diff --git a/.gitignore b/.gitignore index f151b9c24..aac515a31 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.i *.elf *.gba +*.sgm *.1bpp *.4bpp *.8bpp diff --git a/asm/battle_2.s b/asm/battle_2.s new file mode 100644 index 000000000..53b83c10e --- /dev/null +++ b/asm/battle_2.s @@ -0,0 +1,16487 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + + thumb_func_start sub_8036760 +sub_8036760: @ 8036760 + push {lr} + bl MoveSaveBlocks_ResetHeap + bl sub_8056F28 + bl dp11_init + bl init_uns_table_pokemon_copy + bl sub_8185F84 + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080367CC + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _08036798 + bl InitBattle + b _080367BA + .pool +_08036798: + movs r0, 0x80 + lsls r0, 15 + ands r1, r0 + cmp r1, 0 + bne _080367B4 + bl battle_wireless_setup_if_required_maybe + ldr r0, =sub_8037ADC + bl SetMainCallback2 + b _080367BA + .pool +_080367B4: + ldr r0, =intro_end + bl SetMainCallback2 +_080367BA: + ldr r1, =gBattleCommunication + movs r0, 0 + strb r0, [r1] + b _080367D0 + .pool +_080367CC: + bl InitBattle +_080367D0: + pop {r0} + bx r0 + thumb_func_end sub_8036760 + + thumb_func_start InitBattle +InitBattle: @ 80367D4 + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + mov r0, sp + bl CpuSet + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0xF0 + bl SetGpuReg + ldr r1, =0x00005051 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + ldr r0, =gUnknown_02022E24 + movs r2, 0xF0 + strh r2, [r0] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08036870 + ldr r0, =gUnknown_02038BCE + ldrh r1, [r0] + ldr r0, =0x00000c03 + cmp r1, r0 + beq _08036870 + ldr r1, =gUnknown_02022E26 + movs r0, 0x9F + strh r0, [r1] + ldr r0, =gUnknown_02022E28 + strh r2, [r0] + ldr r1, =gUnknown_02022E2A + movs r0, 0x20 + strh r0, [r1] + b _080368BE + .pool +_08036870: + ldr r0, =gUnknown_02022E26 + ldr r2, =0x00005051 + adds r1, r2, 0 + strh r1, [r0] + bl dp12_8087EA4 + ldr r0, =gUnknown_02038C28 + movs r3, 0xF0 + movs r5, 0xF0 + lsls r5, 3 + adds r2, r0, r5 + movs r1, 0x4F +_08036888: + strh r3, [r0] + strh r3, [r2] + adds r2, 0x2 + adds r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08036888 + movs r1, 0x50 + ldr r4, =gUnknown_0831AC70 + ldr r0, =gUnknown_02038C28 + ldr r3, =0x0000ff10 + movs r5, 0x82 + lsls r5, 4 + adds r2, r0, r5 + adds r0, 0xA0 +_080368A6: + strh r3, [r0] + strh r3, [r2] + adds r2, 0x2 + adds r0, 0x2 + adds r1, 0x1 + cmp r1, 0x9F + ble _080368A6 + ldr r0, [r4] + ldr r1, [r4, 0x4] + ldr r2, [r4, 0x8] + bl sub_80BA038 +_080368BE: + bl ResetPaletteFade + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r0, =gUnknown_02022E18 + strh r1, [r0] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + ldr r0, =gUnknown_02022E1C + strh r1, [r0] + ldr r0, =gUnknown_02022E1E + strh r1, [r0] + ldr r0, =gUnknown_02022E20 + strh r1, [r0] + ldr r0, =gUnknown_02022E22 + strh r1, [r0] + bl sub_80B0BD0 + ldr r2, =gUnknown_02022FF0 + strb r0, [r2] + ldr r4, =gBattleTypeFlags + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _080368FE + movs r0, 0x8 + strb r0, [r2] +_080368FE: + bl c2_berry_program_update_menu + bl sub_8035AA4 + bl ResetSpriteData + bl ResetTasks + bl sub_8036154 + bl FreeAllSpritePalettes + ldr r1, =gReservedSpritePaletteCount + movs r0, 0x4 + strb r0, [r1] + ldr r0, =vblank_cb_08078BB4 + bl SetVBlankCallback + bl sub_803269C + ldr r2, [r4] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + beq _0803693E + ldr r1, =0x00400040 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + bne _08036994 +_0803693E: + ldr r0, =sub_8037458 + bl SetMainCallback2 + b _080369AE + .pool +_08036994: + movs r0, 0x40 + ands r2, r0 + cmp r2, 0 + beq _080369A8 + ldr r0, =sub_8037DF4 + bl SetMainCallback2 + b _080369AE + .pool +_080369A8: + ldr r0, =sub_8036FAC + bl SetMainCallback2 +_080369AE: + ldr r5, =gBattleTypeFlags + ldr r0, [r5] + ldr r1, =0x01000002 + ands r0, r1 + cmp r0, 0 + bne _080369E8 + ldr r4, =gEnemyParty + ldr r0, =gTrainerBattleOpponent_A + ldrh r1, [r0] + adds r0, r4, 0 + movs r2, 0x1 + bl CreateNPCTrainerParty + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _080369E4 + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + ldr r1, =gTrainerBattleOpponent_B + ldrh r1, [r1] + movs r2, 0 + bl CreateNPCTrainerParty +_080369E4: + bl SetWildMonHeldItem +_080369E8: + ldr r1, =gMain + ldr r2, =0x00000439 + adds r1, r2 + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r5, =0x00000ca9 + adds r1, r5 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, =gPlayerParty + movs r0, 0xFA + lsls r0, 1 + adds r5, r4, r0 +_08036A10: + adds r0, r4, 0 + movs r1, 0x3 + bl AdjustFriendship + adds r4, 0x64 + cmp r4, r5 + ble _08036A10 + movs r1, 0 + ldr r0, =gBattleCommunication + strb r1, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end InitBattle + + thumb_func_start sub_8036A5C +sub_8036A5C: @ 8036A5C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r6, 0 + mov r9, r6 + movs r0, 0xCE + lsls r0, 1 + mov r10, r0 + mov r8, r6 +_08036A72: + movs r0, 0x64 + mov r4, r9 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData + adds r1, r0, 0 + cmp r5, 0 + beq _08036AEE + cmp r5, r10 + beq _08036ABA + cmp r7, 0 + beq _08036ABA + cmp r1, 0 + bne _08036ABA + movs r0, 0x1 + mov r2, r8 + lsls r0, r2 + orrs r6, r0 + lsls r0, r6, 16 + lsrs r6, r0, 16 +_08036ABA: + cmp r5, 0 + beq _08036AEE + cmp r7, 0 + beq _08036AD6 + cmp r5, r10 + beq _08036ACA + cmp r1, 0 + beq _08036AD6 +_08036ACA: + movs r0, 0x2 + mov r1, r8 + lsls r0, r1 + orrs r6, r0 + lsls r0, r6, 16 + lsrs r6, r0, 16 +_08036AD6: + cmp r5, 0 + beq _08036AEE + cmp r5, r10 + beq _08036AEE + cmp r7, 0 + bne _08036AEE + movs r0, 0x3 + mov r2, r8 + lsls r0, r2 + orrs r6, r0 + lsls r0, r6, 16 + lsrs r6, r0, 16 +_08036AEE: + movs r0, 0x2 + add r8, r0 + movs r1, 0x1 + add r9, r1 + mov r2, r9 + cmp r2, 0x5 + ble _08036A72 + ldr r4, =gBattleStruct + ldr r0, [r4] + movs r1, 0xC1 + lsls r1, 1 + adds r0, r1 + strb r6, [r0] + ldr r0, [r4] + ldr r5, =0x00000183 + adds r0, r5 + lsrs r1, r6, 8 + strb r1, [r0] + ldr r0, =0x000008d2 + bl FlagGet + ldr r1, [r4] + adds r1, r5 + lsls r0, 7 + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8036A5C + + thumb_func_start sub_8036B44 +sub_8036B44: @ 8036B44 + push {r4-r7,lr} + ldr r0, =gBattleStruct + ldr r5, [r0] + movs r0, 0xC2 + lsls r0, 1 + adds r4, r5, r0 + bl sub_80E162C + cmp r0, 0x1 + bne _08036BC0 + movs r2, 0 + ldr r7, =gSaveBlock1Ptr + movs r1, 0xC6 + lsls r1, 1 + adds r5, r1 + adds r6, r7, 0 + ldr r3, =0x000031f8 +_08036B66: + adds r0, r4, r2 + ldr r1, [r6] + adds r1, r3 + adds r1, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x5 + ble _08036B66 + adds r1, r4, r2 + movs r0, 0xFF + strb r0, [r1] + movs r2, 0 + adds r3, r5, 0 + ldr r6, =gSaveBlock1Ptr + ldr r5, =0x00003214 +_08036B86: + adds r0, r3, r2 + ldr r1, [r6] + adds r1, r5 + adds r1, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x11 + ble _08036B86 + ldr r0, [r7] + ldr r1, =0x00003226 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4, 0x7] + ldr r0, [r7] + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + b _08036C00 + .pool +_08036BC0: + movs r0, 0xAF + bl ItemIdToBerryType + lsls r0, 24 + lsrs r0, 24 + bl GetBerryInfo + adds r3, r0, 0 + movs r2, 0 + movs r0, 0xC6 + lsls r0, 1 + adds r5, r0 +_08036BD8: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x5 + ble _08036BD8 + adds r1, r4, r2 + movs r0, 0xFF + strb r0, [r1] + adds r0, r5, 0 + movs r2, 0 + adds r1, r0, 0 + adds r1, 0x11 +_08036BF4: + strb r2, [r1] + subs r1, 0x1 + cmp r1, r0 + bge _08036BF4 + movs r0, 0 + strb r0, [r4, 0x7] +_08036C00: + strb r0, [r4, 0x1A] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8036B44 + + thumb_func_start berry_801017C +berry_801017C: @ 8036C08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08036C20 + b _08036D4C +_08036C20: + bl sub_80E162C + cmp r0, 0x1 + bne _08036CDC + movs r5, 0 + ldr r3, =gEnigmaBerries + ldr r0, =gSaveBlock1Ptr + mov r8, r0 + adds r6, r3, 0 + mov r4, r8 + ldr r2, =0x000031f8 + adds r7, r3, 0 + adds r7, 0x38 +_08036C3A: + adds r1, r5, r6 + ldr r0, [r4] + adds r0, r2 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r5, r7 + ldr r0, [r4] + adds r0, r2 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x5 + ble _08036C3A + adds r1, r5, r3 + movs r0, 0xFF + strb r0, [r1] + adds r0, r3, 0 + adds r0, 0x38 + adds r0, r5, r0 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + movs r5, 0 + adds r7, r3, 0 + adds r7, 0x8 + ldr r4, =gSaveBlock1Ptr + ldr r2, =0x00003214 + adds r6, r3, 0 + adds r6, 0x40 +_08036C78: + adds r1, r5, r7 + ldr r0, [r4] + adds r0, r2 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r5, r6 + ldr r0, [r4] + adds r0, r2 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x11 + ble _08036C78 + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00003226 + adds r0, r2 + ldrb r1, [r0] + strb r1, [r3, 0x7] + ldrb r0, [r0] + adds r1, r3, 0 + adds r1, 0x3F + strb r0, [r1] + mov r4, r8 + ldr r0, [r4] + ldr r1, =0x00003227 + adds r0, r1 + ldrb r1, [r0] + strb r1, [r3, 0x1A] + ldrb r1, [r0] + adds r0, r3, 0 + adds r0, 0x52 + strb r1, [r0] + b _08036EA0 + .pool +_08036CDC: + movs r0, 0xAF + bl ItemIdToBerryType + lsls r0, 24 + lsrs r0, 24 + bl GetBerryInfo + adds r6, r0, 0 + movs r5, 0 + ldr r4, =gEnigmaBerries + adds r7, r4, 0 + adds r7, 0x38 + adds r3, r4, 0 +_08036CF6: + adds r1, r5, r4 + adds r2, r6, r5 + ldrb r0, [r2] + strb r0, [r1] + adds r1, r5, r7 + ldrb r0, [r2] + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x5 + ble _08036CF6 + adds r1, r5, r3 + movs r0, 0xFF + strb r0, [r1] + adds r0, r3, 0 + adds r0, 0x38 + adds r0, r5, r0 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + movs r5, 0 + adds r4, r3, 0 + adds r4, 0x8 + movs r1, 0 + adds r2, r3, 0 + adds r2, 0x40 +_08036D28: + adds r0, r5, r4 + strb r1, [r0] + adds r0, r5, r2 + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x11 + ble _08036D28 + movs r1, 0 + strb r1, [r3, 0x7] + adds r0, r3, 0 + adds r0, 0x3F + strb r1, [r0] + strb r1, [r3, 0x1A] + adds r0, 0x13 + strb r1, [r0] + b _08036EA0 + .pool +_08036D4C: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08036DF0 + movs r0, 0x80 + lsls r0, 1 + ands r1, r0 + movs r2, 0x4 + mov r8, r2 + cmp r1, 0 + beq _08036D66 + movs r4, 0x2 + mov r8, r4 +_08036D66: + movs r5, 0 + cmp r5, r8 + blt _08036D6E + b _08036EA0 +_08036D6E: + ldr r0, =gLinkPlayers + mov r12, r0 + ldr r3, =gEnigmaBerries + adds r6, r3, 0 + movs r1, 0x8 + adds r1, r6 + mov r9, r1 +_08036D7C: + lsls r1, r5, 8 + ldr r0, =gUnknown_020223C8 + adds r7, r1, r0 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r12 + ldrb r3, [r0, 0x18] + movs r4, 0 + adds r5, 0x1 + mov r10, r5 + lsls r1, r3, 3 + subs r0, r1, r3 + adds r5, r1, 0 + lsls r0, 2 + adds r1, r0, r6 +_08036D9C: + adds r0, r7, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r1, 0x1 + adds r4, 0x1 + cmp r4, 0x5 + ble _08036D9C + subs r0, r5, r3 + lsls r0, 2 + adds r1, r4, r0 + adds r1, r6 + movs r2, 0xFF + strb r2, [r1] + movs r4, 0 + mov r2, r9 + adds r1, r0, r2 + adds r2, r7, 0 + adds r2, 0x8 +_08036DC0: + adds r0, r2, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r1, 0x1 + adds r4, 0x1 + cmp r4, 0x11 + ble _08036DC0 + subs r0, r5, r3 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r7, 0x7] + strb r1, [r0, 0x7] + ldrb r1, [r7, 0x1A] + strb r1, [r0, 0x1A] + mov r5, r10 + cmp r5, r8 + blt _08036D7C + b _08036EA0 + .pool +_08036DF0: + movs r5, 0 + ldr r4, =gEnigmaBerries + mov r9, r4 +_08036DF6: + lsls r0, r5, 8 + ldr r1, =gUnknown_020223C8 + adds r7, r0, r1 + movs r4, 0 + adds r2, r5, 0x1 + mov r10, r2 + lsls r0, r5, 3 + mov r8, r0 + adds r1, r5, 0x2 + mov r12, r1 + subs r1, r0, r5 + mov r2, r12 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + mov r2, r9 + adds r3, r0, r2 + lsls r1, 2 + adds r2, r1, r2 +_08036E1C: + adds r0, r7, r4 + ldrb r1, [r0] + strb r1, [r2] + ldrb r0, [r0] + strb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + adds r4, 0x1 + cmp r4, 0x5 + ble _08036E1C + mov r0, r8 + subs r3, r0, r5 + lsls r3, 2 + adds r1, r4, r3 + add r1, r9 + ldrb r0, [r1] + movs r2, 0xFF + orrs r0, r2 + strb r0, [r1] + mov r0, r12 + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r1, r4, r2 + add r1, r9 + ldrb r0, [r1] + movs r4, 0xFF + orrs r0, r4 + strb r0, [r1] + movs r4, 0 + ldr r0, =gEnigmaBerries + adds r0, 0x8 + adds r2, r0 + adds r3, r0 + adds r6, r7, 0 + adds r6, 0x8 +_08036E64: + adds r0, r6, r4 + ldrb r1, [r0] + strb r1, [r3] + ldrb r0, [r0] + strb r0, [r2] + adds r2, 0x1 + adds r3, 0x1 + adds r4, 0x1 + cmp r4, 0x11 + ble _08036E64 + mov r0, r8 + subs r2, r0, r5 + lsls r2, 2 + add r2, r9 + ldrb r0, [r7, 0x7] + strb r0, [r2, 0x7] + mov r1, r12 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r9 + ldrb r1, [r7, 0x7] + strb r1, [r0, 0x7] + ldrb r1, [r7, 0x1A] + strb r1, [r2, 0x1A] + ldrb r1, [r7, 0x1A] + strb r1, [r0, 0x1A] + mov r5, r10 + cmp r5, 0x1 + ble _08036DF6 +_08036EA0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end berry_801017C + + thumb_func_start sub_8036EB8 +sub_8036EB8: @ 8036EB8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + movs r6, 0 + ldr r0, =gUnknown_020223C4 + ldrh r2, [r0] + movs r1, 0x80 + lsls r1, 1 + mov r12, r0 + cmp r2, r1 + bne _08036EFC + cmp r3, 0 + bne _08036EEC + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r2, 0xC + b _08036EF2 + .pool +_08036EEC: + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r2, 0x8 +_08036EF2: + orrs r1, r2 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08036EFC: + cmp r6, 0 + bne _08036FA0 + movs r2, 0 + cmp r2, r4 + bge _08036F20 + ldr r1, =gUnknown_020223C4 + mov r8, r1 + movs r5, 0x80 + lsls r5, 1 +_08036F0E: + adds r1, r5 + adds r2, 0x1 + cmp r2, r4 + bge _08036F20 + mov r7, r8 + ldrh r0, [r7] + ldrh r7, [r1] + cmp r0, r7 + beq _08036F0E +_08036F20: + cmp r2, r4 + bne _08036F48 + cmp r3, 0 + bne _08036F38 + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r2, 0xC + b _08036F3E + .pool +_08036F38: + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r2, 0x8 +_08036F3E: + orrs r1, r2 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08036F48: + cmp r6, 0 + bne _08036FA0 + movs r2, 0 + ldr r5, =gBattleTypeFlags + cmp r2, r4 + bge _08036F8A + mov r0, r12 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 2 + cmp r1, r0 + beq _08036F82 +_08036F60: + lsls r0, r2, 8 + add r0, r12 + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 2 + cmp r0, r1 + bls _08036F72 + cmp r2, r3 + bne _08036F8A +_08036F72: + adds r2, 0x1 + cmp r2, r4 + bge _08036F8A + lsls r0, r2, 8 + add r0, r12 + ldrh r0, [r0] + cmp r0, r1 + bne _08036F60 +_08036F82: + cmp r2, r3 + beq _08036F60 + cmp r2, r3 + bge _08036F60 +_08036F8A: + cmp r2, r4 + bne _08036F98 + ldr r0, [r5] + movs r1, 0xC + b _08036F9C + .pool +_08036F98: + ldr r0, [r5] + movs r1, 0x8 +_08036F9C: + orrs r0, r1 + str r0, [r5] +_08036FA0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8036EB8 + + thumb_func_start sub_8036FAC +sub_8036FAC: @ 8036FAC + push {r4-r6,lr} + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl GetMultiplayerId + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gBattleScripting + adds r0, 0x25 + strb r6, [r0] + movs r0, 0x1 + adds r5, r6, 0 + eors r5, r0 + ldr r0, =gBattleCommunication + ldrb r0, [r0] + cmp r0, 0x12 + bls _08036FD8 + b _0803744C +_08036FD8: + lsls r0, 2 + ldr r1, =_08036FF0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08036FF0: + .4byte _0803703C + .4byte _08037080 + .4byte _08037144 + .4byte _080371D8 + .4byte _08037200 + .4byte _0803742C + .4byte _08037438 + .4byte _08037230 + .4byte _08037258 + .4byte _0803742C + .4byte _08037438 + .4byte _08037288 + .4byte _080372B0 + .4byte _0803742C + .4byte _08037438 + .4byte _08037318 + .4byte _08037378 + .4byte _080373A0 + .4byte _080373E0 +_0803703C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08037068 + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + bl sub_805EF14 + ldr r1, =gBattleCommunication + movs r0, 0x1 + strb r0, [r1] +_08037068: + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + bne _08037072 + b _0803744C +_08037072: + bl sub_800E0E8 + b _0803744C + .pool +_08037080: + ldr r2, =gBattleTypeFlags + ldr r1, [r2] + movs r6, 0x2 + adds r0, r1, 0 + ands r0, r6 + cmp r0, 0 + beq _08037124 + ldr r0, =gUnknown_03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08037098 + b _0803744C +_08037098: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080370EE + ldr r4, =gBattleStruct + ldr r0, [r4] + movs r5, 0xC0 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, =0x00000181 + adds r1, r0, r2 + movs r0, 0x3 + strb r0, [r1] + bl sub_8036A5C + bl sub_8036B44 + ldr r0, =gTrainerBattleOpponent_A + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _080370D8 + ldr r0, =gLinkPlayers + movs r1, 0 + strh r1, [r0, 0x18] + movs r1, 0x1 + strh r1, [r0, 0x34] +_080370D8: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + adds r1, r5 + movs r2, 0x20 + bl link_0800A448 + ldr r0, =gBattleCommunication + strb r6, [r0] +_080370EE: + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + bne _080370F8 + b _0803744C +_080370F8: + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _0803744C + .pool +_08037124: + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _08037134 + movs r0, 0x4 + orrs r1, r0 + str r1, [r2] +_08037134: + ldr r1, =gBattleCommunication + movs r0, 0xF + strb r0, [r1] + bl berry_801017C + b _0803744C + .pool +_08037144: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037152 + b _0803744C +_08037152: + bl sub_800A5B4 + movs r0, 0x2 + adds r1, r6, 0 + bl sub_8036EB8 + bl berry_801017C + ldr r0, =task00_0800F6FC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gTasks + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r1 + movs r1, 0 + movs r0, 0x87 + lsls r0, 1 + strh r0, [r2, 0xA] + movs r0, 0x5A + strh r0, [r2, 0xC] + strh r1, [r2, 0x12] + ldr r0, =gBattleStruct + ldr r3, [r0] + movs r4, 0xC1 + lsls r4, 1 + adds r0, r3, r4 + ldrb r1, [r0] + adds r4, 0x1 + adds r0, r3, r4 + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + strh r1, [r2, 0xE] + ldr r1, =gUnknown_020223C4 + lsls r4, r5, 8 + adds r1, 0x2 + adds r4, r1 + ldrh r0, [r4] + strh r0, [r2, 0x10] + lsls r0, r6, 8 + adds r0, r1 + ldrh r0, [r0] + bl sub_8185F90 + ldrh r0, [r4] + bl sub_8185F90 + bl sub_8068AA4 + ldr r1, =gBattleCommunication + b _08037446 + .pool +_080371D8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080371E4 + b _0803744C +_080371E4: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gPlayerParty + movs r2, 0xC8 + bl link_0800A448 + ldr r1, =gBattleCommunication + b _08037446 + .pool +_08037200: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _0803720E + b _0803744C +_0803720E: + bl sub_800A5B4 + ldr r0, =gEnemyParty + lsls r1, r5, 8 + ldr r2, =gUnknown_020223C4 + adds r1, r2 + movs r2, 0xC8 + bl memcpy + ldr r1, =gBattleCommunication + b _08037446 + .pool +_08037230: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0803723C + b _0803744C +_0803723C: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gPlayerParty + 200 + movs r2, 0xC8 + bl link_0800A448 + ldr r1, =gBattleCommunication + b _08037446 + .pool +_08037258: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037266 + b _0803744C +_08037266: + bl sub_800A5B4 + ldr r0, =gEnemyParty + 200 + lsls r1, r5, 8 + ldr r2, =gUnknown_020223C4 + adds r1, r2 + movs r2, 0xC8 + bl memcpy + ldr r1, =gBattleCommunication + b _08037446 + .pool +_08037288: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08037294 + b _0803744C +_08037294: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gPlayerParty + 400 + movs r2, 0xC8 + bl link_0800A448 + ldr r1, =gBattleCommunication + b _08037446 + .pool +_080372B0: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _080372BE + b _0803744C +_080372BE: + bl sub_800A5B4 + ldr r4, =gEnemyParty + 400 + lsls r1, r5, 8 + ldr r0, =gUnknown_020223C4 + adds r1, r0 + adds r0, r4, 0 + movs r2, 0xC8 + bl memcpy + ldr r1, =0xfffffe70 + adds r0, r4, r1 + bl shedinja_something + ldr r2, =0xfffffed4 + adds r0, r4, r2 + bl shedinja_something + adds r0, r4, 0 + subs r0, 0xC8 + bl shedinja_something + adds r0, r4, 0 + subs r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + ldr r1, =gBattleCommunication + b _08037446 + .pool +_08037318: + bl sub_8032768 + bl sub_8184E58 + ldr r2, =gBattleCommunication + movs r0, 0 + strb r0, [r2, 0x1] + strb r0, [r2, 0x2] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08037372 + movs r3, 0 + ldr r1, =gLinkPlayers + ldrb r0, [r1] + adds r5, r2, 0 + cmp r0, 0x3 + bne _08037356 + movs r4, 0xFF + adds r2, r1, 0 +_08037344: + adds r2, 0x1C + adds r3, 0x1 + cmp r3, 0x1 + bgt _08037356 + ldrh r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x3 + beq _08037344 +_08037356: + cmp r3, 0x2 + bne _0803736C + movs r0, 0x10 + strb r0, [r5] + b _0803744C + .pool +_0803736C: + movs r0, 0x12 + strb r0, [r5] + b _0803744C +_08037372: + movs r0, 0x12 + strb r0, [r2] + b _0803744C +_08037378: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0803744C + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203BD2C + movs r2, 0x4 + bl link_0800A448 + ldr r1, =gBattleCommunication + b _08037446 + .pool +_080373A0: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + bne _0803744C + bl sub_800A5B4 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080373CA + ldr r0, =gUnknown_0203BD2C + lsls r1, r5, 8 + ldr r2, =gUnknown_020223C4 + adds r1, r2 + movs r2, 0x4 + bl memcpy +_080373CA: + ldr r1, =gBattleCommunication + b _08037446 + .pool +_080373E0: + ldr r0, =gUnknown_02024333 + adds r1, r0, 0x1 + bl battle_load_something + lsls r0, 24 + cmp r0, 0 + beq _0803744C + ldr r2, =gUnknown_03005D00 + ldr r1, =gMain + ldr r0, [r1] + str r0, [r2] + ldr r0, =sub_8039EF0 + str r0, [r1] + ldr r0, =sub_8038420 + bl SetMainCallback2 + ldr r2, =gBattleTypeFlags + ldr r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803744C + movs r0, 0x20 + orrs r1, r0 + str r1, [r2] + b _0803744C + .pool +_0803742C: + ldr r0, =gBattleCommunication + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + movs r1, 0x1 + strb r1, [r0, 0x1] +_08037438: + ldr r1, =gBattleCommunication + ldrb r0, [r1, 0x1] + subs r0, 0x1 + strb r0, [r1, 0x1] + lsls r0, 24 + cmp r0, 0 + bne _0803744C +_08037446: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0803744C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8036FAC + + thumb_func_start sub_8037458 +sub_8037458: @ 8037458 + push {r4-r7,lr} + sub sp, 0x4 + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl GetMultiplayerId + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gBattleScripting + adds r0, 0x25 + strb r6, [r0] + movs r0, 0x1 + adds r7, r6, 0 + eors r7, r0 + ldr r0, =gBattleCommunication + ldrb r0, [r0] + cmp r0, 0x10 + bls _08037486 + b _080379D6 +_08037486: + lsls r0, 2 + ldr r1, =_0803749C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803749C: + .4byte _080374E0 + .4byte _08037518 + .4byte _0803761C + .4byte _08037670 + .4byte _08037694 + .4byte _08037710 + .4byte _08037734 + .4byte _080377B0 + .4byte _080377CC + .4byte _080377FC + .4byte _08037818 + .4byte _08037848 + .4byte _08037864 + .4byte _08037908 + .4byte _0803793A + .4byte _0803795C + .4byte _080379A0 +_080374E0: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0803750C + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + bl sub_805EF14 + ldr r1, =gBattleCommunication + movs r0, 0x1 + strb r0, [r1] +_0803750C: + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + beq _08037518 + bl sub_800E0E8 +_08037518: + ldr r2, =gBattleTypeFlags + ldr r1, [r2] + movs r3, 0x2 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _080375FC + ldr r0, =gUnknown_03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08037530 + b _080379D6 +_08037530: + ldr r6, =gLinkPlayers + movs r0, 0 + strh r0, [r6, 0x18] + strh r3, [r6, 0x34] + adds r1, r6, 0 + adds r1, 0x50 + movs r0, 0x1 + strh r0, [r1] + adds r1, 0x1C + movs r0, 0x3 + strh r0, [r1] + adds r0, r6, 0 + adds r0, 0x40 + ldr r4, =gTrainerBattleOpponent_A + ldrh r1, [r4] + bl sub_8162E20 + adds r0, r6, 0 + adds r0, 0x5C + ldr r5, =gTrainerBattleOpponent_B + ldrh r1, [r5] + bl sub_8162E20 + ldrh r1, [r4] + mov r0, sp + bl sub_8165B88 + mov r0, sp + ldrb r0, [r0] + adds r1, r6, 0 + adds r1, 0x52 + strh r0, [r1] + ldrh r1, [r5] + mov r0, sp + bl sub_8165B88 + mov r0, sp + ldrb r1, [r0] + adds r0, r6, 0 + adds r0, 0x6E + strh r1, [r0] + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080375C4 + ldr r4, =gBattleStruct + ldr r0, [r4] + movs r5, 0xC0 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, =0x00000181 + adds r1, r0, r2 + movs r0, 0x3 + strb r0, [r1] + bl sub_8036A5C + bl sub_8036B44 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + adds r1, r5 + movs r2, 0x20 + bl link_0800A448 + ldr r1, =gBattleCommunication + movs r0, 0x2 + strb r0, [r1] +_080375C4: + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + bne _080375CE + b _080379D6 +_080375CE: + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _080379D6 + .pool +_080375FC: + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _0803760C + movs r0, 0x4 + orrs r1, r0 + str r1, [r2] +_0803760C: + ldr r1, =gBattleCommunication + movs r0, 0xD + strb r0, [r1] + bl berry_801017C + b _080379D6 + .pool +_0803761C: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _0803762A + b _080379D6 +_0803762A: + bl sub_800A5B4 + movs r0, 0x2 + adds r1, r6, 0 + bl sub_8036EB8 + bl berry_801017C + ldr r0, =task00_0800F6FC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + movs r0, 0x87 + lsls r0, 1 + strh r0, [r1, 0xA] + movs r0, 0x5A + strh r0, [r1, 0xC] + strh r2, [r1, 0x12] + adds r0, 0xEB + strh r0, [r1, 0xE] + strh r0, [r1, 0x10] + b _08037986 + .pool +_08037670: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0803767C + b _080379D6 +_0803767C: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gPlayerParty +_08037686: + movs r2, 0xC8 + bl link_0800A448 + b _08037986 + .pool +_08037694: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _080376A2 + b _080379D6 +_080376A2: + bl sub_800A5B4 + ldr r0, =gLinkPlayers + lsls r1, r6, 3 + subs r1, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x18] + cmp r0, 0 + beq _080376E8 + ldr r4, =gPlayerParty + lsls r1, r7, 8 + ldr r5, =gUnknown_020223C4 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0xC8 + bl memcpy + movs r0, 0x96 + lsls r0, 1 + adds r4, r0 + lsls r1, r6, 8 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0xC8 + bl memcpy + b _08037986 + .pool +_080376E8: + ldr r4, =gPlayerParty + lsls r1, r6, 8 + ldr r5, =gUnknown_020223C4 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0xC8 + bl memcpy + movs r1, 0x96 + lsls r1, 1 + adds r4, r1 + lsls r1, r7, 8 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0xC8 + b _08037982 + .pool +_08037710: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0803771C + b _080379D6 +_0803771C: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gPlayerParty + 200 + movs r2, 0x64 + bl link_0800A448 + b _08037986 + .pool +_08037734: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037742 + b _080379D6 +_08037742: + bl sub_800A5B4 + ldr r0, =gLinkPlayers + lsls r1, r6, 3 + subs r1, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x18] + cmp r0, 0 + beq _08037788 + ldr r4, =gPlayerParty + 200 + lsls r1, r7, 8 + ldr r5, =gUnknown_020223C4 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + movs r2, 0x96 + lsls r2, 1 + adds r4, r2 + lsls r1, r6, 8 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + b _08037986 + .pool +_08037788: + ldr r4, =gPlayerParty + 200 + lsls r1, r6, 8 + ldr r5, =gUnknown_020223C4 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + movs r0, 0x96 + lsls r0, 1 + adds r4, r0 + lsls r1, r7, 8 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x64 + b _08037982 + .pool +_080377B0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080377BC + b _080379D6 +_080377BC: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gEnemyParty + b _08037686 + .pool +_080377CC: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _080377DA + b _080379D6 +_080377DA: + bl sub_800A5B4 + bl GetMultiplayerId + lsls r0, 24 + cmp r0, 0 + bne _080377EA + b _08037986 +_080377EA: + ldr r0, =gEnemyParty + ldr r1, =gUnknown_020223C4 + movs r2, 0xC8 + b _08037982 + .pool +_080377FC: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08037808 + b _080379D6 +_08037808: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gEnemyParty + 200 + b _08037686 + .pool +_08037818: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037826 + b _080379D6 +_08037826: + bl sub_800A5B4 + bl GetMultiplayerId + lsls r0, 24 + cmp r0, 0 + bne _08037836 + b _08037986 +_08037836: + ldr r0, =gEnemyParty + 200 + ldr r1, =gUnknown_020223C4 + movs r2, 0xC8 + b _08037982 + .pool +_08037848: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08037854 + b _080379D6 +_08037854: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gEnemyParty + 400 + b _08037686 + .pool +_08037864: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037872 + b _080379D6 +_08037872: + bl sub_800A5B4 + bl GetMultiplayerId + lsls r0, 24 + cmp r0, 0 + beq _0803788A + ldr r0, =gEnemyParty + 400 + ldr r1, =gUnknown_020223C4 + movs r2, 0xC8 + bl memcpy +_0803788A: + ldr r4, =gPlayerParty + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0xC8 + bl shedinja_something + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + movs r2, 0xC8 + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + movs r1, 0xFA + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + ldr r4, =gEnemyParty + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0xC8 + bl shedinja_something + movs r2, 0x96 + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + movs r1, 0xC8 + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + movs r2, 0xFA + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + b _08037986 + .pool +_08037908: + bl sub_8032768 + bl sub_8184E58 + ldr r2, =gBattleCommunication + movs r0, 0 + strb r0, [r2, 0x1] + strb r0, [r2, 0x2] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08037934 + movs r0, 0xE + strb r0, [r2] + b _080379D6 + .pool +_08037934: + movs r0, 0x10 + strb r0, [r2] + b _080379D6 +_0803793A: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080379D6 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203BD2C + movs r2, 0x4 + bl link_0800A448 + b _08037986 + .pool +_0803795C: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + bne _080379D6 + bl sub_800A5B4 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08037986 + ldr r0, =gUnknown_0203BD2C + lsls r1, r7, 8 + ldr r2, =gUnknown_020223C4 + adds r1, r2 + movs r2, 0x4 +_08037982: + bl memcpy +_08037986: + ldr r1, =gBattleCommunication + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080379D6 + .pool +_080379A0: + ldr r0, =gUnknown_02024333 + adds r1, r0, 0x1 + bl battle_load_something + lsls r0, 24 + cmp r0, 0 + beq _080379D6 + bl sub_8166188 + ldr r2, =gUnknown_03005D00 + ldr r1, =gMain + ldr r0, [r1] + str r0, [r2] + ldr r0, =sub_8039EF0 + str r0, [r1] + ldr r0, =sub_8038420 + bl SetMainCallback2 + ldr r2, =gBattleTypeFlags + ldr r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080379D6 + movs r0, 0x20 + orrs r1, r0 + str r1, [r2] +_080379D6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8037458 + + thumb_func_start sub_80379F8 +sub_80379F8: @ 80379F8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + mov r8, r0 + ldr r6, =gUnknown_02022FF8 + mov r10, r6 +_08037A12: + ldr r1, [sp] + add r1, r8 + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + mov r1, r8 + lsls r5, r1, 5 + strh r0, [r6] + adds r0, r4, 0 + movs r1, 0xC + bl GetMonData + strh r0, [r6, 0x2] + movs r0, 0x4 + add r0, r10 + mov r9, r0 + adds r7, r5, r0 + adds r0, r4, 0 + movs r1, 0x2 + adds r2, r7, 0 + bl GetMonData + adds r0, r4, 0 + movs r1, 0x38 + bl GetMonData + strb r0, [r6, 0xF] + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + strh r0, [r6, 0x10] + adds r0, r4, 0 + movs r1, 0x3A + bl GetMonData + strh r0, [r6, 0x12] + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData + mov r1, r10 + adds r1, 0x14 + adds r5, r1 + str r0, [r5] + adds r0, r4, 0 + movs r1, 0 + bl GetMonData + str r0, [r6, 0x18] + adds r0, r4, 0 + bl GetMonGender + strb r0, [r6, 0x1C] + adds r0, r7, 0 + bl StripExtCtrlCodes + adds r0, r4, 0 + movs r1, 0x3 + bl GetMonData + cmp r0, 0x1 + beq _08037AA4 + adds r0, r7, 0 + movs r1, 0 + bl sub_81DB4DC +_08037AA4: + adds r6, 0x20 + movs r1, 0x1 + add r8, r1 + mov r0, r8 + cmp r0, 0x2 + ble _08037A12 + ldr r0, =gUnknown_02023058 + ldr r0, [r0] + mov r1, r9 + subs r1, 0x4 + movs r2, 0x60 + bl memcpy + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80379F8 + + thumb_func_start sub_8037ADC +sub_8037ADC: @ 8037ADC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0x4 + mov r9, r0 + movs r4, 0xF + ldr r6, =gBattleTypeFlags + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + cmp r0, 0 + beq _08037B02 + movs r1, 0x2 + mov r9, r1 + movs r4, 0x3 +_08037B02: + bl GetMultiplayerId + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gBattleScripting + adds r0, 0x25 + movs r2, 0 + mov r8, r2 + strb r7, [r0] + ldr r0, =gBattleStruct + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xB4 + str r1, [sp] + adds r0, 0xAC + mov r10, r0 + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + ldr r5, =gBattleCommunication + ldrb r0, [r5] + cmp r0, 0x1 + beq _08037BA4 + cmp r0, 0x1 + bgt _08037B50 + cmp r0, 0 + beq _08037B5E + b _08037D0A + .pool +_08037B50: + cmp r0, 0x2 + bne _08037B56 + b _08037C64 +_08037B56: + cmp r0, 0x3 + bne _08037B5C + b _08037C9E +_08037B5C: + b _08037D0A +_08037B5E: + ldr r0, =gUnknown_03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08037B68 + b _08037D0A +_08037B68: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08037B74 + b _08037D0A +_08037B74: + ldr r4, =gUnknown_02023058 + movs r0, 0x60 + bl Alloc + str r0, [r4] + movs r0, 0 + bl sub_80379F8 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + movs r2, 0x60 + bl link_0800A448 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _08037D0A + .pool +_08037BA4: + bl sub_800A550 + adds r1, r4, 0 + ands r1, r0 + cmp r1, r4 + beq _08037BB2 + b _08037D0A +_08037BB2: + bl sub_800A5B4 + movs r5, 0 + cmp r8, r9 + bge _08037C2E + lsls r0, r7, 3 + subs r0, r7 + lsls r6, r0, 2 + mov r8, r5 + ldr r4, =gUnknown_020223C4 +_08037BC6: + cmp r5, r7 + beq _08037C1E + mov r2, r9 + cmp r2, 0x4 + bne _08037C14 + ldr r2, =gLinkPlayers + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _08037BF8 + adds r0, r6, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08037C04 + b _08037C1E + .pool +_08037BF8: + adds r0, r6, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08037C1E +_08037C04: + ldr r0, =gUnknown_02022FF8 + adds r1, r4, 0 + movs r2, 0x60 + bl memcpy + b _08037C1E + .pool +_08037C14: + ldr r0, =gUnknown_02022FF8 + adds r1, r4, 0 + movs r2, 0x60 + bl memcpy +_08037C1E: + movs r2, 0x80 + lsls r2, 1 + adds r4, r2 + movs r0, 0x1C + add r8, r0 + adds r5, 0x1 + cmp r5, r9 + blt _08037BC6 +_08037C2E: + ldr r1, =gBattleCommunication + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =gMain + ldr r0, [r1, 0x8] + ldr r2, [sp] + str r0, [r2] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + mov r2, r10 + str r0, [r2] + ldr r0, =sub_8037ADC + str r0, [r1, 0x8] + bl sub_81B9150 + b _08037D0A + .pool +_08037C64: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08037D0A + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08037D0A + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + beq _08037C98 + bl sub_800ADF8 + b _08037D0A + .pool +_08037C98: + bl sub_800AC34 + b _08037D0A +_08037C9E: + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + beq _08037CE4 + bl sub_8010500 + lsls r0, 24 + cmp r0, 0 + beq _08037D0A + mov r1, r10 + ldr r0, [r1] + str r0, [r6] + ldr r1, =gMain + ldr r2, [sp] + ldr r0, [r2] + str r0, [r1, 0x8] + ldr r0, =InitBattle + bl SetMainCallback2 + ldr r4, =gUnknown_02023058 + ldr r0, [r4] + bl Free + mov r0, r8 + str r0, [r4] + b _08037D0A + .pool +_08037CE4: + ldr r0, =gUnknown_03003124 + ldrb r5, [r0] + cmp r5, 0 + bne _08037D0A + mov r1, r10 + ldr r0, [r1] + str r0, [r6] + ldr r1, =gMain + ldr r2, [sp] + ldr r0, [r2] + str r0, [r1, 0x8] + ldr r0, =InitBattle + bl SetMainCallback2 + ldr r4, =gUnknown_02023058 + ldr r0, [r4] + bl Free + str r5, [r4] +_08037D0A: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8037ADC + + thumb_func_start intro_end +intro_end: @ 8037D2C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gBattleStruct + ldr r0, [r0] + movs r1, 0xB4 + adds r1, r0 + mov r8, r1 + adds r7, r0, 0 + adds r7, 0xAC + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + ldr r5, =gBattleCommunication + ldrb r0, [r5] + cmp r0, 0 + beq _08037D64 + cmp r0, 0x1 + beq _08037DA4 + b _08037DD6 + .pool +_08037D64: + ldr r4, =gUnknown_02023058 + movs r0, 0x60 + bl Alloc + str r0, [r4] + movs r0, 0x3 + bl sub_80379F8 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r1, =gMain + ldr r0, [r1, 0x8] + mov r2, r8 + str r0, [r2] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + str r0, [r7] + ldr r0, =intro_end + str r0, [r1, 0x8] + bl sub_81B9150 + b _08037DD6 + .pool +_08037DA4: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08037DD6 + movs r0, 0x2 + strb r0, [r5] + ldr r1, =gBattleTypeFlags + ldr r0, [r7] + str r0, [r1] + ldr r1, =gMain + mov r2, r8 + ldr r0, [r2] + str r0, [r1, 0x8] + ldr r0, =InitBattle + bl SetMainCallback2 + ldr r4, =gUnknown_02023058 + ldr r0, [r4] + bl Free + str r6, [r4] +_08037DD6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end intro_end + + thumb_func_start sub_8037DF4 +sub_8037DF4: @ 8037DF4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + bl GetMultiplayerId + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gBattleScripting + adds r0, 0x25 + strb r7, [r0] + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + ldr r0, =gBattleCommunication + ldrb r0, [r0] + cmp r0, 0xA + bls _08037E20 + b _080383F8 +_08037E20: + lsls r0, 2 + ldr r1, =_08037E38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08037E38: + .4byte _08037E64 + .4byte _08037EA8 + .4byte _08037F50 + .4byte _08038026 + .4byte _0803804C + .4byte _08038140 + .4byte _08038164 + .4byte _080382CC + .4byte _0803832C + .4byte _0803836C + .4byte _080383BC +_08037E64: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08037E90 + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + bl sub_805EF14 + ldr r1, =gBattleCommunication + movs r0, 0x1 + strb r0, [r1] +_08037E90: + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + bne _08037E9A + b _080383F8 +_08037E9A: + bl sub_800E0E8 + b _080383F8 + .pool +_08037EA8: + ldr r2, =gBattleTypeFlags + ldr r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08037F30 + ldr r0, =gUnknown_03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08037EBE + b _080383F8 +_08037EBE: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08037F02 + ldr r4, =gBattleStruct + ldr r0, [r4] + movs r5, 0xC0 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, =0x00000181 + adds r1, r0, r2 + movs r0, 0x3 + strb r0, [r1] + bl sub_8036A5C + bl sub_8036B44 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + adds r1, r5 + movs r2, 0x20 + bl link_0800A448 + ldr r1, =gBattleCommunication + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08037F02: + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + bne _08037F0C + b _080383F8 +_08037F0C: + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _080383F8 + .pool +_08037F30: + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _08037F40 + movs r0, 0x4 + orrs r1, r0 + str r1, [r2] +_08037F40: + ldr r1, =gBattleCommunication + movs r0, 0x7 + strb r0, [r1] + bl berry_801017C + b _080383F8 + .pool +_08037F50: + bl sub_800A550 + movs r1, 0xF + ands r1, r0 + cmp r1, 0xF + beq _08037F5E + b _080383F8 +_08037F5E: + bl sub_800A5B4 + movs r0, 0x4 + adds r1, r7, 0 + bl sub_8036EB8 + bl berry_801017C + bl sub_8068AA4 + ldr r0, =task00_0800F6FC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x87 + lsls r1, 1 + strh r1, [r0, 0xA] + movs r1, 0x5A + strh r1, [r0, 0xC] + strh r2, [r0, 0x12] + strh r2, [r0, 0xE] + strh r2, [r0, 0x10] + ldr r1, =gUnknown_020223C4 + adds r4, r0, 0 + adds r5, r1, 0x2 + movs r7, 0x3F + movs r6, 0x3 +_08037FA4: + ldrh r0, [r5] + str r2, [sp] + bl sub_8185F90 + ldr r0, =gLinkPlayers + ldr r2, [sp] + adds r0, r2, r0 + ldrh r0, [r0, 0x18] + cmp r0, 0x1 + beq _08037FE6 + cmp r0, 0x1 + bgt _08037FD4 + cmp r0, 0 + beq _08037FDE + b _0803800C + .pool +_08037FD4: + cmp r0, 0x2 + beq _08037FEE + cmp r0, 0x3 + beq _08037FFE + b _0803800C +_08037FDE: + ldrh r0, [r5] + adds r1, r7, 0 + ands r1, r0 + b _08037FF6 +_08037FE6: + ldrh r0, [r5] + adds r1, r7, 0 + ands r1, r0 + b _08038006 +_08037FEE: + ldrh r0, [r5] + adds r1, r7, 0 + ands r1, r0 + lsls r1, 6 +_08037FF6: + ldrh r0, [r4, 0xE] + orrs r1, r0 + strh r1, [r4, 0xE] + b _0803800C +_08037FFE: + ldrh r0, [r5] + adds r1, r7, 0 + ands r1, r0 + lsls r1, 6 +_08038006: + ldrh r0, [r4, 0x10] + orrs r1, r0 + strh r1, [r4, 0x10] +_0803800C: + movs r0, 0x80 + lsls r0, 1 + adds r5, r0 + adds r2, 0x1C + subs r6, 0x1 + cmp r6, 0 + bge _08037FA4 + bl ZeroEnemyPartyMons + ldr r1, =gBattleCommunication + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08038026: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08038032 + b _080383F8 +_08038032: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gPlayerParty + movs r2, 0xC8 + bl link_0800A448 + b _080383A6 + .pool +_0803804C: + bl sub_800A550 + movs r1, 0xF + ands r1, r0 + cmp r1, 0xF + beq _0803805A + b _080383F8 +_0803805A: + bl sub_800A5B4 + movs r6, 0 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + mov r8, r0 + ldr r4, =gUnknown_020223C4 + movs r5, 0 +_0803806C: + cmp r6, r7 + bne _080380A0 + ldr r0, =gLinkPlayers + adds r0, r5, r0 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _0803808C + cmp r0, 0x1 + bge _08038098 + cmp r0, 0 + beq _08038090 + b _0803812A + .pool +_0803808C: + cmp r0, 0x3 + bne _0803812A +_08038090: + ldr r0, =gPlayerParty + b _08038110 + .pool +_08038098: + ldr r0, =gPlayerParty + 300 + b _08038110 + .pool +_080380A0: + ldr r2, =gLinkPlayers + adds r0, r5, r2 + ldrh r1, [r0, 0x18] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _080380C4 + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080380D2 + b _080380F8 + .pool +_080380C4: + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080380F8 +_080380D2: + adds r0, r5, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _080380E4 + cmp r0, 0x1 + bge _080380F0 + cmp r0, 0 + beq _080380E8 + b _0803812A +_080380E4: + cmp r0, 0x3 + bne _0803812A +_080380E8: + ldr r0, =gPlayerParty + b _08038110 + .pool +_080380F0: + ldr r0, =gPlayerParty + 300 + b _08038110 + .pool +_080380F8: + adds r0, r5, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _0803810A + cmp r0, 0x1 + bge _08038120 + cmp r0, 0 + beq _0803810E + b _0803812A +_0803810A: + cmp r0, 0x3 + bne _0803812A +_0803810E: + ldr r0, =gEnemyParty +_08038110: + adds r1, r4, 0 + movs r2, 0xC8 + bl memcpy + b _0803812A + .pool +_08038120: + ldr r0, =gEnemyParty + 300 + adds r1, r4, 0 + movs r2, 0xC8 + bl memcpy +_0803812A: + movs r2, 0x80 + lsls r2, 1 + adds r4, r2 + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _0803806C + b _080383A6 + .pool +_08038140: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0803814C + b _080383F8 +_0803814C: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gPlayerParty + 200 + movs r2, 0x64 + bl link_0800A448 + b _080383A6 + .pool +_08038164: + bl sub_800A550 + movs r1, 0xF + ands r1, r0 + cmp r1, 0xF + beq _08038172 + b _080383F8 +_08038172: + bl sub_800A5B4 + movs r6, 0 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + mov r8, r0 + ldr r4, =gUnknown_020223C4 + movs r5, 0 +_08038184: + cmp r6, r7 + bne _080381B8 + ldr r0, =gLinkPlayers + adds r0, r5, r0 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _080381A4 + cmp r0, 0x1 + bge _080381B0 + cmp r0, 0 + beq _080381A8 + b _08038242 + .pool +_080381A4: + cmp r0, 0x3 + bne _08038242 +_080381A8: + ldr r0, =gPlayerParty + 200 + b _08038228 + .pool +_080381B0: + ldr r0, =gPlayerParty + 500 + b _08038228 + .pool +_080381B8: + ldr r2, =gLinkPlayers + adds r0, r5, r2 + ldrh r1, [r0, 0x18] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _080381DC + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080381EA + b _08038210 + .pool +_080381DC: + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08038210 +_080381EA: + adds r0, r5, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _080381FC + cmp r0, 0x1 + bge _08038208 + cmp r0, 0 + beq _08038200 + b _08038242 +_080381FC: + cmp r0, 0x3 + bne _08038242 +_08038200: + ldr r0, =gPlayerParty + 200 + b _08038228 + .pool +_08038208: + ldr r0, =gPlayerParty + 500 + b _08038228 + .pool +_08038210: + adds r0, r5, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _08038222 + cmp r0, 0x1 + bge _08038238 + cmp r0, 0 + beq _08038226 + b _08038242 +_08038222: + cmp r0, 0x3 + bne _08038242 +_08038226: + ldr r0, =gEnemyParty + 200 +_08038228: + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + b _08038242 + .pool +_08038238: + ldr r0, =gEnemyParty + 500 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy +_08038242: + movs r2, 0x80 + lsls r2, 1 + adds r4, r2 + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _08038184 + ldr r4, =gPlayerParty + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0xC8 + bl shedinja_something + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + movs r2, 0xC8 + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + movs r1, 0xFA + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + ldr r4, =gEnemyParty + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0xC8 + bl shedinja_something + movs r2, 0x96 + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + movs r1, 0xC8 + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + movs r2, 0xFA + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + b _080383A6 + .pool +_080382CC: + bl sub_8032768 + bl sub_8184E58 + ldr r3, =gBattleCommunication + movs r0, 0 + strb r0, [r3, 0x1] + strb r0, [r3, 0x2] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08038326 + movs r6, 0 + ldr r0, =gLinkPlayers + ldrb r1, [r0] + adds r4, r3, 0 + adds r2, r0, 0 + cmp r1, 0x3 + bne _0803830A + movs r3, 0xFF +_080382F8: + adds r2, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + bgt _0803830A + ldrh r1, [r2] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0x3 + beq _080382F8 +_0803830A: + cmp r6, 0x4 + bne _08038320 + movs r0, 0x8 + strb r0, [r4] + b _080383F8 + .pool +_08038320: + movs r0, 0xA + strb r0, [r4] + b _080383F8 +_08038326: + movs r0, 0xA + strb r0, [r3] + b _080383F8 +_0803832C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080383F8 + ldr r0, =gBattleStruct + ldr r4, [r0] + movs r0, 0xC0 + lsls r0, 1 + adds r4, r0 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + str r0, [r4] + ldr r0, =gUnknown_0203BD2C + ldr r0, [r0] + str r0, [r4, 0x4] + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + movs r2, 0x8 + bl link_0800A448 + b _080383A6 + .pool +_0803836C: + bl sub_800A550 + movs r1, 0xF + ands r1, r0 + cmp r1, 0xF + bne _080383F8 + bl sub_800A5B4 + movs r2, 0 + b _08038386 +_08038380: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_08038386: + cmp r2, 0x3 + bhi _080383A6 + ldr r4, =gUnknown_020223C4 + lsls r3, r2, 8 + adds r0, r3, r4 + ldrh r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08038380 + adds r1, r4, 0x4 + adds r1, r3, r1 + ldr r0, =gUnknown_0203BD2C + movs r2, 0x4 + bl memcpy +_080383A6: + ldr r1, =gBattleCommunication + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080383F8 + .pool +_080383BC: + ldr r0, =gUnknown_02024333 + adds r1, r0, 0x1 + bl battle_load_something + lsls r0, 24 + cmp r0, 0 + beq _080383F8 + ldr r2, =gUnknown_03005D00 + ldr r1, =gMain + ldr r0, [r1] + str r0, [r2] + ldr r0, =sub_8039EF0 + str r0, [r1] + ldr r0, =sub_8038420 + bl SetMainCallback2 + ldr r3, =gBattleTypeFlags + ldr r2, [r3] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _080383F8 + ldr r0, =gTrainerBattleOpponent_A + movs r4, 0x80 + lsls r4, 4 + adds r1, r4, 0 + strh r1, [r0] + movs r0, 0x20 + orrs r2, r0 + str r2, [r3] +_080383F8: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8037DF4 + + thumb_func_start sub_8038420 +sub_8038420: @ 8038420 + push {lr} + sub sp, 0x4 + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + bl RunTasks + ldr r0, =gMain + ldrh r1, [r0, 0x2C] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08038482 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08038482 + bl rfu_lacks_rfufunc + lsls r0, 24 + cmp r0, 0 + beq _08038482 + ldr r2, =gScriptResult + ldr r1, =gBattleOutcome + movs r0, 0x5 + strb r0, [r1] + movs r0, 0x5 + strh r0, [r2] + bl ResetPaletteFadeControl + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r0, =sub_80384E4 + bl SetMainCallback2 +_08038482: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038420 + + thumb_func_start sub_803849C +sub_803849C: @ 803849C + push {lr} + ldr r1, =gMain + ldr r0, =gUnknown_03005D00 + ldr r0, [r0] + str r0, [r1] + ldr r2, =gUnknown_02039B28 + movs r0, 0x3 + strb r0, [r2, 0x15] + ldr r0, =0x00000439 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bl ZeroEnemyPartyMons + movs r0, 0x5A + bl m4aSongNumStop + bl sub_805F094 + bl dp11_free + bl sub_8057028 + pop {r0} + bx r0 + .pool + thumb_func_end sub_803849C + + thumb_func_start sub_80384E4 +sub_80384E4: @ 80384E4 + push {lr} + bl UpdatePaletteFade + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08038512 + ldr r0, =gMPlay_SE1 + bl m4aMPlayStop + ldr r0, =gMPlay_SE2 + bl m4aMPlayStop + bl sub_803849C + bl FreeAllWindowBuffers + ldr r0, =gMain + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_08038512: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80384E4 + + thumb_func_start sub_8038528 +sub_8038528: @ 8038528 + movs r1, 0 + strh r1, [r0, 0x2E] + ldr r1, =sub_8038538 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8038528 + + thumb_func_start sub_8038538 +sub_8038538: @ 8038538 + push {r4,r5,lr} + adds r3, r0, 0 + ldr r5, =0x0201c000 + movs r0, 0x2E + ldrsh r1, [r3, r0] + cmp r1, 0x1 + beq _0803856C + cmp r1, 0x1 + bgt _08038554 + cmp r1, 0 + beq _0803855A + b _080385DC + .pool +_08038554: + cmp r1, 0x2 + beq _080385C8 + b _080385DC +_0803855A: + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + strh r1, [r3, 0x30] + ldr r0, =0x00000281 + strh r0, [r3, 0x32] + strh r1, [r3, 0x34] + movs r0, 0x1 + strh r0, [r3, 0x36] +_0803856C: + ldrh r0, [r3, 0x36] + subs r0, 0x1 + strh r0, [r3, 0x36] + lsls r0, 16 + cmp r0, 0 + bne _080385DC + movs r0, 0x2 + strh r0, [r3, 0x36] + movs r4, 0x30 + ldrsh r2, [r3, r4] + movs r0, 0x34 + ldrsh r1, [r3, r0] + lsls r1, 5 + adds r2, r1 + movs r4, 0x32 + ldrsh r0, [r3, r4] + subs r0, r1 + movs r4, 0x3D + lsls r0, 1 + adds r0, r5 + lsls r2, 1 + adds r2, r5 + movs r1, 0x1C +_0803859A: + strh r4, [r2] + strh r4, [r0] + adds r0, 0x4 + adds r2, 0x4 + subs r1, 0x2 + cmp r1, 0 + bge _0803859A + ldrh r0, [r3, 0x34] + adds r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _080385DC + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + movs r0, 0x20 + strh r0, [r3, 0x30] + b _080385DC + .pool +_080385C8: + ldrh r0, [r3, 0x30] + subs r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _080385DC + ldr r0, =sub_8036760 + bl SetMainCallback2 +_080385DC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038538 + + thumb_func_start CreateNPCTrainerParty +CreateNPCTrainerParty: @ 80385E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + str r0, [sp, 0x10] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + mov r9, r0 + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + bne _08038610 + movs r0, 0 + b _080389E2 +_08038610: + ldr r4, =gBattleTypeFlags + ldr r0, [r4] + ldr r1, =0x043f0908 + ands r0, r1 + ldr r1, [sp, 0x14] + lsls r1, 2 + str r1, [sp, 0x20] + cmp r0, 0x8 + beq _08038624 + b _080389D2 +_08038624: + cmp r2, 0x1 + bne _0803862C + bl ZeroEnemyPartyMons +_0803862C: + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _08038668 + ldr r0, =gTrainers + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r1, r2, r3 + lsls r1, 3 + adds r1, r0 + adds r2, r1, 0 + adds r2, 0x20 + ldrb r1, [r2] + movs r4, 0x3 + str r4, [sp, 0x1C] + adds r4, r0, 0 + cmp r1, 0x3 + bhi _0803867C + adds r2, r1, 0 + str r2, [sp, 0x1C] + b _0803867C + .pool +_08038668: + ldr r1, =gTrainers + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r0, r2, r3 + lsls r0, 3 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + str r0, [sp, 0x1C] + adds r4, r1, 0 +_0803867C: + movs r0, 0 + str r0, [sp, 0x18] + b _080389B4 + .pool +_08038688: + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r0, r2, r3 + lsls r0, 3 + adds r1, r0, r4 + ldrb r0, [r1, 0x18] + cmp r0, 0x1 + bne _0803869E + movs r0, 0x80 + mov r10, r0 + b _080386B0 +_0803869E: + ldrb r1, [r1, 0x2] + movs r0, 0x80 + ands r0, r1 + movs r1, 0x88 + mov r10, r1 + cmp r0, 0 + beq _080386B0 + movs r2, 0x78 + mov r10, r2 +_080386B0: + movs r6, 0 + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r0, r2, r3 + lsls r0, 3 + adds r1, r4, 0x4 + adds r0, r1 + ldrb r0, [r0] + ldr r3, [sp, 0x18] + adds r3, 0x1 + str r3, [sp, 0x24] + cmp r0, 0xFF + beq _080386E6 + adds r3, r1, 0 +_080386CC: + ldr r0, [sp, 0x14] + adds r1, r2, r0 + lsls r1, 3 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _080386CC +_080386E6: + ldr r1, [sp, 0x20] + ldr r2, [sp, 0x14] + adds r0, r1, r2 + lsls r1, r0, 3 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08038794 + cmp r0, 0x1 + bgt _08038700 + cmp r0, 0 + beq _0803870E + b _080389AC +_08038700: + cmp r0, 0x2 + bne _08038706 + b _08038854 +_08038706: + cmp r0, 0x3 + bne _0803870C + b _080388E8 +_0803870C: + b _080389AC +_0803870E: + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r4, [r0] + movs r6, 0 + ldr r3, [sp, 0x18] + lsls r2, r3, 3 + adds r0, r2, r4 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + ldrb r0, [r0] + adds r5, r2, 0 + cmp r0, 0xFF + beq _08038750 + adds r3, r1, 0 + movs r7, 0xB +_08038734: + adds r0, r2, r4 + ldrh r0, [r0, 0x4] + adds r1, r0, 0 + muls r1, r7 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _08038734 +_08038750: + mov r2, r9 + lsls r0, r2, 8 + add r10, r0 + adds r4, r5, r4 + ldrh r1, [r4] + lsls r0, r1, 5 + subs r0, r1 + movs r1, 0xFF + bl __divsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x18] + movs r1, 0x64 + adds r0, r3, 0 + muls r0, r1 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldrh r1, [r4, 0x4] + ldrb r2, [r4, 0x2] + movs r3, 0x1 + str r3, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r3, 0x2 + str r3, [sp, 0x8] + movs r3, 0 + str r3, [sp, 0xC] + adds r3, r6, 0 + bl CreateMon + b _080389AC + .pool +_08038794: + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r7, [r0] + movs r6, 0 + ldr r4, [sp, 0x18] + lsls r2, r4, 4 + adds r0, r2, r7 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + ldrb r0, [r0] + mov r8, r2 + cmp r0, 0xFF + beq _080387D6 + adds r3, r1, 0 + movs r4, 0xB +_080387BA: + adds r0, r2, r7 + ldrh r0, [r0, 0x4] + adds r1, r0, 0 + muls r1, r4 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _080387BA +_080387D6: + mov r2, r9 + lsls r0, r2, 8 + add r10, r0 + mov r3, r8 + adds r4, r3, r7 + ldrh r1, [r4] + lsls r0, r1, 5 + subs r0, r1 + movs r1, 0xFF + bl __divsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [sp, 0x18] + movs r1, 0x64 + adds r5, r0, 0 + muls r5, r1 + ldr r2, [sp, 0x10] + adds r5, r2, r5 + ldrh r1, [r4, 0x4] + ldrb r2, [r4, 0x2] + movs r0, 0x1 + str r0, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r0, 0x2 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + adds r0, r5, 0 + adds r3, r6, 0 + bl CreateMon + movs r6, 0 + mov r0, r8 + adds r0, 0x6 + adds r4, r7, r0 +_08038820: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r5, 0 + adds r2, r4, 0 + bl SetMonData + adds r1, r6, 0 + adds r1, 0x11 + ldrh r0, [r4] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, =gBattleMoves + 0x4 @ PP offset + adds r2, r0 + adds r0, r5, 0 + bl SetMonData + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08038820 + b _080389AC + .pool +_08038854: + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r4, [r0] + movs r6, 0 + ldr r0, [sp, 0x18] + lsls r2, r0, 3 + adds r0, r2, r4 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + ldrb r0, [r0] + adds r5, r2, 0 + cmp r0, 0xFF + beq _08038896 + adds r3, r1, 0 + movs r7, 0xB +_0803887A: + adds r0, r2, r4 + ldrh r0, [r0, 0x4] + adds r1, r0, 0 + muls r1, r7 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _0803887A +_08038896: + mov r2, r9 + lsls r0, r2, 8 + add r10, r0 + adds r5, r4 + ldrh r1, [r5] + lsls r0, r1, 5 + subs r0, r1 + movs r1, 0xFF + bl __divsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x18] + movs r0, 0x64 + adds r4, r3, 0 + muls r4, r0 + ldr r1, [sp, 0x10] + adds r4, r1, r4 + ldrh r1, [r5, 0x4] + ldrb r2, [r5, 0x2] + movs r0, 0x1 + str r0, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r0, 0x2 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + adds r0, r4, 0 + adds r3, r6, 0 + bl CreateMon + adds r5, 0x6 + adds r0, r4, 0 + movs r1, 0xC + adds r2, r5, 0 + bl SetMonData + b _080389AC + .pool +_080388E8: + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r7, [r0] + movs r6, 0 + ldr r4, [sp, 0x18] + lsls r2, r4, 4 + adds r0, r2, r7 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + ldrb r0, [r0] + mov r8, r2 + cmp r0, 0xFF + beq _0803892A + adds r3, r1, 0 + movs r4, 0xB +_0803890E: + adds r0, r2, r7 + ldrh r0, [r0, 0x4] + adds r1, r0, 0 + muls r1, r4 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _0803890E +_0803892A: + mov r2, r9 + lsls r0, r2, 8 + add r10, r0 + mov r3, r8 + adds r5, r3, r7 + ldrh r1, [r5] + lsls r0, r1, 5 + subs r0, r1 + movs r1, 0xFF + bl __divsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [sp, 0x18] + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r2, [sp, 0x10] + adds r4, r2, r4 + ldrh r1, [r5, 0x4] + ldrb r2, [r5, 0x2] + movs r0, 0x1 + str r0, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r0, 0x2 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + adds r0, r4, 0 + adds r3, r6, 0 + bl CreateMon + adds r5, 0x6 + adds r0, r4, 0 + movs r1, 0xC + adds r2, r5, 0 + bl SetMonData + movs r6, 0 + adds r5, r4, 0 + mov r0, r8 + adds r0, 0x8 + adds r4, r7, r0 +_08038982: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r5, 0 + adds r2, r4, 0 + bl SetMonData + adds r1, r6, 0 + adds r1, 0x11 + ldrh r0, [r4] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, =gBattleMoves + 0x4 @ PP offset + adds r2, r0 + adds r0, r5, 0 + bl SetMonData + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08038982 +_080389AC: + ldr r4, [sp, 0x24] + str r4, [sp, 0x18] + ldr r4, =gTrainers + ldr r0, [sp, 0x18] +_080389B4: + ldr r1, [sp, 0x1C] + cmp r0, r1 + bge _080389BC + b _08038688 +_080389BC: + ldr r2, =gBattleTypeFlags + ldr r1, =gTrainers + ldr r3, [sp, 0x20] + ldr r4, [sp, 0x14] + adds r0, r3, r4 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x18] + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] +_080389D2: + ldr r0, =gTrainers + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r1, r2, r3 + lsls r1, 3 + adds r1, r0 + adds r1, 0x20 + ldrb r0, [r1] +_080389E2: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end CreateNPCTrainerParty + + thumb_func_start sub_8038A04 +sub_8038A04: @ 8038A04 + push {lr} + ldr r0, =0x04000006 + ldrh r0, [r0] + subs r0, 0x6F + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x30 + bhi _08038A1E + movs r1, 0x98 + lsls r1, 8 + movs r0, 0x8 + bl SetGpuReg +_08038A1E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038A04 + + thumb_func_start vblank_cb_08078BB4 +vblank_cb_08078BB4: @ 8038A28 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + ldr r1, =0x013f0102 + ands r0, r1 + cmp r0, 0 + bne _08038A3A + bl Random +_08038A3A: + ldr r0, =gUnknown_02022E14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =gUnknown_02022E16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =gUnknown_02022E18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =gUnknown_02022E1A + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, =gUnknown_02022E1C + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + ldr r0, =gUnknown_02022E1E + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + ldr r0, =gUnknown_02022E20 + ldrh r1, [r0] + movs r0, 0x1C + bl SetGpuReg + ldr r0, =gUnknown_02022E22 + ldrh r1, [r0] + movs r0, 0x1E + bl SetGpuReg + ldr r0, =gUnknown_02022E24 + ldrh r1, [r0] + movs r0, 0x40 + bl SetGpuReg + ldr r0, =gUnknown_02022E26 + ldrh r1, [r0] + movs r0, 0x44 + bl SetGpuReg + ldr r0, =gUnknown_02022E28 + ldrh r1, [r0] + movs r0, 0x42 + bl SetGpuReg + ldr r0, =gUnknown_02022E2A + ldrh r1, [r0] + movs r0, 0x46 + bl SetGpuReg + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end vblank_cb_08078BB4 + + thumb_func_start nullsub_17 +nullsub_17: @ 8038B00 + bx lr + thumb_func_end nullsub_17 + + thumb_func_start sub_8038B04 +sub_8038B04: @ 8038B04 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08038B24 + movs r1, 0x32 + ldrsh r0, [r5, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + lsrs r0, 8 + ldrh r1, [r5, 0x30] + adds r0, r1 + strh r0, [r5, 0x20] + b _08038B36 +_08038B24: + movs r1, 0x32 + ldrsh r0, [r5, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + asrs r0, 8 + ldrh r1, [r5, 0x30] + subs r1, r0 + strh r1, [r5, 0x20] +_08038B36: + movs r1, 0xC0 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r5, 0x32] + adds r0, r1 + strh r0, [r5, 0x32] + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08038B6A + ldr r4, =0x00002710 + adds r0, r4, 0 + bl FreeSpriteTilesByTag + adds r0, r4, 0 + bl FreeSpritePaletteByTag + adds r0, r5, 0 + bl FreeSpriteOamMatrix + adds r0, r5, 0 + bl DestroySprite +_08038B6A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038B04 + + thumb_func_start sub_8038B74 +sub_8038B74: @ 8038B74 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl StartSpriteAffineAnim + ldr r0, =sub_8038B04 + str r0, [r4, 0x1C] + movs r0, 0x68 + bl PlaySE + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038B74 + + thumb_func_start sub_8038B94 +sub_8038B94: @ 8038B94 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + ldr r0, =gBattleScripting + adds r0, 0x25 + ldrb r2, [r0] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08038C04 + ldr r1, =gLinkPlayers + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x18] + cmp r0, 0x1 + beq _08038BF0 + cmp r0, 0x1 + bgt _08038BE8 + cmp r0, 0 + beq _08038C04 + b _08038C0C + .pool +_08038BE8: + cmp r0, 0x2 + beq _08038C04 + cmp r0, 0x3 + bne _08038C0C +_08038BF0: + ldr r0, =gEnemyParty + str r0, [sp, 0x4] + ldr r1, =gPlayerParty + str r1, [sp, 0x8] + b _08038C0C + .pool +_08038C04: + ldr r2, =gPlayerParty + str r2, [sp, 0x4] + ldr r3, =gEnemyParty + str r3, [sp, 0x8] +_08038C0C: + movs r7, 0 + movs r0, 0 + mov r8, r0 + ldr r1, [sp] + lsls r1, 2 + str r1, [sp, 0xC] + movs r2, 0xCE + lsls r2, 1 + mov r10, r2 + mov r9, r0 +_08038C20: + movs r0, 0x64 + mov r4, r8 + muls r4, r0 + ldr r3, [sp, 0x4] + adds r4, r3, r4 + adds r0, r4, 0 + movs r1, 0x41 + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData + adds r1, r0, 0 + cmp r5, 0 + beq _08038C90 + cmp r5, r10 + beq _08038C64 + cmp r6, 0 + beq _08038C64 + cmp r1, 0 + bne _08038C64 + movs r0, 0x1 + mov r2, r9 + lsls r0, r2 + orrs r7, r0 +_08038C64: + cmp r5, 0 + beq _08038C90 + cmp r6, 0 + beq _08038C7C + cmp r5, r10 + beq _08038C74 + cmp r1, 0 + beq _08038C7C +_08038C74: + movs r0, 0x2 + mov r3, r9 + lsls r0, r3 + orrs r7, r0 +_08038C7C: + cmp r5, 0 + beq _08038C90 + cmp r5, r10 + beq _08038C90 + cmp r6, 0 + bne _08038C90 + movs r0, 0x3 + mov r1, r9 + lsls r0, r1 + orrs r7, r0 +_08038C90: + movs r2, 0x2 + add r9, r2 + movs r3, 0x1 + add r8, r3 + mov r0, r8 + cmp r0, 0x5 + ble _08038C20 + ldr r1, =gTasks + ldr r2, [sp, 0xC] + ldr r3, [sp] + adds r0, r2, r3 + lsls r0, 3 + adds r0, r1 + strh r7, [r0, 0xE] + movs r7, 0 + movs r0, 0 + mov r8, r0 + movs r1, 0xCE + lsls r1, 1 + mov r10, r1 + mov r9, r0 +_08038CBA: + movs r0, 0x64 + mov r4, r8 + muls r4, r0 + ldr r2, [sp, 0x8] + adds r4, r2, r4 + adds r0, r4, 0 + movs r1, 0x41 + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData + adds r1, r0, 0 + cmp r5, 0 + beq _08038D2A + cmp r5, r10 + beq _08038CFE + cmp r6, 0 + beq _08038CFE + cmp r1, 0 + bne _08038CFE + movs r0, 0x1 + mov r3, r9 + lsls r0, r3 + orrs r7, r0 +_08038CFE: + cmp r5, 0 + beq _08038D2A + cmp r6, 0 + beq _08038D16 + cmp r5, r10 + beq _08038D0E + cmp r1, 0 + beq _08038D16 +_08038D0E: + movs r0, 0x2 + mov r1, r9 + lsls r0, r1 + orrs r7, r0 +_08038D16: + cmp r5, 0 + beq _08038D2A + cmp r5, r10 + beq _08038D2A + cmp r6, 0 + bne _08038D2A + movs r0, 0x3 + mov r2, r9 + lsls r0, r2 + orrs r7, r0 +_08038D2A: + movs r3, 0x2 + add r9, r3 + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x5 + ble _08038CBA + ldr r1, =gTasks + ldr r2, [sp, 0xC] + ldr r3, [sp] + adds r0, r2, r3 + lsls r0, 3 + adds r0, r1 + strh r7, [r0, 0x10] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038B94 + + thumb_func_start sub_8038D64 +sub_8038D64: @ 8038D64 + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r2, 0x21 + negs r2, r2 + ands r1, r2 + str r1, [r0] + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _08038DAC + ldr r0, =gMain + ldr r0, [r0, 0x8] + bl SetMainCallback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 + b _08038EB6 + .pool +_08038DAC: + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + mov r0, sp + bl CpuSet + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0xF0 + bl SetGpuReg + ldr r4, =0x00005051 + movs r0, 0x44 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + ldr r1, =gUnknown_02022E24 + movs r0, 0xF0 + strh r0, [r1] + ldr r0, =gUnknown_02022E26 + strh r4, [r0] + bl dp12_8087EA4 + ldr r0, =gUnknown_02038C28 + movs r3, 0xF0 + movs r1, 0xF0 + lsls r1, 3 + adds r2, r0, r1 + movs r1, 0x4F +_08038DFE: + strh r3, [r0] + strh r3, [r2] + adds r2, 0x2 + adds r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08038DFE + movs r1, 0x50 + ldr r0, =gUnknown_02038C28 + ldr r3, =0x0000ff10 + movs r4, 0x82 + lsls r4, 4 + adds r2, r0, r4 + adds r0, 0xA0 +_08038E1A: + strh r3, [r0] + strh r3, [r2] + adds r2, 0x2 + adds r0, 0x2 + adds r1, 0x1 + cmp r1, 0x9F + ble _08038E1A + bl ResetPaletteFade + ldr r0, =gUnknown_02022E14 + movs r4, 0 + strh r4, [r0] + ldr r0, =gUnknown_02022E16 + strh r4, [r0] + ldr r0, =gUnknown_02022E18 + strh r4, [r0] + ldr r0, =gUnknown_02022E1A + strh r4, [r0] + ldr r0, =gUnknown_02022E1C + strh r4, [r0] + ldr r0, =gUnknown_02022E1E + strh r4, [r0] + ldr r0, =gUnknown_02022E20 + strh r4, [r0] + ldr r0, =gUnknown_02022E22 + strh r4, [r0] + bl c2_berry_program_update_menu + ldr r0, =gUnknown_08C004E0 + movs r1, 0 + movs r2, 0x40 + bl LoadCompressedPalette + bl sub_803570C + bl ResetSpriteData + bl ResetTasks + bl sub_8036154 + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + bl FreeAllSpritePalettes + ldr r1, =gReservedSpritePaletteCount + movs r0, 0x4 + strb r0, [r1] + ldr r0, =vblank_cb_08078BB4 + bl SetVBlankCallback + ldr r0, =task00_0800F6FC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x87 + lsls r2, 1 + strh r2, [r1, 0xA] + movs r2, 0x5A + strh r2, [r1, 0xC] + movs r2, 0x1 + strh r2, [r1, 0x12] + bl sub_8038B94 + ldr r0, =sub_8038F14 + bl SetMainCallback2 + ldr r0, =gBattleCommunication + strb r4, [r0] +_08038EB6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038D64 + + thumb_func_start sub_8038F14 +sub_8038F14: @ 8038F14 + push {lr} + bl sub_8038F34 + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_8038F14 + + thumb_func_start sub_8038F34 +sub_8038F34: @ 8038F34 + push {r4-r6,lr} + sub sp, 0x8 + ldr r0, =gBattleCommunication + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x9 + bls _08038F44 + b _080391C6 +_08038F44: + lsls r0, r1, 2 + ldr r1, =_08038F58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08038F58: + .4byte _08038F80 + .4byte _08038FA0 + .4byte _08038FC2 + .4byte _080390C8 + .4byte _08039100 + .4byte _08039118 + .4byte _0803912C + .4byte _0803914C + .4byte _08039166 + .4byte _08039184 +_08038F80: + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r1, =gBattleCommunication + movs r0, 0xFF + strb r0, [r1, 0x1] + b _08039174 + .pool +_08038FA0: + ldrb r0, [r4, 0x1] + subs r0, 0x1 + strb r0, [r4, 0x1] + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08038FB0 + b _080391C6 +_08038FB0: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + b _0803910C +_08038FC2: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08038FD0 + b _080391C6 +_08038FD0: + bl sub_8185FAC + ldr r2, =gMain + ldr r1, =0x00000439 + adds r2, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + movs r3, 0x2 + cmp r0, 0 + beq _08038FFC + movs r3, 0x4 +_08038FFC: + movs r4, 0 + ldr r6, =gSaveBlock2Ptr + cmp r4, r3 + bge _08039022 + ldr r1, =gLinkPlayers + ldrb r0, [r1] + cmp r0, 0x3 + bne _08039022 + movs r5, 0xFF + adds r2, r1, 0 +_08039010: + adds r2, 0x1C + adds r4, 0x1 + cmp r4, r3 + bge _08039022 + ldrh r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x3 + beq _08039010 +_08039022: + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080390AC + cmp r4, r3 + bne _080390AC + ldr r0, =0x000008d2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08039074 + bl FreeAllWindowBuffers + ldr r0, =sub_80392A8 + bl SetMainCallback2 + b _080391C6 + .pool +_08039074: + ldr r2, =gMain + ldr r1, =0x00000439 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08039090 + ldr r0, [r2, 0x8] + b _080390B0 + .pool +_08039090: + ldr r0, =gUnknown_03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08039172 + ldr r0, =sub_80B3AF8 + movs r1, 0x5 + bl CreateTask + b _08039172 + .pool +_080390AC: + ldr r0, =gMain + ldr r0, [r0, 0x8] +_080390B0: + bl SetMainCallback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 + b _080391C6 + .pool +_080390C8: + movs r0, 0 + str r0, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x4 + bl CpuSet + movs r4, 0 +_080390DA: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80363C4 + adds r4, 0x1 + cmp r4, 0x1 + ble _080390DA + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + b _08039172 + .pool +_08039100: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080391C6 +_0803910C: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _080391C6 + .pool +_08039118: + ldr r0, =sub_80B3AF8 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080391C6 + b _08039172 + .pool +_0803912C: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080391C6 + bl sub_800ADF8 + ldr r0, =gUnknown_0824978D + movs r1, 0 + bl battle_show_message_maybe + b _08039172 + .pool +_0803914C: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _080391C6 + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080391C6 + b _08039172 +_08039166: + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + bne _08039172 + bl sub_800AC34 +_08039172: + ldr r1, =gBattleCommunication +_08039174: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080391C6 + .pool +_08039184: + ldr r2, =gMain + ldr r1, =0x00000439 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + adds r3, r2, 0 + cmp r0, 0 + beq _080391A6 + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + bne _080391A6 + ldr r0, =gUnknown_03003124 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080391C6 +_080391A6: + ldr r0, =0x00000439 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, [r3, 0x8] + bl SetMainCallback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 +_080391C6: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038F34 + + thumb_func_start sub_80391E0 +sub_80391E0: @ 80391E0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + cmp r1, 0x6 + bhi _080392A0 + lsls r0, r1, 2 + ldr r1, =_08039200 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08039200: + .4byte _0803921C + .4byte _08039230 + .4byte _08039244 + .4byte _08039258 + .4byte _0803926C + .4byte _08039280 + .4byte _08039294 +_0803921C: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + lsrs r0, 30 + b _080392A0 + .pool +_08039230: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 28 + lsrs r0, 30 + b _080392A0 + .pool +_08039244: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrh r0, [r1] + lsls r0, 23 + lsrs r0, 27 + b _080392A0 + .pool +_08039258: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 29 + lsrs r0, 30 + b _080392A0 + .pool +_0803926C: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 28 + lsrs r0, 31 + b _080392A0 + .pool +_08039280: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 26 + lsrs r0, 30 + b _080392A0 + .pool +_08039294: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + lsls r0, 8 + lsrs r0, 22 +_080392A0: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80391E0 + + thumb_func_start sub_80392A8 +sub_80392A8: @ 80392A8 + push {r4,lr} + sub sp, 0x8 + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r4, 0 + str r4, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x4 + bl CpuSet + bl ResetPaletteFade + ldr r0, =gUnknown_02022E14 + strh r4, [r0] + ldr r0, =gUnknown_02022E16 + strh r4, [r0] + ldr r0, =gUnknown_02022E18 + strh r4, [r0] + ldr r0, =gUnknown_02022E1A + strh r4, [r0] + ldr r0, =gUnknown_02022E1C + strh r4, [r0] + ldr r0, =gUnknown_02022E1E + strh r4, [r0] + ldr r0, =gUnknown_02022E20 + strh r4, [r0] + ldr r0, =gUnknown_02022E22 + strh r4, [r0] + bl c2_berry_program_update_menu + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + bl sub_803570C +_080392FE: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80363C4 + adds r4, 0x1 + cmp r4, 0x1 + ble _080392FE + bl ResetSpriteData + bl ResetTasks + bl FreeAllSpritePalettes + ldr r1, =gReservedSpritePaletteCount + movs r0, 0x4 + strb r0, [r1] + ldr r0, =vblank_cb_08078BB4 + bl SetVBlankCallback + ldr r0, =sub_803937C + bl SetMainCallback2 + movs r0, 0x1 + negs r0, r0 + movs r4, 0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r0, =gBattleCommunication + strb r4, [r0] + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80392A8 + + thumb_func_start sub_803937C +sub_803937C: @ 803937C + push {lr} + bl sub_803939C + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_803937C + + thumb_func_start sub_803939C +sub_803939C: @ 803939C + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, =gBattleCommunication + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0xC + bls _080393AC + b _0803975E +_080393AC: + lsls r0, r1, 2 + ldr r1, =_080393C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080393C0: + .4byte _080393F4 + .4byte _08039414 + .4byte _08039450 + .4byte _08039470 + .4byte _0803949C + .4byte _080394D8 + .4byte _0803957C + .4byte _08039704 + .4byte _080395CC + .4byte _08039610 + .4byte _08039678 + .4byte _080396A8 + .4byte _08039704 +_080393F4: + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r1, =gBattleCommunication + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_08039414: + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08039434 + ldr r0, =gUnknown_03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08039434 + ldr r0, =sub_80B3AF8 + movs r1, 0x5 + bl CreateTask +_08039434: + ldr r1, =gBattleCommunication + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_08039450: + ldr r0, =sub_80B3AF8 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _0803945E + b _0803975E +_0803945E: + ldr r1, =gBattleCommunication + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_08039470: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803947E + b _0803975E +_0803947E: + ldr r0, =gUnknown_085CD28F + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =gBattleCommunication + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_0803949C: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _080394AC + b _0803975E +_080394AC: + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldr r4, =gBattleCommunication + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 + b _080396EA + .pool +_080394D8: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08039500 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _080394EC + b _0803975E +_080394EC: + movs r0, 0x5 + bl PlaySE + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0 + b _0803951E + .pool +_08039500: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08039526 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08039510 + b _0803975E +_08039510: + movs r0, 0x5 + bl PlaySE + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0x1 +_0803951E: + strb r0, [r4, 0x1] + bl sub_8056B74 + b _0803975E +_08039526: + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08039560 + movs r0, 0x5 + bl PlaySE + ldr r4, =gBattleCommunication + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08039540 + b _080396EA +_08039540: + str r5, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + bl sub_8185338 + strb r0, [r4, 0x1] + movs r0, 0xA + strb r0, [r4] + b _0803975E + .pool +_08039560: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0803956A + b _0803975E +_0803956A: + movs r0, 0x5 + bl PlaySE + ldr r1, =gBattleCommunication + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_0803957C: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0803958A + b _0803975E +_0803958A: + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080395B4 + bl sub_800ADF8 + ldr r0, =gUnknown_0824978D + movs r1, 0 + bl battle_show_message_maybe +_080395B4: + ldr r1, =gBattleCommunication + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_080395CC: + ldrb r0, [r4, 0x1] + subs r0, 0x1 + strb r0, [r4, 0x1] + lsls r0, 24 + cmp r0, 0 + beq _080395DA + b _0803975E +_080395DA: + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080395F6 + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + bne _080395F6 + bl sub_800AC34 +_080395F6: + ldr r1, =gBattleCommunication + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_08039610: + ldr r2, =gMain + ldr r1, =0x00000439 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + adds r3, r2, 0 + cmp r0, 0 + beq _08039634 + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + bne _08039634 + ldr r0, =gUnknown_03003124 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08039634 + b _0803975E +_08039634: + ldr r0, =0x00000439 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08039650 + b _0803975E +_08039650: + ldr r0, [r3, 0x8] + bl SetMainCallback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 + b _0803975E + .pool +_08039678: + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + bne _080396A0 + movs r0, 0x37 + bl PlaySE + ldr r0, =gUnknown_085CD2CB +_08039686: + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle + movs r1, 0 + bl battle_show_message_maybe + movs r0, 0x80 + strb r0, [r4, 0x1] + b _080396EA + .pool +_080396A0: + ldr r0, =gUnknown_08242481 + b _08039686 + .pool +_080396A8: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803975E + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0803975E + ldr r4, =gBattleCommunication + ldrb r0, [r4, 0x1] + subs r0, 0x1 + strb r0, [r4, 0x1] + lsls r0, 24 + cmp r0, 0 + bne _0803975E + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080396EA + bl sub_800ADF8 + ldr r0, =gUnknown_0824978D + movs r1, 0 + bl battle_show_message_maybe +_080396EA: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0803975E + .pool +_08039704: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + bne _0803975E + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08039744 + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803975E + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + b _0803974A + .pool +_08039744: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] +_0803974A: + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gBattleCommunication + movs r0, 0x20 + strb r0, [r1, 0x1] + movs r0, 0x8 +_0803975C: + strb r0, [r1] +_0803975E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803939C + + thumb_func_start shedinja_something +shedinja_something: @ 803976C + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r5, sp, 0xC + movs r0, 0x1 + strb r0, [r5] + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + ldr r1, =0x0000012f + cmp r0, r1 + bne _080397B4 + adds r0, r4, 0 + movs r1, 0x3 + bl GetMonData + ldrb r1, [r5] + cmp r0, r1 + beq _080397B4 + adds r0, r4, 0 + movs r1, 0x2 + mov r2, sp + bl GetMonData + ldr r1, =gUnknown_0831ACA0 + mov r0, sp + bl StringCompareWithoutExtCtrlCodes + cmp r0, 0 + bne _080397B4 + adds r0, r4, 0 + movs r1, 0x3 + adds r2, r5, 0 + bl SetMonData +_080397B4: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end shedinja_something + + thumb_func_start sub_80397C4 +sub_80397C4: @ 80397C4 + ldr r2, =gUnknown_0831ABA0 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + lsls r1, 3 + adds r1, r0 + ldrb r0, [r1, 0x3] + lsls r0, 3 + bx lr + .pool + thumb_func_end sub_80397C4 + + thumb_func_start oac_poke_opponent +oac_poke_opponent: @ 80397DC + push {lr} + sub sp, 0x4 + ldr r1, =sub_803980C + str r1, [r0, 0x1C] + movs r1, 0 + bl StartSpriteAnimIfDifferent + movs r0, 0x80 + lsls r0, 10 + ldr r1, =0x00002108 + str r1, [sp] + movs r1, 0 + movs r2, 0xA + movs r3, 0xA + bl BeginNormalPaletteFade + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end oac_poke_opponent + + thumb_func_start sub_803980C +sub_803980C: @ 803980C + push {lr} + adds r2, r0, 0 + ldr r0, =gUnknown_020243FC + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0803982C + ldrh r0, [r2, 0x24] + adds r0, 0x2 + strh r0, [r2, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _0803982C + ldr r0, =sub_8039838 + str r0, [r2, 0x1C] +_0803982C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803980C + + thumb_func_start sub_8039838 +sub_8039838: @ 8039838 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08039880 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + bl sub_8076918 + ldr r1, =gHealthBoxesIds + movs r2, 0x2E + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r0, [r0] + bl sub_80729D0 + ldr r0, =sub_8039894 + str r0, [r4, 0x1C] + adds r0, r4, 0 + movs r1, 0 + bl StartSpriteAnimIfDifferent + movs r0, 0x80 + lsls r0, 10 + ldr r1, =0x00002108 + str r1, [sp] + movs r1, 0 + movs r2, 0xA + movs r3, 0 + bl BeginNormalPaletteFade +_08039880: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039838 + + thumb_func_start sub_8039894 +sub_8039894: @ 8039894 + push {lr} + adds r2, r0, 0 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080398B0 + ldrh r1, [r2, 0x32] + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_806ECEC +_080398B0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039894 + + thumb_func_start nullsub_18 +nullsub_18: @ 80398B8 + bx lr + thumb_func_end nullsub_18 + + thumb_func_start sub_80398BC +sub_80398BC: @ 80398BC + movs r1, 0x6 + strh r1, [r0, 0x34] + movs r1, 0x1 + strh r1, [r0, 0x36] + ldr r1, =sub_80398D0 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_80398BC + + thumb_func_start sub_80398D0 +sub_80398D0: @ 80398D0 + push {r4,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x36] + subs r0, 0x1 + strh r0, [r3, 0x36] + lsls r0, 16 + cmp r0, 0 + bne _08039924 + movs r0, 0x8 + strh r0, [r3, 0x36] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r4, 0x5 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x34] + subs r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + bne _08039924 + ldrb r1, [r1] + adds r0, r4, 0 + ands r0, r1 + mov r1, r12 + strb r0, [r1] + ldr r0, =nullsub_18 + str r0, [r3, 0x1C] + ldr r0, =gUnknown_02022F88 + str r2, [r0] +_08039924: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80398D0 + + thumb_func_start sub_8039934 +sub_8039934: @ 8039934 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + ldrh r0, [r0, 0x2E] + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r6, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + beq _0803995C + adds r4, r0, 0 + b _08039960 + .pool +_0803995C: + mov r0, r9 + ldrh r4, [r0, 0x32] +_08039960: + ldr r1, =gBattlePartyID + lsls r0, r6, 1 + adds r5, r0, r1 + ldrh r0, [r5] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r7, =gEnemyParty + adds r0, r7 + movs r1, 0 + bl GetMonData + cmp r4, 0xC9 + bne _080399E4 + ldrh r0, [r5] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + movs r1, 0 + bl GetMonData + adds r2, r0, 0 + movs r0, 0xC0 + lsls r0, 18 + ands r0, r2 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r2 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r2 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r2 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080399D0 + movs r0, 0xC9 + b _080399DA + .pool +_080399D0: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080399DA: + ldr r1, =gUnknown_08300D38 + lsls r0, 2 + b _08039A1C + .pool +_080399E4: + ldr r0, =0x00000181 + cmp r4, r0 + bne _08039A08 + ldr r0, =gUnknown_08525F78 + ldr r1, =gUnknown_020244E4 + adds r1, r6, r1 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + b _08039A20 + .pool +_08039A08: + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bls _08039A18 + ldr r0, =gUnknown_08300D38 + b _08039A1E + .pool +_08039A18: + ldr r1, =gUnknown_08300D38 + lsls r0, r4, 2 +_08039A1C: + adds r0, r1 +_08039A1E: + ldrb r0, [r0, 0x1] +_08039A20: + lsrs r1, r0, 3 + movs r0, 0x8 + subs r0, r1 + mov r1, r9 + strh r0, [r1, 0x34] + movs r0, 0x1 + strh r0, [r1, 0x36] + ldr r0, =sub_8039A48 + str r0, [r1, 0x1C] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039934 + + thumb_func_start sub_8039A48 +sub_8039A48: @ 8039A48 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x36] + subs r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + cmp r0, 0 + bne _08039AC8 + movs r0, 0x2 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x26] + adds r0, 0x8 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x34] + subs r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + cmp r0, 0 + bge _08039A7C + adds r0, r4, 0 + bl FreeSpriteOamMatrix + adds r0, r4, 0 + bl DestroySprite + b _08039AC8 +_08039A7C: + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + bl GetBankIdentity + ldr r1, =gUnknown_020244D4 + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 22 + adds r1, 0x4 + adds r1, r0 + ldr r2, =gUnknown_020244E4 + movs r3, 0x2E + ldrsh r0, [r4, r3] + adds r0, r2 + ldrb r0, [r0] + lsls r0, 11 + ldr r1, [r1] + adds r1, r0 + movs r2, 0x34 + ldrsh r0, [r4, r2] + lsls r0, 8 + adds r1, r0 + movs r2, 0 + movs r0, 0xFF +_08039AAE: + strb r2, [r1] + adds r1, 0x1 + subs r0, 0x1 + cmp r0, 0 + bge _08039AAE + ldr r0, =gUnknown_020244E4 + movs r3, 0x2E + ldrsh r1, [r4, r3] + adds r1, r0 + ldrb r1, [r1] + adds r0, r4, 0 + bl StartSpriteAnim +_08039AC8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039A48 + + thumb_func_start sub_8039AD8 +sub_8039AD8: @ 8039AD8 + movs r1, 0x8 + strh r1, [r0, 0x34] + adds r1, r0, 0 + adds r1, 0x3E + ldrb r1, [r1] + lsls r1, 29 + lsrs r1, 31 + strh r1, [r0, 0x36] + ldr r1, =sub_8039AF4 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8039AD8 + + thumb_func_start sub_8039AF4 +sub_8039AF4: @ 8039AF4 + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x34] + subs r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + cmp r0, 0 + bne _08039B26 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + movs r0, 0x8 + strh r0, [r3, 0x34] +_08039B26: + pop {r0} + bx r0 + thumb_func_end sub_8039AF4 + + thumb_func_start sub_8039B2C +sub_8039B2C: @ 8039B2C + movs r1, 0x3E + adds r1, r0 + mov r12, r1 + movs r1, 0x1 + ldrh r2, [r0, 0x36] + ands r2, r1 + lsls r2, 2 + mov r1, r12 + ldrb r3, [r1] + movs r1, 0x5 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + movs r1, 0 + strh r1, [r0, 0x36] + ldr r1, =nullsub_18 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8039B2C + + thumb_func_start sub_8039B58 +sub_8039B58: @ 8039B58 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08039BA0 + ldr r0, =gHitMarker + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08039B80 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _08039B94 +_08039B80: + ldrh r0, [r4, 0x32] + bl sub_806F0D4 + lsls r0, 24 + cmp r0, 0 + beq _08039B94 + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAnim +_08039B94: + ldrh r1, [r4, 0x32] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_806ECEC +_08039BA0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039B58 + + thumb_func_start sub_8039BB4 +sub_8039BB4: @ 8039BB4 + ldr r1, =oac_poke_ally_ + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8039BB4 + + thumb_func_start oac_poke_ally_ +oac_poke_ally_: @ 8039BC0 + push {lr} + adds r2, r0, 0 + ldr r0, =gUnknown_020243FC + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08039BE4 + ldrh r0, [r2, 0x24] + subs r0, 0x2 + strh r0, [r2, 0x24] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _08039BE4 + ldr r0, =nullsub_19 + str r0, [r2, 0x1C] + strh r1, [r2, 0x30] +_08039BE4: + pop {r0} + bx r0 + .pool + thumb_func_end oac_poke_ally_ + + thumb_func_start sub_8039BF0 +sub_8039BF0: @ 8039BF0 + ldr r1, =nullsub_19 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8039BF0 + + thumb_func_start nullsub_19 +nullsub_19: @ 8039BFC + bx lr + thumb_func_end nullsub_19 + + thumb_func_start sub_8039C00 +sub_8039C00: @ 8039C00 + push {lr} + adds r2, r0, 0 + ldr r0, =gUnknown_020243FC + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08039C20 + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x26] + adds r0, r1 + strh r0, [r2, 0x26] +_08039C20: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039C00 + + thumb_func_start dp11b_obj_instanciate +dp11b_obj_instanciate: @ 8039C28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + cmp r1, 0 + beq _08039C64 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r2, r4, 1 + adds r0, r2, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + b _08039C76 + .pool +_08039C64: + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r2, r4, 1 + adds r0, r2, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 +_08039C76: + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + bne _08039D2C + ldr r0, =objc_dp11b_pingpong + bl CreateInvisibleSpriteWithCallback + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + cmp r0, 0x1 + bne _08039CD0 + ldr r0, =gHealthBoxesIds + adds r0, r4, r0 + ldrb r7, [r0] + ldr r2, =gUnknown_020244D0 + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r1, r6, r4 + lsls r1, 2 + adds r0, r1, r0 + strb r5, [r0, 0x2] + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + ldr r2, =gSprites + lsls r3, r5, 4 + adds r0, r3, r5 + lsls r0, 2 + adds r0, r2 + movs r1, 0x80 + b _08039CFE + .pool +_08039CD0: + ldr r0, =gBankSpriteIds + adds r0, r4, r0 + ldrb r7, [r0] + ldr r2, =gUnknown_020244D0 + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r1, r6, r4 + lsls r1, 2 + adds r0, r1, r0 + strb r5, [r0, 0x3] + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r2, =gSprites + lsls r3, r5, 4 + adds r0, r3, r5 + lsls r0, 2 + adds r0, r2 + movs r1, 0xC0 +_08039CFE: + strh r1, [r0, 0x2E] + adds r4, r2, 0 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r4 + mov r2, r9 + lsls r0, r2, 24 + asrs r0, 24 + movs r2, 0 + strh r0, [r1, 0x30] + mov r3, r10 + lsls r0, r3, 24 + asrs r0, 24 + strh r0, [r1, 0x32] + strh r7, [r1, 0x34] + mov r0, r8 + strh r0, [r1, 0x36] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x24] + strh r2, [r0, 0x26] +_08039D2C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp11b_obj_instanciate + + thumb_func_start dp11b_obj_free +dp11b_obj_free: @ 8039D48 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + bne _08039D9C + ldr r6, =gUnknown_020244D0 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r5, r0, 2 + adds r3, r5, r1 + ldrb r1, [r3] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08039DEA + ldr r2, =gSprites + ldrb r1, [r3, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x34] + lsls r1, 24 + lsrs r4, r1, 24 + bl DestroySprite + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r5, r1 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + b _08039DD6 + .pool +_08039D9C: + ldr r6, =gUnknown_020244D0 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r5, r0, 2 + adds r3, r5, r1 + ldrb r1, [r3] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08039DEA + ldr r2, =gSprites + ldrb r1, [r3, 0x3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x34] + lsls r1, 24 + lsrs r4, r1, 24 + bl DestroySprite + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r5, r1 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 +_08039DD6: + ands r0, r2 + strb r0, [r1] + ldr r0, =gSprites + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x24] + strh r0, [r1, 0x26] +_08039DEA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp11b_obj_free + + thumb_func_start objc_dp11b_pingpong +objc_dp11b_pingpong: @ 8039DF8 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08039E10 + movs r2, 0x2E + ldrsh r0, [r4, r2] + b _08039E14 +_08039E10: + movs r1, 0x2E + ldrsh r0, [r4, r1] +_08039E14: + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl Sin + ldr r2, =gSprites + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r4, 0x32] + adds r0, r2 + strh r0, [r1, 0x26] + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x2E] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end objc_dp11b_pingpong + + thumb_func_start sub_8039E44 +sub_8039E44: @ 8039E44 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08039E5C + ldrh r1, [r2, 0x32] + adds r0, r2, 0 + bl sub_806EEB4 +_08039E5C: + pop {r0} + bx r0 + thumb_func_end sub_8039E44 + + thumb_func_start sub_8039E60 +sub_8039E60: @ 8039E60 + push {r4,lr} + adds r4, r0, 0 + bl sub_8039E9C + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08039E7A + ldr r0, =nullsub_19 + str r0, [r4, 0x1C] +_08039E7A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039E60 + + thumb_func_start sub_8039E84 +sub_8039E84: @ 8039E84 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl StartSpriteAnim + ldr r0, =sub_8039E60 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039E84 + + thumb_func_start sub_8039E9C +sub_8039E9C: @ 8039E9C + push {lr} + adds r2, r0, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + bne _08039EBE + ldr r1, =gUnknown_0831ACE0 + adds r0, r2, 0 + adds r0, 0x2B + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + adds r0, 0x28 + strb r1, [r0] +_08039EBE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039E9C + + thumb_func_start nullsub_20 +nullsub_20: @ 8039EC8 + bx lr + thumb_func_end nullsub_20 + + thumb_func_start sub_8039ECC +sub_8039ECC: @ 8039ECC + push {lr} + bl sub_8039F40 + ldr r1, =gBattleCommunication + movs r0, 0 + strb r0, [r1, 0x1] + ldr r1, =gBattleMainFunc + ldr r0, =bc_8012FAC + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039ECC + + thumb_func_start sub_8039EF0 +sub_8039EF0: @ 8039EF0 + push {r4,r5,lr} + ldr r0, =gBattleMainFunc + ldr r0, [r0] + bl _call_via_r0 + ldr r1, =gActiveBank + movs r0, 0 + strb r0, [r1] + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r0, 0 + beq _08039F2A + ldr r5, =gBattleBankFunc + adds r4, r1, 0 +_08039F0C: + ldrb r0, [r4] + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + bl _call_via_r0 + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =gNoOfAllBanks + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _08039F0C +_08039F2A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039EF0 + + thumb_func_start sub_8039F40 +sub_8039F40: @ 8039F40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + bl sub_803D580 + bl sub_803D6A0 + movs r2, 0 + movs r3, 0 + ldr r0, =gUnknown_02024260 + mov r10, r0 + ldr r1, =gUnknown_02024258 + mov r9, r1 + ldr r0, =gUnknown_02024250 + mov r8, r0 + ldr r1, =gLastUsedMovesByBanks + mov r12, r1 + ldr r5, =gDisableStructs + movs r4, 0 + ldr r7, =gUnknown_02024240 + ldr r6, =gUnknown_02024268 +_08039F70: + ldr r0, =gStatuses3 + adds r0, r4, r0 + str r3, [r0] + movs r1, 0 +_08039F78: + adds r0, r5, r1 + strb r3, [r0] + adds r1, 0x1 + cmp r1, 0x1B + bls _08039F78 + movs r0, 0x2 + strb r0, [r5, 0x16] + ldr r1, =gUnknown_02024284 + adds r0, r2, r1 + strb r3, [r0] + mov r0, r12 + strh r3, [r0] + mov r1, r8 + strh r3, [r1] + mov r0, r9 + strh r3, [r0] + mov r1, r10 + strh r3, [r1] + ldr r0, =gUnknown_02024270 + adds r1, r2, r0 + movs r0, 0xFF + strb r0, [r1] + strh r3, [r6] + strh r3, [r7] + ldr r1, =gBattleResources + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r0, r4 + str r3, [r0] + ldr r1, =gUnknown_02024230 + adds r0, r4, r1 + str r3, [r0] + movs r0, 0x2 + add r10, r0 + add r9, r0 + add r8, r0 + add r12, r0 + adds r5, 0x1C + adds r4, 0x4 + adds r7, 0x2 + adds r6, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + ble _08039F70 + movs r5, 0 + ldr r3, =gSideTimers + ldr r4, =gSideAffecting + movs r2, 0x1 +_08039FD8: + strh r5, [r4] + movs r1, 0 +_08039FDC: + adds r0, r3, r1 + strb r5, [r0] + adds r1, 0x1 + cmp r1, 0xB + bls _08039FDC + adds r3, 0xC + adds r4, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08039FD8 + movs r1, 0 + ldr r2, =gBankAttacker + strb r1, [r2] + ldr r0, =gBankTarget + strb r1, [r0] + ldr r2, =gBattleWeather + strh r1, [r2] + ldr r1, =gUnknown_020243D0 + movs r2, 0 + movs r3, 0 +_0803A004: + adds r0, r1, r2 + strb r3, [r0] + adds r2, 0x1 + cmp r2, 0x2B + bls _0803A004 + ldr r2, =gHitMarker + movs r0, 0 + str r0, [r2] + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _0803A090 + movs r0, 0x2 + ands r1, r0 + cmp r1, 0 + bne _0803A0AE + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r1, [r0, 0x15] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0803A0AE + movs r0, 0x80 + b _0803A0AC + .pool +_0803A090: + ldr r0, =0x02000002 + ands r1, r0 + cmp r1, 0 + bne _0803A0AE + bl sub_8185FB8 + lsls r0, 24 + cmp r0, 0 + beq _0803A0AE + ldr r1, =gHitMarker + ldr r0, [r1] + movs r1, 0x80 + orrs r0, r1 + ldr r2, =gHitMarker +_0803A0AC: + str r0, [r2] +_0803A0AE: + ldr r3, =gBattleScripting + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x15] + lsls r0, 30 + lsrs r0, 31 + movs r1, 0 + strb r0, [r3, 0x1D] + ldr r0, =gUnknown_02024212 + strb r1, [r0] + ldr r0, =gBattleOutcome + strb r1, [r0] + ldr r0, =gBattleExecBuffer + str r1, [r0] + ldr r0, =gUnknown_0202432E + movs r2, 0 + strh r1, [r0] + ldr r1, =gBattleResources + ldr r0, [r1] + ldr r0, [r0, 0x8] + adds r0, 0x20 + strb r2, [r0] + ldr r0, [r1] + ldr r0, [r0, 0xC] + adds r0, 0x20 + strb r2, [r0] + ldr r5, =gUnknown_0202432C + ldr r6, =gBattleMoveDamage + ldr r7, =gUnknown_020243FC + ldr r0, =gUnknown_03005D54 + mov r8, r0 + ldr r1, =gAbsentBankFlags + mov r9, r1 + ldr r2, =gEnemyParty + mov r10, r2 + ldr r1, =gBattleCommunication + movs r2, 0 + adds r0, r1, 0x7 +_0803A0FA: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803A0FA + movs r4, 0 + strh r4, [r5] + movs r0, 0 + str r0, [r6] + strh r0, [r7] + strb r4, [r3, 0x18] + strb r4, [r3, 0x19] + mov r0, r8 + strb r4, [r0] + mov r1, r9 + strb r4, [r1] + ldr r5, =gBattleStruct + ldr r0, [r5] + adds r0, 0x6C + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x79 + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x7A + strb r4, [r0] + mov r0, r10 + movs r1, 0xB + bl GetMonData + ldr r6, [r5] + adds r6, 0x7C + ldr r2, =gBaseStats + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x8] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x000004fb + bl __divsi3 + strb r0, [r6] + ldr r0, [r5] + adds r0, 0x7B + movs r1, 0x3 + strb r1, [r0] + ldr r0, [r5] + strb r4, [r0, 0x12] + ldr r0, [r5] + adds r0, 0x4A + movs r1, 0x1 + strb r1, [r0] + movs r2, 0 + movs r1, 0 + adds r6, r5, 0 +_0803A16A: + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0x98 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xB8 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xC8 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xD0 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xE0 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xE8 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xF0 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xF8 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _0803A16A + movs r2, 0 + ldr r4, =gBattleStruct + movs r3, 0xA5 + lsls r3, 2 + movs r1, 0x6 +_0803A1BA: + ldr r0, [r4] + adds r0, r2, r0 + adds r0, r3 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _0803A1BA + ldr r0, [r6] + adds r0, 0xDF + movs r1, 0 + strb r1, [r0] + ldr r0, [r6] + adds r0, 0x92 + strb r1, [r0] + bl Random + ldr r1, =gUnknown_02024330 + strh r0, [r1] + ldr r1, =gBattleResults + movs r2, 0 + movs r3, 0 +_0803A1E4: + adds r0, r1, r2 + strb r3, [r0] + adds r2, 0x1 + cmp r2, 0x43 + bls _0803A1E4 + ldr r0, =gEnemyParty + bl IsMonShiny + ldr r3, =gBattleResults + movs r1, 0x1 + ands r1, r0 + lsls r1, 6 + ldrb r2, [r3, 0x5] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x5] + ldr r2, =gBattleStruct + ldr r0, [r2] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r2, =0x000002a1 + adds r0, r2 + strb r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039F40 + + thumb_func_start sub_803A284 +sub_803A284: @ 803A284 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, =gDisableStructs + ldr r5, =gActiveBank + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r1, sp + adds r0, r4 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r0, [r0] + str r0, [r1] + ldr r2, =gBattleMoves + ldr r3, =gCurrentMove + ldrh r1, [r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + mov r12, r4 + mov r9, r5 + ldr r6, =gStatuses3 + mov r10, r6 + cmp r0, 0x7F + beq _0803A35C + movs r5, 0 + mov r6, r9 + movs r4, 0x58 + ldr r2, =gBattleMons + adds r2, 0x18 + movs r1, 0x6 +_0803A2D4: + ldrb r0, [r6] + muls r0, r4 + adds r0, r5, r0 + adds r0, r2 + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x7 + ble _0803A2D4 + movs r5, 0 + ldr r7, =gNoOfAllBanks + ldrb r7, [r7] + cmp r5, r7 + bge _0803A348 + ldr r0, =gBattleMons + 0x50 + mov r8, r0 + ldr r4, =gDisableStructs + ldr r3, =gStatuses3 +_0803A2F6: + movs r0, 0x58 + muls r0, r5 + mov r1, r8 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 19 + ands r0, r1 + cmp r0, 0 + beq _0803A31A + ldrb r0, [r4, 0x14] + ldr r6, =gActiveBank + ldrb r6, [r6] + cmp r0, r6 + bne _0803A31A + ldr r0, =0xfbffffff + ands r1, r0 + str r1, [r2] +_0803A31A: + ldr r1, [r3] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _0803A33A + ldrb r0, [r4, 0x15] + ldr r7, =gActiveBank + ldrb r7, [r7] + cmp r0, r7 + bne _0803A33A + movs r0, 0x19 + negs r0, r0 + ands r1, r0 + str r1, [r3] + movs r0, 0 + strb r0, [r4, 0x15] +_0803A33A: + adds r4, 0x1C + adds r3, 0x4 + adds r5, 0x1 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r5, r0 + blt _0803A2F6 +_0803A348: + ldr r1, =gCurrentMove + ldrh r0, [r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r2, =gBattleMoves + adds r1, r2 + ldrb r0, [r1] + cmp r0, 0x7F + bne _0803A414 +_0803A35C: + mov r3, r9 + ldrb r1, [r3] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + ldr r0, =gBattleMons + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0x15100007 + ands r0, r1 + str r0, [r2] + ldrb r1, [r3] + lsls r1, 2 + add r1, r10 + ldr r0, [r1] + ldr r2, =0x0003043f + ands r0, r2 + str r0, [r1] + movs r5, 0 + ldr r6, =gNoOfAllBanks + ldrb r6, [r6] + cmp r5, r6 + bge _0803A430 + mov r7, r9 + movs r6, 0 +_0803A390: + ldrb r0, [r7] + bl GetBankSide + adds r4, r0, 0 + lsls r0, r5, 24 + lsrs r0, 24 + bl GetBankSide + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803A3D0 + ldr r1, =gStatuses3 + lsls r0, r5, 2 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _0803A3D0 + ldr r0, =gDisableStructs + adds r0, r6, r0 + ldrb r0, [r0, 0x15] + ldrb r3, [r7] + cmp r0, r3 + bne _0803A3D0 + movs r0, 0x19 + negs r0, r0 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + str r1, [r2] +_0803A3D0: + adds r6, 0x1C + adds r5, 0x1 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r5, r0 + blt _0803A390 + ldr r6, =gDisableStructs + mov r12, r6 + ldr r7, =gActiveBank + mov r9, r7 + b _0803A430 + .pool +_0803A414: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + ldr r1, =gBattleMons + adds r1, 0x50 + adds r0, r1 + movs r1, 0 + str r1, [r0] + mov r2, r9 + ldrb r0, [r2] + lsls r0, 2 + add r0, r10 + str r1, [r0] +_0803A430: + movs r5, 0 + ldr r3, =gBattleStruct + mov r8, r3 + ldr r6, =gUnknown_020244AC + mov r10, r6 + ldr r7, =gNoOfAllBanks + ldrb r7, [r7] + cmp r5, r7 + bge _0803A490 + ldr r3, =gBattleMons + 0x50 + ldr r7, =gBitTable + ldr r6, =gActiveBank +_0803A448: + movs r0, 0x58 + muls r0, r5 + adds r4, r0, r3 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r7 + ldr r0, [r0] + lsls r2, r0, 16 + ldr r1, [r4] + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _0803A466 + bics r1, r2 + str r1, [r4] +_0803A466: + ldr r1, [r4] + movs r0, 0xE0 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _0803A486 + mov r2, r8 + ldr r0, [r2] + adds r0, r5, r0 + ldrb r0, [r0, 0x14] + ldrb r2, [r6] + cmp r0, r2 + bne _0803A486 + ldr r0, =0xffff1fff + ands r1, r0 + str r1, [r4] +_0803A486: + adds r5, 0x1 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r5, r0 + blt _0803A448 +_0803A490: + mov r1, r9 + ldrb r0, [r1] + add r0, r10 + movs r1, 0 + strb r1, [r0] + mov r2, r9 + ldrb r0, [r2] + ldr r3, =gUnknown_020244B0 + adds r0, r3 + strb r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r6, r12 + adds r1, r0, r6 + movs r5, 0 + movs r2, 0 +_0803A4B4: + adds r0, r1, r5 + strb r2, [r0] + adds r5, 0x1 + cmp r5, 0x1B + bls _0803A4B4 + ldr r7, =gCurrentMove + ldrh r0, [r7] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r0, =gBattleMoves + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x7F + bne _0803A540 + mov r2, r9 + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + mov r1, sp + ldrb r1, [r1, 0xA] + strb r1, [r0, 0xA] + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + mov r1, sp + ldrb r1, [r1, 0x15] + strb r1, [r0, 0x15] + ldrb r0, [r2] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r12 + mov r0, sp + ldrb r2, [r0, 0xF] + lsls r2, 28 + movs r4, 0xF + lsrs r2, 28 + ldrb r3, [r1, 0xF] + movs r0, 0x10 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0xF] + mov r3, r9 + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + mov r1, sp + ldrb r1, [r1, 0xF] + lsrs r1, 4 + lsls r1, 4 + ldrb r2, [r0, 0xF] + ands r4, r2 + orrs r4, r1 + strb r4, [r0, 0xF] + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + mov r1, sp + ldrb r1, [r1, 0x14] + strb r1, [r0, 0x14] +_0803A540: + movs r0, 0 + ldr r6, =gBattleMoveFlags + strb r0, [r6] + mov r7, r9 + ldrb r1, [r7] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + movs r4, 0 + movs r1, 0x2 + strb r1, [r0, 0x16] + ldrb r0, [r7] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r12 + mov r0, sp + ldrb r0, [r0, 0x18] + movs r2, 0x2 + ands r2, r0 + ldrb r3, [r1, 0x18] + movs r0, 0x3 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x18] + ldrb r0, [r7] + lsls r0, 1 + ldr r1, =gLastUsedMovesByBanks + adds r0, r1 + movs r2, 0 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + ldr r3, =gUnknown_02024250 + adds r0, r3 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + ldr r6, =gUnknown_02024258 + adds r0, r6 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + ldr r7, =gUnknown_02024260 + adds r0, r7 + strh r4, [r0] + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + ldr r3, =gUnknown_02024240 + adds r0, r3 + strh r4, [r0] + ldrb r0, [r1] + ldr r6, =gUnknown_02024270 + adds r0, r6 + movs r1, 0xFF + strb r1, [r0] + mov r7, r9 + ldrb r0, [r7] + mov r3, r8 + ldr r1, [r3] + lsls r0, 1 + adds r0, r1 + adds r0, 0x98 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 1 + adds r0, r1 + adds r0, 0x99 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE0 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE1 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE2 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE3 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE4 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE5 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE6 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE7 + strb r2, [r0] + ldr r1, [r3] + adds r1, 0x92 + ldrb r0, [r7] + lsls r0, 2 + ldr r6, =gBitTable + adds r0, r6 + ldr r2, [r0] + ldrb r0, [r1] + bics r0, r2 + strb r0, [r1] + movs r5, 0 + ldr r7, =gNoOfAllBanks + ldrb r7, [r7] + cmp r5, r7 + bge _0803A6B4 + mov r3, r9 + mov r7, r8 + movs r6, 0 +_0803A656: + ldrb r0, [r3] + cmp r5, r0 + beq _0803A68C + lsls r0, r5, 24 + lsrs r0, 24 + str r3, [sp, 0x1C] + bl GetBankSide + adds r4, r0, 0 + ldr r3, [sp, 0x1C] + ldrb r0, [r3] + bl GetBankSide + lsls r4, 24 + lsls r0, 24 + ldr r3, [sp, 0x1C] + cmp r4, r0 + beq _0803A68C + ldr r0, [r7] + lsls r1, r5, 1 + adds r0, r1, r0 + adds r0, 0x98 + strb r6, [r0] + ldr r0, [r7] + adds r1, r0 + adds r1, 0x99 + strb r6, [r1] +_0803A68C: + ldrb r0, [r3] + ldr r1, [r7] + lsls r0, 1 + lsls r2, r5, 3 + adds r0, r2 + adds r0, r1 + adds r0, 0xE0 + strb r6, [r0] + ldrb r0, [r3] + ldr r1, [r7] + lsls r0, 1 + adds r0, r2 + adds r0, r1 + adds r0, 0xE1 + strb r6, [r0] + adds r5, 0x1 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r5, r0 + blt _0803A656 +_0803A6B4: + mov r1, r9 + ldrb r0, [r1] + mov r2, r8 + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + movs r2, 0 + strb r2, [r0] + mov r3, r9 + ldrb r0, [r3] + mov r6, r8 + ldr r1, [r6] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + strb r2, [r0] + ldr r0, =gBattleResources + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldrb r0, [r3] + lsls r0, 2 + adds r1, r0 + movs r2, 0 + str r2, [r1] + ldr r0, =gCurrentMove + strh r2, [r0] + ldr r0, [r6] + adds r0, 0xDA + movs r1, 0xFF + strb r1, [r0] + ldrb r0, [r3] + bl ClearBankMoveHistory + mov r7, r9 + ldrb r0, [r7] + bl ClearBankAbilityHistory + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803A284 + + thumb_func_start sub_803A75C +sub_803A75C: @ 803A75C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r5, 0 + ldr r6, =gBattleMons + ldr r0, =gStatuses3 + mov r8, r0 + ldr r1, =gBattleStruct + mov r12, r1 + ldr r2, =gUnknown_020244AC + mov r9, r2 + ldr r3, =gUnknown_020244B0 + mov r10, r3 + ldr r7, =gProtectStructs + ldr r4, =gActiveBank + movs r3, 0x58 + adds r2, r6, 0 + adds r2, 0x18 + movs r1, 0x6 +_0803A788: + ldrb r0, [r4] + muls r0, r3 + adds r0, r5, r0 + adds r0, r2 + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x7 + ble _0803A788 + ldr r0, =gActiveBank + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r2, r6, 0 + adds r2, 0x50 + adds r0, r2 + movs r1, 0 + str r1, [r0] + ldr r3, =gActiveBank + ldrb r0, [r3] + lsls r0, 2 + add r0, r8 + str r1, [r0] + movs r5, 0 + ldr r6, =gNoOfAllBanks + ldrb r6, [r6] + cmp r5, r6 + bge _0803A830 + adds r3, r2, 0 + movs r4, 0 + ldr r0, =gBitTable + mov r8, r0 +_0803A7C6: + ldr r1, [r3] + movs r0, 0x80 + lsls r0, 19 + ands r0, r1 + cmp r0, 0 + beq _0803A7E6 + ldr r2, =gDisableStructs + adds r0, r4, r2 + ldrb r0, [r0, 0x14] + ldr r6, =gActiveBank + ldrb r6, [r6] + cmp r0, r6 + bne _0803A7E6 + ldr r0, =0xfbffffff + ands r1, r0 + str r1, [r3] +_0803A7E6: + ldr r1, =gActiveBank + ldrb r0, [r1] + lsls r0, 2 + add r0, r8 + ldr r0, [r0] + lsls r2, r0, 16 + ldr r1, [r3] + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _0803A800 + bics r1, r2 + str r1, [r3] +_0803A800: + ldr r1, [r3] + movs r0, 0xE0 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _0803A822 + mov r2, r12 + ldr r0, [r2] + adds r0, r5, r0 + ldrb r0, [r0, 0x14] + ldr r6, =gActiveBank + ldrb r6, [r6] + cmp r0, r6 + bne _0803A822 + ldr r0, =0xffff1fff + ands r1, r0 + str r1, [r3] +_0803A822: + adds r3, 0x58 + adds r4, 0x1C + adds r5, 0x1 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r5, r0 + blt _0803A7C6 +_0803A830: + ldr r1, =gActiveBank + ldrb r0, [r1] + add r0, r9 + movs r1, 0 + strb r1, [r0] + ldr r2, =gActiveBank + ldrb r0, [r2] + add r0, r10 + strb r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r3, =gDisableStructs + adds r1, r0, r3 + movs r5, 0 + movs r2, 0 +_0803A852: + adds r0, r1, r5 + strb r2, [r0] + adds r5, 0x1 + cmp r5, 0x1B + bls _0803A852 + ldr r6, =gActiveBank + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + mov r9, r0 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r3, 0x3 + negs r3, r3 + mov r8, r3 + mov r0, r8 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r6, 0x5 + negs r6, r6 + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + ldr r0, =gActiveBank + ldrb r1, [r0] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + subs r3, 0x6 + mov r10, r3 + mov r0, r10 + ands r0, r2 + strb r0, [r1] + ldr r0, =gActiveBank + ldrb r1, [r0] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r2, =gActiveBank + ldrb r1, [r2] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r5, 0x21 + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + strb r0, [r1] + ldr r3, =gActiveBank + ldrb r1, [r3] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r4, 0x41 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r3] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldr r0, =gActiveBank + ldrb r1, [r0] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1, 0x1] + mov r0, r9 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r2, =gActiveBank + ldrb r1, [r2] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1, 0x1] + mov r0, r8 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r0, =gActiveBank + ldrb r1, [r0] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1, 0x1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r2, =gActiveBank + ldrb r1, [r2] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1, 0x1] + movs r0, 0x19 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r1, =gActiveBank + ldrb r0, [r1] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x1] + ands r5, r1 + strb r5, [r0, 0x1] + ldr r2, =gActiveBank + ldrb r0, [r2] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x1] + ands r4, r1 + strb r4, [r0, 0x1] + ldrb r0, [r2] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x1] + ands r3, r1 + strb r3, [r0, 0x1] + ldrb r0, [r2] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x2] + mov r3, r9 + ands r3, r1 + strb r3, [r0, 0x2] + ldrb r0, [r2] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x2] + mov r2, r8 + ands r2, r1 + strb r2, [r0, 0x2] + ldr r3, =gActiveBank + ldrb r0, [r3] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x2] + ands r6, r1 + strb r6, [r0, 0x2] + ldrb r0, [r3] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x2] + mov r6, r10 + ands r6, r1 + strb r6, [r0, 0x2] + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =gDisableStructs + adds r0, r1 + movs r2, 0 + movs r1, 0x2 + strb r1, [r0, 0x16] + ldrb r0, [r3] + lsls r0, 1 + ldr r3, =gLastUsedMovesByBanks + adds r0, r3 + movs r3, 0 + strh r2, [r0] + ldr r6, =gActiveBank + ldrb r0, [r6] + lsls r0, 1 + ldr r1, =gUnknown_02024250 + adds r0, r1 + strh r2, [r0] + ldrb r0, [r6] + lsls r0, 1 + ldr r6, =gUnknown_02024258 + adds r0, r6 + strh r2, [r0] + ldr r1, =gActiveBank + ldrb r0, [r1] + lsls r0, 1 + ldr r6, =gUnknown_02024260 + adds r0, r6 + strh r2, [r0] + ldrb r0, [r1] + lsls r0, 1 + ldr r1, =gUnknown_02024240 + adds r0, r1 + strh r2, [r0] + ldr r2, =gActiveBank + ldrb r0, [r2] + ldr r6, =gUnknown_02024270 + adds r0, r6 + movs r1, 0xFF + strb r1, [r0] + ldrb r0, [r2] + mov r2, r12 + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + strb r3, [r0] + ldr r6, =gActiveBank + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0x98 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0x99 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE0 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE1 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE2 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE3 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE4 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE5 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE6 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE7 + strb r3, [r0] + ldr r1, [r2] + adds r1, 0x92 + ldrb r0, [r6] + lsls r0, 2 + ldr r2, =gBitTable + adds r0, r2 + ldr r2, [r0] + ldrb r0, [r1] + bics r0, r2 + strb r0, [r1] + movs r5, 0 + ldr r3, =gNoOfAllBanks + ldrb r3, [r3] + cmp r5, r3 + bge _0803AB02 + adds r3, r6, 0 + mov r7, r12 + movs r6, 0 +_0803AAA4: + ldrb r0, [r3] + cmp r5, r0 + beq _0803AADA + lsls r0, r5, 24 + lsrs r0, 24 + str r3, [sp] + bl GetBankSide + adds r4, r0, 0 + ldr r3, [sp] + ldrb r0, [r3] + bl GetBankSide + lsls r4, 24 + lsls r0, 24 + ldr r3, [sp] + cmp r4, r0 + beq _0803AADA + ldr r0, [r7] + lsls r1, r5, 1 + adds r0, r1, r0 + adds r0, 0x98 + strb r6, [r0] + ldr r0, [r7] + adds r1, r0 + adds r1, 0x99 + strb r6, [r1] +_0803AADA: + ldrb r0, [r3] + ldr r1, [r7] + lsls r0, 1 + lsls r2, r5, 3 + adds r0, r2 + adds r0, r1 + adds r0, 0xE0 + strb r6, [r0] + ldrb r0, [r3] + ldr r1, [r7] + lsls r0, 1 + adds r0, r2 + adds r0, r1 + adds r0, 0xE1 + strb r6, [r0] + adds r5, 0x1 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r5, r0 + blt _0803AAA4 +_0803AB02: + ldr r0, =gBattleResources + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldr r2, =gActiveBank + ldrb r0, [r2] + lsls r0, 2 + adds r1, r0 + movs r0, 0 + str r0, [r1] + ldr r4, =gBattleMons + ldrb r0, [r2] + movs r3, 0x58 + adds r2, r0, 0 + muls r2, r3 + b _0803AB6C + .pool +_0803AB6C: + adds r2, r4 + ldr r5, =gBaseStats + ldrh r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x6] + adds r2, 0x21 + strb r0, [r2] + ldr r6, =gActiveBank + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r3 + adds r1, r4 + ldrh r2, [r1] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x7] + adds r1, 0x22 + strb r0, [r1] + ldrb r0, [r6] + bl ClearBankMoveHistory + ldrb r0, [r6] + bl ClearBankAbilityHistory + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803A75C + + thumb_func_start bc_8012FAC +bc_8012FAC: @ 803ABC0 + push {r4,r5,lr} + ldr r5, =gBattleCommunication + ldrb r0, [r5] + cmp r0, 0 + beq _0803ABD4 + cmp r0, 0x1 + beq _0803ABF8 + b _0803AC2E + .pool +_0803ABD4: + ldr r4, =gActiveBank + ldrb r0, [r5, 0x1] + strb r0, [r4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x00_a_b_0 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _0803AC2E + .pool +_0803ABF8: + ldr r0, =gBattleExecBuffer + ldr r2, [r0] + cmp r2, 0 + bne _0803AC2E + ldrb r0, [r5, 0x1] + adds r0, 0x1 + strb r0, [r5, 0x1] + ldr r1, =gNoOfAllBanks + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _0803AC2C + ldr r1, =gBattleMainFunc + ldr r0, =bc_load_battlefield + str r0, [r1] + b _0803AC2E + .pool +_0803AC2C: + strb r2, [r5] +_0803AC2E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end bc_8012FAC + + thumb_func_start bc_load_battlefield +bc_load_battlefield: @ 803AC34 + push {r4,r5,lr} + ldr r0, =gBattleExecBuffer + ldr r5, [r0] + cmp r5, 0 + bne _0803AC64 + movs r0, 0 + bl GetBankByPlayerAI + ldr r4, =gActiveBank + strb r0, [r4] + ldr r0, =gUnknown_02022FF0 + ldrb r1, [r0] + movs r0, 0 + bl dp01_build_cmdbuf_x2E_a + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =gBattleMainFunc + ldr r0, =sub_803AC84 + str r0, [r1] + ldr r0, =gBattleCommunication + strb r5, [r0] + strb r5, [r0, 0x1] +_0803AC64: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end bc_load_battlefield + + thumb_func_start sub_803AC84 +sub_803AC84: @ 803AC84 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gBattleExecBuffer + ldr r1, [r0] + cmp r1, 0 + beq _0803AC98 + b _0803AF4E +_0803AC98: + ldr r2, =gActiveBank + strb r1, [r2] + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r1, r0 + bcc _0803ACA6 + b _0803AF48 +_0803ACA6: + movs r7, 0x58 + ldr r0, =gBattleMons + mov r8, r0 + mov r9, r2 + movs r1, 0x48 + add r1, r8 + mov r10, r1 +_0803ACB4: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803ACFC + ldr r4, =gActiveBank + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0803ACFC + ldrb r0, [r4] + muls r0, r7 + mov r2, r8 + adds r3, r0, r2 + movs r2, 0 + movs r1, 0 +_0803ACDA: + adds r0, r3, r2 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x57 + bls _0803ACDA + b _0803ADCA + .pool +_0803ACFC: + mov r1, r9 + ldrb r0, [r1] + muls r0, r7 + mov r2, r8 + adds r3, r0, r2 + movs r2, 0 + ldr r6, =gBaseStats + ldr r5, =gBattleBufferB + ldr r4, =gActiveBank +_0803AD0E: + adds r0, r3, r2 + ldrb r1, [r4] + lsls r1, 9 + adds r1, 0x4 + adds r1, r2, r1 + adds r1, r5 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x57 + bls _0803AD0E + mov r1, r9 + ldrb r0, [r1] + adds r2, r0, 0 + muls r2, r7 + add r2, r8 + ldrh r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x6] + adds r2, 0x21 + strb r0, [r2] + mov r2, r9 + ldrb r0, [r2] + adds r2, r0, 0 + muls r2, r7 + add r2, r8 + ldrh r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x7] + adds r2, 0x22 + strb r0, [r2] + mov r1, r9 + ldrb r0, [r1] + adds r1, r0, 0 + muls r1, r7 + add r1, r8 + ldrh r0, [r1] + ldrb r1, [r1, 0x17] + lsrs r1, 7 + bl GetAbilityBySpecies + mov r2, r9 + ldrb r1, [r2] + muls r1, r7 + add r1, r8 + adds r1, 0x20 + strb r0, [r1] + ldrb r0, [r2] + bl GetBankSide + ldr r1, =gBattleStruct + lsls r0, 24 + lsrs r0, 23 + adds r0, 0xA8 + ldr r1, [r1] + adds r1, r0 + mov r2, r9 + ldrb r0, [r2] + muls r0, r7 + add r0, r8 + ldrh r0, [r0, 0x28] + strh r0, [r1] + movs r2, 0 + ldr r4, =gActiveBank + movs r5, 0x58 + ldr r1, =gBattleMons + 0x18 + adds r6, r4, 0 + movs r0, 0x18 + negs r0, r0 + adds r0, r1 + mov r12, r0 + movs r3, 0x6 +_0803ADAA: + ldrb r0, [r4] + muls r0, r5 + adds r0, r2, r0 + adds r0, r1 + strb r3, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _0803ADAA + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r7 + mov r0, r12 + adds r0, 0x50 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_0803ADCA: + ldr r4, =gActiveBank + ldrb r0, [r4] + bl GetBankIdentity + lsls r0, 24 + cmp r0, 0 + bne _0803ADE4 + movs r0, 0 + bl dp01_build_cmdbuf_x07_7_7_7 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803ADE4: + ldr r5, =gBattleTypeFlags + ldr r0, [r5] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0803AE60 + ldrb r0, [r4] + bl GetBankIdentity + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803AE0A + movs r0, 0 + bl dp01_build_cmdbuf_x07_7_7_7 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803AE0A: + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803AEC0 + ldr r0, [r5] + ldr r1, =0x063f0902 + ands r0, r1 + cmp r0, 0 + bne _0803AEC0 + ldrb r0, [r4] + muls r0, r7 + add r0, r8 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4] + muls r1, r7 + add r1, r10 + ldr r2, [r1] + movs r1, 0x2 + bl SetPokedexFlag + b _0803AEC0 + .pool +_0803AE60: + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803AEC0 + ldr r0, [r5] + ldr r1, =0x063f0902 + ands r0, r1 + cmp r0, 0 + bne _0803AE96 + ldrb r0, [r4] + muls r0, r7 + add r0, r8 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4] + muls r1, r7 + add r1, r10 + ldr r2, [r1] + movs r1, 0x2 + bl SetPokedexFlag +_0803AE96: + movs r0, 0 + bl dp01_build_cmdbuf_x04_4_4_4 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =gBattlePartyID + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + ldr r1, =gBattleResults + strh r0, [r1, 0x20] +_0803AEC0: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0803AEF6 + ldr r4, =gActiveBank + ldrb r0, [r4] + bl GetBankIdentity + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _0803AEEA + ldrb r0, [r4] + bl GetBankIdentity + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0803AEF6 +_0803AEEA: + movs r0, 0 + bl dp01_build_cmdbuf_x07_7_7_7 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803AEF6: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0803AF20 + ldr r4, =gActiveBank + ldrb r0, [r4] + bl GetBankIdentity + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0803AF20 + movs r0, 0 + bl dp01_build_cmdbuf_x07_7_7_7 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803AF20: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0803AF32 + bl sub_81A56B4 +_0803AF32: + mov r1, r9 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =gNoOfAllBanks + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcs _0803AF48 + b _0803ACB4 +_0803AF48: + ldr r1, =gBattleMainFunc + ldr r0, =bc_801333C + str r0, [r1] +_0803AF4E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803AC84 + + thumb_func_start bc_801333C +bc_801333C: @ 803AF80 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x30 + ldr r0, =gBattleExecBuffer + ldr r0, [r0] + cmp r0, 0 + beq _0803AF92 + b _0803B10C +_0803AF92: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0803AFA0 + b _0803B0AC +_0803AFA0: + movs r7, 0 + add r0, sp, 0x4 + mov r8, r0 + mov r6, r8 + mov r5, sp +_0803AFAA: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =gEnemyParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl GetMonData + cmp r0, 0 + beq _0803AFD0 + adds r0, r4, 0 + movs r1, 0x41 + bl GetMonData + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0803AFE8 +_0803AFD0: + ldr r0, =0x0000ffff + strh r0, [r5] + movs r0, 0 + b _0803AFFA + .pool +_0803AFE8: + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData +_0803AFFA: + str r0, [r6] + adds r6, 0x8 + adds r5, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _0803AFAA + movs r0, 0x1 + bl GetBankByPlayerAI + ldr r4, =gActiveBank + strb r0, [r4] + movs r0, 0 + mov r1, sp + movs r2, 0x80 + bl dp01_build_cmdbuf_x30_TODO + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + movs r7, 0 + mov r6, r8 + mov r5, sp +_0803B026: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl GetMonData + cmp r0, 0 + beq _0803B04C + adds r0, r4, 0 + movs r1, 0x41 + bl GetMonData + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0803B060 +_0803B04C: + ldr r0, =0x0000ffff + strh r0, [r5] + movs r0, 0 + b _0803B072 + .pool +_0803B060: + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData +_0803B072: + str r0, [r6] + adds r6, 0x8 + adds r5, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _0803B026 + movs r0, 0 + bl GetBankByPlayerAI + ldr r4, =gActiveBank + strb r0, [r4] + movs r0, 0 + mov r1, sp + movs r2, 0x80 + bl dp01_build_cmdbuf_x30_TODO + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =gBattleMainFunc + ldr r0, =bc_battle_begin_message + b _0803B10A + .pool +_0803B0AC: + movs r7, 0 + add r6, sp, 0x4 + mov r5, sp +_0803B0B2: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl GetMonData + cmp r0, 0 + beq _0803B0D8 + adds r0, r4, 0 + movs r1, 0x41 + bl GetMonData + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0803B0E8 +_0803B0D8: + ldr r0, =0x0000ffff + strh r0, [r5] + movs r0, 0 + b _0803B0FA + .pool +_0803B0E8: + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData +_0803B0FA: + str r0, [r6] + adds r6, 0x8 + adds r5, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _0803B0B2 + ldr r1, =gBattleMainFunc + ldr r0, =bc_8013568 +_0803B10A: + str r0, [r1] +_0803B10C: + add sp, 0x30 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bc_801333C + + thumb_func_start bc_battle_begin_message +bc_battle_begin_message: @ 803B120 + push {lr} + ldr r0, =gBattleExecBuffer + ldr r0, [r0] + cmp r0, 0 + bne _0803B142 + movs r0, 0x1 + bl GetBankByPlayerAI + ldr r1, =gActiveBank + strb r0, [r1] + ldrb r1, [r1] + movs r0, 0 + bl b_std_message + ldr r1, =gBattleMainFunc + ldr r0, =sub_803B180 + str r0, [r1] +_0803B142: + pop {r0} + bx r0 + .pool + thumb_func_end bc_battle_begin_message + + thumb_func_start bc_8013568 +bc_8013568: @ 803B158 + push {lr} + ldr r0, =gBattleExecBuffer + ldr r0, [r0] + cmp r0, 0 + bne _0803B170 + ldr r1, =gBattleMainFunc + ldr r0, =sub_803B3CC + str r0, [r1] + movs r0, 0 + movs r1, 0 + bl b_std_message +_0803B170: + pop {r0} + bx r0 + .pool + thumb_func_end bc_8013568 + + thumb_func_start sub_803B180 +sub_803B180: @ 803B180 + push {lr} + ldr r0, =gBattleExecBuffer + ldr r0, [r0] + cmp r0, 0 + bne _0803B1D0 + ldr r0, =gBattleTypeFlags + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r2 + cmp r0, 0 + beq _0803B1B8 + movs r0, 0x80 + lsls r0, 18 + ands r0, r2 + cmp r0, 0 + beq _0803B1B8 + movs r1, 0x80 + lsls r1, 24 + ands r1, r2 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _0803B1BA + .pool +_0803B1B8: + movs r0, 0x1 +_0803B1BA: + bl GetBankByPlayerAI + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + bl b_std_message + ldr r1, =gBattleMainFunc + ldr r0, =sub_803B25C + str r0, [r1] +_0803B1D0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B180 + + thumb_func_start sub_803B1DC +sub_803B1DC: @ 803B1DC + push {r4,r5,lr} + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _0803B1FC + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0803B1FC + movs r5, 0x2 + cmp r1, 0 + bge _0803B1FE +_0803B1FC: + movs r5, 0x3 +_0803B1FE: + ldr r1, =gActiveBank + movs r0, 0 + strb r0, [r1] + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r0, 0 + beq _0803B23A + adds r4, r1, 0 +_0803B20E: + ldrb r0, [r4] + bl GetBankIdentity + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _0803B228 + movs r0, 0 + bl dp01_build_cmdbuf_x2F_2F_2F_2F + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803B228: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =gNoOfAllBanks + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B20E +_0803B23A: + ldr r1, =gBattleMainFunc + ldr r0, =bc_801362C + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B1DC + + thumb_func_start sub_803B25C +sub_803B25C: @ 803B25C + push {r4-r6,lr} + ldr r0, =gBattleTypeFlags + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r2 + cmp r0, 0 + beq _0803B298 + movs r0, 0x80 + lsls r0, 18 + ands r0, r2 + cmp r0, 0 + beq _0803B298 + movs r1, 0x80 + lsls r1, 24 + ands r1, r2 + negs r0, r1 + orrs r0, r1 + lsrs r5, r0, 31 + b _0803B29A + .pool +_0803B288: + ldr r1, =gBattleMainFunc + ldr r0, =sub_803B1DC + b _0803B2F0 + .pool +_0803B298: + movs r5, 0x1 +_0803B29A: + ldr r0, =gBattleExecBuffer + ldr r2, [r0] + cmp r2, 0 + bne _0803B2F2 + ldr r0, =gActiveBank + strb r2, [r0] + ldr r1, =gNoOfAllBanks + adds r4, r0, 0 + ldrb r1, [r1] + cmp r2, r1 + bcs _0803B2EC + adds r6, r4, 0 +_0803B2B2: + ldrb r0, [r4] + bl GetBankIdentity + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _0803B2D8 + movs r0, 0 + bl dp01_build_cmdbuf_x2F_2F_2F_2F + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + ldr r1, =0x00008040 + ands r0, r1 + cmp r0, 0 + bne _0803B288 +_0803B2D8: + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + ldr r1, =gNoOfAllBanks + lsls r0, 24 + lsrs r0, 24 + ldr r4, =gActiveBank + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B2B2 +_0803B2EC: + ldr r1, =gBattleMainFunc + ldr r0, =bc_801362C +_0803B2F0: + str r0, [r1] +_0803B2F2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B25C + + thumb_func_start bc_801362C +bc_801362C: @ 803B314 + push {r4-r7,lr} + ldr r0, =gBattleExecBuffer + ldr r1, [r0] + cmp r1, 0 + bne _0803B384 + ldr r2, =gActiveBank + strb r1, [r2] + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r1, r0 + bcs _0803B37E + adds r4, r2, 0 + ldr r6, =gBattleMons + movs r5, 0x58 + adds r7, r6, 0 + adds r7, 0x48 +_0803B334: + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803B36C + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + ldr r1, =0x063f0902 + ands r0, r1 + cmp r0, 0 + bne _0803B36C + ldrb r0, [r4] + muls r0, r5 + adds r0, r6 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4] + muls r1, r5 + adds r1, r7 + ldr r2, [r1] + movs r1, 0x2 + bl SetPokedexFlag +_0803B36C: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =gNoOfAllBanks + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B334 +_0803B37E: + ldr r1, =gBattleMainFunc + ldr r0, =sub_803B3CC + str r0, [r1] +_0803B384: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bc_801362C + + thumb_func_start sub_803B3AC +sub_803B3AC: @ 803B3AC + push {lr} + ldr r0, =gBattleExecBuffer + ldr r0, [r0] + cmp r0, 0 + bne _0803B3BC + ldr r1, =gBattleMainFunc + ldr r0, =sub_803B3CC + str r0, [r1] +_0803B3BC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B3AC + + thumb_func_start sub_803B3CC +sub_803B3CC: @ 803B3CC + push {lr} + ldr r0, =gBattleExecBuffer + ldr r0, [r0] + cmp r0, 0 + bne _0803B418 + ldr r1, =gBattleTypeFlags + ldr r2, [r1] + movs r0, 0x80 + lsls r0, 17 + ands r0, r2 + cmp r0, 0 + beq _0803B3F4 + movs r0, 0x80 + lsls r0, 18 + ands r0, r2 + cmp r0, 0 + beq _0803B3F4 + movs r3, 0x1 + cmp r2, 0 + bge _0803B3F6 +_0803B3F4: + movs r3, 0 +_0803B3F6: + ldr r0, [r1] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0803B412 + adds r0, r3, 0 + bl GetBankByPlayerAI + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + bl b_std_message +_0803B412: + ldr r1, =gBattleMainFunc + ldr r0, =sub_803B4C8 + str r0, [r1] +_0803B418: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B3CC + + thumb_func_start sub_803B42C +sub_803B42C: @ 803B42C + push {r4,r5,lr} + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _0803B44C + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0803B44C + movs r5, 0x3 + cmp r1, 0 + bge _0803B44E +_0803B44C: + movs r5, 0x2 +_0803B44E: + ldr r1, =gActiveBank + movs r0, 0 + strb r0, [r1] + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r0, 0 + beq _0803B48A + adds r4, r1, 0 +_0803B45E: + ldrb r0, [r4] + bl GetBankIdentity + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _0803B478 + movs r0, 0 + bl dp01_build_cmdbuf_x2F_2F_2F_2F + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803B478: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =gNoOfAllBanks + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B45E +_0803B48A: + ldr r2, =gBattleStruct + ldr r0, [r2] + adds r0, 0x4C + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xD9 + strb r1, [r0] + ldr r0, [r2] + movs r2, 0xD1 + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + ldr r1, =gBattleMainFunc + ldr r0, =sub_803B628 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B42C + + thumb_func_start sub_803B4C8 +sub_803B4C8: @ 803B4C8 + push {r4-r6,lr} + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _0803B500 + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0803B500 + movs r6, 0x1 + cmp r1, 0 + bge _0803B502 + b _0803B500 + .pool +_0803B4F0: + ldr r1, =gBattleMainFunc + ldr r0, =sub_803B42C + b _0803B572 + .pool +_0803B500: + movs r6, 0 +_0803B502: + ldr r0, =gBattleExecBuffer + ldr r2, [r0] + cmp r2, 0 + bne _0803B574 + ldr r0, =gActiveBank + strb r2, [r0] + ldr r1, =gNoOfAllBanks + adds r4, r0, 0 + ldrb r1, [r1] + cmp r2, r1 + bcs _0803B554 + adds r5, r4, 0 +_0803B51A: + ldrb r0, [r4] + bl GetBankIdentity + lsls r0, 24 + lsrs r0, 24 + cmp r0, r6 + bne _0803B540 + movs r0, 0 + bl dp01_build_cmdbuf_x2F_2F_2F_2F + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0803B4F0 +_0803B540: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r1, =gNoOfAllBanks + lsls r0, 24 + lsrs r0, 24 + ldr r4, =gActiveBank + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B51A +_0803B554: + ldr r2, =gBattleStruct + ldr r0, [r2] + adds r0, 0x4C + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xD9 + strb r1, [r0] + ldr r0, [r2] + movs r2, 0xD1 + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + ldr r1, =gBattleMainFunc + ldr r0, =sub_803B628 +_0803B572: + str r0, [r1] +_0803B574: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B4C8 + + thumb_func_start sub_803B598 +sub_803B598: @ 803B598 + push {r4,r5,lr} + ldr r0, =gBattleExecBuffer + ldr r1, [r0] + cmp r1, 0 + bne _0803B606 + ldr r2, =gActiveBank + strb r1, [r2] + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r1, r0 + bcs _0803B5E6 + adds r4, r2, 0 + ldr r5, =gBattlePartyID +_0803B5B2: + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0803B5D4 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r5 + ldrb r1, [r0] + movs r0, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x05_a_b_c + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803B5D4: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =gNoOfAllBanks + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B5B2 +_0803B5E6: + ldr r2, =gBattleStruct + ldr r0, [r2] + adds r0, 0x4C + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xD9 + strb r1, [r0] + ldr r0, [r2] + movs r2, 0xD1 + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + ldr r1, =gBattleMainFunc + ldr r0, =sub_803B628 + str r0, [r1] +_0803B606: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B598 + + thumb_func_start sub_803B628 +sub_803B628: @ 803B628 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0 + mov r9, r0 + ldr r0, =gBattleExecBuffer + ldr r0, [r0] + cmp r0, 0 + beq _0803B642 + b _0803B8B2 +_0803B642: + ldr r0, =gBattleStruct + ldr r0, [r0] + adds r0, 0x4C + ldrb r0, [r0] + cmp r0, 0 + bne _0803B6C2 + movs r5, 0 + ldr r1, =gNoOfAllBanks + mov r10, r1 + ldrb r3, [r1] + cmp r5, r3 + bge _0803B668 + ldr r2, =gTurnOrder +_0803B65C: + adds r0, r5, r2 + strb r5, [r0] + adds r5, 0x1 + ldrb r0, [r1] + cmp r5, r0 + blt _0803B65C +_0803B668: + movs r5, 0 + b _0803B6B8 + .pool +_0803B67C: + adds r4, r5, 0x1 + mov r8, r4 + ldrb r1, [r1] + cmp r8, r1 + bge _0803B6B6 + ldr r6, =gTurnOrder + ldr r1, =gNoOfAllBanks + mov r10, r1 + lsls r7, r5, 24 +_0803B68E: + adds r0, r5, r6 + ldrb r0, [r0] + adds r1, r4, r6 + ldrb r1, [r1] + movs r2, 0x1 + bl b_first_side + lsls r0, 24 + cmp r0, 0 + beq _0803B6AC + lsls r1, r4, 24 + lsrs r1, 24 + lsrs r0, r7, 24 + bl sub_803CEDC +_0803B6AC: + adds r4, 0x1 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r4, r0 + blt _0803B68E +_0803B6B6: + mov r5, r8 +_0803B6B8: + mov r1, r10 + ldrb r0, [r1] + subs r0, 0x1 + cmp r5, r0 + blt _0803B67C +_0803B6C2: + ldr r5, =gBattleStruct + ldr r0, [r5] + movs r4, 0xD1 + lsls r4, 1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _0803B6FC + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0xFF + bl AbilityBattleEffects + lsls r0, 24 + cmp r0, 0 + beq _0803B6FC + ldr r0, [r5] + adds r0, r4 + movs r1, 0x1 + strb r1, [r0] + b _0803B8B2 + .pool +_0803B6FC: + ldr r2, =gBattleStruct + ldr r0, [r2] + adds r0, 0x4C + ldr r1, =gNoOfAllBanks + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _0803B756 + ldr r5, =gTurnOrder + adds r4, r2, 0 +_0803B710: + ldr r0, [r4] + adds r0, 0x4C + ldrb r0, [r0] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r2, 0 + movs r3, 0 + bl AbilityBattleEffects + lsls r0, 24 + cmp r0, 0 + beq _0803B736 + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0803B736: + ldr r1, [r4] + adds r1, 0x4C + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r3, r9 + cmp r3, 0 + beq _0803B748 + b _0803B8B2 +_0803B748: + ldr r0, [r4] + adds r0, 0x4C + ldr r1, =gNoOfAllBanks + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B710 +_0803B756: + movs r0, 0 + str r0, [sp] + movs r0, 0x9 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AbilityBattleEffects + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0803B770 + b _0803B8B2 +_0803B770: + str r0, [sp] + movs r0, 0xB + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AbilityBattleEffects + lsls r0, 24 + cmp r0, 0 + beq _0803B786 + b _0803B8B2 +_0803B786: + ldr r2, =gBattleStruct + ldr r0, [r2] + adds r0, 0xD9 + ldr r1, =gNoOfAllBanks + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _0803B7DA + ldr r5, =gTurnOrder + adds r4, r2, 0 +_0803B79A: + ldr r0, [r4] + adds r0, 0xD9 + ldrb r0, [r0] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0 + movs r2, 0 + bl berry_effects_maybe + lsls r0, 24 + cmp r0, 0 + beq _0803B7BC + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0803B7BC: + ldr r1, [r4] + adds r1, 0xD9 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r0, r9 + cmp r0, 0 + bne _0803B8B2 + ldr r0, [r4] + adds r0, 0xD9 + ldr r1, =gNoOfAllBanks + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B79A +_0803B7DA: + movs r5, 0 + ldr r1, =gBattleStruct + mov r8, r1 + movs r7, 0x6 + ldr r6, =gUnknown_0202421C + ldr r2, =gUnknown_02024274 + movs r4, 0xFF + movs r3, 0 +_0803B7EA: + mov r1, r8 + ldr r0, [r1] + adds r0, r5, r0 + adds r0, 0x5C + strb r7, [r0] + adds r1, r5, r6 + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + strh r3, [r2] + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0803B7EA + movs r0, 0 + bl sub_803D580 + bl sub_803D6A0 + ldr r0, =gBattleStruct + ldr r0, [r0] + adds r0, 0x91 + ldr r1, =gAbsentBankFlags + ldrb r1, [r1] + strb r1, [r0] + ldr r0, =gUnknown_085CC23E + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =gBattleMainFunc + ldr r0, =sub_803BE74 + str r0, [r1] + bl sub_803F988 + ldr r1, =gBattleCommunication + movs r2, 0 + adds r0, r1, 0x7 +_0803B834: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803B834 + movs r5, 0 + ldr r3, =gNoOfAllBanks + ldr r2, =gBattleStruct + ldr r6, =gBattleScripting + ldr r7, =gBattleMoveFlags + ldrb r0, [r3] + cmp r5, r0 + bge _0803B866 + ldr r0, =gBattleMons + movs r4, 0x9 + negs r4, r4 + adds r1, r0, 0 + adds r1, 0x50 +_0803B856: + ldr r0, [r1] + ands r0, r4 + str r0, [r1] + adds r1, 0x58 + adds r5, 0x1 + ldrb r0, [r3] + cmp r5, r0 + blt _0803B856 +_0803B866: + ldr r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + ldr r0, [r2] + movs r3, 0xD0 + lsls r3, 1 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x1 + adds r0, r3 + strb r1, [r0] + movs r1, 0 + strb r1, [r6, 0x14] + ldr r0, [r2] + adds r0, 0x4D + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x3] + strb r1, [r7] + bl Random + ldr r1, =gUnknown_02024330 + strh r0, [r1] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0803B8B2 + bl StopCryAndClearCrySongs + ldr r0, =gUnknown_082DB8BE + bl b_call_bc_move_exec +_0803B8B2: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B628 + + thumb_func_start bc_8013B1C +bc_8013B1C: @ 803B904 + push {r4-r6,lr} + ldr r0, =gBattleExecBuffer + ldr r0, [r0] + cmp r0, 0 + bne _0803B994 + ldr r1, =gBattleMainFunc + ldr r0, =sub_803B9BC + str r0, [r1] + ldr r3, =gNoOfAllBanks + ldr r1, =gBattleCommunication + movs r2, 0 + adds r0, r1, 0x7 +_0803B91C: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803B91C + movs r4, 0 + ldrb r3, [r3] + cmp r4, r3 + bge _0803B96E + ldr r5, =gBattleMons + adds r6, r5, 0 + adds r6, 0x4C +_0803B932: + movs r0, 0x58 + adds r2, r4, 0 + muls r2, r0 + adds r1, r5, 0 + adds r1, 0x50 + adds r1, r2, r1 + ldr r3, [r1] + subs r0, 0x61 + ands r3, r0 + str r3, [r1] + adds r2, r6 + ldr r0, [r2] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _0803B964 + movs r0, 0x80 + lsls r0, 5 + ands r3, r0 + cmp r3, 0 + beq _0803B964 + lsls r0, r4, 24 + lsrs r0, 24 + bl CancelMultiTurnMoves +_0803B964: + adds r4, 0x1 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r4, r0 + blt _0803B932 +_0803B96E: + ldr r2, =gBattleStruct + ldr r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + ldr r0, [r2] + movs r3, 0xD0 + lsls r3, 1 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x1 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x3] + ldr r0, =gBattleMoveFlags + strb r1, [r0] +_0803B994: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bc_8013B1C + + thumb_func_start sub_803B9BC +sub_803B9BC: @ 803B9BC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0x1 + bl sub_803D580 + ldr r0, =gBattleOutcome + ldrb r0, [r0] + cmp r0, 0 + bne _0803B9EA + bl sub_80401D0 + lsls r0, 24 + cmp r0, 0 + beq _0803B9DE + b _0803BB78 +_0803B9DE: + bl sub_8040924 + lsls r0, 24 + cmp r0, 0 + beq _0803B9EA + b _0803BB78 +_0803B9EA: + bl sub_8041728 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0803B9F8 + b _0803BB78 +_0803B9F8: + ldr r0, =gBattleStruct + ldr r0, [r0] + adds r0, 0x4D + strb r1, [r0] + bl sub_8041364 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0803BA0E + b _0803BB78 +_0803BA0E: + movs r0, 0 + bl sub_803D580 + ldr r2, =gHitMarker + ldr r0, [r2] + ldr r1, =0xfffffdff + ands r0, r1 + ldr r1, =0xfff7ffff + ands r0, r1 + ldr r1, =0xffbfffff + ands r0, r1 + ldr r1, =0xffefffff + ands r0, r1 + str r0, [r2] + ldr r0, =gBattleScripting + strb r4, [r0, 0x18] + strb r4, [r0, 0x19] + strb r4, [r0, 0x14] + ldr r0, =gBattleMoveDamage + str r4, [r0] + ldr r0, =gBattleMoveFlags + strb r4, [r0] + ldr r1, =gBattleCommunication + movs r2, 0 + adds r0, r1, 0x4 +_0803BA40: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803BA40 + ldr r0, =gBattleOutcome + ldrb r0, [r0] + cmp r0, 0 + beq _0803BA98 + ldr r1, =gFightStateTracker + movs r0, 0xC + strb r0, [r1] + ldr r1, =gBattleMainFunc + ldr r0, =bc_bs_exec + str r0, [r1] + b _0803BB78 + .pool +_0803BA98: + ldr r1, =gBattleResults + ldrb r0, [r1, 0x13] + ldr r2, =gBattleStruct + mov r8, r2 + cmp r0, 0xFE + bhi _0803BAB2 + adds r0, 0x1 + strb r0, [r1, 0x13] + ldr r1, [r2] + adds r1, 0xDA + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0803BAB2: + movs r2, 0 + ldr r4, =gNoOfAllBanks + ldr r0, =gAbsentBankFlags + mov r12, r0 + ldr r1, =gUnknown_085CC23E + mov r9, r1 + ldrb r0, [r4] + cmp r2, r0 + bge _0803BAE0 + ldr r7, =gUnknown_0202421C + movs r6, 0xFF + movs r5, 0 + ldr r3, =gUnknown_02024274 +_0803BACC: + adds r1, r2, r7 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + strh r5, [r3] + adds r3, 0x2 + adds r2, 0x1 + ldrb r1, [r4] + cmp r2, r1 + blt _0803BACC +_0803BAE0: + movs r2, 0 + ldr r3, =gBattleStruct + movs r1, 0x6 +_0803BAE6: + ldr r0, [r3] + adds r0, r2, r0 + adds r0, 0x5C + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _0803BAE6 + mov r2, r8 + ldr r0, [r2] + adds r0, 0x91 + mov r2, r12 + ldrb r1, [r2] + strb r1, [r0] + mov r0, r9 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =gBattleMainFunc + ldr r0, =sub_803BE74 + str r0, [r1] + bl Random + ldr r1, =gUnknown_02024330 + strh r0, [r1] + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 10 + ands r0, r1 + cmp r0, 0 + beq _0803BB5C + ldr r0, =gUnknown_082DB881 + bl b_call_bc_move_exec + b _0803BB78 + .pool +_0803BB5C: + movs r0, 0x80 + lsls r0, 11 + ands r1, r0 + cmp r1, 0 + beq _0803BB78 + mov r1, r8 + ldr r0, [r1] + adds r0, 0xDA + ldrb r0, [r0] + cmp r0, 0 + bne _0803BB78 + ldr r0, =gUnknown_082DB8BE + bl b_call_bc_move_exec +_0803BB78: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B9BC + + thumb_func_start sub_803BB88 +sub_803BB88: @ 803BB88 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, =gBattleMons + ldr r0, =gActiveBank + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803BBB8 + ldr r1, =gEnigmaBerries + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x7] + b _0803BBC2 + .pool +_0803BBB8: + ldrh r0, [r1, 0x2E] + bl ItemId_GetHoldEffect + lsls r0, 24 + lsrs r2, r0, 24 +_0803BBC2: + ldr r1, =gUnknown_0202420F + ldr r3, =gActiveBank + ldrb r0, [r3] + strb r0, [r1] + cmp r2, 0x25 + bne _0803BBD0 + b _0803BD4C +_0803BBD0: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803BBDE + b _0803BD4C +_0803BBDE: + ldr r1, =gBattleMons + ldrb r2, [r3] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x32 + bne _0803BBF2 + b _0803BD4C +_0803BBF2: + adds r0, r2, 0 + bl GetBankSide + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r5, r0 + bge _0803BC86 + movs r7, 0 +_0803BC08: + lsrs r4, r7, 24 + adds r0, r4, 0 + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _0803BC2C + ldr r1, =gBattleMons + movs r0, 0x58 + muls r0, r5 + adds r0, r1 + adds r2, r0, 0 + adds r2, 0x20 + ldrb r0, [r2] + cmp r0, 0x17 + bne _0803BC2C + b _0803BD54 +_0803BC2C: + adds r0, r4, 0 + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _0803BC76 + ldr r3, =gBattleMons + ldr r0, =gActiveBank + ldrb r0, [r0] + movs r2, 0x58 + muls r0, r2 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1A + beq _0803BC76 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0803BC76 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0803BC76 + adds r0, r5, 0 + muls r0, r2 + adds r0, r3 + adds r2, r0, 0 + adds r2, 0x20 + ldrb r0, [r2] + cmp r0, 0x47 + bne _0803BC76 + b _0803BD70 +_0803BC76: + movs r0, 0x80 + lsls r0, 17 + adds r7, r0 + adds r5, 0x1 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r5, r0 + blt _0803BC08 +_0803BC86: + ldr r4, =gActiveBank + ldrb r1, [r4] + movs r0, 0 + str r0, [sp] + movs r0, 0xF + movs r2, 0x2A + movs r3, 0 + bl AbilityBattleEffects + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _0803BCF8 + ldr r6, =gBattleMons + ldrb r0, [r4] + movs r3, 0x58 + muls r0, r3 + adds r1, r0, r6 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x8 + beq _0803BCBE + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x8 + bne _0803BCF8 +_0803BCBE: + ldr r0, =gBattleScripting + subs r1, r5, 0x1 + strb r1, [r0, 0x17] + ldr r2, =gLastUsedAbility + adds r0, r1, 0 + muls r0, r3 + adds r0, r6 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r2] + ldr r1, =gBattleCommunication + movs r0, 0x2 + b _0803BD90 + .pool +_0803BCF8: + ldr r1, =gBattleMons + ldr r0, =gActiveBank + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0400e000 + ands r0, r1 + cmp r0, 0 + bne _0803BD22 + ldr r1, =gStatuses3 + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + beq _0803BD40 +_0803BD22: + ldr r1, =gBattleCommunication + movs r0, 0 + strb r0, [r1, 0x5] + movs r0, 0x1 + b _0803BD92 + .pool +_0803BD40: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0803BD8C +_0803BD4C: + movs r0, 0 + b _0803BD92 + .pool +_0803BD54: + ldr r0, =gBattleScripting + strb r5, [r0, 0x17] + ldr r1, =gLastUsedAbility + ldrb r0, [r2] + strb r0, [r1] + ldr r1, =gBattleCommunication + movs r0, 0x2 + b _0803BD90 + .pool +_0803BD70: + ldr r0, =gBattleScripting + strb r5, [r0, 0x17] + ldr r1, =gLastUsedAbility + ldrb r0, [r2] + strb r0, [r1] + ldr r1, =gBattleCommunication + movs r0, 0x2 + b _0803BD90 + .pool +_0803BD8C: + ldr r1, =gBattleCommunication + movs r0, 0x1 +_0803BD90: + strb r0, [r1, 0x5] +_0803BD92: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_803BB88 + + thumb_func_start sub_803BDA0 +sub_803BDA0: @ 803BDA0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + ldr r0, =gBattlePartyID + mov r8, r0 + ldr r1, =gUnknown_0203CF00 + mov r12, r1 + ldr r7, =gBattleStruct + lsls r0, r5, 1 + adds r4, r0, r5 + adds r6, r0, 0 +_0803BDBC: + mov r0, r12 + adds r2, r3, r0 + ldr r1, [r7] + adds r0, r4, r3 + adds r0, r1 + adds r0, 0x60 + ldrb r0, [r0] + strb r0, [r2] + adds r3, 0x1 + cmp r3, 0x2 + ble _0803BDBC + mov r1, r8 + adds r0, r6, r1 + ldrb r0, [r0] + bl pokemon_order_func + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r7, =gBattleStruct + ldr r0, [r7] + adds r0, r5, r0 + adds r0, 0x5C + ldrb r0, [r0] + bl pokemon_order_func + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B8FB0 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0803BE4C + movs r3, 0 + adds r4, r7, 0 + adds r6, r5 + movs r0, 0x2 + adds r1, r5, 0 + eors r1, r0 + ldr r7, =gUnknown_0203CF00 + lsls r0, r1, 1 + adds r5, r0, r1 +_0803BE1A: + ldr r0, [r4] + adds r1, r6, r3 + adds r1, r0 + adds r1, 0x60 + adds r2, r3, r7 + ldrb r0, [r2] + strb r0, [r1] + ldr r1, [r4] + adds r0, r5, r3 + adds r0, r1 + adds r0, 0x60 + ldrb r1, [r2] + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0x2 + ble _0803BE1A + b _0803BE66 + .pool +_0803BE4C: + movs r3, 0 + adds r2, r6, r5 + ldr r4, =gUnknown_0203CF00 +_0803BE52: + ldr r0, [r7] + adds r1, r2, r3 + adds r1, r0 + adds r1, 0x60 + adds r0, r3, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r3, 0x1 + cmp r3, 0x2 + ble _0803BE52 +_0803BE66: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803BDA0 + + thumb_func_start sub_803BE74 +sub_803BE74: @ 803BE74 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r0, =gBattleCommunication + movs r1, 0 + strb r1, [r0, 0x4] + ldr r0, =gActiveBank + strb r1, [r0] + ldr r0, =gNoOfAllBanks + bl _0803CD12 + .pool +_0803BE9C: + ldr r4, =gActiveBank + ldrb r0, [r4] + bl GetBankIdentity + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gBattleCommunication + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x8 + bls _0803BEB8 + bl _0803CD04 +_0803BEB8: + lsls r0, 2 + ldr r1, =_0803BED0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803BED0: + .4byte _0803BEF4 + .4byte _0803BF0C + .4byte _0803C02C + .4byte _0803C7D8 + .4byte _0803CAD0 + .4byte _0803CB84 + .4byte _0803CBC8 + .4byte _0803CBF4 + .4byte _0803CC38 +_0803BEF4: + bl sub_8185FD0 + ldr r1, =gBattleCommunication + ldr r0, =gActiveBank + ldrb r0, [r0] + adds r0, r1 + bl _0803CC20 + .pool +_0803BF0C: + ldr r0, =gActiveBank + ldrb r1, [r0] + ldr r4, =gBattleStruct + ldr r0, [r4] + adds r1, r0 + adds r1, 0x5C + movs r0, 0x6 + strb r0, [r1] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0803BF68 + movs r1, 0x2 + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _0803BF68 + eors r5, r1 + adds r0, r5, 0 + bl GetBankByPlayerAI + ldr r1, [r4] + adds r1, 0x91 + ldrb r1, [r1] + ldr r2, =gBitTable + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803BF68 + ldr r4, =gBattleCommunication + adds r0, r5, 0 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x5 + beq _0803BF68 + bl _0803CD04 +_0803BF68: + ldr r0, =gBattleStruct + ldr r0, [r0] + adds r0, 0x91 + ldrb r3, [r0] + ldr r1, =gBitTable + ldr r4, =gActiveBank + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ands r3, r0 + cmp r3, 0 + beq _0803BFD0 + ldr r0, =gUnknown_0202421C + adds r0, r2, r0 + movs r1, 0xD + strb r1, [r0] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0803BFBC + ldr r0, =gBattleCommunication + ldrb r1, [r4] + adds r1, r0 + movs r0, 0x5 + strb r0, [r1] + bl _0803CD04 + .pool +_0803BFBC: + ldr r0, =gBattleCommunication + ldrb r1, [r4] + adds r1, r0 + movs r0, 0x4 + strb r0, [r1] + bl _0803CD04 + .pool +_0803BFD0: + ldr r1, =gBattleMons + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + bne _0803BFF0 + movs r0, 0x80 + lsls r0, 15 + ands r1, r0 + cmp r1, 0 + beq _0803C00C +_0803BFF0: + ldr r0, =gUnknown_0202421C + adds r0, r2, r0 + strb r3, [r0] + ldr r1, =gBattleCommunication + ldrb r0, [r4] + bl _0803CC72 + .pool +_0803C00C: + ldr r0, =gUnknown_0202421C + ldrb r1, [r0] + ldr r0, =gBattleBufferB + ldrb r2, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r2, r0 + movs r0, 0 + bl dp01_build_cmdbuf_x12_a_bb + bl _0803CB68 + .pool +_0803C02C: + ldr r3, =gBattleExecBuffer + ldr r1, =gBitTable + ldr r6, =gActiveBank + ldrb r5, [r6] + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + beq _0803C058 + bl _0803CD04 +_0803C058: + ldr r4, =gBattleBufferB + lsls r0, r5, 9 + adds r4, 0x1 + adds r0, r4 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8184FBC + ldr r1, =gUnknown_0202421C + ldrb r0, [r6] + adds r1, r0, r1 + lsls r0, 9 + adds r0, r4 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r6] + lsls r0, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0xC + bls _0803C084 + b _0803C6C4 +_0803C084: + lsls r0, 2 + ldr r1, =_0803C0A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803C0A8: + .4byte _0803C0DC + .4byte _0803C230 + .4byte _0803C268 + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C440 + .4byte _0803C48C + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C4B4 +_0803C0DC: + bl sub_80400C8 + lsls r0, 24 + cmp r0, 0 + beq _0803C134 + ldr r0, =gBattleCommunication + ldr r3, =gActiveBank + ldrb r1, [r3] + adds r1, r0 + movs r4, 0 + movs r0, 0x6 + strb r0, [r1] + ldrb r1, [r3] + ldr r2, =gBattleStruct + ldr r0, [r2] + adds r1, r0 + adds r1, 0x54 + strb r4, [r1] + ldrb r1, [r3] + ldr r0, [r2] + adds r1, r0 + adds r1, 0x84 + movs r0, 0x4 + strb r0, [r1] + ldrb r1, [r3] + ldr r2, [r2] + adds r2, r1, r2 + ldr r0, =gBattleBufferB + lsls r1, 9 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2, 0xC] + bl _0803CD70 + .pool +_0803C134: + ldr r3, =gDisableStructs + ldr r5, =gActiveBank + ldrb r4, [r5] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r3 + ldrh r2, [r0, 0x6] + cmp r2, 0 + beq _0803C188 + ldr r1, =gUnknown_02024274 + lsls r0, r4, 1 + adds r0, r1 + strh r2, [r0] + ldrb r2, [r5] + ldr r0, =gBattleStruct + ldr r1, [r0] + adds r1, r2, r1 + adds r1, 0x80 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0xC] + strb r0, [r1] + ldr r1, =gBattleCommunication + ldrb r0, [r5] + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + bl _0803CD70 + .pool +_0803C188: + add r2, sp, 0x4 + ldr r3, =gBattleMons + movs r1, 0x58 + adds r0, r4, 0 + muls r0, r1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r2, 0x10] + ldrb r0, [r5] + muls r0, r1 + adds r0, r3 + adds r0, 0x21 + ldrb r0, [r0] + strb r0, [r2, 0x12] + ldrb r0, [r5] + muls r0, r1 + adds r0, r3 + adds r0, 0x22 + ldrb r0, [r0] + strb r0, [r2, 0x13] + movs r4, 0 + mov r1, sp + adds r1, 0xC + str r1, [sp, 0x18] + add r2, sp, 0x10 + mov r10, r2 + mov r8, r3 + adds r7, r5, 0 + movs r6, 0x58 + movs r0, 0xC + add r0, r8 + mov r9, r0 + add r5, sp, 0x4 +_0803C1CA: + lsls r2, r4, 1 + ldrb r0, [r7] + muls r0, r6 + adds r0, r2, r0 + add r0, r9 + ldrh r0, [r0] + strh r0, [r5] + ldr r1, [sp, 0x18] + adds r3, r1, r4 + ldrb r0, [r7] + muls r0, r6 + adds r0, r4, r0 + mov r1, r8 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + ldrb r0, [r7] + adds r1, r0, 0 + muls r1, r6 + adds r2, r1 + add r2, r9 + ldrh r0, [r2] + add r1, r8 + adds r1, 0x3B + ldrb r1, [r1] + lsls r2, r4, 24 + lsrs r2, 24 + bl CalculatePPWithBonus + mov r2, r10 + adds r1, r2, r4 + strb r0, [r1] + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _0803C1CA + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r0, 0x1 + ands r1, r0 + movs r0, 0 + movs r2, 0 + add r3, sp, 0x4 + bl sub_8033E30 + b _0803C42E + .pool +_0803C230: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + ldr r1, =0x021f0902 + ands r0, r1 + cmp r0, 0 + bne _0803C23E + b _0803C48C +_0803C23E: + ldr r4, =gActiveBank + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8185008 + ldr r1, =gUnknown_02024220 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB879 + b _0803C784 + .pool +_0803C268: + ldr r5, =gActiveBank + ldrb r0, [r5] + ldr r3, =gBattleStruct + ldr r1, [r3] + adds r1, r0, r1 + adds r1, 0x58 + ldr r2, =gBattlePartyID + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + ldr r7, =gBattleMons + ldrb r2, [r5] + movs r6, 0x58 + adds r0, r2, 0 + muls r0, r6 + adds r1, r7, 0 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + ldr r0, =0x0400e000 + ands r1, r0 + cmp r1, 0 + bne _0803C2B8 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + bne _0803C2B8 + ldr r0, =gStatuses3 + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x80 + lsls r0, 3 + ands r1, r0 + cmp r1, 0 + beq _0803C2EC +_0803C2B8: + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0x60 + ldr r0, [r3] + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0x6 + b _0803C400 + .pool +_0803C2EC: + str r1, [sp] + movs r0, 0xC + adds r1, r2, 0 + movs r2, 0x17 + movs r3, 0 + bl AbilityBattleEffects + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0803C374 + ldrb r1, [r5] + str r4, [sp] + movs r0, 0xC + movs r2, 0x47 + movs r3, 0 + bl AbilityBattleEffects + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0803C33C + ldrb r0, [r5] + muls r0, r6 + adds r1, r0, r7 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0803C33C + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0803C33C + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1A + bne _0803C374 +_0803C33C: + ldr r5, =gActiveBank + ldrb r1, [r5] + movs r0, 0 + str r0, [sp] + movs r0, 0xF + movs r2, 0x2A + movs r3, 0 + bl AbilityBattleEffects + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0803C3B0 + ldr r2, =gBattleMons + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x8 + beq _0803C374 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x8 + bne _0803C3B0 +_0803C374: + subs r1, r4, 0x1 + lsls r1, 4 + movs r0, 0x4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =gLastUsedAbility + ldrb r3, [r0] + ldr r4, =gBattleStruct + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r2, r0, 1 + adds r2, r0 + adds r2, 0x60 + ldr r0, [r4] + adds r0, r2 + str r0, [sp] + movs r0, 0 + movs r2, 0x6 + bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f + b _0803C42E + .pool +_0803C3B0: + ldr r0, =gActiveBank + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x2 + bne _0803C3D8 + ldr r0, =gUnknown_0202421C + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803C3D8 + ldr r0, =gBattleStruct + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0x5C + b _0803C3EE + .pool +_0803C3D8: + ldrb r0, [r4] + cmp r0, 0x3 + bne _0803C410 + ldr r0, =gUnknown_0202421C + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _0803C410 + ldr r0, =gBattleStruct + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0x5D +_0803C3EE: + ldrb r2, [r0] + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + adds r0, 0x60 + adds r3, r0 + str r3, [sp] + movs r0, 0 + movs r1, 0 +_0803C400: + movs r3, 0 + bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f + b _0803C42E + .pool +_0803C410: + ldr r2, =gBattleStruct + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0x60 + ldr r0, [r2] + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0x6 + movs r3, 0 + bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f +_0803C42E: + ldr r0, =gActiveBank + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _0803C6C4 + .pool +_0803C440: + bl PlayerPartyAndPokemonStorageFull + lsls r0, 24 + cmp r0, 0 + bne _0803C44C + b _0803C6C4 +_0803C44C: + ldr r1, =gUnknown_02024220 + ldr r3, =gActiveBank + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DAB11 + str r1, [r0] + ldr r0, =gBattleCommunication + ldrb r1, [r3] + adds r1, r0 + movs r4, 0 + movs r0, 0x6 + strb r0, [r1] + ldrb r1, [r3] + ldr r2, =gBattleStruct + ldr r0, [r2] + adds r1, r0 + adds r1, 0x54 + strb r4, [r1] + ldrb r1, [r3] + b _0803C7A0 + .pool +_0803C48C: + ldr r2, =gBattleStruct + ldr r4, =gActiveBank + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + adds r0, 0x60 + ldr r1, [r2] + adds r1, r0 + movs r0, 0 + bl sub_8033E6C + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0803C6C4 + .pool +_0803C4B4: + ldr r4, =gBattleCommunication + ldr r5, =gActiveBank + ldrb r0, [r5] + adds r0, r4 + movs r1, 0x7 + strb r1, [r0] + ldrb r0, [r5] + bl GetBankIdentity + movs r6, 0x2 + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + movs r1, 0x1 + strb r1, [r0] + ldrb r0, [r5] + bl sub_8185008 + ldrb r0, [r5] + bl GetBankIdentity + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + ldr r1, =gBattleMons + lsls r0, 24 + lsrs r0, 24 + movs r7, 0x58 + muls r0, r7 + adds r4, r1, 0 + adds r4, 0x50 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + bne _0803C532 + ldrb r0, [r5] + bl GetBankIdentity + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0803C550 +_0803C532: + movs r0, 0 + bl dp01_build_cmdbuf_x32_32_32_32 + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + bl _0803CD70 + .pool +_0803C550: + ldr r4, =gUnknown_0202421C + ldrb r0, [r5] + bl GetBankIdentity + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803C590 + ldrb r0, [r5] + bl GetBankIdentity + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_8185008 + b _0803C6AE + .pool +_0803C590: + ldrb r0, [r5] + bl GetBankIdentity + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0803C5B6 + ldrb r0, [r5] + bl GetBankIdentity + eors r0, r6 + b _0803C668 +_0803C5B6: + ldrb r0, [r5] + bl GetBankIdentity + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _0803C628 + ldr r4, =gProtectStructs + ldrb r0, [r5] + bl GetBankIdentity + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 20 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _0803C616 + ldr r4, =gDisableStructs + ldrb r0, [r5] + bl GetBankIdentity + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1, 0x6] + cmp r0, 0 + beq _0803C628 +_0803C616: + ldrb r0, [r5] + bl GetBankIdentity + eors r0, r6 + b _0803C668 + .pool +_0803C628: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803C690 + ldr r4, =gUnknown_0202421C + ldr r6, =gActiveBank + ldrb r0, [r6] + bl GetBankIdentity + movs r5, 0x2 + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _0803C690 + ldr r1, =gRngValue + ldr r0, =gUnknown_0203BD30 + ldr r0, [r0] + str r0, [r1] + ldrb r0, [r6] + bl GetBankIdentity + eors r0, r5 +_0803C668: + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_8185008 + b _0803C6AE + .pool +_0803C690: + ldr r0, =gActiveBank + ldrb r0, [r0] + bl GetBankIdentity + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl sub_8185008 +_0803C6AE: + movs r0, 0 + bl dp01_build_cmdbuf_x32_32_32_32 + ldr r0, =gActiveBank + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _0803CD70 + .pool +_0803C6C4: + ldr r1, =gBattleTypeFlags + ldr r2, [r1] + movs r5, 0x8 + adds r0, r2, 0 + ands r0, r5 + adds r3, r1, 0 + cmp r0, 0 + beq _0803C720 + ldr r0, =0x043f0100 + ands r2, r0 + cmp r2, 0 + beq _0803C720 + ldr r0, =gBattleBufferB + ldr r4, =gActiveBank + ldrb r2, [r4] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _0803C720 + ldr r1, =gUnknown_02024220 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB9BA + str r1, [r0] + ldr r1, =gBattleCommunication + ldrb r0, [r4] + adds r0, r1 + movs r3, 0 + strb r5, [r0] + b _0803C792 + .pool +_0803C720: + ldr r0, [r3] + ldr r1, =0x0200000a + ands r0, r1 + cmp r0, 0x8 + bne _0803C760 + ldr r0, =gBattleBufferB + ldr r4, =gActiveBank + ldrb r1, [r4] + lsls r1, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _0803C760 + ldr r0, =gUnknown_082DAAFE + bl b_call_bc_move_exec + ldr r1, =gBattleCommunication + ldrb r0, [r4] + adds r0, r1 + b _0803CC20 + .pool +_0803C760: + bl sub_803BB88 + lsls r0, 24 + cmp r0, 0 + beq _0803C7C4 + ldr r0, =gBattleBufferB + ldr r4, =gActiveBank + ldrb r2, [r4] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _0803C7C4 + ldr r1, =gUnknown_02024220 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, =gUnknown_082DAB0B +_0803C784: + str r1, [r0] + ldr r0, =gBattleCommunication + ldrb r1, [r4] + adds r1, r0 + movs r3, 0 + movs r0, 0x6 + strb r0, [r1] +_0803C792: + ldrb r1, [r4] + ldr r2, =gBattleStruct + ldr r0, [r2] + adds r1, r0 + adds r1, 0x54 + strb r3, [r1] + ldrb r1, [r4] +_0803C7A0: + ldr r0, [r2] + adds r1, r0 + adds r1, 0x84 + movs r0, 0x1 + strb r0, [r1] + b _0803CD70 + .pool +_0803C7C4: + ldr r2, =gBattleCommunication + ldr r0, =gActiveBank + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803C7D8: + ldr r4, =gBattleExecBuffer + ldr r1, =gBitTable + ldr r3, =gActiveBank + ldrb r5, [r3] + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + lsls r0, r2, 4 + movs r1, 0xF0 + lsls r1, 24 + orrs r0, r1 + orrs r0, r2 + lsls r1, r2, 8 + orrs r0, r1 + lsls r2, 12 + orrs r0, r2 + ldr r1, [r4] + ands r1, r0 + adds r4, r3, 0 + cmp r1, 0 + beq _0803C804 + b _0803CD04 +_0803C804: + ldr r1, =gUnknown_0202421C + adds r0, r5, r1 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x9 + bls _0803C812 + b _0803CD04 +_0803C812: + lsls r0, 2 + ldr r1, =_0803C830 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803C830: + .4byte _0803C858 + .4byte _0803C99C + .4byte _0803C9D4 + .4byte _0803CA0A + .4byte _0803CA2C + .4byte _0803CA40 + .4byte _0803CA54 + .4byte _0803CA84 + .4byte _0803CA98 + .4byte _0803CABC +_0803C858: + ldr r1, =gBattleBufferB + ldrb r3, [r4] + lsls r0, r3, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0x3 + blt _0803C88A + cmp r1, 0x9 + ble _0803C878 + cmp r1, 0xF + beq _0803C87E + b _0803C88A + .pool +_0803C878: + adds r0, r3, r2 + strb r1, [r0] + b _0803CD70 +_0803C87E: + adds r1, r3, r2 + movs r0, 0x2 + strb r0, [r1] + bl sub_803CDF8 + b _0803CD70 +_0803C88A: + movs r0, 0x2 + bl sub_818603C + ldr r4, =gBattleBufferB + ldr r6, =gActiveBank + ldrb r3, [r6] + lsls r1, r3, 9 + adds r5, r4, 0x2 + adds r0, r1, r5 + ldrb r2, [r0] + adds r7, r4, 0x3 + adds r1, r7 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + ldr r0, =0x0000ffff + cmp r2, r0 + bne _0803C8D0 + ldr r0, =gBattleCommunication + adds r0, r3, r0 + movs r1, 0x1 + strb r1, [r0] + ldrb r0, [r6] + bl sub_8185008 + b _0803CD04 + .pool +_0803C8D0: + bl sub_803FB4C + lsls r0, 24 + cmp r0, 0 + beq _0803C91C + ldrb r0, [r6] + movs r1, 0x1 + bl sub_8185008 + ldr r0, =gBattleCommunication + ldrb r1, [r6] + adds r1, r0 + movs r3, 0 + movs r0, 0x6 + strb r0, [r1] + ldrb r1, [r6] + ldr r2, =gBattleStruct + ldr r0, [r2] + adds r1, r0 + adds r1, 0x54 + strb r3, [r1] + ldrb r0, [r6] + lsls r0, 9 + adds r1, r4, 0x1 + adds r0, r1 + strb r3, [r0] + ldrb r1, [r6] + ldr r0, [r2] + adds r1, r0 + adds r1, 0x84 + movs r0, 0x2 + strb r0, [r1] + b _0803CD70 + .pool +_0803C91C: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + bne _0803C942 + ldrb r0, [r6] + lsls r1, r0, 9 + adds r1, r5 + ldrb r1, [r1] + bl sub_8184FBC + ldrb r0, [r6] + lsls r1, r0, 9 + adds r1, r7 + ldrb r1, [r1] + bl sub_8184FBC +_0803C942: + ldrb r0, [r6] + ldr r4, =gBattleStruct + ldr r1, [r4] + adds r1, r0, r1 + adds r1, 0x80 + lsls r0, 9 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =gUnknown_02024274 + ldrb r2, [r6] + lsls r5, r2, 1 + adds r5, r0 + ldr r3, =gBattleMons + ldr r4, [r4] + adds r0, r2, r4 + adds r0, 0x80 + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x58 + muls r1, r2 + adds r0, r1 + adds r3, 0xC + adds r0, r3 + ldrh r0, [r0] + strh r0, [r5] + ldrb r0, [r6] + adds r4, r0, r4 + lsls r0, 9 + adds r0, r7 + ldrb r0, [r0] + strb r0, [r4, 0xC] + ldr r0, =gBattleCommunication + ldrb r1, [r6] + b _0803CB72 + .pool +_0803C99C: + ldr r2, =gBattleBufferB + ldr r5, =gActiveBank + ldrb r4, [r5] + lsls r1, r4, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r3, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r0, [r1] + lsls r0, 8 + orrs r3, r0 + cmp r3, 0 + bne _0803C9BA + b _0803CC1C +_0803C9BA: + ldr r0, =gLastUsedItem + strh r3, [r0] + ldr r0, =gBattleCommunication + ldrb r1, [r5] + b _0803CB72 + .pool +_0803C9D4: + ldr r0, =gBattleBufferB + ldr r4, =gActiveBank + ldrb r2, [r4] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x6 + bne _0803CA04 + ldr r0, =gBattleCommunication + adds r0, r2, r0 + movs r1, 0x1 + strb r1, [r0] + ldrb r0, [r4] + bl sub_8185008 + b _0803CD04 + .pool +_0803CA04: + bl sub_803CDF8 + b _0803CB6E +_0803CA0A: + ldr r2, =gHitMarker + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + str r0, [r2] + ldr r2, =gBattleCommunication + ldr r0, =gActiveBank + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CA2C: + ldr r2, =gBattleCommunication + ldr r0, =gActiveBank + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CA40: + ldr r2, =gBattleCommunication + ldr r0, =gActiveBank + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CA54: + ldr r3, =gBattleBufferB + ldr r0, =gActiveBank + ldrb r4, [r0] + lsls r1, r4, 9 + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r2, [r0] + adds r3, 0x2 + adds r1, r3 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + cmp r2, 0 + bne _0803CA72 + b _0803CC1C +_0803CA72: + ldr r1, =gBattleCommunication + adds r1, r4, r1 + b _0803CB74 + .pool +_0803CA84: + ldr r2, =gBattleCommunication + ldr r0, =gActiveBank + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CA98: + ldr r2, =gHitMarker + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + str r0, [r2] + ldr r2, =gBattleCommunication + ldr r0, =gActiveBank + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CABC: + ldr r2, =gBattleCommunication + ldr r0, =gActiveBank + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CAD0: + ldr r3, =gBattleExecBuffer + ldr r6, =gBitTable + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 2 + adds r0, r6 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + beq _0803CAFA + b _0803CD04 +_0803CAFA: + bl sub_803CDB8 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x41 + ands r0, r1 + cmp r0, 0x1 + bne _0803CB3C + movs r1, 0x2 + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + bne _0803CB3C + adds r0, r5, 0 + eors r0, r1 + bl GetBankByPlayerAI + ldr r1, =gBattleStruct + ldr r1, [r1] + adds r1, 0x91 + ldrb r1, [r1] + lsls r0, 24 + lsrs r0, 22 + adds r0, r6 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0803CB5C +_0803CB3C: + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + bl sub_8034464 + b _0803CB66 + .pool +_0803CB5C: + movs r0, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_8034464 +_0803CB66: + ldr r4, =gActiveBank +_0803CB68: + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803CB6E: + ldr r0, =gBattleCommunication + ldrb r1, [r4] +_0803CB72: + adds r1, r0 +_0803CB74: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0803CD04 + .pool +_0803CB84: + ldr r3, =gBattleExecBuffer + ldr r1, =gBitTable + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + beq _0803CBAE + b _0803CD04 +_0803CBAE: + ldr r1, =gBattleCommunication + ldrb r0, [r1, 0x4] + adds r0, 0x1 + strb r0, [r1, 0x4] + b _0803CD04 + .pool +_0803CBC8: + ldr r5, =gActiveBank + ldrb r2, [r5] + ldr r0, =gBattleStruct + ldr r0, [r0] + adds r1, r2, r0 + adds r0, r1, 0 + adds r0, 0x54 + ldrb r0, [r0] + cmp r0, 0 + beq _0803CCB4 + ldr r0, =gBattleCommunication + adds r0, r2, r0 + adds r1, 0x84 + ldrb r1, [r1] + strb r1, [r0] + b _0803CD04 + .pool +_0803CBF4: + ldr r3, =gBattleExecBuffer + ldr r1, =gBitTable + ldr r0, =gActiveBank + ldrb r4, [r0] + lsls r0, r4, 2 + adds r0, r1 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + bne _0803CD04 +_0803CC1C: + ldr r0, =gBattleCommunication + adds r0, r4, r0 +_0803CC20: + movs r1, 0x1 + strb r1, [r0] + b _0803CD04 + .pool +_0803CC38: + ldr r5, =gActiveBank + ldrb r2, [r5] + ldr r4, =gBattleStruct + ldr r0, [r4] + adds r0, r2, r0 + adds r0, 0x54 + ldrb r0, [r0] + cmp r0, 0 + beq _0803CCB4 + ldr r0, =gBattleBufferB + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xD + bne _0803CC94 + ldr r2, =gHitMarker + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + str r0, [r2] + ldr r1, =gUnknown_0202421C + ldrb r0, [r5] + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + ldr r1, =gBattleCommunication + ldrb r0, [r5] +_0803CC72: + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + b _0803CD04 + .pool +_0803CC94: + adds r0, r2, 0 + movs r1, 0x1 + bl sub_8185008 + ldr r2, =gBattleCommunication + ldrb r0, [r5] + adds r2, r0, r2 + ldr r1, [r4] + adds r0, r1 + adds r0, 0x84 + ldrb r0, [r0] + strb r0, [r2] + b _0803CD04 + .pool +_0803CCB4: + ldr r0, =gBankAttacker + strb r2, [r0] + ldr r7, =gBattlescriptCurrInstr + ldr r6, =gUnknown_02024220 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r6 + ldr r4, [r0] + str r4, [r7] + ldr r3, =gBattleExecBuffer + ldr r1, =gBitTable + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + bne _0803CCFA + ldr r0, =gBattleScriptingCommandsTable + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 +_0803CCFA: + ldrb r0, [r5] + lsls r0, 2 + adds r0, r6 + ldr r1, [r7] + str r1, [r0] +_0803CD04: + ldr r0, =gActiveBank + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, =gNoOfAllBanks + lsls r1, 24 + lsrs r1, 24 +_0803CD12: + adds r5, r0, 0 + ldrb r0, [r5] + cmp r1, r0 + bcs _0803CD1E + bl _0803BE9C +_0803CD1E: + ldr r0, =gBattleCommunication + ldrb r0, [r0, 0x4] + ldrb r1, [r5] + cmp r0, r1 + bne _0803CD70 + movs r0, 0x1 + bl sub_818603C + ldr r1, =gBattleMainFunc + ldr r0, =sub_803D2E8 + str r0, [r1] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0803CD70 + movs r4, 0 + ldrb r5, [r5] + cmp r4, r5 + bge _0803CD70 +_0803CD4A: + ldr r0, =gUnknown_0202421C + adds r0, r4, r0 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803CD66 + lsls r0, r4, 24 + lsrs r0, 24 + ldr r1, =gBattleStruct + ldr r1, [r1] + adds r1, r4, r1 + adds r1, 0x5C + ldrb r1, [r1] + bl sub_80571DC +_0803CD66: + adds r4, 0x1 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r4, r0 + blt _0803CD4A +_0803CD70: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803BE74 + + thumb_func_start sub_803CDB8 +sub_803CDB8: @ 803CDB8 + push {r4,r5,lr} + movs r3, 0 + movs r1, 0 + ldr r0, =gNoOfAllBanks + ldrb r2, [r0] + adds r5, r0, 0 + cmp r3, r2 + bge _0803CDDA + ldr r4, =gBattleCommunication +_0803CDCA: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x5 + bne _0803CDD4 + adds r3, 0x1 +_0803CDD4: + adds r1, 0x1 + cmp r1, r2 + blt _0803CDCA +_0803CDDA: + adds r0, r3, 0x1 + ldrb r5, [r5] + cmp r0, r5 + beq _0803CDF0 + movs r0, 0 + b _0803CDF2 + .pool +_0803CDF0: + movs r0, 0x1 +_0803CDF2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_803CDB8 + + thumb_func_start sub_803CDF8 +sub_803CDF8: @ 803CDF8 + push {r4-r7,lr} + ldr r7, =gActiveBank + ldrb r0, [r7] + ldr r6, =gBattleStruct + ldr r1, [r6] + adds r1, r0, r1 + adds r1, 0x5C + ldr r4, =gBattleBufferB + lsls r0, 9 + adds r2, r4, 0x1 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + lsls r1, r0, 9 + adds r1, r2 + ldrb r1, [r1] + bl sub_8184FBC + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _0803CEC6 + ldrb r0, [r7] + ldr r2, [r6] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + strb r0, [r1] + ldrb r0, [r7] + ldr r2, [r6] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + lsls r0, 9 + adds r5, r4, 0x2 + adds r0, r5 + ldrb r2, [r0] + movs r3, 0xF0 + adds r0, r3, 0 + ands r0, r2 + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] + ldrb r1, [r7] + ldr r2, [r6] + lsls r0, r1, 1 + adds r0, r1 + adds r0, r2 + adds r0, 0x61 + lsls r1, 9 + adds r4, 0x3 + mov r12, r4 + add r1, r12 + ldrb r1, [r1] + strb r1, [r0] + ldrb r0, [r7] + movs r4, 0x2 + eors r0, r4 + ldr r2, [r6] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r2, [r1] + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldrb r0, [r7] + eors r0, r4 + ldr r2, [r6] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r0, [r7] + lsls r0, 9 + adds r0, r5 + ldrb r0, [r0] + ands r3, r0 + lsrs r3, 4 + ldrb r0, [r1] + orrs r3, r0 + strb r3, [r1] + ldrb r0, [r7] + eors r4, r0 + ldr r0, [r6] + lsls r1, r4, 1 + adds r1, r4 + adds r1, r0 + adds r1, 0x62 + ldrb r0, [r7] + lsls r0, 9 + add r0, r12 + ldrb r0, [r0] + strb r0, [r1] +_0803CEC6: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803CDF8 + + thumb_func_start sub_803CEDC +sub_803CEDC: @ 803CEDC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_0202407A + adds r4, r0, r2 + ldrb r5, [r4] + adds r2, r1, r2 + ldrb r3, [r2] + strb r3, [r4] + strb r5, [r2] + ldr r2, =gTurnOrder + adds r0, r2 + ldrb r5, [r0] + adds r1, r2 + ldrb r2, [r1] + strb r2, [r0] + strb r5, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803CEDC + + thumb_func_start b_first_side +b_first_side: @ 803CF10 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl AbilityBattleEffects + lsls r0, 24 + cmp r0, 0 + bne _0803CFD8 + ldr r1, [sp, 0x8] + str r1, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl AbilityBattleEffects + lsls r0, 24 + cmp r0, 0 + bne _0803CFD8 + ldr r1, =gBattleMons + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r0, r1 + adds r0, 0x20 + ldrb r3, [r0] + cmp r3, 0x21 + bne _0803CF7C + ldr r0, =gBattleWeather + ldrh r1, [r0] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0803CF8C +_0803CF7C: + cmp r3, 0x22 + bne _0803CF98 + ldr r0, =gBattleWeather + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _0803CF98 +_0803CF8C: + movs r3, 0x2 + b _0803CF9A + .pool +_0803CF98: + movs r3, 0x1 +_0803CF9A: + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + ldr r2, =gBattleMons + adds r0, r2 + adds r0, 0x20 + ldrb r2, [r0] + cmp r2, 0x21 + bne _0803CFBA + ldr r0, =gBattleWeather + ldrh r1, [r0] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0803CFCA +_0803CFBA: + cmp r2, 0x22 + bne _0803CFDA + ldr r0, =gBattleWeather + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _0803CFDA +_0803CFCA: + movs r7, 0x2 + b _0803CFDC + .pool +_0803CFD8: + movs r3, 0x1 +_0803CFDA: + movs r7, 0x1 +_0803CFDC: + ldr r1, =gBattleMons + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r4, r0, r1 + ldrh r0, [r4, 0x6] + muls r3, r0 + ldr r2, =gStatStageRatios + movs r1, 0x1B + ldrsb r1, [r4, r1] + lsls r1, 1 + adds r0, r1, r2 + ldrb r0, [r0] + muls r0, r3 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + bl __divsi3 + mov r8, r0 + ldrh r0, [r4, 0x2E] + cmp r0, 0xAF + bne _0803D02C + ldr r1, =gEnigmaBerries + mov r3, r9 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r6, [r0, 0x7] + ldrb r5, [r0, 0x1A] + b _0803D040 + .pool +_0803D02C: + ldrh r0, [r4, 0x2E] + bl ItemId_GetHoldEffect + lsls r0, 24 + lsrs r6, r0, 24 + ldrh r0, [r4, 0x2E] + bl ItemId_GetHoldEffectParam + lsls r0, 24 + lsrs r5, r0, 24 +_0803D040: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + ldr r1, =0x023f0102 + ands r0, r1 + cmp r0, 0 + bne _0803D074 + ldr r0, =0x00000869 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0803D074 + mov r0, r9 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0803D074 + movs r0, 0x6E + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0x64 + bl __udivsi3 + mov r8, r0 +_0803D074: + cmp r6, 0x18 + bne _0803D07E + mov r2, r8 + lsrs r2, 1 + mov r8, r2 +_0803D07E: + ldr r1, =gBattleMons + movs r0, 0x58 + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0803D09C + mov r0, r8 + lsrs r0, 2 + mov r8, r0 +_0803D09C: + cmp r6, 0x1A + bne _0803D0B8 + ldr r0, =gUnknown_02024330 + ldrh r4, [r0] + lsls r0, r5, 16 + subs r0, r5 + movs r1, 0x64 + bl __divsi3 + cmp r4, r0 + bge _0803D0B8 + movs r1, 0x1 + negs r1, r1 + mov r8, r1 +_0803D0B8: + ldr r1, =gBattleMons + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + adds r4, r0, r1 + ldrh r0, [r4, 0x6] + adds r3, r0, 0 + muls r3, r7 + ldr r2, =gStatStageRatios + movs r1, 0x1B + ldrsb r1, [r4, r1] + lsls r1, 1 + adds r0, r1, r2 + ldrb r0, [r0] + muls r0, r3 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + bl __divsi3 + adds r7, r0, 0 + ldrh r0, [r4, 0x2E] + cmp r0, 0xAF + bne _0803D118 + ldr r1, =gEnigmaBerries + mov r3, r10 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r6, [r0, 0x7] + ldrb r5, [r0, 0x1A] + b _0803D12C + .pool +_0803D118: + ldrh r0, [r4, 0x2E] + bl ItemId_GetHoldEffect + lsls r0, 24 + lsrs r6, r0, 24 + ldrh r0, [r4, 0x2E] + bl ItemId_GetHoldEffectParam + lsls r0, 24 + lsrs r5, r0, 24 +_0803D12C: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + ldr r1, =0x023f0102 + ands r0, r1 + cmp r0, 0 + bne _0803D15C + ldr r0, =0x00000869 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0803D15C + mov r0, r10 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0803D15C + movs r0, 0x6E + muls r0, r7 + movs r1, 0x64 + bl __udivsi3 + adds r7, r0, 0 +_0803D15C: + cmp r6, 0x18 + bne _0803D162 + lsrs r7, 1 +_0803D162: + ldr r2, =gBattleMons + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0803D17E + lsrs r7, 2 +_0803D17E: + cmp r6, 0x1A + bne _0803D198 + ldr r0, =gUnknown_02024330 + ldrh r4, [r0] + lsls r0, r5, 16 + subs r0, r5 + movs r1, 0x64 + bl __divsi3 + cmp r4, r0 + bge _0803D198 + movs r7, 0x1 + negs r7, r7 +_0803D198: + ldr r2, [sp, 0x4] + cmp r2, 0 + beq _0803D1B8 + movs r3, 0 + b _0803D254 + .pool +_0803D1B8: + ldr r0, =gUnknown_0202421C + mov r3, r9 + adds r1, r3, r0 + ldrb r1, [r1] + adds r2, r0, 0 + cmp r1, 0 + bne _0803D208 + ldr r0, =gProtectStructs + lsls r1, r3, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + bge _0803D1E0 + movs r3, 0xA5 + b _0803D20A + .pool +_0803D1E0: + ldr r0, =gBattleStruct + ldr r0, [r0] + add r0, r9 + adds r0, 0x80 + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x58 + mov r3, r9 + muls r3, r1 + adds r1, r3, 0 + adds r0, r1 + ldr r1, =gBattleMons + adds r1, 0xC + adds r0, r1 + ldrh r3, [r0] + b _0803D20A + .pool +_0803D208: + movs r3, 0 +_0803D20A: + mov r1, r10 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0803D254 + ldr r0, =gProtectStructs + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + bge _0803D22C + movs r2, 0xA5 + b _0803D256 + .pool +_0803D22C: + ldr r0, =gBattleStruct + ldr r0, [r0] + add r0, r10 + adds r0, 0x80 + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x58 + mov r2, r10 + muls r2, r1 + adds r1, r2, 0 + adds r0, r1 + ldr r1, =gBattleMons + adds r1, 0xC + adds r0, r1 + ldrh r2, [r0] + b _0803D256 + .pool +_0803D254: + movs r2, 0 +_0803D256: + ldr r4, =gBattleMoves + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r4 + movs r1, 0x7 + ldrsb r1, [r0, r1] + lsls r3, r2, 1 + cmp r1, 0 + bne _0803D27A + adds r0, r3, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x7] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _0803D2B8 +_0803D27A: + adds r0, r3, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x7] + lsls r0, 24 + asrs r0, 24 + cmp r1, r0 + bne _0803D2AE + cmp r8, r7 + bne _0803D2A4 + bl Random + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803D2A4 + movs r3, 0x2 + b _0803D2D4 + .pool +_0803D2A4: + cmp r8, r7 + bcs _0803D2D6 + movs r0, 0x1 + str r0, [sp, 0x8] + b _0803D2D6 +_0803D2AE: + cmp r1, r0 + bge _0803D2D6 + movs r1, 0x1 + str r1, [sp, 0x8] + b _0803D2D6 +_0803D2B8: + cmp r8, r7 + bne _0803D2CE + bl Random + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803D2CE + movs r2, 0x2 + str r2, [sp, 0x8] + b _0803D2D6 +_0803D2CE: + cmp r8, r7 + bcs _0803D2D6 + movs r3, 0x1 +_0803D2D4: + str r3, [sp, 0x8] +_0803D2D6: + ldr r0, [sp, 0x8] + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end b_first_side + + thumb_func_start sub_803D2E8 +sub_803D2E8: @ 803D2E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r3, 0 + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803D354 + ldr r0, =gActiveBank + strb r3, [r0] + ldr r4, =gNoOfAllBanks + mov r8, r0 + ldrb r0, [r4] + cmp r3, r0 + bcc _0803D310 + b _0803D54A +_0803D310: + ldr r7, =gUnknown_0202407A + ldr r6, =gUnknown_0202421C + mov r2, r8 + ldr r5, =gTurnOrder +_0803D318: + adds r1, r3, r7 + ldrb r0, [r2] + adds r0, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r3, r5 + ldrb r0, [r2] + strb r0, [r1] + adds r3, 0x1 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r4] + cmp r0, r1 + bcc _0803D318 + b _0803D54A + .pool +_0803D354: + movs r2, 0x2 + ands r1, r2 + cmp r1, 0 + beq _0803D3A4 + ldr r0, =gActiveBank + strb r3, [r0] + ldr r1, =gNoOfAllBanks + mov r8, r0 + adds r2, r1, 0 + ldrb r2, [r2] + cmp r3, r2 + bcs _0803D3C0 + ldr r0, =gUnknown_0202421C + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x3 + beq _0803D3BE +_0803D376: + mov r7, r8 + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gNoOfAllBanks + ldrb r1, [r1] + cmp r0, r1 + bcs _0803D3C0 + ldrb r0, [r7] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0803D376 + b _0803D3BE + .pool +_0803D3A4: + ldr r1, =gUnknown_0202421C + ldrb r0, [r1] + ldr r4, =gActiveBank + mov r8, r4 + cmp r0, 0x3 + bne _0803D3B4 + strb r3, [r4] + movs r3, 0x5 +_0803D3B4: + ldrb r0, [r1, 0x2] + cmp r0, 0x3 + bne _0803D3C0 + mov r7, r8 + strb r2, [r7] +_0803D3BE: + movs r3, 0x5 +_0803D3C0: + cmp r3, 0x5 + bne _0803D448 + ldr r6, =gUnknown_0202407A + ldr r1, =gUnknown_0202421C + mov r2, r8 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r6] + ldr r2, =gTurnOrder + mov r3, r8 + ldrb r0, [r3] + strb r0, [r2] + movs r3, 0x1 + movs r5, 0 + adds r4, r1, 0 + ldr r7, =gBattleMainFunc + mov r10, r7 + ldr r0, =bc_80154A0 + mov r12, r0 + ldr r1, =gBattleStruct + mov r9, r1 + ldr r7, =gNoOfAllBanks + ldrb r7, [r7] + cmp r5, r7 + bge _0803D41A + adds r7, r6, 0 + adds r6, r4, 0 + adds r4, r2, 0 + ldr r2, =gNoOfAllBanks +_0803D3FC: + mov r0, r8 + ldrb r0, [r0] + cmp r5, r0 + beq _0803D412 + adds r1, r3, r7 + adds r0, r5, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, r4 + strb r5, [r0] + adds r3, 0x1 +_0803D412: + adds r5, 0x1 + ldrb r1, [r2] + cmp r5, r1 + blt _0803D3FC +_0803D41A: + mov r2, r12 + mov r3, r10 + str r2, [r3] + mov r4, r9 + ldr r0, [r4] + b _0803D554 + .pool +_0803D448: + movs r0, 0 + mov r7, r8 + strb r0, [r7] + ldr r1, =gNoOfAllBanks + ldrb r0, [r1] + cmp r0, 0 + beq _0803D48E + ldr r6, =gUnknown_0202421C + mov r2, r8 + ldr r5, =gUnknown_0202407A + ldr r4, =gTurnOrder +_0803D45E: + ldrb r0, [r2] + adds r0, r6 + ldrb r1, [r0] + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0803D47C + adds r0, r3, r5 + strb r1, [r0] + adds r1, r3, r4 + mov r7, r8 + ldrb r0, [r7] + strb r0, [r1] + adds r3, 0x1 +_0803D47C: + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gNoOfAllBanks + ldrb r1, [r1] + cmp r0, r1 + bcc _0803D45E +_0803D48E: + movs r0, 0 + mov r2, r8 + strb r0, [r2] + ldr r4, =gNoOfAllBanks + ldrb r0, [r4] + cmp r0, 0 + beq _0803D4D2 + ldr r6, =gUnknown_0202421C + ldr r5, =gUnknown_0202407A + ldr r4, =gTurnOrder +_0803D4A2: + ldrb r0, [r2] + adds r0, r6 + ldrb r1, [r0] + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _0803D4C0 + adds r0, r3, r5 + strb r1, [r0] + adds r1, r3, r4 + mov r7, r8 + ldrb r0, [r7] + strb r0, [r1] + adds r3, 0x1 +_0803D4C0: + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gNoOfAllBanks + ldrb r1, [r1] + cmp r0, r1 + bcc _0803D4A2 +_0803D4D2: + movs r5, 0 + b _0803D540 + .pool +_0803D4E8: + adds r4, r5, 0x1 + adds r7, r4, 0 + ldrb r1, [r1] + cmp r7, r1 + bge _0803D53E + ldr r6, =gUnknown_0202407A + lsls r2, r5, 24 + mov r8, r2 +_0803D4F8: + ldr r0, =gTurnOrder + adds r1, r5, r0 + ldrb r3, [r1] + adds r0, r4, r0 + ldrb r1, [r0] + adds r0, r5, r6 + ldrb r2, [r0] + cmp r2, 0x1 + beq _0803D534 + adds r0, r4, r6 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0803D534 + cmp r2, 0x2 + beq _0803D534 + cmp r0, 0x2 + beq _0803D534 + adds r0, r3, 0 + movs r2, 0 + bl b_first_side + lsls r0, 24 + cmp r0, 0 + beq _0803D534 + lsls r1, r4, 24 + lsrs r1, 24 + mov r3, r8 + lsrs r0, r3, 24 + bl sub_803CEDC +_0803D534: + adds r4, 0x1 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r4, r0 + blt _0803D4F8 +_0803D53E: + adds r5, r7, 0 +_0803D540: + ldr r1, =gNoOfAllBanks + ldrb r0, [r1] + subs r0, 0x1 + cmp r5, r0 + blt _0803D4E8 +_0803D54A: + ldr r1, =gBattleMainFunc + ldr r0, =bc_80154A0 + str r0, [r1] + ldr r0, =gBattleStruct + ldr r0, [r0] +_0803D554: + adds r0, 0x48 + movs r1, 0 + strb r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803D2E8 + + thumb_func_start sub_803D580 +sub_803D580: @ 803D580 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r1, =gActiveBank + movs r0, 0 + strb r0, [r1] + ldr r0, =gNoOfAllBanks + ldrb r2, [r0] + adds r5, r1, 0 + cmp r2, 0 + beq _0803D678 + ldr r7, =gProtectStructs + adds r6, r5, 0 + ldr r0, =gBattleMons + 0x50 + mov r12, r0 + ldr r1, =gDisableStructs + mov r8, r1 + mov r10, r8 +_0803D5AE: + mov r2, r9 + cmp r2, 0 + beq _0803D5EC + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + b _0803D648 + .pool +_0803D5EC: + ldrb r0, [r6] + lsls r0, 4 + adds r2, r0, r7 + movs r1, 0 + mov r4, r10 + movs r3, 0 +_0803D5F8: + adds r0, r2, r1 + strb r3, [r0] + adds r1, 0x1 + cmp r1, 0xF + bls _0803D5F8 + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1, 0x16] + cmp r0, 0 + beq _0803D616 + subs r0, 0x1 + strb r0, [r1, 0x16] +_0803D616: + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1, 0x19] + cmp r0, 0 + beq _0803D648 + subs r0, 0x1 + strb r0, [r1, 0x19] + ldrb r2, [r5] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x19] + cmp r0, 0 + bne _0803D648 + movs r0, 0x58 + muls r2, r0 + add r2, r12 + ldr r0, [r2] + ldr r1, =0xffbfffff + ands r0, r1 + str r0, [r2] +_0803D648: + ldrb r2, [r5] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0xA] + cmp r0, 0 + bne _0803D666 + movs r0, 0x58 + muls r2, r0 + add r2, r12 + ldr r0, [r2] + ldr r1, =0xfeffffff + ands r0, r1 + str r0, [r2] +_0803D666: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gNoOfAllBanks + ldrb r1, [r1] + cmp r0, r1 + bcc _0803D5AE +_0803D678: + movs r0, 0 + ldr r2, =gSideTimers + strb r0, [r2, 0x8] + strb r0, [r2, 0x14] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803D580 + + thumb_func_start sub_803D6A0 +sub_803D6A0: @ 803D6A0 + push {r4-r6,lr} + ldr r2, =gActiveBank + movs r0, 0 + strb r0, [r2] + ldr r0, =gNoOfAllBanks + ldrb r1, [r0] + adds r6, r0, 0 + cmp r1, 0 + beq _0803D6DE + adds r3, r2, 0 + movs r4, 0 + ldr r5, =gSpecialStatuses +_0803D6B8: + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r5 + movs r1, 0 +_0803D6C4: + adds r0, r2, r1 + strb r4, [r0] + adds r1, 0x1 + cmp r1, 0x13 + bls _0803D6C4 + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r6] + cmp r0, r1 + bcc _0803D6B8 +_0803D6DE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803D6A0 + + thumb_func_start bc_80154A0 +bc_80154A0: @ 803D6F0 + push {r4-r7,lr} + ldr r0, =gHitMarker + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + bne _0803D7AE + ldr r2, =gBattleStruct + ldr r0, [r2] + adds r0, 0x48 + ldr r1, =gNoOfAllBanks + ldrb r0, [r0] + mov r12, r2 + adds r6, r1, 0 + ldrb r1, [r6] + cmp r0, r1 + bcs _0803D7AE + ldr r5, =gActiveBank + ldr r4, =gBankAttacker + movs r7, 0x84 + lsls r7, 1 +_0803D71C: + ldr r1, [r2] + adds r1, 0x48 + ldrb r0, [r1] + strb r0, [r4] + strb r0, [r5] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =gUnknown_02024274 + ldrb r3, [r5] + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + bne _0803D7A0 + ldr r1, =gBattleMons + movs r0, 0x58 + muls r0, r3 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0803D7A0 + ldr r2, =gDisableStructs + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x18] + lsls r0, 31 + cmp r0, 0 + bne _0803D7A0 + ldr r0, =gProtectStructs + lsls r1, r3, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + blt _0803D7A0 + ldr r0, =gUnknown_082DB1FF + bl b_call_bc_move_exec + b _0803D7E8 + .pool +_0803D7A0: + mov r2, r12 + ldr r0, [r2] + adds r0, 0x48 + ldrb r0, [r0] + ldrb r1, [r6] + cmp r0, r1 + bcc _0803D71C +_0803D7AE: + bl b_clear_atk_up_if_hit_flag_unless_enraged + ldr r1, =gUnknown_02024082 + movs r0, 0 + strb r0, [r1] + ldr r1, =gFightStateTracker + ldr r0, =gUnknown_0202407A + movs r3, 0 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =gDynamicBasePower + movs r2, 0 + strh r3, [r0] + ldr r0, =gBattleStruct + ldr r0, [r0] + strb r2, [r0, 0x13] + ldr r1, =gBattleMainFunc + ldr r0, =bc_bs_exec + str r0, [r1] + ldr r0, =gBattleCommunication + strb r2, [r0, 0x3] + strb r2, [r0, 0x4] + ldr r0, =gBattleScripting + strb r2, [r0, 0x16] + ldr r0, =gBattleResources + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0x20 + strb r2, [r0] +_0803D7E8: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bc_80154A0 + + thumb_func_start bc_bs_exec +bc_bs_exec: @ 803D818 + push {r4-r6,lr} + ldr r6, =gBattleOutcome + ldrb r0, [r6] + ldr r2, =gFightStateTracker + cmp r0, 0 + beq _0803D828 + movs r0, 0xC + strb r0, [r2] +_0803D828: + ldr r5, =gBattleStruct + ldr r0, [r5] + adds r0, 0x4B + ldr r4, =gUnknown_02024082 + ldrb r1, [r4] + strb r1, [r0] + ldr r1, =gUnknown_0831BC0C + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =gNoOfAllBanks + ldrb r1, [r4] + ldrb r0, [r0] + cmp r1, r0 + bcc _0803D894 + ldr r2, =gHitMarker + ldr r0, [r2] + ldr r1, =0xffefffff + ands r0, r1 + str r0, [r2] + ldr r3, =gBattleMainFunc + ldr r2, =gUnknown_0831BC44 + ldrb r1, [r6] + movs r0, 0x7F + ands r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [r3] + b _0803D8AC + .pool +_0803D894: + ldr r0, [r5] + adds r0, 0x4B + ldrb r0, [r0] + cmp r0, r1 + beq _0803D8AC + ldr r2, =gHitMarker + ldr r0, [r2] + ldr r1, =0xfffffdff + ands r0, r1 + ldr r1, =0xfff7ffff + ands r0, r1 + str r0, [r2] +_0803D8AC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bc_bs_exec + + thumb_func_start sub_803D8C0 +sub_803D8C0: @ 803D8C0 + push {r4,lr} + ldr r1, =gFightStateTracker + movs r0, 0 + strb r0, [r1] + ldr r1, =gBattleTypeFlags + ldr r2, [r1] + ldr r0, =0x02000002 + ands r0, r2 + cmp r0, 0 + beq _0803D920 + ldr r1, =gScriptResult + ldr r4, =gBattleOutcome + ldrb r0, [r4] + strh r0, [r1] + ldr r1, =gBattleTextBuff1 + ldrb r0, [r4] + strb r0, [r1] + movs r0, 0 + bl GetBankByPlayerAI + ldr r1, =gBankAttacker + strb r0, [r1] + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DAA35 + str r0, [r1] + ldrb r1, [r4] + movs r0, 0x7F + ands r0, r1 + strb r0, [r4] + b _0803DAA4 + .pool +_0803D920: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0803D95C + ldr r0, =0x043f0900 + ands r2, r0 + cmp r2, 0 + beq _0803D95C + bl sub_805EA60 + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DAA87 + str r0, [r1] + ldr r0, =gTrainerBattleOpponent_A + ldrh r1, [r0] + ldr r0, =0x000003fe + cmp r1, r0 + bne _0803D946 + b _0803DA8A +_0803D946: + b _0803DA94 + .pool +_0803D95C: + ldr r0, [r1] + movs r1, 0xA + ands r0, r1 + cmp r0, 0x8 + beq _0803D968 + b _0803DA9E +_0803D968: + bl sub_805EA60 + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DA92D + str r0, [r1] + ldr r2, =gTrainers + ldr r0, =gTrainerBattleOpponent_A + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + subs r0, 0x3 + cmp r0, 0x32 + bls _0803D98A + b _0803DA94 +_0803D98A: + lsls r0, 2 + ldr r1, =_0803D9A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803D9A8: + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA74 + .4byte _0803DA8A + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA74 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA80 +_0803DA74: + ldr r0, =0x00000163 + bl PlayBGM + b _0803DAA4 + .pool +_0803DA80: + movs r0, 0xD4 + lsls r0, 1 + bl PlayBGM + b _0803DAA4 +_0803DA8A: + movs r0, 0xB1 + lsls r0, 1 + bl PlayBGM + b _0803DAA4 +_0803DA94: + movs r0, 0xCE + lsls r0, 1 + bl PlayBGM + b _0803DAA4 +_0803DA9E: + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DA96A + str r0, [r1] +_0803DAA4: + ldr r1, =gBattleMainFunc + ldr r0, =sub_803DCD8 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803D8C0 + + thumb_func_start sub_803DAC0 +sub_803DAC0: @ 803DAC0 + push {r4,lr} + ldr r1, =gFightStateTracker + movs r0, 0 + strb r0, [r1] + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + ldr r0, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _0803DB7C + ldr r0, =0x003f0100 + ands r1, r0 + cmp r1, 0 + beq _0803DB44 + ldr r3, =gBattleOutcome + ldrb r2, [r3] + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _0803DB2C + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DB9C8 + str r0, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r3] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + b _0803DB82 + .pool +_0803DB2C: + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DAA0B + str r0, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r3] + b _0803DB82 + .pool +_0803DB44: + ldr r1, =gBattleTextBuff1 + ldr r4, =gBattleOutcome + ldrb r0, [r4] + strb r0, [r1] + movs r0, 0 + bl GetBankByPlayerAI + ldr r1, =gBankAttacker + strb r0, [r1] + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DAA35 + str r0, [r1] + ldrb r1, [r4] + movs r0, 0x7F + ands r0, r1 + strb r0, [r4] + b _0803DB82 + .pool +_0803DB7C: + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DA96D + str r0, [r1] +_0803DB82: + ldr r1, =gBattleMainFunc + ldr r0, =sub_803DCD8 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DAC0 + + thumb_func_start sub_803DBA0 +sub_803DBA0: @ 803DBA0 + push {lr} + ldr r1, =gFightStateTracker + movs r0, 0 + strb r0, [r1] + ldr r1, =gBattleTypeFlags + ldr r2, [r1] + ldr r0, =0x003f0100 + ands r0, r2 + cmp r0, 0 + beq _0803DBFC + movs r0, 0x8 + ands r2, r0 + cmp r2, 0 + beq _0803DBFC + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DB9C1 + str r0, [r1] + ldr r1, =gBattleOutcome + movs r0, 0x9 + strb r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + b _0803DC6A + .pool +_0803DBFC: + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + beq _0803DC24 + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DB9C1 + str r0, [r1] + ldr r1, =gBattleOutcome + movs r0, 0x9 + strb r0, [r1] + b _0803DC6A + .pool +_0803DC24: + ldr r1, =gProtectStructs + ldr r0, =gBankAttacker + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 27 + lsrs r0, 30 + cmp r0, 0x1 + beq _0803DC54 + cmp r0, 0x2 + beq _0803DC64 + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DAAF0 + b _0803DC68 + .pool +_0803DC54: + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DAADB + b _0803DC68 + .pool +_0803DC64: + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DAAE9 +_0803DC68: + str r0, [r1] +_0803DC6A: + ldr r1, =gBattleMainFunc + ldr r0, =sub_803DCD8 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DBA0 + + thumb_func_start bc_80158BC +bc_80158BC: @ 803DC84 + ldr r1, =gFightStateTracker + movs r0, 0 + strb r0, [r1] + ldr r1, =gBattleTextBuff1 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + ldr r2, =gBankAttacker + ldrb r0, [r2] + strb r0, [r1, 0x2] + ldr r3, =gBattlePartyID + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DAAF7 + str r0, [r1] + ldr r1, =gBattleMainFunc + ldr r0, =sub_803DCD8 + str r0, [r1] + bx lr + .pool + thumb_func_end bc_80158BC + + thumb_func_start sub_803DCD8 +sub_803DCD8: @ 803DCD8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gFightStateTracker + ldrb r0, [r0] + subs r0, 0xB + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _0803DCEE + b _0803DE10 +_0803DCEE: + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + ldr r0, =0x023f0b92 + ands r1, r0 + cmp r1, 0 + bne _0803DDB6 + ldr r2, =gActiveBank + strb r1, [r2] + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r1, r0 + bcs _0803DDB2 + adds r5, r2, 0 + ldr r0, =gBattlePartyID + mov r8, r0 + movs r7, 0x64 + ldr r6, =gPlayerParty +_0803DD10: + ldrb r0, [r5] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0803DDA0 + ldr r4, =gBattleResults + ldrh r0, [r4, 0x6] + cmp r0, 0 + bne _0803DD74 + ldrb r0, [r5] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r7 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl GetMonData + strh r0, [r4, 0x6] + ldrb r0, [r5] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r7 + adds r0, r6 + movs r1, 0x2 + adds r2, r4, 0 + adds r2, 0x8 + bl GetMonData + b _0803DDA0 + .pool +_0803DD74: + ldrb r0, [r5] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r7 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl GetMonData + strh r0, [r4, 0x26] + ldrb r0, [r5] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r7 + adds r0, r6 + movs r1, 0x2 + adds r2, r4, 0 + adds r2, 0x14 + bl GetMonData +_0803DDA0: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r1, =gNoOfAllBanks + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803DD10 +_0803DDB2: + bl sub_80EC728 +_0803DDB6: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + ldr r1, =0x023f0b9a + ands r0, r1 + cmp r0, 0 + bne _0803DDD2 + ldr r0, =gBattleResults + ldrb r1, [r0, 0x5] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0803DDD2 + bl sub_80EE184 +_0803DDD2: + bl sub_8186444 + movs r0, 0x3 + bl BeginFastPaletteFade + movs r0, 0x5 + bl FadeOutMapMusic + ldr r1, =gBattleMainFunc + ldr r0, =sub_803DE40 + str r0, [r1] + ldr r1, =gUnknown_030061E8 + ldr r0, =sub_8038420 + str r0, [r1] + b _0803DE2A + .pool +_0803DE10: + ldr r0, =gBattleExecBuffer + ldr r0, [r0] + cmp r0, 0 + bne _0803DE2A + ldr r1, =gBattleScriptingCommandsTable + ldr r0, =gBattlescriptCurrInstr + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_0803DE2A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DCD8 + + thumb_func_start sub_803DE40 +sub_803DE40: @ 803DE40 + push {lr} + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0803DE86 + bl ResetSpriteData + ldr r0, =gUnknown_03005D54 + ldrb r0, [r0] + cmp r0, 0 + beq _0803DE62 + ldr r0, =gBattleOutcome + ldrb r0, [r0] + cmp r0, 0x1 + beq _0803DE80 +_0803DE62: + ldr r1, =gBattleMainFunc + ldr r0, =c4_overworld + str r0, [r1] + b _0803DEA2 + .pool +_0803DE80: + ldr r1, =gBattleMainFunc + ldr r0, =bc_evolution_cutscene + str r0, [r1] +_0803DE86: + bl FreeAllWindowBuffers + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0803DEA2 + bl sub_805F094 + bl sub_8057028 + bl dp11_free +_0803DEA2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DE40 + + thumb_func_start bc_evolution_cutscene +bc_evolution_cutscene: @ 803DEB4 + push {r4-r6,lr} + ldr r0, =gUnknown_03005D54 + ldrb r1, [r0] + adds r3, r0, 0 + cmp r1, 0 + beq _0803DF2E +_0803DEC0: + movs r6, 0 +_0803DEC2: + ldrb r2, [r3] + ldr r0, =gBitTable + lsls r1, r6, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0803DF20 + bics r2, r1 + strb r2, [r3] + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0803DF20 + bl FreeAllWindowBuffers + ldr r0, =gBattleMainFunc + ldr r1, =sub_803DF48 + str r1, [r0] + lsls r3, r6, 24 + lsrs r3, 24 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl evolution_cutscene + b _0803DF34 + .pool +_0803DF20: + adds r6, 0x1 + ldr r3, =gUnknown_03005D54 + cmp r6, 0x5 + ble _0803DEC2 + ldrb r0, [r3] + cmp r0, 0 + bne _0803DEC0 +_0803DF2E: + ldr r1, =gBattleMainFunc + ldr r0, =c4_overworld + str r0, [r1] +_0803DF34: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bc_evolution_cutscene + + thumb_func_start sub_803DF48 +sub_803DF48: @ 803DF48 + push {lr} + ldr r0, =gMain + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _0803DF5A + ldr r1, =gBattleMainFunc + ldr r0, =bc_evolution_cutscene + str r0, [r1] +_0803DF5A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DF48 + + thumb_func_start c4_overworld +c4_overworld: @ 803DF70 + push {r4-r6,lr} + ldr r6, =gBattleTypeFlags + ldr r0, [r6] + movs r5, 0x2 + ands r0, r5 + cmp r0, 0 + bne _0803DF8C + ldr r4, =gPlayerParty + adds r0, r4, 0 + bl RandomlyGivePartyPokerus + adds r0, r4, 0 + bl PartySpreadPokerus +_0803DF8C: + ldr r4, [r6] + adds r0, r4, 0 + ands r0, r5 + cmp r0, 0 + beq _0803DF9E + ldr r0, =gUnknown_03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0803DFEC +_0803DF9E: + ldr r1, =gScriptResult + ldr r5, =gBattleOutcome + ldrb r0, [r5] + strh r0, [r1] + ldr r3, =gMain + ldr r0, =0x00000439 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =gUnknown_03005D00 + ldr r0, [r0] + str r0, [r3] + movs r0, 0x80 + lsls r0, 3 + ands r4, r0 + cmp r4, 0 + beq _0803DFDE + ldr r0, =gEnemyParty + bl UpdateRoamerHPStatus + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0803DFDA + cmp r1, 0x7 + bne _0803DFDE +_0803DFDA: + bl SetRoamerInactive +_0803DFDE: + movs r0, 0x5A + bl m4aSongNumStop + ldr r0, =gMain + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_0803DFEC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end c4_overworld + + thumb_func_start bc_move_exec_returning +bc_move_exec_returning: @ 803E018 + push {lr} + ldr r0, =gFightStateTracker + ldrb r0, [r0] + subs r0, 0xB + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0803E060 + ldr r3, =gBattleResources + ldr r0, [r3] + ldr r0, [r0, 0xC] + adds r1, r0, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0 + beq _0803E03C + subs r0, 0x1 + strb r0, [r1] +_0803E03C: + ldr r2, =gBattleMainFunc + ldr r0, [r3] + ldr r1, [r0, 0xC] + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + b _0803E07A + .pool +_0803E060: + ldr r0, =gBattleExecBuffer + ldr r0, [r0] + cmp r0, 0 + bne _0803E07A + ldr r1, =gBattleScriptingCommandsTable + ldr r0, =gBattlescriptCurrInstr + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_0803E07A: + pop {r0} + bx r0 + .pool + thumb_func_end bc_move_exec_returning + + thumb_func_start sub_803E08C +sub_803E08C: @ 803E08C + push {lr} + ldr r0, =gBattleExecBuffer + ldr r0, [r0] + cmp r0, 0 + bne _0803E0A8 + ldr r1, =gBattleScriptingCommandsTable + ldr r0, =gBattlescriptCurrInstr + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_0803E0A8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803E08C + + thumb_func_start sub_803E0B8 +sub_803E0B8: @ 803E0B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0x4 + str r0, [sp] + ldr r6, =gBankAttacker + ldr r1, =gTurnOrder + ldr r0, =gUnknown_02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r6] + ldr r1, =gBattleStruct + ldr r3, [r1] + adds r0, r3, 0 + adds r0, 0x91 + ldrb r2, [r0] + ldr r1, =gBitTable + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + beq _0803E110 + ldr r1, =gFightStateTracker + movs r0, 0xC + b _0803E83C + .pool +_0803E110: + ldr r1, =gCritMultiplier + movs r0, 0x1 + strb r0, [r1] + ldr r1, =gBattleScripting + movs r0, 0x1 + strb r0, [r1, 0xE] + ldr r5, =0x000001a3 + adds r0, r3, r5 + strb r2, [r0] + ldr r0, =gBattleMoveFlags + strb r2, [r0] + ldr r0, =gUnknown_02024212 + strb r2, [r0] + ldr r0, =gBattleCommunication + strb r2, [r0, 0x6] + ldr r2, =gCurrMovePos + ldr r0, =gUnknown_020241E9 + mov r9, r0 + ldrb r0, [r6] + ldr r3, =gBattleStruct + ldr r1, [r3] + adds r0, r1 + adds r0, 0x80 + ldrb r0, [r0] + mov r5, r9 + strb r0, [r5] + strb r0, [r2] + ldr r1, =gProtectStructs + ldrb r4, [r6] + lsls r0, r4, 4 + adds r3, r0, r1 + ldrb r1, [r3] + lsls r0, r1, 29 + mov r8, r2 + cmp r0, 0 + bge _0803E1BC + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldr r2, =gCurrentMove + ldr r1, =gUnknown_020241EC + movs r0, 0xA5 + strh r0, [r1] + strh r0, [r2] + ldr r2, =gHitMarker + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 4 + orrs r0, r1 + str r0, [r2] + movs r0, 0xA5 + movs r1, 0 + bl GetMoveTarget + ldrb r1, [r6] + ldr r3, =gBattleStruct + ldr r2, [r3] + b _0803E316 + .pool +_0803E1BC: + ldr r5, =gBattleMons + mov r10, r5 + movs r0, 0x58 + adds r5, r4, 0 + muls r5, r0 + mov r0, r10 + adds r0, 0x50 + adds r0, r5, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + bne _0803E1E2 + movs r7, 0x80 + lsls r7, 15 + ands r7, r1 + cmp r7, 0 + beq _0803E204 +_0803E1E2: + ldr r3, =gCurrentMove + ldr r2, =gUnknown_020241EC + ldr r1, =gUnknown_02024268 + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + strh r0, [r3] + b _0803E33C + .pool +_0803E204: + ldr r1, =gDisableStructs + mov r12, r1 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + add r0, r12 + ldrh r3, [r0, 0x6] + adds r1, r3, 0 + cmp r1, 0 + beq _0803E2DC + ldrb r2, [r0, 0xC] + lsls r0, r2, 1 + adds r0, r5 + mov r4, r10 + adds r4, 0xC + adds r0, r4 + ldrh r0, [r0] + cmp r1, r0 + bne _0803E268 + ldr r2, =gCurrentMove + ldr r0, =gUnknown_020241EC + strh r3, [r0] + strh r3, [r2] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r0, [r0, 0xC] + mov r3, r9 + strb r0, [r3] + mov r5, r8 + strb r0, [r5] + ldrh r0, [r2] + movs r1, 0 + bl GetMoveTarget + ldrb r1, [r6] + ldr r3, =gBattleStruct + ldr r2, [r3] + b _0803E316 + .pool +_0803E268: + cmp r1, 0 + beq _0803E2DC + cmp r1, r0 + beq _0803E2DC + mov r5, r9 + strb r2, [r5] + mov r0, r8 + strb r2, [r0] + ldr r3, =gCurrentMove + ldr r2, =gUnknown_020241EC + ldrb r0, [r0] + lsls r0, 1 + ldrb r1, [r6] + movs r5, 0x58 + muls r1, r5 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r2] + strh r0, [r3] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + movs r2, 0 + strh r7, [r0, 0x6] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + strb r2, [r0, 0xC] + ldrb r0, [r6] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r12 + ldrb r2, [r1, 0xE] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0xE] + ldrh r0, [r3] + movs r1, 0 + bl GetMoveTarget + ldrb r1, [r6] + ldr r3, =gBattleStruct + ldr r2, [r3] + b _0803E316 + .pool +_0803E2DC: + ldr r3, =gBattleMons + mov r5, r8 + ldrb r0, [r5] + lsls r0, 1 + ldr r4, =gBankAttacker + ldrb r2, [r4] + movs r1, 0x58 + muls r1, r2 + adds r0, r1 + adds r3, 0xC + adds r0, r3 + ldr r1, =gUnknown_02024274 + lsls r2, 1 + adds r2, r1 + ldrh r3, [r0] + ldrh r2, [r2] + cmp r3, r2 + beq _0803E334 + ldr r1, =gCurrentMove + ldr r0, =gUnknown_020241EC + strh r3, [r0] + strh r3, [r1] + ldrh r0, [r1] + movs r1, 0 + bl GetMoveTarget + ldrb r1, [r4] + ldr r2, =gBattleStruct + ldr r2, [r2] +_0803E316: + adds r1, r2 + strb r0, [r1, 0xC] + b _0803E33C + .pool +_0803E334: + ldr r1, =gCurrentMove + ldr r0, =gUnknown_020241EC + strh r3, [r0] + strh r3, [r1] +_0803E33C: + ldr r2, =gBattleMons + ldr r1, =gBankAttacker + ldrb r3, [r1] + movs r0, 0x58 + muls r0, r3 + adds r0, r2 + ldrh r0, [r0, 0x28] + mov r8, r1 + cmp r0, 0 + beq _0803E384 + adds r0, r3, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0803E37C + ldr r0, =gBattleResults + ldr r1, =gCurrentMove + ldrh r1, [r1] + strh r1, [r0, 0x22] + b _0803E384 + .pool +_0803E37C: + ldr r0, =gBattleResults + ldr r1, =gCurrentMove + ldrh r1, [r1] + strh r1, [r0, 0x24] +_0803E384: + mov r1, r8 + ldrb r0, [r1] + bl GetBankSide + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gSideTimers + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r5, r0, r1 + ldrb r0, [r5, 0x8] + cmp r0, 0 + beq _0803E400 + ldr r2, =gBattleMoves + ldr r0, =gCurrentMove + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0803E400 + mov r3, r8 + ldrb r0, [r3] + bl GetBankSide + adds r4, r0, 0 + ldrb r0, [r5, 0x9] + bl GetBankSide + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803E400 + ldr r1, =gBattleMons + ldrb r2, [r5, 0x9] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0803E400 + ldr r0, =gBankTarget + strb r2, [r0] + b _0803E76A + .pool +_0803E400: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + ldr r5, =gBankAttacker + mov r8, r5 + cmp r0, 0 + bne _0803E412 + b _0803E6E0 +_0803E412: + ldr r1, =gSideTimers + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x8] + cmp r5, 0 + beq _0803E424 + b _0803E630 +_0803E424: + ldr r2, =gBattleMoves + ldr r0, =gCurrentMove + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _0803E440 + ldrb r0, [r4, 0x6] + cmp r0, 0x10 + bne _0803E440 + b _0803E630 +_0803E440: + ldr r3, =gBattleMons + ldr r2, =gBankAttacker + ldrb r6, [r2] + ldr r0, =gBattleStruct + ldr r0, [r0] + adds r0, r6, r0 + ldrb r1, [r0, 0xC] + movs r0, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + mov r8, r2 + cmp r0, 0x1F + bne _0803E460 + b _0803E630 +_0803E460: + ldrb r0, [r4, 0x2] + cmp r0, 0xD + beq _0803E468 + b _0803E630 +_0803E468: + adds r0, r6, 0 + bl GetBankSide + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gActiveBank + strb r5, [r1] + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r5, r0 + bcs _0803E4E0 + adds r4, r1, 0 +_0803E480: + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _0803E4CE + ldr r0, =gBankAttacker + ldrb r1, [r0] + ldr r0, =gBattleStruct + ldr r0, [r0] + adds r1, r0 + ldrb r0, [r1, 0xC] + ldrb r1, [r4] + cmp r0, r1 + beq _0803E4CE + ldr r1, =gBattleMons + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1F + bne _0803E4CE + adds r0, r2, 0 + bl sub_8048728 + lsls r0, 24 + lsrs r0, 24 + ldr r3, [sp] + cmp r0, r3 + bcs _0803E4CE + ldrb r0, [r4] + bl sub_8048728 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] +_0803E4CE: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =gNoOfAllBanks + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803E480 +_0803E4E0: + ldr r5, [sp] + cmp r5, 0x4 + beq _0803E4E8 + b _0803E5E2 +_0803E4E8: + ldr r2, =gBattleMoves + ldr r0, =gUnknown_020241EC + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x6] + ands r5, r0 + cmp r5, 0 + beq _0803E568 + ldr r0, =gBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0803E548 + bl Random + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803E544 + movs r0, 0x1 + b _0803E55A + .pool +_0803E544: + movs r0, 0x3 + b _0803E55A +_0803E548: + bl Random + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803E558 + movs r0, 0 + b _0803E55A +_0803E558: + movs r0, 0x2 +_0803E55A: + bl GetBankByPlayerAI + ldr r1, =gBankTarget + strb r0, [r1] + b _0803E578 + .pool +_0803E568: + ldr r2, =gBankTarget + ldr r0, =gBankAttacker + ldrb r0, [r0] + ldr r1, =gBattleStruct + ldr r1, [r1] + adds r0, r1 + ldrb r0, [r0, 0xC] + strb r0, [r2] +_0803E578: + ldr r7, =gAbsentBankFlags + ldrb r0, [r7] + ldr r1, =gBitTable + mov r8, r1 + ldr r5, =gBankTarget + ldrb r1, [r5] + lsls r1, 2 + add r1, r8 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _0803E592 + b _0803E76A +_0803E592: + ldr r6, =gBankAttacker + ldrb r0, [r6] + bl GetBankSide + adds r4, r0, 0 + ldrb r0, [r5] + bl GetBankSide + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803E5C4 + ldrb r0, [r5] + b _0803E758 + .pool +_0803E5C4: + ldrb r0, [r6] + bl GetBankIdentity + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + strb r0, [r5] + ldrb r1, [r7] + ldrb r2, [r5] + lsls r0, r2, 2 + add r0, r8 + b _0803E74E +_0803E5E2: + ldr r4, =gActiveBank + ldr r0, =gTurnOrder + ldr r3, [sp] + adds r0, r3, r0 + ldrb r0, [r0] + strb r0, [r4] + ldrb r0, [r4] + ldr r2, =gBattleMons + movs r1, 0x58 + muls r1, r0 + adds r1, r2 + adds r1, 0x20 + ldrb r1, [r1] + bl RecordAbilityBattle + ldr r2, =gSpecialStatuses + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] + ldr r1, =gBankTarget + ldrb r0, [r4] + strb r0, [r1] + b _0803E76A + .pool +_0803E630: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r4, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0803E6E0 + ldr r2, =gBattleMoves + ldr r0, =gUnknown_020241EC + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x6] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0803E6E0 + mov r5, r8 + ldrb r0, [r5] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0803E684 + bl Random + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0 + beq _0803E680 + movs r0, 0x1 + b _0803E696 + .pool +_0803E680: + movs r0, 0x3 + b _0803E696 +_0803E684: + bl Random + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0 + beq _0803E694 + movs r0, 0 + b _0803E696 +_0803E694: + movs r0, 0x2 +_0803E696: + bl GetBankByPlayerAI + ldr r1, =gBankTarget + strb r0, [r1] + ldr r0, =gAbsentBankFlags + ldrb r1, [r0] + ldr r2, =gBitTable + ldr r5, =gBankTarget + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0803E76A + ldr r0, =gBankAttacker + ldrb r0, [r0] + bl GetBankSide + adds r4, r0, 0 + ldrb r0, [r5] + bl GetBankSide + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803E76A + ldrb r0, [r5] + b _0803E758 + .pool +_0803E6E0: + ldr r5, =gBankTarget + mov r2, r8 + ldrb r0, [r2] + ldr r1, =gBattleStruct + ldr r1, [r1] + adds r0, r1 + ldrb r0, [r0, 0xC] + strb r0, [r5] + ldr r6, =gAbsentBankFlags + ldrb r1, [r6] + ldr r7, =gBitTable + ldrb r0, [r5] + lsls r0, 2 + adds r0, r7 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0803E76A + ldrb r0, [r2] + bl GetBankSide + adds r4, r0, 0 + ldrb r0, [r5] + bl GetBankSide + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803E730 + ldrb r0, [r5] + b _0803E758 + .pool +_0803E730: + mov r1, r8 + ldrb r0, [r1] + bl GetBankIdentity + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + strb r0, [r5] + ldrb r1, [r6] + ldrb r2, [r5] + lsls r0, r2, 2 + adds r0, r7 +_0803E74E: + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0803E76A + adds r0, r2, 0 +_0803E758: + bl GetBankIdentity + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl GetBankByPlayerAI + strb r0, [r5] +_0803E76A: + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 10 + ands r1, r2 + adds r5, r0, 0 + cmp r1, 0 + beq _0803E808 + ldr r0, =gProtectStructs + ldr r4, =gBankAttacker + ldrb r2, [r4] + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + lsls r0, 27 + cmp r0, 0 + bge _0803E808 + ldr r1, =gBattleMons + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0803E7B4 + ldr r1, =gFightStateTracker + movs r0, 0xC + b _0803E83C + .pool +_0803E7B4: + ldr r3, =gUnknown_02024230 + lsls r0, r2, 2 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0 + beq _0803E7EC + ldr r1, =gBattleCommunication + movs r2, 0 + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r1, =gBattlescriptCurrInstr + ldrb r0, [r4] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + str r0, [r1] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r3 + str r2, [r0] + b _0803E824 + .pool +_0803E7EC: + ldr r1, =gBattleCommunication + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DB6AD + str r0, [r1] + b _0803E824 + .pool +_0803E808: + ldr r4, =gBattlescriptCurrInstr + ldr r3, =gUnknown_082D86A8 + ldr r2, =gBattleMoves + ldr r0, =gCurrentMove + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + str r0, [r4] +_0803E824: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0803E838 + ldr r0, =gBankAttacker + ldrb r0, [r0] + bl sub_81A56E8 +_0803E838: + ldr r1, =gFightStateTracker + movs r0, 0xA +_0803E83C: + strb r0, [r1] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803E0B8 + + thumb_func_start bs2_8016374 +bs2_8016374: @ 803E868 + push {r4,lr} + ldr r3, =gBankAttacker + ldr r1, =gTurnOrder + ldr r0, =gUnknown_02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + ldr r0, =gUnknown_02022E14 + movs r2, 0 + strh r2, [r0] + ldr r0, =gUnknown_02022E16 + strh r2, [r0] + ldr r1, =gUnknown_020244AC + ldrb r0, [r3] + adds r0, r1 + strb r2, [r0] + ldr r1, =gUnknown_020244B0 + ldrb r0, [r3] + adds r0, r1 + strb r2, [r0] + ldr r2, =gBattleTextBuff1 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x7 + strb r0, [r2, 0x1] + ldrb r4, [r3] + strb r4, [r2, 0x2] + ldrb r0, [r3] + ldr r1, =gBattleStruct + ldr r1, [r1] + adds r0, r1 + adds r0, 0x58 + ldrb r0, [r0] + strb r0, [r2, 0x3] + movs r0, 0xFF + strb r0, [r2, 0x4] + ldr r0, =gBattleScripting + strb r4, [r0, 0x17] + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DAB15 + str r0, [r1] + ldr r1, =gFightStateTracker + movs r0, 0xA + strb r0, [r1] + ldr r1, =gBattleResults + ldrb r0, [r1, 0x2] + cmp r0, 0xFE + bhi _0803E8CE + adds r0, 0x1 + strb r0, [r1, 0x2] +_0803E8CE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bs2_8016374 + + thumb_func_start sub_803E90C +sub_803E90C: @ 803E90C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, =gBankAttacker + ldr r2, =gBankTarget + ldr r1, =gTurnOrder + ldr r0, =gUnknown_02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + strb r0, [r4] + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldrb r0, [r4] + bl sub_8045868 + ldr r5, =gLastUsedItem + ldr r2, =gBattleBufferB + ldrb r1, [r4] + lsls r1, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r3, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r0, [r1] + lsls r0, 8 + orrs r3, r0 + strh r3, [r5] + cmp r3, 0xC + bhi _0803E998 + ldr r2, =gBattlescriptCurrInstr + ldr r1, =gUnknown_082DBD08 + ldrh r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r0, =gFightStateTracker + mov r10, r0 + b _0803EBF6 + .pool +_0803E998: + adds r0, r3, 0 + subs r0, 0x50 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _0803E9C0 + ldr r0, =gBattlescriptCurrInstr + ldr r1, =gUnknown_082DBD54 + ldr r1, [r1] + str r1, [r0] + ldr r1, =gFightStateTracker + mov r10, r1 + b _0803EBF6 + .pool +_0803E9C0: + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0803E9E8 + ldr r0, =gBattlescriptCurrInstr + ldr r1, =gUnknown_082DBD3C + ldr r1, [r1] + str r1, [r0] + ldr r2, =gFightStateTracker + mov r10, r2 + b _0803EBF6 + .pool +_0803E9E8: + ldr r3, =gBattleScripting + ldrb r0, [r4] + strb r0, [r3, 0x17] + lsls r0, 24 + lsrs r0, 25 + ldr r2, =gBattleStruct + ldr r1, [r2] + adds r0, r1 + adds r0, 0xC4 + ldrb r0, [r0] + subs r0, 0x1 + mov r8, r4 + ldr r1, =gBattlescriptCurrInstr + mov r9, r1 + ldr r6, =gUnknown_082DBD3C + mov r12, r3 + adds r7, r2, 0 + ldr r2, =gFightStateTracker + mov r10, r2 + cmp r0, 0x4 + bls _0803EA14 + b _0803EBDE +_0803EA14: + lsls r0, 2 + ldr r1, =_0803EA38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803EA38: + .4byte _0803EBDE + .4byte _0803EBDE + .4byte _0803EA4C + .4byte _0803EAE0 + .4byte _0803EBB0 +_0803EA4C: + ldr r5, =gBattleCommunication + movs r0, 0 + strb r0, [r5, 0x5] + ldr r2, =gBankAttacker + ldrb r0, [r2] + lsrs r0, 1 + ldr r1, [r7] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + mov r8, r2 + cmp r0, 0 + beq _0803EA98 + movs r0, 0x3E + ands r0, r1 + ldr r1, =gBattlescriptCurrInstr + mov r9, r1 + ldr r6, =gUnknown_082DBD3C + ldr r2, =gFightStateTracker + mov r10, r2 + cmp r0, 0 + bne _0803EA7E + b _0803EBDE +_0803EA7E: + movs r0, 0x5 + strb r0, [r5, 0x5] + b _0803EBDE + .pool +_0803EA98: + ldr r0, =gBattlescriptCurrInstr + mov r9, r0 + ldr r6, =gUnknown_082DBD3C + ldr r1, =gFightStateTracker + mov r10, r1 + mov r4, r8 + adds r3, r7, 0 + adds r2, r5, 0 +_0803EAA8: + ldrb r1, [r4] + lsrs r1, 1 + ldr r0, [r3] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + lsrs r0, 1 + strb r0, [r1] + ldrb r0, [r2, 0x5] + adds r0, 0x1 + strb r0, [r2, 0x5] + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0803EAA8 + b _0803EBDE + .pool +_0803EAE0: + ldr r3, =gBattleCommunication + movs r0, 0x4 + strb r0, [r3, 0x5] + ldr r2, =gBankAttacker + ldrb r0, [r2] + lsrs r0, 1 + ldr r1, [r7] + adds r0, r1 + adds r6, r0, 0 + adds r6, 0xC6 + ldrb r1, [r6] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r8, r2 + cmp r5, 0 + beq _0803EB28 + movs r0, 0x5 + strb r0, [r3, 0x5] + ldr r2, =gBattlescriptCurrInstr + mov r9, r2 + ldr r6, =gUnknown_082DBD3C + ldr r0, =gFightStateTracker + mov r10, r0 + b _0803EBDE + .pool +_0803EB28: + ldr r3, =gBattleTextBuff1 + movs r4, 0xFD + strb r4, [r3] + movs r0, 0x5 + strb r0, [r3, 0x1] + movs r2, 0x1 + strb r2, [r3, 0x2] + movs r0, 0xFF + strb r0, [r3, 0x3] + ldr r1, =gBattleTextBuff2 + strb r4, [r1] + strb r5, [r1, 0x1] + movs r0, 0xD2 + strb r0, [r1, 0x2] + strb r5, [r1, 0x3] + subs r0, 0xD3 + strb r0, [r1, 0x4] + ldrb r0, [r6] + ands r2, r0 + ldr r1, =gBattlescriptCurrInstr + mov r9, r1 + ldr r6, =gUnknown_082DBD3C + ldr r0, =gFightStateTracker + mov r10, r0 + cmp r2, 0 + bne _0803EB8C + mov r5, r8 + adds r4, r7, 0 + adds r2, r3, 0 +_0803EB62: + ldrb r1, [r5] + lsrs r1, 1 + ldr r0, [r4] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + lsrs r0, 1 + strb r0, [r1] + ldrb r0, [r2, 0x2] + adds r0, 0x1 + strb r0, [r2, 0x2] + ldrb r0, [r5] + lsrs r0, 1 + ldr r1, [r4] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0803EB62 +_0803EB8C: + ldrb r0, [r3, 0x2] + adds r0, 0xE + movs r1, 0 + mov r2, r12 + strb r0, [r2, 0x10] + strb r1, [r2, 0x11] + b _0803EBDE + .pool +_0803EBB0: + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803EBCC + ldr r1, =gBattleCommunication + movs r0, 0x2 + strb r0, [r1, 0x5] + b _0803EBD0 + .pool +_0803EBCC: + ldr r0, =gBattleCommunication + strb r1, [r0, 0x5] +_0803EBD0: + ldr r0, =gBankAttacker + mov r8, r0 + ldr r1, =gBattlescriptCurrInstr + mov r9, r1 + ldr r6, =gUnknown_082DBD3C + ldr r2, =gFightStateTracker + mov r10, r2 +_0803EBDE: + mov r1, r8 + ldrb r0, [r1] + lsrs r0, 1 + ldr r1, [r7] + adds r0, r1 + adds r0, 0xC4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + mov r2, r9 + str r0, [r2] +_0803EBF6: + movs r0, 0xA + mov r1, r10 + strb r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803E90C + + thumb_func_start sub_803EC20 +sub_803EC20: @ 803EC20 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0 + ldr r1, =gBattleMons + movs r0, 0x58 + muls r0, r5 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803EC54 + ldr r1, =gEnigmaBerries + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x7] + b _0803EC5E + .pool +_0803EC54: + ldrh r0, [r1, 0x2E] + bl ItemId_GetHoldEffect + lsls r0, 24 + lsrs r1, r0, 24 +_0803EC5E: + ldr r0, =gUnknown_0202420F + strb r5, [r0] + cmp r1, 0x25 + bne _0803EC9C + ldr r2, =gLastUsedItem + ldr r1, =gBattleMons + movs r0, 0x58 + muls r0, r5 + adds r0, r1 + ldrh r0, [r0, 0x2E] + strh r0, [r2] + ldr r0, =gProtectStructs + lsls r2, r5, 4 + adds r2, r0 + ldrb r1, [r2, 0x1] + movs r0, 0x19 + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0x1] + b _0803ED70 + .pool +_0803EC9C: + ldr r0, =gBattleMons + mov r10, r0 + movs r2, 0x58 + mov r9, r2 + mov r0, r9 + muls r0, r5 + add r0, r10 + mov r8, r0 + adds r0, 0x20 + ldrb r6, [r0] + cmp r6, 0x32 + bne _0803ED5C + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0803ED38 + ldr r4, =gBattleStruct + ldr r1, [r4] + adds r1, 0x6C + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_81A9E28 + lsls r0, 24 + lsrs r1, r0, 24 + mov r2, r8 + ldrh r0, [r2, 0x6] + muls r0, r1 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + mov r2, r9 + muls r2, r1 + adds r1, r2, 0 + add r1, r10 + ldrh r1, [r1, 0x6] + bl __divsi3 + ldr r1, [r4] + adds r1, 0x6C + ldrb r2, [r1] + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + bl Random + movs r1, 0xFF + ands r1, r0 + cmp r4, r1 + bhi _0803ED0C + b _0803EE12 +_0803ED0C: + ldr r0, =gLastUsedAbility + strb r6, [r0] + ldr r0, =gProtectStructs + lsls r2, r5, 4 + adds r2, r0 + ldrb r1, [r2, 0x1] + movs r0, 0x19 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x1] + b _0803ED70 + .pool +_0803ED38: + ldr r0, =gLastUsedAbility + strb r6, [r0] + ldr r0, =gProtectStructs + lsls r2, r5, 4 + adds r2, r0 + ldrb r1, [r2, 0x1] + movs r0, 0x19 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x1] + b _0803ED70 + .pool +_0803ED5C: + ldr r1, =gBattleTypeFlags + ldr r2, [r1] + ldr r0, =0x043f0100 + ands r0, r2 + cmp r0, 0 + beq _0803ED80 + movs r0, 0x8 + ands r2, r0 + cmp r2, 0 + beq _0803ED80 +_0803ED70: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + b _0803EE12 + .pool +_0803ED80: + ldr r0, [r1] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0803EE06 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0803EDBC + bl sub_81A9E28 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r4, =gBattleMons + movs r3, 0x58 + adds r0, r5, 0 + muls r0, r3 + adds r0, r4 + ldrh r0, [r0, 0x6] + muls r0, r1 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + muls r1, r3 + adds r1, r4 + b _0803EDDA + .pool +_0803EDBC: + ldr r3, =gBattleMons + movs r2, 0x58 + adds r0, r5, 0 + muls r0, r2 + adds r4, r0, r3 + movs r1, 0x1 + adds r0, r5, 0 + eors r0, r1 + muls r0, r2 + adds r1, r0, r3 + ldrh r0, [r4, 0x6] + ldrh r2, [r1, 0x6] + cmp r0, r2 + bcs _0803EE00 + lsls r0, 7 +_0803EDDA: + ldrh r1, [r1, 0x6] + bl __divsi3 + ldr r1, =gBattleStruct + ldr r1, [r1] + adds r1, 0x6C + ldrb r2, [r1] + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + bl Random + movs r1, 0xFF + ands r1, r0 + cmp r4, r1 + bls _0803EE06 +_0803EE00: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_0803EE06: + ldr r0, =gBattleStruct + ldr r1, [r0] + adds r1, 0x6C + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0803EE12: + cmp r7, 0 + beq _0803EE24 + ldr r1, =gUnknown_02024082 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + strb r0, [r1] + ldr r1, =gBattleOutcome + movs r0, 0x4 + strb r0, [r1] +_0803EE24: + adds r0, r7, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_803EC20 + + thumb_func_start sub_803EE48 +sub_803EE48: @ 803EE48 + push {r4-r6,lr} + ldr r4, =gBankAttacker + ldr r1, =gTurnOrder + ldr r5, =gUnknown_02024082 + ldrb r0, [r5] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _0803EF0C + ldr r0, =gNoOfAllBanks + ldrb r1, [r0] + strb r1, [r5] + ldr r2, =gActiveBank + movs r0, 0 + strb r0, [r2] + lsls r1, 24 + cmp r1, 0 + beq _0803EEE0 + adds r4, r2, 0 + ldr r6, =gUnknown_0202421C + ldr r5, =gBattleOutcome +_0803EE7C: + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0803EEBC + ldrb r0, [r4] + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0803EECE + ldrb r0, [r5] + movs r1, 0x2 + b _0803EECA + .pool +_0803EEBC: + ldrb r0, [r4] + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0803EECE + ldrb r0, [r5] + movs r1, 0x1 +_0803EECA: + orrs r0, r1 + strb r0, [r5] +_0803EECE: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =gNoOfAllBanks + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803EE7C +_0803EEE0: + ldr r2, =gBattleOutcome + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + b _0803EF96 + .pool +_0803EF0C: + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0803EF4C + ldrb r0, [r4] + bl sub_803EC20 + lsls r0, 24 + cmp r0, 0 + bne _0803EF98 + ldrb r0, [r4] + bl sub_8045868 + ldr r1, =gBattleCommunication + movs r0, 0x3 + strb r0, [r1, 0x5] + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DAB02 + str r0, [r1] + ldr r1, =gFightStateTracker + movs r0, 0xA + b _0803EF96 + .pool +_0803EF4C: + ldr r1, =gBattleMons + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0400e000 + ands r0, r1 + cmp r0, 0 + beq _0803EF8C + ldr r1, =gBattleCommunication + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DAB02 + str r0, [r1] + ldr r1, =gFightStateTracker + movs r0, 0xA + b _0803EF96 + .pool +_0803EF8C: + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + strb r0, [r5] + ldr r1, =gBattleOutcome + movs r0, 0x6 +_0803EF96: + strb r0, [r1] +_0803EF98: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803EE48 + + thumb_func_start sub_803EFA8 +sub_803EFA8: @ 803EFA8 + ldr r2, =gBankAttacker + ldr r1, =gTurnOrder + ldr r0, =gUnknown_02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DBD58 + ldr r0, [r0] + str r0, [r1] + ldr r1, =gFightStateTracker + movs r0, 0xA + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_803EFA8 + + thumb_func_start bs5_8016AC0 +bs5_8016AC0: @ 803EFF0 + ldr r2, =gBankAttacker + ldr r1, =gTurnOrder + ldr r0, =gUnknown_02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r1, =gNumSafariBalls + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + ldr r1, =gLastUsedItem + movs r0, 0x5 + strh r0, [r1] + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DBD08 + ldr r0, [r0, 0x14] + str r0, [r1] + ldr r1, =gFightStateTracker + movs r0, 0xA + strb r0, [r1] + bx lr + .pool + thumb_func_end bs5_8016AC0 + + thumb_func_start sub_803F050 +sub_803F050: @ 803F050 + push {r4-r6,lr} + ldr r3, =gBankAttacker + ldr r1, =gTurnOrder + ldr r0, =gUnknown_02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r6, =gBattleCommunication + ldr r2, =gBattleBufferB + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x1 + strb r0, [r6, 0x5] + ldr r1, =gLastUsedItem + ldrb r0, [r3] + lsls r0, 9 + adds r2, 0x2 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1] + ldr r1, =gBattleResults + ldrb r0, [r1, 0x1F] + cmp r0, 0xFE + bhi _0803F096 + adds r0, 0x1 + strb r0, [r1, 0x1F] +_0803F096: + ldr r2, =gBattleStruct + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0x7A + ldrb r0, [r1] + cmp r0, 0x2 + bhi _0803F0A8 + adds r0, 0x1 + strb r0, [r1] +_0803F0A8: + ldr r0, [r2] + adds r3, r0, 0 + adds r3, 0x7B + ldrb r5, [r3] + adds r4, r5, 0 + cmp r4, 0x1 + bls _0803F100 + ldr r2, =gUnknown_0831BCE0 + adds r0, 0x7A + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + ldrb r6, [r6, 0x5] + adds r0, r6 + adds r0, r2 + ldrb r0, [r0] + cmp r4, r0 + bcs _0803F0FC + movs r0, 0x1 + b _0803F0FE + .pool +_0803F0FC: + subs r0, r5, r0 +_0803F0FE: + strb r0, [r3] +_0803F100: + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DBD58 + ldr r0, [r0, 0x8] + str r0, [r1] + ldr r1, =gFightStateTracker + movs r0, 0xA + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F050 + + thumb_func_start sub_803F120 +sub_803F120: @ 803F120 + push {r4,lr} + ldr r2, =gBankAttacker + ldr r1, =gTurnOrder + ldr r0, =gUnknown_02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =gUnknown_02022E14 + movs r4, 0 + strh r4, [r0] + ldr r0, =gUnknown_02022E16 + strh r4, [r0] + ldr r3, =gBattleStruct + ldr r0, [r3] + adds r2, r0, 0 + adds r2, 0x7C + ldr r1, =gUnknown_0831BCEF + adds r0, 0x79 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + ldrb r1, [r2] + adds r0, r1 + strb r0, [r2] + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x7C + ldrb r0, [r1] + cmp r0, 0x14 + bls _0803F162 + movs r0, 0x14 + strb r0, [r1] +_0803F162: + ldr r0, [r3] + adds r2, r0, 0 + adds r2, 0x7B + ldr r1, =gUnknown_0831BCF3 + adds r0, 0x79 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + ldrb r1, [r2] + adds r0, r1 + strb r0, [r2] + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x7B + ldrb r0, [r1] + cmp r0, 0x14 + bls _0803F188 + movs r0, 0x14 + strb r0, [r1] +_0803F188: + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x79 + ldrb r0, [r1] + cmp r0, 0x2 + bhi _0803F1C4 + adds r0, 0x1 + strb r0, [r1] + ldr r0, =gBattleCommunication + strb r4, [r0, 0x5] + b _0803F1CA + .pool +_0803F1C4: + ldr r1, =gBattleCommunication + movs r0, 0x1 + strb r0, [r1, 0x5] +_0803F1CA: + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DBD58 + ldr r0, [r0, 0x4] + str r0, [r1] + ldr r1, =gFightStateTracker + movs r0, 0xA + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F120 + + thumb_func_start bs8_exit_by_flight +bs8_exit_by_flight: @ 803F1F0 + push {r4,lr} + ldr r2, =gBankAttacker + ldr r1, =gTurnOrder + ldr r4, =gUnknown_02024082 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0x11 + bl PlaySE + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + strb r0, [r4] + ldr r1, =gBattleOutcome + movs r0, 0x4 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bs8_exit_by_flight + + thumb_func_start bs9_8016C9C +bs9_8016C9C: @ 803F22C + ldr r3, =gBankAttacker + ldr r1, =gTurnOrder + ldr r0, =gUnknown_02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + strb r2, [r3] + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r1, =gBattleTextBuff1 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + strb r2, [r1, 0x2] + ldr r2, =gBattlePartyID + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =gBattlescriptCurrInstr + ldr r0, =gUnknown_082DBD58 + ldr r0, [r0, 0xC] + str r0, [r1] + ldr r1, =gFightStateTracker + movs r0, 0xA + strb r0, [r1] + ldr r1, =gUnknown_0202407A + movs r0, 0xC + strb r0, [r1, 0x1] + bx lr + .pool + thumb_func_end bs9_8016C9C + + thumb_func_start bsB_exit_by_move +bsB_exit_by_move: @ 803F2A4 + push {lr} + bl sub_8041728 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0803F2C0 + ldr r0, =gBattleStruct + ldr r0, [r0] + adds r0, 0x4D + strb r1, [r0] + ldr r1, =gFightStateTracker + movs r0, 0xC + strb r0, [r1] +_0803F2C0: + pop {r0} + bx r0 + .pool + thumb_func_end bsB_exit_by_move + + thumb_func_start bsD_proceed +bsD_proceed: @ 803F2CC + ldr r1, =gUnknown_02024082 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r3, =gFightStateTracker + ldr r2, =gUnknown_0202407A + ldrb r0, [r1] + adds r0, r2 + ldrb r0, [r0] + strb r0, [r3] + ldr r2, =gHitMarker + ldr r0, [r2] + ldr r1, =0xf1e892af + ands r0, r1 + str r0, [r2] + bx lr + .pool + thumb_func_end bsD_proceed + + thumb_func_start bsC_8016D70 +bsC_8016D70: @ 803F300 + push {r4-r6,lr} + ldr r1, =gTurnOrder + ldr r2, =gUnknown_02024082 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + ldr r6, =gBattleStruct + ldr r1, [r6] + adds r0, r1 + adds r0, 0x5C + movs r1, 0x6 + strb r1, [r0] + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldr r3, =gFightStateTracker + ldr r1, =gUnknown_0202407A + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + bl sub_803D6A0 + ldr r2, =gHitMarker + ldr r0, [r2] + ldr r1, =0xf1e892af + ands r0, r1 + str r0, [r2] + ldr r0, =gCurrentMove + movs r1, 0 + strh r1, [r0] + ldr r0, =gBattleMoveDamage + movs r4, 0 + str r4, [r0] + ldr r0, =gBattleMoveFlags + strb r1, [r0] + ldr r5, =gBattleScripting + strb r1, [r5, 0x18] + strb r1, [r5, 0x19] + ldr r2, =gUnknown_02024250 + ldr r3, =gBankAttacker + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + strh r4, [r0] + ldr r2, =gUnknown_02024258 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + strh r4, [r0] + ldr r0, [r6] + strb r1, [r0, 0x13] + ldr r0, =gDynamicBasePower + strh r4, [r0] + strb r1, [r5, 0x14] + ldr r0, =gBattleCommunication + strb r1, [r0, 0x3] + strb r1, [r0, 0x4] + strb r1, [r5, 0x16] + ldr r0, =gBattleResources + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0x20 + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bsC_8016D70 + + thumb_func_start get_battle_side_of_something +get_battle_side_of_something: @ 803F3CC + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0 + cmp r1, 0xE + bhi _0803F47A + lsls r0, r1, 2 + ldr r1, =_0803F3E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803F3E8: + .4byte _0803F424 + .4byte _0803F430 + .4byte _0803F43C + .4byte _0803F458 + .4byte _0803F464 + .4byte _0803F458 + .4byte _0803F464 + .4byte _0803F448 + .4byte _0803F464 + .4byte _0803F464 + .4byte _0803F44C + .4byte _0803F464 + .4byte _0803F468 + .4byte _0803F46C + .4byte _0803F470 +_0803F424: + ldr r0, =gBankTarget + ldrb r0, [r0] + b _0803F47A + .pool +_0803F430: + ldr r0, =gBankAttacker + ldrb r0, [r0] + b _0803F47A + .pool +_0803F43C: + ldr r0, =gUnknown_0202420E + ldrb r0, [r0] + b _0803F47A + .pool +_0803F448: + movs r0, 0 + b _0803F47A +_0803F44C: + ldr r0, =gBattleScripting + ldrb r0, [r0, 0x17] + b _0803F47A + .pool +_0803F458: + ldr r0, =gUnknown_0202420D + ldrb r0, [r0] + b _0803F47A + .pool +_0803F464: + movs r0, 0 + b _0803F472 +_0803F468: + movs r0, 0x1 + b _0803F472 +_0803F46C: + movs r0, 0x2 + b _0803F472 +_0803F470: + movs r0, 0x3 +_0803F472: + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r0, 24 +_0803F47A: + pop {r1} + bx r1 + thumb_func_end get_battle_side_of_something + + thumb_func_start sub_803F480 +sub_803F480: @ 803F480 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r1, =gBattleMons + movs r4, 0x58 + muls r0, r4 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + mov r12, r1 + cmp r0, 0x2E + bne _0803F532 + movs r3, 0 + adds r0, r5, 0 + muls r0, r4 + adds r1, 0xC + adds r1, r0, r1 + b _0803F4BC + .pool +_0803F4B4: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + bgt _0803F4C2 +_0803F4BC: + ldrh r0, [r1] + cmp r0, r2 + bne _0803F4B4 +_0803F4C2: + cmp r3, 0x4 + beq _0803F532 + movs r7, 0x58 + adds r2, r5, 0 + muls r2, r7 + adds r0, r3, r2 + mov r6, r12 + adds r6, 0x24 + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0 + beq _0803F4DE + subs r0, 0x1 + strb r0, [r1] +_0803F4DE: + mov r0, r12 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0803F532 + ldr r1, =gDisableStructs + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gBitTable + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803F532 + ldr r4, =gActiveBank + strb r5, [r4] + adds r1, r3, 0 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r4] + muls r0, r7 + adds r0, r6 + adds r0, r3 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803F532: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F480 + + thumb_func_start sub_803F548 +sub_803F548: @ 803F548 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x4 + mov r8, r0 + adds r0, r5, 0 + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r4, 0 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r4, r0 + bge _0803F5F0 + ldr r1, =gBattleMons + movs r0, 0x58 + adds r7, r5, 0 + muls r7, r0 + adds r1, 0xC + mov r10, r1 +_0803F57E: + lsls r0, r4, 24 + lsrs r0, 24 + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + adds r6, r4, 0x1 + cmp r9, r0 + beq _0803F5E6 + ldr r0, =gBattleMons + movs r3, 0x58 + adds r1, r4, 0 + muls r1, r3 + adds r1, r0 + adds r1, 0x20 + ldrb r1, [r1] + adds r4, r0, 0 + cmp r1, 0x2E + bne _0803F5E6 + movs r2, 0 + adds r0, r5, 0 + muls r0, r3 + adds r1, r4, 0 + adds r1, 0xC + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x8F + lsls r1, 1 + cmp r0, r1 + beq _0803F5CE + adds r3, r1, 0 + mov r0, r10 + adds r1, r7, r0 +_0803F5C0: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + bgt _0803F5CE + ldrh r0, [r1] + cmp r0, r3 + bne _0803F5C0 +_0803F5CE: + cmp r2, 0x4 + beq _0803F5E6 + mov r8, r2 + adds r1, r2, r7 + adds r0, r4, 0 + adds r0, 0x24 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _0803F5E6 + subs r0, 0x1 + strb r0, [r1] +_0803F5E6: + adds r4, r6, 0 + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r4, r0 + blt _0803F57E +_0803F5F0: + mov r1, r8 + cmp r1, 0x4 + beq _0803F658 + ldr r6, =gBattleMons + movs r3, 0x58 + adds r0, r5, 0 + muls r0, r3 + adds r1, r6, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0803F658 + ldr r1, =gDisableStructs + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gBitTable + mov r4, r8 + lsls r0, r4, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803F658 + ldr r4, =gActiveBank + strb r5, [r4] + mov r1, r8 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r4] + muls r0, r3 + adds r2, r6, 0 + adds r2, 0x24 + adds r0, r2 + add r0, r8 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803F658: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F548 + + thumb_func_start sub_803F67C +sub_803F67C: @ 803F67C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r3, r0, 24 + movs r6, 0x4 + movs r1, 0 + ldr r0, =gNoOfAllBanks + mov r8, r0 + ldrb r0, [r0] + cmp r1, r0 + bge _0803F6FE + ldr r7, =gBattleMons + movs r2, 0x58 + mov r12, r2 + mov r5, r12 + muls r5, r3 + adds r0, r7, 0 + adds r0, 0xC + adds r2, r5, r0 + mov r10, r2 + mov r9, r5 +_0803F6AE: + mov r0, r12 + muls r0, r1 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + adds r4, r1, 0x1 + cmp r0, 0x2E + bne _0803F6F4 + cmp r1, r3 + beq _0803F6F4 + movs r2, 0 + mov r1, r10 + ldrh r0, [r1] + cmp r0, 0xC3 + beq _0803F6DE + ldr r1, =gBattleMons + 0xC + add r1, r9 +_0803F6D0: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + bgt _0803F6DE + ldrh r0, [r1] + cmp r0, 0xC3 + bne _0803F6D0 +_0803F6DE: + cmp r2, 0x4 + beq _0803F6F4 + adds r6, r2, 0 + adds r0, r6, r5 + ldr r2, =gBattleMons + 0x24 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _0803F6F4 + subs r0, 0x1 + strb r0, [r1] +_0803F6F4: + adds r1, r4, 0 + mov r0, r8 + ldrb r0, [r0] + cmp r1, r0 + blt _0803F6AE +_0803F6FE: + cmp r6, 0x4 + beq _0803F762 + ldr r7, =gBattleMons + movs r5, 0x58 + adds r0, r3, 0 + muls r0, r5 + adds r1, r7, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0803F762 + ldr r1, =gDisableStructs + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gBitTable + lsls r0, r6, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803F762 + ldr r4, =gActiveBank + strb r3, [r4] + adds r1, r6, 0 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r4] + muls r0, r5 + adds r2, r7, 0 + adds r2, 0x24 + adds r0, r2 + adds r0, r6 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803F762: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F67C + + thumb_func_start sub_803F790 +sub_803F790: @ 803F790 + push {r4,r5,lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803F7D0 + movs r2, 0 + ldr r4, =gNoOfAllBanks + ldrb r0, [r4] + cmp r2, r0 + bge _0803F7EE + ldr r3, =gBattleExecBuffer + ldr r5, =gBitTable +_0803F7AC: + ldm r5!, {r1} + lsls r1, 28 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + adds r2, 0x1 + ldrb r0, [r4] + cmp r2, r0 + blt _0803F7AC + b _0803F7EE + .pool +_0803F7D0: + movs r2, 0 + ldr r4, =gNoOfAllBanks + ldrb r0, [r4] + cmp r2, r0 + bge _0803F7EE + ldr r3, =gBattleExecBuffer + ldr r5, =gBitTable +_0803F7DE: + ldr r0, [r3] + ldm r5!, {r1} + orrs r0, r1 + str r0, [r3] + adds r2, 0x1 + ldrb r0, [r4] + cmp r2, r0 + blt _0803F7DE +_0803F7EE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F790 + + thumb_func_start dp01_battle_side_mark_buffer_for_execution +dp01_battle_side_mark_buffer_for_execution: @ 803F800 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803F834 + ldr r2, =gBattleExecBuffer + ldr r1, =gBitTable + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + b _0803F844 + .pool +_0803F834: + ldr r2, =gBattleExecBuffer + ldr r1, =gBitTable + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + orrs r1, r0 + str r1, [r2] +_0803F844: + pop {r0} + bx r0 + .pool + thumb_func_end dp01_battle_side_mark_buffer_for_execution + + thumb_func_start sub_803F850 +sub_803F850: @ 803F850 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r4, 0 + ldr r5, =gBattleExecBuffer + ldr r1, =gBitTable + lsls r0, r7, 2 + adds r6, r0, r1 + b _0803F87A + .pool +_0803F86C: + lsls r0, r4, 2 + ldr r1, [r6] + lsls r1, r0 + ldr r0, [r5] + orrs r0, r1 + str r0, [r5] + adds r4, 0x1 +_0803F87A: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _0803F86C + ldr r2, =gBattleExecBuffer + movs r1, 0x80 + lsls r1, 21 + lsls r1, r7 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F850 + + thumb_func_start CancelMultiTurnMoves +CancelMultiTurnMoves: @ 803F8A0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gBattleMons + movs r2, 0x58 + adds r3, r0, 0 + muls r3, r2 + adds r1, 0x50 + adds r3, r1 + ldr r1, [r3] + ldr r2, =0xffffefff + ands r1, r2 + ldr r2, =0xfffff3ff + ands r1, r2 + movs r2, 0x71 + negs r2, r2 + ands r1, r2 + ldr r2, =0xfffffcff + ands r1, r2 + str r1, [r3] + ldr r1, =gStatuses3 + lsls r2, r0, 2 + adds r2, r1 + ldr r1, [r2] + ldr r3, =0xfffbff3f + ands r1, r3 + str r1, [r2] + ldr r2, =gDisableStructs + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x11] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x11] + movs r0, 0 + strb r0, [r1, 0x10] + bx lr + .pool + thumb_func_end CancelMultiTurnMoves + + thumb_func_start sub_803F90C +sub_803F90C: @ 803F90C + push {lr} + lsls r0, 24 + ldr r1, =gProtectStructs + lsrs r0, 20 + adds r1, r0, r1 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + bne _0803F952 + ldrb r2, [r1, 0x1] + lsls r0, r2, 30 + cmp r0, 0 + blt _0803F952 + lsls r0, r2, 26 + cmp r0, 0 + blt _0803F952 + lsls r0, r2, 25 + cmp r0, 0 + blt _0803F952 + lsrs r0, r2, 7 + cmp r0, 0 + bne _0803F952 + ldrb r1, [r1, 0x2] + lsls r0, r1, 31 + cmp r0, 0 + bne _0803F952 + lsls r0, r1, 30 + cmp r0, 0 + blt _0803F952 + lsls r0, r1, 29 + cmp r0, 0 + blt _0803F952 + lsls r0, r2, 31 + cmp r0, 0 + beq _0803F95C +_0803F952: + movs r0, 0x1 + b _0803F95E + .pool +_0803F95C: + movs r0, 0 +_0803F95E: + pop {r1} + bx r1 + thumb_func_end sub_803F90C + + thumb_func_start b_std_message +b_std_message: @ 803F964 + push {r4,lr} + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r4, =gActiveBank + strb r1, [r4] + movs r0, 0 + adds r1, r2, 0 + bl dp01_build_cmdbuf_x10_TODO + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end b_std_message + + thumb_func_start sub_803F988 +sub_803F988: @ 803F988 + push {r4-r6,lr} + movs r3, 0 + ldr r0, =gUnknown_020243FE + strb r3, [r0] + strb r3, [r0, 0x1] + movs r1, 0 + ldr r0, =gNoOfAllBanks + ldrb r2, [r0] + adds r6, r0, 0 + cmp r1, r2 + bge _0803F9B6 + ldr r5, =gBitTable + adds r4, r2, 0 + ldr r2, =gBattlePartyID +_0803F9A4: + ldrh r0, [r2] + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + orrs r3, r0 + adds r2, 0x4 + adds r1, 0x2 + cmp r1, r4 + blt _0803F9A4 +_0803F9B6: + movs r1, 0x1 + adds r2, r6, 0 + ldrb r0, [r2] + cmp r1, r0 + bge _0803F9D6 + ldr r5, =gUnknown_020243FE + movs r4, 0x2 +_0803F9C4: + adds r0, r1, 0 + ands r0, r4 + asrs r0, 1 + adds r0, r5 + strb r3, [r0] + adds r1, 0x2 + ldrb r0, [r2] + cmp r1, r0 + blt _0803F9C4 +_0803F9D6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F988 + + thumb_func_start sub_803F9EC +sub_803F9EC: @ 803F9EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + adds r0, r5, 0 + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803FA50 + movs r0, 0x2 + ands r0, r5 + lsls r0, 24 + lsrs r0, 25 + mov r12, r0 + ldr r1, =gUnknown_020243FE + adds r0, r1 + strb r4, [r0] + adds r5, r4, 0 + ldr r0, =gNoOfAllBanks + ldrb r2, [r0] + mov r8, r1 + cmp r4, r2 + bge _0803FA4A + ldr r0, =gAbsentBankFlags + ldrb r7, [r0] + ldr r1, =gBitTable + adds r6, r2, 0 + ldr r3, =gBattlePartyID + adds r2, r1, 0 +_0803FA2E: + ldr r0, [r2] + ands r0, r7 + cmp r0, 0 + bne _0803FA40 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r4, r0 +_0803FA40: + adds r3, 0x4 + adds r2, 0x8 + adds r5, 0x2 + cmp r5, r6 + blt _0803FA2E +_0803FA4A: + mov r0, r12 + add r0, r8 + strb r4, [r0] +_0803FA50: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F9EC + + thumb_func_start sub_803FA70 +sub_803FA70: @ 803FA70 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803FA8C + adds r0, r4, 0 + bl sub_803F9EC + b _0803FAC2 +_0803FA8C: + movs r3, 0x1 + ldr r5, =gNoOfAllBanks + ldrb r0, [r5] + cmp r3, r0 + bge _0803FAC2 + ldr r0, =gUnknown_020243FE + mov r12, r0 + movs r7, 0x2 + ldr r6, =gBitTable + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r4, r0, r1 +_0803FAA4: + adds r2, r3, 0 + ands r2, r7 + asrs r2, 1 + add r2, r12 + ldrh r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + adds r3, 0x1 + ldrb r0, [r5] + cmp r3, r0 + blt _0803FAA4 +_0803FAC2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803FA70 + + .align 2, 0 @ Don't pad with nop. + \ No newline at end of file diff --git a/asm/battle_3.s b/asm/battle_3.s index 9a7a03e6f..b314b6b5b 100644 --- a/asm/battle_3.s +++ b/asm/battle_3.s @@ -141,7 +141,7 @@ _0803FBF8: str r0, [r1] movs r6, 0x1 _0803FC06: - ldr r1, =gUnknown_02024248 + ldr r1, =gLastUsedMovesByBanks ldrb r2, [r7] lsls r0, r2, 1 adds r0, r1 @@ -336,7 +336,7 @@ _0803FDCE: beq _0803FE58 ldr r0, =gCurrentMove strh r1, [r0] - ldr r2, =gUnknown_02024208 + ldr r2, =gLastUsedItem ldrb r1, [r7] movs r0, 0x58 muls r0, r1 @@ -420,8 +420,8 @@ _0803FEB8: .pool thumb_func_end sub_803FB4C - thumb_func_start sub_803FECC -sub_803FECC: @ 803FECC + thumb_func_start CheckMoveLimitations +CheckMoveLimitations: @ 803FECC push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -479,7 +479,7 @@ _0803FF2E: adds r6, r7, 0 muls r6, r2 str r6, [sp, 0x8] - ldr r2, =gUnknown_02024090 + ldr r2, =gBattleMons + 0xC adds r5, r6, r2 movs r6, 0 str r6, [sp, 0x10] @@ -538,10 +538,10 @@ _0803FFAC: muls r2, r0 ldr r1, [sp, 0x10] adds r0, r1, r2 - ldr r1, =gUnknown_02024090 + ldr r1, =gBattleMons + 0xC adds r0, r1 mov r12, r0 - ldr r1, =gUnknown_02024248 + ldr r1, =gLastUsedMovesByBanks ldr r0, [sp, 0xC] adds r1, r0, r1 str r1, [sp, 0x18] @@ -665,7 +665,7 @@ _08040096: pop {r1} bx r1 .pool - thumb_func_end sub_803FECC + thumb_func_end CheckMoveLimitations thumb_func_start sub_80400C8 sub_80400C8: @ 80400C8 @@ -674,7 +674,7 @@ sub_80400C8: @ 80400C8 ldrb r0, [r4] movs r1, 0 movs r2, 0xFF - bl sub_803FECC + bl CheckMoveLimitations lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0xF @@ -737,7 +737,7 @@ sub_8040130: @ 8040130 ldrb r0, [r0] cmp r6, r0 bge _080401B4 - ldr r7, =gUnknown_02024090 + ldr r7, =gBattleMons + 0xC mov r8, r7 _0804015A: lsls r0, r4, 24 @@ -997,7 +997,7 @@ _0804035A: strb r0, [r6] mov r3, r8 strb r0, [r3] - ldr r0, =gUnknown_0202428E + ldr r0, =gSideAffecting adds r3, r1, r0 ldrh r1, [r3] movs r0, 0x1 @@ -1082,7 +1082,7 @@ _08040422: strb r0, [r7] ldr r3, =gActiveBank strb r0, [r3] - ldr r0, =gUnknown_0202428E + ldr r0, =gSideAffecting adds r3, r1, r0 ldrh r1, [r3] movs r0, 0x2 @@ -1177,7 +1177,7 @@ _080404EC: lsls r0, 24 cmp r0, 0 bne _0804054E - ldr r2, =gUnknown_0202428E + ldr r2, =gSideAffecting adds r2, r3, r2 ldrh r0, [r2] ldr r3, =0x0000feff @@ -1260,7 +1260,7 @@ _080405C0: ldrb r0, [r2, 0x7] strb r0, [r5] strb r0, [r6] - ldr r0, =gUnknown_0202428E + ldr r0, =gSideAffecting adds r3, r1, r0 ldrh r1, [r3] movs r0, 0x20 @@ -2988,7 +2988,7 @@ _080414CC: _080414DA: ldrb r0, [r5] bl GetBankIdentity - ldr r2, =gUnknown_0202428E + ldr r2, =gSideAffecting lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -3598,7 +3598,7 @@ b_clear_atk_up_if_hit_flag_unless_enraged: @ 8041A1C ldr r4, =gUnknown_02024274 movs r6, 0x80 lsls r6, 16 - ldr r2, =gUnknown_020240D4 + ldr r2, =gBattleMons + 0x50 _08041A32: ldr r1, [r2] adds r0, r1, 0 @@ -3635,7 +3635,7 @@ sub_8041A6C: @ 8041A6C sub sp, 0x10 movs r0, 0 mov r9, r0 - ldr r1, =gUnknown_02024478 + ldr r1, =gBattleScripting + 4 mov r10, r1 ldr r2, =gBattleStruct mov r8, r2 @@ -4237,7 +4237,7 @@ _0804207C: adds r0, r1, 0 movs r2, 0x1 movs r3, 0 - bl sub_806957C + bl CalculateBaseDamage ldr r1, =gBattleMoveDamage str r0, [r1] ldr r0, =gProtectStructs @@ -4545,7 +4545,7 @@ _08042388: ldrb r1, [r4] movs r0, 0x58 muls r0, r1 - ldr r1, =gUnknown_020240D0 + ldr r1, =gBattleMons + 0x4C adds r0, r1 str r0, [sp] movs r0, 0 @@ -6796,11 +6796,11 @@ _08043840: _08043854: ldr r0, [sp, 0x8] ldr r1, [sp, 0x10] - bl pokemon_species_get_gender_info + bl GetGenderFromSpeciesAndPersonality adds r4, r0, 0 ldr r0, [sp, 0xC] ldr r1, [sp, 0x14] - bl pokemon_species_get_gender_info + bl GetGenderFromSpeciesAndPersonality lsls r4, 24 lsls r0, 24 cmp r4, r0 @@ -6823,7 +6823,7 @@ _08043872: _0804388E: ldr r0, [sp, 0x8] ldr r1, [sp, 0x10] - bl pokemon_species_get_gender_info + bl GetGenderFromSpeciesAndPersonality lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF @@ -6832,7 +6832,7 @@ _0804388E: _080438A2: ldr r0, [sp, 0xC] ldr r1, [sp, 0x14] - bl pokemon_species_get_gender_info + bl GetGenderFromSpeciesAndPersonality lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF @@ -7166,7 +7166,7 @@ _08043BFC: ldrb r1, [r4] movs r0, 0x58 muls r0, r1 - ldr r1, =gUnknown_020240D0 + ldr r1, =gBattleMons + 0x4C adds r0, r1 str r0, [sp] movs r0, 0 @@ -8200,7 +8200,7 @@ berry_effects_maybe: @ 80444DC str r1, [sp, 0xC] add r0, sp, 0x4 strb r1, [r0] - ldr r4, =gUnknown_02024208 + ldr r4, =gLastUsedItem ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 @@ -8532,7 +8532,7 @@ _08044836: lsls r2, r5, 24 lsrs r2, 24 adds r0, r6, 0 - bl CalcPPWithPPUps + bl CalculatePPWithBonus lsls r0, 24 lsrs r2, r0, 24 add r0, sp, 0x4 @@ -8664,7 +8664,7 @@ _08044958: str r0, [sp, 0xC] adds r0, r7, 0 adds r1, r5, 0 - bl b_history__record_item_x12_of_player + bl RecordItemEffectBattle bl _080451D6 .pool _0804497C: @@ -8721,7 +8721,7 @@ _080449D2: adds r0, r2, r0 ldr r0, [r0] movs r1, 0 - bl sub_806E880 + bl GetFlavourRelationByPersonality lsls r0, 24 cmp r0, 0 bge _080449F0 @@ -8782,7 +8782,7 @@ _08044A50: adds r0, r1, r0 ldr r0, [r0] movs r1, 0x1 - bl sub_806E880 + bl GetFlavourRelationByPersonality lsls r0, 24 cmp r0, 0 bge _08044A6E @@ -8845,7 +8845,7 @@ _08044ACC: adds r0, r5, r0 ldr r0, [r0] movs r1, 0x2 - bl sub_806E880 + bl GetFlavourRelationByPersonality lsls r0, 24 cmp r0, 0 bge _08044AFC @@ -8916,7 +8916,7 @@ _08044B60: adds r0, r2, r0 ldr r0, [r0] movs r1, 0x3 - bl sub_806E880 + bl GetFlavourRelationByPersonality lsls r0, 24 cmp r0, 0 bge _08044B90 @@ -8987,7 +8987,7 @@ _08044BF2: adds r0, r1, r0 ldr r0, [r0] movs r1, 0x4 - bl sub_806E880 + bl GetFlavourRelationByPersonality lsls r0, 24 cmp r0, 0 bge _08044C24 @@ -9315,7 +9315,7 @@ _08044EB4: movs r0, 0x58 muls r0, r7 adds r4, r0, 0x1 - ldr r5, =gUnknown_0202409C + ldr r5, =gBattleMons + 0x18 _08044EBC: bl Random lsls r0, 16 @@ -9749,7 +9749,7 @@ _08045280: bcc _0804528C b _0804582A _0804528C: - ldr r4, =gUnknown_02024208 + ldr r4, =gLastUsedItem ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 @@ -10158,7 +10158,7 @@ _0804567A: movs r0, 0x58 muls r0, r1 _0804568C: - ldr r1, =gUnknown_020240D0 + ldr r1, =gBattleMons + 0x4C adds r0, r1 str r0, [sp] movs r0, 0 @@ -10301,7 +10301,7 @@ _08045794: beq _0804582A cmp r1, 0 beq _0804582A - ldr r0, =gUnknown_02024208 + ldr r0, =gLastUsedItem mov r1, sp ldrh r1, [r1, 0x14] strh r1, [r0] @@ -10864,7 +10864,7 @@ _08045D08: ldr r0, [r0] adds r2, 0x3C adds r1, r2 - bl sub_806E8D4 + bl IsOtherTrainer lsls r0, 24 cmp r0, 0 beq _08045DAC @@ -10988,7 +10988,7 @@ _08045E20: ldrb r1, [r0] adds r0, r3, 0 movs r2, 0xFF - bl sub_803FECC + bl CheckMoveLimitations lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xF @@ -11133,7 +11133,7 @@ _08045F8C: adds r0, r1, 0 movs r2, 0x1 movs r3, 0 - bl sub_806957C + bl CalculateBaseDamage ldr r1, =gBattleMoveDamage str r0, [r1] ldr r1, =gBankTarget diff --git a/asm/battle_4.s b/asm/battle_4.s index a7e61faec..609a74566 100644 --- a/asm/battle_4.s +++ b/asm/battle_4.s @@ -454,8 +454,8 @@ _0804642A: .pool thumb_func_end mcmd_jump_if_move_not_executed - thumb_func_start atk40_801DBA0 -atk40_801DBA0: @ 804643C + thumb_func_start atk40_jump_if_move_affected_by_protect +atk40_jump_if_move_affected_by_protect: @ 804643C push {lr} ldr r1, =gProtectStructs ldr r0, =gBankTarget @@ -500,7 +500,7 @@ _080464A4: pop {r0} bx r0 .pool - thumb_func_end atk40_801DBA0 + thumb_func_end atk40_jump_if_move_affected_by_protect thumb_func_start sub_80464AC sub_80464AC: @ 80464AC @@ -912,7 +912,7 @@ _080467D0: movs r0, 0x32 mov r8, r0 _08046822: - ldr r1, =gUnknown_0831C0F4 + ldr r1, =gAccuracyStageRatios lsls r0, r5, 24 asrs r0, 22 adds r0, r1 @@ -1508,7 +1508,7 @@ _08046D00: cmp r0, 0 bne _08046D70 bl Random - ldr r2, =gUnknown_0831C128 + ldr r2, =gCriticalHitChance lsls r1, r5, 1 adds r1, r2 lsls r0, 16 @@ -1537,11 +1537,11 @@ _08046D74: .pool thumb_func_end atk04_critcalc - thumb_func_start atk05_cmd5 -atk05_cmd5: @ 8046D8C + thumb_func_start atk05_damagecalc1 +atk05_damagecalc1: @ 8046D8C push {r4-r7,lr} sub sp, 0x10 - ldr r4, =gUnknown_0202428E + ldr r4, =gSideAffecting ldr r5, =gBankTarget ldrb r0, [r5] bl GetBankIdentity @@ -1561,7 +1561,7 @@ atk05_cmd5: @ 8046D8C adds r1, r2 ldr r7, =gCurrentMove ldrh r2, [r7] - ldr r4, =gUnknown_02024400 + ldr r4, =gDynamicBasePower ldrh r4, [r4] str r4, [sp] ldr r4, =gBattleStruct @@ -1572,7 +1572,7 @@ atk05_cmd5: @ 8046D8C str r4, [sp, 0x8] ldrb r4, [r5] str r4, [sp, 0xC] - bl sub_806957C + bl CalculateBaseDamage ldr r4, =gBattleMoveDamage ldr r1, =gCritMultiplier ldrb r1, [r1] @@ -1630,10 +1630,10 @@ _08046E32: pop {r0} bx r0 .pool - thumb_func_end atk05_cmd5 + thumb_func_end atk05_damagecalc1 - thumb_func_start sub_8046E7C -sub_8046E7C: @ 8046E7C + thumb_func_start AI_CalcDmg +AI_CalcDmg: @ 8046E7C push {r4-r7,lr} mov r7, r8 push {r7} @@ -1643,7 +1643,7 @@ sub_8046E7C: @ 8046E7C lsrs r7, r0, 24 lsls r5, 24 lsrs r5, 24 - ldr r4, =gUnknown_0202428E + ldr r4, =gSideAffecting adds r0, r5, 0 bl GetBankIdentity movs r1, 0x1 @@ -1661,7 +1661,7 @@ sub_8046E7C: @ 8046E7C ldr r2, =gCurrentMove mov r8, r2 ldrh r2, [r2] - ldr r6, =gUnknown_02024400 + ldr r6, =gDynamicBasePower ldrh r4, [r6] str r4, [sp] ldr r4, =gBattleStruct @@ -1670,7 +1670,7 @@ sub_8046E7C: @ 8046E7C str r4, [sp, 0x4] str r7, [sp, 0x8] str r5, [sp, 0xC] - bl sub_806957C + bl CalculateBaseDamage ldr r4, =gBattleMoveDamage movs r1, 0 strh r1, [r6] @@ -1726,7 +1726,7 @@ _08046F28: pop {r0} bx r0 .pool - thumb_func_end sub_8046E7C + thumb_func_end AI_CalcDmg thumb_func_start battle_attack_damage_modulate_by_effectivity battle_attack_damage_modulate_by_effectivity: @ 8046F60 @@ -1834,8 +1834,8 @@ _08047032: bx r0 thumb_func_end battle_attack_damage_modulate_by_effectivity - thumb_func_start sub_8047038 -sub_8047038: @ 8047038 + thumb_func_start atk06_typecalc +atk06_typecalc: @ 8047038 push {r4-r7,lr} mov r7, r8 push {r7} @@ -2108,7 +2108,7 @@ _08047260: pop {r0} bx r0 .pool - thumb_func_end sub_8047038 + thumb_func_end atk06_typecalc thumb_func_start b_wonderguard_and_levitate b_wonderguard_and_levitate: @ 80472A8 @@ -2525,8 +2525,8 @@ _080475DE: bx r0 thumb_func_end b_attack_effectivity_adapt - thumb_func_start move_effectiveness_something -move_effectiveness_something: @ 80475E4 + thumb_func_start TypeCalc +TypeCalc: @ 80475E4 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -2760,7 +2760,7 @@ _0804779E: pop {r1} bx r1 .pool - thumb_func_end move_effectiveness_something + thumb_func_end TypeCalc thumb_func_start ai_rate_move ai_rate_move: @ 80477BC @@ -2924,8 +2924,8 @@ _080478EA: .pool thumb_func_end sub_80478B8 - thumb_func_start atk07_cmd7 -atk07_cmd7: @ 80478F4 + thumb_func_start atk07_dmg_adjustment +atk07_dmg_adjustment: @ 80478F4 push {r4-r7,lr} bl Random lsls r0, 16 @@ -2999,7 +2999,7 @@ _08047976: bcs _080479B4 ldrb r0, [r5] movs r1, 0x27 - bl b_history__record_item_x12_of_player + bl RecordItemEffectBattle ldr r2, =gSpecialStatuses ldrb r1, [r5] lsls r0, r1, 2 @@ -3094,7 +3094,7 @@ _08047A5C: movs r1, 0x80 orrs r0, r1 strb r0, [r2] - ldr r1, =gUnknown_02024208 + ldr r1, =gLastUsedItem adds r0, r3, 0 muls r0, r4 adds r0, r5 @@ -3109,10 +3109,10 @@ _08047A84: pop {r0} bx r0 .pool - thumb_func_end atk07_cmd7 + thumb_func_end atk07_dmg_adjustment - thumb_func_start atk08_cmd8 -atk08_cmd8: @ 8047AA4 + thumb_func_start atk08_dmg_adjustment2 +atk08_dmg_adjustment2: @ 8047AA4 push {r4-r7,lr} bl Random lsls r0, 16 @@ -3186,7 +3186,7 @@ _08047B26: bcs _08047B64 ldrb r0, [r5] movs r1, 0x27 - bl b_history__record_item_x12_of_player + bl RecordItemEffectBattle ldr r2, =gSpecialStatuses ldrb r1, [r5] lsls r0, r1, 2 @@ -3267,7 +3267,7 @@ _08047BE8: movs r1, 0x80 orrs r0, r1 strb r0, [r2] - ldr r1, =gUnknown_02024208 + ldr r1, =gLastUsedItem adds r0, r3, 0 muls r0, r7 adds r0, r4 @@ -3282,7 +3282,7 @@ _08047C10: pop {r0} bx r0 .pool - thumb_func_end atk08_cmd8 + thumb_func_end atk08_dmg_adjustment2 thumb_func_start atk09_attackanimation atk09_attackanimation: @ 8047C30 @@ -3454,8 +3454,8 @@ _08047DB6: .pool thumb_func_end atk09_attackanimation - thumb_func_start sub_8047DC8 -sub_8047DC8: @ 8047DC8 + thumb_func_start atk0A_waitanimation +atk0A_waitanimation: @ 8047DC8 push {lr} ldr r0, =gBattleExecBuffer ldr r0, [r0] @@ -3469,10 +3469,10 @@ _08047DDA: pop {r0} bx r0 .pool - thumb_func_end sub_8047DC8 + thumb_func_end atk0A_waitanimation - thumb_func_start atk0B_graphicalhpupdate -atk0B_graphicalhpupdate: @ 8047DE8 + thumb_func_start atk0B_healthbarupdate +atk0B_healthbarupdate: @ 8047DE8 push {r4,lr} ldr r0, =gBattleExecBuffer ldr r0, [r0] @@ -3545,7 +3545,7 @@ _08047E76: ldr r0, [r0] cmp r0, 0 ble _08047EA2 - ldr r0, =gUnknown_03005D10 + ldr r0, =gBattleResults ldrb r1, [r0, 0x5] movs r2, 0x1 orrs r1, r2 @@ -3560,7 +3560,7 @@ _08047EAA: pop {r0} bx r0 .pool - thumb_func_end atk0B_graphicalhpupdate + thumb_func_end atk0B_healthbarupdate thumb_func_start atk0C_datahpupdate atk0C_datahpupdate: @ 8047EC4 @@ -3958,7 +3958,7 @@ _0804823A: ldrb r1, [r5] movs r0, 0x58 muls r0, r1 - ldr r1, =gUnknown_020240AC + ldr r1, =gBattleMons + 0x28 adds r0, r1 str r0, [sp] movs r0, 0 @@ -4037,8 +4037,8 @@ _080482F2: .pool thumb_func_end atk0D_critmessage - thumb_func_start atk0E_missmessage -atk0E_missmessage: @ 8048310 + thumb_func_start atk0E_effectiveness_sound +atk0E_effectiveness_sound: @ 8048310 push {r4,lr} ldr r0, =gBattleExecBuffer ldr r0, [r0] @@ -4136,7 +4136,7 @@ _080483D0: pop {r0} bx r0 .pool - thumb_func_end atk0E_missmessage + thumb_func_end atk0E_effectiveness_sound thumb_func_start atk0F_resultmessage atk0F_resultmessage: @ 80483E0 @@ -4221,7 +4221,7 @@ _08048474: movs r3, 0x99 b _0804856E _08048478: - ldr r4, =gUnknown_02024208 + ldr r4, =gLastUsedItem ldr r2, =gBattleMons ldr r3, =gBankTarget ldrb r1, [r3] @@ -4286,7 +4286,7 @@ _08048510: ands r0, r5 cmp r0, 0 beq _08048558 - ldr r4, =gUnknown_02024208 + ldr r4, =gLastUsedItem ldr r2, =gBattleMons ldr r3, =gBankTarget ldrb r1, [r3] @@ -4368,8 +4368,8 @@ _080485BA: .pool thumb_func_end atk10_printstring - thumb_func_start atk11_printstring2 -atk11_printstring2: @ 80485D0 + thumb_func_start atk11_printstring_playeronly +atk11_printstring_playeronly: @ 80485D0 push {r4,r5,lr} ldr r5, =gActiveBank ldr r0, =gBankAttacker @@ -4395,7 +4395,7 @@ atk11_printstring2: @ 80485D0 pop {r0} bx r0 .pool - thumb_func_end atk11_printstring2 + thumb_func_end atk11_printstring_playeronly thumb_func_start atk12_waitmessage atk12_waitmessage: @ 8048614 @@ -4480,8 +4480,8 @@ _080486AE: .pool thumb_func_end atk13_printfromtable - thumb_func_start atk14_printfromtable2 -atk14_printfromtable2: @ 80486C4 + thumb_func_start atk14_printfromtable_playeronly +atk14_printfromtable_playeronly: @ 80486C4 push {r4-r6,lr} ldr r0, =gBattleExecBuffer ldr r0, [r0] @@ -4522,7 +4522,7 @@ _0804870E: pop {r0} bx r0 .pool - thumb_func_end atk14_printfromtable2 + thumb_func_end atk14_printfromtable_playeronly thumb_func_start sub_8048728 sub_8048728: @ 8048728 @@ -4637,7 +4637,7 @@ _08048828: mov r3, r9 ldrb r0, [r3] bl GetBankIdentity - ldr r2, =gUnknown_0202428E + ldr r2, =gSideAffecting movs r1, 0x1 ands r1, r0 lsls r1, 1 @@ -4726,7 +4726,7 @@ _080488FC: bls _08048906 b _08048F40 _08048906: - ldr r1, =gUnknown_0831C134 + ldr r1, =gStatusFlagsForMoveEffects ldr r2, =gBattleCommunication ldrb r0, [r2, 0x3] lsls r0, 2 @@ -5350,7 +5350,7 @@ _08048DFC: ldr r0, [r0] adds r0, 0x1 bl b_movescr_stack_push - ldr r1, =gUnknown_0831C134 + ldr r1, =gStatusFlagsForMoveEffects ldr r0, =gBattleCommunication ldrb r0, [r0, 0x3] lsls r0, 2 @@ -5387,7 +5387,7 @@ _08048E50: str r0, [r1] _08048E64: ldr r2, =gBattlescriptCurrInstr - ldr r1, =gUnknown_0831C224 + ldr r1, =gMoveEffectBS_Ptrs ldr r5, =gBattleCommunication ldrb r0, [r5, 0x3] lsls r0, 2 @@ -5401,7 +5401,7 @@ _08048E64: ldrb r1, [r1] movs r0, 0x58 muls r0, r1 - ldr r1, =gUnknown_020240D0 + ldr r1, =gBattleMons + 0x4C adds r0, r1 str r0, [sp] movs r0, 0 @@ -5476,7 +5476,7 @@ _08048F40: mov r0, r8 adds r0, 0x50 adds r1, r0 - ldr r2, =gUnknown_0831C134 + ldr r2, =gStatusFlagsForMoveEffects ldr r0, =gBattleCommunication ldrb r3, [r0, 0x3] lsls r0, r3, 2 @@ -5597,7 +5597,7 @@ _0804908A: ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 + ldr r1, =gMoveEffectBS_Ptrs ldr r0, =gBattleCommunication ldrb r0, [r0, 0x3] lsls r0, 2 @@ -5651,7 +5651,7 @@ _0804912A: mov r0, r8 adds r0, 0x50 adds r2, r0 - ldr r1, =gUnknown_0831C134 + ldr r1, =gStatusFlagsForMoveEffects ldr r0, =gBattleCommunication ldrb r0, [r0, 0x3] lsls r0, 2 @@ -5705,7 +5705,7 @@ _08049178: ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 + ldr r1, =gMoveEffectBS_Ptrs ldr r0, =gBattleCommunication ldrb r0, [r0, 0x3] lsls r0, 2 @@ -5746,7 +5746,7 @@ _08049210: ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 + ldr r1, =gMoveEffectBS_Ptrs ldr r0, =gBattleCommunication ldrb r0, [r0, 0x3] lsls r0, 2 @@ -5867,7 +5867,7 @@ _080492E0: ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 + ldr r1, =gMoveEffectBS_Ptrs ldr r2, =gBattleCommunication ldrb r0, [r2, 0x3] lsls r0, 2 @@ -5922,7 +5922,7 @@ _080493A8: ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 + ldr r1, =gMoveEffectBS_Ptrs ldr r0, =gBattleCommunication ldrb r0, [r0, 0x3] lsls r0, 2 @@ -6223,7 +6223,7 @@ _0804967C: adds r0, 0xD0 ldr r1, [r5] adds r1, r0 - ldr r2, =gUnknown_02024208 + ldr r2, =gLastUsedItem strh r3, [r1] strh r3, [r2] ldrb r0, [r7] @@ -6402,7 +6402,7 @@ _08049836: ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 + ldr r1, =gMoveEffectBS_Ptrs ldr r0, =gBattleCommunication ldrb r0, [r0, 0x3] lsls r0, 2 @@ -6487,7 +6487,7 @@ _08049900: bl GetBankSide lsls r0, 24 lsrs r4, r0, 24 - ldr r1, =gUnknown_02024208 + ldr r1, =gLastUsedItem mov r3, r9 ldrb r0, [r3] muls r0, r5 @@ -6671,28 +6671,28 @@ _08049AA2: .pool thumb_func_end atk15_seteffectwithchancetarget - thumb_func_start sub_8049AC0 -sub_8049AC0: @ 8049AC0 + thumb_func_start atk16_seteffectprimary +atk16_seteffectprimary: @ 8049AC0 push {lr} movs r0, 0x1 movs r1, 0 bl sub_8048760 pop {r0} bx r0 - thumb_func_end sub_8049AC0 + thumb_func_end atk16_seteffectprimary - thumb_func_start sub_8049AD0 -sub_8049AD0: @ 8049AD0 + thumb_func_start atk17_seteffectsecondary +atk17_seteffectsecondary: @ 8049AD0 push {lr} movs r0, 0 movs r1, 0 bl sub_8048760 pop {r0} bx r0 - thumb_func_end sub_8049AD0 + thumb_func_end atk17_seteffectsecondary - thumb_func_start sub_8049AE0 -sub_8049AE0: @ 8049AE0 + thumb_func_start atk18_status_effect_clear +atk18_status_effect_clear: @ 8049AE0 push {lr} ldr r0, =gBattlescriptCurrInstr ldr r0, [r0] @@ -6719,7 +6719,7 @@ _08049B14: adds r1, 0x50 _08049B1E: adds r2, r1 - ldr r1, =gUnknown_0831C134 + ldr r1, =gStatusFlagsForMoveEffects ldrb r0, [r3, 0x3] lsls r0, 2 adds r0, r1 @@ -6739,10 +6739,10 @@ _08049B1E: pop {r0} bx r0 .pool - thumb_func_end sub_8049AE0 + thumb_func_end atk18_status_effect_clear - thumb_func_start atk19_faintpokemon -atk19_faintpokemon: @ 8049B5C + thumb_func_start atk19_faint_pokemon +atk19_faint_pokemon: @ 8049B5C push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -6786,7 +6786,7 @@ _08049B94: str r4, [r6] ldrb r0, [r5] bl GetBankSide - ldr r1, =gUnknown_0202428E + ldr r1, =gSideAffecting lsls r0, 24 lsrs r0, 23 adds r0, r1 @@ -6862,7 +6862,7 @@ _08049C42: lsls r1, 15 orrs r0, r1 str r0, [r5] - ldr r1, =gUnknown_03005D10 + ldr r1, =gBattleResults ldrb r0, [r1] cmp r0, 0xFE bhi _08049C78 @@ -6874,7 +6874,7 @@ _08049C78: b _08049CCE .pool _08049CA4: - ldr r4, =gUnknown_03005D10 + ldr r4, =gBattleResults ldrb r0, [r4, 0x1] cmp r0, 0xFE bhi _08049CB0 @@ -7048,10 +7048,10 @@ _08049E32: pop {r4-r7} pop {r0} bx r0 - thumb_func_end atk19_faintpokemon + thumb_func_end atk19_faint_pokemon - thumb_func_start sub_8049E40 -sub_8049E40: @ 8049E40 + thumb_func_start atk1A_faint_animation +atk1A_faint_animation: @ 8049E40 push {r4,r5,lr} ldr r0, =gBattleExecBuffer ldr r0, [r0] @@ -7075,10 +7075,10 @@ _08049E6A: pop {r0} bx r0 .pool - thumb_func_end sub_8049E40 + thumb_func_end atk1A_faint_animation - thumb_func_start sub_8049E7C -sub_8049E7C: @ 8049E7C + thumb_func_start atk1B_faint_effects_clear +atk1B_faint_effects_clear: @ 8049E7C push {r4,r5,lr} sub sp, 0x4 ldr r0, =gBattleExecBuffer @@ -7137,7 +7137,7 @@ _08049EE8: pop {r0} bx r0 .pool - thumb_func_end sub_8049E7C + thumb_func_end atk1B_faint_effects_clear thumb_func_start atk1C_jumpifstatus atk1C_jumpifstatus: @ 8049F04 @@ -7198,8 +7198,8 @@ _08049F70: .pool thumb_func_end atk1C_jumpifstatus - thumb_func_start atk1D_jumpifsecondarystatus -atk1D_jumpifsecondarystatus: @ 8049F7C + thumb_func_start atk1D_jumpifstatus2 +atk1D_jumpifstatus2: @ 8049F7C push {r4,r5,lr} ldr r5, =gBattlescriptCurrInstr ldr r0, [r5] @@ -7255,7 +7255,7 @@ _08049FE8: pop {r0} bx r0 .pool - thumb_func_end atk1D_jumpifsecondarystatus + thumb_func_end atk1D_jumpifstatus2 thumb_func_start atk1E_jumpifability atk1E_jumpifability: @ 8049FF4 @@ -7362,8 +7362,8 @@ _0804A0CE: bx r0 thumb_func_end atk1E_jumpifability - thumb_func_start sub_804A0DC -sub_804A0DC: @ 804A0DC + thumb_func_start atk1F_jumpifsideaffecting +atk1F_jumpifsideaffecting: @ 804A0DC push {r4-r6,lr} ldr r0, =gBattlescriptCurrInstr ldr r0, [r0] @@ -7398,7 +7398,7 @@ _0804A106: ldrb r0, [r3, 0x7] lsls r0, 24 adds r5, r1, r0 - ldr r1, =gUnknown_0202428E + ldr r1, =gSideAffecting lsls r0, r4, 1 adds r0, r1 ldrh r0, [r0] @@ -7416,10 +7416,10 @@ _0804A14E: pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_804A0DC + thumb_func_end atk1F_jumpifsideaffecting - thumb_func_start sub_804A154 -sub_804A154: @ 804A154 + thumb_func_start atk20_jumpifstat +atk20_jumpifstat: @ 804A154 push {r4,r5,lr} movs r5, 0 ldr r4, =gBattlescriptCurrInstr @@ -7534,10 +7534,10 @@ _0804A240: pop {r0} bx r0 .pool - thumb_func_end sub_804A154 + thumb_func_end atk20_jumpifstat - thumb_func_start atk21_jumpifspecialstatusflag -atk21_jumpifspecialstatusflag: @ 804A24C + thumb_func_start atk21_jumpifstatus3 +atk21_jumpifstatus3: @ 804A24C push {r4-r6,lr} ldr r4, =gBattlescriptCurrInstr ldr r0, [r4] @@ -7600,10 +7600,10 @@ _0804A2CA: pop {r4-r6} pop {r0} bx r0 - thumb_func_end atk21_jumpifspecialstatusflag + thumb_func_end atk21_jumpifstatus3 - thumb_func_start sub_804A2D0 -sub_804A2D0: @ 804A2D0 + thumb_func_start atk22_jumpiftype +atk22_jumpiftype: @ 804A2D0 push {r4-r6,lr} ldr r4, =gBattlescriptCurrInstr ldr r0, [r4] @@ -7648,10 +7648,10 @@ _0804A324: pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_804A2D0 + thumb_func_end atk22_jumpiftype - thumb_func_start sub_804A32C -sub_804A32C: @ 804A32C + thumb_func_start atk23_getexp +atk23_getexp: @ 804A32C push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -8031,7 +8031,7 @@ _0804A6AA: muls r0, r1 ldr r1, =gPlayerParty adds r0, r1 - bl sub_806E8A8 + bl IsTradedMon lsls r0, 24 cmp r0, 0 beq _0804A714 @@ -8148,7 +8148,7 @@ _0804A78E: movs r0, 0x1 negs r0, r0 strb r0, [r1, 0x4] - ldr r1, =gUnknown_02022F78 + ldr r1, =gBattleTextBuff3 strb r3, [r1] movs r0, 0x1 strb r0, [r1, 0x1] @@ -8189,7 +8189,7 @@ _0804A78E: muls r1, r2 adds r1, r3 ldrh r1, [r1] - bl sub_806DADC + bl MonGainEVs _0804A824: ldr r0, =gBattleStruct ldr r1, [r0] @@ -8428,7 +8428,7 @@ _0804A9B2: adds r0, r1, 0 adds r0, r7 movs r1, 0 - bl happiness_algorithm + bl AdjustFriendship ldr r1, =gBattlePartyID mov r2, r9 ldr r0, [r2] @@ -8696,10 +8696,10 @@ _0804ACB2: pop {r0} bx r0 .pool - thumb_func_end sub_804A32C + thumb_func_end atk23_getexp - thumb_func_start sub_804ACD0 -sub_804ACD0: @ 804ACD0 + thumb_func_start atk24 +atk24: @ 804ACD0 push {r4-r7,lr} mov r7, r8 push {r7} @@ -8985,7 +8985,7 @@ _0804AF22: pop {r0} bx r0 .pool - thumb_func_end sub_804ACD0 + thumb_func_end atk24 thumb_func_start sub_804AF30 sub_804AF30: @ 804AF30 @@ -9012,8 +9012,8 @@ sub_804AF30: @ 804AF30 .pool thumb_func_end sub_804AF30 - thumb_func_start atk25_cmd25 -atk25_cmd25: @ 804AF70 + thumb_func_start atk25_move_values_cleanup +atk25_move_values_cleanup: @ 804AF70 push {lr} bl sub_804AF30 ldr r1, =gBattlescriptCurrInstr @@ -9023,10 +9023,10 @@ atk25_cmd25: @ 804AF70 pop {r0} bx r0 .pool - thumb_func_end atk25_cmd25 + thumb_func_end atk25_move_values_cleanup - thumb_func_start atk26_80225F0_storebyteforjump -atk26_80225F0_storebyteforjump: @ 804AF88 + thumb_func_start atk26_set_multihit +atk26_set_multihit: @ 804AF88 ldr r3, =gUnknown_02024212 ldr r2, =gBattlescriptCurrInstr ldr r0, [r2] @@ -9036,10 +9036,10 @@ atk26_80225F0_storebyteforjump: @ 804AF88 str r0, [r2] bx lr .pool - thumb_func_end atk26_80225F0_storebyteforjump + thumb_func_end atk26_set_multihit - thumb_func_start atk27_cmd27 -atk27_cmd27: @ 804AFA0 + thumb_func_start atk27_decrement_multihit +atk27_decrement_multihit: @ 804AFA0 push {lr} ldr r1, =gUnknown_02024212 ldrb r0, [r1] @@ -9072,7 +9072,7 @@ _0804AFDE: pop {r0} bx r0 .pool - thumb_func_end atk27_cmd27 + thumb_func_end atk27_decrement_multihit thumb_func_start atk28_goto atk28_goto: @ 804AFE8 @@ -9177,8 +9177,8 @@ _0804B0A0: bx r0 thumb_func_end atk29_jumpifbyte - thumb_func_start sub_804B0A8 -sub_804B0A8: @ 804B0A8 + thumb_func_start atk2A_jumpifhalfword +atk2A_jumpifhalfword: @ 804B0A8 push {r4-r6,lr} ldr r3, =gBattlescriptCurrInstr ldr r1, [r3] @@ -9262,10 +9262,10 @@ _0804B148: pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_804B0A8 + thumb_func_end atk2A_jumpifhalfword - thumb_func_start sub_804B150 -sub_804B150: @ 804B150 + thumb_func_start atk2B_jumpifword +atk2B_jumpifword: @ 804B150 push {r4-r6,lr} ldr r3, =gBattlescriptCurrInstr ldr r1, [r3] @@ -9355,10 +9355,10 @@ _0804B1FC: pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_804B150 + thumb_func_end atk2B_jumpifword - thumb_func_start sub_804B204 -sub_804B204: @ 804B204 + thumb_func_start atk2C_jumpifarrayequal +atk2C_jumpifarrayequal: @ 804B204 push {r4-r7,lr} ldr r2, =gBattlescriptCurrInstr ldr r3, [r2] @@ -9429,10 +9429,10 @@ _0804B284: pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_804B204 + thumb_func_end atk2C_jumpifarrayequal - thumb_func_start sub_804B28C -sub_804B28C: @ 804B28C + thumb_func_start atk2D_jumpifarraynotequal +atk2D_jumpifarraynotequal: @ 804B28C push {r4-r7,lr} movs r7, 0 ldr r3, =gBattlescriptCurrInstr @@ -9502,10 +9502,10 @@ _0804B308: pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_804B28C + thumb_func_end atk2D_jumpifarraynotequal - thumb_func_start sub_804B310 -sub_804B310: @ 804B310 + thumb_func_start atk2E_setbyte +atk2E_setbyte: @ 804B310 ldr r3, =gBattlescriptCurrInstr ldr r2, [r3] ldrb r1, [r2, 0x1] @@ -9525,10 +9525,10 @@ sub_804B310: @ 804B310 str r0, [r3] bx lr .pool - thumb_func_end sub_804B310 + thumb_func_end atk2E_setbyte - thumb_func_start sub_804B338 -sub_804B338: @ 804B338 + thumb_func_start atk2F_addbyte +atk2F_addbyte: @ 804B338 ldr r3, =gBattlescriptCurrInstr ldr r2, [r3] ldrb r1, [r2, 0x1] @@ -9550,10 +9550,10 @@ sub_804B338: @ 804B338 str r0, [r3] bx lr .pool - thumb_func_end sub_804B338 + thumb_func_end atk2F_addbyte - thumb_func_start sub_804B364 -sub_804B364: @ 804B364 + thumb_func_start atk30_subbyte +atk30_subbyte: @ 804B364 ldr r3, =gBattlescriptCurrInstr ldr r2, [r3] ldrb r1, [r2, 0x1] @@ -9575,7 +9575,7 @@ sub_804B364: @ 804B364 str r0, [r3] bx lr .pool - thumb_func_end sub_804B364 + thumb_func_end atk30_subbyte thumb_func_start atk31_copyarray atk31_copyarray: @ 804B390 @@ -9624,8 +9624,8 @@ _0804B3D4: .pool thumb_func_end atk31_copyarray - thumb_func_start atk32_memcpy_with_offset -atk32_memcpy_with_offset: @ 804B3E4 + thumb_func_start atk32_copyarray_withindex +atk32_copyarray_withindex: @ 804B3E4 push {r4-r7,lr} ldr r3, =gBattlescriptCurrInstr ldr r1, [r3] @@ -9681,7 +9681,7 @@ _0804B440: pop {r0} bx r0 .pool - thumb_func_end atk32_memcpy_with_offset + thumb_func_end atk32_copyarray_withindex thumb_func_start atk33_orbyte atk33_orbyte: @ 804B450 @@ -9900,8 +9900,8 @@ _0804B5CC: .pool thumb_func_end atk39_pause - thumb_func_start sub_804B5E0 -sub_804B5E0: @ 804B5E0 + thumb_func_start atk3A_waitstate +atk3A_waitstate: @ 804B5E0 push {lr} ldr r0, =gBattleExecBuffer ldr r0, [r0] @@ -9915,10 +9915,10 @@ _0804B5F2: pop {r0} bx r0 .pool - thumb_func_end sub_804B5E0 + thumb_func_end atk3A_waitstate - thumb_func_start atk3B_8022C68 -atk3B_8022C68: @ 804B600 + thumb_func_start atk3B_healthbar_update +atk3B_healthbar_update: @ 804B600 push {lr} ldr r0, =gBattlescriptCurrInstr ldr r0, [r0] @@ -9949,7 +9949,7 @@ _0804B624: pop {r0} bx r0 .pool - thumb_func_end atk3B_8022C68 + thumb_func_end atk3B_healthbar_update thumb_func_start atk3C_return atk3C_return: @ 804B658 @@ -9959,8 +9959,8 @@ atk3C_return: @ 804B658 bx r0 thumb_func_end atk3C_return - thumb_func_start sub_804B664 -sub_804B664: @ 804B664 + thumb_func_start atk3D_end +atk3D_end: @ 804B664 push {lr} ldr r0, =gBattleTypeFlags ldr r0, [r0] @@ -9984,7 +9984,7 @@ _0804B67C: pop {r0} bx r0 .pool - thumb_func_end sub_804B664 + thumb_func_end atk3D_end thumb_func_start atk3E_end2 atk3E_end2: @ 804B6A4 @@ -10100,8 +10100,8 @@ _0804B77C: bx r0 thumb_func_end atk42_jumpiftype2 - thumb_func_start sub_804B784 -sub_804B784: @ 804B784 + thumb_func_start atk43_jumpifabilitypresent +atk43_jumpifabilitypresent: @ 804B784 push {r4,lr} sub sp, 0x4 ldr r4, =gBattlescriptCurrInstr @@ -10139,10 +10139,10 @@ _0804B7C6: pop {r4} pop {r0} bx r0 - thumb_func_end sub_804B784 + thumb_func_end atk43_jumpifabilitypresent - thumb_func_start sub_804B7D0 -sub_804B7D0: @ 804B7D0 + thumb_func_start atk44 +atk44: @ 804B7D0 ldr r0, =gBankAttacker ldrb r0, [r0] ldr r1, =gBattleStruct @@ -10153,10 +10153,10 @@ sub_804B7D0: @ 804B7D0 strb r1, [r0] bx lr .pool - thumb_func_end sub_804B7D0 + thumb_func_end atk44 - thumb_func_start atk46_cmd46 -atk46_cmd46: @ 804B7EC + thumb_func_start atk45_playanimation +atk45_playanimation: @ 804B7EC push {r4-r6,lr} ldr r5, =gBattlescriptCurrInstr ldr r0, [r5] @@ -10244,10 +10244,10 @@ _0804B8AA: pop {r4-r6} pop {r0} bx r0 - thumb_func_end atk46_cmd46 + thumb_func_end atk45_playanimation - thumb_func_start sub_804B8B0 -sub_804B8B0: @ 804B8B0 + thumb_func_start atk46_playanimation2 +atk46_playanimation2: @ 804B8B0 push {r4-r7,lr} ldr r6, =gBattlescriptCurrInstr ldr r0, [r6] @@ -10342,10 +10342,10 @@ _0804B976: pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_804B8B0 + thumb_func_end atk46_playanimation2 - thumb_func_start sub_804B97C -sub_804B97C: @ 804B97C + thumb_func_start atk47_setgraphicalstatchangevalues +atk47_setgraphicalstatchangevalues: @ 804B97C push {r4,lr} movs r3, 0 ldr r1, =gBattleScripting @@ -10395,7 +10395,7 @@ _0804B9B4: pop {r0} bx r0 .pool - thumb_func_end sub_804B97C + thumb_func_end atk47_setgraphicalstatchangevalues thumb_func_start atk48_playstatchangeanimation atk48_playstatchangeanimation: @ 804B9D8 @@ -10435,7 +10435,7 @@ _0804BA18: beq _0804BAC0 movs r0, 0x1 mov r10, r0 - ldr r0, =gUnknown_0202409C + ldr r0, =gBattleMons + 0x18 mov r9, r0 lsls r5, r1, 16 _0804BA26: @@ -10541,7 +10541,7 @@ _0804BAF8: mov r9, r5 cmp r4, 0 beq _0804BB34 - ldr r6, =gUnknown_0202409C + ldr r6, =gBattleMons + 0x18 adds r5, r2, 0 lsls r2, r1, 16 _0804BB04: @@ -10647,8 +10647,8 @@ _0804BBBA: bx r0 thumb_func_end atk48_playstatchangeanimation - thumb_func_start sub_804BBCC -sub_804BBCC: @ 804BBCC + thumb_func_start atk49_moveendturn +atk49_moveendturn: @ 804BBCC push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -11324,7 +11324,7 @@ _0804C1D8: ldr r2, =gDisableStructs ldr r5, =0xfeffffff adds r3, r0, 0 - ldr r1, =gUnknown_020240D4 + ldr r1, =gBattleMons + 0x50 _0804C1EA: ldrb r0, [r2, 0xA] cmp r0, 0 @@ -11426,7 +11426,7 @@ _0804C2A4: ands r0, r1 cmp r0, 0 beq _0804C308 - ldr r0, =gUnknown_02024248 + ldr r0, =gLastUsedMovesByBanks lsls r1, r4, 1 adds r1, r0 ldr r0, =gUnknown_020241EC @@ -11443,7 +11443,7 @@ _0804C2A4: b _0804C322 .pool _0804C308: - ldr r1, =gUnknown_02024248 + ldr r1, =gLastUsedMovesByBanks lsls r0, r4, 1 adds r0, r1 ldr r1, =0x0000ffff @@ -11768,10 +11768,10 @@ _0804C5BA: pop {r0} bx r0 .pool - thumb_func_end sub_804BBCC + thumb_func_end atk49_moveendturn - thumb_func_start atk4A_damagecalc2 -atk4A_damagecalc2: @ 804C5F4 + thumb_func_start atk4A_typecalc2 +atk4A_typecalc2: @ 804C5F4 push {r4-r7,lr} mov r7, r8 push {r7} @@ -12037,10 +12037,10 @@ _0804C804: pop {r0} bx r0 .pool - thumb_func_end atk4A_damagecalc2 + thumb_func_end atk4A_typecalc2 - thumb_func_start atk4B_cmd4b -atk4B_cmd4b: @ 804C844 + thumb_func_start atk4B_return_atk_to_ball +atk4B_return_atk_to_ball: @ 804C844 push {r4,lr} ldr r4, =gActiveBank ldr r0, =gBankAttacker @@ -12071,10 +12071,10 @@ _0804C872: pop {r0} bx r0 .pool - thumb_func_end atk4B_cmd4b + thumb_func_end atk4B_return_atk_to_ball - thumb_func_start atk4C_switch1 -atk4C_switch1: @ 804C894 + thumb_func_start atk4C_copy_poke_data +atk4C_copy_poke_data: @ 804C894 push {r4,r5,lr} ldr r0, =gBattleExecBuffer ldr r0, [r0] @@ -12117,10 +12117,10 @@ _0804C8E4: pop {r0} bx r0 .pool - thumb_func_end atk4C_switch1 + thumb_func_end atk4C_copy_poke_data - thumb_func_start sub_804C904 -sub_804C904: @ 804C904 + thumb_func_start atk4D_switch_data_update +atk4D_switch_data_update: @ 804C904 push {r4-r7,lr} sub sp, 0x58 ldr r0, =gBattleExecBuffer @@ -12196,7 +12196,7 @@ _0804C93E: ldrh r0, [r1] ldrb r1, [r1, 0x17] lsrs r1, 7 - bl sub_806B694 + bl GetAbilityBySpecies ldrb r1, [r6] muls r1, r7 adds r1, r4 @@ -12336,10 +12336,10 @@ _0804CAA4: pop {r0} bx r0 .pool - thumb_func_end sub_804C904 + thumb_func_end atk4D_switch_data_update - thumb_func_start atk4E_switch3 -atk4E_switch3: @ 804CAE8 + thumb_func_start atk4E_switchin_anim +atk4E_switchin_anim: @ 804CAE8 push {r4-r6,lr} ldr r0, =gBattleExecBuffer ldr r0, [r0] @@ -12418,10 +12418,10 @@ _0804CB86: pop {r0} bx r0 .pool - thumb_func_end atk4E_switch3 + thumb_func_end atk4E_switchin_anim - thumb_func_start atk4F_jumpifcannotswitch -atk4F_jumpifcannotswitch: @ 804CBB0 + thumb_func_start atk4F_jump_if_cannot_switch +atk4F_jump_if_cannot_switch: @ 804CBB0 push {r4-r7,lr} mov r7, r8 push {r7} @@ -12816,7 +12816,7 @@ _0804CF00: pop {r0} bx r0 .pool - thumb_func_end atk4F_jumpifcannotswitch + thumb_func_end atk4F_jump_if_cannot_switch thumb_func_start sub_804CF10 sub_804CF10: @ 804CF10 @@ -13740,7 +13740,7 @@ _0804D6E0: lsls r0, 24 cmp r0, 0 bne _0804D760 - ldr r1, =gUnknown_03005D10 + ldr r1, =gBattleResults ldrb r0, [r1, 0x2] cmp r0, 0xFE bhi _0804D760 @@ -13824,8 +13824,8 @@ _0804D804: .pool thumb_func_end atk50_openpartyscreen - thumb_func_start atk51_cmd51 -atk51_cmd51: @ 804D820 + thumb_func_start atk51_switch_handle_order +atk51_switch_handle_order: @ 804D820 push {r4-r7,lr} ldr r0, =gBattleExecBuffer ldr r0, [r0] @@ -14122,10 +14122,10 @@ _0804DA8A: pop {r0} bx r0 .pool - thumb_func_end atk51_cmd51 + thumb_func_end atk51_switch_handle_order - thumb_func_start atk52_cmd52 -atk52_cmd52: @ 804DAAC + thumb_func_start atk52_switch_in_effects +atk52_switch_in_effects: @ 804DAAC push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -14166,7 +14166,7 @@ atk52_cmd52: @ 804DAAC strb r0, [r1] ldrb r0, [r4] bl GetBankSide - ldr r5, =gUnknown_0202428E + ldr r5, =gSideAffecting lsls r0, 24 lsrs r0, 23 adds r0, r5 @@ -14346,7 +14346,7 @@ _0804DC88: bne _0804DD8E ldrb r0, [r5] bl GetBankSide - ldr r1, =gUnknown_0202428E + ldr r1, =gSideAffecting lsls r0, 24 lsrs r0, 23 adds r0, r1 @@ -14457,10 +14457,10 @@ _0804DD8E: pop {r0} bx r0 .pool - thumb_func_end atk52_cmd52 + thumb_func_end atk52_switch_in_effects - thumb_func_start sub_804DDA8 -sub_804DDA8: @ 804DDA8 + thumb_func_start atk53_trainer_slide +atk53_trainer_slide: @ 804DDA8 push {r4,r5,lr} ldr r5, =gBattlescriptCurrInstr ldr r0, [r5] @@ -14479,10 +14479,10 @@ sub_804DDA8: @ 804DDA8 pop {r0} bx r0 .pool - thumb_func_end sub_804DDA8 + thumb_func_end atk53_trainer_slide - thumb_func_start atk54_802511C -atk54_802511C: @ 804DDD8 + thumb_func_start atk54_effectiveness_sound +atk54_effectiveness_sound: @ 804DDD8 push {r4,r5,lr} ldr r5, =gActiveBank ldr r0, =gBankAttacker @@ -14505,10 +14505,10 @@ atk54_802511C: @ 804DDD8 pop {r0} bx r0 .pool - thumb_func_end atk54_802511C + thumb_func_end atk54_effectiveness_sound - thumb_func_start sub_804DE14 -sub_804DE14: @ 804DE14 + thumb_func_start atk55_play_sound +atk55_play_sound: @ 804DE14 push {r4,r5,lr} ldr r5, =gActiveBank ldr r0, =gBankAttacker @@ -14532,10 +14532,10 @@ sub_804DE14: @ 804DE14 pop {r0} bx r0 .pool - thumb_func_end sub_804DE14 + thumb_func_end atk55_play_sound - thumb_func_start atk56_8025194 -atk56_8025194: @ 804DE50 + thumb_func_start atk56_fainting_cry +atk56_fainting_cry: @ 804DE50 push {r4,r5,lr} ldr r5, =gBattlescriptCurrInstr ldr r0, [r5] @@ -14554,10 +14554,10 @@ atk56_8025194: @ 804DE50 pop {r0} bx r0 .pool - thumb_func_end atk56_8025194 + thumb_func_end atk56_fainting_cry - thumb_func_start atk57_80251C4_flee -atk57_80251C4_flee: @ 804DE80 + thumb_func_start atk57 +atk57: @ 804DE80 push {r4,lr} movs r0, 0 bl GetBankByPlayerAI @@ -14577,10 +14577,10 @@ atk57_80251C4_flee: @ 804DE80 pop {r0} bx r0 .pool - thumb_func_end atk57_80251C4_flee + thumb_func_end atk57 - thumb_func_start atk58_cmd58 -atk58_cmd58: @ 804DEB8 + thumb_func_start atk58_return_to_ball +atk58_return_to_ball: @ 804DEB8 push {r4,r5,lr} ldr r5, =gBattlescriptCurrInstr ldr r0, [r5] @@ -14600,10 +14600,10 @@ atk58_cmd58: @ 804DEB8 pop {r0} bx r0 .pool - thumb_func_end atk58_cmd58 + thumb_func_end atk58_return_to_ball - thumb_func_start atk59_8025230 -atk59_8025230: @ 804DEEC + thumb_func_start atk59_learnmove_inbattle +atk59_learnmove_inbattle: @ 804DEEC push {r4-r7,lr} ldr r0, =gBattlescriptCurrInstr ldr r2, [r0] @@ -14635,7 +14635,7 @@ atk59_8025230: @ 804DEEC ldr r1, =gPlayerParty adds r0, r1 ldrb r1, [r2, 0x9] - bl sub_8069318 + bl MonTryLearningNewMove lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x0000fffe @@ -14651,7 +14651,7 @@ _0804DF3A: ldr r1, =gPlayerParty adds r0, r1 movs r1, 0 - bl sub_8069318 + bl MonTryLearningNewMove lsls r0, 16 lsrs r5, r0, 16 cmp r5, r7 @@ -14703,7 +14703,7 @@ _0804DF88: bne _0804DFC8 adds r0, r2, r4 adds r1, r5, 0 - bl sub_80691B0 + bl GiveMoveToBattleMon _0804DFC8: ldr r0, =gBattleTypeFlags ldr r0, [r0] @@ -14740,7 +14740,7 @@ _0804DFC8: bne _0804E014 adds r0, r2, r4 adds r1, r5, 0 - bl sub_80691B0 + bl GiveMoveToBattleMon _0804E014: ldr r0, =gBattlescriptCurrInstr str r6, [r0] @@ -14749,10 +14749,10 @@ _0804E018: pop {r0} bx r0 .pool - thumb_func_end atk59_8025230 + thumb_func_end atk59_learnmove_inbattle - thumb_func_start sub_804E038 -sub_804E038: @ 804E038 + thumb_func_start atk5A +atk5A: @ 804E038 push {r4-r7,lr} mov r7, r8 push {r7} @@ -14898,7 +14898,7 @@ _0804E170: lsls r2, 24 lsrs r2, 24 ldr r3, =sub_80A92F8 - ldr r4, =gUnknown_020244E2 + ldr r4, =gMoveToLearn ldrh r4, [r4] str r4, [sp] bl sub_81BFA38 @@ -14973,7 +14973,7 @@ _0804E224: lsls r0, 16 lsrs r4, r0, 16 adds r0, r4, 0 - bl sub_806E804 + bl IsHMMove2 cmp r0, 0 beq _0804E274 ldr r0, =0x0000013f @@ -15016,17 +15016,17 @@ _0804E274: adds r0, r1, 0 adds r0, r7 adds r1, r5, 0 - bl sub_806B9A8 + bl RemoveMonPPBonus ldr r0, [r6] ldrb r0, [r0, 0x10] mov r1, r8 muls r1, r0 adds r0, r1, 0 adds r0, r7 - ldr r7, =gUnknown_020244E2 + ldr r7, =gMoveToLearn ldrh r1, [r7] adds r2, r5, 0 - bl sub_80691F4 + bl SetMonMoveSlot ldr r0, =gBattlePartyID ldr r1, [r6] ldrh r0, [r0] @@ -15052,11 +15052,11 @@ _0804E274: bne _0804E30A adds r0, r4, 0 adds r1, r5, 0 - bl sub_806B9E4 + bl RemoveBattleMonPPBonus ldrh r1, [r7] adds r0, r4, 0 adds r2, r5, 0 - bl sub_8069234 + bl SetBattleMonMoveSlot _0804E30A: ldr r0, =gBattleTypeFlags ldr r0, [r0] @@ -15095,12 +15095,12 @@ _0804E30A: adds r4, 0xB0 adds r0, r4, 0 adds r1, r5, 0 - bl sub_806B9E4 - ldr r0, =gUnknown_020244E2 + bl RemoveBattleMonPPBonus + ldr r0, =gMoveToLearn ldrh r1, [r0] adds r0, r4, 0 adds r2, r5, 0 - bl sub_8069234 + bl SetBattleMonMoveSlot b _0804E3B8 .pool _0804E38C: @@ -15133,7 +15133,7 @@ _0804E3B8: pop {r0} bx r0 .pool - thumb_func_end sub_804E038 + thumb_func_end atk5A thumb_func_start atk5B_80256E0 atk5B_80256E0: @ 804E3C8 @@ -15280,8 +15280,8 @@ _0804E4FA: .pool thumb_func_end atk5B_80256E0 - thumb_func_start atk5C_cmd5c -atk5C_cmd5c: @ 804E508 + thumb_func_start atk5C_hitanimation +atk5C_hitanimation: @ 804E508 push {r4,lr} ldr r4, =gBattlescriptCurrInstr ldr r0, [r4] @@ -15342,7 +15342,7 @@ _0804E592: pop {r4} pop {r0} bx r0 - thumb_func_end atk5C_cmd5c + thumb_func_end atk5C_hitanimation thumb_func_start sub_804E598 sub_804E598: @ 804E598 @@ -15510,10 +15510,10 @@ _0804E6CA: bx r1 thumb_func_end sub_804E598 - thumb_func_start sub_804E6D8 -sub_804E6D8: @ 804E6D8 + thumb_func_start atk5D_getmoneyreward +atk5D_getmoneyreward: @ 804E6D8 push {r4,lr} - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r0, [r0] bl sub_804E598 adds r4, r0, 0 @@ -15524,7 +15524,7 @@ sub_804E6D8: @ 804E6D8 ands r0, r1 cmp r0, 0 beq _0804E6FC - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r0, [r0] bl sub_804E598 adds r4, r0 @@ -15535,7 +15535,7 @@ _0804E6FC: lsls r1, 3 adds r0, r1 adds r1, r4, 0 - bl add_money + bl AddMoney ldr r1, =gBattleTextBuff1 movs r0, 0xFD strb r0, [r1] @@ -15568,7 +15568,7 @@ _0804E6FC: pop {r0} bx r0 .pool - thumb_func_end sub_804E6D8 + thumb_func_end atk5D_getmoneyreward thumb_func_start atk5E_8025A70 atk5E_8025A70: @ 804E764 @@ -15608,13 +15608,13 @@ _0804E7AC: bne _0804E800 ldrb r0, [r6] lsls r0, 9 - ldr r1, =gUnknown_02023868 + ldr r1, =gBattleBufferB + 4 adds r0, r1 mov r12, r0 movs r2, 0 adds r4, r6, 0 movs r5, 0x58 - ldr r6, =gUnknown_020240A8 + ldr r6, =gBattleMons + 0x24 adds r7, r6, 0 subs r7, 0x18 mov r3, r12 @@ -15690,8 +15690,8 @@ _0804E856: .pool thumb_func_end atk5F_8025B24 - thumb_func_start atk60_cmd60 -atk60_cmd60: @ 804E868 + thumb_func_start atk60_increment_gamestat +atk60_increment_gamestat: @ 804E868 push {lr} ldr r0, =gBankAttacker ldrb r0, [r0] @@ -15711,7 +15711,7 @@ _0804E882: pop {r0} bx r0 .pool - thumb_func_end atk60_cmd60 + thumb_func_end atk60_increment_gamestat thumb_func_start atk61_8025BA4 atk61_8025BA4: @ 804E898 @@ -15823,8 +15823,8 @@ atk62_08025C6C: @ 804E960 .pool thumb_func_end atk62_08025C6C - thumb_func_start atk63_jumptoattack -atk63_jumptoattack: @ 804E990 + thumb_func_start atk63_jumptorandomattack +atk63_jumptorandomattack: @ 804E990 push {r4,lr} ldr r0, =gBattlescriptCurrInstr ldr r1, [r0] @@ -15863,7 +15863,7 @@ _0804E9C2: pop {r0} bx r0 .pool - thumb_func_end atk63_jumptoattack + thumb_func_end atk63_jumptorandomattack thumb_func_start atk64_statusanimation atk64_statusanimation: @ 804E9F4 @@ -15924,8 +15924,8 @@ _0804EA5C: .pool thumb_func_end atk64_statusanimation - thumb_func_start atk65_8025D90 -atk65_8025D90: @ 804EA84 + thumb_func_start atk65_status2animation +atk65_status2animation: @ 804EA84 push {r4,r5,lr} ldr r0, =gBattleExecBuffer ldr r0, [r0] @@ -15993,10 +15993,10 @@ _0804EB04: pop {r0} bx r0 .pool - thumb_func_end atk65_8025D90 + thumb_func_end atk65_status2animation - thumb_func_start atk66_8025E38 -atk66_8025E38: @ 804EB2C + thumb_func_start atk66_chosenstatusanimation +atk66_chosenstatusanimation: @ 804EB2C push {r4,r5,lr} ldr r0, =gBattleExecBuffer ldr r0, [r0] @@ -16057,7 +16057,7 @@ _0804EB9E: pop {r0} bx r0 .pool - thumb_func_end atk66_8025E38 + thumb_func_end atk66_chosenstatusanimation thumb_func_start atk67_8025ECC atk67_8025ECC: @ 804EBC0 @@ -16163,8 +16163,8 @@ _0804EC96: .pool thumb_func_end atk67_8025ECC - thumb_func_start sub_804ECA4 -sub_804ECA4: @ 804ECA4 + thumb_func_start atk68_80246A0 +atk68_80246A0: @ 804ECA4 push {r4,r5,lr} movs r1, 0 ldr r2, =gNoOfAllBanks @@ -16189,10 +16189,10 @@ _0804ECC2: pop {r0} bx r0 .pool - thumb_func_end sub_804ECA4 + thumb_func_end atk68_80246A0 - thumb_func_start atk69_8025FE0 -atk69_8025FE0: @ 804ECDC + thumb_func_start atk69_dmg_adjustment2 +atk69_dmg_adjustment2: @ 804ECDC push {r4-r7,lr} ldr r7, =gBattleMons ldr r6, =gBankTarget @@ -16243,7 +16243,7 @@ _0804ED2A: bcs _0804ED68 ldrb r0, [r5] movs r1, 0x27 - bl b_history__record_item_x12_of_player + bl RecordItemEffectBattle ldr r2, =gSpecialStatuses ldrb r1, [r5] lsls r0, r1, 2 @@ -16338,7 +16338,7 @@ _0804EE10: movs r1, 0x80 orrs r0, r1 strb r0, [r2] - ldr r1, =gUnknown_02024208 + ldr r1, =gLastUsedItem adds r0, r3, 0 muls r0, r4 adds r0, r5 @@ -16353,10 +16353,10 @@ _0804EE38: pop {r0} bx r0 .pool - thumb_func_end atk69_8025FE0 + thumb_func_end atk69_dmg_adjustment2 - thumb_func_start atk6A_stash_item_for_side -atk6A_stash_item_for_side: @ 804EE58 + thumb_func_start atk6A_removeitem +atk6A_removeitem: @ 804EE58 push {r4-r6,lr} sub sp, 0x4 ldr r6, =gBattlescriptCurrInstr @@ -16403,10 +16403,10 @@ atk6A_stash_item_for_side: @ 804EE58 pop {r0} bx r0 .pool - thumb_func_end atk6A_stash_item_for_side + thumb_func_end atk6A_removeitem - thumb_func_start atk6B_end_battle_80261CC -atk6B_end_battle_80261CC: @ 804EEC8 + thumb_func_start atk6B_atknameinbuff1 +atk6B_atknameinbuff1: @ 804EEC8 ldr r1, =gBattleTextBuff1 movs r0, 0xFD strb r0, [r1] @@ -16429,10 +16429,10 @@ atk6B_end_battle_80261CC: @ 804EEC8 str r0, [r1] bx lr .pool - thumb_func_end atk6B_end_battle_80261CC + thumb_func_end atk6B_atknameinbuff1 - thumb_func_start atk6C_8026208 -atk6C_8026208: @ 804EF04 + thumb_func_start atk6C_lvlbox_display +atk6C_lvlbox_display: @ 804EF04 push {r4,lr} sub sp, 0x4 ldr r0, =gBattleScripting @@ -16641,7 +16641,7 @@ _0804F0F2: pop {r0} bx r0 .pool - thumb_func_end atk6C_8026208 + thumb_func_end atk6C_lvlbox_display thumb_func_start sub_804F100 sub_804F100: @ 804F100 @@ -16800,7 +16800,7 @@ sub_804F220: @ 804F220 ldrb r0, [r0, 0x10] muls r0, r5 adds r0, r4 - bl pokemon_get_gender + bl GetMonGender lsls r0, 24 lsrs r7, r0, 24 ldr r0, [r6] @@ -17097,8 +17097,8 @@ _0804F4CE: bx r1 thumb_func_end sub_804F498 - thumb_func_start sub_804F4D4 -sub_804F4D4: @ 804F4D4 + thumb_func_start atk6D_set_sentpokes_values +atk6D_set_sentpokes_values: @ 804F4D4 push {lr} bl sub_803F988 ldr r1, =gBattlescriptCurrInstr @@ -17108,10 +17108,10 @@ sub_804F4D4: @ 804F4D4 pop {r0} bx r0 .pool - thumb_func_end sub_804F4D4 + thumb_func_end atk6D_set_sentpokes_values - thumb_func_start atk6E_state0_side_becomes_attacker -atk6E_state0_side_becomes_attacker: @ 804F4EC + thumb_func_start atk6E_set_atk_to_player0 +atk6E_set_atk_to_player0: @ 804F4EC push {lr} movs r0, 0 bl GetBankByPlayerAI @@ -17124,10 +17124,10 @@ atk6E_state0_side_becomes_attacker: @ 804F4EC pop {r0} bx r0 .pool - thumb_func_end atk6E_state0_side_becomes_attacker + thumb_func_end atk6E_set_atk_to_player0 - thumb_func_start atk6F_8026810 -atk6F_8026810: @ 804F50C + thumb_func_start atk6F_set_visible +atk6F_set_visible: @ 804F50C push {r4,r5,lr} ldr r5, =gBattlescriptCurrInstr ldr r0, [r5] @@ -17147,10 +17147,10 @@ atk6F_8026810: @ 804F50C pop {r0} bx r0 .pool - thumb_func_end atk6F_8026810 + thumb_func_end atk6F_set_visible - thumb_func_start atk70_record_ability_usage_of_side -atk70_record_ability_usage_of_side: @ 804F540 + thumb_func_start atk70_record_ability +atk70_record_ability: @ 804F540 push {r4,lr} ldr r4, =gBattlescriptCurrInstr ldr r0, [r4] @@ -17169,7 +17169,7 @@ atk70_record_ability_usage_of_side: @ 804F540 pop {r0} bx r0 .pool - thumb_func_end atk70_record_ability_usage_of_side + thumb_func_end atk70_record_ability thumb_func_start sub_804F574 sub_804F574: @ 804F574 @@ -17178,7 +17178,7 @@ sub_804F574: @ 804F574 strb r0, [r2] movs r0, 0x2 strb r0, [r2, 0x1] - ldr r0, =gUnknown_020244E2 + ldr r0, =gMoveToLearn ldrh r1, [r0] strb r1, [r2, 0x2] movs r0, 0xFF @@ -17192,8 +17192,8 @@ sub_804F574: @ 804F574 .pool thumb_func_end sub_804F574 - thumb_func_start atk71_80268A0 -atk71_80268A0: @ 804F59C + thumb_func_start atk71_buffer_move_to_learn +atk71_buffer_move_to_learn: @ 804F59C push {lr} bl sub_804F574 ldr r1, =gBattlescriptCurrInstr @@ -17203,10 +17203,10 @@ atk71_80268A0: @ 804F59C pop {r0} bx r0 .pool - thumb_func_end atk71_80268A0 + thumb_func_end atk71_buffer_move_to_learn - thumb_func_start atk72_flee -atk72_flee: @ 804F5B4 + thumb_func_start atk72_jump_if_can_run_frombattle +atk72_jump_if_can_run_frombattle: @ 804F5B4 push {lr} ldr r0, =gUnknown_0202420D ldrb r0, [r0] @@ -17238,10 +17238,10 @@ _0804F5F0: pop {r0} bx r0 .pool - thumb_func_end atk72_flee + thumb_func_end atk72_jump_if_can_run_frombattle - thumb_func_start atk73_cmd73 -atk73_cmd73: @ 804F5F8 + thumb_func_start atk73_hp_thresholds +atk73_hp_thresholds: @ 804F5F8 push {r4-r6,lr} ldr r0, =gBattleTypeFlags ldr r4, [r0] @@ -17317,10 +17317,10 @@ _0804F68E: pop {r0} bx r0 .pool - thumb_func_end atk73_cmd73 + thumb_func_end atk73_hp_thresholds - thumb_func_start atk74_hp_tresholds_2 -atk74_hp_tresholds_2: @ 804F6A4 + thumb_func_start atk74_hp_thresholds2 +atk74_hp_thresholds2: @ 804F6A4 push {r4-r7,lr} mov r7, r8 push {r7} @@ -17401,7 +17401,7 @@ _0804F73E: pop {r0} bx r0 .pool - thumb_func_end atk74_hp_tresholds_2 + thumb_func_end atk74_hp_thresholds2 thumb_func_start atk75_8026A58 atk75_8026A58: @ 804F754 @@ -17420,7 +17420,7 @@ atk75_8026A58: @ 804F754 muls r0, r2 ldr r1, =gEnemyParty adds r0, r1 - ldr r1, =gUnknown_02024208 + ldr r1, =gLastUsedItem ldrh r1, [r1] lsls r2, 24 lsrs r2, 24 @@ -17438,8 +17438,8 @@ atk75_8026A58: @ 804F754 .pool thumb_func_end atk75_8026A58 - thumb_func_start sub_804F7AC -sub_804F7AC: @ 804F7AC + thumb_func_start atk76_various +atk76_various: @ 804F7AC push {r4-r7,lr} mov r7, r8 push {r7} @@ -17922,8 +17922,8 @@ _0804FC38: lsls r0, 2 adds r0, r1 ldr r0, [r0] - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0x16 bl battle_show_message_maybe b _0804FD70 @@ -18051,7 +18051,7 @@ _0804FD78: pop {r0} bx r0 .pool - thumb_func_end sub_804F7AC + thumb_func_end atk76_various thumb_func_start atk77_setprotect atk77_setprotect: @ 804FD8C @@ -18089,7 +18089,7 @@ _0804FDBC: bne _0804FDCC movs r6, 0 _0804FDCC: - ldr r2, =gUnknown_0831C3D8 + ldr r2, =sProtectSuccessRates mov r5, r8 ldrb r1, [r5] lsls r0, r1, 3 @@ -18313,8 +18313,8 @@ _0804FFCC: .pool thumb_func_end atk78_faintifabilitynotdamp - thumb_func_start atk79_setuserhptozero -atk79_setuserhptozero: @ 804FFE4 + thumb_func_start atk79_setatkhptozero +atk79_setatkhptozero: @ 804FFE4 push {r4,lr} sub sp, 0x4 ldr r0, =gBattleExecBuffer @@ -18353,10 +18353,10 @@ _08050028: pop {r0} bx r0 .pool - thumb_func_end atk79_setuserhptozero + thumb_func_end atk79_setatkhptozero - thumb_func_start sub_8050044 -sub_8050044: @ 8050044 + thumb_func_start atk7A_jumpwhiletargetvalid +atk7A_jumpwhiletargetvalid: @ 8050044 push {r4-r7,lr} ldr r3, =gBattlescriptCurrInstr ldr r2, [r3] @@ -18430,10 +18430,10 @@ _080500E0: pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_8050044 + thumb_func_end atk7A_jumpwhiletargetvalid - thumb_func_start sub_80500E8 -sub_80500E8: @ 80500E8 + thumb_func_start atk7B_healhalfHP_if_possible +atk7B_healhalfHP_if_possible: @ 80500E8 push {r4-r6,lr} ldr r4, =gBattlescriptCurrInstr ldr r1, [r4] @@ -18490,10 +18490,10 @@ _0805015E: pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_80500E8 + thumb_func_end atk7B_healhalfHP_if_possible - thumb_func_start sub_8050164 -sub_8050164: @ 8050164 + thumb_func_start atk7C_8025508 +atk7C_8025508: @ 8050164 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -18646,10 +18646,10 @@ _080502AE: pop {r0} bx r0 .pool - thumb_func_end sub_8050164 + thumb_func_end atk7C_8025508 - thumb_func_start sub_80502C8 -sub_80502C8: @ 80502C8 + thumb_func_start atk7D_set_rain +atk7D_set_rain: @ 80502C8 push {lr} ldr r2, =gBattleWeather ldrh r0, [r2] @@ -18684,7 +18684,7 @@ _08050304: pop {r0} bx r0 .pool - thumb_func_end sub_80502C8 + thumb_func_end atk7D_set_rain thumb_func_start atk7E_setreflect atk7E_setreflect: @ 805031C @@ -18692,7 +18692,7 @@ atk7E_setreflect: @ 805031C ldr r6, =gBankAttacker ldrb r0, [r6] bl GetBankIdentity - ldr r4, =gUnknown_0202428E + ldr r4, =gSideAffecting movs r5, 0x1 adds r1, r5, 0 ands r1, r0 @@ -18750,7 +18750,7 @@ _0805035C: cmp r0, 0 beq _080503CC movs r0, 0x1 - bl sub_8069DEC + bl CountAliveMonsInBattle lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x2 @@ -18775,8 +18775,8 @@ _080503D2: .pool thumb_func_end atk7E_setreflect - thumb_func_start sub_80503E8 -sub_80503E8: @ 80503E8 + thumb_func_start atk7F_setseeded +atk7F_setseeded: @ 80503E8 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -18862,7 +18862,7 @@ _08050488: pop {r0} bx r0 .pool - thumb_func_end sub_80503E8 + thumb_func_end atk7F_setseeded thumb_func_start atk80_manipulatedamage atk80_manipulatedamage: @ 80504A8 @@ -19062,15 +19062,15 @@ _0805063A: bx r0 thumb_func_end atk82_jumpifnotfirstturn - thumb_func_start sub_8050640 -sub_8050640: @ 8050640 + thumb_func_start atk83_nop +atk83_nop: @ 8050640 ldr r1, =gBattlescriptCurrInstr ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .pool - thumb_func_end sub_8050640 + thumb_func_end atk83_nop thumb_func_start sub_8050650 sub_8050650: @ 8050650 @@ -19150,8 +19150,8 @@ _080506E2: bx r1 thumb_func_end sub_8050650 - thumb_func_start sub_80506EC -sub_80506EC: @ 80506EC + thumb_func_start atk84_jump_if_cant_sleep +atk84_jump_if_cant_sleep: @ 80506EC push {r4-r6,lr} ldr r5, =gBattlescriptCurrInstr ldr r1, [r5] @@ -19207,10 +19207,10 @@ _08050762: pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_80506EC + thumb_func_end atk84_jump_if_cant_sleep - thumb_func_start sub_8050768 -sub_8050768: @ 8050768 + thumb_func_start atk85_stockpile +atk85_stockpile: @ 8050768 push {r4,r5,lr} ldr r5, =gDisableStructs ldr r4, =gBankAttacker @@ -19263,7 +19263,7 @@ _080507CA: pop {r0} bx r0 .pool - thumb_func_end sub_8050768 + thumb_func_end atk85_stockpile thumb_func_start atk86_stockpiletobasedamage atk86_stockpiletobasedamage: @ 80507E4 @@ -19303,7 +19303,7 @@ _08050828: beq _080508B0 ldr r0, =gBattleMoveDamage mov r8, r0 - ldr r4, =gUnknown_0202428E + ldr r4, =gSideAffecting ldr r5, =gBankTarget ldrb r0, [r5] bl GetBankIdentity @@ -19329,7 +19329,7 @@ _08050828: str r4, [sp, 0x8] ldrb r4, [r5] str r4, [sp, 0xC] - bl sub_806957C + bl CalculateBaseDamage ldrb r2, [r6] lsls r1, r2, 3 subs r1, r2 @@ -19386,8 +19386,8 @@ _080508CA: .pool thumb_func_end atk86_stockpiletobasedamage - thumb_func_start atk87_stockpiletohprecovery -atk87_stockpiletohprecovery: @ 8050904 + thumb_func_start atk87_stockpiletohpheal +atk87_stockpiletohpheal: @ 8050904 push {r4-r7,lr} mov r7, r8 push {r7} @@ -19486,7 +19486,7 @@ _080509D0: pop {r0} bx r0 .pool - thumb_func_end atk87_stockpiletohprecovery + thumb_func_end atk87_stockpiletohpheal thumb_func_start atk88_negativedamage atk88_negativedamage: @ 80509E8 @@ -20186,8 +20186,8 @@ _08050FD2: .pool thumb_func_end atk8C_confuseifrepeatingattackends - thumb_func_start atk8D_setloopcounter -atk8D_setloopcounter: @ 8050FF0 + thumb_func_start atk8D_setmultihit_counter +atk8D_setmultihit_counter: @ 8050FF0 push {r4,r5,lr} ldr r0, =gBattlescriptCurrInstr ldr r0, [r0] @@ -20220,10 +20220,10 @@ _08051026: pop {r0} bx r0 .pool - thumb_func_end atk8D_setloopcounter + thumb_func_end atk8D_setmultihit_counter - thumb_func_start atk8E_cmd8e -atk8E_cmd8e: @ 805103C + thumb_func_start atk8E_prepare_multihit +atk8E_prepare_multihit: @ 805103C ldr r1, =gBattleScripting movs r2, 0 movs r0, 0xFD @@ -20241,7 +20241,7 @@ atk8E_cmd8e: @ 805103C str r0, [r1] bx lr .pool - thumb_func_end atk8E_cmd8e + thumb_func_end atk8E_prepare_multihit thumb_func_start sub_8051064 sub_8051064: @ 8051064 @@ -20333,8 +20333,8 @@ _08051116: .pool thumb_func_end sub_8051064 - thumb_func_start sub_805112C -sub_805112C: @ 805112C + thumb_func_start atk8F_forcerandomswitch +atk8F_forcerandomswitch: @ 805112C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -20692,10 +20692,10 @@ _08051414: pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_805112C + thumb_func_end atk8F_forcerandomswitch - thumb_func_start sub_8051424 -sub_8051424: @ 8051424 + thumb_func_start atk90_conversion_type_change +atk90_conversion_type_change: @ 8051424 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -20903,10 +20903,10 @@ _080515B0: pop {r0} bx r0 .pool - thumb_func_end sub_8051424 + thumb_func_end atk90_conversion_type_change - thumb_func_start atk91_givemoney -atk91_givemoney: @ 80515C8 + thumb_func_start atk91_givepaydaymoney +atk91_givepaydaymoney: @ 80515C8 push {r4,lr} ldr r0, =gBattleTypeFlags ldr r0, [r0] @@ -20931,7 +20931,7 @@ atk91_givemoney: @ 80515C8 lsls r1, 3 adds r0, r1 adds r1, r4, 0 - bl add_money + bl AddMoney ldr r1, =gBattleTextBuff1 movs r0, 0xFD strb r0, [r1] @@ -20967,7 +20967,7 @@ _08051658: pop {r0} bx r0 .pool - thumb_func_end atk91_givemoney + thumb_func_end atk91_givepaydaymoney thumb_func_start atk92_setlightscreen atk92_setlightscreen: @ 8051664 @@ -20975,7 +20975,7 @@ atk92_setlightscreen: @ 8051664 ldr r5, =gBankAttacker ldrb r0, [r5] bl GetBankIdentity - ldr r4, =gUnknown_0202428E + ldr r4, =gSideAffecting movs r6, 0x1 adds r1, r6, 0 ands r1, r0 @@ -21033,7 +21033,7 @@ _080516A4: cmp r0, 0 beq _08051714 movs r0, 0x1 - bl sub_8069DEC + bl CountAliveMonsInBattle lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -21112,7 +21112,7 @@ _08051782: bcs _080517C0 ldrb r0, [r5] movs r1, 0x27 - bl b_history__record_item_x12_of_player + bl RecordItemEffectBattle ldr r2, =gSpecialStatuses ldrb r1, [r5] lsls r0, r1, 2 @@ -21341,7 +21341,7 @@ _08051990: movs r1, 0x80 orrs r0, r1 strb r0, [r2] - ldr r1, =gUnknown_02024208 + ldr r1, =gLastUsedItem mov r2, r9 ldrb r0, [r2] muls r0, r3 @@ -21452,8 +21452,8 @@ _08051AA2: .pool thumb_func_end atk94_gethalfcurrentenemyhp - thumb_func_start sub_8051AC0 -sub_8051AC0: @ 8051AC0 + thumb_func_start atk95_setsandstorm +atk95_setsandstorm: @ 8051AC0 push {lr} ldr r2, =gBattleWeather ldrh r1, [r2] @@ -21489,10 +21489,10 @@ _08051AFE: pop {r0} bx r0 .pool - thumb_func_end sub_8051AC0 + thumb_func_end atk95_setsandstorm - thumb_func_start sub_8051B18 -sub_8051B18: @ 8051B18 + thumb_func_start atk96_weatherdamage +atk96_weatherdamage: @ 8051B18 push {r4,r5,lr} sub sp, 0x4 movs r0, 0 @@ -21662,10 +21662,10 @@ _08051C6A: pop {r0} bx r0 .pool - thumb_func_end sub_8051B18 + thumb_func_end atk96_weatherdamage - thumb_func_start atk97_tryinfatuatetarget -atk97_tryinfatuatetarget: @ 8051C90 + thumb_func_start atk97_try_infatuation +atk97_try_infatuation: @ 8051C90 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -21768,11 +21768,11 @@ _08051D1C: _08051D94: mov r0, r10 mov r1, r9 - bl pokemon_species_get_gender_info + bl GetGenderFromSpeciesAndPersonality adds r4, r0, 0 mov r0, r8 adds r1, r7, 0 - bl pokemon_species_get_gender_info + bl GetGenderFromSpeciesAndPersonality lsls r4, 24 lsls r0, 24 cmp r4, r0 @@ -21790,14 +21790,14 @@ _08051D94: bne _08051DE4 mov r0, r10 mov r1, r9 - bl pokemon_species_get_gender_info + bl GetGenderFromSpeciesAndPersonality lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq _08051DE4 mov r0, r8 adds r1, r7, 0 - bl pokemon_species_get_gender_info + bl GetGenderFromSpeciesAndPersonality lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF @@ -21846,10 +21846,10 @@ _08051E2C: pop {r0} bx r0 .pool - thumb_func_end atk97_tryinfatuatetarget + thumb_func_end atk97_try_infatuation - thumb_func_start sub_8051E48 -sub_8051E48: @ 8051E48 + thumb_func_start atk98_status_icon_update +atk98_status_icon_update: @ 8051E48 push {r4-r7,lr} ldr r0, =gBattleExecBuffer ldr r0, [r0] @@ -21960,10 +21960,10 @@ _08051F34: pop {r0} bx r0 .pool - thumb_func_end sub_8051E48 + thumb_func_end atk98_status_icon_update - thumb_func_start atk99_setmisteffect -atk99_setmisteffect: @ 8051F58 + thumb_func_start atk99_setmist +atk99_setmist: @ 8051F58 push {r4-r6,lr} ldr r6, =gSideTimers ldr r4, =gBankAttacker @@ -22011,7 +22011,7 @@ _08051F98: strb r1, [r0, 0x5] ldrb r0, [r4] bl GetBankIdentity - ldr r2, =gUnknown_0202428E + ldr r2, =gSideAffecting adds r1, r5, 0 ands r1, r0 lsls r1, 1 @@ -22034,10 +22034,10 @@ _08051FE6: pop {r0} bx r0 .pool - thumb_func_end atk99_setmisteffect + thumb_func_end atk99_setmist - thumb_func_start atk9A_setincreasedcriticalchance -atk9A_setincreasedcriticalchance: @ 8052000 + thumb_func_start atk9A_set_focusenergy +atk9A_set_focusenergy: @ 8052000 push {lr} ldr r1, =gBattleMons ldr r0, =gBankAttacker @@ -22076,7 +22076,7 @@ _08052048: pop {r0} bx r0 .pool - thumb_func_end atk9A_setincreasedcriticalchance + thumb_func_end atk9A_set_focusenergy thumb_func_start atk9B_transformdataexecution atk9B_transformdataexecution: @ 805205C @@ -22212,7 +22212,7 @@ _08052170: bls _08052170 movs r4, 0 ldr r7, =gBattleMoves - ldr r3, =gUnknown_02024090 + ldr r3, =gBattleMons + 0xC adds r5, r3, 0 adds r5, 0x18 _08052188: @@ -22264,8 +22264,8 @@ _080521EC: .pool thumb_func_end atk9B_transformdataexecution - thumb_func_start sub_80521FC -sub_80521FC: @ 80521FC + thumb_func_start atk9C_set_substitute +atk9C_set_substitute: @ 80521FC push {r4-r7,lr} ldr r7, =gBattleMons ldr r6, =gBankAttacker @@ -22344,7 +22344,7 @@ _08052290: pop {r0} bx r0 .pool - thumb_func_end sub_80521FC + thumb_func_end atk9C_set_substitute thumb_func_start sub_80522B8 sub_80522B8: @ 80522B8 @@ -22395,7 +22395,7 @@ atk9D_copyattack: @ 8052300 ldr r1, =0x0000ffff adds r7, r1, 0 strh r7, [r0] - ldr r5, =gUnknown_02024248 + ldr r5, =gLastUsedMovesByBanks ldr r6, =gBankTarget ldrb r0, [r6] lsls r0, 1 @@ -22491,7 +22491,7 @@ _080523CE: mov r0, r12 adds r0, 0xC adds r1, r0 - ldr r2, =gUnknown_02024248 + ldr r2, =gLastUsedMovesByBanks ldr r3, =gBankTarget ldrb r0, [r3] lsls r0, 1 @@ -22602,8 +22602,8 @@ _080524CC: bx r0 thumb_func_end atk9D_copyattack - thumb_func_start sub_80524DC -sub_80524DC: @ 80524DC + thumb_func_start atk9E_metronome +atk9E_metronome: @ 80524DC push {r4-r7,lr} mov r7, r8 push {r7} @@ -22671,10 +22671,10 @@ _0805251C: pop {r0} bx r0 .pool - thumb_func_end sub_80524DC + thumb_func_end atk9E_metronome - thumb_func_start atk9F_nightshadedamageeffect -atk9F_nightshadedamageeffect: @ 8052584 + thumb_func_start atk9F_dmgtolevel +atk9F_dmgtolevel: @ 8052584 ldr r3, =gBattleMoveDamage ldr r2, =gBattleMons ldr r0, =gBankAttacker @@ -22691,7 +22691,7 @@ atk9F_nightshadedamageeffect: @ 8052584 str r0, [r1] bx lr .pool - thumb_func_end atk9F_nightshadedamageeffect + thumb_func_end atk9F_dmgtolevel thumb_func_start atkA0_psywavedamageeffect atkA0_psywavedamageeffect: @ 80525B4 @@ -22955,7 +22955,7 @@ atkA3_disablelastusedattack: @ 80527F8 adds r7, r2, 0 adds r7, 0xC adds r0, r7 - ldr r5, =gUnknown_02024248 + ldr r5, =gLastUsedMovesByBanks lsls r1, 1 adds r1, r5 ldrh r0, [r0] @@ -23112,7 +23112,7 @@ atkA4_setencore: @ 805293C adds r6, r3, 0 adds r6, 0xC adds r0, r6 - ldr r2, =gUnknown_02024248 + ldr r2, =gLastUsedMovesByBanks lsls r1, 1 adds r1, r2 ldrh r0, [r0] @@ -23249,8 +23249,8 @@ _08052A5E: .pool thumb_func_end atkA4_setencore - thumb_func_start sub_8052A70 -sub_8052A70: @ 8052A70 + thumb_func_start atkA5_painsplitdmgcalc +atkA5_painsplitdmgcalc: @ 8052A70 push {r4-r7,lr} ldr r6, =gBattleMons ldr r0, =gBankTarget @@ -23335,7 +23335,7 @@ _08052B2A: pop {r0} bx r0 .pool - thumb_func_end sub_8052A70 + thumb_func_end atkA5_painsplitdmgcalc thumb_func_start atkA6_settypetorandomresistance atkA6_settypetorandomresistance: @ 8052B34 @@ -23942,8 +23942,8 @@ _08053012: bx r1 thumb_func_end move_weather_interaction - thumb_func_start sub_8053018 -sub_8053018: @ 8053018 + thumb_func_start atkA9_sleeptalk_choose_move +atkA9_sleeptalk_choose_move: @ 8053018 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -23955,7 +23955,7 @@ sub_8053018: @ 8053018 mov r9, r0 movs r1, 0x58 mov r8, r1 - ldr r7, =gUnknown_02024090 + ldr r7, =gBattleMons + 0xC movs r0, 0x84 lsls r0, 1 mov r10, r0 @@ -24006,7 +24006,7 @@ _08053084: ldrb r0, [r0] adds r1, r6, 0 movs r2, 0xFD - bl sub_803FECC + bl CheckMoveLimitations lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0xF @@ -24076,10 +24076,10 @@ _0805311C: pop {r0} bx r0 .pool - thumb_func_end sub_8053018 + thumb_func_end atkA9_sleeptalk_choose_move - thumb_func_start atkAA_destinybondeffect -atkAA_destinybondeffect: @ 8053150 + thumb_func_start atkAA_set_destinybond +atkAA_set_destinybond: @ 8053150 ldr r1, =gBattleMons ldr r0, =gBankAttacker ldrb r2, [r0] @@ -24098,7 +24098,7 @@ atkAA_destinybondeffect: @ 8053150 str r0, [r1] bx lr .pool - thumb_func_end atkAA_destinybondeffect + thumb_func_end atkAA_set_destinybond thumb_func_start b_feature_update_destiny_bond b_feature_update_destiny_bond: @ 8053180 @@ -24144,8 +24144,8 @@ _080531CA: .pool thumb_func_end b_feature_update_destiny_bond - thumb_func_start atkAB_802A458 -atkAB_802A458: @ 80531E0 + thumb_func_start atkAB_DestinyBondFlagUpdate +atkAB_DestinyBondFlagUpdate: @ 80531E0 push {lr} bl b_feature_update_destiny_bond ldr r1, =gBattlescriptCurrInstr @@ -24155,7 +24155,7 @@ atkAB_802A458: @ 80531E0 pop {r0} bx r0 .pool - thumb_func_end atkAB_802A458 + thumb_func_end atkAB_DestinyBondFlagUpdate thumb_func_start atkAC_remaininghptopower atkAC_remaininghptopower: @ 80531F8 @@ -24189,7 +24189,7 @@ _08053224: cmp r1, r0 bgt _08053224 _08053232: - ldr r2, =gUnknown_02024400 + ldr r2, =gDynamicBasePower ldr r1, =gUnknown_0831C408 adds r0, r3, 0x1 adds r0, r1 @@ -24204,15 +24204,15 @@ _08053232: .pool thumb_func_end atkAC_remaininghptopower - thumb_func_start atkAD_reducepprandom -atkAD_reducepprandom: @ 8053260 + thumb_func_start atkAD_spite_ppreduce +atkAD_spite_ppreduce: @ 8053260 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 - ldr r4, =gUnknown_02024248 + ldr r4, =gLastUsedMovesByBanks ldr r1, =gBankTarget ldrb r3, [r1] lsls r0, r3, 1 @@ -24299,7 +24299,7 @@ _08053304: strb r5, [r1] movs r0, 0x2 strb r0, [r1, 0x1] - ldr r2, =gUnknown_02024248 + ldr r2, =gLastUsedMovesByBanks mov r3, r8 ldrb r0, [r3] lsls r0, 1 @@ -24425,10 +24425,10 @@ _08053422: pop {r0} bx r0 .pool - thumb_func_end atkAD_reducepprandom + thumb_func_end atkAD_spite_ppreduce - thumb_func_start atkAE_clearstatusifnotsoundproofed -atkAE_clearstatusifnotsoundproofed: @ 8053438 + thumb_func_start atkAE_heal_party_status +atkAE_heal_party_status: @ 8053438 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -24630,7 +24630,7 @@ _08053600: _08053618: adds r0, r5, 0 adds r1, r4, 0 - bl sub_806B694 + bl GetAbilityBySpecies lsls r0, 24 lsrs r0, 24 _08053624: @@ -24740,7 +24740,7 @@ _080536DE: pop {r0} bx r0 .pool - thumb_func_end atkAE_clearstatusifnotsoundproofed + thumb_func_end atkAE_heal_party_status thumb_func_start atkAF_cursetarget atkAF_cursetarget: @ 805371C @@ -24803,8 +24803,8 @@ _0805378C: .pool thumb_func_end atkAF_cursetarget - thumb_func_start atkB0_setspikes -atkB0_setspikes: @ 80537A0 + thumb_func_start atkB0_set_spikes +atkB0_set_spikes: @ 80537A0 push {r4,lr} ldr r4, =gBankAttacker ldrb r0, [r4] @@ -24847,7 +24847,7 @@ atkB0_setspikes: @ 80537A0 b _0805381E .pool _08053804: - ldr r1, =gUnknown_0202428E + ldr r1, =gSideAffecting adds r1, r2, r1 ldrh r2, [r1] movs r0, 0x10 @@ -24865,10 +24865,10 @@ _0805381E: pop {r0} bx r0 .pool - thumb_func_end atkB0_setspikes + thumb_func_end atkB0_set_spikes - thumb_func_start atkB1_setforesight -atkB1_setforesight: @ 805382C + thumb_func_start atkB1_set_foresight +atkB1_set_foresight: @ 805382C ldr r1, =gBattleMons ldr r0, =gBankTarget ldrb r2, [r0] @@ -24887,7 +24887,7 @@ atkB1_setforesight: @ 805382C str r0, [r1] bx lr .pool - thumb_func_end atkB1_setforesight + thumb_func_end atkB1_set_foresight thumb_func_start atkB2_setperishsong atkB2_setperishsong: @ 805385C @@ -25084,7 +25084,7 @@ _080539BA: ands r0, r2 str r0, [r1] _080539EE: - ldr r3, =gUnknown_02024400 + ldr r3, =gDynamicBasePower ldr r2, =gBattleMoves mov r0, r8 ldrh r1, [r0] @@ -25154,8 +25154,8 @@ _08053A60: .pool thumb_func_end atkB3_rolloutdamagecalculation - thumb_func_start atkB4_jumpifconfusedandattackmaxed -atkB4_jumpifconfusedandattackmaxed: @ 8053A90 + thumb_func_start atkB4_jumpifconfusedandstatmaxed +atkB4_jumpifconfusedandstatmaxed: @ 8053A90 push {r4,r5,lr} ldr r5, =gBattleMons ldr r0, =gBankTarget @@ -25204,10 +25204,10 @@ _08053AF2: pop {r4,r5} pop {r0} bx r0 - thumb_func_end atkB4_jumpifconfusedandattackmaxed + thumb_func_end atkB4_jumpifconfusedandstatmaxed - thumb_func_start sub_8053AF8 -sub_8053AF8: @ 8053AF8 + thumb_func_start atkB5_furycuttercalc +atkB5_furycuttercalc: @ 8053AF8 push {r4,r5,lr} ldr r0, =gBattleMoveFlags ldrb r1, [r0] @@ -25243,7 +25243,7 @@ _08053B34: adds r0, 0x1 strb r0, [r1, 0x10] _08053B4C: - ldr r3, =gUnknown_02024400 + ldr r3, =gDynamicBasePower ldr r2, =gBattleMoves ldr r0, =gCurrentMove ldrh r1, [r0] @@ -25282,7 +25282,7 @@ _08053B8C: pop {r0} bx r0 .pool - thumb_func_end sub_8053AF8 + thumb_func_end atkB5_furycuttercalc thumb_func_start atkB6_happinesstodamagecalculation atkB6_happinesstodamagecalculation: @ 8053BAC @@ -25297,7 +25297,7 @@ atkB6_happinesstodamagecalculation: @ 8053BAC ldrb r0, [r0] cmp r0, 0x79 bne _08053BEC - ldr r4, =gUnknown_02024400 + ldr r4, =gDynamicBasePower ldr r2, =gBattleMons ldr r0, =gBankAttacker ldrb r1, [r0] @@ -25309,7 +25309,7 @@ atkB6_happinesstodamagecalculation: @ 8053BAC b _08053C02 .pool _08053BEC: - ldr r4, =gUnknown_02024400 + ldr r4, =gDynamicBasePower ldr r2, =gBattleMons ldr r0, =gBankAttacker ldrb r1, [r0] @@ -25345,7 +25345,7 @@ atkB7_presentdamagecalculation: @ 8053C30 ands r4, r0 cmp r4, 0x65 bgt _08053C4C - ldr r1, =gUnknown_02024400 + ldr r1, =gDynamicBasePower movs r0, 0x28 strh r0, [r1] b _08053C8E @@ -25353,7 +25353,7 @@ atkB7_presentdamagecalculation: @ 8053C30 _08053C4C: cmp r4, 0xB1 bgt _08053C5C - ldr r1, =gUnknown_02024400 + ldr r1, =gDynamicBasePower movs r0, 0x50 strh r0, [r1] b _08053C8E @@ -25361,7 +25361,7 @@ _08053C4C: _08053C5C: cmp r4, 0xCB bgt _08053C6C - ldr r1, =gUnknown_02024400 + ldr r1, =gDynamicBasePower movs r0, 0x78 strh r0, [r1] b _08053C8E @@ -25423,13 +25423,13 @@ _08053CE6: .pool thumb_func_end atkB7_presentdamagecalculation - thumb_func_start atkB8_setsafeguard -atkB8_setsafeguard: @ 8053CFC + thumb_func_start atkB8_set_safeguard +atkB8_set_safeguard: @ 8053CFC push {r4-r7,lr} ldr r7, =gBankAttacker ldrb r0, [r7] bl GetBankIdentity - ldr r4, =gUnknown_0202428E + ldr r4, =gSideAffecting movs r6, 0x1 adds r1, r6, 0 ands r1, r0 @@ -25493,7 +25493,7 @@ _08053D88: pop {r0} bx r0 .pool - thumb_func_end atkB8_setsafeguard + thumb_func_end atkB8_set_safeguard thumb_func_start atkB9_magnitudedamagecalculation atkB9_magnitudedamagecalculation: @ 8053DA4 @@ -25509,7 +25509,7 @@ atkB9_magnitudedamagecalculation: @ 8053DA4 lsrs r3, r0, 16 cmp r3, 0x4 bgt _08053DD0 - ldr r1, =gUnknown_02024400 + ldr r1, =gDynamicBasePower movs r0, 0xA strh r0, [r1] movs r3, 0x4 @@ -25518,7 +25518,7 @@ atkB9_magnitudedamagecalculation: @ 8053DA4 _08053DD0: cmp r3, 0xE bgt _08053DE4 - ldr r1, =gUnknown_02024400 + ldr r1, =gDynamicBasePower movs r0, 0x1E strh r0, [r1] movs r3, 0x5 @@ -25527,7 +25527,7 @@ _08053DD0: _08053DE4: cmp r3, 0x22 bgt _08053DF8 - ldr r1, =gUnknown_02024400 + ldr r1, =gDynamicBasePower movs r0, 0x32 strh r0, [r1] movs r3, 0x6 @@ -25536,7 +25536,7 @@ _08053DE4: _08053DF8: cmp r3, 0x40 bgt _08053E0C - ldr r1, =gUnknown_02024400 + ldr r1, =gDynamicBasePower movs r0, 0x46 strh r0, [r1] movs r3, 0x7 @@ -25545,7 +25545,7 @@ _08053DF8: _08053E0C: cmp r3, 0x54 bgt _08053E20 - ldr r1, =gUnknown_02024400 + ldr r1, =gDynamicBasePower movs r0, 0x5A strh r0, [r1] movs r3, 0x8 @@ -25554,14 +25554,14 @@ _08053E0C: _08053E20: cmp r3, 0x5E bgt _08053E34 - ldr r1, =gUnknown_02024400 + ldr r1, =gDynamicBasePower movs r0, 0x6E strh r0, [r1] movs r3, 0x9 b _08053E3C .pool _08053E34: - ldr r1, =gUnknown_02024400 + ldr r1, =gDynamicBasePower movs r0, 0x96 strh r0, [r1] movs r3, 0xA @@ -25625,8 +25625,8 @@ _08053E94: .pool thumb_func_end atkB9_magnitudedamagecalculation - thumb_func_start atkBA_802B140 -atkBA_802B140: @ 8053EC8 + thumb_func_start atkBA_jumpifnopursuitswitchdmg +atkBA_jumpifnopursuitswitchdmg: @ 8053EC8 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -25797,10 +25797,10 @@ _0805404A: pop {r0} bx r0 .pool - thumb_func_end atkBA_802B140 + thumb_func_end atkBA_jumpifnopursuitswitchdmg - thumb_func_start sub_805405C -sub_805405C: @ 805405C + thumb_func_start atkBB_setsunny +atkBB_setsunny: @ 805405C push {lr} ldr r2, =gBattleWeather ldrh r1, [r2] @@ -25836,7 +25836,7 @@ _0805409A: pop {r0} bx r0 .pool - thumb_func_end sub_805405C + thumb_func_end atkBB_setsunny thumb_func_start atkBC_maxattackhalvehp atkBC_maxattackhalvehp: @ 80540B4 @@ -25908,7 +25908,7 @@ atkBD_copyfoestats: @ 8054134 ldr r7, =gBattlescriptCurrInstr ldr r6, =gBankAttacker movs r4, 0x58 - ldr r3, =gUnknown_0202409C + ldr r3, =gBattleMons + 0x18 ldr r5, =gBankTarget _08054142: ldrb r0, [r6] @@ -26021,7 +26021,7 @@ _08054210: _08054250: adds r0, r2, 0 bl GetBankSide - ldr r4, =gUnknown_0202428E + ldr r4, =gSideAffecting lsls r0, 24 lsrs r0, 23 adds r0, r4 @@ -26067,8 +26067,8 @@ _080542BA: .pool thumb_func_end atkBE_breakfree - thumb_func_start atkBF_setcurled -atkBF_setcurled: @ 80542C8 + thumb_func_start atkBF_set_defense_curl +atkBF_set_defense_curl: @ 80542C8 ldr r1, =gBattleMons ldr r0, =gBankAttacker ldrb r2, [r0] @@ -26087,7 +26087,7 @@ atkBF_setcurled: @ 80542C8 str r0, [r1] bx lr .pool - thumb_func_end atkBF_setcurled + thumb_func_end atkBF_set_defense_curl thumb_func_start atkC0_recoverbasedonsunlight atkC0_recoverbasedonsunlight: @ 80542F8 @@ -26211,8 +26211,8 @@ _080543F2: .pool thumb_func_end atkC0_recoverbasedonsunlight - thumb_func_start sub_8054400 -sub_8054400: @ 8054400 + thumb_func_start atkC1_hidden_power +atkC1_hidden_power: @ 8054400 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -26309,7 +26309,7 @@ sub_8054400: @ 8054400 ands r1, r3 lsls r1, 5 orrs r4, r1 - ldr r5, =gUnknown_02024400 + ldr r5, =gDynamicBasePower lsls r0, r2, 2 adds r0, r2 lsls r0, 3 @@ -26349,7 +26349,7 @@ _080544F0: pop {r0} bx r0 .pool - thumb_func_end sub_8054400 + thumb_func_end atkC1_hidden_power thumb_func_start atkC2_selectnexttarget atkC2_selectnexttarget: @ 8054524 @@ -26439,7 +26439,7 @@ atkC3_setfutureattack: @ 8054598 _080545DC: adds r0, r1, 0 bl GetBankIdentity - ldr r4, =gUnknown_0202428E + ldr r4, =gSideAffecting lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -26497,7 +26497,7 @@ _080545DC: str r4, [sp, 0x8] ldrb r4, [r6] str r4, [sp, 0xC] - bl sub_806957C + bl CalculateBaseDamage ldrb r1, [r6] lsls r1, 2 mov r2, r8 @@ -26554,8 +26554,8 @@ _080546CC: .pool thumb_func_end atkC3_setfutureattack - thumb_func_start atkC4_802B910 -atkC4_802B910: @ 80546E4 + thumb_func_start atkC4_beat_up +atkC4_beat_up: @ 80546E4 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -26783,7 +26783,7 @@ _080548E2: pop {r0} bx r0 .pool - thumb_func_end atkC4_802B910 + thumb_func_end atkC4_beat_up thumb_func_start atkC5_hidepreattack atkC5_hidepreattack: @ 80548F4 @@ -26940,8 +26940,8 @@ _08054A2C: .pool thumb_func_end atkC7_setminimize - thumb_func_start sub_8054A48 -sub_8054A48: @ 8054A48 + thumb_func_start atkC8_sethail +atkC8_sethail: @ 8054A48 push {lr} ldr r3, =gBattleWeather ldrh r1, [r3] @@ -26976,7 +26976,7 @@ _08054A86: pop {r0} bx r0 .pool - thumb_func_end sub_8054A48 + thumb_func_end atkC8_sethail thumb_func_start atkC9_jumpifattackandspecialattackcannotfall atkC9_jumpifattackandspecialattackcannotfall: @ 8054AA0 @@ -27375,8 +27375,8 @@ _08054E02: .pool thumb_func_end atkD0_settaunt - thumb_func_start atkD1_sethelpinghand -atkD1_sethelpinghand: @ 8054E0C + thumb_func_start atkD1_set_helpinghand +atkD1_set_helpinghand: @ 8054E0C push {r4,lr} ldr r4, =gBankAttacker ldrb r0, [r4] @@ -27446,10 +27446,10 @@ _08054EAA: pop {r0} bx r0 .pool - thumb_func_end atkD1_sethelpinghand + thumb_func_end atkD1_set_helpinghand - thumb_func_start sub_8054EB4 -sub_8054EB4: @ 8054EB4 + thumb_func_start atkD2_swap_items +atkD2_swap_items: @ 8054EB4 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -27742,10 +27742,10 @@ _08055132: pop {r0} bx r0 .pool - thumb_func_end sub_8054EB4 + thumb_func_end atkD2_swap_items - thumb_func_start sub_8055148 -sub_8055148: @ 8055148 + thumb_func_start atkD3_copy_ability +atkD3_copy_ability: @ 8055148 push {r4,lr} ldr r3, =gBattleMons ldr r4, =gBankTarget @@ -27798,10 +27798,10 @@ _080551B6: pop {r0} bx r0 .pool - thumb_func_end sub_8055148 + thumb_func_end atkD3_copy_ability - thumb_func_start atkD4_802C408 -atkD4_802C408: @ 80551C0 + thumb_func_start atkD4_wish_effect +atkD4_wish_effect: @ 80551C0 push {r4-r7,lr} ldr r7, =gBattlescriptCurrInstr ldr r2, [r7] @@ -27898,10 +27898,10 @@ _0805528C: pop {r4-r7} pop {r0} bx r0 - thumb_func_end atkD4_802C408 + thumb_func_end atkD4_wish_effect - thumb_func_start sub_8055294 -sub_8055294: @ 8055294 + thumb_func_start atkD5_setroots +atkD5_setroots: @ 8055294 push {lr} ldr r1, =gStatuses3 ldr r0, =gBankAttacker @@ -27941,7 +27941,7 @@ _080552E4: pop {r0} bx r0 .pool - thumb_func_end sub_8055294 + thumb_func_end atkD5_setroots thumb_func_start atkD6_doubledamagedealtifdamaged atkD6_doubledamagedealtifdamaged: @ 80552EC @@ -27988,8 +27988,8 @@ _0805532A: .pool thumb_func_end atkD6_doubledamagedealtifdamaged - thumb_func_start sub_805534C -sub_805534C: @ 805534C + thumb_func_start atkD7_setyawn +atkD7_setyawn: @ 805534C push {r4,lr} ldr r1, =gStatuses3 ldr r0, =gBankTarget @@ -28040,7 +28040,7 @@ _080553B0: pop {r0} bx r0 .pool - thumb_func_end sub_805534C + thumb_func_end atkD7_setyawn thumb_func_start atkD8_setdamagetohealthdifference atkD8_setdamagetohealthdifference: @ 80553BC @@ -28093,7 +28093,7 @@ _0805541A: thumb_func_start atkD9_scaledamagebyhealthratio atkD9_scaledamagebyhealthratio: @ 8055428 push {r4,lr} - ldr r4, =gUnknown_02024400 + ldr r4, =gDynamicBasePower ldrh r0, [r4] cmp r0, 0 bne _08055464 @@ -28408,7 +28408,7 @@ _080556A0: lsls r0, 16 lsrs r0, 16 movs r1, 0x1 - bl sub_80C0630 + bl GetPokedexHeightWeight ldrh r1, [r4] lsls r0, 16 lsrs r0, 16 @@ -28426,7 +28426,7 @@ _080556CE: ldr r0, =0x0000ffff cmp r1, r0 beq _080556FC - ldr r0, =gUnknown_02024400 + ldr r0, =gDynamicBasePower adds r1, r5, 0x1 lsls r1, 1 adds r1, r6 @@ -28435,7 +28435,7 @@ _080556CE: b _08055702 .pool _080556FC: - ldr r1, =gUnknown_02024400 + ldr r1, =gDynamicBasePower movs r0, 0x78 strh r0, [r1] _08055702: @@ -28736,8 +28736,8 @@ _0805598E: .pool thumb_func_end atkE0_setstealstatchange - thumb_func_start atkE1_802CBE4 -atkE1_802CBE4: @ 805599C + thumb_func_start atkE1_intimidate_string_loader +atkE1_intimidate_string_loader: @ 805599C push {r4-r6,lr} ldr r4, =gBattleScripting ldr r0, =gBattleStruct @@ -28832,10 +28832,10 @@ _08055A6C: pop {r0} bx r0 .pool - thumb_func_end atkE1_802CBE4 + thumb_func_end atkE1_intimidate_string_loader - thumb_func_start atkE2_cmde2 -atkE2_cmde2: @ 8055A78 + thumb_func_start atkE2_switchout_abilities +atkE2_switchout_abilities: @ 8055A78 push {r4-r6,lr} sub sp, 0x4 ldr r5, =gBattlescriptCurrInstr @@ -28887,7 +28887,7 @@ _08055AD2: pop {r0} bx r0 .pool - thumb_func_end atkE2_cmde2 + thumb_func_end atkE2_switchout_abilities thumb_func_start atkE3_jumpiffainted atkE3_jumpiffainted: @ 8055AF4 @@ -28930,8 +28930,8 @@ _08055B42: bx r0 thumb_func_end atkE3_jumpiffainted - thumb_func_start sub_8055B48 -sub_8055B48: @ 8055B48 + thumb_func_start atkE4_getsecretpowereffect +atkE4_getsecretpowereffect: @ 8055B48 push {lr} ldr r0, =gUnknown_02022FF0 ldrb r0, [r0] @@ -29005,10 +29005,10 @@ _08055BE8: pop {r0} bx r0 .pool - thumb_func_end sub_8055B48 + thumb_func_end atkE4_getsecretpowereffect - thumb_func_start atkE5_pickupitemcalculation -atkE5_pickupitemcalculation: @ 8055C00 + thumb_func_start atkE5_pickup +atkE5_pickup: @ 8055C00 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -29240,10 +29240,10 @@ _08055DD8: pop {r0} bx r0 .pool - thumb_func_end atkE5_pickupitemcalculation + thumb_func_end atkE5_pickup - thumb_func_start atkE6_castform_transform -atkE6_castform_transform: @ 8055DFC + thumb_func_start atkE6_castform_change_animation +atkE6_castform_change_animation: @ 8055DFC push {r4,lr} ldr r4, =gActiveBank ldr r0, =gBattleScripting @@ -29285,10 +29285,10 @@ _08055E2C: pop {r0} bx r0 .pool - thumb_func_end atkE6_castform_transform + thumb_func_end atkE6_castform_change_animation - thumb_func_start atkE7_castform_switch -atkE7_castform_switch: @ 8055E64 + thumb_func_start atkE7_castform_data_change +atkE7_castform_data_change: @ 8055E64 push {r4,lr} ldr r1, =gBattlescriptCurrInstr ldr r0, [r1] @@ -29313,7 +29313,7 @@ _08055E8E: pop {r0} bx r0 .pool - thumb_func_end atkE7_castform_switch + thumb_func_end atkE7_castform_data_change thumb_func_start atkE8_settypebasedhalvers atkE8_settypebasedhalvers: @ 8055EA4 @@ -29397,8 +29397,8 @@ _08055F52: .pool thumb_func_end atkE8_settypebasedhalvers - thumb_func_start atkE9_seteffectbyweather -atkE9_seteffectbyweather: @ 8055F5C + thumb_func_start atkE9_setweatherballtype +atkE9_setweatherballtype: @ 8055F5C push {lr} sub sp, 0x4 movs r0, 0 @@ -29484,7 +29484,7 @@ _08055FFC: pop {r0} bx r0 .pool - thumb_func_end atkE9_seteffectbyweather + thumb_func_end atkE9_setweatherballtype thumb_func_start atkEA_recycleitem atkEA_recycleitem: @ 8056014 @@ -29511,7 +29511,7 @@ atkEA_recycleitem: @ 8056014 ldrh r0, [r0, 0x2E] cmp r0, 0 bne _08056094 - ldr r1, =gUnknown_02024208 + ldr r1, =gLastUsedItem strh r5, [r1] strh r0, [r6] ldrb r0, [r7] @@ -29576,7 +29576,7 @@ atkEB_settypetoterrain: @ 80560BC movs r0, 0x21 adds r0, r3 mov r12, r0 - ldr r5, =gUnknown_0831C483 + ldr r5, =sTerrainToType ldr r4, =gUnknown_02022FF0 ldrb r0, [r4] adds r0, r5 @@ -29642,8 +29642,8 @@ _0805615E: .pool thumb_func_end atkEB_settypetoterrain - thumb_func_start atkEC_802D2A0 -atkEC_802D2A0: @ 805616C + thumb_func_start atkEC_pursuit_sth +atkEC_pursuit_sth: @ 805616C push {r4-r6,lr} ldr r5, =gBankAttacker ldrb r0, [r5] @@ -29720,10 +29720,10 @@ _08056226: pop {r0} bx r0 .pool - thumb_func_end atkEC_802D2A0 + thumb_func_end atkEC_pursuit_sth - thumb_func_start atkED_802D364 -atkED_802D364: @ 8056230 + thumb_func_start atkED_802B4B4 +atkED_802B4B4: @ 8056230 push {r4,lr} ldr r1, =gUnknown_0202420E ldr r3, =gBankAttacker @@ -29757,10 +29757,10 @@ _0805626A: pop {r0} bx r0 .pool - thumb_func_end atkED_802D364 + thumb_func_end atkED_802B4B4 - thumb_func_start atkEE_removereflectlightscreen -atkEE_removereflectlightscreen: @ 8056284 + thumb_func_start atkEE_removelightscreenreflect +atkEE_removelightscreenreflect: @ 8056284 push {r4,lr} ldr r0, =gBankAttacker ldrb r0, [r0] @@ -29781,7 +29781,7 @@ atkEE_removereflectlightscreen: @ 8056284 cmp r1, 0 beq _080562E4 _080562AC: - ldr r2, =gUnknown_0202428E + ldr r2, =gSideAffecting adds r2, r3, r2 ldrh r1, [r2] ldr r0, =0x0000fffe @@ -29811,10 +29811,10 @@ _080562EA: pop {r0} bx r0 .pool - thumb_func_end atkEE_removereflectlightscreen + thumb_func_end atkEE_removelightscreenreflect - thumb_func_start sub_8056300 -sub_8056300: @ 8056300 + thumb_func_start atkEF_pokeball_catch_calculation +atkEF_pokeball_catch_calculation: @ 8056300 push {r4-r6,lr} movs r4, 0 ldr r0, =gBattleExecBuffer @@ -29862,7 +29862,7 @@ _0805635C: b _08056694 .pool _08056384: - ldr r0, =gUnknown_02024208 + ldr r0, =gLastUsedItem ldrh r0, [r0] cmp r0, 0x5 bne _080563B0 @@ -29894,7 +29894,7 @@ _080563B0: adds r0, r3 ldrb r5, [r0, 0x8] _080563C8: - ldr r2, =gUnknown_02024208 + ldr r2, =gLastUsedItem ldrh r0, [r2] cmp r0, 0x5 bhi _080563D2 @@ -29994,7 +29994,7 @@ _080564A4: b _080564D2 .pool _080564B0: - ldr r0, =gUnknown_03005D10 + ldr r0, =gBattleResults ldrb r0, [r0, 0x13] adds r0, 0xA lsls r0, 24 @@ -30005,7 +30005,7 @@ _080564B0: b _080564D2 .pool _080564C8: - ldr r1, =gUnknown_0831C48D + ldr r1, =sBallCatchBonuses ldrh r0, [r2] subs r0, 0x2 adds r0, r1 @@ -30050,13 +30050,13 @@ _0805650E: bl __udivsi3 adds r6, r0, 0 _08056522: - ldr r1, =gUnknown_02024208 + ldr r1, =gLastUsedItem ldrh r0, [r1] cmp r0, 0x5 beq _08056564 cmp r0, 0x1 bne _08056550 - ldr r0, =gUnknown_03005D10 + ldr r0, =gBattleResults ldrb r1, [r0, 0x5] movs r2, 0x2 orrs r1, r2 @@ -30064,7 +30064,7 @@ _08056522: b _08056564 .pool _08056550: - ldr r0, =gUnknown_03005D10 + ldr r0, =gBattleResults ldrh r1, [r1] adds r0, r1 adds r1, r0, 0 @@ -30096,10 +30096,10 @@ _08056564: muls r0, r1 ldr r1, =gEnemyParty adds r0, r1 - ldr r2, =gUnknown_02024208 + ldr r2, =gLastUsedItem movs r1, 0x26 bl SetMonData - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x6 @@ -30137,7 +30137,7 @@ _080565FA: cmp r0, r6 bcc _080565F4 _0805660A: - ldr r5, =gUnknown_02024208 + ldr r5, =gLastUsedItem ldrh r0, [r5] cmp r0, 0x1 bne _08056614 @@ -30167,7 +30167,7 @@ _08056614: movs r1, 0x26 adds r2, r5, 0 bl SetMonData - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x6 @@ -30196,10 +30196,10 @@ _08056696: pop {r0} bx r0 .pool - thumb_func_end sub_8056300 + thumb_func_end atkEF_pokeball_catch_calculation - thumb_func_start atkF0_catch_pokemon -atkF0_catch_pokemon: @ 80566A8 + thumb_func_start atkF0_copy_caught_poke +atkF0_copy_caught_poke: @ 80566A8 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -30219,7 +30219,7 @@ atkF0_catch_pokemon: @ 80566A8 ldr r1, =gEnemyParty mov r8, r1 add r0, r8 - bl pokemon_catch + bl GiveMonToPlayer lsls r0, 24 cmp r0, 0 beq _08056792 @@ -30313,7 +30313,7 @@ _08056792: movs r1, 0xB movs r2, 0 bl GetMonData - ldr r5, =gUnknown_03005D10 + ldr r5, =gBattleResults strh r0, [r5, 0x28] mov r1, r9 ldrb r0, [r1] @@ -30363,10 +30363,10 @@ _08056792: pop {r0} bx r0 .pool - thumb_func_end atkF0_catch_pokemon + thumb_func_end atkF0_copy_caught_poke - thumb_func_start atkF1_802D95C -atkF1_802D95C: @ 8056850 + thumb_func_start atkF1_setpoke_as_caught +atkF1_setpoke_as_caught: @ 8056850 push {r4,r5,lr} ldr r4, =gEnemyParty adds r0, r4, 0 @@ -30421,10 +30421,10 @@ _080568C2: pop {r0} bx r0 .pool - thumb_func_end atkF1_802D95C + thumb_func_end atkF1_setpoke_as_caught - thumb_func_start sub_80568CC -sub_80568CC: @ 80568CC + thumb_func_start atkF2_display_dex_info +atkF2_display_dex_info: @ 80568CC push {r4,lr} sub sp, 0x4 ldr r0, =gEnemyParty @@ -30573,7 +30573,7 @@ _08056A2C: pop {r0} bx r0 .pool - thumb_func_end sub_80568CC + thumb_func_end atkF2_display_dex_info thumb_func_start sub_8056A3C sub_8056A3C: @ 8056A3C @@ -30795,8 +30795,8 @@ sub_8056BAC: @ 8056BAC .pool thumb_func_end sub_8056BAC - thumb_func_start atkF3_receive_new_pokemon_maybe -atkF3_receive_new_pokemon_maybe: @ 8056BEC + thumb_func_start atkF3_nickname_caught_poke +atkF3_nickname_caught_poke: @ 8056BEC push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -30970,7 +30970,7 @@ _08056D0A: muls r1, r0 adds r0, r1, 0 add r0, r8 - bl pokemon_get_gender + bl GetMonGender adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 @@ -31035,7 +31035,7 @@ _08056DD4: b _08056E48 .pool _08056E2C: - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x6 @@ -31070,10 +31070,10 @@ _08056E62: pop {r0} bx r0 .pool - thumb_func_end atkF3_receive_new_pokemon_maybe + thumb_func_end atkF3_nickname_caught_poke - thumb_func_start sub_8056E78 -sub_8056E78: @ 8056E78 + thumb_func_start atkF4_802BEF0 +atkF4_802BEF0: @ 8056E78 ldr r2, =gBattleMons ldr r0, =gBankAttacker ldrb r1, [r0] @@ -31091,10 +31091,10 @@ sub_8056E78: @ 8056E78 str r0, [r1] bx lr .pool - thumb_func_end sub_8056E78 + thumb_func_end atkF4_802BEF0 - thumb_func_start atkF5_reset_attacker_bd_x4C -atkF5_reset_attacker_bd_x4C: @ 8056EA8 + thumb_func_start atkF5_removeattackerstatus1 +atkF5_removeattackerstatus1: @ 8056EA8 ldr r1, =gBattleMons ldr r0, =gBankAttacker ldrb r2, [r0] @@ -31110,19 +31110,19 @@ atkF5_reset_attacker_bd_x4C: @ 8056EA8 str r0, [r1] bx lr .pool - thumb_func_end atkF5_reset_attacker_bd_x4C + thumb_func_end atkF5_removeattackerstatus1 - thumb_func_start sub_8056ED0 -sub_8056ED0: @ 8056ED0 + thumb_func_start atkF6_802BF48 +atkF6_802BF48: @ 8056ED0 ldr r1, =gFightStateTracker movs r0, 0xC strb r0, [r1] bx lr .pool - thumb_func_end sub_8056ED0 + thumb_func_end atkF6_802BF48 - thumb_func_start sub_8056EDC -sub_8056EDC: @ 8056EDC + thumb_func_start atkF7_802BF54 +atkF7_802BF54: @ 8056EDC ldr r1, =gFightStateTracker movs r0, 0xC strb r0, [r1] @@ -31132,7 +31132,7 @@ sub_8056EDC: @ 8056EDC strb r0, [r1] bx lr .pool - thumb_func_end sub_8056EDC + thumb_func_end atkF7_802BF54 thumb_func_start sub_8056EF8 sub_8056EF8: @ 8056EF8 diff --git a/asm/battle_5.s b/asm/battle_5.s index 718ded432..064171dd8 100644 --- a/asm/battle_5.s +++ b/asm/battle_5.s @@ -96,7 +96,7 @@ _08056F3E: adds r1, r0 ldr r0, [r2] adds r0, r1 - bl create_enemy_party + bl CreateSecretBaseEnemyParty _08056FFA: pop {r4-r6} pop {r0} @@ -253,7 +253,7 @@ _0805714A: ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x8 - bl happiness_algorithm + bl AdjustFriendship b _080571CE .pool _08057198: @@ -266,7 +266,7 @@ _08057198: ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x6 - bl happiness_algorithm + bl AdjustFriendship b _080571CE .pool _080571B8: @@ -279,7 +279,7 @@ _080571B8: ldr r1, =gPlayerParty adds r0, r1 movs r1, 0x6 - bl happiness_algorithm + bl AdjustFriendship _080571CE: pop {r4,r5} pop {r0} @@ -555,7 +555,7 @@ _08057406: ldrb r1, [r4] movs r0, 0x58 muls r0, r1 - ldr r1, =gUnknown_020240D0 + ldr r1, =gBattleMons + 0x4C adds r0, r1 str r0, [sp] movs r0, 0 diff --git a/asm/battle_7.s b/asm/battle_7.s index ef67d6bc0..b92d69947 100644 --- a/asm/battle_7.s +++ b/asm/battle_7.s @@ -80,12 +80,12 @@ sub_805D19C: @ 805D19C ldr r4, =gActiveBank ldrb r0, [r4] lsls r2, r0, 9 - ldr r1, =gUnknown_02023068 + ldr r1, =gBattleBufferA + 4 adds r2, r1 mov r10, r2 movs r1, 0 movs r2, 0xFF - bl sub_803FECC + bl CheckMoveLimitations lsls r0, 24 lsrs r0, 24 mov r8, r0 @@ -124,7 +124,7 @@ _0805D20E: ldrb r1, [r0] movs r0, 0x58 muls r0, r1 - ldr r1, =gUnknown_020240CC + ldr r1, =gBattleMons + 0x48 adds r0, r1 ldr r0, [r0] bl GetNatureFromPersonality @@ -194,7 +194,7 @@ _0805D27C: lsls r0, r6, 24 lsrs r0, 24 bl BattleAI_SetupAIData - bl sub_8130BA4 + bl BattleAI_ChooseMoveOrAction lsls r0, 24 lsrs r0, 24 mov r9, r0 @@ -2029,7 +2029,7 @@ _0805E24C: ldrb r0, [r4] bl battle_make_oam_normal_battle _0805E252: - ldr r2, =gUnknown_03005D70 + ldr r2, =gHealthBoxesIds ldrb r1, [r4] adds r1, r2 strb r0, [r1] @@ -2044,7 +2044,7 @@ _0805E260: ldrb r0, [r0] cmp r0, 0x1 bhi _0805E288 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r1, r0 ldrb r0, [r0] movs r1, 0 @@ -2052,7 +2052,7 @@ _0805E260: b _0805E30E .pool _0805E288: - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r1, r0 ldrb r0, [r0] movs r1, 0x1 @@ -2071,7 +2071,7 @@ _0805E29C: ands r0, r1 cmp r0, 0 bne _0805E302 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] @@ -2088,7 +2088,7 @@ _0805E29C: b _0805E302 .pool _0805E2E4: - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] @@ -2103,7 +2103,7 @@ _0805E2E4: movs r2, 0 bl healthbar_draw_field_maybe _0805E302: - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r4] adds r0, r1 ldrb r0, [r0] @@ -2347,7 +2347,7 @@ _0805E4DE: b _0805E77A .pool _0805E51C: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _0805E558 @@ -2578,7 +2578,7 @@ _0805E70A: adds r1, r2 ldr r2, =0x04000008 bl CpuSet - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0805E74A @@ -2639,7 +2639,7 @@ sub_805E7DC: @ 805E7DC lsls r1, 24 cmp r1, 0 bne _0805E898 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _0805E7F8 @@ -2651,7 +2651,7 @@ _0805E7F8: lsls r0, 24 lsrs r4, r0, 24 _0805E802: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _0805E814 @@ -2714,7 +2714,7 @@ _0805E860: b _0805E8E6 .pool _0805E898: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0805E8E6 diff --git a/asm/battle_9.s b/asm/battle_9.s index 00d893f21..f1811e1af 100644 --- a/asm/battle_9.s +++ b/asm/battle_9.s @@ -2039,7 +2039,7 @@ _08063D02: ldrb r1, [r0] adds r0, r4, 0 ldr r2, [sp, 0x4] - bl move_effectiveness_something + bl TypeCalc movs r1, 0x2 ands r1, r0 cmp r1, 0 @@ -2074,7 +2074,7 @@ _08063D58: beq _08063D60 b _08063BE4 _08063D60: - ldr r0, =gUnknown_02024400 + ldr r0, =gDynamicBasePower movs r1, 0 strh r1, [r0] ldr r0, =gBattleStruct @@ -2167,11 +2167,11 @@ _08063DEE: beq _08063E2A ldrb r0, [r6] ldr r1, [sp, 0x4] - bl sub_8046E7C + bl AI_CalcDmg ldrb r1, [r6] adds r0, r4, 0 ldr r2, [sp, 0x4] - bl move_effectiveness_something + bl TypeCalc _08063E2A: mov r2, r8 ldr r0, [r2] @@ -2367,7 +2367,7 @@ _08063F8E: bne _08063FA6 b _08064370 _08063FA6: - ldr r1, =gItemEffectInfoPointers + ldr r1, =gItemEffectTable subs r0, 0xD lsls r0, 2 adds r0, r1 @@ -2451,7 +2451,7 @@ _08064074: mov r0, r9 movs r1, 0x4 movs r2, 0x4 - bl sub_806CDDC + bl GetItemEffectParamOffset lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 diff --git a/asm/battle_anim.s b/asm/battle_anim.s index 3fb24e627..639be6b7d 100644 --- a/asm/battle_anim.s +++ b/asm/battle_anim.s @@ -123,7 +123,7 @@ move_something: @ 80A3A48 lsls r2, 24 lsrs r2, 24 mov r9, r2 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A3AE8 @@ -846,7 +846,7 @@ _080A406E: movs r2, 0x80 lsls r2, 1 bl m4aMPlayVolumeControl - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A409C @@ -1021,7 +1021,7 @@ _080A41FA: lsrs r0, 24 cmp r0, 0x1 bls _080A4226 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A4230 @@ -1073,7 +1073,7 @@ _080A4266: lsrs r0, 24 cmp r0, 0x1 bls _080A4294 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A42A4 @@ -1130,7 +1130,7 @@ b_side_obj__get_some_boolean: @ 80A4310 lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A4330 @@ -1146,7 +1146,7 @@ _080A4330: lsls r0, 24 cmp r0, 0 beq _080A4384 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A4374 @@ -1203,7 +1203,7 @@ sub_80A438C: @ 80A438C beq _080A43AA b _080A455E _080A43AA: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1278,7 +1278,7 @@ _080A43F8: negs r0, r0 adds r0, 0x20 strh r0, [r5] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A447A @@ -1347,7 +1347,7 @@ _080A44B0: ldr r2, =0x04000008 adds r0, r4, 0 bl CpuSet - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A4524 @@ -1374,7 +1374,7 @@ _080A452E: movs r1, 0 movs r2, 0 bl sub_8118FBC - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A4558 @@ -1645,7 +1645,7 @@ sub_80A477C: @ 80A477C bl sub_80A6B30 cmp r4, 0 beq _080A479C - bl sub_80A4DF0 + bl IsContest lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 @@ -1891,7 +1891,7 @@ sub_80A4980: @ 80A4980 lsrs r0, 24 cmp r0, 0x1 bls _080A49BC - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A49C4 @@ -1985,7 +1985,7 @@ _080A4A4A: lsrs r0, 24 cmp r0, 0x1 bls _080A4A76 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A4A80 @@ -2018,7 +2018,7 @@ _080A4A8A: lsrs r0, 24 cmp r0, 0x1 bls _080A4ABC - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A4AC0 @@ -2171,7 +2171,7 @@ sub_80A4BB0: @ 80A4BB0 lsrs r0, 24 cmp r0, 0x1 bls _080A4BEE - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A4BF8 @@ -2441,8 +2441,8 @@ ma13_goto: @ 80A4DCC .pool thumb_func_end ma13_goto - thumb_func_start sub_80A4DF0 -sub_80A4DF0: @ 80A4DF0 + thumb_func_start IsContest +IsContest: @ 80A4DF0 push {lr} ldr r0, =gMain ldr r1, =0x00000439 @@ -2460,7 +2460,7 @@ _080A4E10: _080A4E12: pop {r1} bx r1 - thumb_func_end sub_80A4DF0 + thumb_func_end IsContest thumb_func_start ma14_load_background ma14_load_background: @ 80A4E18 @@ -2513,7 +2513,7 @@ sub_80A4E5C: @ 80A4E5C lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A4EA8 @@ -2670,7 +2670,7 @@ sub_80A4FC8: @ 80A4FC8 push {r4-r7,lr} lsls r0, 16 lsrs r7, r0, 16 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A5050 @@ -2747,7 +2747,7 @@ _080A507E: thumb_func_start dp01t_11_3_message_for_player_only dp01t_11_3_message_for_player_only: @ 80A5090 push {lr} - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A50A2 @@ -2855,12 +2855,12 @@ ma18_load_background_probably: @ 80A5158 .pool thumb_func_end ma18_load_background_probably - thumb_func_start sub_80A5178 -sub_80A5178: @ 80A5178 + thumb_func_start BattleAnimGetPanControl +BattleAnimGetPanControl: @ 80A5178 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A51C0 @@ -2888,7 +2888,7 @@ sub_80A5178: @ 80A5178 b _080A5252 .pool _080A51C0: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A51E8 @@ -2975,14 +2975,14 @@ _080A526C: pop {r4} pop {r1} bx r1 - thumb_func_end sub_80A5178 + thumb_func_end BattleAnimGetPanControl thumb_func_start sub_80A5278 sub_80A5278: @ 80A5278 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A52C0 @@ -3016,7 +3016,7 @@ _080A52C0: lsls r0, 24 cmp r0, 0 bne _080A52D8 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A52DE @@ -3110,7 +3110,7 @@ ma19_08073BC8: @ 80A5354 orrs r4, r0 movs r0, 0x2 ldrsb r0, [r1, r0] - bl sub_80A5178 + bl BattleAnimGetPanControl adds r1, r0, 0 lsls r1, 24 asrs r1, 24 @@ -3134,7 +3134,7 @@ ma1A_8073C00: @ 80A538C str r0, [r4] movs r0, 0x1 ldrsb r0, [r1, r0] - bl sub_80A5178 + bl BattleAnimGetPanControl lsls r0, 24 asrs r0, 24 bl SE12PanpotControl @@ -3172,14 +3172,14 @@ ma1B_8073C2C: @ 80A53B8 ldrb r7, [r1, 0x5] movs r0, 0x2 ldrsb r0, [r1, r0] - bl sub_80A5178 + bl BattleAnimGetPanControl adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 lsls r4, 24 asrs r4, 24 adds r0, r4, 0 - bl sub_80A5178 + bl BattleAnimGetPanControl mov r8, r0 lsls r5, 24 asrs r5, 24 @@ -3487,7 +3487,7 @@ ma1C_8073ED0: @ 80A565C mov r9, r2 movs r0, 0x2 ldrsb r0, [r1, r0] - bl sub_80A5178 + bl BattleAnimGetPanControl adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -3592,7 +3592,7 @@ ma1D_08073FB4: @ 80A5740 mov r8, r0 movs r0, 0x2 ldrsb r0, [r1, r0] - bl sub_80A5178 + bl BattleAnimGetPanControl adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -3822,7 +3822,7 @@ sub_80A5944: @ 80A5944 ldr r0, [r4] adds r0, 0x1 str r0, [r4] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A5978 @@ -3870,7 +3870,7 @@ _080A59A2: bl GetBankIdentity lsls r0, 24 lsrs r4, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A59D2 @@ -3901,7 +3901,7 @@ sub_80A59DC: @ 80A59DC ldr r1, [r0] adds r1, 0x1 str r1, [r0] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A5A04 @@ -3949,7 +3949,7 @@ _080A5A4A: bl GetBankIdentity lsls r0, 24 lsrs r4, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A5A78 @@ -3978,7 +3978,7 @@ ma2B_make_side_invisible: @ 80A5A80 ldr r4, =gBattleAnimScriptPtr ldr r0, [r4] ldrb r0, [r0, 0x1] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF @@ -4009,7 +4009,7 @@ ma2C_make_side_visible: @ 80A5ABC ldr r4, =gBattleAnimScriptPtr ldr r0, [r4] ldrb r0, [r0, 0x1] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF @@ -4043,7 +4043,7 @@ sub_80A5AFC: @ 80A5AFC ldrb r7, [r0, 0x1] adds r0, 0x2 str r0, [r1] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A5BA6 @@ -4078,7 +4078,7 @@ _080A5B54: lsrs r4, r0, 24 movs r0, 0x1 _080A5B60: - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF @@ -4125,7 +4125,7 @@ sub_80A5BAC: @ 80A5BAC ldrb r7, [r0, 0x1] adds r0, 0x2 str r0, [r1] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A5C38 @@ -4160,7 +4160,7 @@ _080A5C04: lsrs r4, r0, 24 movs r0, 0x1 _080A5C10: - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF diff --git a/asm/battle_anin_80A9C70.s b/asm/battle_anim_80A9C70.s similarity index 99% rename from asm/battle_anin_80A9C70.s rename to asm/battle_anim_80A9C70.s index 1455134ec..16366988e 100644 --- a/asm/battle_anin_80A9C70.s +++ b/asm/battle_anim_80A9C70.s @@ -348,7 +348,7 @@ sub_80A9EF4: @ 80A9EF4 ldr r1, =0xffdc0000 adds r0, r1 lsrs r4, r0, 16 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A9F32 diff --git a/asm/battle_anim_80FE840.s b/asm/battle_anim_80FE840.s index ba712ef89..9bcbbe0c5 100644 --- a/asm/battle_anim_80FE840.s +++ b/asm/battle_anim_80FE840.s @@ -113,7 +113,7 @@ sub_80FE8E0: @ 80FE8E0 str r0, [r4, 0x1C] ldr r1, =move_anim_8074EE0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -149,7 +149,7 @@ sub_80FE930: @ 80FE930 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -557,7 +557,7 @@ sub_80FECB8: @ 80FECB8 str r0, [r4, 0x1C] ldr r1, =sub_80FECF0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 _080FECE2: pop {r4} pop {r0} @@ -585,7 +585,7 @@ sub_80FECF0: @ 80FECF0 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4} pop {r0} bx r0 @@ -717,7 +717,7 @@ sub_80FEE1C: @ 80FEE1C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080FEE36 @@ -1434,7 +1434,7 @@ sub_80FF3B0: @ 80FF3B0 ands r0, r1 strb r0, [r2] movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId movs r0, 0x80 lsls r0, 1 strh r0, [r4, 0x2E] @@ -1452,7 +1452,7 @@ sub_80FF3EC: @ 80FF3EC push {r4,lr} adds r4, r0, 0 movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId movs r1, 0x32 ldrsh r0, [r4, r1] cmp r0, 0 @@ -1517,7 +1517,7 @@ sub_80FF458: @ 80FF458 lsls r0, 24 lsrs r4, r0, 24 movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r1, r0, 24 ldr r0, =gSprites @@ -1567,7 +1567,7 @@ _080FF498: orrs r0, r1 strb r0, [r7, 0x5] movs r0, 0x3 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r1, r0, 24 lsls r4, r1, 4 @@ -1618,7 +1618,7 @@ sub_80FF53C: @ 80FF53C lsls r4, 24 lsrs r4, 24 movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 adds r6, r0, 0 @@ -1698,7 +1698,7 @@ sub_80FF5CC: @ 80FF5CC cmp r5, 0 bne _080FF674 movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -1723,7 +1723,7 @@ sub_80FF5CC: @ 80FF5CC orrs r0, r2 strb r0, [r1, 0x5] movs r0, 0x3 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 4 @@ -1862,7 +1862,7 @@ _080FF704: str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 _080FF756: pop {r4-r6} pop {r0} @@ -2485,7 +2485,7 @@ _080FFC38: adds r0, r6, 0 adds r0, 0xA strh r0, [r5, 0x3C] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080FFC50 @@ -2640,7 +2640,7 @@ _080FFD56: cmp r0, 0 bne _080FFD8A movs r0, 0x3F - bl sub_80A5178 + bl BattleAnimGetPanControl adds r1, r0, 0 lsls r1, 24 asrs r1, 24 @@ -2658,7 +2658,7 @@ _080FFD8A: str r0, [r4, 0x1C] movs r0, 0x40 negs r0, r0 - bl sub_80A5178 + bl BattleAnimGetPanControl adds r1, r0, 0 lsls r1, 24 asrs r1, 24 @@ -2679,7 +2679,7 @@ sub_80FFDBC: @ 80FFDBC ldrsh r0, [r4, r1] cmp r0, 0 bne _080FFE50 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080FFDE4 @@ -2869,7 +2869,7 @@ _080FFF10: movs r1, 0xFF ands r0, r1 strh r0, [r4, 0x30] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080FFF5E @@ -3867,7 +3867,7 @@ _08100700: adds r0, r7 strh r0, [r4, 0x22] movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId _0810071A: adds r0, r6, 0 bl sub_80A8328 @@ -4155,7 +4155,7 @@ _08100918: bl sub_80A74F4 lsls r0, 16 lsrs r4, r0, 16 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _0810097A @@ -4266,7 +4266,7 @@ _08100A2C: str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4} pop {r0} bx r0 @@ -4330,7 +4330,7 @@ sub_8100A94: @ 8100A94 bl StartSpriteAffineAnim ldr r1, =move_anim_8074EE0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A66DC str r0, [r4, 0x1C] pop {r4} @@ -4621,7 +4621,7 @@ _08100CF2: bne _08100D28 ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 movs r0, 0x3 strh r0, [r4, 0x2E] ldr r0, =sub_80A64B0 @@ -4857,7 +4857,7 @@ _08100EE8: sub_8100EF0: @ 8100EF0 push {r4-r6,lr} adds r5, r0, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08100F06 @@ -4889,7 +4889,7 @@ _08100F06: lsls r0, 24 cmp r0, 0 beq _08100F44 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08100F6C @@ -5408,7 +5408,7 @@ _08101320: strh r0, [r4, 0x32] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A656C str r0, [r4, 0x1C] pop {r4,r5} @@ -5509,7 +5509,7 @@ _08101414: strh r0, [r5, 0x32] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A656C str r0, [r5, 0x1C] pop {r4-r6} @@ -5707,7 +5707,7 @@ sub_81015AC: @ 81015AC ldr r1, =sub_80A64B0 str r1, [r0, 0x1C] ldr r1, =sub_81015D4 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r0} bx r0 .pool @@ -5732,7 +5732,7 @@ _081015EA: str r0, [r5, 0x1C] ldr r1, =sub_81015D4 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 b _0810166A .pool _08101604: @@ -5770,7 +5770,7 @@ _08101604: str r0, [r5, 0x1C] ldr r1, =sub_8101684 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 movs r1, 0x80 lsls r1, 1 adds r0, r1, 0 @@ -5778,7 +5778,7 @@ _08101604: adds r0, r1 strh r0, [r5, 0x38] movs r0, 0x3F - bl sub_80A5178 + bl BattleAnimGetPanControl adds r1, r0, 0 lsls r1, 24 asrs r1, 24 @@ -5810,7 +5810,7 @@ sub_8101684: @ 8101684 str r0, [r2, 0x1C] ldr r1, =sub_81016B8 adds r0, r2, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 b _081016B0 .pool _081016AC: @@ -5837,7 +5837,7 @@ sub_81016B8: @ 81016B8 str r0, [r5, 0x1C] ldr r1, =sub_8101774 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 b _08101760 .pool _081016E0: @@ -5904,7 +5904,7 @@ _08101718: str r0, [r5, 0x1C] ldr r1, =sub_8101820 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 _08101760: pop {r4-r7} pop {r0} @@ -5975,7 +5975,7 @@ _081017A4: movs r2, 0x4 bl LoadPalette movs r0, 0x3F - bl sub_80A5178 + bl BattleAnimGetPanControl adds r1, r0, 0 lsls r1, 24 asrs r1, 24 @@ -6220,7 +6220,7 @@ _081019B6: strh r0, [r4, 0x34] ldr r1, =sub_81019E8 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A6630 str r0, [r4, 0x1C] pop {r4,r5} @@ -6322,7 +6322,7 @@ _08101A92: strh r0, [r4, 0x34] ldr r1, =sub_8101B84 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A6630 str r0, [r4, 0x1C] pop {r4,r5} @@ -6949,7 +6949,7 @@ _08101F5E: strh r0, [r5, 0x30] ldr r1, =sub_810208C adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67D8 str r0, [r5, 0x1C] pop {r4-r6} @@ -6979,7 +6979,7 @@ sub_8101FA8: @ 8101FA8 strh r0, [r4, 0x22] ldr r1, =sub_8102044 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67D8 str r0, [r4, 0x1C] pop {r4,r5} @@ -7043,7 +7043,7 @@ sub_8102044: @ 8102044 strh r0, [r4, 0x32] ldr r1, =sub_810207C adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A653C str r0, [r4, 0x1C] _0810206E: @@ -7213,7 +7213,7 @@ sub_810217C: @ 810217C strh r5, [r4, 0x34] strh r5, [r4, 0x36] subs r0, 0x42 - bl sub_80A5178 + bl BattleAnimGetPanControl lsls r0, 24 asrs r0, 24 strh r0, [r4, 0x38] @@ -7334,7 +7334,7 @@ sub_8102268: @ 8102268 ldrh r5, [r5, 0x2] adds r0, r5 strh r0, [r6, 0x22] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _081022AC @@ -7482,7 +7482,7 @@ _08102390: str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 _081023CC: pop {r4,r5} pop {r0} @@ -7544,7 +7544,7 @@ sub_8102434: @ 8102434 cmp r4, r0 bcs _08102490 ldr r6, =gBattleAnimArgs - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds _08102448: movs r1, 0 ldrsh r0, [r6, r1] @@ -7597,7 +7597,7 @@ sub_81024A8: @ 81024A8 movs r4, 0 b _081024C2 _081024B2: - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r4, r0 ldrb r0, [r0] bl sub_80729D0 @@ -7621,7 +7621,7 @@ _081024C2: sub_81024E0: @ 81024E0 push {r4,lr} adds r4, r0, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _081024F6 @@ -8088,7 +8088,7 @@ _08102862: ldrh r1, [r5, 0x20] strh r1, [r5, 0x3A] strh r0, [r5, 0x3C] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _081028D4 @@ -8237,7 +8237,7 @@ sub_81029B4: @ 81029B4 ldr r1, =gTasks adds r6, r0, r1 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x8] @@ -8482,7 +8482,7 @@ sub_8102BCC: @ 8102BCC push {r4,lr} adds r4, r0, 0 ldr r1, =move_anim_8072740 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67D8 str r0, [r4, 0x1C] pop {r4} @@ -8648,7 +8648,7 @@ _08102D10: strh r1, [r5, 0x32] ldrh r0, [r4, 0x4] strh r0, [r5, 0x34] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08102D34 @@ -9023,7 +9023,7 @@ _08102FDE: str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4-r6} pop {r0} bx r0 @@ -9223,7 +9223,7 @@ _08103182: bl StartSpriteAnim ldr r1, =sub_81031D0 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67D8 str r0, [r5, 0x1C] pop {r4,r5} @@ -9244,7 +9244,7 @@ sub_81031D0: @ 81031D0 bne _081031F8 ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldrh r1, [r4, 0x30] lsls r1, 24 lsrs r1, 24 @@ -9281,7 +9281,7 @@ _08103226: strh r0, [r4, 0x2E] ldr r1, =sub_8103250 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67BC str r0, [r4, 0x1C] pop {r4} @@ -9306,7 +9306,7 @@ sub_8103250: @ 8103250 bl StartSpriteAffineAnim ldr r1, =move_anim_8074EE0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67BC str r0, [r4, 0x1C] _08103276: @@ -9363,7 +9363,7 @@ _081032CA: strh r6, [r4, 0x36] ldr r1, =sub_8103300 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67BC str r0, [r4, 0x1C] pop {r4-r6} @@ -9519,7 +9519,7 @@ sub_81033F0: @ 81033F0 bl StartSpriteAnim ldr r1, =sub_810342C adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67D8 str r0, [r4, 0x1C] _0810341E: @@ -9571,7 +9571,7 @@ sub_8103448: @ 8103448 strh r0, [r4, 0x36] ldr r1, =move_anim_8074EE0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r1, =sub_80A6450 str r1, [r4, 0x1C] adds r0, r4, 0 @@ -9794,7 +9794,7 @@ sub_8103620: @ 8103620 str r0, [r4, 0x1C] ldr r1, =sub_8103658 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4} pop {r0} bx r0 @@ -9814,7 +9814,7 @@ sub_8103658: @ 8103658 ldr r1, =sub_80A6EEC str r1, [r0, 0x1C] ldr r1, =sub_8103680 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r0} bx r0 .pool @@ -10056,7 +10056,7 @@ _08103860: str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -10073,7 +10073,7 @@ sub_810387C: @ 810387C str r0, [r4, 0x1C] ldr r1, =sub_81038A0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4} pop {r0} bx r0 @@ -10093,7 +10093,7 @@ sub_81038A0: @ 81038A0 ldr r1, =sub_80A6EEC str r1, [r0, 0x1C] ldr r1, =move_anim_8072740 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r0} bx r0 .pool @@ -10106,7 +10106,7 @@ sub_81038C8: @ 81038C8 push {r7} sub sp, 0x4 adds r5, r0, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _081038EC @@ -10178,7 +10178,7 @@ _0810390E: lsls r1, 24 adds r0, r1 lsrs r4, r0, 16 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08103980 @@ -10203,7 +10203,7 @@ _08103980: str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 add sp, 0x4 pop {r3} mov r8, r3 @@ -10604,7 +10604,7 @@ _08103C90: strh r0, [r4, 0xA] movs r0, 0x3F negs r0, r0 - bl sub_80A5178 + bl BattleAnimGetPanControl adds r1, r0, 0 lsls r1, 24 asrs r1, 24 @@ -10642,7 +10642,7 @@ sub_8103CF0: @ 8103CF0 mov r4, sp adds r4, 0x2 strh r1, [r4] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 mov r10, r4 cmp r0, 0 @@ -11114,7 +11114,7 @@ _081040CC: str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 add sp, 0x4 pop {r4-r7} pop {r0} @@ -11223,7 +11223,7 @@ sub_81041C4: @ 81041C4 strb r0, [r2] ldr r1, =sub_810421C adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -11235,7 +11235,7 @@ sub_810421C: @ 810421C push {r4,lr} adds r4, r0, 0 movs r0, 0x3F - bl sub_80A5178 + bl BattleAnimGetPanControl adds r1, r0, 0 lsls r1, 24 asrs r1, 24 @@ -11377,7 +11377,7 @@ _08104322: str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 @@ -11442,7 +11442,7 @@ _08104390: str r0, [r5, 0x1C] ldr r1, =sub_81043F8 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r3} mov r8, r3 pop {r4-r7} @@ -11678,7 +11678,7 @@ sub_81045B0: @ 81045B0 lsls r5, 24 lsrs r5, 24 movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -11735,7 +11735,7 @@ sub_8104614: @ 8104614 cmp r1, r0 bne _08104664 movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -11771,7 +11771,7 @@ sub_8104674: @ 8104674 ldr r0, =gTasks adds r4, r0 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 movs r5, 0 @@ -12129,7 +12129,7 @@ sub_8104938: @ 8104938 .pool _08104964: ldrb r0, [r5] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -12303,7 +12303,7 @@ sub_8104AB4: @ 8104AB4 ldr r0, =gTasks adds r4, r0 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -12393,7 +12393,7 @@ _08104B6A: strh r1, [r4, 0x36] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A656C str r0, [r4, 0x1C] pop {r4,r5} @@ -12456,7 +12456,7 @@ _08104BE4: _08104C16: ldr r1, =move_anim_8074EE0 adds r0, r6, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67BC str r0, [r6, 0x1C] pop {r4-r6} @@ -12476,7 +12476,7 @@ sub_8104C38: @ 8104C38 ldr r0, =gTasks adds r4, r0 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -12528,7 +12528,7 @@ sub_8104CA4: @ 8104CA4 ldr r0, =gTasks adds r4, r1, r0 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 movs r2, 0 @@ -12986,7 +12986,7 @@ sub_810501C: @ 810501C adds r0, 0x2 strh r0, [r4, 0x38] movs r0, 0x3F - bl sub_80A5178 + bl BattleAnimGetPanControl lsls r0, 24 asrs r0, 24 strh r0, [r4, 0x3A] @@ -13381,7 +13381,7 @@ _0810536C: lsls r0, 16 lsrs r0, 16 mov r9, r0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _081053E4 @@ -13450,7 +13450,7 @@ _081053FA: adds r0, r1 lsls r0, 16 lsrs r6, r0, 16 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810544C @@ -13873,7 +13873,7 @@ sub_810577C: @ 810577C ldr r0, =gTasks adds r4, r0 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -13968,7 +13968,7 @@ _08105850: _08105856: strh r0, [r4, 0x24] movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x26] @@ -14154,7 +14154,7 @@ sub_810599C: @ 810599C movs r0, 0x2 strh r0, [r4, 0x24] movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x26] @@ -14718,7 +14718,7 @@ _08105E08: str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldrb r1, [r4, 0xA] ldrb r2, [r4, 0xC] adds r0, r5, 0 @@ -14777,7 +14777,7 @@ sub_8105EB0: @ 8105EB0 push {r4-r7,lr} lsls r0, 24 lsrs r7, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 movs r6, 0xF0 cmp r0, 0 @@ -14939,7 +14939,7 @@ sub_8106020: @ 8106020 lsrs r0, 24 adds r6, r0, 0 movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r4, r0, 24 ldr r1, =gTasks @@ -14955,7 +14955,7 @@ sub_8106020: @ 8106020 cmp r0, 0x1 bne _0810607C movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -15004,7 +15004,7 @@ sub_81060B0: @ 81060B0 lsrs r0, 24 adds r6, r0, 0 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r4, r0, 24 ldr r1, =gTasks @@ -15020,7 +15020,7 @@ sub_81060B0: @ 81060B0 cmp r0, 0x1 bne _0810610C movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -15212,7 +15212,7 @@ sub_810624C: @ 810624C ldr r1, =sub_80A64B0 str r1, [r0, 0x1C] ldr r1, =sub_810627C - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r0} bx r0 .pool @@ -15296,7 +15296,7 @@ sub_81062E8: @ 81062E8 movs r1, 0 movs r2, 0 bl lcd_bg_operations - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810632A @@ -15482,7 +15482,7 @@ _08106496: b _081064F0 .pool _081064BC: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _081064D0 @@ -15531,7 +15531,7 @@ sub_81064F8: @ 81064F8 movs r1, 0 movs r2, 0 bl lcd_bg_operations - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810653A @@ -15553,7 +15553,7 @@ _0810653A: bl SetGpuReg mov r0, sp bl sub_80A6B30 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08106578 @@ -15740,7 +15740,7 @@ _081066DA: adds r0, 0x1 strh r0, [r1, 0x20] _081066FC: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08106710 @@ -16593,7 +16593,7 @@ sub_8106D90: @ 8106D90 lsrs r5, 24 ldr r0, =gBattleAnimArgs ldrb r0, [r0] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -17042,7 +17042,7 @@ _08107118: str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -17396,7 +17396,7 @@ sub_8107408: @ 8107408 ldr r1, =sub_80A67D8 str r1, [r0, 0x1C] ldr r1, =sub_8107430 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r0} bx r0 .pool @@ -17410,7 +17410,7 @@ sub_8107430: @ 8107430 ldr r1, =sub_80A64B0 str r1, [r0, 0x1C] ldr r1, =move_anim_8074EE0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r0} bx r0 .pool @@ -17792,7 +17792,7 @@ sub_8107730: @ 8107730 bl sub_80A82E4 lsls r0, 24 lsrs r5, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810778A @@ -17931,7 +17931,7 @@ _08107842: str r0, [r6, 0x1C] ldr r1, =move_anim_8072740 adds r0, r6, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4-r7} pop {r0} bx r0 @@ -17958,7 +17958,7 @@ sub_8107894: @ 8107894 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4} pop {r0} bx r0 @@ -18061,7 +18061,7 @@ sub_8107954: @ 8107954 bl lcd_bg_operations mov r0, sp bl sub_80A6B30 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _081079E0 @@ -18152,7 +18152,7 @@ _08107A32: lsls r0, 5 strh r0, [r7, 0xA] strh r0, [r7, 0xC] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 @@ -18447,7 +18447,7 @@ sub_8107CC4: @ 8107CC4 b _08107D4A .pool _08107D08: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08107D1C @@ -18963,7 +18963,7 @@ sub_81080E4: @ 81080E4 ldr r0, =gTasks adds r4, r0 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x26] @@ -19981,7 +19981,7 @@ sub_81088E4: @ 81088E4 movs r1, 0x1 _08108928: strh r1, [r5, 0x16] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _0810893C @@ -20700,7 +20700,7 @@ sub_8108EC8: @ 8108EC8 strh r0, [r4, 0x36] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r1, =sub_80A634C str r1, [r4, 0x1C] adds r0, r4, 0 @@ -20734,7 +20734,7 @@ sub_8108F08: @ 8108F08 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -21027,7 +21027,7 @@ sub_810916C: @ 810916C ldr r1, =sub_80A6EEC str r1, [r0, 0x1C] ldr r1, =move_anim_8072740 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r0} bx r0 .pool @@ -21276,7 +21276,7 @@ sub_8109364: @ 8109364 strh r0, [r4, 0x32] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A653C str r0, [r4, 0x1C] pop {r4} @@ -21306,7 +21306,7 @@ sub_81093A4: @ 81093A4 str r0, [r4, 0x1C] ldr r1, =sub_81093E4 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4} pop {r0} bx r0 @@ -21389,7 +21389,7 @@ sub_8109460: @ 8109460 ldr r0, =gTasks adds r4, r0 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 movs r5, 0 @@ -22475,7 +22475,7 @@ _08109CC8: movs r1, 0xFF ands r0, r1 strh r0, [r4, 0x30] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08109D64 @@ -22600,12 +22600,12 @@ _08109DE2: adds r0, 0x1 strh r0, [r4, 0x22] movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x24] movs r0, 0x3 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x26] @@ -23230,7 +23230,7 @@ _0810A2D8: strh r0, [r5, 0x34] ldr r1, =move_anim_8074EE0 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A62EC str r0, [r5, 0x1C] pop {r4,r5} @@ -23572,7 +23572,7 @@ _0810A5B6: sub_810A5BC: @ 810A5BC push {r4-r6,lr} adds r6, r0, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810A5D8 @@ -23640,7 +23640,7 @@ _0810A64C: ldr r0, =gAnimationBankAttacker _0810A64E: ldrb r6, [r0] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810A666 @@ -23814,7 +23814,7 @@ _0810A7B6: str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -24339,7 +24339,7 @@ sub_810AB78: @ 810AB78 bl obj_translate_based_on_private_1_2_3_4 ldr r1, =sub_810ACC0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67D8 str r0, [r4, 0x1C] ldrh r0, [r5, 0x1A] @@ -24460,7 +24460,7 @@ _0810ACF6: strh r0, [r5, 0x22] ldr r1, =move_anim_8074EE0 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67BC str r0, [r5, 0x1C] pop {r4,r5} @@ -24503,7 +24503,7 @@ _0810AD4E: strh r0, [r5, 0x26] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67D8 str r0, [r5, 0x1C] pop {r4,r5} @@ -24532,7 +24532,7 @@ sub_810AD98: @ 810AD98 lsrs r0, 24 strh r0, [r5, 0x22] movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x3A] @@ -24641,7 +24641,7 @@ _0810AE8E: b _0810AFC0 _0810AE90: movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 movs r6, 0 @@ -25228,12 +25228,12 @@ _0810B2DC: movs r0, 0xC strh r0, [r5, 0x1E] subs r0, 0x4C - bl sub_80A5178 + bl BattleAnimGetPanControl lsls r0, 24 asrs r0, 24 strh r0, [r5, 0x20] movs r0, 0x3F - bl sub_80A5178 + bl BattleAnimGetPanControl lsls r0, 24 asrs r0, 24 strh r0, [r5, 0x22] @@ -25959,7 +25959,7 @@ sub_810B8AC: @ 810B8AC strh r0, [r4, 0x36] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r1, =sub_80A634C str r1, [r4, 0x1C] adds r0, r4, 0 @@ -26017,7 +26017,7 @@ _0810B936: strh r0, [r4, 0x2E] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A6EEC str r0, [r4, 0x1C] pop {r4} @@ -26070,7 +26070,7 @@ _0810B9B6: _0810B9C6: ldr r1, =sub_810B9E8 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67BC str r0, [r4, 0x1C] pop {r4,r5} @@ -26252,7 +26252,7 @@ _0810BB36: bge _0810BB36 str r6, [r5, 0x1C] adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 add sp, 0x10 pop {r4-r7} pop {r0} @@ -26939,7 +26939,7 @@ sub_810C0A0: @ 810C0A0 movs r1, 0 movs r2, 0 bl lcd_bg_operations - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810C0E2 @@ -27141,7 +27141,7 @@ _0810C27A: adds r0, 0x1 strh r0, [r1, 0x20] _0810C29C: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810C2B0 @@ -27221,7 +27221,7 @@ sub_810C324: @ 810C324 movs r1, 0 movs r2, 0 bl lcd_bg_operations - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810C366 @@ -27413,7 +27413,7 @@ _0810C4EA: adds r0, 0x1 strh r0, [r1, 0x20] _0810C50C: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810C520 @@ -27505,7 +27505,7 @@ _0810C594: cmp r0, 0 bne _0810C5F0 movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId ldr r2, =gSprites lsls r0, 24 lsrs r0, 24 @@ -27596,7 +27596,7 @@ _0810C684: ldrh r1, [r5, 0x3C] orrs r0, r1 strh r0, [r5, 0x3C] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _0810C6B8 @@ -27695,7 +27695,7 @@ _0810C736: ldrh r0, [r4, 0x3C] adds r0, 0x1 strh r0, [r4, 0x3C] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810C78C @@ -27762,7 +27762,7 @@ _0810C7BC: ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810C83A @@ -27839,7 +27839,7 @@ _0810C85A: strh r0, [r4, 0x34] adds r0, 0x4 strh r0, [r4, 0x36] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810C8B4 @@ -28425,7 +28425,7 @@ sub_810CD1C: @ 810CD1C str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 _0810CD3E: pop {r4} pop {r0} @@ -28565,7 +28565,7 @@ unc_080B08A0: @ 810CE2C str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -28612,7 +28612,7 @@ _0810CE90: sub_810CEB4: @ 810CEB4 push {r4,lr} adds r4, r0, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _0810CED0 @@ -28660,7 +28660,7 @@ _0810CF0C: str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -28923,7 +28923,7 @@ _0810D142: str r0, [r4, 0x1C] ldr r1, =sub_810D164 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4} pop {r0} bx r0 @@ -28962,7 +28962,7 @@ sub_810D164: @ 810D164 str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 _0810D1A4: pop {r4-r6} pop {r0} @@ -29082,7 +29082,7 @@ sub_810D278: @ 810D278 str r0, [r4, 0x1C] ldr r1, =sub_810D2B0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -29107,7 +29107,7 @@ sub_810D2B0: @ 810D2B0 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4} pop {r0} bx r0 @@ -29163,7 +29163,7 @@ sub_810D308: @ 810D308 str r0, [r5, 0x1C] ldr r1, =sub_810D360 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 _0810D34C: pop {r4,r5} pop {r0} @@ -29179,7 +29179,7 @@ sub_810D360: @ 810D360 ldr r1, =sub_80A64B0 str r1, [r0, 0x1C] ldr r1, =move_anim_8072740 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r0} bx r0 .pool @@ -29619,7 +29619,7 @@ sub_810D6A8: @ 810D6A8 bl obj_translate_based_on_private_1_2_3_4 ldr r1, =move_anim_8074EE0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A6F98 str r0, [r4, 0x1C] _0810D704: @@ -29842,7 +29842,7 @@ _0810D8BE: ands r0, r2 orrs r0, r1 strb r0, [r5, 0x5] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _0810D8F8 @@ -29895,7 +29895,7 @@ _0810D918: bl obj_translate_based_on_private_1_2_3_4 ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A6F98 str r0, [r5, 0x1C] pop {r4,r5} @@ -30009,7 +30009,7 @@ _0810DA2C: movs r1, 0 bl sub_80A6980 _0810DA34: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _0810DA48 @@ -30032,7 +30032,7 @@ _0810DA5E: str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4} pop {r0} bx r0 @@ -30428,7 +30428,7 @@ _0810DD7C: str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4} pop {r0} bx r0 @@ -30721,7 +30721,7 @@ _0810DFC8: str r0, [r6, 0x1C] ldr r1, =sub_810E028 adds r0, r6, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4-r6} pop {r0} bx r0 @@ -30768,7 +30768,7 @@ sub_810E044: @ 810E044 negs r0, r0 strh r0, [r1, 0x6] _0810E070: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _0810E088 @@ -30843,7 +30843,7 @@ _0810E0FE: str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldrb r1, [r4, 0xA] adds r0, r5, 0 bl SeekSpriteAnim @@ -30867,7 +30867,7 @@ sub_810E13C: @ 810E13C ldr r0, =sub_810E184 str r0, [r4, 0x1C] movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId ldr r2, =gSprites lsls r0, 24 lsrs r0, 24 @@ -31021,7 +31021,7 @@ _0810E274: ble _0810E2BC _0810E296: movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId ldr r2, =gSprites lsls r0, 24 lsrs r0, 24 @@ -31166,7 +31166,7 @@ _0810E354: lsrs r1, 16 cmp r1, 0x7F bhi _0810E44A - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810E3F0 @@ -31458,7 +31458,7 @@ _0810E5B4: ands r0, r1 cmp r0, 0 beq _0810E672 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810E642 @@ -31590,7 +31590,7 @@ _0810E6A8: ands r0, r1 cmp r0, 0 beq _0810E766 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810E736 @@ -31722,7 +31722,7 @@ _0810E79C: ands r0, r1 cmp r0, 0 beq _0810E85A - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810E82A @@ -31863,7 +31863,7 @@ _0810E8A4: ands r0, r1 cmp r0, 0 beq _0810E962 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810E932 @@ -32289,7 +32289,7 @@ _0810EC46: movs r1, 0x1 bl sub_80A69CC movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId ldr r2, =gSprites lsls r0, 24 lsrs r0, 24 @@ -32379,7 +32379,7 @@ _0810ECE0: cmp r0, r1 bge _0810ED1E movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId ldr r2, =gSprites lsls r0, 24 lsrs r0, 24 @@ -32416,7 +32416,7 @@ sub_810ED28: @ 810ED28 ldr r0, =sub_810ED70 str r0, [r4, 0x1C] movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId ldr r2, =gSprites lsls r0, 24 lsrs r0, 24 @@ -32989,7 +32989,7 @@ sub_810F184: @ 810F184 cmp r0, 0 bne _0810F1BC movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 ldr r2, =gSprites @@ -33005,7 +33005,7 @@ sub_810F184: @ 810F184 .pool _0810F1BC: movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 ldr r2, =gSprites @@ -33034,7 +33034,7 @@ sub_810F1EC: @ 810F1EC mov r7, r8 push {r7} adds r5, r0, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 lsrs r0, 24 mov r8, r0 @@ -33365,7 +33365,7 @@ sub_810F46C: @ 810F46C negs r1, r1 cmp r0, r1 bne _0810F512 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810F502 @@ -33436,7 +33436,7 @@ _0810F512: sub_810F524: @ 810F524 push {r4-r6,lr} adds r6, r0, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810F57C @@ -33497,7 +33497,7 @@ sub_810F58C: @ 810F58C bne _0810F5A6 movs r6, 0x1 _0810F5A6: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0810F5EE @@ -33610,7 +33610,7 @@ _0810F692: strh r0, [r5, 0x30] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67D8 str r0, [r5, 0x1C] pop {r4,r5} @@ -33677,7 +33677,7 @@ _0810F6F6: _0810F722: ldr r1, =sub_810F740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67D8 str r0, [r5, 0x1C] pop {r4-r7} @@ -33774,7 +33774,7 @@ sub_810F7D4: @ 810F7D4 ldr r0, =gTasks adds r4, r0 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -33824,7 +33824,7 @@ sub_810F83C: @ 810F83C ldr r0, =gTasks adds r4, r1, r0 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 movs r1, 0 @@ -34294,7 +34294,7 @@ sub_810FBF0: @ 810FBF0 lsls r1, 3 ldr r0, =gTasks adds r5, r1, r0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _0810FC94 @@ -34891,7 +34891,7 @@ _08110094: bl CalcCenterToCornerVec ldr r1, =gBattleAnimArgs ldrb r0, [r1] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r7, 0x22] @@ -35075,7 +35075,7 @@ _08110260: lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _0811028E @@ -35110,7 +35110,7 @@ _081102B8: beq _08110360 movs r0, 0x40 negs r0, r0 - bl sub_80A5178 + bl BattleAnimGetPanControl adds r1, r0, 0 lsls r1, 24 asrs r1, 24 @@ -35192,7 +35192,7 @@ _08110360: sub_8110368: @ 8110368 push {r4-r6,lr} adds r6, r0, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08110394 @@ -35272,7 +35272,7 @@ _081103C4: str r0, [r6, 0x1C] ldr r1, =move_anim_8072740 adds r0, r6, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4-r6} pop {r0} bx r0 @@ -35283,7 +35283,7 @@ _081103C4: sub_8110438: @ 8110438 push {r4-r6,lr} adds r6, r0, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _0811045C @@ -35347,7 +35347,7 @@ _08110478: str r0, [r6, 0x1C] ldr r1, =move_anim_8072740 adds r0, r6, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4-r6} pop {r0} bx r0 @@ -35358,7 +35358,7 @@ _08110478: sub_81104E4: @ 81104E4 push {r4,r5,lr} adds r5, r0, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08110500 @@ -35644,7 +35644,7 @@ sub_8110720: @ 8110720 push {r4-r7,lr} sub sp, 0x4 adds r7, r0, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08110740 @@ -35672,7 +35672,7 @@ _08110740: negs r0, r0 strh r0, [r1, 0x6] _08110762: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _081107B2 @@ -35766,7 +35766,7 @@ _081107B2: str r0, [r7, 0x1C] ldr r1, =move_anim_8072740 adds r0, r7, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 add sp, 0x4 pop {r4-r7} pop {r0} @@ -35962,7 +35962,7 @@ _081109B2: strh r0, [r5, 0x22] ldr r1, =move_anim_8074EE0 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67BC str r0, [r5, 0x1C] pop {r4,r5} @@ -36014,7 +36014,7 @@ _08110A10: strh r0, [r5, 0x38] ldr r1, =sub_8110A70 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r1, =sub_80A6450 str r1, [r5, 0x1C] adds r0, r5, 0 @@ -36044,7 +36044,7 @@ sub_8110A70: @ 8110A70 strh r0, [r4, 0x36] ldr r1, =move_anim_8074EE0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r1, =sub_80A6450 str r1, [r4, 0x1C] adds r0, r4, 0 @@ -36106,7 +36106,7 @@ _08110AEA: str r0, [r5, 0x1C] ldr r1, =move_anim_8074EE0 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -36212,7 +36212,7 @@ sub_8110BCC: @ 8110BCC movs r1, 0 movs r2, 0 bl lcd_bg_operations - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08110C10 @@ -36433,7 +36433,7 @@ _08110DF0: b _08110E3A .pool _08110DFC: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08110E10 @@ -36599,7 +36599,7 @@ sub_8110F30: @ 8110F30 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -36713,13 +36713,13 @@ _0811101E: strh r4, [r6, 0x16] movs r0, 0x40 negs r0, r0 - bl sub_80A5178 + bl BattleAnimGetPanControl adds r4, r0, 0 lsls r4, 24 asrs r4, 8 lsrs r4, 16 movs r0, 0x3F - bl sub_80A5178 + bl BattleAnimGetPanControl lsls r0, 24 strh r4, [r6, 0x22] asrs r0, 24 @@ -36732,7 +36732,7 @@ _0811101E: strh r0, [r6, 0x24] strh r5, [r6, 0xA] movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x26] @@ -37770,7 +37770,7 @@ sub_811188C: @ 811188C movs r0, 0x52 bl SetGpuReg movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -37881,7 +37881,7 @@ sub_811196C: @ 811196C .pool _08111994: movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r1, r0, 24 ldrh r0, [r4, 0x8] @@ -38349,7 +38349,7 @@ _08111D12: lsls r0, 2 adds r0, r4 ldr r1, =SpriteCallbackDummy - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 movs r0, 0x8 ldrsh r1, [r5, r0] lsls r0, r1, 4 @@ -38626,7 +38626,7 @@ _08111F0C: movs r0, 0x10 strh r0, [r5, 0xE] movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -38888,7 +38888,7 @@ _081121AE: movs r0, 0x3 strb r0, [r1, 0x15] movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x24] @@ -39179,7 +39179,7 @@ sub_81123C4: @ 81123C4 lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x8] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08112434 @@ -39600,7 +39600,7 @@ sub_8112758: @ 8112758 lsls r0, 24 cmp r0, 0 bne _081127A0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _081127B8 @@ -39956,7 +39956,7 @@ _08112A5E: str r0, [r3, 0x1C] ldr r1, =sub_8112ACC adds r0, r3, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 b _08112AC4 .pool _08112AC0: @@ -40738,7 +40738,7 @@ _081130BE: strb r0, [r2] ldr r1, =move_anim_8074EE0 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A66DC str r0, [r5, 0x1C] pop {r4,r5} @@ -40818,7 +40818,7 @@ _0811318E: str r0, [r5, 0x1C] ldr r1, =move_anim_8074EE0 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -40865,7 +40865,7 @@ _081131D2: str r0, [r5, 0x1C] ldr r1, =move_anim_8074EE0 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -42121,7 +42121,7 @@ _08113C1E: ldr r0, =0x04000016 str r0, [sp] movs r7, 0x2 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08113CB0 @@ -42142,7 +42142,7 @@ _08113C80: ldr r0, =0x0400001a str r0, [sp] movs r7, 0x4 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08113CB0 @@ -42393,7 +42393,7 @@ _08113EA8: .4byte _08113FF0 .4byte _08114058 _08113EBC: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -42979,7 +42979,7 @@ sub_8114374: @ 8114374 _0811438A: lsls r0, r4, 24 lsrs r0, 24 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF @@ -43143,7 +43143,7 @@ sub_81144BC: @ 81144BC str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4} pop {r0} bx r0 @@ -43185,7 +43185,7 @@ sub_81144F8: @ 81144F8 movs r1, 0 movs r2, 0 bl lcd_bg_operations - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0811455C @@ -43198,7 +43198,7 @@ _0811455C: lsls r0, 24 cmp r0, 0 beq _081145D6 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _081145D6 @@ -43251,7 +43251,7 @@ _0811458C: bl lcd_bg_operations movs r6, 0x1 _081145D6: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08114614 @@ -43295,7 +43295,7 @@ _08114650: lsrs r5, r0, 16 _0811465C: movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -43421,7 +43421,7 @@ _08114776: cmp r0, 0x2 bne _08114824 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 ldr r5, =gSprites @@ -43496,7 +43496,7 @@ _08114824: movs r0, 0x4A adds r1, r4, 0 bl SetGpuReg - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08114856 @@ -43562,7 +43562,7 @@ _081148C4: .4byte _081148FC _081148E4: ldrb r0, [r2] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r2, r0, 24 b _08114902 @@ -43799,7 +43799,7 @@ _08114A9C: str r0, [r6, 0x1C] ldr r1, =move_anim_8072740 adds r0, r6, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4-r6} pop {r0} bx r0 @@ -43861,7 +43861,7 @@ _08114B48: str r0, [r6, 0x1C] ldr r1, =move_anim_8074EE0 adds r0, r6, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r3} mov r8, r3 pop {r4-r7} @@ -44092,7 +44092,7 @@ _08114D28: .4byte _08114E8C _08114D3C: movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x1C] @@ -44272,7 +44272,7 @@ sub_8114EB4: @ 8114EB4 lsls r0, 24 lsrs r5, r0, 24 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 ldr r2, =gSprites @@ -44361,7 +44361,7 @@ sub_8114F54: @ 8114F54 .pool _08114F78: movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x1C] @@ -44438,7 +44438,7 @@ _08115004: .4byte _081150D4 _08115018: movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x1C] @@ -44756,7 +44756,7 @@ _08115262: strh r0, [r6, 0x4] ldr r1, =move_anim_8072740 adds r0, r6, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldrh r0, [r4, 0x4] strh r0, [r6, 0x2E] ldr r0, =sub_80A64B0 @@ -44846,7 +44846,7 @@ _08115370: .pool _08115380: ldrb r0, [r6] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x1A] @@ -45672,7 +45672,7 @@ sub_81159B4: @ 81159B4 strh r2, [r4, 0x38] ldr r1, =move_anim_8074EE0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r1, =sub_80A634C str r1, [r4, 0x1C] adds r0, r4, 0 @@ -46450,7 +46450,7 @@ _08115FF8: cmp r0, 0 beq _08116028 ldr r2, =gSprites - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds add r0, r9 ldrb r1, [r0] lsls r0, r1, 4 @@ -46564,13 +46564,13 @@ _081160F4: ldr r1, =gSpriteCoordOffsetX _081160F6: adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 b _0811610C .pool _08116104: ldr r1, =gSpriteCoordOffsetY adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 _0811610C: movs r0, 0x3A ldrsh r1, [r4, r0] @@ -46909,7 +46909,7 @@ _081163B4: str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -46944,7 +46944,7 @@ _081163FC: str r0, [r5, 0x1C] ldr r1, =sub_810E2C8 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 @@ -46961,7 +46961,7 @@ sub_8116420: @ 8116420 lsls r0, 24 cmp r0, 0 beq _08116444 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08116444 @@ -47033,7 +47033,7 @@ _0811649C: strh r0, [r4, 0x26] ldr r1, =move_anim_8074EE0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67BC str r0, [r4, 0x1C] pop {r4,r5} @@ -47048,7 +47048,7 @@ sub_81164F0: @ 81164F0 adds r4, r0, 0 ldr r5, =gBattleAnimArgs ldrb r0, [r5] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x2E] @@ -47082,7 +47082,7 @@ sub_81164F0: @ 81164F0 bl StartSpriteAffineAnim ldr r1, =move_anim_8074EE0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A67BC str r0, [r4, 0x1C] pop {r4,r5} @@ -47115,7 +47115,7 @@ _08116584: strh r0, [r4, 0x2E] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A64B0 str r0, [r4, 0x1C] pop {r4} @@ -47844,7 +47844,7 @@ sub_8116B14: @ 8116B14 ldrh r1, [r4] movs r0, 0xA bl SetGpuReg - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08116BA2 @@ -47863,7 +47863,7 @@ _08116BA2: lsls r0, 24 cmp r0, 0 beq _08116C26 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08116C26 @@ -47921,7 +47921,7 @@ _08116BD2: bl SetGpuReg movs r7, 0x1 _08116C26: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08116C64 @@ -47965,7 +47965,7 @@ _08116CA0: lsrs r5, r0, 16 _08116CAC: movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -48084,7 +48084,7 @@ sub_8116D64: @ 8116D64 movs r0, 0x4A adds r1, r4, 0 bl SetGpuReg - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08116DF6 @@ -48119,7 +48119,7 @@ _08116DF6: movs r1, 0 bl SetGpuReg movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId ldr r4, =gSprites movs r0, 0x8 ldrsh r1, [r5, r0] @@ -48237,7 +48237,7 @@ _08116F26: movs r1, 0x2 eors r0, r1 strb r0, [r2, 0x1] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08116F56 @@ -48286,7 +48286,7 @@ _08116F5C: movs r1, 0 movs r2, 0 bl lcd_bg_operations - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08116FBA @@ -48354,7 +48354,7 @@ _08116FEC: ldr r0, [r4] strb r5, [r0, 0x2] _08117036: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08117078 @@ -48758,7 +48758,7 @@ _081173B6: movs r0, 0x4A adds r1, r4, 0 bl SetGpuReg - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _081173E6 @@ -49347,7 +49347,7 @@ sub_8117854: @ 8117854 movs r0, 0x2 adds r6, r7, 0 eors r6, r0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _081178B6 @@ -49404,7 +49404,7 @@ _081178BA: movs r1, 0x20 orrs r0, r1 strb r0, [r2] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08117930 @@ -49419,7 +49419,7 @@ _08117930: ldrh r1, [r4] movs r0, 0xA bl SetGpuReg - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08117964 @@ -49687,7 +49687,7 @@ _08117B34: movs r0, 0x4A adds r1, r4, 0 bl SetGpuReg - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _08117BB2 @@ -50037,7 +50037,7 @@ sub_8117E60: @ 8117E60 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -50150,7 +50150,7 @@ sub_8117F60: @ 8117F60 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _08117F78 diff --git a/asm/battle_anim_8170478.s b/asm/battle_anim_8170478.s index 690138efb..c64dd69e5 100644 --- a/asm/battle_anim_8170478.s +++ b/asm/battle_anim_8170478.s @@ -56,7 +56,7 @@ sub_8170478: @ 8170478 movs r1, 0x3 movs r2, 0x1 bl lcd_bg_operations - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r4, r0 ldrb r0, [r4] ldr r1, =gSprites @@ -328,7 +328,7 @@ _08170708: movs r0, 0x4A adds r1, r4, 0 bl SetGpuReg - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _0817076C @@ -373,7 +373,7 @@ _0817076C: movs r1, 0x1 movs r2, 0 bl lcd_bg_operations - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds add r0, r8 ldrb r0, [r0] lsls r1, r0, 4 @@ -434,7 +434,7 @@ sub_8170834: @ 8170834 adds r7, r1, 0 lsls r2, 24 lsrs r2, 24 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r2, r0 ldrb r0, [r2] lsls r5, r0, 4 @@ -561,7 +561,7 @@ sub_817094C: @ 817094C push {r5,r6} lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r0, r1 ldrb r0, [r0] ldr r1, =gSprites @@ -996,7 +996,7 @@ sub_8170CFC: @ 8170CFC adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_02024208 + ldr r0, =gLastUsedItem ldrh r0, [r0] bl ball_number_to_ball_processing_index lsls r0, 24 @@ -1016,7 +1016,7 @@ sub_8170D24: @ 8170D24 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_02024208 + ldr r0, =gLastUsedItem ldrh r0, [r0] bl ball_number_to_ball_processing_index lsls r0, 24 @@ -1136,7 +1136,7 @@ sub_8170E04: @ 8170E04 lsls r0, 24 lsrs r0, 24 mov r10, r0 - ldr r0, =gUnknown_02024208 + ldr r0, =gLastUsedItem ldrh r0, [r0] bl ball_number_to_ball_processing_index adds r1, r0, 0 @@ -1276,7 +1276,7 @@ _08170F50: movs r6, 0x17 movs r5, 0x5 _08170F54: - ldr r0, =gUnknown_02024208 + ldr r0, =gLastUsedItem ldrh r0, [r0] bl ball_number_to_ball_processing_index adds r4, r0, 0 @@ -1530,7 +1530,7 @@ _08171188: strh r0, [r4, 0x38] ldr r0, =sub_81711E8 str r0, [r4, 0x1C] - ldr r0, =gUnknown_02024208 + ldr r0, =gLastUsedItem ldrh r0, [r0] bl ball_number_to_ball_processing_index lsls r0, 24 @@ -2695,7 +2695,7 @@ sub_8171AE4: @ 8171AE4 bl StartSpriteAffineAnim ldr r0, =sub_8171BAC str r0, [r4, 0x1C] - ldr r0, =gUnknown_02024208 + ldr r0, =gLastUsedItem ldrh r0, [r0] bl ball_number_to_ball_processing_index lsls r0, 24 diff --git a/asm/battle_anim_sound_tasks.s b/asm/battle_anim_sound_tasks.s new file mode 100644 index 000000000..698230802 --- /dev/null +++ b/asm/battle_anim_sound_tasks.s @@ -0,0 +1,1006 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8158B30 +sub_8158B30: @ 8158B30 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gTasks + lsls r6, r0, 2 + adds r6, r0 + lsls r6, 3 + adds r6, r1 + ldr r1, =gBattleAnimArgs + ldrh r0, [r1] + strh r0, [r6, 0x8] + ldrh r0, [r1, 0x2] + strh r0, [r6, 0xA] + movs r0, 0x40 + negs r0, r0 + bl BattleAnimGetPanControl + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x3F + bl BattleAnimGetPanControl + adds r5, r0, 0 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_80A5314 + strh r4, [r6, 0xC] + strh r5, [r6, 0xE] + lsls r0, 24 + asrs r0, 24 + strh r0, [r6, 0x10] + movs r0, 0xA + strh r0, [r6, 0x1C] + ldr r0, =sub_8158B98 + str r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158B30 + + thumb_func_start sub_8158B98 +sub_8158B98: @ 8158B98 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r5, [r4, 0xC] + ldrb r6, [r4, 0x10] + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6F + bne _08158BD0 + movs r0, 0x5 + strh r0, [r4, 0x1C] + strh r1, [r4, 0x1E] + ldr r0, =sub_8158C04 + str r0, [r4] + b _08158BFE + .pool +_08158BD0: + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _08158BEA + strh r1, [r4, 0x1C] + ldrh r0, [r4, 0x8] + lsls r1, r5, 24 + asrs r1, 24 + bl PlaySE12WithPanning +_08158BEA: + lsls r1, r6, 24 + asrs r1, 24 + lsls r0, r5, 16 + asrs r0, 16 + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + bl sub_80A52EC + strh r0, [r4, 0xC] +_08158BFE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8158B98 + + thumb_func_start sub_8158C04 +sub_8158C04: @ 8158C04 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _08158C4C + movs r0, 0 + strh r0, [r4, 0x1C] + movs r0, 0x3F + bl BattleAnimGetPanControl + adds r1, r0, 0 + ldrh r0, [r4, 0xA] + lsls r1, 24 + asrs r1, 24 + bl PlaySE12WithPanning + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _08158C4C + adds r0, r5, 0 + bl move_anim_related_task_del +_08158C4C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158C04 + + thumb_func_start mas_80DCF38 +mas_80DCF38: @ 8158C58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =gBattleAnimArgs + ldrh r1, [r0] + str r1, [sp] + ldrb r5, [r0, 0x4] + ldrb r6, [r0, 0x6] + ldrb r3, [r0, 0x8] + mov r10, r3 + ldrb r7, [r0, 0xA] + ldrb r1, [r0, 0xC] + mov r9, r1 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + bl BattleAnimGetPanControl + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + asrs r5, 24 + adds r0, r5, 0 + bl BattleAnimGetPanControl + adds r5, r0, 0 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_80A5314 + ldr r2, =gTasks + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + mov r6, sp + ldrh r6, [r6] + strh r6, [r1, 0x8] + strh r4, [r1, 0xA] + strh r5, [r1, 0xC] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0xE] + mov r0, r10 + strh r0, [r1, 0x10] + strh r7, [r1, 0x12] + mov r3, r9 + strh r3, [r1, 0x14] + strh r2, [r1, 0x1C] + strh r4, [r1, 0x1E] + strh r3, [r1, 0x20] + ldr r2, =sub_8158D08 + str r2, [r1] + mov r0, r8 + bl _call_via_r2 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end mas_80DCF38 + + thumb_func_start sub_8158D08 +sub_8158D08: @ 8158D08 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x20] + adds r1, r0, 0x1 + strh r1, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x14 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08158D50 + movs r0, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x8] + movs r1, 0x1E + ldrsb r1, [r4, r1] + bl PlaySE12WithPanning + ldrh r0, [r4, 0x10] + subs r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bne _08158D50 + adds r0, r5, 0 + bl move_anim_related_task_del + b _08158D82 + .pool +_08158D50: + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x12 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08158D82 + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r0, [r4, 0xE] + ldrh r1, [r4, 0x1E] + adds r0, r1 + strh r0, [r4, 0x1E] + movs r2, 0x1E + ldrsh r0, [r4, r2] + bl sub_80A52EC + strh r0, [r4, 0x1E] +_08158D82: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158D08 + + thumb_func_start sub_8158D8C +sub_8158D8C: @ 8158D8C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + movs r0, 0x40 + negs r0, r0 + bl BattleAnimGetPanControl + lsls r0, 24 + lsrs r6, r0, 24 + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _08158DD0 + ldr r0, =gBattleAnimArgs + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08158DC8 + ldr r0, =gUnknown_02039F34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r4, [r0] + b _08158E76 + .pool +_08158DC8: + adds r0, r5, 0 + bl move_anim_task_del + b _08158E76 +_08158DD0: + ldr r0, =gBattleAnimArgs + movs r2, 0 + ldrsh r1, [r0, r2] + adds r2, r0, 0 + cmp r1, 0 + bne _08158DEC + ldr r0, =gAnimationBankAttacker + ldrb r4, [r0] + b _08158E12 + .pool +_08158DEC: + cmp r1, 0x1 + bne _08158DFC + ldr r0, =gAnimationBankTarget + ldrb r4, [r0] + b _08158E12 + .pool +_08158DFC: + cmp r1, 0x2 + bne _08158E08 + ldr r0, =gAnimationBankAttacker + b _08158E0A + .pool +_08158E08: + ldr r0, =gAnimationBankTarget +_08158E0A: + ldrb r1, [r0] + movs r0, 0x2 + adds r4, r0, 0 + eors r4, r1 +_08158E12: + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _08158E1E + cmp r0, 0x3 + bne _08158E38 +_08158E1E: + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _08158E38 + adds r0, r5, 0 + bl move_anim_task_del + b _08158E8C + .pool +_08158E38: + adds r0, r4, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _08158E5C + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty + b _08158E6A + .pool +_08158E5C: + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty +_08158E6A: + adds r0, r1 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 +_08158E76: + cmp r4, 0 + beq _08158E86 + lsls r1, r6, 24 + asrs r1, 24 + adds r0, r4, 0 + movs r2, 0x3 + bl PlayCry3 +_08158E86: + adds r0, r5, 0 + bl move_anim_task_del +_08158E8C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158D8C + + thumb_func_start sub_8158E9C +sub_8158E9C: @ 8158E9C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + movs r0, 0x40 + negs r0, r0 + bl BattleAnimGetPanControl + lsls r0, 24 + lsrs r5, r0, 24 + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _08158EE0 + ldr r0, =gBattleAnimArgs + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08158ED8 + ldr r0, =gUnknown_02039F34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r4, [r0] + b _08158F86 + .pool +_08158ED8: + adds r0, r6, 0 + bl move_anim_task_del + b _08158F86 +_08158EE0: + ldr r0, =gBattleAnimArgs + movs r2, 0 + ldrsh r1, [r0, r2] + adds r2, r0, 0 + cmp r1, 0 + bne _08158EFC + ldr r0, =gAnimationBankAttacker + ldrb r4, [r0] + b _08158F22 + .pool +_08158EFC: + cmp r1, 0x1 + bne _08158F0C + ldr r0, =gAnimationBankTarget + ldrb r4, [r0] + b _08158F22 + .pool +_08158F0C: + cmp r1, 0x2 + bne _08158F18 + ldr r0, =gAnimationBankAttacker + b _08158F1A + .pool +_08158F18: + ldr r0, =gAnimationBankTarget +_08158F1A: + ldrb r1, [r0] + movs r0, 0x2 + adds r4, r0, 0 + eors r4, r1 +_08158F22: + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _08158F2E + cmp r0, 0x3 + bne _08158F48 +_08158F2E: + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _08158F48 + adds r0, r6, 0 + bl move_anim_task_del + b _08158FEE + .pool +_08158F48: + adds r0, r4, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _08158F6C + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty + b _08158F7A + .pool +_08158F6C: + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty +_08158F7A: + adds r0, r1 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 +_08158F86: + ldr r1, =gTasks + lsls r2, r6, 2 + adds r0, r2, r6 + lsls r0, 3 + adds r0, r1 + ldr r3, =gBattleAnimArgs + ldrh r1, [r3, 0x2] + strh r1, [r0, 0x8] + strh r4, [r0, 0xA] + lsls r1, r5, 24 + asrs r1, 24 + strh r1, [r0, 0xC] + adds r5, r2, 0 + cmp r4, 0 + beq _08158FE8 + movs r2, 0x2 + ldrsh r0, [r3, r2] + cmp r0, 0xFF + bne _08158FC8 + adds r0, r4, 0 + movs r2, 0x9 + bl PlayCry3 + b _08158FD0 + .pool +_08158FC8: + adds r0, r4, 0 + movs r2, 0x7 + bl PlayCry3 +_08158FD0: + ldr r0, =gTasks + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8158FF4 + str r0, [r1] + b _08158FEE + .pool +_08158FE8: + adds r0, r6, 0 + bl move_anim_task_del +_08158FEE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8158E9C + + thumb_func_start sub_8158FF4 +sub_8158FF4: @ 8158FF4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + mov r9, r4 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r6, [r1, 0xA] + mov r8, r6 + ldrb r5, [r1, 0xC] + adds r7, r5, 0 + ldrh r2, [r1, 0x1A] + movs r3, 0x1A + ldrsh r0, [r1, r3] + cmp r0, 0x1 + bgt _08159028 + adds r0, r2, 0x1 + strh r0, [r1, 0x1A] + b _0815906A + .pool +_08159028: + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0xFF + bne _0815904E + bl IsCryPlaying + lsls r0, 24 + cmp r0, 0 + bne _0815906A + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0xA + bl PlayCry3 + adds r0, r4, 0 + bl move_anim_task_del + b _0815906A +_0815904E: + bl IsCryPlaying + lsls r0, 24 + cmp r0, 0 + bne _0815906A + lsls r1, r7, 24 + asrs r1, 24 + mov r0, r8 + movs r2, 0x8 + bl PlayCry3 + mov r0, r9 + bl move_anim_task_del +_0815906A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8158FF4 + + thumb_func_start sub_8159078 +sub_8159078: @ 8159078 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x1A] + movs r3, 0x1A + ldrsh r0, [r1, r3] + cmp r0, 0x1 + bgt _081590A0 + adds r0, r2, 0x1 + strh r0, [r1, 0x1A] + b _081590B0 + .pool +_081590A0: + bl IsCryPlaying + lsls r0, 24 + cmp r0, 0 + bne _081590B0 + adds r0, r4, 0 + bl move_anim_task_del +_081590B0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8159078 + + thumb_func_start sub_81590B8 +sub_81590B8: @ 81590B8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =gBattleAnimArgs + ldrh r1, [r1] + strh r1, [r0, 0x1C] + movs r0, 0x40 + negs r0, r0 + bl BattleAnimGetPanControl + lsls r0, 24 + lsrs r5, r0, 24 + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _081590F8 + ldr r0, =gUnknown_02039F34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + b _08159102 + .pool +_081590F8: + ldr r1, =gUnknown_02038438 + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 +_08159102: + ldrh r2, [r0] + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + strh r2, [r1, 0xA] + lsls r0, r5, 24 + asrs r0, 24 + strh r0, [r1, 0xC] + cmp r2, 0 + beq _08159130 + ldr r0, =sub_815913C + str r0, [r1] + b _08159136 + .pool +_08159130: + adds r0, r4, 0 + bl move_anim_task_del +_08159136: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81590B8 + + thumb_func_start sub_815913C +sub_815913C: @ 815913C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r6, [r0, 0xA] + mov r8, r6 + ldrb r3, [r0, 0xC] + adds r5, r3, 0 + movs r7, 0x1A + ldrsh r2, [r0, r7] + mov r12, r1 + cmp r2, 0x5 + bhi _081591DC + lsls r0, r2, 2 + ldr r1, =_08159174 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08159174: + .4byte _081591C2 + .4byte _081591A8 + .4byte _0815918C + .4byte _081591A8 + .4byte _081591A8 + .4byte _081591B8 +_0815918C: + lsls r1, r5, 24 + asrs r1, 24 + mov r0, r8 + movs r2, 0x4 + bl PlayCry6 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + b _081591B0 + .pool +_081591A8: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r12 +_081591B0: + ldrh r1, [r0, 0x1A] + adds r1, 0x1 + strh r1, [r0, 0x1A] + b _08159204 +_081591B8: + bl IsCryPlaying + lsls r0, 24 + cmp r0, 0 + bne _08159204 +_081591C2: + bl StopCryAndClearCrySongs + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1A] + adds r0, 0x1 + strh r0, [r1, 0x1A] + b _08159204 + .pool +_081591DC: + movs r1, 0x1C + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081591F2 + lsls r1, r3, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0x6 + bl PlayCry6 + b _081591FE +_081591F2: + lsls r1, r5, 24 + asrs r1, 24 + mov r0, r8 + movs r2, 0x6 + bl PlayCry3 +_081591FE: + adds r0, r4, 0 + bl move_anim_task_del +_08159204: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815913C + + thumb_func_start sub_8159210 +sub_8159210: @ 8159210 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gBattleAnimArgs + ldrh r5, [r0] + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + bl BattleAnimGetPanControl + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl PlaySE1WithPanning + adds r0, r4, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159210 + + thumb_func_start sub_8159244 +sub_8159244: @ 8159244 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gBattleAnimArgs + ldrh r5, [r0] + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + bl BattleAnimGetPanControl + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl PlaySE2WithPanning + adds r0, r4, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159244 + + thumb_func_start sub_8159278 +sub_8159278: @ 8159278 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =gBattleAnimArgs + ldrb r5, [r0, 0x2] + ldrb r6, [r0, 0x4] + ldrh r1, [r0, 0x6] + mov r9, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl BattleAnimGetPanControl + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + asrs r5, 24 + adds r0, r5, 0 + bl BattleAnimGetPanControl + adds r5, r0, 0 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_80A5314 + ldr r2, =gTasks + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r4, [r1, 0xA] + strh r5, [r1, 0xC] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0xE] + mov r0, r9 + strh r0, [r1, 0x12] + strh r2, [r1, 0x1C] + strh r4, [r1, 0x1E] + ldr r2, =sub_8159308 + str r2, [r1] + mov r0, r8 + bl _call_via_r2 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159278 + + thumb_func_start sub_8159308 +sub_8159308: @ 8159308 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r2, [r4, 0xE] + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x12 + ldrsh r1, [r4, r3] + cmp r0, r1 + bne _08159342 + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + adds r0, r2, r1 + strh r0, [r4, 0x1E] + movs r2, 0x1E + ldrsh r0, [r4, r2] + bl sub_80A52EC + strh r0, [r4, 0x1E] +_08159342: + ldr r1, =gUnknown_02038440 + ldrh r0, [r4, 0x1E] + strb r0, [r1] + movs r3, 0x1E + ldrsh r1, [r4, r3] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0815935A + adds r0, r5, 0 + bl move_anim_task_del +_0815935A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159308 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_controller_linkopponent.s b/asm/battle_controller_linkopponent.s index bfeafd0f4..e07ec2dbb 100644 --- a/asm/battle_controller_linkopponent.s +++ b/asm/battle_controller_linkopponent.s @@ -18,14 +18,14 @@ SetBankFuncToLinkOpponentBufferRunCommand: @ 8064394 ldrb r0, [r0] lsls r0, 2 adds r0, r1 - ldr r1, =sub_80643B0 + ldr r1, =LinkOpponentBufferRunCommand str r1, [r0] bx lr .pool thumb_func_end SetBankFuncToLinkOpponentBufferRunCommand - thumb_func_start sub_80643B0 -sub_80643B0: @ 80643B0 + thumb_func_start LinkOpponentBufferRunCommand +LinkOpponentBufferRunCommand: @ 80643B0 push {lr} ldr r2, =gBattleExecBuffer ldr r1, =gBitTable @@ -44,7 +44,7 @@ sub_80643B0: @ 80643B0 ldrb r0, [r1] cmp r0, 0x38 bhi _080643F8 - ldr r0, =gUnknown_0831C7B4 + ldr r0, =gLinkOpponentBufferCommands ldrb r1, [r1] lsls r1, 2 adds r1, r0 @@ -53,11 +53,11 @@ sub_80643B0: @ 80643B0 b _080643FC .pool _080643F8: - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _080643FC: pop {r0} bx r0 - thumb_func_end sub_80643B0 + thumb_func_end LinkOpponentBufferRunCommand thumb_func_start sub_8064400 sub_8064400: @ 8064400 @@ -77,7 +77,7 @@ sub_8064400: @ 8064400 ldr r0, =SpriteCallbackDummy cmp r1, r0 bne _08064424 - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _08064424: pop {r0} bx r0 @@ -102,7 +102,7 @@ sub_8064438: @ 8064438 ldr r0, =SpriteCallbackDummy cmp r1, r0 bne _0806445C - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _0806445C: pop {r0} bx r0 @@ -147,7 +147,7 @@ sub_8064470: @ 8064470 lsls r0, 2 adds r0, r5 bl DestroySprite - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _080644C2: pop {r4-r6} pop {r0} @@ -183,7 +183,7 @@ sub_80644D8: @ 80644D8 adds r0, r2 movs r1, 0 strb r1, [r0, 0x9] - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _08064510: pop {r4} pop {r0} @@ -215,7 +215,7 @@ sub_8064520: @ 8064520 beq _08064584 _0806454C: ldr r2, =gSprites - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldr r3, =gActiveBank ldrb r0, [r3] adds r0, r1 @@ -234,7 +234,7 @@ _0806454C: .pool _08064584: ldr r3, =gSprites - ldr r6, =gUnknown_03005D70 + ldr r6, =gHealthBoxesIds ldr r2, =gActiveBank ldrb r4, [r2] adds r0, r4, r6 @@ -541,7 +541,7 @@ _080647B4: ands r0, r1 cmp r0, 0 bne _0806484A - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds mov r1, r9 ldrb r0, [r1] adds r1, r7, 0 @@ -569,7 +569,7 @@ _080647B4: ldrb r0, [r0] bl sub_80729D0 _0806484A: - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds ldr r4, =gActiveBank ldrb r1, [r4] adds r0, r1, r5 @@ -949,7 +949,7 @@ _08064B7C: bl FreeSpriteTilesByTag adds r0, r4, 0 bl FreeSpritePaletteByTag - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _08064BB6: pop {r4-r7} pop {r0} @@ -962,7 +962,7 @@ sub_8064BC0: @ 8064BC0 push {r4-r6,lr} ldr r6, =gActiveBank ldrb r0, [r6] - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds adds r1, r0, r5 ldrb r1, [r1] movs r2, 0 @@ -989,7 +989,7 @@ sub_8064BC0: @ 8064BC0 b _08064C0C .pool _08064C08: - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _08064C0C: pop {r4-r6} pop {r0} @@ -1014,11 +1014,11 @@ sub_8064C14: @ 8064C14 lsls r0, 31 cmp r0, 0 bne _08064C42 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r3, r0 ldrb r0, [r0] bl sub_8072984 - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _08064C42: pop {r0} bx r0 @@ -1061,12 +1061,12 @@ sub_8064C58: @ 8064C58 bl DestroySprite ldrb r0, [r6] bl sub_805EEE0 - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] bl sub_8072984 - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _08064CB2: pop {r4-r6} pop {r0} @@ -1082,7 +1082,7 @@ sub_8064CCC: @ 8064CCC lsls r0, 16 cmp r0, 0 bne _08064CDE - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _08064CDE: pop {r0} bx r0 @@ -1116,7 +1116,7 @@ sub_8064CE4: @ 8064CE4 strb r0, [r2] ldr r0, =gDoingBattleAnim strb r3, [r0] - bl sub_8065068 + bl LinkOpponentBufferExecCompleted b _08064D5A .pool _08064D30: @@ -1152,7 +1152,7 @@ _08064D5A: sub_8064D60: @ 8064D60 push {r4,lr} ldr r2, =gSprites - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldr r4, =gActiveBank ldrb r3, [r4] adds r0, r3, r0 @@ -1239,7 +1239,7 @@ _08064E1A: movs r2, 0x80 lsls r2, 1 bl m4aMPlayVolumeControl - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _08064E2A: pop {r4} pop {r0} @@ -1308,7 +1308,7 @@ sub_8064E50: @ 8064E50 adds r0, r7 movs r1, 0 bl StartSpriteAnim - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds ldrb r1, [r5] adds r0, r1, r4 ldrb r0, [r0] @@ -1444,7 +1444,7 @@ sub_8065008: @ 8065008 ands r0, r1 cmp r0, 0 bne _0806502A - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _0806502A: pop {r0} bx r0 @@ -1468,15 +1468,15 @@ sub_8065038: @ 8065038 ands r0, r1 cmp r0, 0 bne _0806505A - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _0806505A: pop {r0} bx r0 .pool thumb_func_end sub_8065038 - thumb_func_start sub_8065068 -sub_8065068: @ 8065068 + thumb_func_start LinkOpponentBufferExecCompleted +LinkOpponentBufferExecCompleted: @ 8065068 push {r4,lr} sub sp, 0x4 ldr r1, =gBattleBankFunc @@ -1484,7 +1484,7 @@ sub_8065068: @ 8065068 ldrb r0, [r4] lsls r0, 2 adds r0, r1 - ldr r1, =sub_80643B0 + ldr r1, =LinkOpponentBufferRunCommand str r1, [r0] ldr r0, =gBattleTypeFlags ldr r0, [r0] @@ -1492,7 +1492,7 @@ sub_8065068: @ 8065068 ands r0, r1 cmp r0, 0 beq _080650BC - bl link_get_multiplayer_id + bl GetMultiplayerId mov r1, sp strb r0, [r1] movs r0, 0x2 @@ -1523,7 +1523,7 @@ _080650CE: pop {r0} bx r0 .pool - thumb_func_end sub_8065068 + thumb_func_end LinkOpponentBufferExecCompleted thumb_func_start dp01t_00_2_getattr dp01t_00_2_getattr: @ 80650E0 @@ -1573,7 +1573,7 @@ _0806513A: movs r0, 0x1 mov r2, sp bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl sub_8065068 + bl LinkOpponentBufferExecCompleted add sp, 0x100 pop {r4-r6} pop {r0} @@ -2461,7 +2461,7 @@ _080658EA: thumb_func_start sub_8065900 sub_8065900: @ 8065900 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8065900 @@ -2503,7 +2503,7 @@ _0806594E: cmp r5, 0x5 bls _08065940 _0806595A: - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r4,r5} pop {r0} bx r0 @@ -2522,7 +2522,7 @@ sub_8065964: @ 8065964 ldr r3, =gActiveBank ldrb r0, [r3] lsls r0, 9 - ldr r2, =gUnknown_02023067 + ldr r2, =gBattleBufferA + 3 adds r4, r0, r2 adds r7, r4, 0 subs r1, r2, 0x2 @@ -3542,7 +3542,7 @@ _080662BA: cmp r3, r0 bcc _080662BA _080662DC: - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r4-r7} pop {r0} bx r0 @@ -3943,12 +3943,12 @@ _0806666C: bl DestroySprite ldrb r0, [r6] bl sub_805EEE0 - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] bl sub_8072984 - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _080666A8: pop {r4-r6} pop {r0} @@ -4057,11 +4057,11 @@ _08066770: ldrb r0, [r5] cmp r0, 0x1 bne _08066794 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A b _08066796 .pool _08066794: - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B _08066796: ldrh r0, [r0] bl sub_8162AA0 @@ -4072,7 +4072,7 @@ _08066796: _080667A8: ldrb r0, [r5] bl sub_806D864 - ldr r6, =gUnknown_020229E8 + ldr r6, =gLinkPlayers lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -4143,7 +4143,7 @@ _08066838: b _0806693A _08066840: movs r7, 0xB0 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] movs r0, 0xC0 lsls r0, 4 @@ -4153,8 +4153,8 @@ _08066840: b _08066948 .pool _08066858: - bl link_get_multiplayer_id - ldr r6, =gUnknown_020229E8 + bl GetMultiplayerId + ldr r6, =gLinkPlayers movs r5, 0x1 eors r0, r5 lsls r0, 24 @@ -4167,7 +4167,7 @@ _08066858: ldrb r0, [r1] cmp r0, 0x4 beq _08066892 - bl link_get_multiplayer_id + bl GetMultiplayerId eors r0, r5 lsls r0, 24 lsrs r0, 24 @@ -4181,7 +4181,7 @@ _08066858: cmp r0, 0x5 bne _080668C8 _08066892: - bl link_get_multiplayer_id + bl GetMultiplayerId eors r0, r5 lsls r0, 24 lsrs r0, 24 @@ -4205,7 +4205,7 @@ _080668BC: b _0806694C .pool _080668C8: - bl link_get_multiplayer_id + bl GetMultiplayerId eors r0, r5 lsls r0, 24 lsrs r0, 24 @@ -4218,7 +4218,7 @@ _080668C8: ands r0, r1 cmp r0, 0x2 beq _080668FE - bl link_get_multiplayer_id + bl GetMultiplayerId eors r0, r5 lsls r0, 24 lsrs r0, 24 @@ -4231,7 +4231,7 @@ _080668C8: cmp r4, 0x1 bne _08066930 _080668FE: - bl link_get_multiplayer_id + bl GetMultiplayerId eors r0, r5 lsls r0, 24 lsrs r0, 24 @@ -4255,7 +4255,7 @@ _08066924: b _0806694C .pool _08066930: - bl link_get_multiplayer_id + bl GetMultiplayerId eors r0, r5 lsls r0, 24 lsrs r0, 24 @@ -4389,11 +4389,11 @@ sub_8066A58: @ 8066A58 ldrb r0, [r0] cmp r0, 0x1 bne _08066A74 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A b _08066A76 .pool _08066A74: - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B _08066A76: ldrh r0, [r0] bl sub_8162AA0 @@ -4503,7 +4503,7 @@ _08066A76: adds r0, r1 ldr r1, =sub_8064438 str r1, [r0] - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r3} mov r8, r3 pop {r4-r6} @@ -4573,7 +4573,7 @@ sub_8066B94: @ 8066B94 lsls r0, 2 adds r0, r5 ldr r1, =SpriteCallbackDummy - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r1, =gBattleBankFunc ldrb r0, [r4] lsls r0, 2 @@ -4666,7 +4666,7 @@ _08066CD0: thumb_func_start sub_8066CEC sub_8066CEC: @ 8066CEC push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8066CEC @@ -4674,7 +4674,7 @@ sub_8066CEC: @ 8066CEC thumb_func_start sub_8066CF8 sub_8066CF8: @ 8066CF8 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8066CF8 @@ -4682,7 +4682,7 @@ sub_8066CF8: @ 8066CF8 thumb_func_start sub_8066D04 sub_8066D04: @ 8066D04 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8066D04 @@ -4690,7 +4690,7 @@ sub_8066D04: @ 8066D04 thumb_func_start sub_8066D10 sub_8066D10: @ 8066D10 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8066D10 @@ -4812,7 +4812,7 @@ _08066D32: lsrs r3, r0, 24 cmp r3, 0 beq _08066E30 - bl sub_8065068 + bl LinkOpponentBufferExecCompleted b _08066E58 .pool _08066E30: @@ -5017,7 +5017,7 @@ _08066FA8: lsls r0, 2 adds r0, r2 strb r4, [r0, 0x4] - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _08066FE4: pop {r3-r5} mov r8, r3 @@ -5039,11 +5039,11 @@ sub_8066FF4: @ 8066FF4 ldr r5, =gActiveBank ldrb r4, [r5] lsls r4, 9 - ldr r0, =gUnknown_02023066 + ldr r0, =gBattleBufferA + 2 adds r4, r0 ldrh r0, [r4] - bl battle_pick_message - ldr r0, =gUnknown_02022E2C + bl BufferStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r1, =gBattleBankFunc @@ -5063,7 +5063,7 @@ sub_8066FF4: @ 8066FF4 thumb_func_start sub_806704C sub_806704C: @ 806704C push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_806704C @@ -5071,7 +5071,7 @@ sub_806704C: @ 806704C thumb_func_start sub_8067058 sub_8067058: @ 8067058 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8067058 @@ -5079,7 +5079,7 @@ sub_8067058: @ 8067058 thumb_func_start sub_8067064 sub_8067064: @ 8067064 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8067064 @@ -5087,7 +5087,7 @@ sub_8067064: @ 8067064 thumb_func_start sub_8067070 sub_8067070: @ 8067070 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8067070 @@ -5095,7 +5095,7 @@ sub_8067070: @ 8067070 thumb_func_start sub_806707C sub_806707C: @ 806707C push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_806707C @@ -5103,7 +5103,7 @@ sub_806707C: @ 806707C thumb_func_start sub_8067088 sub_8067088: @ 8067088 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8067088 @@ -5111,7 +5111,7 @@ sub_8067088: @ 8067088 thumb_func_start sub_8067094 sub_8067094: @ 8067094 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8067094 @@ -5166,7 +5166,7 @@ sub_80670A0: @ 80670A0 adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] @@ -5188,7 +5188,7 @@ _08067130: adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] @@ -5215,7 +5215,7 @@ _0806715A: thumb_func_start sub_8067190 sub_8067190: @ 8067190 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8067190 @@ -5229,7 +5229,7 @@ sub_806719C: @ 806719C lsls r0, 24 cmp r0, 0 bne _080671F0 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] @@ -5319,7 +5319,7 @@ _08067264: thumb_func_start sub_806727C sub_806727C: @ 806727C push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_806727C @@ -5327,7 +5327,7 @@ sub_806727C: @ 806727C thumb_func_start sub_8067288 sub_8067288: @ 8067288 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8067288 @@ -5335,7 +5335,7 @@ sub_8067288: @ 8067288 thumb_func_start sub_8067294 sub_8067294: @ 8067294 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8067294 @@ -5343,7 +5343,7 @@ sub_8067294: @ 8067294 thumb_func_start sub_80672A0 sub_80672A0: @ 80672A0 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80672A0 @@ -5351,7 +5351,7 @@ sub_80672A0: @ 80672A0 thumb_func_start sub_80672AC sub_80672AC: @ 80672AC push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80672AC @@ -5359,7 +5359,7 @@ sub_80672AC: @ 80672AC thumb_func_start sub_80672B8 sub_80672B8: @ 80672B8 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80672B8 @@ -5367,7 +5367,7 @@ sub_80672B8: @ 80672B8 thumb_func_start sub_80672C4 sub_80672C4: @ 80672C4 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80672C4 @@ -5375,7 +5375,7 @@ sub_80672C4: @ 80672C4 thumb_func_start sub_80672D0 sub_80672D0: @ 80672D0 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80672D0 @@ -5383,7 +5383,7 @@ sub_80672D0: @ 80672D0 thumb_func_start sub_80672DC sub_80672DC: @ 80672DC push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80672DC @@ -5397,7 +5397,7 @@ sub_80672E8: @ 80672E8 negs r0, r0 ands r0, r1 strb r0, [r2] - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -5422,7 +5422,7 @@ sub_8067304: @ 8067304 ands r0, r2 orrs r0, r1 strb r0, [r3] - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -5436,7 +5436,7 @@ sub_806733C: @ 806733C movs r0, 0x7F ands r0, r1 strb r0, [r2] - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -5457,7 +5457,7 @@ sub_8067354: @ 8067354 ands r0, r2 orrs r0, r1 strb r0, [r3] - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -5481,7 +5481,7 @@ sub_806737C: @ 806737C lsls r0, 29 cmp r0, 0 bge _080673B0 - bl sub_8065068 + bl LinkOpponentBufferExecCompleted b _080673DA .pool _080673B0: @@ -5515,7 +5515,7 @@ _080673DA: thumb_func_start sub_80673EC sub_80673EC: @ 80673EC push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80673EC @@ -5546,7 +5546,7 @@ _0806740C: lsls r1, r3, 24 asrs r1, 24 bl PlaySE12WithPanning - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r4} pop {r0} bx r0 @@ -5590,7 +5590,7 @@ _08067478: orrs r0, r1 bl PlayFanfare _0806748C: - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r4,r5} pop {r0} bx r0 @@ -5616,7 +5616,7 @@ sub_8067498: @ 8067498 movs r1, 0x19 movs r2, 0x5 bl PlayCry3 - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -5638,7 +5638,7 @@ sub_80674D4: @ 80674D4 movs r1, 0x1 orrs r0, r1 strh r0, [r2] - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -5705,7 +5705,7 @@ sub_8067508: @ 8067508 lsls r0, 2 adds r0, r4 ldr r1, =sub_80676FC - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =c3_08038DC4 movs r1, 0x5 bl CreateTask @@ -5889,7 +5889,7 @@ sub_8067718: @ 8067718 lsls r0, 24 cmp r0, 0 bne _08067748 - bl sub_8065068 + bl LinkOpponentBufferExecCompleted b _08067812 .pool _08067748: @@ -5946,7 +5946,7 @@ _080677B4: adds r5, r7, 0 ldrb r0, [r5] lsls r3, r0, 9 - ldr r4, =gUnknown_02023068 + ldr r4, =gBattleBufferA + 4 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 @@ -6025,7 +6025,7 @@ sub_806782C: @ 806782C adds r0, r2 movs r1, 0 strb r1, [r0, 0x5] - bl sub_8065068 + bl LinkOpponentBufferExecCompleted _08067864: pop {r4} pop {r0} @@ -6061,7 +6061,7 @@ sub_8067874: @ 8067874 ldr r1, =sub_8073C30 str r1, [r0] _080678A6: - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -6070,7 +6070,7 @@ _080678A6: thumb_func_start sub_80678C4 sub_80678C4: @ 80678C4 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80678C4 @@ -6111,7 +6111,7 @@ sub_80678D0: @ 80678D0 ldrb r0, [r4] bl sub_805E408 _08067916: - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r4} pop {r0} bx r0 @@ -6150,7 +6150,7 @@ sub_8067930: @ 8067930 lsls r0, 24 cmp r0, 0 beq _08067980 - bl sub_8065068 + bl LinkOpponentBufferExecCompleted b _0806798C .pool _08067980: @@ -6177,10 +6177,10 @@ sub_80679A4: @ 80679A4 ldr r0, =gActiveBank ldrb r0, [r0] lsls r0, 9 - ldr r1, =gUnknown_02023066 + ldr r1, =gBattleBufferA + 2 adds r0, r1 bl sub_81851A8 - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -6189,7 +6189,7 @@ sub_80679A4: @ 80679A4 thumb_func_start sub_80679C4 sub_80679C4: @ 80679C4 push {lr} - bl sub_8065068 + bl LinkOpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80679C4 @@ -6200,7 +6200,7 @@ sub_80679D0: @ 80679D0 ldr r5, =gActiveBank ldrb r0, [r5] lsls r0, 9 - ldr r4, =gUnknown_02023068 + ldr r4, =gBattleBufferA + 4 adds r0, r4 bl sub_81851A8 ldrb r0, [r5] @@ -6244,7 +6244,7 @@ _08067A08: bl FadeOutMapMusic movs r0, 0x3 bl BeginFastPaletteFade - bl sub_8065068 + bl LinkOpponentBufferExecCompleted ldr r1, =gBattleBankFunc ldrb r0, [r4] lsls r0, 2 diff --git a/asm/battle_controller_linkpartner.s b/asm/battle_controller_linkpartner.s index 09dd9077b..dbe8052b9 100644 --- a/asm/battle_controller_linkpartner.s +++ b/asm/battle_controller_linkpartner.s @@ -184,7 +184,7 @@ sub_814B004: @ 814B004 beq _0814B05C _0814B028: ldr r2, =gSprites - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldr r0, =gActiveBank ldrb r0, [r0] adds r0, r1 @@ -202,7 +202,7 @@ _0814B028: .pool _0814B05C: ldr r2, =gSprites - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds ldr r0, =gActiveBank ldrb r3, [r0] adds r0, r3, r5 @@ -368,7 +368,7 @@ _0814B136: lsls r0, 2 add r0, r10 bl DestroySprite - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds ldrb r0, [r7] mov r1, r8 eors r1, r0 @@ -406,7 +406,7 @@ _0814B1F0: ldr r1, =gSprites adds r0, r1 bl DestroySprite - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds ldrb r1, [r4] adds r0, r1, r5 ldrb r0, [r0] @@ -486,7 +486,7 @@ bx_t4_healthbar_update: @ 814B2D0 push {r4-r6,lr} ldr r5, =gActiveBank ldrb r0, [r5] - ldr r6, =gUnknown_03005D70 + ldr r6, =gHealthBoxesIds adds r1, r0, r6 ldrb r1, [r1] movs r2, 0 @@ -583,7 +583,7 @@ sub_814B340: @ 814B340 lsls r0, 2 adds r0, r6 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r4] adds r0, r1 ldrb r0, [r0] @@ -630,7 +630,7 @@ sub_814B3DC: @ 814B3DC lsls r0, 2 adds r0, r4 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -721,7 +721,7 @@ _0814B4DA: sub_814B4E0: @ 814B4E0 push {r4,lr} ldr r2, =gSprites - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldr r4, =gActiveBank ldrb r3, [r4] adds r0, r3, r0 @@ -868,7 +868,7 @@ sub_814B5A8: @ 814B5A8 adds r0, r1 movs r1, 0 bl StartSpriteAnim - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds ldrb r1, [r7] adds r0, r1, r4 ldrb r0, [r0] @@ -985,7 +985,7 @@ LinkPartnerBufferExecCompleted: @ 814B740 ands r0, r1 cmp r0, 0 beq _0814B794 - bl link_get_multiplayer_id + bl GetMultiplayerId mov r1, sp strb r0, [r1] movs r0, 0x2 @@ -2063,7 +2063,7 @@ sub_814C09C: @ 814C09C ldr r0, =gActiveBank ldrb r0, [r0] lsls r0, 9 - ldr r2, =gUnknown_02023067 + ldr r2, =gBattleBufferA + 3 adds r3, r0, r2 adds r6, r3, 0 subs r1, r2, 0x2 @@ -3510,7 +3510,7 @@ _0814CE5C: lsls r0, 2 adds r0, r4 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -3621,7 +3621,7 @@ _0814CF62: ldr r5, =gActiveBank ldrb r0, [r5] bl sub_806D864 - ldr r6, =gUnknown_020229E8 + ldr r6, =gLinkPlayers lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -3854,7 +3854,7 @@ sub_814D0F0: @ 814D0F0 lsls r0, 2 adds r0, r5 ldr r1, =SpriteCallbackDummy - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r1, =gBattleBankFunc ldrb r0, [r4] lsls r0, 2 @@ -4348,11 +4348,11 @@ sub_814D590: @ 814D590 ldr r5, =gActiveBank ldrb r4, [r5] lsls r4, 9 - ldr r0, =gUnknown_02023066 + ldr r0, =gBattleBufferA + 2 adds r4, r0 ldrh r0, [r4] - bl battle_pick_message - ldr r0, =gUnknown_02022E2C + bl BufferStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r1, =gBattleBankFunc @@ -4475,7 +4475,7 @@ sub_814D63C: @ 814D63C adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] @@ -4497,7 +4497,7 @@ _0814D6CC: adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] @@ -4538,7 +4538,7 @@ sub_814D738: @ 814D738 lsls r0, 24 cmp r0, 0 bne _0814D78C - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] @@ -5022,7 +5022,7 @@ sub_814DAA8: @ 814DAA8 lsls r0, 2 adds r0, r4 ldr r1, =sub_805CC00 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -5038,7 +5038,7 @@ sub_814DAA8: @ 814DAA8 lsrs r7, r0, 24 ldrb r0, [r6] bl sub_806D864 - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -5341,7 +5341,7 @@ _0814DE08: strb r1, [r0] ldrb r0, [r5] lsls r3, r0, 9 - ldr r4, =gUnknown_02023068 + ldr r4, =gBattleBufferA + 4 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 @@ -5571,7 +5571,7 @@ sub_814E014: @ 814E014 ldr r0, =gActiveBank ldrb r0, [r0] lsls r0, 9 - ldr r1, =gUnknown_02023066 + ldr r1, =gBattleBufferA + 2 adds r0, r1 bl sub_81851A8 bl LinkPartnerBufferExecCompleted @@ -5594,7 +5594,7 @@ sub_814E040: @ 814E040 ldr r5, =gActiveBank ldrb r0, [r5] lsls r0, 9 - ldr r4, =gUnknown_02023068 + ldr r4, =gBattleBufferA + 4 adds r0, r4 bl sub_81851A8 ldr r2, =gBattleOutcome diff --git a/asm/battle_controller_opponent.s b/asm/battle_controller_opponent.s index ed5bb8ab1..9e2512227 100644 --- a/asm/battle_controller_opponent.s +++ b/asm/battle_controller_opponent.s @@ -224,7 +224,7 @@ _0805F31E: beq _0805F368 _0805F32C: ldr r2, =gSprites - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldr r3, =gActiveBank ldrb r0, [r3] adds r0, r1 @@ -246,7 +246,7 @@ _0805F34E: .pool _0805F368: ldr r3, =gSprites - ldr r6, =gUnknown_03005D70 + ldr r6, =gHealthBoxesIds ldr r2, =gActiveBank ldrb r4, [r2] adds r0, r4, r6 @@ -593,7 +593,7 @@ _0805F5EE: ands r0, r1 cmp r0, 0 bne _0805F684 - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds mov r1, r8 ldrb r0, [r1] adds r1, r7, 0 @@ -621,7 +621,7 @@ _0805F5EE: ldrb r0, [r0] bl sub_80729D0 _0805F684: - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds ldr r4, =gActiveBank ldrb r1, [r4] adds r0, r1, r5 @@ -1056,7 +1056,7 @@ sub_805FA70: @ 805FA70 push {r4-r6,lr} ldr r6, =gActiveBank ldrb r0, [r6] - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds adds r1, r0, r5 ldrb r1, [r1] movs r2, 0 @@ -1108,7 +1108,7 @@ sub_805FAC4: @ 805FAC4 lsls r0, 31 cmp r0, 0 bne _0805FAF2 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r3, r0 ldrb r0, [r0] bl sub_8072984 @@ -1155,7 +1155,7 @@ sub_805FB08: @ 805FB08 bl DestroySprite ldrb r0, [r6] bl sub_805EEE0 - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -1246,7 +1246,7 @@ _0805FC0A: sub_805FC10: @ 805FC10 push {r4,lr} ldr r2, =gSprites - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldr r4, =gActiveBank ldrb r3, [r4] adds r0, r3, r0 @@ -1402,7 +1402,7 @@ sub_805FD00: @ 805FD00 adds r0, r7 movs r1, 0 bl StartSpriteAnim - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds ldrb r1, [r5] adds r0, r1, r4 ldrb r0, [r0] @@ -1586,7 +1586,7 @@ OpponentBufferExecCompleted: @ 805FF18 ands r0, r1 cmp r0, 0 beq _0805FF6C - bl link_get_multiplayer_id + bl GetMultiplayerId mov r1, sp strb r0, [r1] movs r0, 0x2 @@ -2672,7 +2672,7 @@ sub_8060890: @ 8060890 ldr r3, =gActiveBank ldrb r0, [r3] lsls r0, 9 - ldr r2, =gUnknown_02023067 + ldr r2, =gBattleBufferA + 3 adds r4, r0, r2 adds r7, r4, 0 subs r1, r2, 0x2 @@ -4105,7 +4105,7 @@ _080615B4: bl DestroySprite ldrb r0, [r6] bl sub_805EEE0 - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -4201,11 +4201,11 @@ sub_8061690: @ 8061690 ands r0, r2 cmp r0, 0 beq _080616B0 - bl sub_806B830 + bl GetSecretBaseTrainerPicIndex b _0806175A .pool _080616B0: - ldr r3, =gUnknown_02038BCA + ldr r3, =gTrainerBattleOpponent_A ldrh r1, [r3] ldr r0, =0x000003fe cmp r1, r0 @@ -4233,7 +4233,7 @@ _080616C8: b _0806175A .pool _080616F0: - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r0, [r0] bl sub_81D5588 b _0806175A @@ -4260,7 +4260,7 @@ _08061708: b _0806175A .pool _08061734: - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r0, [r0] bl sub_8162AA0 b _0806175A @@ -4291,7 +4291,7 @@ _08061760: cmp r0, 0x1 beq _08061788 ldr r2, =gTrainers - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r1, [r0] b _0806178C .pool @@ -4448,11 +4448,11 @@ sub_80618D8: @ 80618D8 ands r0, r2 cmp r0, 0 beq _080618F8 - bl sub_806B830 + bl GetSecretBaseTrainerPicIndex b _080619A2 .pool _080618F8: - ldr r3, =gUnknown_02038BCA + ldr r3, =gTrainerBattleOpponent_A ldrh r1, [r3] ldr r0, =0x000003fe cmp r1, r0 @@ -4480,7 +4480,7 @@ _08061910: b _080619A2 .pool _08061938: - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r0, [r0] bl sub_81D5588 b _080619A2 @@ -4507,7 +4507,7 @@ _08061950: b _080619A2 .pool _0806197C: - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r0, [r0] bl sub_8162AA0 b _080619A2 @@ -4538,7 +4538,7 @@ _080619A8: cmp r0, 0x1 beq _080619D0 ldr r2, =gTrainers - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r1, [r0] b _080619D4 .pool @@ -4725,7 +4725,7 @@ sub_8061AF0: @ 8061AF0 lsls r0, 2 adds r0, r5 ldr r1, =SpriteCallbackDummy - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r1, =gBattleBankFunc ldrb r0, [r4] lsls r0, 2 @@ -5179,11 +5179,11 @@ sub_8061F34: @ 8061F34 ldr r5, =gActiveBank ldrb r4, [r5] lsls r4, 9 - ldr r0, =gUnknown_02023066 + ldr r0, =gBattleBufferA + 2 adds r4, r0 ldrh r0, [r4] - bl battle_pick_message - ldr r0, =gUnknown_02022E2C + bl BufferStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r1, =gBattleBankFunc @@ -5252,7 +5252,7 @@ _08061FE4: ldr r0, =gActiveBank ldrb r0, [r0] lsls r0, 9 - ldr r1, =gUnknown_02023068 + ldr r1, =gBattleBufferA + 4 adds r5, r0, r1 movs r0, 0x93 lsls r0, 3 @@ -5261,7 +5261,7 @@ _08061FE4: beq _080620C4 movs r0, 0xF bl BattleAI_SetupAIData - bl sub_8130BA4 + bl BattleAI_ChooseMoveOrAction lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x5 @@ -5616,7 +5616,7 @@ sub_8062294: @ 8062294 adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] @@ -5638,7 +5638,7 @@ _08062324: adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] @@ -5679,7 +5679,7 @@ sub_8062390: @ 8062390 lsls r0, 24 cmp r0, 0 bne _080623E4 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] @@ -6155,7 +6155,7 @@ sub_80626FC: @ 80626FC lsls r0, 2 adds r0, r4 ldr r1, =sub_806280C - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_8062828 movs r1, 0x5 bl CreateTask @@ -6401,7 +6401,7 @@ _080629B4: adds r5, r7, 0 ldrb r0, [r5] lsls r3, r0, 9 - ldr r4, =gUnknown_02023068 + ldr r4, =gBattleBufferA + 4 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 diff --git a/asm/battle_controller_player.s b/asm/battle_controller_player.s index 821a7bbb2..5854d5e47 100644 --- a/asm/battle_controller_player.s +++ b/asm/battle_controller_player.s @@ -45,7 +45,7 @@ PlayerBufferExecCompleted: @ 805748C ands r0, r1 cmp r0, 0 beq _080574E0 - bl link_get_multiplayer_id + bl GetMultiplayerId mov r1, sp strb r0, [r1] movs r0, 0x2 @@ -856,7 +856,7 @@ sub_8057BFC: @ 8057BFC ldr r3, =gActiveBank ldrb r0, [r3] lsls r0, 9 - ldr r1, =gUnknown_02023068 + ldr r1, =gBattleBufferA + 4 adds r6, r0, r1 ldr r2, =gMain ldrh r1, [r2, 0x2C] @@ -991,7 +991,7 @@ _08057D24: cmp r0, 0 bne _08057D5A movs r0, 0 - bl sub_8069DEC + bl CountAliveMonsInBattle lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1471,7 +1471,7 @@ _08058152: b _080584A8 _08058170: lsls r1, 9 - ldr r0, =gUnknown_02023068 + ldr r0, =gBattleBufferA + 4 adds r1, r0 mov r9, r1 ldrb r1, [r2] @@ -2401,7 +2401,7 @@ sub_805896C: @ 805896C beq _080589D0 _08058998: ldr r2, =gSprites - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldr r3, =gActiveBank ldrb r0, [r3] adds r0, r1 @@ -2420,7 +2420,7 @@ _08058998: .pool _080589D0: ldr r3, =gSprites - ldr r6, =gUnknown_03005D70 + ldr r6, =gHealthBoxesIds ldr r2, =gActiveBank ldrb r4, [r2] adds r0, r4, r6 @@ -2682,7 +2682,7 @@ _08058BB2: ands r0, r1 cmp r0, 0 bne _08058C38 - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds ldrb r0, [r7] adds r1, r6, 0 eors r1, r0 @@ -2707,7 +2707,7 @@ _08058BB2: ldrb r0, [r0] bl sub_80729D0 _08058C38: - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds ldr r4, =gActiveBank ldrb r1, [r4] adds r0, r1, r5 @@ -3001,7 +3001,7 @@ _08058EAA: sub_8058EDC: @ 8058EDC push {r4-r6,lr} ldr r2, =gSprites - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldr r6, =gActiveBank ldrb r3, [r6] adds r0, r3, r0 @@ -3194,7 +3194,7 @@ _0805905E: bne _080590D2 adds r0, r3, r4 bl DestroySprite - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds ldrb r1, [r5] adds r0, r1, r4 ldrb r0, [r0] @@ -3255,7 +3255,7 @@ bx_t1_healthbar_update: @ 8059130 push {r4-r6,lr} ldr r5, =gActiveBank ldrb r0, [r5] - ldr r6, =gUnknown_03005D70 + ldr r6, =gHealthBoxesIds adds r1, r0, r6 ldrb r1, [r1] movs r2, 0 @@ -3399,7 +3399,7 @@ _080591FE: mov r2, sp bl SetMonData adds r0, r6, 0 - bl pokemon_calc_effective_stats + bl CalculateMonStats ldr r2, [sp] add r0, sp, 0x4 ldrh r0, [r0] @@ -3550,7 +3550,7 @@ sub_8059330: @ 8059330 adds r4, r6 ldr r2, [r4] subs r2, r1 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds add r0, r10 ldrb r1, [r0] mov r0, r9 @@ -3605,7 +3605,7 @@ _08059430: ldrh r2, [r6, 0xA] mov r10, r2 ldrb r7, [r6, 0xC] - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds adds r5, r7, r5 ldrb r1, [r5] adds r0, r7, 0 @@ -3673,7 +3673,7 @@ _08059430: mov r2, sp bl SetMonData adds r0, r5, 0 - bl pokemon_calc_effective_stats + bl CalculateMonStats ldr r2, [sp] add r0, sp, 0x4 ldrh r0, [r0] @@ -3809,7 +3809,7 @@ sub_80595A4: @ 80595A4 ldrh r0, [r0] cmp r4, r0 bne _08059624 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r2, r0 ldrb r0, [r0] adds r1, r7, 0 @@ -3818,7 +3818,7 @@ sub_80595A4: @ 80595A4 b _08059638 .pool _08059624: - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r5, r0 ldrb r0, [r0] movs r1, 0x64 @@ -3926,7 +3926,7 @@ sub_80596A8: @ 80596A8 lsls r0, 2 adds r0, r6 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r4] adds r0, r1 ldrb r0, [r0] @@ -3973,7 +3973,7 @@ sub_8059744: @ 8059744 lsls r0, 2 adds r0, r4 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -4332,12 +4332,12 @@ sub_8059AAC: @ 8059AAC ldr r0, =gActiveBank ldrb r1, [r0] lsls r1, 9 - ldr r3, =gUnknown_02023068 + ldr r3, =gBattleBufferA + 4 ldr r2, =gUnknown_03005D78 movs r0, 0 strb r0, [r2] movs r5, 0 - ldr r7, =gUnknown_02022E2C + ldr r7, =gDisplayedStringBattle adds r4, r1, r3 adds r6, r2, 0 _08059AC4: @@ -4376,7 +4376,7 @@ _08059AF4: thumb_func_start sub_8059B18 sub_8059B18: @ 8059B18 push {r4,lr} - ldr r4, =gUnknown_02022E2C + ldr r4, =gDisplayedStringBattle ldr r1, =gUnknown_085CCA6F adds r0, r4, 0 bl StringCopy @@ -4406,7 +4406,7 @@ sub_8059B3C: @ 8059B3C lsls r4, r1, 9 adds r0, r5, 0x4 adds r4, r0 - ldr r6, =gUnknown_02022E2C + ldr r6, =gDisplayedStringBattle ldr r5, =gUnknown_020244B0 adds r1, r5 adds r0, r4, 0 @@ -4446,9 +4446,9 @@ sub_8059BB0: @ 8059BB0 ldr r5, =gActiveBank ldrb r4, [r5] lsls r4, 9 - ldr r0, =gUnknown_02023068 + ldr r0, =gBattleBufferA + 4 adds r4, r0 - ldr r6, =gUnknown_02022E2C + ldr r6, =gDisplayedStringBattle ldr r1, =gUnknown_085CCA73 adds r0, r6, 0 bl StringCopy @@ -5778,7 +5778,7 @@ dp01_setattr_by_ch1_for_player_pokemon: @ 805A6F4 ldr r0, =gActiveBank ldrb r0, [r0] lsls r0, 9 - ldr r2, =gUnknown_02023067 + ldr r2, =gBattleBufferA + 3 adds r3, r0, r2 adds r6, r3, 0 subs r1, r2, 0x2 @@ -7158,7 +7158,7 @@ _0805B41C: lsls r0, 2 adds r0, r4 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -7253,8 +7253,8 @@ sub_805B4F0: @ 805B4F0 ands r0, r1 cmp r0, 0 beq _0805B5B4 - bl link_get_multiplayer_id - ldr r5, =gUnknown_020229E8 + bl GetMultiplayerId + ldr r5, =gLinkPlayers lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7265,7 +7265,7 @@ sub_805B4F0: @ 805B4F0 ldrb r0, [r1] cmp r0, 0x4 beq _0805B538 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7278,7 +7278,7 @@ sub_805B4F0: @ 805B4F0 cmp r0, 0x5 bne _0805B558 _0805B538: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7290,7 +7290,7 @@ _0805B538: b _0805B5BA .pool _0805B558: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7302,7 +7302,7 @@ _0805B558: ands r0, r1 cmp r0, 0x2 beq _0805B58A - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7314,7 +7314,7 @@ _0805B558: cmp r4, 0x1 bne _0805B5A0 _0805B58A: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7325,7 +7325,7 @@ _0805B58A: adds r4, r0, 0x4 b _0805B5BA _0805B5A0: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7635,8 +7635,8 @@ dp01t_08_1_8032428: @ 805B864 ands r0, r1 cmp r0, 0 beq _0805B920 - bl link_get_multiplayer_id - ldr r5, =gUnknown_020229E8 + bl GetMultiplayerId + ldr r5, =gLinkPlayers lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7647,7 +7647,7 @@ dp01t_08_1_8032428: @ 805B864 ldrb r0, [r1] cmp r0, 0x4 beq _0805B8A6 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7660,7 +7660,7 @@ dp01t_08_1_8032428: @ 805B864 cmp r0, 0x5 bne _0805B8C4 _0805B8A6: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7672,7 +7672,7 @@ _0805B8A6: b _0805B926 .pool _0805B8C4: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7684,7 +7684,7 @@ _0805B8C4: ands r0, r1 cmp r0, 0x2 beq _0805B8F6 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7696,7 +7696,7 @@ _0805B8C4: cmp r4, 0x1 bne _0805B90C _0805B8F6: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7707,7 +7707,7 @@ _0805B8F6: adds r4, r0, 0x4 b _0805B926 _0805B90C: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -7865,7 +7865,7 @@ sub_805B9F8: @ 805B9F8 lsls r0, 2 adds r0, r4 ldr r1, =SpriteCallbackDummy - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -8452,11 +8452,11 @@ sub_805BF80: @ 805BF80 ldr r5, =gActiveBank ldrb r4, [r5] lsls r4, 9 - ldr r0, =gUnknown_02023066 + ldr r0, =gBattleBufferA + 2 adds r4, r0 ldrh r0, [r4] - bl battle_pick_message - ldr r0, =gUnknown_02022E2C + bl BufferStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r1, =gBattleBankFunc @@ -8551,8 +8551,8 @@ _0805C062: movs r1, 0 bl sub_8059CB4 ldr r0, =gUnknown_085CC9F3 - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0x1 bl battle_show_message_maybe pop {r4} @@ -8987,7 +8987,7 @@ _0805C44A: adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] @@ -9011,7 +9011,7 @@ _0805C4B4: adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds adds r1, r0, r4 ldrb r1, [r1] str r7, [sp] @@ -9117,7 +9117,7 @@ sub_805C5C4: @ 805C5C4 lsls r0, 24 cmp r0, 0 bne _0805C618 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] @@ -9743,7 +9743,7 @@ dp01t_2F_1_pokemon_enter: @ 805CA80 lsls r0, 2 adds r0, r5 ldr r1, =sub_805CC00 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] @@ -10030,7 +10030,7 @@ _0805CDA4: strb r1, [r0] ldrb r0, [r5] lsls r3, r0, 9 - ldr r4, =gUnknown_02023068 + ldr r4, =gBattleBufferA + 4 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 @@ -10269,7 +10269,7 @@ dp01t_35_1_link_standby_message_and_free_vram: @ 805CFC8 ldr r5, =gActiveBank ldrb r0, [r5] lsls r0, 9 - ldr r4, =gUnknown_02023066 + ldr r4, =gBattleBufferA + 2 adds r0, r4 bl sub_81851A8 ldrb r0, [r5] @@ -10366,7 +10366,7 @@ sub_805D094: @ 805D094 ldr r5, =gActiveBank ldrb r0, [r5] lsls r0, 9 - ldr r4, =gUnknown_02023068 + ldr r4, =gBattleBufferA + 4 adds r0, r4 bl sub_81851A8 ldr r2, =gBattleOutcome diff --git a/asm/battle_controller_player_partner.s b/asm/battle_controller_player_partner.s index 75a911521..481096ffb 100644 --- a/asm/battle_controller_player_partner.s +++ b/asm/battle_controller_player_partner.s @@ -185,7 +185,7 @@ sub_81BAF48: @ 81BAF48 beq _081BAFA0 _081BAF6C: ldr r2, =gSprites - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldr r0, =gActiveBank ldrb r0, [r0] adds r0, r1 @@ -203,7 +203,7 @@ _081BAF6C: .pool _081BAFA0: ldr r2, =gSprites - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds ldr r0, =gActiveBank ldrb r3, [r0] adds r0, r3, r5 @@ -369,7 +369,7 @@ _081BB07A: lsls r0, 2 add r0, r10 bl DestroySprite - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds ldrb r0, [r7] mov r1, r8 eors r1, r0 @@ -407,7 +407,7 @@ _081BB134: ldr r1, =gSprites adds r0, r1 bl DestroySprite - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds ldrb r1, [r4] adds r0, r1, r5 ldrb r0, [r0] @@ -487,7 +487,7 @@ bx_t3_healthbar_update: @ 81BB214 push {r4-r6,lr} ldr r5, =gActiveBank ldrb r0, [r5] - ldr r6, =gUnknown_03005D70 + ldr r6, =gHealthBoxesIds adds r1, r0, r6 ldrb r1, [r1] movs r2, 0 @@ -631,7 +631,7 @@ _081BB2E2: mov r2, sp bl SetMonData adds r0, r6, 0 - bl pokemon_calc_effective_stats + bl CalculateMonStats ldr r2, [sp] add r0, sp, 0x4 ldrh r0, [r0] @@ -782,7 +782,7 @@ sub_81BB414: @ 81BB414 adds r4, r6 ldr r2, [r4] subs r2, r1 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds add r0, r10 ldrb r1, [r0] mov r0, r9 @@ -837,7 +837,7 @@ _081BB514: ldrh r2, [r6, 0xA] mov r10, r2 ldrb r7, [r6, 0xC] - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds adds r5, r7, r5 ldrb r1, [r5] adds r0, r7, 0 @@ -905,7 +905,7 @@ _081BB514: mov r2, sp bl SetMonData adds r0, r5, 0 - bl pokemon_calc_effective_stats + bl CalculateMonStats ldr r2, [sp] add r0, sp, 0x4 ldrh r0, [r0] @@ -1041,7 +1041,7 @@ sub_81BB688: @ 81BB688 ldrh r0, [r0] cmp r4, r0 bne _081BB708 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r2, r0 ldrb r0, [r0] adds r1, r7, 0 @@ -1050,7 +1050,7 @@ sub_81BB688: @ 81BB688 b _081BB71C .pool _081BB708: - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r5, r0 ldrb r0, [r0] movs r1, 0x64 @@ -1158,7 +1158,7 @@ sub_81BB78C: @ 81BB78C lsls r0, 2 adds r0, r6 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r4] adds r0, r1 ldrb r0, [r0] @@ -1205,7 +1205,7 @@ sub_81BB828: @ 81BB828 lsls r0, 2 adds r0, r4 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -1296,7 +1296,7 @@ _081BB926: sub_81BB92C: @ 81BB92C push {r4,lr} ldr r2, =gSprites - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldr r4, =gActiveBank ldrb r3, [r4] adds r0, r3, r0 @@ -1443,7 +1443,7 @@ sub_81BB9F4: @ 81BB9F4 adds r0, r1 movs r1, 0 bl StartSpriteAnim - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds ldrb r1, [r7] adds r0, r1, r4 ldrb r0, [r0] @@ -1560,7 +1560,7 @@ PlayerPartnerBufferExecCompleted: @ 81BBB8C ands r0, r1 cmp r0, 0 beq _081BBBE0 - bl link_get_multiplayer_id + bl GetMultiplayerId mov r1, sp strb r0, [r1] movs r0, 0x2 @@ -2638,7 +2638,7 @@ sub_81BC4E8: @ 81BC4E8 ldr r0, =gActiveBank ldrb r0, [r0] lsls r0, 9 - ldr r2, =gUnknown_02023067 + ldr r2, =gBattleBufferA + 3 adds r3, r0, r2 adds r6, r3, 0 subs r1, r2, 0x2 @@ -4085,7 +4085,7 @@ _081BD2A8: lsls r0, 2 adds r0, r4 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -4478,7 +4478,7 @@ sub_81BD5C8: @ 81BD5C8 lsls r0, 2 adds r0, r5 ldr r1, =SpriteCallbackDummy - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r1, =gBattleBankFunc ldrb r0, [r4] lsls r0, 2 @@ -4960,11 +4960,11 @@ sub_81BDA4C: @ 81BDA4C ldr r4, =gActiveBank ldrb r0, [r4] lsls r0, 9 - ldr r1, =gUnknown_02023066 + ldr r1, =gBattleBufferA + 2 adds r0, r1 ldrh r0, [r0] - bl battle_pick_message - ldr r0, =gUnknown_02022E2C + bl BufferStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r1, =gBattleBankFunc @@ -5010,11 +5010,11 @@ sub_81BDAC8: @ 81BDAC8 ldr r6, =gActiveBank ldrb r4, [r6] lsls r4, 9 - ldr r0, =gUnknown_02023068 + ldr r0, =gBattleBufferA + 4 adds r4, r0 movs r0, 0xF bl BattleAI_SetupAIData - bl sub_8130BA4 + bl BattleAI_ChooseMoveOrAction lsls r0, 24 lsrs r5, r0, 24 ldr r2, =gBattleMoves @@ -5204,7 +5204,7 @@ sub_81BDC10: @ 81BDC10 adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] @@ -5226,7 +5226,7 @@ _081BDCA0: adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] @@ -5325,7 +5325,7 @@ sub_81BDD9C: @ 81BDD9C lsls r0, 24 cmp r0, 0 bne _081BDDF0 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] @@ -5809,7 +5809,7 @@ sub_81BE10C: @ 81BE10C lsls r0, 2 adds r0, r4 ldr r1, =sub_805CC00 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] @@ -6074,7 +6074,7 @@ _081BE404: strb r1, [r0] ldrb r0, [r5] lsls r3, r0, 9 - ldr r4, =gUnknown_02023068 + ldr r4, =gBattleBufferA + 4 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 diff --git a/asm/battle_controller_recorded_opponent.s b/asm/battle_controller_recorded_opponent.s index 4e2290b72..2b0eed22e 100644 --- a/asm/battle_controller_recorded_opponent.s +++ b/asm/battle_controller_recorded_opponent.s @@ -214,7 +214,7 @@ sub_8186678: @ 8186678 beq _081866F8 _081866A4: ldr r4, =gSprites - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldr r2, =gActiveBank ldrb r3, [r2] adds r0, r3, r0 @@ -246,7 +246,7 @@ _081866A4: .pool _081866F8: ldr r6, =gSprites - ldr r7, =gUnknown_03005D70 + ldr r7, =gHealthBoxesIds ldr r2, =gActiveBank ldrb r3, [r2] adds r0, r3, r7 @@ -514,7 +514,7 @@ _081868DE: ands r0, r1 cmp r0, 0 bne _08186964 - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds ldrb r0, [r7] adds r1, r6, 0 eors r1, r0 @@ -539,7 +539,7 @@ _081868DE: ldrb r0, [r0] bl sub_80729D0 _08186964: - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds ldr r4, =gActiveBank ldrb r1, [r4] adds r0, r1, r5 @@ -943,7 +943,7 @@ sub_8186D04: @ 8186D04 push {r4-r6,lr} ldr r6, =gActiveBank ldrb r0, [r6] - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds adds r1, r0, r5 ldrb r1, [r1] movs r2, 0 @@ -995,7 +995,7 @@ sub_8186D58: @ 8186D58 lsls r0, 31 cmp r0, 0 bne _08186D86 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r3, r0 ldrb r0, [r0] bl sub_8072984 @@ -1042,7 +1042,7 @@ sub_8186D9C: @ 8186D9C bl DestroySprite ldrb r0, [r6] bl sub_805EEE0 - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -1133,7 +1133,7 @@ _08186E9E: sub_8186EA4: @ 8186EA4 push {r4,lr} ldr r2, =gSprites - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldr r4, =gActiveBank ldrb r3, [r4] adds r0, r3, r0 @@ -1289,7 +1289,7 @@ sub_8186F94: @ 8186F94 adds r0, r7 movs r1, 0 bl StartSpriteAnim - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds ldrb r1, [r5] adds r0, r1, r4 ldrb r0, [r0] @@ -1473,7 +1473,7 @@ RecordedOpponentBufferExecCompleted: @ 81871AC ands r0, r1 cmp r0, 0 beq _08187200 - bl link_get_multiplayer_id + bl GetMultiplayerId mov r1, sp strb r0, [r1] movs r0, 0x2 @@ -2503,7 +2503,7 @@ dp01_setattr_for_opponent_pokemon: @ 8187AA8 ldr r3, =gActiveBank ldrb r0, [r3] lsls r0, 9 - ldr r2, =gUnknown_02023067 + ldr r2, =gBattleBufferA + 3 adds r4, r0, r2 adds r7, r4, 0 subs r1, r2, 0x2 @@ -3924,7 +3924,7 @@ _081887B0: bl DestroySprite ldrb r0, [r6] bl sub_805EEE0 - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -4038,11 +4038,11 @@ _081888B4: ldrb r0, [r4] cmp r0, 0x1 bne _081888D8 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A b _081888DA .pool _081888D8: - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B _081888DA: ldrh r0, [r0] bl sub_8162AA0 @@ -4057,7 +4057,7 @@ _081888EC: b _08188924 _081888F6: movs r7, 0xB0 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] movs r0, 0xC0 lsls r0, 4 @@ -4067,7 +4067,7 @@ _081888F6: b _08188928 .pool _08188910: - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers ldr r0, =gUnknown_0203C7B4 ldrb r0, [r0] movs r1, 0x1 @@ -4262,7 +4262,7 @@ sub_8188A4C: @ 8188A4C lsls r0, 2 adds r0, r5 ldr r1, =SpriteCallbackDummy - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r1, =gBattleBankFunc ldrb r0, [r4] lsls r0, 2 @@ -4716,11 +4716,11 @@ sub_8188E90: @ 8188E90 ldr r4, =gActiveBank ldrb r0, [r4] lsls r0, 9 - ldr r1, =gUnknown_02023066 + ldr r1, =gBattleBufferA + 2 adds r0, r1 ldrh r0, [r0] - bl battle_pick_message - ldr r0, =gUnknown_02022E2C + bl BufferStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r1, =gBattleBankFunc @@ -4905,7 +4905,7 @@ sub_8188FD0: @ 8188FD0 adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] @@ -4927,7 +4927,7 @@ _08189060: adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] @@ -4968,7 +4968,7 @@ sub_81890CC: @ 81890CC lsls r0, 24 cmp r0, 0 bne _08189120 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] @@ -5444,7 +5444,7 @@ sub_8189438: @ 8189438 lsls r0, 2 adds r0, r4 ldr r1, =sub_818962C - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =c3_0803D564 movs r1, 0x5 bl CreateTask @@ -5685,7 +5685,7 @@ _081896E4: adds r5, r7, 0 ldrb r0, [r5] lsls r3, r0, 9 - ldr r4, =gUnknown_02023068 + ldr r4, =gBattleBufferA + 4 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 diff --git a/asm/battle_controller_recorded_player.s b/asm/battle_controller_recorded_player.s index 118ebbda4..7f2b918a4 100644 --- a/asm/battle_controller_recorded_player.s +++ b/asm/battle_controller_recorded_player.s @@ -196,7 +196,7 @@ _08189ABA: beq _08189B0C _08189ADA: ldr r2, =gSprites - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] @@ -213,7 +213,7 @@ _08189ADA: .pool _08189B0C: ldr r2, =gSprites - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds ldr r0, =gActiveBank ldrb r3, [r0] adds r0, r3, r5 @@ -382,7 +382,7 @@ _08189C60: beq _08189CB0 _08189C80: ldr r2, =gSprites - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] @@ -399,7 +399,7 @@ _08189C80: .pool _08189CB0: ldr r2, =gSprites - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds ldr r0, =gActiveBank ldrb r3, [r0] adds r0, r3, r5 @@ -571,7 +571,7 @@ _08189DBE: ands r0, r1 cmp r0, 0 bne _08189E54 - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds mov r1, r9 ldrb r0, [r1] adds r1, r7, 0 @@ -599,7 +599,7 @@ _08189DBE: ldrb r0, [r0] bl sub_80729D0 _08189E54: - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds ldr r4, =gActiveBank ldrb r1, [r4] adds r0, r1, r5 @@ -862,7 +862,7 @@ sub_818A0A4: @ 818A0A4 push {r4-r6,lr} ldr r5, =gActiveBank ldrb r0, [r5] - ldr r6, =gUnknown_03005D70 + ldr r6, =gHealthBoxesIds adds r1, r0, r6 ldrb r1, [r1] movs r2, 0 @@ -959,7 +959,7 @@ sub_818A114: @ 818A114 lsls r0, 2 adds r0, r6 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r4] adds r0, r1 ldrb r0, [r0] @@ -1006,7 +1006,7 @@ sub_818A1B0: @ 818A1B0 lsls r0, 2 adds r0, r4 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -1097,7 +1097,7 @@ _0818A2AE: sub_818A2B4: @ 818A2B4 push {r4,lr} ldr r2, =gSprites - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldr r4, =gActiveBank ldrb r3, [r4] adds r0, r3, r0 @@ -1244,7 +1244,7 @@ sub_818A37C: @ 818A37C adds r0, r1 movs r1, 0 bl StartSpriteAnim - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds ldrb r1, [r7] adds r0, r1, r4 ldrb r0, [r0] @@ -1361,7 +1361,7 @@ RecordedPlayerBufferExecCompleted: @ 818A514 ands r0, r1 cmp r0, 0 beq _0818A568 - bl link_get_multiplayer_id + bl GetMultiplayerId mov r1, sp strb r0, [r1] movs r0, 0x2 @@ -2439,7 +2439,7 @@ sub_818AE70: @ 818AE70 ldr r0, =gActiveBank ldrb r0, [r0] lsls r0, 9 - ldr r2, =gUnknown_02023067 + ldr r2, =gBattleBufferA + 3 adds r3, r0, r2 adds r6, r3, 0 subs r1, r2, 0x2 @@ -3886,7 +3886,7 @@ _0818BC30: lsls r0, 2 adds r0, r4 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -3992,7 +3992,7 @@ sub_818BD04: @ 818BD04 b _0818BD4C .pool _0818BD30: - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers ldr r0, =gUnknown_0203C7B4 ldrb r1, [r0] lsls r0, r1, 3 @@ -4002,7 +4002,7 @@ _0818BD30: b _0818BD4A .pool _0818BD48: - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers _0818BD4A: ldrb r4, [r0, 0x13] _0818BD4C: @@ -4334,7 +4334,7 @@ sub_818BFB8: @ 818BFB8 lsls r0, 2 adds r0, r5 ldr r1, =SpriteCallbackDummy - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r1, =gBattleBankFunc ldrb r0, [r4] lsls r0, 2 @@ -4816,11 +4816,11 @@ sub_818C43C: @ 818C43C ldr r4, =gActiveBank ldrb r0, [r4] lsls r0, 9 - ldr r1, =gUnknown_02023066 + ldr r1, =gBattleBufferA + 2 adds r0, r1 ldrh r0, [r0] - bl battle_pick_message - ldr r0, =gUnknown_02022E2C + bl BufferStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r1, =gBattleBankFunc @@ -5049,7 +5049,7 @@ sub_818C5E8: @ 818C5E8 adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] @@ -5071,7 +5071,7 @@ _0818C678: adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds adds r1, r0, r4 ldrb r1, [r1] str r7, [sp] @@ -5119,7 +5119,7 @@ sub_818C6F4: @ 818C6F4 lsls r0, 24 cmp r0, 0 bne _0818C748 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] @@ -5603,7 +5603,7 @@ sub_818CA64: @ 818CA64 lsls r0, 2 adds r0, r4 ldr r1, =sub_805CC00 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -5624,7 +5624,7 @@ sub_818CA64: @ 818CA64 ands r0, r1 cmp r0, 0 beq _0818CB54 - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers ldrb r0, [r6] bl sub_806D864 lsls r1, r0, 3 @@ -5870,7 +5870,7 @@ _0818CD60: strb r1, [r0] ldrb r0, [r5] lsls r3, r0, 9 - ldr r4, =gUnknown_02023068 + ldr r4, =gBattleBufferA + 4 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 diff --git a/asm/battle_controller_safari.s b/asm/battle_controller_safari.s new file mode 100644 index 000000000..3de3c2608 --- /dev/null +++ b/asm/battle_controller_safari.s @@ -0,0 +1,1412 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + + thumb_func_start nullsub_114 +nullsub_114: @ 8159368 + bx lr + thumb_func_end nullsub_114 + + thumb_func_start SetBankFuncToSafariBufferRunCommand +SetBankFuncToSafariBufferRunCommand: @ 815936C + ldr r1, =gBattleBankFunc + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =SafariBufferRunCommand + str r1, [r0] + bx lr + .pool + thumb_func_end SetBankFuncToSafariBufferRunCommand + + thumb_func_start SafariBufferRunCommand +SafariBufferRunCommand: @ 8159388 + push {lr} + ldr r2, =gBattleExecBuffer + ldr r1, =gBitTable + ldr r0, =gActiveBank + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _081593D4 + ldr r0, =gBattleBufferA + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _081593D0 + ldr r0, =gSafariBufferCommands + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _081593D4 + .pool +_081593D0: + bl SafariBufferExecCompleted +_081593D4: + pop {r0} + bx r0 + thumb_func_end SafariBufferRunCommand + + thumb_func_start bx_battle_menu_t6_2 +bx_battle_menu_t6_2: @ 81593D8 + push {r4,r5,lr} + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08159446 + movs r0, 0x5 + bl PlaySE + ldr r1, =gUnknown_020244AC + ldr r0, =gActiveBank + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08159424 + cmp r0, 0x1 + bgt _08159414 + cmp r0, 0 + beq _0815941E + b _08159440 + .pool +_08159414: + cmp r0, 0x2 + beq _0815942A + cmp r0, 0x3 + beq _08159436 + b _08159440 +_0815941E: + movs r0, 0x1 + movs r1, 0x5 + b _0815942E +_08159424: + movs r0, 0x1 + movs r1, 0x6 + b _0815942E +_0815942A: + movs r0, 0x1 + movs r1, 0x7 +_0815942E: + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + b _08159440 +_08159436: + movs r0, 0x1 + movs r1, 0x8 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb +_08159440: + bl SafariBufferExecCompleted + b _0815954E +_08159446: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08159484 + ldr r5, =gUnknown_020244AC + ldr r4, =gActiveBank + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0815954E + movs r0, 0x5 + bl PlaySE + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x1 + b _081594F2 + .pool +_08159484: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081594C0 + ldr r5, =gUnknown_020244AC + ldr r4, =gActiveBank + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0815954E + movs r0, 0x5 + bl PlaySE + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x1 + b _081594F2 + .pool +_081594C0: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0815950C + ldr r5, =gUnknown_020244AC + ldr r4, =gActiveBank + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0815954E + movs r0, 0x5 + bl PlaySE + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x2 +_081594F2: + eors r0, r2 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + b _0815954E + .pool +_0815950C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0815954E + ldr r5, =gUnknown_020244AC + ldr r4, =gActiveBank + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0815954E + movs r0, 0x5 + bl PlaySE + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x2 + eors r0, r2 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 +_0815954E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end bx_battle_menu_t6_2 + + thumb_func_start sub_815955C +sub_815955C: @ 815955C + push {lr} + ldr r2, =gSprites + ldr r1, =gBankSpriteIds + ldr r0, =gActiveBank + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _08159580 + bl SafariBufferExecCompleted +_08159580: + pop {r0} + bx r0 + .pool + thumb_func_end sub_815955C + + thumb_func_start bx_t6_button_a +bx_t6_button_a: @ 8159594 + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _081595A6 + bl SafariBufferExecCompleted +_081595A6: + pop {r0} + bx r0 + thumb_func_end bx_t6_button_a + + thumb_func_start sub_81595AC +sub_81595AC: @ 81595AC + push {lr} + ldr r2, =gSprites + ldr r1, =gHealthBoxesIds + ldr r0, =gActiveBank + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _081595D0 + bl SafariBufferExecCompleted +_081595D0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81595AC + + thumb_func_start sub_81595E4 +sub_81595E4: @ 81595E4 + push {lr} + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0815960E + ldr r2, =gMain + ldr r0, =0x00000439 + adds r3, r2, r0 + ldrb r1, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldr r0, =gUnknown_03005D00 + ldr r0, [r0] + str r0, [r2] + ldr r0, [r2, 0x8] + bl SetMainCallback2 +_0815960E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81595E4 + + thumb_func_start bx_wait_t6 +bx_wait_t6: @ 8159624 + push {lr} + ldr r0, =gDoingBattleAnim + ldrb r0, [r0] + cmp r0, 0 + beq _0815964A + ldr r0, =gUnknown_020244D0 + ldr r2, [r0] + ldr r0, =gActiveBank + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0815964E +_0815964A: + bl SafariBufferExecCompleted +_0815964E: + pop {r0} + bx r0 + .pool + thumb_func_end bx_wait_t6 + + thumb_func_start sub_8159660 +sub_8159660: @ 8159660 + push {lr} + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08159684 + ldr r1, =gBattleBankFunc + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8159698 + str r1, [r0] + bl FreeAllWindowBuffers + bl sub_81358F4 +_08159684: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159660 + + thumb_func_start sub_8159698 +sub_8159698: @ 8159698 + push {lr} + ldr r0, =gMain + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _081596BE + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081596BE + ldr r0, =gUnknown_0203CE7C + ldrh r1, [r0] + movs r0, 0x1 + bl dp01_build_cmdbuf_x23_aa_0 + bl SafariBufferExecCompleted +_081596BE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159698 + + thumb_func_start sub_81596D4 +sub_81596D4: @ 81596D4 + push {lr} + ldr r0, =gUnknown_020244D0 + ldr r2, [r0] + ldr r0, =gActiveBank + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081596F6 + bl SafariBufferExecCompleted +_081596F6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81596D4 + + thumb_func_start SafariBufferExecCompleted +SafariBufferExecCompleted: @ 8159704 + push {r4,lr} + sub sp, 0x4 + ldr r1, =gBattleBankFunc + ldr r4, =gActiveBank + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =SafariBufferRunCommand + str r1, [r0] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08159758 + bl GetMultiplayerId + mov r1, sp + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + mov r2, sp + bl PrepareBufferDataTransferLink + ldr r1, =gBattleBufferA + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _0815976A + .pool +_08159758: + ldr r2, =gBattleExecBuffer + ldr r1, =gBitTable + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_0815976A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end SafariBufferExecCompleted + + thumb_func_start bx_80364D0 +bx_80364D0: @ 815977C + push {lr} + ldr r0, =gUnknown_020244D0 + ldr r2, [r0] + ldr r0, =gActiveBank + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0815979E + bl SafariBufferExecCompleted +_0815979E: + pop {r0} + bx r0 + .pool + thumb_func_end bx_80364D0 + + thumb_func_start sub_81597AC +sub_81597AC: @ 81597AC + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81597AC + + thumb_func_start sub_81597B8 +sub_81597B8: @ 81597B8 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81597B8 + + thumb_func_start sub_81597C4 +sub_81597C4: @ 81597C4 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81597C4 + + thumb_func_start sub_81597D0 +sub_81597D0: @ 81597D0 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81597D0 + + thumb_func_start sub_81597DC +sub_81597DC: @ 81597DC + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81597DC + + thumb_func_start sub_81597E8 +sub_81597E8: @ 81597E8 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81597E8 + + thumb_func_start sub_81597F4 +sub_81597F4: @ 81597F4 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81597F4 + + thumb_func_start sub_8159800 +sub_8159800: @ 8159800 + push {r4-r6,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldrb r0, [r0, 0x8] + ldr r5, =gActiveBank + ldrb r1, [r5] + bl sub_805DF84 + ldr r0, [r4] + ldrb r6, [r0, 0x8] + ldrb r0, [r5] + bl GetBankIdentity + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl template_build_for_pokemon_or_trainer + ldr r0, =gUnknown_0202499C + ldr r2, =gUnknown_08305D2C + ldr r1, [r4] + ldrb r1, [r1, 0x8] + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0x8 + subs r2, r1 + lsls r2, 18 + movs r1, 0xA0 + lsls r1, 15 + adds r2, r1 + asrs r2, 16 + movs r1, 0x50 + movs r3, 0x1E + bl CreateSprite + ldr r6, =gBankSpriteIds + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =gSprites + ldrb r3, [r5] + adds r0, r3, r6 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xF0 + strh r1, [r0, 0x24] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000fffe + strh r1, [r0, 0x2E] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =sub_805D7AC + str r1, [r0] + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_815955C + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159800 + + thumb_func_start sub_81598E0 +sub_81598E0: @ 81598E0 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81598E0 + + thumb_func_start sub_81598EC +sub_81598EC: @ 81598EC + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81598EC + + thumb_func_start sub_81598F8 +sub_81598F8: @ 81598F8 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81598F8 + + thumb_func_start sub_8159904 +sub_8159904: @ 8159904 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159904 + + thumb_func_start sub_8159910 +sub_8159910: @ 8159910 + push {r4,r5,lr} + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r1, [r0, 0x8] + movs r0, 0x4 + strb r0, [r1, 0x8] + ldr r1, =gDoingBattleAnim + movs r0, 0x1 + strb r0, [r1] + ldr r5, =gActiveBank + ldrb r4, [r5] + movs r0, 0x1 + bl GetBankByPlayerAI + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x4 + bl move_anim_start_t4 + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_wait_t6 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159910 + + thumb_func_start sub_8159964 +sub_8159964: @ 8159964 + push {r4,r5,lr} + ldr r1, =gBattleBufferA + ldr r5, =gActiveBank + ldrb r0, [r5] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + strb r1, [r0, 0x8] + ldr r1, =gDoingBattleAnim + movs r0, 0x1 + strb r0, [r1] + ldrb r4, [r5] + movs r0, 0x1 + bl GetBankByPlayerAI + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x4 + bl move_anim_start_t4 + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_wait_t6 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159964 + + thumb_func_start sub_81599C4 +sub_81599C4: @ 81599C4 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81599C4 + + thumb_func_start sub_81599D0 +sub_81599D0: @ 81599D0 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81599D0 + + thumb_func_start dp01t_10_6_message +dp01t_10_6_message: @ 81599DC + push {r4,lr} + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r4, =gActiveBank + ldrb r0, [r4] + lsls r0, 9 + ldr r1, =gBattleBufferA + 2 + adds r0, r1 + ldrh r0, [r0] + bl BufferStringBattle + ldr r0, =gDisplayedStringBattle + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_t6_button_a + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_10_6_message + + thumb_func_start dp01t_11_6_message_for_player_only +dp01t_11_6_message_for_player_only: @ 8159A30 + push {lr} + ldr r0, =gActiveBank + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _08159A4C + bl dp01t_10_6_message + b _08159A50 + .pool +_08159A4C: + bl SafariBufferExecCompleted +_08159A50: + pop {r0} + bx r0 + thumb_func_end dp01t_11_6_message_for_player_only + + thumb_func_start sub_8159A54 +sub_8159A54: @ 8159A54 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08159A7A + ldr r0, =gUnknown_02022E14 + strh r1, [r0] + ldr r1, =gUnknown_02022E16 + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gBattleBankFunc + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_battle_menu_t6_2 + str r1, [r0] +_08159A7A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159A54 + + thumb_func_start sub_8159A94 +sub_8159A94: @ 8159A94 + push {r4,lr} + ldr r1, =gBattleBankFunc + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8159A54 + str r1, [r0] + ldr r0, =gUnknown_085CCA54 + movs r1, 0x2 + bl battle_show_message_maybe + movs r4, 0 +_08159AAE: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8059CF8 + adds r4, 0x1 + cmp r4, 0x3 + ble _08159AAE + ldr r1, =gUnknown_020244AC + ldr r0, =gActiveBank + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + ldr r0, =gUnknown_085CCA04 + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle + movs r1, 0x1 + bl battle_show_message_maybe + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159A94 + + thumb_func_start sub_8159AFC +sub_8159AFC: @ 8159AFC + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159AFC + + thumb_func_start sub_8159B08 +sub_8159B08: @ 8159B08 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159B08 + + thumb_func_start sub_8159B14 +sub_8159B14: @ 8159B14 + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gBattleBankFunc + ldr r2, =gActiveBank + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8159660 + str r1, [r0] + ldr r1, =gUnknown_020244B8 + ldrb r0, [r2] + strb r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159B14 + + thumb_func_start sub_8159B54 +sub_8159B54: @ 8159B54 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159B54 + + thumb_func_start sub_8159B60 +sub_8159B60: @ 8159B60 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159B60 + + thumb_func_start sub_8159B6C +sub_8159B6C: @ 8159B6C + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159B6C + + thumb_func_start sub_8159B78 +sub_8159B78: @ 8159B78 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159B78 + + thumb_func_start sub_8159B84 +sub_8159B84: @ 8159B84 + push {lr} + ldr r0, =gHealthBoxesIds + ldr r1, =gActiveBank + ldrb r1, [r1] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =gBattlePartyID + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =gPlayerParty + adds r1, r2 + movs r2, 0xB + bl healthbar_draw_field_maybe + bl SafariBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159B84 + + thumb_func_start sub_8159BC0 +sub_8159BC0: @ 8159BC0 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159BC0 + + thumb_func_start sub_8159BCC +sub_8159BCC: @ 8159BCC + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159BCC + + thumb_func_start sub_8159BD8 +sub_8159BD8: @ 8159BD8 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159BD8 + + thumb_func_start sub_8159BE4 +sub_8159BE4: @ 8159BE4 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159BE4 + + thumb_func_start sub_8159BF0 +sub_8159BF0: @ 8159BF0 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159BF0 + + thumb_func_start sub_8159BFC +sub_8159BFC: @ 8159BFC + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159BFC + + thumb_func_start sub_8159C08 +sub_8159C08: @ 8159C08 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159C08 + + thumb_func_start sub_8159C14 +sub_8159C14: @ 8159C14 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159C14 + + thumb_func_start sub_8159C20 +sub_8159C20: @ 8159C20 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159C20 + + thumb_func_start sub_8159C2C +sub_8159C2C: @ 8159C2C + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159C2C + + thumb_func_start sub_8159C38 +sub_8159C38: @ 8159C38 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159C38 + + thumb_func_start sub_8159C44 +sub_8159C44: @ 8159C44 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159C44 + + thumb_func_start sub_8159C50 +sub_8159C50: @ 8159C50 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159C50 + + thumb_func_start sub_8159C5C +sub_8159C5C: @ 8159C5C + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159C5C + + thumb_func_start sub_8159C68 +sub_8159C68: @ 8159C68 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159C68 + + thumb_func_start sub_8159C74 +sub_8159C74: @ 8159C74 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159C74 + + thumb_func_start sub_8159C80 +sub_8159C80: @ 8159C80 + push {r4,lr} + ldr r4, =gActiveBank + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _08159C94 + movs r3, 0xC0 +_08159C94: + ldr r2, =gBattleBufferA + ldrb r1, [r4] + lsls r1, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + lsls r1, r3, 24 + asrs r1, 24 + bl PlaySE12WithPanning + bl SafariBufferExecCompleted + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159C80 + + thumb_func_start dp01t_34_6_move_anim_start_t3 +dp01t_34_6_move_anim_start_t3: @ 8159CC4 + push {r4,r5,lr} + ldr r4, =gBattleBufferA + ldr r5, =gActiveBank + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _08159D00 + bl sub_805EA60 + ldrb r1, [r5] + lsls r1, 9 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, r4, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl PlayBGM + b _08159D14 + .pool +_08159D00: + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl PlayFanfare +_08159D14: + bl SafariBufferExecCompleted + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp01t_34_6_move_anim_start_t3 + + thumb_func_start sub_8159D20 +sub_8159D20: @ 8159D20 + push {lr} + ldr r1, =gBattlePartyID + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + bl PlayCry1 + bl SafariBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159D20 + + thumb_func_start dp01t_2E_6_battle_intro +dp01t_2E_6_battle_intro: @ 8159D5C + push {lr} + ldr r1, =gBattleBufferA + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =gUnknown_020243FC + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl SafariBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_2E_6_battle_intro + + thumb_func_start sub_8159D90 +sub_8159D90: @ 8159D90 + push {r4,r5,lr} + ldr r5, =gHealthBoxesIds + ldr r4, =gActiveBank + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =gBattlePartyID + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =gPlayerParty + adds r1, r2 + movs r2, 0xA + bl healthbar_draw_field_maybe + ldrb r0, [r4] + bl sub_8076918 + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_80729D0 + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81595AC + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159D90 + + thumb_func_start sub_8159DEC +sub_8159DEC: @ 8159DEC + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159DEC + + thumb_func_start sub_8159DF8 +sub_8159DF8: @ 8159DF8 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159DF8 + + thumb_func_start sub_8159E04 +sub_8159E04: @ 8159E04 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159E04 + + thumb_func_start sub_8159E10 +sub_8159E10: @ 8159E10 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159E10 + + thumb_func_start sub_8159E1C +sub_8159E1C: @ 8159E1C + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, =gBattleBufferA + ldr r6, =gActiveBank + ldrb r2, [r6] + lsls r1, r2, 9 + adds r0, r5, 0x1 + adds r0, r1, r0 + ldrb r3, [r0] + adds r0, r5, 0x2 + adds r0, r1, r0 + ldrb r4, [r0] + adds r5, 0x3 + adds r1, r5 + ldrb r0, [r1] + lsls r0, 8 + orrs r4, r0 + str r4, [sp] + adds r0, r2, 0 + adds r1, r2, 0 + bl move_anim_start_t3 + lsls r0, 24 + cmp r0, 0 + beq _08159E5C + bl SafariBufferExecCompleted + b _08159E68 + .pool +_08159E5C: + ldr r0, =gBattleBankFunc + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_81596D4 + str r0, [r1] +_08159E68: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159E1C + + thumb_func_start sub_8159E78 +sub_8159E78: @ 8159E78 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159E78 + + thumb_func_start sub_8159E84 +sub_8159E84: @ 8159E84 + push {lr} + bl SafariBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8159E84 + + thumb_func_start sub_8159E90 +sub_8159E90: @ 8159E90 + push {r4,lr} + ldr r2, =gBattleOutcome + ldr r1, =gBattleBufferA + ldr r4, =gActiveBank + ldrb r0, [r4] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0x5 + bl FadeOutMapMusic + movs r0, 0x3 + bl BeginFastPaletteFade + bl SafariBufferExecCompleted + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x6 + ands r0, r1 + cmp r0, 0x2 + bne _08159ECC + ldr r0, =gBattleBankFunc + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_81595E4 + str r0, [r1] +_08159ECC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159E90 + + thumb_func_start nullsub_115 +nullsub_115: @ 8159EEC + bx lr + thumb_func_end nullsub_115 + + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_controller_wally.s b/asm/battle_controller_wally.s index 895b0711c..c00988ed2 100644 --- a/asm/battle_controller_wally.s +++ b/asm/battle_controller_wally.s @@ -444,7 +444,7 @@ _081686D2: lsls r0, 2 add r0, r8 bl DestroySprite - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds ldrb r0, [r5] adds r1, r6, 0 eors r1, r0 @@ -480,7 +480,7 @@ _0816877A: ldr r1, =gSprites adds r0, r1 bl DestroySprite - ldr r5, =gUnknown_03005D70 + ldr r5, =gHealthBoxesIds ldrb r1, [r4] adds r0, r1, r5 ldrb r0, [r0] @@ -530,7 +530,7 @@ sub_8168818: @ 8168818 push {r7} movs r4, 0 ldr r2, =gSprites - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds ldr r1, =gActiveBank mov r8, r1 ldrb r3, [r1] @@ -653,7 +653,7 @@ sub_8168934: @ 8168934 push {r4-r6,lr} ldr r5, =gActiveBank ldrb r0, [r5] - ldr r6, =gUnknown_03005D70 + ldr r6, =gHealthBoxesIds adds r1, r0, r6 ldrb r1, [r1] movs r2, 0 @@ -792,7 +792,7 @@ sub_8168A20: @ 8168A20 lsls r0, 2 adds r0, r4 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -871,7 +871,7 @@ WallyBufferExecCompleted: @ 8168AF8 ands r0, r1 cmp r0, 0 beq _08168B4C - bl link_get_multiplayer_id + bl GetMultiplayerId mov r1, sp strb r0, [r1] movs r0, 0x2 @@ -1925,7 +1925,7 @@ sub_8169424: @ 8169424 ldr r0, =gActiveBank ldrb r0, [r0] lsls r0, 9 - ldr r2, =gUnknown_02023067 + ldr r2, =gBattleBufferA + 3 adds r3, r0, r2 adds r6, r3, 0 subs r1, r2, 0x2 @@ -3011,7 +3011,7 @@ _08169E80: lsls r0, 2 adds r0, r4 bl DestroySprite - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] @@ -3600,11 +3600,11 @@ sub_816A3B8: @ 816A3B8 ldr r4, =gActiveBank ldrb r0, [r4] lsls r0, 9 - ldr r1, =gUnknown_02023066 + ldr r1, =gBattleBufferA + 2 adds r0, r1 ldrh r0, [r0] - bl battle_pick_message - ldr r0, =gUnknown_02022E2C + bl BufferStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r1, =gBattleBankFunc @@ -3693,8 +3693,8 @@ _0816A48A: movs r1, 0 bl sub_8059CB4 ldr r0, =gUnknown_085CCA15 - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0x1 bl battle_show_message_maybe pop {r4} @@ -3878,7 +3878,7 @@ sub_816A5D4: @ 816A5D4 adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 + ldr r1, =gHealthBoxesIds adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] @@ -3900,7 +3900,7 @@ _0816A664: adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] - ldr r4, =gUnknown_03005D70 + ldr r4, =gHealthBoxesIds adds r1, r0, r4 ldrb r1, [r1] str r7, [sp] @@ -4296,7 +4296,7 @@ sub_816A90C: @ 816A90C lsls r0, 2 adds r0, r5 ldr r1, =sub_805CC00 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] @@ -4637,7 +4637,7 @@ _0816ACA8: strb r1, [r0] ldrb r0, [r5] lsls r4, r0, 9 - ldr r3, =gUnknown_02023068 + ldr r3, =gBattleBufferA + 4 adds r1, r4, r3 subs r2, r3, 0x3 adds r2, r4, r2 diff --git a/asm/battle_message.s b/asm/battle_message.s index 6bd3f6835..c224df9f9 100644 --- a/asm/battle_message.s +++ b/asm/battle_message.s @@ -5,8 +5,8 @@ .text - thumb_func_start battle_pick_message -battle_pick_message: @ 814E0C4 + thumb_func_start BufferStringBattle +BufferStringBattle: @ 814E0C4 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -15,15 +15,15 @@ battle_pick_message: @ 814E0C4 lsls r0, 16 lsrs r6, r0, 16 movs r7, 0 - ldr r4, =gUnknown_0203ABA8 + ldr r4, =gStringInfo ldr r0, =gActiveBank mov r8, r0 ldrb r1, [r0] lsls r1, 9 - ldr r0, =gUnknown_02023068 + ldr r0, =gBattleBufferA + 4 adds r1, r0 str r1, [r4] - ldr r2, =gUnknown_02024208 + ldr r2, =gLastUsedItem ldrh r0, [r1, 0x4] strh r0, [r2] ldr r2, =gLastUsedAbility @@ -55,7 +55,7 @@ battle_pick_message: @ 814E0C4 mov r9, r5 ldr r1, =gBattleTextBuff1 mov r10, r1 - ldr r3, =gUnknown_0203ABA4 + ldr r3, =gAbilitiesPerBank _0814E126: adds r0, r2, r3 ldr r1, [r4] @@ -69,9 +69,9 @@ _0814E126: movs r2, 0 ldr r0, =gBattleTextBuff1 mov r8, r0 - ldr r3, =gUnknown_0203ABA8 + ldr r3, =gStringInfo ldr r5, =gBattleTextBuff2 - ldr r4, =gUnknown_02022F78 + ldr r4, =gBattleTextBuff3 _0814E144: mov r0, r8 adds r1, r2, r0 @@ -145,7 +145,7 @@ _0814E200: b _0814E6D8 .pool _0814E214: - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] movs r0, 0xC0 lsls r0, 4 @@ -302,7 +302,7 @@ _0814E368: ands r1, r0 cmp r1, 0 beq _0814E380 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] movs r0, 0xC0 lsls r0, 4 @@ -353,7 +353,7 @@ _0814E3E0: b _0814E6D8 .pool _0814E3EC: - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] movs r0, 0x80 lsls r0, 4 @@ -444,7 +444,7 @@ _0814E4AC: b _0814E6D8 .pool _0814E4BC: - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] movs r0, 0xC0 lsls r0, 4 @@ -475,7 +475,7 @@ _0814E4F2: _0814E4F8: mov r0, r10 bl sub_814F8F8 - ldr r0, =gUnknown_0203ABA8 + ldr r0, =gStringInfo ldr r2, [r0] ldrh r1, [r2] movs r0, 0xB1 @@ -609,7 +609,7 @@ _0814E630: b _0814E6D8 .pool _0814E638: - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] movs r0, 0xC0 lsls r0, 4 @@ -673,7 +673,7 @@ _0814E6B8: lsls r0, 1 cmp r6, r0 bls _0814E6CC - ldr r1, =gUnknown_02022E2C + ldr r1, =gDisplayedStringBattle movs r0, 0xFF strb r0, [r1] b _0814E6DE @@ -687,7 +687,7 @@ _0814E6CC: ldr r7, [r0] _0814E6D8: adds r0, r7, 0 - bl get_battle_strings_ + bl StrCpyDecodeToDisplayedStringBattle _0814E6DE: pop {r3-r5} mov r8, r3 @@ -697,20 +697,20 @@ _0814E6DE: pop {r0} bx r0 .pool - thumb_func_end battle_pick_message + thumb_func_end BufferStringBattle - thumb_func_start get_battle_strings_ -get_battle_strings_: @ 814E6F0 + thumb_func_start StrCpyDecodeToDisplayedStringBattle +StrCpyDecodeToDisplayedStringBattle: @ 814E6F0 push {lr} - ldr r1, =gUnknown_02022E2C - bl get_battle_strings + ldr r1, =gDisplayedStringBattle + bl StrCpyDecodeBattle pop {r1} bx r1 .pool - thumb_func_end get_battle_strings_ + thumb_func_end StrCpyDecodeToDisplayedStringBattle - thumb_func_start sub_814E700 -sub_814E700: @ 814E700 + thumb_func_start AppendStatusString +AppendStatusString: @ 814E700 push {r4,r5,lr} sub sp, 0x8 adds r4, r0, 0 @@ -761,10 +761,10 @@ _0814E75A: pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_814E700 + thumb_func_end AppendStatusString - thumb_func_start get_battle_strings -get_battle_strings: @ 814E764 + thumb_func_start StrCpyDecodeBattle +StrCpyDecodeBattle: @ 814E764 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -786,7 +786,7 @@ get_battle_strings: @ 814E764 b _0814E79C .pool _0814E794: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r7, r0, 24 _0814E79C: @@ -878,7 +878,7 @@ _0814E8A0: .pool _0814E8B8: adds r0, r5, 0 - bl sub_814E700 + bl AppendStatusString adds r4, r0, 0 cmp r4, 0 beq _0814E8C8 @@ -895,7 +895,7 @@ _0814E8CE: b _0814E8EE .pool _0814E8E4: - ldr r1, =gUnknown_02022F78 + ldr r1, =gBattleTextBuff3 ldrb r0, [r1] cmp r0, 0xFD bne _0814E904 @@ -904,7 +904,7 @@ _0814E8EE: adds r0, r1, 0 _0814E8F0: adds r1, r4, 0 - bl sub_814F648 + bl StrCpyDecodeBattleTextBuff bl _0814F5C0 .pool _0814E904: @@ -1000,7 +1000,7 @@ _0814E9C8: .pool _0814E9FC: ldr r2, =gBattlePartyID - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers lsls r0, r7, 3 subs r0, r7 lsls r0, 2 @@ -1022,7 +1022,7 @@ _0814E9FC: .pool _0814EA38: ldr r2, =gBattlePartyID - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers lsls r0, r7, 3 subs r0, r7 lsls r0, 2 @@ -1046,7 +1046,7 @@ _0814EA38: .pool _0814EA78: ldr r2, =gBattlePartyID - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers lsls r0, r7, 3 subs r0, r7 lsls r0, 2 @@ -1070,7 +1070,7 @@ _0814EA78: .pool _0814EAB8: ldr r2, =gBattlePartyID - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers lsls r0, r7, 3 subs r0, r7 lsls r0, 2 @@ -1544,7 +1544,7 @@ _0814EF32: b _0814F5BE .pool _0814EF44: - ldr r0, =gUnknown_0203ABA8 + ldr r0, =gStringInfo ldr r2, [r0] ldrh r1, [r2] movs r0, 0xB1 @@ -1555,7 +1555,7 @@ _0814EF44: b _0814EF8A .pool _0814EF5C: - ldr r0, =gUnknown_0203ABA8 + ldr r0, =gStringInfo ldr r2, [r0] ldrh r1, [r2, 0x2] movs r0, 0xB1 @@ -1589,7 +1589,7 @@ _0814EF98: ands r0, r1 cmp r0, 0 beq _0814F06E - ldr r2, =gUnknown_02024208 + ldr r2, =gLastUsedItem ldrh r0, [r2] cmp r0, 0xAF bne _0814F064 @@ -1632,7 +1632,7 @@ _0814EFEC: b _0814F5BE .pool _0814F014: - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers ldr r0, =gBattleScripting adds r0, 0x25 ldrb r1, [r0] @@ -1667,7 +1667,7 @@ _0814F064: bl CopyItemName b _0814F5BE _0814F06E: - ldr r0, =gUnknown_02024208 + ldr r0, =gLastUsedItem ldrh r0, [r0] mov r1, sp bl CopyItemName @@ -1678,23 +1678,23 @@ _0814F080: b _0814F0C0 .pool _0814F088: - ldr r1, =gUnknown_0203ABA4 + ldr r1, =gAbilitiesPerBank ldr r0, =gBankAttacker b _0814F0BC .pool _0814F098: - ldr r1, =gUnknown_0203ABA4 + ldr r1, =gAbilitiesPerBank ldr r0, =gBankTarget b _0814F0BC .pool _0814F0A8: - ldr r1, =gUnknown_0203ABA4 + ldr r1, =gAbilitiesPerBank ldr r0, =gBattleScripting ldrb r0, [r0, 0x17] b _0814F0BE .pool _0814F0B8: - ldr r1, =gUnknown_0203ABA4 + ldr r1, =gAbilitiesPerBank ldr r0, =gUnknown_0202420E _0814F0BC: ldrb r0, [r0] @@ -1716,11 +1716,11 @@ _0814F0D8: ands r0, r1 cmp r0, 0 beq _0814F0F0 - bl sub_806B870 + bl GetSecretBaseTrainerNameIndex b _0814F59C .pool _0814F0F0: - ldr r3, =gUnknown_02038BCA + ldr r3, =gTrainerBattleOpponent_A ldrh r2, [r3] movs r0, 0xC0 lsls r0, 4 @@ -1808,7 +1808,7 @@ _0814F178: b _0814F5BE .pool _0814F1AC: - ldr r3, =gUnknown_02038BCA + ldr r3, =gTrainerBattleOpponent_A ldrh r2, [r3] movs r0, 0xC0 lsls r0, 4 @@ -1867,12 +1867,12 @@ _0814F220: lsls r0, r7, 3 subs r0, r7 lsls r0, 2 - ldr r1, =gUnknown_020229F0 + ldr r1, =gLinkPlayers + 8 adds r4, r0, r1 b _0814F5C0 .pool _0814F230: - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers lsls r0, r7, 3 subs r0, r7 lsls r0, 2 @@ -1882,7 +1882,7 @@ _0814F230: b _0814F266 .pool _0814F244: - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers lsls r0, r7, 3 subs r0, r7 lsls r0, 2 @@ -1892,7 +1892,7 @@ _0814F244: b _0814F266 .pool _0814F258: - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers lsls r0, r7, 3 subs r0, r7 lsls r0, 2 @@ -1917,7 +1917,7 @@ _0814F284: lsls r1, r0, 3 subs r1, r0 lsls r1, 2 - ldr r0, =gUnknown_020229F0 + ldr r0, =gLinkPlayers + 8 adds r4, r1, r0 b _0814F5C0 .pool @@ -1929,7 +1929,7 @@ _0814F298: ands r0, r1 cmp r0, 0 beq _0814F2B4 - ldr r4, =gUnknown_020229F0 + ldr r4, =gLinkPlayers + 8 b _0814F5C0 .pool _0814F2B4: @@ -1944,7 +1944,7 @@ _0814F2C0: ands r0, r1 cmp r0, 0 beq _0814F2E0 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] movs r0, 0x2 b _0814F55A @@ -1955,7 +1955,7 @@ _0814F2E0: ands r1, r0 cmp r1, 0 beq _0814F2F8 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] movs r0, 0x4 b _0814F584 @@ -1971,7 +1971,7 @@ _0814F300: ands r0, r1 cmp r0, 0 beq _0814F31C - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A b _0814F556 .pool _0814F31C: @@ -1982,7 +1982,7 @@ _0814F31C: bne _0814F328 b _0814F5C0 _0814F328: - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A b _0814F580 .pool _0814F330: @@ -2120,7 +2120,7 @@ _0814F468: ands r0, r1 cmp r0, 0 beq _0814F484 - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B b _0814F596 .pool _0814F484: @@ -2129,14 +2129,14 @@ _0814F484: ands r1, r0 cmp r1, 0 beq _0814F49C - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r0, [r0] bl sub_81D5530 b _0814F59C .pool _0814F49C: ldr r2, =gTrainers - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -2153,7 +2153,7 @@ _0814F4B8: ands r0, r1 cmp r0, 0 beq _0814F4D4 - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B b _0814F5B6 .pool _0814F4D4: @@ -2162,14 +2162,14 @@ _0814F4D4: ands r1, r0 cmp r1, 0 beq _0814F4F0 - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r1, [r0] mov r0, sp bl sub_81D5554 b _0814F5BE .pool _0814F4F0: - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -2185,7 +2185,7 @@ _0814F508: ands r0, r1 cmp r0, 0 beq _0814F528 - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r1, [r0] movs r0, 0x2 b _0814F55A @@ -2196,7 +2196,7 @@ _0814F528: ands r1, r0 cmp r1, 0 beq _0814F540 - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r1, [r0] movs r0, 0x4 b _0814F584 @@ -2212,7 +2212,7 @@ _0814F548: ands r0, r1 cmp r0, 0 beq _0814F574 - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B _0814F556: ldrh r1, [r0] movs r0, 0x1 @@ -2227,7 +2227,7 @@ _0814F574: ands r1, r0 cmp r1, 0 beq _0814F5C0 - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B _0814F580: ldrh r1, [r0] movs r0, 0x3 @@ -2335,10 +2335,10 @@ _0814F62A: pop {r4-r7} pop {r1} bx r1 - thumb_func_end get_battle_strings + thumb_func_end StrCpyDecodeBattle - thumb_func_start sub_814F648 -sub_814F648: @ 814F648 + thumb_func_start StrCpyDecodeBattleTextBuff +StrCpyDecodeBattleTextBuff: @ 814F648 push {r4-r7,lr} mov r7, r8 push {r7} @@ -2598,7 +2598,7 @@ _0814F858: beq _0814F8D6 cmp r2, 0xAF bne _0814F8CC - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers ldr r0, =gBattleScripting adds r0, 0x25 ldrb r1, [r0] @@ -2652,14 +2652,14 @@ _0814F8EA: pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_814F648 + thumb_func_end StrCpyDecodeBattleTextBuff thumb_func_start sub_814F8F8 sub_814F8F8: @ 814F8F8 push {r4,r5,lr} adds r4, r0, 0 movs r2, 0 - ldr r5, =gUnknown_0203ABA8 + ldr r5, =gStringInfo ldr r3, =gUnknown_085CD336 _0814F902: cmp r2, 0x4 @@ -2710,7 +2710,7 @@ _0814F95A: cmp r0, 0xFF bne _0814F958 ldr r1, =gUnknown_085CD336 - ldr r5, =gUnknown_0203ABA8 + ldr r5, =gStringInfo movs r0, 0 lsls r0, 1 adds r2, r0, r1 @@ -2995,7 +2995,7 @@ sub_814FBAC: @ 814FBAC ldr r0, =gActiveBank ldrb r2, [r0] lsls r1, r2, 9 - ldr r0, =gUnknown_02023068 + ldr r0, =gBattleBufferA + 4 adds r1, r0 ldr r4, =gUnknown_08D85620 ldr r0, =gUnknown_020244B0 diff --git a/asm/battle_records.s b/asm/battle_records.s index f7be16379..e386b14c7 100644 --- a/asm/battle_records.s +++ b/asm/battle_records.s @@ -311,7 +311,7 @@ sub_813C170: @ 813C170 strh r7, [r4, 0x8] adds r2, r6, 0 adds r2, 0x54 - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers mov r3, r9 lsls r0, r3, 3 subs r0, r3 @@ -507,7 +507,7 @@ sub_813C2F4: @ 813C2F4 str r1, [sp, 0x8] movs r1, 0x1 adds r2, r4, 0 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r4} pop {r0} @@ -544,7 +544,7 @@ sub_813C384: @ 813C384 str r7, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow mov r1, r8 ldrb r0, [r1] ldr r5, =gUnknown_085B3D8C @@ -554,7 +554,7 @@ sub_813C384: @ 813C384 movs r1, 0x1 adds r2, r5, 0 movs r3, 0x50 - bl Print + bl PrintTextOnWindow mov r1, r8 ldrb r0, [r1] str r4, [sp] @@ -563,7 +563,7 @@ sub_813C384: @ 813C384 movs r1, 0x1 adds r2, r5, 0 movs r3, 0x80 - bl Print + bl PrintTextOnWindow mov r1, r8 ldrb r0, [r1] str r4, [sp] @@ -572,7 +572,7 @@ sub_813C384: @ 813C384 movs r1, 0x1 adds r2, r5, 0 movs r3, 0xB0 - bl Print + bl PrintTextOnWindow b _0813C4A8 .pool _0813C40C: @@ -601,7 +601,7 @@ _0813C40C: movs r1, 0x1 ldr r2, =gStringVar1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldrh r1, [r6, 0xA] ldr r0, =gStringVar1 movs r2, 0x1 @@ -615,7 +615,7 @@ _0813C40C: movs r1, 0x1 ldr r2, =gStringVar1 movs r3, 0x50 - bl Print + bl PrintTextOnWindow ldrh r1, [r6, 0xC] ldr r0, =gStringVar1 movs r2, 0x1 @@ -629,7 +629,7 @@ _0813C40C: movs r1, 0x1 ldr r2, =gStringVar1 movs r3, 0x80 - bl Print + bl PrintTextOnWindow ldrh r1, [r6, 0xE] ldr r0, =gStringVar1 movs r2, 0x1 @@ -643,7 +643,7 @@ _0813C40C: movs r1, 0x1 ldr r2, =gStringVar1 movs r3, 0xB0 - bl Print + bl PrintTextOnWindow _0813C4A8: add sp, 0xC pop {r3} @@ -689,7 +689,7 @@ sub_813C4BC: @ 813C4BC str r4, [sp, 0x4] str r4, [sp, 0x8] adds r2, r5, 0 - bl Print + bl PrintTextOnWindow ldr r0, =gSaveBlock1Ptr mov r8, r0 ldr r0, [r0] @@ -708,7 +708,7 @@ sub_813C4BC: @ 813C4BC movs r1, 0x1 adds r2, r5, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow mov r7, r8 movs r6, 0xE0 lsls r6, 19 diff --git a/asm/battle_setup.s b/asm/battle_setup.s index a4b143703..9418c4d1d 100644 --- a/asm/battle_setup.s +++ b/asm/battle_setup.s @@ -35,7 +35,7 @@ _080B0614: strh r0, [r4] b _080B0652 _080B062E: - bl sub_8145F20 + bl IsBattleTransitionDone lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -108,7 +108,7 @@ sub_80B06B0: @ 80B06B0 thumb_func_start sub_80B06BC sub_80B06BC: @ 80B06BC push {r4,lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl player_bitmagic bl sub_808BCF4 ldr r1, =gMain @@ -150,7 +150,7 @@ _080B06F2: thumb_func_start sub_80B072C sub_80B072C: @ 80B072C push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl player_bitmagic bl sub_808BCF4 ldr r1, =gMain @@ -179,7 +179,7 @@ sub_80B072C: @ 80B072C thumb_func_start sub_80B077C sub_80B077C: @ 80B077C push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl player_bitmagic bl sub_808BCF4 ldr r1, =gMain @@ -201,7 +201,7 @@ sub_80B077C: @ 80B077C thumb_func_start sub_80B07B4 sub_80B07B4: @ 80B07B4 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl player_bitmagic bl sub_808BCF4 ldr r1, =gMain @@ -282,8 +282,8 @@ sub_80B086C: @ 80B086C movs r1, 0xC4 lsls r1, 1 movs r2, 0x5 - bl sub_8067FF8 - bl script_env_2_enable + bl CreateMaleMon + bl ScriptContext2_Enable ldr r1, =gMain ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music str r0, [r1, 0x8] @@ -302,7 +302,7 @@ sub_80B086C: @ 80B086C thumb_func_start sub_80B08A8 sub_80B08A8: @ 80B08A8 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable ldr r1, =gMain ldr r0, =sub_80B0B6C str r0, [r1, 0x8] @@ -328,7 +328,7 @@ sub_80B08A8: @ 80B08A8 thumb_func_start sub_80B08EC sub_80B08EC: @ 80B08EC push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable ldr r1, =gMain ldr r0, =sub_80B0B6C str r0, [r1, 0x8] @@ -355,7 +355,7 @@ sub_80B08EC: @ 80B08EC thumb_func_start sub_80B0934 sub_80B0934: @ 80B0934 push {r4,lr} - bl script_env_2_enable + bl ScriptContext2_Enable ldr r1, =gMain ldr r0, =sub_80B0B6C str r0, [r1, 0x8] @@ -457,7 +457,7 @@ _080B09FE: thumb_func_start sub_80B0A18 sub_80B0A18: @ 80B0A18 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable ldr r1, =gMain ldr r0, =sub_80B0B6C str r0, [r1, 0x8] @@ -494,7 +494,7 @@ _080B0A5A: thumb_func_start sub_80B0A74 sub_80B0A74: @ 80B0A74 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable ldr r1, =gMain ldr r0, =sub_80B0B6C str r0, [r1, 0x8] @@ -1082,7 +1082,7 @@ _080B0F2E: thumb_func_start reads_trainer_data_byte1_byte0x18 reads_trainer_data_byte1_byte0x18: @ 80B0F34 push {r4-r6,lr} - ldr r4, =gUnknown_02038BCA + ldr r4, =gTrainerBattleOpponent_A ldrh r1, [r4] movs r0, 0x80 lsls r0, 3 @@ -1375,7 +1375,7 @@ sub_80B11A8: @ 80B11A8 push {lr} bl UpdatePaletteFade bl RunTasks - bl sub_8145F20 + bl IsBattleTransitionDone lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1481,7 +1481,7 @@ TrainerBattleLoadArg8: @ 80B1274 thumb_func_start trainerflag_opponent trainerflag_opponent: @ 80B1278 - ldr r1, =gUnknown_02038BCA + ldr r1, =gTrainerBattleOpponent_A movs r2, 0xA0 lsls r2, 3 adds r0, r2, 0 @@ -1495,7 +1495,7 @@ trainerflag_opponent: @ 80B1278 thumb_func_start sub_80B1290 sub_80B1290: @ 80B1290 - ldr r1, =gUnknown_02038BCC + ldr r1, =gTrainerBattleOpponent_B movs r2, 0xA0 lsls r2, 3 adds r0, r2, 0 @@ -1540,10 +1540,10 @@ _080B12E2: thumb_func_start ResetTrainerOpponentIds ResetTrainerOpponentIds: @ 80B12E8 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A movs r1, 0 strh r1, [r0] - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B strh r1, [r0] bx lr .pool @@ -1765,7 +1765,7 @@ _080B14EC: adds r1, r5, 0 bl TrainerBattleLoadArgs bl battle_80801F0 - ldr r4, =gUnknown_02038BCA + ldr r4, =gTrainerBattleOpponent_A ldrh r0, [r4] bl sub_80B2234 strh r0, [r4] @@ -1777,7 +1777,7 @@ _080B1514: adds r1, r5, 0 bl TrainerBattleLoadArgs bl battle_80801F0 - ldr r4, =gUnknown_02038BCA + ldr r4, =gTrainerBattleOpponent_A ldrh r0, [r4] bl sub_80B2234 strh r0, [r4] @@ -1796,7 +1796,7 @@ _080B153C: ldr r0, =gScriptLastTalked ldrb r0, [r0] bl sub_81A9AA8 - ldr r1, =gUnknown_02038BCA + ldr r1, =gTrainerBattleOpponent_A b _080B157E .pool _080B156C: @@ -1807,7 +1807,7 @@ _080B156C: ldrb r0, [r0] bl sub_81A9AA8 _080B157C: - ldr r1, =gUnknown_02038BCC + ldr r1, =gTrainerBattleOpponent_B _080B157E: strh r0, [r1] b _080B161C @@ -1836,7 +1836,7 @@ _080B15A8: ldr r0, =gScriptLastTalked ldrb r0, [r0] bl battle_init - ldr r1, =gUnknown_02038BCA + ldr r1, =gTrainerBattleOpponent_A b _080B157E .pool _080B15D8: @@ -1894,8 +1894,8 @@ SingleTrainerWantsBattle: @ 80B162C adds r0, r1, 0 bl TrainerBattleConfigure ldr r0, =gUnknown_08271354 - bl script_env_1_execute_new_script - bl script_env_2_enable + bl ScriptContext1_SetupScript + bl ScriptContext2_Enable pop {r4} pop {r0} bx r0 @@ -1932,8 +1932,8 @@ TwoTrainersWantBattle: @ 80B1670 TwoTrainersWantBattleExecuteScript: @ 80B16A4 push {lr} ldr r0, =gUnknown_08271354 - bl script_env_1_execute_new_script - bl script_env_2_enable + bl ScriptContext1_SetupScript + bl ScriptContext2_Enable pop {r0} bx r0 .pool @@ -2027,7 +2027,7 @@ _080B1752: thumb_func_start rom_npc_set_flag_for_script_id rom_npc_set_flag_for_script_id: @ 80B1760 push {lr} - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r0, [r0] cmp r0, 0 beq _080B1776 @@ -2132,31 +2132,31 @@ _080B1800: bne _080B1864 movs r0, 0x1 bl sub_816306C - ldr r4, =gUnknown_020247A8 + ldr r4, =gEnemyParty + 100 adds r0, r4, 0 - bl zero_pokemon_struct + bl ZeroMonData adds r0, r4, 0 adds r0, 0x64 - bl zero_pokemon_struct + bl ZeroMonData movs r1, 0x96 lsls r1, 1 adds r0, r4, r1 - bl zero_pokemon_struct + bl ZeroMonData movs r1, 0xC8 lsls r1, 1 adds r0, r4, r1 - bl zero_pokemon_struct + bl ZeroMonData b _080B187A .pool _080B1864: movs r0, 0x1 bl sub_8163048 - ldr r4, =gUnknown_020247A8 + ldr r4, =gEnemyParty + 100 adds r0, r4, 0 - bl zero_pokemon_struct + bl ZeroMonData adds r4, 0x64 adds r0, r4, 0 - bl zero_pokemon_struct + bl ZeroMonData _080B187A: bl sub_81A9B04 b _080B18B8 @@ -2213,7 +2213,7 @@ _080B18E8: _080B1908: bl task_add_01_battle_start_with_music_and_stats _080B190C: - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop pop {r4} pop {r0} bx r0 @@ -2222,7 +2222,7 @@ _080B190C: thumb_func_start sub_80B1918 sub_80B1918: @ 80B1918 push {lr} - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] movs r0, 0x80 lsls r0, 3 @@ -2273,7 +2273,7 @@ _080B198A: thumb_func_start sub_80B1994 sub_80B1994: @ 80B1994 push {lr} - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] movs r0, 0x80 lsls r0, 3 @@ -2315,7 +2315,7 @@ sub_80B19EC: @ 80B19EC ldr r0, =sub_80B1994 str r0, [r1, 0x8] bl task_add_01_battle_start_with_music_and_stats - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop pop {r0} bx r0 .pool @@ -2481,11 +2481,11 @@ SetUpTrainerEncounterMusic: @ 80B1B70 ldrb r0, [r0] cmp r0, 0 bne _080B1B88 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A b _080B1B8A .pool _080B1B88: - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B _080B1B8A: ldrh r1, [r0] ldr r0, =gUnknown_02038BC8 @@ -2620,7 +2620,7 @@ _080B1C96: thumb_func_start sub_80B1CA4 sub_80B1CA4: @ 80B1CA4 push {r4,lr} - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] movs r0, 0x80 lsls r0, 3 @@ -3202,7 +3202,7 @@ sub_80B20BC: @ 80B20BC lsls r0, 24 cmp r0, 0 beq _080B20E2 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r0, [r0] bl sub_80B208C adds r1, r0, 0 @@ -3423,7 +3423,7 @@ sub_80B2250: @ 80B2250 sub_80B226C: @ 80B226C push {r4,r5,lr} ldr r5, =gUnknown_085500A4 - ldr r4, =gUnknown_02038BCA + ldr r4, =gTrainerBattleOpponent_A ldrh r1, [r4] adds r0, r5, 0 bl sub_80B1F38 @@ -3449,7 +3449,7 @@ _080B229A: sub_80B22A0: @ 80B22A0 push {lr} ldr r0, =gUnknown_085500A4 - ldr r1, =gUnknown_02038BCA + ldr r1, =gTrainerBattleOpponent_A ldrh r1, [r1] bl sub_80B1F74 lsls r0, 24 @@ -3463,7 +3463,7 @@ sub_80B22A0: @ 80B22A0 sub_80B22BC: @ 80B22BC push {lr} ldr r0, =gUnknown_085500A4 - ldr r1, =gUnknown_02038BCA + ldr r1, =gTrainerBattleOpponent_A ldrh r1, [r1] bl sub_80B205C bl rom_npc_set_flag_for_script_id diff --git a/asm/battle_transition.s b/asm/battle_transition.s index b6b0e3bf5..9709fb54f 100644 --- a/asm/battle_transition.s +++ b/asm/battle_transition.s @@ -4,6 +4,58 @@ .syntax unified .text + + thumb_func_start CB2_TestBattleTransition +CB2_TestBattleTransition: @ 8145E84 + push {r4,lr} + ldr r4, =sTestingTransitionState + ldrb r0, [r4] + cmp r0, 0 + beq _08145E98 + cmp r0, 0x1 + beq _08145EAC + b _08145EC0 + .pool +_08145E98: + ldr r0, =sTestingTransitionId + ldrb r0, [r0] + bl LaunchBattleTransitionTask + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _08145EC0 + .pool +_08145EAC: + bl IsBattleTransitionDone + lsls r0, 24 + cmp r0, 0 + beq _08145EC0 + movs r0, 0 + strb r0, [r4] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 +_08145EC0: + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl UpdatePaletteFade + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end CB2_TestBattleTransition + + thumb_func_start TestBattleTransition +TestBattleTransition: @ 8145EDC + push {lr} + ldr r1, =sTestingTransitionId + strb r0, [r1] + ldr r0, =CB2_TestBattleTransition + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end TestBattleTransition thumb_func_start sub_8145EF4 sub_8145EF4: @ 8145EF4 @@ -13,7 +65,7 @@ sub_8145EF4: @ 8145EF4 ldr r2, =gMain ldr r1, =sub_8085E50 str r1, [r2, 0x4] - bl sub_8145F6C + bl LaunchBattleTransitionTask pop {r0} bx r0 .pool @@ -24,15 +76,15 @@ sub_8145F10: @ 8145F10 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_8145F6C + bl LaunchBattleTransitionTask pop {r0} bx r0 thumb_func_end sub_8145F10 - thumb_func_start sub_8145F20 -sub_8145F20: @ 8145F20 + thumb_func_start IsBattleTransitionDone +IsBattleTransitionDone: @ 8145F20 push {r4,lr} - ldr r0, =sub_8145FA8 + ldr r0, =Task_BattleTransitionMain bl FindTaskIdByFunc lsls r0, 24 lsrs r2, r0, 24 @@ -51,7 +103,7 @@ sub_8145F20: @ 8145F20 _08145F4C: adds r0, r2, 0 bl DestroyTask - ldr r4, =gUnknown_0203ABA0 + ldr r4, =sTransitionStructPtr ldr r0, [r4] bl Free movs r0, 0 @@ -62,15 +114,15 @@ _08145F60: pop {r1} bx r1 .pool - thumb_func_end sub_8145F20 + thumb_func_end IsBattleTransitionDone - thumb_func_start sub_8145F6C -sub_8145F6C: @ 8145F6C + thumb_func_start LaunchBattleTransitionTask +LaunchBattleTransitionTask: @ 8145F6C push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =sub_8145FA8 + ldr r0, =Task_BattleTransitionMain movs r1, 0x2 bl CreateTask lsls r0, 24 @@ -81,7 +133,7 @@ sub_8145F6C: @ 8145F6C lsls r1, 3 adds r1, r2 strh r4, [r1, 0xA] - ldr r4, =gUnknown_0203ABA0 + ldr r4, =sTransitionStructPtr movs r0, 0x3C bl AllocZeroed str r0, [r4] @@ -89,10 +141,10 @@ sub_8145F6C: @ 8145F6C pop {r0} bx r0 .pool - thumb_func_end sub_8145F6C + thumb_func_end LaunchBattleTransitionTask - thumb_func_start sub_8145FA8 -sub_8145FA8: @ 8145FA8 + thumb_func_start Task_BattleTransitionMain +Task_BattleTransitionMain: @ 8145FA8 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 @@ -117,7 +169,7 @@ _08145FBA: pop {r0} bx r0 .pool - thumb_func_end sub_8145FA8 + thumb_func_end Task_BattleTransitionMain thumb_func_start sub_8145FE0 sub_8145FE0: @ 8145FE0 @@ -445,7 +497,7 @@ sub_814623C: @ 814623C movs r3, 0x10 bl BeginNormalPaletteFade ldr r0, =gUnknown_020393A8 - ldr r1, =gUnknown_0203ABA0 + ldr r1, =sTransitionStructPtr ldr r1, [r1] movs r2, 0x14 ldrsh r1, [r1, r2] @@ -476,7 +528,7 @@ sub_814623C: @ 814623C sub_81462A8: @ 81462A8 push {r4,r5,lr} sub sp, 0x8 - ldr r4, =gUnknown_0203ABA0 + ldr r4, =sTransitionStructPtr ldr r2, [r4] ldrb r1, [r2] movs r1, 0 @@ -530,7 +582,7 @@ _081462FA: sub_8146320: @ 8146320 push {lr} bl sub_8149F2C - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r0, [r0] ldrb r0, [r0] cmp r0, 0 @@ -615,7 +667,7 @@ sub_81463BC: @ 81463BC movs r2, 0 movs r3, 0x10 bl BeginNormalPaletteFade - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldr r0, =gUnknown_020393A8 movs r2, 0x16 @@ -643,7 +695,7 @@ sub_81463BC: @ 81463BC thumb_func_start sub_8146420 sub_8146420: @ 8146420 push {r4-r7,lr} - ldr r1, =gUnknown_0203ABA0 + ldr r1, =sTransitionStructPtr ldr r2, [r1] ldrb r1, [r2] movs r1, 0 @@ -669,7 +721,7 @@ _08146448: ldr r1, =gUnknown_02038C28 lsls r2, r5, 1 adds r2, r1 - ldr r6, =gUnknown_0203ABA0 + ldr r6, =sTransitionStructPtr ldr r1, [r6] ldrh r1, [r1, 0x16] adds r0, r1 @@ -712,7 +764,7 @@ _0814648E: sub_81464B0: @ 81464B0 push {lr} bl sub_8149F2C - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r0, [r0] ldrb r0, [r0] cmp r0, 0 @@ -964,7 +1016,7 @@ sub_814669C: @ 814669C movs r0, 0x80 lsls r0, 7 strh r0, [r4, 0x12] - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r2, [r0] movs r0, 0x3F strh r0, [r2, 0x2] @@ -1583,7 +1635,7 @@ sub_8146BF8: @ 8146BF8 push {r4,r5,lr} sub sp, 0x8 adds r3, r0, 0 - ldr r2, =gUnknown_0203ABA0 + ldr r2, =sTransitionStructPtr ldr r1, [r2] ldrb r0, [r1] movs r0, 0 @@ -1657,7 +1709,7 @@ sub_8146C8C: @ 8146C8C push {r4,r5,lr} sub sp, 0x8 adds r3, r0, 0 - ldr r2, =gUnknown_0203ABA0 + ldr r2, =sTransitionStructPtr ldr r1, [r2] ldrb r0, [r1] movs r0, 0 @@ -1731,7 +1783,7 @@ sub_8146D20: @ 8146D20 push {r4-r7,lr} sub sp, 0x8 adds r4, r0, 0 - ldr r7, =gUnknown_0203ABA0 + ldr r7, =sTransitionStructPtr ldr r0, [r7] ldrb r1, [r0] movs r6, 0 @@ -1847,7 +1899,7 @@ _08146DEE: sub_8146DF8: @ 8146DF8 push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r0, [r0] ldrb r1, [r0] movs r3, 0 @@ -1918,7 +1970,7 @@ _08146E90: ldr r0, =sub_8146F68 bl SetVBlankCallback _08146EA4: - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 @@ -1946,7 +1998,7 @@ sub_8146EC0: @ 8146EC0 strh r0, [r1, 0xA] ldrh r0, [r1, 0xA] bl sub_8149F2C - ldr r2, =gUnknown_0203ABA0 + ldr r2, =sTransitionStructPtr ldr r0, [r2] ldrb r0, [r0] cmp r0, 0 @@ -2347,7 +2399,7 @@ sub_814723C: @ 814723C adds r4, r0, 0 bl sub_8149F08 bl dp12_8087EA4 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] movs r0, 0 strh r0, [r1, 0x2] @@ -2371,7 +2423,7 @@ _08147262: bls _08147262 ldr r0, =sub_8147688 bl SetVBlankCallback - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] movs r0, 0x78 strh r0, [r1, 0x2C] @@ -2390,7 +2442,7 @@ sub_81472A4: @ 81472A4 push {r4-r7,lr} sub sp, 0xC adds r6, r0, 0 - ldr r2, =gUnknown_0203ABA0 + ldr r2, =sTransitionStructPtr ldr r1, [r2] ldrb r0, [r1] movs r0, 0 @@ -2411,7 +2463,7 @@ sub_81472A4: @ 81472A4 bl sub_814A1AC ldr r5, =gUnknown_02038C28 _081472D4: - ldr r4, =gUnknown_0203ABA0 + ldr r4, =sTransitionStructPtr ldr r0, [r4] movs r7, 0x2A ldrsh r3, [r0, r7] @@ -2469,7 +2521,7 @@ sub_8147334: @ 8147334 add r1, sp, 0xC movs r0, 0 strb r0, [r1] - ldr r4, =gUnknown_0203ABA0 + ldr r4, =sTransitionStructPtr ldr r1, [r4] ldrb r0, [r1] movs r0, 0 @@ -2548,7 +2600,7 @@ _081473DE: cmp r0, r2 bge _08147406 adds r3, r4, 0 - ldr r5, =gUnknown_0203ABA0 + ldr r5, =sTransitionStructPtr _081473EA: ldr r2, [r5] ldrh r0, [r2, 0x2A] @@ -2587,7 +2639,7 @@ sub_8147428: @ 8147428 push {r4-r6,lr} sub sp, 0xC adds r6, r0, 0 - ldr r2, =gUnknown_0203ABA0 + ldr r2, =sTransitionStructPtr ldr r1, [r2] ldrb r0, [r1] movs r0, 0 @@ -2607,7 +2659,7 @@ sub_8147428: @ 8147428 bl sub_814A1AC ldr r5, =gUnknown_02038C28 _08147456: - ldr r4, =gUnknown_0203ABA0 + ldr r4, =sTransitionStructPtr ldr r0, [r4] movs r1, 0x2A ldrsh r3, [r0, r1] @@ -2663,7 +2715,7 @@ sub_81474B0: @ 81474B0 add r1, sp, 0xC movs r0, 0 strb r0, [r1] - ldr r4, =gUnknown_0203ABA0 + ldr r4, =sTransitionStructPtr ldr r1, [r4] ldrb r0, [r1] movs r0, 0 @@ -2683,7 +2735,7 @@ sub_81474B0: @ 81474B0 bl sub_814A1AC ldr r7, =gUnknown_02038C28 mov r10, r7 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr mov r8, r0 add r6, sp, 0xC _081474F4: @@ -2745,7 +2797,7 @@ _0814755E: ble _08147588 ldr r6, =gUnknown_02038C28 adds r3, r1, 0 - ldr r5, =gUnknown_0203ABA0 + ldr r5, =sTransitionStructPtr _0814756C: ldr r2, [r5] ldrh r0, [r2, 0x2A] @@ -2762,7 +2814,7 @@ _0814756C: cmp r1, r0 bgt _0814756C _08147588: - ldr r7, =gUnknown_0203ABA0 + ldr r7, =sTransitionStructPtr ldr r0, [r7] ldrb r1, [r0] adds r1, 0x1 @@ -2785,7 +2837,7 @@ sub_81475B0: @ 81475B0 push {r4-r7,lr} sub sp, 0xC adds r7, r0, 0 - ldr r1, =gUnknown_0203ABA0 + ldr r1, =sTransitionStructPtr ldr r0, [r1] ldrb r2, [r0] movs r2, 0 @@ -2805,7 +2857,7 @@ sub_81475B0: @ 81475B0 ldr r6, =gUnknown_02038C28 _081475DC: movs r2, 0x78 - ldr r5, =gUnknown_0203ABA0 + ldr r5, =sTransitionStructPtr ldr r3, [r5] ldrh r4, [r3, 0x28] movs r1, 0x28 @@ -2896,7 +2948,7 @@ sub_8147688: @ 8147688 strh r0, [r4, 0xA] ldrh r0, [r4, 0xA] bl sub_8149F2C - ldr r3, =gUnknown_0203ABA0 + ldr r3, =sTransitionStructPtr ldr r0, [r3] ldrb r0, [r0] cmp r0, 0 @@ -2976,7 +3028,7 @@ sub_8147750: @ 8147750 bl dp12_8087EA4 movs r2, 0 ldr r4, =gUnknown_020393A8 - ldr r3, =gUnknown_0203ABA0 + ldr r3, =sTransitionStructPtr _08147762: lsls r1, r2, 1 adds r1, r4 @@ -3011,7 +3063,7 @@ sub_81477A8: @ 81477A8 push {r7} sub sp, 0x4 adds r6, r0, 0 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] movs r0, 0 @@ -3046,7 +3098,7 @@ _081477E8: ldr r1, =gUnknown_02038C28 lsls r2, r5, 1 adds r2, r1 - ldr r1, =gUnknown_0203ABA0 + ldr r1, =sTransitionStructPtr ldr r1, [r1] ldrh r1, [r1, 0x16] adds r0, r1 @@ -3095,7 +3147,7 @@ _08147838: lsrs r0, 24 bl DestroyTask _0814785A: - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 @@ -3115,7 +3167,7 @@ _0814785A: sub_8147888: @ 8147888 push {lr} bl sub_8149F2C - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r0, [r0] ldrb r0, [r0] cmp r0, 0 @@ -3191,7 +3243,7 @@ sub_8147924: @ 8147924 adds r4, r0, 0 bl sub_8149F08 bl dp12_8087EA4 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] movs r2, 0 movs r0, 0x3F @@ -3231,7 +3283,7 @@ sub_814797C: @ 814797C mov r7, r8 push {r7} adds r4, r0, 0 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] movs r0, 0 @@ -3292,7 +3344,7 @@ _081479D8: adds r0, 0x1 strh r0, [r4, 0x8] _081479F6: - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 @@ -3346,7 +3398,7 @@ sub_8147A58: @ 8147A58 strh r0, [r4, 0xA] ldrh r0, [r4, 0xA] bl sub_8149F2C - ldr r3, =gUnknown_0203ABA0 + ldr r3, =sTransitionStructPtr ldr r0, [r3] ldrb r0, [r0] cmp r0, 0 @@ -3517,7 +3569,7 @@ sub_8147BBC: @ 8147BBC strh r0, [r4, 0xC] movs r0, 0xEF strh r0, [r4, 0xE] - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] movs r0, 0x3F strh r0, [r1, 0x2] @@ -3638,7 +3690,7 @@ _08147C7E: sub_8147CE4: @ 8147CE4 push {r4-r7,lr} adds r4, r0, 0 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] movs r0, 0 @@ -3741,7 +3793,7 @@ _08147D9A: adds r0, 0x1 strh r0, [r4, 0x8] _08147DA6: - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrh r0, [r1, 0x18] subs r0, 0x8 @@ -3764,7 +3816,7 @@ _08147DA6: sub_8147DD0: @ 8147DD0 push {r4,r5,lr} adds r4, r0, 0 - ldr r2, =gUnknown_0203ABA0 + ldr r2, =sTransitionStructPtr ldr r1, [r2] ldrb r0, [r1] movs r0, 0 @@ -3823,7 +3875,7 @@ _08147DE4: sub_8147E4C: @ 8147E4C push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrh r0, [r1, 0x18] subs r0, 0x8 @@ -3857,7 +3909,7 @@ sub_8147E88: @ 8147E88 mov r7, r8 push {r7} adds r6, r0, 0 - ldr r7, =gUnknown_0203ABA0 + ldr r7, =sTransitionStructPtr ldr r1, [r7] ldrh r0, [r1, 0x18] subs r0, 0x8 @@ -3934,7 +3986,7 @@ _08147F1C: sub_8147F40: @ 8147F40 push {r4-r7,lr} adds r4, r0, 0 - ldr r2, =gUnknown_0203ABA0 + ldr r2, =sTransitionStructPtr ldr r1, [r2] ldrb r0, [r1] movs r0, 0 @@ -4041,7 +4093,7 @@ _08147FEA: sub_8148008: @ 8148008 push {r4-r6,lr} adds r4, r0, 0 - ldr r5, =gUnknown_0203ABA0 + ldr r5, =sTransitionStructPtr ldr r0, [r5] ldrb r1, [r0] movs r6, 0 @@ -4069,7 +4121,7 @@ sub_8148008: @ 8148008 sub_8148040: @ 8148040 push {r4,r5,lr} adds r4, r0, 0 - ldr r5, =gUnknown_0203ABA0 + ldr r5, =sTransitionStructPtr ldr r1, [r5] ldrb r0, [r1] movs r0, 0 @@ -4144,7 +4196,7 @@ sub_81480CC: @ 81480CC strh r0, [r4, 0xA] ldrh r0, [r4, 0xA] bl sub_8149F2C - ldr r3, =gUnknown_0203ABA0 + ldr r3, =sTransitionStructPtr ldr r0, [r3] ldrb r0, [r0] cmp r0, 0 @@ -4200,7 +4252,7 @@ sub_8148160: @ 8148160 strh r0, [r4, 0xA] ldrh r0, [r4, 0xA] bl sub_8149F2C - ldr r2, =gUnknown_0203ABA0 + ldr r2, =sTransitionStructPtr ldr r0, [r2] ldrb r0, [r0] cmp r0, 0 @@ -4241,14 +4293,14 @@ sub_81481E0: @ 81481E0 cmp r0, 0x4F bhi _08148200 ldr r1, =0x04000010 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r0, [r0] ldrh r0, [r0, 0x18] b _08148208 .pool _08148200: ldr r1, =0x04000010 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r0, [r0] ldrh r0, [r0, 0x1A] _08148208: @@ -4653,7 +4705,7 @@ sub_8148508: @ 8148508 strh r0, [r5, 0xC] movs r0, 0x1 strh r0, [r5, 0xE] - ldr r2, =gUnknown_0203ABA0 + ldr r2, =sTransitionStructPtr ldr r1, [r2] movs r0, 0x3F strh r0, [r1, 0x2] @@ -4706,7 +4758,7 @@ sub_8148590: @ 8148590 mov r7, r8 push {r7} adds r3, r0, 0 - ldr r2, =gUnknown_0203ABA0 + ldr r2, =sTransitionStructPtr ldr r1, [r2] ldrb r0, [r1] movs r0, 0 @@ -4847,7 +4899,7 @@ sub_814869C: @ 814869C ldrh r0, [r4, 0xA] bl sub_8149F2C ldr r2, =0x04000048 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrh r0, [r1, 0x2] strh r0, [r2] @@ -4948,7 +5000,7 @@ sub_8148798: @ 8148798 adds r6, r0, 0 bl sub_8149F08 bl dp12_8087EA4 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] movs r2, 0 movs r0, 0x3F @@ -4969,7 +5021,7 @@ _081487CC: lsls r2, r4, 1 mov r7, r12 adds r1, r2, r7 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r3, [r0] ldrh r0, [r3, 0x14] strh r0, [r1] @@ -5052,7 +5104,7 @@ sub_8148864: @ 8148864 adds r0, r4, 0 movs r2, 0x4 bl memcpy - ldr r2, =gUnknown_0203ABA0 + ldr r2, =sTransitionStructPtr ldr r1, [r2] ldrb r0, [r1] movs r0, 0 @@ -5147,7 +5199,7 @@ _08148940: adds r2, r0, r1 ldr r1, =gUnknown_02038D68 adds r3, r0, r1 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrh r0, [r4] ldrh r1, [r1, 0x14] @@ -5251,7 +5303,7 @@ _08148A18: adds r2, r0, r1 ldr r1, =gUnknown_02038D68 adds r3, r0, r1 - ldr r1, =gUnknown_0203ABA0 + ldr r1, =sTransitionStructPtr ldr r0, [r1] ldrh r1, [r0, 0x14] ldrh r0, [r4] @@ -5322,7 +5374,7 @@ _08148A98: adds r0, 0x1 strh r0, [r3, 0x8] _08148AA6: - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 @@ -5463,7 +5515,7 @@ sub_8148BC4: @ 8148BC4 adds r5, r0, 0 bl sub_8149F08 bl dp12_8087EA4 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] movs r0, 0 strh r0, [r1, 0x2] @@ -5530,7 +5582,7 @@ sub_8148C28: @ 8148C28 b _08148CDE .pool _08148C6C: - ldr r5, =gUnknown_0203ABA0 + ldr r5, =sTransitionStructPtr ldr r1, [r5] ldrb r0, [r1] movs r0, 0 @@ -5595,7 +5647,7 @@ _08148CDE: sub_8148CE8: @ 8148CE8 push {r4-r6,lr} adds r4, r0, 0 - ldr r6, =gUnknown_0203ABA0 + ldr r6, =sTransitionStructPtr ldr r0, [r6] ldrb r1, [r0] movs r5, 0 @@ -5660,7 +5712,7 @@ _08148D4C: sub_8148D6C: @ 8148D6C push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] movs r0, 0 @@ -5754,7 +5806,7 @@ _08148E28: adds r0, 0x1 strh r0, [r4, 0x14] _08148E3C: - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 @@ -6342,7 +6394,7 @@ sub_81492B4: @ 81492B4 movs r2, 0x80 lsls r2, 5 bl CpuSet - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] movs r0, 0 strh r0, [r1, 0x20] @@ -6491,7 +6543,7 @@ sub_8149410: @ 8149410 ands r0, r1 cmp r0, 0 bne _0814942E - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] movs r0, 0x1 strh r0, [r1, 0x20] @@ -6557,7 +6609,7 @@ _0814949A: asrs r0, 16 cmp r0, 0x27 ble _081494F0 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] movs r0, 0 strh r0, [r1, 0x2] @@ -6614,7 +6666,7 @@ sub_8149508: @ 8149508 strh r0, [r1, 0xA] ldrh r0, [r1, 0xA] bl sub_8149F2C - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r0, [r0] movs r1, 0x20 ldrsh r0, [r0, r1] @@ -6677,7 +6729,7 @@ sub_81495B0: @ 81495B0 adds r5, r0, 0 bl sub_8149F08 bl dp12_8087EA4 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] movs r2, 0 movs r0, 0xBF @@ -6782,7 +6834,7 @@ _0814963C: sub_814969C: @ 814969C push {r4,lr} adds r4, r0, 0 - ldr r2, =gUnknown_0203ABA0 + ldr r2, =sTransitionStructPtr ldr r1, [r2] ldrb r0, [r1] movs r0, 0 @@ -6812,7 +6864,7 @@ _081496C6: sub_81496D8: @ 81496D8 push {r4-r6,lr} adds r6, r0, 0 - ldr r4, =gUnknown_0203ABA0 + ldr r4, =sTransitionStructPtr ldr r0, [r4] ldrb r1, [r0] movs r5, 0 @@ -6854,7 +6906,7 @@ sub_81496D8: @ 81496D8 thumb_func_start sub_8149740 sub_8149740: @ 8149740 push {lr} - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrh r0, [r1, 0x12] adds r0, 0x1 @@ -6891,7 +6943,7 @@ sub_8149774: @ 8149774 ldrh r0, [r4, 0xA] bl sub_8149F2C ldr r2, =0x04000050 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrh r0, [r1, 0xE] strh r0, [r2] @@ -6936,7 +6988,7 @@ sub_8149804: @ 8149804 push {lr} bl sub_8149F2C ldr r1, =0x04000054 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r2, [r0] ldrh r0, [r2, 0x12] strh r0, [r1] @@ -6992,7 +7044,7 @@ sub_8149864: @ 8149864 ldrsh r0, [r3, r1] cmp r0, 0 beq _0814994C - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] movs r0, 0x1 @@ -7065,7 +7117,7 @@ _08149902: ldrsh r0, [r3, r2] cmp r0, 0 beq _08149914 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] movs r0, 0x1 @@ -7077,7 +7129,7 @@ _08149914: beq _0814994C movs r2, 0x3A ldrsh r0, [r3, r2] - ldr r2, =gUnknown_0203ABA0 + ldr r2, =sTransitionStructPtr cmp r0, 0 beq _0814993E ldr r0, [r2] @@ -7271,7 +7323,7 @@ sub_8149AA4: @ 8149AA4 adds r5, r0, 0 bl sub_8149F08 bl dp12_8087EA4 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] movs r2, 0 movs r0, 0x3F @@ -7317,7 +7369,7 @@ sub_8149B08: @ 8149B08 push {r6} sub sp, 0xC mov r8, r0 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r0, [r0] adds r0, 0x24 ldr r6, =gUnknown_085C8DD0 @@ -7378,7 +7430,7 @@ sub_8149B84: @ 8149B84 mov r6, r8 push {r6,r7} adds r6, r0, 0 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] movs r0, 0 @@ -7389,7 +7441,7 @@ sub_8149B84: @ 8149B84 mov r9, r0 _08149BA0: ldr r1, =gUnknown_02038C28 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r2, [r0] movs r3, 0x2A ldrsh r0, [r2, r3] @@ -7431,7 +7483,7 @@ _08149BEA: bgt _08149BF4 lsrs r5, r1, 16 _08149BF4: - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r4, [r0] movs r0, 0x2A ldrsh r2, [r4, r0] @@ -7469,7 +7521,7 @@ _08149C1C: cmp r0, 0xF ble _08149BA0 _08149C40: - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 @@ -7568,7 +7620,7 @@ sub_8149CE8: @ 8149CE8 strh r0, [r4, 0xA] ldrh r0, [r4, 0xA] bl sub_8149F2C - ldr r3, =gUnknown_0203ABA0 + ldr r3, =sTransitionStructPtr ldr r0, [r3] ldrb r0, [r0] cmp r0, 0 @@ -7824,7 +7876,7 @@ _08149EFE: thumb_func_start sub_8149F08 sub_8149F08: @ 8149F08 push {r4,lr} - ldr r4, =gUnknown_0203ABA0 + ldr r4, =sTransitionStructPtr ldr r0, [r4] movs r1, 0 movs r2, 0x3C @@ -8538,7 +8590,7 @@ sub_814A42C: @ 814A42C movs r0, 0xA0 lsls r0, 4 strh r0, [r4, 0x16] - ldr r6, =gUnknown_0203ABA0 + ldr r6, =sTransitionStructPtr ldr r2, [r6] ldr r3, =0x00003f41 strh r3, [r2, 0xE] @@ -8609,7 +8661,7 @@ sub_814A500: @ 814A500 movs r2, 0 ldr r6, =sub_814A684 ldr r4, =gUnknown_020393A8 - ldr r3, =gUnknown_0203ABA0 + ldr r3, =sTransitionStructPtr _0814A50C: lsls r1, r2, 1 adds r1, r4 @@ -8644,7 +8696,7 @@ sub_814A550: @ 814A550 push {r7} sub sp, 0x4 adds r4, r0, 0 - ldr r1, =gUnknown_0203ABA0 + ldr r1, =sTransitionStructPtr ldr r0, [r1] ldrb r2, [r0] movs r3, 0 @@ -8721,7 +8773,7 @@ _0814A5E4: ldr r1, =gUnknown_02038C28 lsls r2, r5, 1 adds r2, r1 - ldr r1, =gUnknown_0203ABA0 + ldr r1, =sTransitionStructPtr ldr r1, [r1] ldrh r1, [r1, 0x16] adds r0, r1 @@ -8772,7 +8824,7 @@ _0814A654: ldrh r0, [r4, 0x16] subs r0, 0x11 strh r0, [r4, 0x16] - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 @@ -8793,7 +8845,7 @@ sub_814A684: @ 814A684 push {lr} bl sub_8149F2C ldr r2, =0x04000050 - ldr r0, =gUnknown_0203ABA0 + ldr r0, =sTransitionStructPtr ldr r1, [r0] ldrh r0, [r1, 0xE] strh r0, [r2] diff --git a/asm/berry_blender.s b/asm/berry_blender.s index c63b72647..cc859f052 100644 --- a/asm/berry_blender.s +++ b/asm/berry_blender.s @@ -820,7 +820,7 @@ _0807FE7C: adds r0, 0x7C movs r1, 0x2 strb r1, [r0] - ldr r4, =gUnknown_020229F0 + ldr r4, =gLinkPlayers + 8 ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r4, 0 @@ -845,7 +845,7 @@ _0807FEC8: ldr r1, [r1] bl StringCopy _0807FED4: - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers movs r0, 0x2 strh r0, [r1, 0x1A] strh r0, [r1, 0x36] @@ -859,7 +859,7 @@ _0807FEE8: adds r0, 0x7C movs r1, 0x3 strb r1, [r0] - ldr r6, =gUnknown_020229F0 + ldr r6, =gLinkPlayers + 8 ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r6, 0 @@ -889,7 +889,7 @@ _0807FF3C: adds r0, 0x7C movs r1, 0x4 strb r1, [r0] - ldr r5, =gUnknown_020229F0 + ldr r5, =gLinkPlayers + 8 ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r5, 0 @@ -1214,7 +1214,7 @@ _08080248: b _08080546 _08080254: bl sub_800A5B4 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 beq _08080264 @@ -1880,7 +1880,7 @@ sub_80807BC: @ 80807BC ldrb r0, [r0] cmp r0, 0 beq _080807DE - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 mov r10, r0 @@ -1935,7 +1935,7 @@ _080807E4: lsls r1, r0, 3 subs r1, r0 lsls r1, 2 - ldr r0, =gUnknown_020229F0 + ldr r0, =gLinkPlayers + 8 adds r1, r0 add r0, sp, 0x8 bl StringCopy @@ -3637,7 +3637,7 @@ sub_8081744: @ 8081744 ldrb r0, [r0] cmp r0, 0 beq _0808175A - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r6, r0, 24 _0808175A: @@ -4737,7 +4737,7 @@ sub_8081FC8: @ 8081FC8 bhi _08081FDE bl sub_8082D28 _08081FDE: - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r0, [r4] adds r0, 0x63 ldrb r0, [r0] @@ -4836,7 +4836,7 @@ _080820C6: b _0808249E .pool _080820D4: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 beq _080820E0 @@ -5551,7 +5551,7 @@ _080826EC: lsls r1, r0, 3 subs r1, r0 lsls r1, 2 - ldr r0, =gUnknown_020229F0 + ldr r0, =gLinkPlayers + 8 adds r1, r0 adds r0, r4, 0 bl StringCopy @@ -5571,7 +5571,7 @@ _0808271C: lsls r1, r0, 3 subs r1, r0 lsls r1, 2 - ldr r0, =gUnknown_020229F0 + ldr r0, =gLinkPlayers + 8 adds r1, r0 adds r0, r4, 0 bl StringCopy @@ -6026,7 +6026,7 @@ _08082B58: _08082B64: strh r1, [r0] _08082B66: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 beq _08082B72 @@ -6246,7 +6246,7 @@ sub_8082D28: @ 8082D28 ldrb r0, [r4] cmp r0, 0 beq _08082D3C - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r1, r0, 24 _08082D3C: @@ -7340,7 +7340,7 @@ _08083564: lsls r4, r5, 3 subs r4, r5 lsls r4, 2 - ldr r3, =gUnknown_020229F0 + ldr r3, =gLinkPlayers + 8 adds r1, r4, r3 bl StringAppend ldr r1, [r7] @@ -7368,7 +7368,7 @@ _08083564: bl StringCopy ldr r0, [r7] adds r0, 0x9F - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers adds r4, r2 ldrb r1, [r4, 0x1A] bl ConvertInternationalString @@ -7675,7 +7675,7 @@ sub_80838AC: @ 80838AC adds r6, r1, 0 movs r0, 0xFF strb r0, [r6] - ldr r1, =gUnknown_085B262C + ldr r1, =gPokeblockNames ldrb r0, [r5] lsls r0, 2 adds r0, r1 @@ -7917,7 +7917,7 @@ _08083A9E: b _08083ABC .pool _08083AB4: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r3, r0, 24 _08083ABC: @@ -8172,7 +8172,7 @@ _08083C84: lsls r1, r5, 3 subs r1, r5 lsls r1, 2 - ldr r2, =gUnknown_020229F0 + ldr r2, =gLinkPlayers + 8 adds r1, r2 bl StringAppend ldr r1, [r7] @@ -8365,7 +8365,7 @@ ShowBerryBlenderRecordWindow: @ 8083E24 str r4, [sp, 0x4] str r4, [sp, 0x8] adds r2, r6, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r5] ldr r2, =gUnknown_085EE473 movs r1, 0x29 @@ -8374,7 +8374,7 @@ ShowBerryBlenderRecordWindow: @ 8083E24 str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0x4 - bl Print + bl PrintTextOnWindow movs r6, 0 movs r7, 0xA4 lsls r7, 22 @@ -8425,7 +8425,7 @@ _08083E8A: str r1, [sp, 0x8] movs r1, 0x1 add r2, sp, 0xC - bl Print + bl PrintTextOnWindow movs r0, 0x80 lsls r0, 21 adds r7, r0 @@ -8542,7 +8542,7 @@ sub_8083F94: @ 8083F94 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 - ldr r5, =gUnknown_020229F0 + ldr r5, =gLinkPlayers + 8 adds r1, r5 adds r0, r7, 0 bl StringCopy @@ -8596,7 +8596,7 @@ _08084058: lsls r1, r0, 3 subs r1, r0 lsls r1, 2 - ldr r5, =gUnknown_020229F0 + ldr r5, =gLinkPlayers + 8 adds r1, r5 adds r0, r7, 0 bl StringCopy diff --git a/asm/berry_tag_screen.s b/asm/berry_tag_screen.s index b03c56ed4..4d5022189 100644 --- a/asm/berry_tag_screen.s +++ b/asm/berry_tag_screen.s @@ -612,7 +612,7 @@ sub_8178174: @ 8178174 movs r0, 0x1 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrh r0, [r4, 0x8] cmp r0, 0 beq _08178230 @@ -662,7 +662,7 @@ _081781C8: movs r1, 0x1 adds r2, r4, 0 movs r3, 0x28 - bl Print + bl PrintTextOnWindow b _08178242 .pool _08178230: @@ -673,7 +673,7 @@ _08178230: movs r0, 0x1 movs r1, 0x1 movs r3, 0x28 - bl Print + bl PrintTextOnWindow _08178242: add sp, 0xC pop {r4-r7} @@ -704,7 +704,7 @@ itemid_copy_name: @ 8178250 movs r0, 0x1 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r6, 0x7] cmp r0, 0 beq _081782B0 @@ -720,7 +720,7 @@ itemid_copy_name: @ 8178250 movs r0, 0x1 movs r1, 0x1 movs r3, 0x28 - bl Print + bl PrintTextOnWindow b _081782C2 .pool _081782B0: @@ -731,7 +731,7 @@ _081782B0: movs r0, 0x1 movs r1, 0x1 movs r3, 0x28 - bl Print + bl PrintTextOnWindow _081782C2: add sp, 0xC pop {r4-r6} @@ -760,7 +760,7 @@ sub_81782D0: @ 81782D0 movs r0, 0x2 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r0} bx r0 @@ -787,7 +787,7 @@ sub_8178304: @ 8178304 movs r0, 0x2 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r0} bx r0 diff --git a/asm/bg.s b/asm/bg.s deleted file mode 100644 index 4526f8116..000000000 --- a/asm/bg.s +++ /dev/null @@ -1,3365 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start ResetBgs -@ void ResetBgs() -ResetBgs: @ 80012F0 - push {lr} - bl ResetBgControlStructs - ldr r1, =gUnknown_030008E0 - movs r0, 0 - strh r0, [r1, 0x10] - bl SetTextModeAndHideBgs - pop {r0} - bx r0 - .pool - thumb_func_end ResetBgs - - thumb_func_start SetBgModeInternal -@ void SetBgModeInternal(u8 bgMode) -SetBgModeInternal: @ 8001308 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_030008E0 - ldrh r2, [r3, 0x10] - ldr r1, =0x0000fff8 - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x10] - bx lr - .pool - thumb_func_end SetBgModeInternal - - thumb_func_start GetBgMode -@ u8 GetBgMode() -GetBgMode: @ 8001324 - ldr r0, =gUnknown_030008E0 - ldrb r1, [r0, 0x10] - movs r0, 0x7 - ands r0, r1 - bx lr - .pool - thumb_func_end GetBgMode - - thumb_func_start ResetBgControlStructs -@ void ResetBgControlStructs() -ResetBgControlStructs: @ 8001334 - push {lr} - ldr r2, =gUnknown_030008E0 - ldr r0, =gZeroedBgControlStruct - ldr r0, [r0] - adds r1, r2, 0 - adds r1, 0xC -_08001340: - str r0, [r1] - subs r1, 0x4 - cmp r1, r2 - bge _08001340 - pop {r0} - bx r0 - .pool - thumb_func_end ResetBgControlStructs - - thumb_func_start Unused_ResetBgControlStruct -@ void Unused_ResetBgControlStruct(u8 bg) -Unused_ResetBgControlStruct: @ 8001354 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl IsInvalidBg - lsls r0, 24 - cmp r0, 0 - bne _08001372 - ldr r1, =gUnknown_030008E0 - lsls r0, r4, 2 - adds r0, r1 - ldr r1, =gZeroedBgControlStruct - ldr r1, [r1] - str r1, [r0] -_08001372: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Unused_ResetBgControlStruct - - thumb_func_start SetBgControlAttributes -@ void SetBgControlAttributes(u8 bg, u8 tilesBaseBlock, u8 tileMapBaseBlock, u8 screenSize, u8 paletteMode, u8 priority, u8 mosaic, u8 wraparound) -SetBgControlAttributes: @ 8001380 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r4, [sp, 0x30] - ldr r5, [sp, 0x34] - ldr r6, [sp, 0x38] - mov r12, r6 - ldr r6, [sp, 0x3C] - mov r8, r6 - lsls r0, 24 - lsrs r7, r0, 24 - str r7, [sp] - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x4] - lsls r5, 24 - lsrs r5, 24 - mov r0, r12 - lsls r0, 24 - lsrs r4, r0, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0xC] - adds r0, r7, 0 - bl IsInvalidBg - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - cmp r0, 0 - bne _08001498 - ldr r2, =gUnknown_030008E0 - mov r8, r2 - mov r0, r10 - cmp r0, 0xFF - beq _080013F4 - lsls r2, r7, 2 - add r2, r8 - movs r1, 0x3 - ands r1, r0 - ldrb r3, [r2, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x1] -_080013F4: - cmp r6, 0xFF - beq _0800140C - lsls r1, r7, 2 - add r1, r8 - movs r0, 0x1F - ands r6, r0 - lsls r3, r6, 2 - ldrb r2, [r1, 0x1] - subs r0, 0x9C - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x1] -_0800140C: - mov r1, r9 - cmp r1, 0xFF - beq _08001428 - lsls r1, r7, 2 - add r1, r8 - movs r0, 0x3 - mov r2, r9 - ands r2, r0 - lsls r3, r2, 2 - ldrb r2, [r1] - subs r0, 0x10 - ands r0, r2 - orrs r0, r3 - strb r0, [r1] -_08001428: - ldr r6, [sp, 0x4] - cmp r6, 0xFF - beq _0800143E - lsls r1, r7, 2 - add r1, r8 - lsls r3, r6, 7 - ldrb r2, [r1, 0x1] - movs r0, 0x7F - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x1] -_0800143E: - cmp r5, 0xFF - beq _08001456 - lsls r1, r7, 2 - add r1, r8 - movs r0, 0x3 - ands r5, r0 - lsls r3, r5, 4 - ldrb r2, [r1] - subs r0, 0x34 - ands r0, r2 - orrs r0, r3 - strb r0, [r1] -_08001456: - cmp r4, 0xFF - beq _0800146E - lsls r1, r7, 2 - add r1, r8 - movs r0, 0x1 - ands r4, r0 - lsls r3, r4, 6 - ldrb r2, [r1] - subs r0, 0x42 - ands r0, r2 - orrs r0, r3 - strb r0, [r1] -_0800146E: - ldr r0, [sp, 0xC] - cmp r0, 0xFF - beq _08001484 - lsls r1, r7, 2 - add r1, r8 - lsls r3, r0, 7 - ldrb r2, [r1] - movs r0, 0x7F - ands r0, r2 - orrs r0, r3 - strb r0, [r1] -_08001484: - ldr r1, [sp] - lsls r0, r1, 2 - add r0, r8 - mov r2, r12 - strb r2, [r0, 0x2] - strb r2, [r0, 0x3] - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] -_08001498: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end SetBgControlAttributes - - thumb_func_start GetBgControlAttribute -@ u8 GetBgControlAttribute(u8 bg, u8 attributeId) -GetBgControlAttribute: @ 80014AC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - adds r0, r4, 0 - bl IsInvalidBg - lsls r0, 24 - cmp r0, 0 - bne _08001558 - ldr r1, =gUnknown_030008E0 - lsls r2, r4, 2 - adds r0, r2, r1 - ldrb r0, [r0] - lsls r0, 31 - adds r3, r1, 0 - cmp r0, 0 - beq _08001558 - subs r0, r5, 0x1 - cmp r0, 0x7 - bhi _08001558 - lsls r0, 2 - ldr r1, =_080014EC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080014EC: - .4byte _0800150C - .4byte _08001516 - .4byte _08001520 - .4byte _0800152A - .4byte _08001534 - .4byte _0800153C - .4byte _08001546 - .4byte _08001550 -_0800150C: - adds r0, r2, r3 - ldrb r0, [r0] - lsls r0, 31 - lsrs r0, 31 - b _0800155A -_08001516: - adds r0, r2, r3 - ldrb r0, [r0, 0x1] - lsls r0, 30 - lsrs r0, 30 - b _0800155A -_08001520: - adds r0, r2, r3 - ldrb r0, [r0, 0x1] - lsls r0, 25 - lsrs r0, 27 - b _0800155A -_0800152A: - adds r0, r2, r3 - ldrb r0, [r0] - lsls r0, 28 - lsrs r0, 30 - b _0800155A -_08001534: - adds r0, r2, r3 - ldrb r0, [r0, 0x1] - lsrs r0, 7 - b _0800155A -_0800153C: - adds r0, r2, r3 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 30 - b _0800155A -_08001546: - adds r0, r2, r3 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 31 - b _0800155A -_08001550: - adds r0, r2, r3 - ldrb r0, [r0] - lsrs r0, 7 - b _0800155A -_08001558: - movs r0, 0xFF -_0800155A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetBgControlAttribute - - thumb_func_start LoadBgVram -@ u8 LoadBgVram(u8, void *src, u16 size, u16 destOffset, u8 mode) -LoadBgVram: @ 8001560 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r1 - ldr r1, [sp, 0x18] - lsls r0, 24 - lsrs r4, r0, 24 - lsls r2, 16 - lsrs r7, r2, 16 - lsls r3, 16 - lsrs r6, r3, 16 - lsls r1, 24 - lsrs r5, r1, 24 - adds r0, r4, 0 - bl IsInvalidBg - lsls r0, 24 - cmp r0, 0 - bne _080015D8 - ldr r1, =gUnknown_030008E0 - lsls r0, r4, 2 - adds r1, r0, r1 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _080015D8 - cmp r5, 0x1 - beq _080015A4 - cmp r5, 0x2 - beq _080015AC - movs r2, 0xFF - b _080015DC - .pool -_080015A4: - ldrb r0, [r1, 0x1] - lsls r0, 30 - lsrs r0, 16 - b _080015B4 -_080015AC: - ldrb r0, [r1, 0x1] - lsls r0, 25 - lsrs r0, 27 - lsls r0, 11 -_080015B4: - adds r0, r6, r0 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xC0 - lsls r1, 19 - adds r1, r0, r1 - mov r0, r8 - adds r2, r7, 0 - movs r3, 0 - bl RequestDma3Copy - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _080015DC -_080015D8: - movs r0, 0xFF - b _080015DE -_080015DC: - adds r0, r2, 0 -_080015DE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end LoadBgVram - - thumb_func_start ShowBgInternal -@ void ShowBgInternal(u8 bg) -ShowBgInternal: @ 80015E8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl IsInvalidBg - lsls r0, 24 - cmp r0, 0 - bne _08001656 - ldr r5, =gUnknown_030008E0 - lsls r0, r4, 2 - adds r2, r0, r5 - ldrb r3, [r2] - lsls r0, r3, 31 - cmp r0, 0 - beq _08001656 - lsls r1, r3, 26 - lsrs r1, 30 - ldrb r2, [r2, 0x1] - lsls r0, r2, 30 - lsrs r0, 28 - orrs r1, r0 - movs r0, 0x40 - ands r0, r3 - orrs r1, r0 - lsrs r0, r2, 7 - lsls r0, 7 - orrs r1, r0 - lsls r2, 25 - lsrs r2, 27 - lsls r2, 8 - orrs r1, r2 - lsrs r0, r3, 7 - lsls r0, 13 - orrs r1, r0 - lsls r0, r3, 28 - lsrs r0, 30 - lsls r0, 14 - orrs r1, r0 - lsls r0, r4, 25 - movs r2, 0x80 - lsls r2, 20 - adds r0, r2 - lsrs r0, 24 - bl SetGpuReg - adds r1, r4, 0 - adds r1, 0x8 - movs r0, 0x1 - lsls r0, r1 - ldrh r1, [r5, 0x10] - orrs r0, r1 - ldr r1, =0x00000f07 - ands r0, r1 - strh r0, [r5, 0x10] -_08001656: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ShowBgInternal - - thumb_func_start HideBgInternal -@ void HideBgInternal(u8 bg) -HideBgInternal: @ 8001664 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl IsInvalidBg - lsls r0, 24 - cmp r0, 0 - bne _0800168A - ldr r2, =gUnknown_030008E0 - adds r0, r4, 0 - adds r0, 0x8 - movs r1, 0x1 - lsls r1, r0 - ldrh r0, [r2, 0x10] - bics r0, r1 - ldr r1, =0x00000f07 - ands r0, r1 - strh r0, [r2, 0x10] -_0800168A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end HideBgInternal - - thumb_func_start SyncBgVisibilityAndMode -@ void SyncBgVisibilityAndMode() -SyncBgVisibilityAndMode: @ 8001698 - push {lr} - movs r0, 0 - bl GetGpuReg - ldr r1, =0x0000f0f8 - ands r1, r0 - ldr r0, =gUnknown_030008E0 - ldrh r0, [r0, 0x10] - orrs r1, r0 - movs r0, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end SyncBgVisibilityAndMode - - thumb_func_start SetTextModeAndHideBgs -@ void SetTextModeAndHideBgs() -SetTextModeAndHideBgs: @ 80016BC - push {lr} - movs r0, 0 - bl GetGpuReg - ldr r1, =0x0000f0f8 - ands r1, r0 - movs r0, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end SetTextModeAndHideBgs - - thumb_func_start SetBgAffineInternal -@ void SetBgAffineInternal(u8 bg, u16 srcCenterX, u16 srcCenterY, u16 dispCenterX, u16 dispCenterY, u16 scaleX, u16 scaleY, u16 rotationAngle) -SetBgAffineInternal: @ 80016D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x24 - mov r12, r1 - mov r8, r2 - ldr r1, [sp, 0x3C] - ldr r2, [sp, 0x40] - ldr r4, [sp, 0x44] - ldr r5, [sp, 0x48] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r3, 16 - lsrs r3, 16 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r2, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =gUnknown_030008E0 - ldrh r0, [r0, 0x10] - movs r1, 0x7 - ands r1, r0 - cmp r1, 0x1 - beq _08001720 - cmp r1, 0x1 - ble _08001796 - cmp r1, 0x2 - beq _08001726 - b _08001796 - .pool -_08001720: - cmp r6, 0x2 - bne _08001796 - b _08001730 -_08001726: - subs r0, r6, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08001796 -_08001730: - mov r0, r12 - str r0, [sp] - mov r0, r8 - str r0, [sp, 0x4] - mov r0, sp - strh r3, [r0, 0x8] - strh r7, [r0, 0xA] - strh r2, [r0, 0xC] - strh r4, [r0, 0xE] - strh r5, [r0, 0x10] - add r4, sp, 0x14 - adds r1, r4, 0 - movs r2, 0x1 - bl BgAffineSet - ldrh r1, [r4] - movs r0, 0x20 - bl SetGpuReg - ldrh r1, [r4, 0x2] - movs r0, 0x22 - bl SetGpuReg - ldrh r1, [r4, 0x4] - movs r0, 0x24 - bl SetGpuReg - ldrh r1, [r4, 0x6] - movs r0, 0x26 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x20 - bl SetGpuReg - ldrh r1, [r4, 0x8] - movs r0, 0x28 - bl SetGpuReg - ldrh r1, [r4, 0xA] - movs r0, 0x2A - bl SetGpuReg - ldrh r1, [r4, 0xC] - movs r0, 0x2C - bl SetGpuReg - ldrh r1, [r4, 0xE] - movs r0, 0x2E - bl SetGpuReg -_08001796: - add sp, 0x24 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end SetBgAffineInternal - - thumb_func_start IsInvalidBg -@ bool8 IsInvalidBg(u8 bg) -IsInvalidBg: @ 80017A4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080017B2 - movs r0, 0 - b _080017B4 -_080017B2: - movs r0, 0x1 -_080017B4: - pop {r1} - bx r1 - thumb_func_end IsInvalidBg - - thumb_func_start DummiedOutFireRedLeafGreenTileAllocFunc -@ int DummiedOutFireRedLeafGreenTileAllocFunc() -DummiedOutFireRedLeafGreenTileAllocFunc: @ 80017B8 - movs r0, 0 - bx lr - thumb_func_end DummiedOutFireRedLeafGreenTileAllocFunc - - thumb_func_start ResetBgsAndClearDma3BusyFlags -@ void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable) -ResetBgsAndClearDma3BusyFlags: @ 80017BC - push {r4,lr} - adds r4, r0, 0 - bl ResetBgs - ldr r1, =gUnknown_03000938 - movs r2, 0 - adds r0, r1, 0 - adds r0, 0xC -_080017CC: - str r2, [r0] - subs r0, 0x4 - cmp r0, r1 - bge _080017CC - ldr r0, =gUnneededFireRedVariable - str r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ResetBgsAndClearDma3BusyFlags - - thumb_func_start InitBgsFromTemplates -@ void InitBgsFromTemplates(u8 bgMode, struct BgTemplate *templates, u8 numTemplates) -InitBgsFromTemplates: @ 80017E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r4, r2, 24 - bl SetBgModeInternal - bl ResetBgControlStructs - cmp r4, 0 - beq _08001894 - movs r7, 0 - ldr r0, =gUnknown_030008F8 - mov r9, r0 - movs r2, 0xC - add r2, r9 - mov r10, r2 - adds r6, r5, 0 - mov r8, r4 -_0800181A: - ldr r4, [r6] - lsls r0, r4, 30 - lsrs r5, r0, 30 - cmp r5, 0x3 - bhi _08001886 - lsls r1, r4, 28 - lsrs r1, 30 - lsls r2, r4, 23 - lsrs r2, 27 - lsls r3, r4, 21 - lsrs r3, 30 - lsls r0, r4, 20 - lsrs r0, 31 - str r0, [sp] - lsls r0, r4, 18 - lsrs r0, 30 - str r0, [sp, 0x4] - str r7, [sp, 0x8] - str r7, [sp, 0xC] - adds r0, r5, 0 - bl SetBgControlAttributes - lsls r4, r5, 4 - mov r5, r9 - adds r3, r4, r5 - ldr r2, [r6] - lsls r2, 8 - lsrs r2, 22 - ldrh r0, [r3] - ldr r5, =0xfffffc00 - adds r1, r5, 0 - ands r0, r1 - orrs r0, r2 - strh r0, [r3] - ldrb r0, [r3, 0x1] - movs r2, 0x3D - negs r2, r2 - adds r1, r2, 0 - ands r0, r1 - strb r0, [r3, 0x1] - ldr r0, [r3] - ldr r1, =0x00003fff - ands r0, r1 - str r0, [r3] - mov r0, r9 - adds r0, 0x4 - adds r0, r4, r0 - str r7, [r0] - mov r0, r9 - adds r0, 0x8 - adds r0, r4, r0 - str r7, [r0] - add r4, r10 - str r7, [r4] -_08001886: - adds r6, 0x4 - movs r5, 0x1 - negs r5, r5 - add r8, r5 - mov r0, r8 - cmp r0, 0 - bne _0800181A -_08001894: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end InitBgsFromTemplates - - thumb_func_start InitBgFromTemplate -@ void InitBgFromTemplate(struct BgTemplate *templates) -InitBgFromTemplate: @ 80018B0 - push {r4-r7,lr} - sub sp, 0x10 - adds r7, r0, 0 - ldr r4, [r7] - lsls r0, r4, 30 - lsrs r5, r0, 30 - cmp r5, 0x3 - bhi _08001920 - lsls r1, r4, 28 - lsrs r1, 30 - lsls r2, r4, 23 - lsrs r2, 27 - lsls r3, r4, 21 - lsrs r3, 30 - lsls r0, r4, 20 - lsrs r0, 31 - str r0, [sp] - lsls r0, r4, 18 - lsrs r0, 30 - str r0, [sp, 0x4] - movs r6, 0 - str r6, [sp, 0x8] - str r6, [sp, 0xC] - adds r0, r5, 0 - bl SetBgControlAttributes - ldr r4, =gUnknown_030008F8 - lsls r5, 4 - adds r3, r5, r4 - ldr r1, [r7] - lsls r1, 8 - lsrs r1, 22 - ldrh r2, [r3] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3] - ldrb r1, [r3, 0x1] - movs r0, 0x3D - negs r0, r0 - ands r0, r1 - strb r0, [r3, 0x1] - ldr r0, [r3] - ldr r1, =0x00003fff - ands r0, r1 - str r0, [r3] - adds r0, r4, 0x4 - adds r0, r5, r0 - str r6, [r0] - adds r0, r4, 0 - adds r0, 0x8 - adds r0, r5, r0 - str r6, [r0] - adds r4, 0xC - adds r5, r4 - str r6, [r5] -_08001920: - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end InitBgFromTemplate - - thumb_func_start SetBgMode -@ void SetBgMode(u8 bgMode) -SetBgMode: @ 8001934 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl SetBgModeInternal - pop {r0} - bx r0 - thumb_func_end SetBgMode - - thumb_func_start LoadBgTiles -@ u8 LoadBgTiles(u8 bg, void *src, u16 size, u16 destOffset) -LoadBgTiles: @ 8001944 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r7, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - lsls r3, 16 - lsrs r4, r3, 16 - adds r0, r5, 0 - movs r1, 0x5 - bl GetBgControlAttribute - lsls r0, 16 - cmp r0, 0 - bne _08001980 - ldr r1, =gUnknown_030008F8 - lsls r0, r5, 4 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - adds r0, r4 - lsls r0, 21 - b _08001990 - .pool -_08001980: - ldr r1, =gUnknown_030008F8 - lsls r0, r5, 4 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - adds r0, r4 - lsls r0, 22 -_08001990: - lsrs r4, r0, 16 - movs r6, 0x1 - str r6, [sp] - adds r0, r5, 0 - adds r1, r7, 0 - mov r2, r8 - adds r3, r4, 0 - bl LoadBgVram - lsls r2, r0, 24 - lsrs r1, r2, 24 - adds r7, r1, 0 - cmp r1, 0xFF - bne _080019B8 - ldr r0, =0x0000ffff - b _080019E6 - .pool -_080019B8: - ldr r0, =gUnknown_03000938 - lsrs r2, 29 - lsls r2, 2 - adds r2, r0 - movs r0, 0x1F - ands r0, r1 - adds r1, r6, 0 - lsls r1, r0 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - ldr r0, =gUnneededFireRedVariable - ldr r0, [r0] - cmp r0, 0x1 - bne _080019E4 - lsrs r1, r4, 5 - mov r0, r8 - lsrs r2, r0, 5 - adds r0, r5, 0 - movs r3, 0x1 - bl DummiedOutFireRedLeafGreenTileAllocFunc -_080019E4: - adds r0, r7, 0 -_080019E6: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end LoadBgTiles - - thumb_func_start LoadBgTilemap -@ u8 LoadBgTilemap(u8 bg, void *src, u16 size, u16 destOffset) -LoadBgTilemap: @ 80019FC - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 17 - lsrs r3, 16 - movs r4, 0x2 - str r4, [sp] - bl LoadBgVram - lsls r2, r0, 24 - lsrs r3, r2, 24 - cmp r3, 0xFF - beq _08001A3C - ldr r0, =gUnknown_03000938 - lsrs r2, 29 - lsls r2, 2 - adds r2, r0 - movs r0, 0x1F - ands r0, r3 - movs r1, 0x1 - lsls r1, r0 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - adds r0, r3, 0 - b _08001A3E - .pool -_08001A3C: - ldr r0, =0x0000ffff -_08001A3E: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end LoadBgTilemap - - thumb_func_start Unused_LoadBgPalette -@ u8 Unused_LoadBgPalette(u8 bg, void *src, u16 size, u16 destOffset) -Unused_LoadBgPalette: @ 8001A4C - push {r4-r7,lr} - adds r7, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r2, 16 - lsrs r6, r2, 16 - lsls r3, 16 - lsrs r5, r3, 16 - adds r0, r4, 0 - bl IsInvalidBg_ - cmp r0, 0 - bne _08001A98 - ldr r1, =gUnknown_030008F8 - lsls r0, r4, 4 - adds r0, r1 - ldrb r1, [r0, 0x1] - lsls r1, 26 - lsrs r1, 28 - lsls r1, 5 - lsls r0, r5, 1 - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0xA0 - lsls r0, 19 - adds r1, r0 - adds r0, r7, 0 - adds r2, r6, 0 - movs r3, 0 - bl RequestDma3Copy - lsls r3, r0, 24 - asrs r1, r3, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _08001AA4 -_08001A98: - ldr r0, =0x0000ffff - b _08001AC8 - .pool -_08001AA4: - ldr r4, =gUnknown_03000938 - adds r0, r1, 0 - cmp r1, 0 - bge _08001AAE - adds r0, 0x1F -_08001AAE: - asrs r0, 5 - lsls r2, r0, 2 - adds r2, r4 - lsls r0, 5 - subs r0, r1, r0 - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - lsls r1, r0 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - lsrs r0, r3, 24 -_08001AC8: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end Unused_LoadBgPalette - - thumb_func_start IsDma3ManagerBusyWithBgCopy -@ bool8 IsDma3ManagerBusyWithBgCopy() -IsDma3ManagerBusyWithBgCopy: @ 8001AD4 - push {r4-r7,lr} - movs r5, 0 - movs r7, 0x1 - negs r7, r7 -_08001ADC: - adds r0, r5, 0 - cmp r5, 0 - bge _08001AE4 - adds r0, 0x1F -_08001AE4: - asrs r0, 5 - lsls r2, r0, 24 - lsls r0, 5 - subs r0, r5, r0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_03000938 - lsrs r2, 22 - adds r4, r2, r1 - movs r6, 0x1 - lsls r6, r0 - ldr r0, [r4] - ands r0, r6 - cmp r0, 0 - beq _08001B22 - lsls r0, r5, 16 - asrs r0, 16 - bl CheckForSpaceForDma3Request - lsls r0, 24 - asrs r0, 24 - cmp r0, r7 - bne _08001B1C - movs r0, 0x1 - b _08001B2A - .pool -_08001B1C: - ldr r0, [r4] - bics r0, r6 - str r0, [r4] -_08001B22: - adds r5, 0x1 - cmp r5, 0x7F - ble _08001ADC - movs r0, 0 -_08001B2A: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end IsDma3ManagerBusyWithBgCopy - - thumb_func_start ShowBg -@ void ShowBg(u8 bg) -ShowBg: @ 8001B30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl ShowBgInternal - bl SyncBgVisibilityAndMode - pop {r0} - bx r0 - thumb_func_end ShowBg - - thumb_func_start HideBg -@ void HideBg(u8 bg) -HideBg: @ 8001B44 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl HideBgInternal - bl SyncBgVisibilityAndMode - pop {r0} - bx r0 - thumb_func_end HideBg - - thumb_func_start SetBgAttribute -@ void SetBgAttribute(u8 bg, u8 attributeId, u8 value) -SetBgAttribute: @ 8001B58 - push {r4,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r3, r2, 24 - subs r0, r1, 0x1 - cmp r0, 0x6 - bhi _08001C12 - lsls r0, 2 - ldr r1, =_08001B7C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08001B7C: - .4byte _08001B98 - .4byte _08001BA8 - .4byte _08001BBA - .4byte _08001BD0 - .4byte _08001BE4 - .4byte _08001BFC - .4byte _08001BDA -_08001B98: - movs r0, 0xFF - str r0, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - adds r0, r4, 0 - adds r1, r3, 0 - b _08001BF2 -_08001BA8: - movs r0, 0xFF - str r0, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0xFF - adds r2, r3, 0 - b _08001BF4 -_08001BBA: - movs r0, 0xFF - str r0, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0xFF - movs r2, 0xFF - bl SetBgControlAttributes - b _08001C12 -_08001BD0: - str r3, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - str r0, [sp, 0x8] - b _08001BEC -_08001BDA: - movs r0, 0xFF - str r0, [sp] - str r3, [sp, 0x4] - str r0, [sp, 0x8] - b _08001BEC -_08001BE4: - movs r0, 0xFF - str r0, [sp] - str r0, [sp, 0x4] - str r3, [sp, 0x8] -_08001BEC: - str r0, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0xFF -_08001BF2: - movs r2, 0xFF -_08001BF4: - movs r3, 0xFF - bl SetBgControlAttributes - b _08001C12 -_08001BFC: - movs r0, 0xFF - str r0, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r3, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0xFF - movs r2, 0xFF - movs r3, 0xFF - bl SetBgControlAttributes -_08001C12: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - thumb_func_end SetBgAttribute - - thumb_func_start GetBgAttribute -@ u8 GetBgAttribute(u8 bg, u8 attributeId) -GetBgAttribute: @ 8001C1C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - subs r0, r1, 0x1 - cmp r0, 0x9 - bhi _08001CF8 - lsls r0, 2 - ldr r1, =_08001C3C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08001C3C: - .4byte _08001C64 - .4byte _08001C6E - .4byte _08001C78 - .4byte _08001C82 - .4byte _08001C96 - .4byte _08001CA0 - .4byte _08001C8C - .4byte _08001CAA - .4byte _08001CD8 - .4byte _08001CE4 -_08001C64: - adds r0, r4, 0 - movs r1, 0x2 - bl GetBgControlAttribute - b _08001CDE -_08001C6E: - adds r0, r4, 0 - movs r1, 0x3 - bl GetBgControlAttribute - b _08001CDE -_08001C78: - adds r0, r4, 0 - movs r1, 0x4 - bl GetBgControlAttribute - b _08001CDE -_08001C82: - adds r0, r4, 0 - movs r1, 0x5 - bl GetBgControlAttribute - b _08001CDE -_08001C8C: - adds r0, r4, 0 - movs r1, 0x6 - bl GetBgControlAttribute - b _08001CDE -_08001C96: - adds r0, r4, 0 - movs r1, 0x7 - bl GetBgControlAttribute - b _08001CDE -_08001CA0: - adds r0, r4, 0 - movs r1, 0x8 - bl GetBgControlAttribute - b _08001CDE -_08001CAA: - adds r0, r4, 0 - bl GetBgType - cmp r0, 0 - beq _08001CBC - cmp r0, 0x1 - beq _08001CCA - movs r0, 0 - b _08001CFA -_08001CBC: - adds r0, r4, 0 - movs r1, 0 - bl GetBgMetricTextMode - lsls r0, 27 - lsrs r0, 16 - b _08001CFA -_08001CCA: - adds r0, r4, 0 - movs r1, 0 - bl GetBgMetricAffineMode - lsls r0, 24 - lsrs r0, 16 - b _08001CFA -_08001CD8: - adds r0, r4, 0 - bl GetBgType -_08001CDE: - lsls r0, 16 - lsrs r0, 16 - b _08001CFA -_08001CE4: - ldr r0, =gUnknown_030008F8 - lsls r1, r4, 4 - adds r1, r0 - ldrh r0, [r1] - lsls r0, 22 - lsrs r0, 22 - b _08001CFA - .pool -_08001CF8: - ldr r0, =0x0000ffff -_08001CFA: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetBgAttribute - - thumb_func_start ChangeBgX -@ u32 ChangeBgX(u8 bg, u32 value, u8 op) -ChangeBgX: @ 8001D04 - push {r4-r6,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r2, 24 - lsrs r5, r2, 24 - adds r0, r4, 0 - bl IsInvalidBg_ - cmp r0, 0 - bne _08001D28 - adds r0, r4, 0 - movs r1, 0x1 - bl GetBgControlAttribute - lsls r0, 16 - cmp r0, 0 - bne _08001D2E -_08001D28: - movs r0, 0x1 - negs r0, r0 - b _08001E34 -_08001D2E: - cmp r5, 0x1 - beq _08001D4C - cmp r5, 0x1 - ble _08001D3A - cmp r5, 0x2 - beq _08001D60 -_08001D3A: - ldr r0, =gUnknown_030008F8 - lsls r1, r4, 4 - adds r0, 0x8 - adds r0, r1, r0 - str r6, [r0] - adds r5, r1, 0 - b _08001D70 - .pool -_08001D4C: - ldr r0, =gUnknown_030008F8 - lsls r2, r4, 4 - adds r0, 0x8 - adds r0, r2, r0 - ldr r1, [r0] - adds r1, r6 - b _08001D6C - .pool -_08001D60: - ldr r0, =gUnknown_030008F8 - lsls r2, r4, 4 - adds r0, 0x8 - adds r0, r2, r0 - ldr r1, [r0] - subs r1, r6 -_08001D6C: - str r1, [r0] - adds r5, r2, 0 -_08001D70: - bl GetBgMode - lsls r0, 24 - lsrs r0, 24 - cmp r4, 0x1 - beq _08001DAC - cmp r4, 0x1 - bgt _08001D8C - cmp r4, 0 - beq _08001D96 - b _08001E2C - .pool -_08001D8C: - cmp r4, 0x2 - beq _08001DC0 - cmp r4, 0x3 - beq _08001DF8 - b _08001E2C -_08001D96: - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x8] - lsls r0, 8 - lsrs r1, r0, 16 - movs r0, 0x10 - bl SetGpuReg - b _08001E2C - .pool -_08001DAC: - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x18] - lsls r0, 8 - lsrs r1, r0, 16 - movs r0, 0x14 - bl SetGpuReg - b _08001E2C - .pool -_08001DC0: - cmp r0, 0 - bne _08001DD8 - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x28] - lsls r0, 8 - lsrs r1, r0, 16 - movs r0, 0x18 - bl SetGpuReg - b _08001E2C - .pool -_08001DD8: - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x28] - lsrs r1, r0, 16 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x2A - bl SetGpuReg - movs r0, 0x28 - adds r1, r4, 0 - bl SetGpuReg - b _08001E2C - .pool -_08001DF8: - cmp r0, 0 - bne _08001E10 - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x38] - lsls r0, 8 - lsrs r1, r0, 16 - movs r0, 0x1C - bl SetGpuReg - b _08001E2C - .pool -_08001E10: - cmp r0, 0x2 - bne _08001E2C - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x38] - lsrs r1, r0, 16 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x3A - bl SetGpuReg - movs r0, 0x38 - adds r1, r4, 0 - bl SetGpuReg -_08001E2C: - ldr r0, =gUnknown_030008F8 - adds r0, 0x8 - adds r0, r5, r0 - ldr r0, [r0] -_08001E34: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end ChangeBgX - - thumb_func_start GetBgX -@ u32 GetBgX(u8 bg) -GetBgX: @ 8001E40 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - bl IsInvalidBg_ - cmp r0, 0 - bne _08001E70 - adds r0, r4, 0 - movs r1, 0x1 - bl GetBgControlAttribute - lsls r0, 16 - cmp r0, 0 - beq _08001E70 - ldr r0, =gUnknown_030008F8 - lsls r1, r4, 4 - adds r0, 0x8 - adds r1, r0 - ldr r0, [r1] - b _08001E74 - .pool -_08001E70: - movs r0, 0x1 - negs r0, r0 -_08001E74: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetBgX - - thumb_func_start ChangeBgY -@ u32 ChangeBgY(u8 bg, u32 value, u8 op) -ChangeBgY: @ 8001E7C - push {r4-r6,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r2, 24 - lsrs r5, r2, 24 - adds r0, r4, 0 - bl IsInvalidBg_ - cmp r0, 0 - bne _08001EA0 - adds r0, r4, 0 - movs r1, 0x1 - bl GetBgControlAttribute - lsls r0, 16 - cmp r0, 0 - bne _08001EA6 -_08001EA0: - movs r0, 0x1 - negs r0, r0 - b _08001FAC -_08001EA6: - cmp r5, 0x1 - beq _08001EC4 - cmp r5, 0x1 - ble _08001EB2 - cmp r5, 0x2 - beq _08001ED8 -_08001EB2: - ldr r0, =gUnknown_030008F8 - lsls r1, r4, 4 - adds r0, 0xC - adds r0, r1, r0 - str r6, [r0] - adds r5, r1, 0 - b _08001EE8 - .pool -_08001EC4: - ldr r0, =gUnknown_030008F8 - lsls r2, r4, 4 - adds r0, 0xC - adds r0, r2, r0 - ldr r1, [r0] - adds r1, r6 - b _08001EE4 - .pool -_08001ED8: - ldr r0, =gUnknown_030008F8 - lsls r2, r4, 4 - adds r0, 0xC - adds r0, r2, r0 - ldr r1, [r0] - subs r1, r6 -_08001EE4: - str r1, [r0] - adds r5, r2, 0 -_08001EE8: - bl GetBgMode - lsls r0, 24 - lsrs r0, 24 - cmp r4, 0x1 - beq _08001F24 - cmp r4, 0x1 - bgt _08001F04 - cmp r4, 0 - beq _08001F0E - b _08001FA4 - .pool -_08001F04: - cmp r4, 0x2 - beq _08001F38 - cmp r4, 0x3 - beq _08001F70 - b _08001FA4 -_08001F0E: - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0xC] - lsls r0, 8 - lsrs r1, r0, 16 - movs r0, 0x12 - bl SetGpuReg - b _08001FA4 - .pool -_08001F24: - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x1C] - lsls r0, 8 - lsrs r1, r0, 16 - movs r0, 0x16 - bl SetGpuReg - b _08001FA4 - .pool -_08001F38: - cmp r0, 0 - bne _08001F50 - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x2C] - lsls r0, 8 - lsrs r1, r0, 16 - movs r0, 0x1A - bl SetGpuReg - b _08001FA4 - .pool -_08001F50: - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x2C] - lsrs r1, r0, 16 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x2E - bl SetGpuReg - movs r0, 0x2C - adds r1, r4, 0 - bl SetGpuReg - b _08001FA4 - .pool -_08001F70: - cmp r0, 0 - bne _08001F88 - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x3C] - lsls r0, 8 - lsrs r1, r0, 16 - movs r0, 0x1E - bl SetGpuReg - b _08001FA4 - .pool -_08001F88: - cmp r0, 0x2 - bne _08001FA4 - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x3C] - lsrs r1, r0, 16 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x3E - bl SetGpuReg - movs r0, 0x3C - adds r1, r4, 0 - bl SetGpuReg -_08001FA4: - ldr r0, =gUnknown_030008F8 - adds r0, 0xC - adds r0, r5, r0 - ldr r0, [r0] -_08001FAC: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end ChangeBgY - - thumb_func_start ChangeBgY_ScreenOff -@ u32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op) -ChangeBgY_ScreenOff: @ 8001FB8 - push {r4-r6,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r2, 24 - lsrs r5, r2, 24 - adds r0, r4, 0 - bl IsInvalidBg_ - cmp r0, 0 - bne _08001FDC - adds r0, r4, 0 - movs r1, 0x1 - bl GetBgControlAttribute - lsls r0, 16 - cmp r0, 0 - bne _08001FE2 -_08001FDC: - movs r0, 0x1 - negs r0, r0 - b _080020E8 -_08001FE2: - cmp r5, 0x1 - beq _08002000 - cmp r5, 0x1 - ble _08001FEE - cmp r5, 0x2 - beq _08002014 -_08001FEE: - ldr r0, =gUnknown_030008F8 - lsls r1, r4, 4 - adds r0, 0xC - adds r0, r1, r0 - str r6, [r0] - adds r5, r1, 0 - b _08002024 - .pool -_08002000: - ldr r0, =gUnknown_030008F8 - lsls r2, r4, 4 - adds r0, 0xC - adds r0, r2, r0 - ldr r1, [r0] - adds r1, r6 - b _08002020 - .pool -_08002014: - ldr r0, =gUnknown_030008F8 - lsls r2, r4, 4 - adds r0, 0xC - adds r0, r2, r0 - ldr r1, [r0] - subs r1, r6 -_08002020: - str r1, [r0] - adds r5, r2, 0 -_08002024: - bl GetBgMode - lsls r0, 24 - lsrs r0, 24 - cmp r4, 0x1 - beq _08002060 - cmp r4, 0x1 - bgt _08002040 - cmp r4, 0 - beq _0800204A - b _080020E0 - .pool -_08002040: - cmp r4, 0x2 - beq _08002074 - cmp r4, 0x3 - beq _080020AC - b _080020E0 -_0800204A: - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0xC] - lsls r0, 8 - lsrs r1, r0, 16 - movs r0, 0x12 - bl SetGpuReg_ForcedBlank - b _080020E0 - .pool -_08002060: - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x1C] - lsls r0, 8 - lsrs r1, r0, 16 - movs r0, 0x16 - bl SetGpuReg_ForcedBlank - b _080020E0 - .pool -_08002074: - cmp r0, 0 - bne _0800208C - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x2C] - lsls r0, 8 - lsrs r1, r0, 16 - movs r0, 0x1A - bl SetGpuReg_ForcedBlank - b _080020E0 - .pool -_0800208C: - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x2C] - lsrs r1, r0, 16 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x2E - bl SetGpuReg_ForcedBlank - movs r0, 0x2C - adds r1, r4, 0 - bl SetGpuReg_ForcedBlank - b _080020E0 - .pool -_080020AC: - cmp r0, 0 - bne _080020C4 - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x3C] - lsls r0, 8 - lsrs r1, r0, 16 - movs r0, 0x1E - bl SetGpuReg_ForcedBlank - b _080020E0 - .pool -_080020C4: - cmp r0, 0x2 - bne _080020E0 - ldr r0, =gUnknown_030008F8 - ldr r0, [r0, 0x3C] - lsrs r1, r0, 16 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x3E - bl SetGpuReg_ForcedBlank - movs r0, 0x3C - adds r1, r4, 0 - bl SetGpuReg_ForcedBlank -_080020E0: - ldr r0, =gUnknown_030008F8 - adds r0, 0xC - adds r0, r5, r0 - ldr r0, [r0] -_080020E8: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end ChangeBgY_ScreenOff - - thumb_func_start GetBgY -@ u32 GetBgY(u8 bg) -GetBgY: @ 80020F4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - bl IsInvalidBg_ - cmp r0, 0 - bne _08002124 - adds r0, r4, 0 - movs r1, 0x1 - bl GetBgControlAttribute - lsls r0, 16 - cmp r0, 0 - beq _08002124 - ldr r0, =gUnknown_030008F8 - lsls r1, r4, 4 - adds r0, 0xC - adds r1, r0 - ldr r0, [r1] - b _08002128 - .pool -_08002124: - movs r0, 0x1 - negs r0, r0 -_08002128: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetBgY - - thumb_func_start SetBgAffine -@ void SetBgAffine(u8 bg, u16 srcCenterX, u16 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) -SetBgAffine: @ 8002130 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - ldr r4, [sp, 0x28] - ldr r5, [sp, 0x2C] - ldr r6, [sp, 0x30] - ldr r7, [sp, 0x34] - lsls r0, 24 - lsrs r0, 24 - lsls r7, 16 - lsrs r7, 16 - lsls r3, 16 - asrs r3, 16 - lsls r4, 16 - asrs r4, 16 - str r4, [sp] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x4] - lsls r6, 16 - asrs r6, 16 - str r6, [sp, 0x8] - str r7, [sp, 0xC] - bl SetBgAffineInternal - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end SetBgAffine - - thumb_func_start Unused_AdjustBgMosaic -@ u8 Unused_AdjustBgMosaic(u8 a1, u8 a2) -Unused_AdjustBgMosaic: @ 8002170 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - movs r0, 0x4C - bl GetGpuReg - lsls r0, 16 - lsrs r5, r0, 16 - movs r1, 0xF - movs r3, 0xF - ands r3, r5 - lsrs r2, r0, 20 - ands r2, r1 - movs r0, 0xFF - lsls r0, 8 - ands r5, r0 - cmp r6, 0x6 - bhi _080021C4 - lsls r0, r6, 2 - ldr r1, =_080021A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080021A8: - .4byte _080021C4 - .4byte _080021CC - .4byte _080021D2 - .4byte _080021E4 - .4byte _080021FA - .4byte _08002200 - .4byte _08002212 -_080021C4: - movs r3, 0xF - ands r3, r4 - lsrs r2, r4, 4 - b _08002226 -_080021CC: - movs r3, 0xF - ands r3, r4 - b _08002226 -_080021D2: - lsls r0, r3, 16 - asrs r0, 16 - adds r0, r4 - cmp r0, 0xF - ble _080021E0 - movs r3, 0xF - b _08002226 -_080021E0: - adds r0, r3, r4 - b _080021F4 -_080021E4: - lsls r0, r3, 16 - asrs r0, 16 - subs r0, r4 - cmp r0, 0 - bge _080021F2 - movs r3, 0 - b _08002226 -_080021F2: - subs r0, r3, r4 -_080021F4: - lsls r0, 16 - lsrs r3, r0, 16 - b _08002226 -_080021FA: - movs r2, 0xF - ands r2, r4 - b _08002226 -_08002200: - lsls r0, r2, 16 - asrs r0, 16 - adds r0, r4 - cmp r0, 0xF - ble _0800220E - movs r2, 0xF - b _08002226 -_0800220E: - adds r0, r2, r4 - b _08002222 -_08002212: - lsls r0, r2, 16 - asrs r0, 16 - subs r0, r4 - cmp r0, 0 - bge _08002220 - movs r2, 0 - b _08002226 -_08002220: - subs r0, r2, r4 -_08002222: - lsls r0, 16 - lsrs r2, r0, 16 -_08002226: - lsls r0, r2, 16 - asrs r0, 12 - movs r1, 0xF0 - ands r0, r1 - orrs r5, r0 - lsls r0, r3, 16 - asrs r0, 16 - movs r1, 0xF - ands r0, r1 - orrs r5, r0 - lsls r0, r5, 16 - lsrs r5, r0, 16 - movs r0, 0x4C - adds r1, r5, 0 - bl SetGpuReg - lsls r0, r5, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end Unused_AdjustBgMosaic - - thumb_func_start SetBgTilemapBuffer -@ void SetBgTilemapBuffer(u8 bg, void *tilemap) -SetBgTilemapBuffer: @ 8002250 - push {r4,r5,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl IsInvalidBg_ - cmp r0, 0 - bne _0800227A - adds r0, r4, 0 - movs r1, 0x1 - bl GetBgControlAttribute - lsls r0, 16 - cmp r0, 0 - beq _0800227A - ldr r0, =gUnknown_030008F8 - lsls r1, r4, 4 - adds r0, 0x4 - adds r1, r0 - str r5, [r1] -_0800227A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end SetBgTilemapBuffer - - thumb_func_start UnsetBgTilemapBuffer -@ void UnsetBgTilemapBuffer(u8 bg) -UnsetBgTilemapBuffer: @ 8002284 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl IsInvalidBg_ - adds r5, r0, 0 - cmp r5, 0 - bne _080022AE - adds r0, r4, 0 - movs r1, 0x1 - bl GetBgControlAttribute - lsls r0, 16 - cmp r0, 0 - beq _080022AE - ldr r0, =gUnknown_030008F8 - lsls r1, r4, 4 - adds r0, 0x4 - adds r1, r0 - str r5, [r1] -_080022AE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end UnsetBgTilemapBuffer - - thumb_func_start GetBgTilemapBuffer -@ void *GetBgTilemapBuffer(u8 bg) -GetBgTilemapBuffer: @ 80022B8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - bl IsInvalidBg_ - cmp r0, 0 - bne _080022E8 - adds r0, r4, 0 - movs r1, 0x1 - bl GetBgControlAttribute - lsls r0, 16 - cmp r0, 0 - beq _080022E8 - ldr r0, =gUnknown_030008F8 - lsls r1, r4, 4 - adds r0, 0x4 - adds r1, r0 - ldr r0, [r1] - b _080022EA - .pool -_080022E8: - movs r0, 0 -_080022EA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetBgTilemapBuffer - - thumb_func_start CopyToBgTilemapBuffer -@ void CopyToBgTilemapBuffer(u8 bg, void *src, u16 mode, u16 destOffset) -CopyToBgTilemapBuffer: @ 80022F0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r1 - lsls r0, 24 - lsrs r4, r0, 24 - mov r9, r4 - lsls r7, r2, 16 - lsrs r6, r7, 16 - lsls r3, 16 - lsrs r5, r3, 16 - mov r8, r5 - adds r0, r4, 0 - bl IsInvalidBg_ - cmp r0, 0 - bne _08002358 - adds r0, r4, 0 - bl IsTileMapOutsideWram - cmp r0, 0 - bne _08002358 - cmp r6, 0 - beq _08002340 - ldr r0, =gUnknown_030008F8 - lsls r1, r4, 4 - adds r0, 0x4 - adds r1, r0 - lsls r0, r5, 1 - ldr r1, [r1] - adds r1, r0 - lsrs r2, r7, 17 - mov r0, r10 - bl CpuSet - b _08002358 - .pool -_08002340: - ldr r0, =gUnknown_030008F8 - mov r2, r9 - lsls r1, r2, 4 - adds r0, 0x4 - adds r1, r0 - mov r2, r8 - lsls r0, r2, 1 - ldr r1, [r1] - adds r1, r0 - mov r0, r10 - bl LZ77UnCompWram -_08002358: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end CopyToBgTilemapBuffer - - thumb_func_start CopyBgTilemapBufferToVram -@ void CopyBgTilemapBufferToVram(u8 bg) -CopyBgTilemapBufferToVram: @ 800236C - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl IsInvalidBg_ - cmp r0, 0 - bne _080023C8 - adds r0, r4, 0 - bl IsTileMapOutsideWram - cmp r0, 0 - bne _080023C8 - adds r0, r4, 0 - bl GetBgType - cmp r0, 0 - beq _0800239A - cmp r0, 0x1 - beq _080023A6 - movs r2, 0 - b _080023B2 -_0800239A: - adds r0, r4, 0 - movs r1, 0 - bl GetBgMetricTextMode - lsls r0, 27 - b _080023B0 -_080023A6: - adds r0, r4, 0 - movs r1, 0 - bl GetBgMetricAffineMode - lsls r0, 24 -_080023B0: - lsrs r2, r0, 16 -_080023B2: - ldr r0, =gUnknown_030008F8 - lsls r1, r4, 4 - adds r0, 0x4 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r3, 0 - bl LoadBgVram -_080023C8: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end CopyBgTilemapBufferToVram - - thumb_func_start CopyToBgTilemapBufferRect -@ void CopyToBgTilemapBufferRect(u8 bg, void *src, u8 destX, u8 destY, u8 width, u8 height) -CopyToBgTilemapBufferRect: @ 80023D4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r1 - ldr r1, [sp, 0x24] - ldr r4, [sp, 0x28] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r4, 24 - lsrs r6, r4, 24 - adds r0, r5, 0 - bl IsInvalidBg_ - cmp r0, 0 - bne _080024C4 - adds r0, r5, 0 - bl IsTileMapOutsideWram - cmp r0, 0 - bne _080024C4 - adds r0, r5, 0 - bl GetBgType - cmp r0, 0 - beq _08002422 - cmp r0, 0x1 - beq _08002470 - b _080024C4 -_08002422: - mov r4, r8 - adds r3, r7, 0 - adds r0, r3, r6 - cmp r3, r0 - bge _080024C4 - mov r12, r0 - lsls r1, r5, 4 - ldr r0, =gUnknown_030008FC - adds r1, r0 - mov r8, r1 -_08002436: - mov r2, r10 - mov r1, r9 - adds r0, r2, r1 - adds r7, r3, 0x1 - cmp r2, r0 - bge _08002460 - mov r1, r8 - ldr r6, [r1] - lsls r5, r3, 5 - adds r3, r0, 0 -_0800244A: - adds r0, r5, r2 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r4] - strh r1, [r0] - adds r4, 0x2 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r3 - blt _0800244A -_08002460: - lsls r0, r7, 16 - lsrs r3, r0, 16 - cmp r3, r12 - blt _08002436 - b _080024C4 - .pool -_08002470: - mov r4, r8 - adds r0, r5, 0 - movs r1, 0x1 - bl GetBgMetricAffineMode - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - adds r3, r7, 0 - adds r0, r3, r6 - cmp r3, r0 - bge _080024C4 - mov r12, r0 - lsls r5, 4 - mov r8, r5 -_0800248E: - mov r2, r10 - mov r1, r9 - adds r0, r2, r1 - adds r7, r3, 0x1 - cmp r2, r0 - bge _080024BC - ldr r6, =gUnknown_030008FC - add r6, r8 - ldr r1, [sp] - adds r5, r3, 0 - muls r5, r1 - adds r3, r0, 0 -_080024A6: - ldr r1, [r6] - adds r0, r5, r2 - adds r1, r0 - ldrb r0, [r4] - strb r0, [r1] - adds r4, 0x1 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r3 - blt _080024A6 -_080024BC: - lsls r0, r7, 16 - lsrs r3, r0, 16 - cmp r3, r12 - blt _0800248E -_080024C4: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end CopyToBgTilemapBufferRect - - thumb_func_start CopyToBgTilemapBufferRect_ChangePalette -@ void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette) -CopyToBgTilemapBufferRect_ChangePalette: @ 80024D8 - push {r4-r6,lr} - sub sp, 0x24 - ldr r4, [sp, 0x34] - ldr r5, [sp, 0x38] - ldr r6, [sp, 0x3C] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r2, [sp, 0x8] - str r3, [sp, 0xC] - str r4, [sp, 0x10] - str r5, [sp, 0x14] - str r6, [sp, 0x18] - movs r2, 0 - str r2, [sp, 0x1C] - str r2, [sp, 0x20] - movs r3, 0 - bl CopyRectToBgTilemapBufferRect - add sp, 0x24 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end CopyToBgTilemapBufferRect_ChangePalette - - thumb_func_start CopyRectToBgTilemapBufferRect -@ void CopyRectToBgTilemapBufferRect(u8 bg, void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, u16 tileOffset, u16 palette2) -CopyRectToBgTilemapBufferRect: @ 800251C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - str r1, [sp, 0x8] - ldr r1, [sp, 0x60] - ldr r4, [sp, 0x68] - ldr r5, [sp, 0x6C] - ldr r6, [sp, 0x70] - ldr r7, [sp, 0x74] - mov r8, r7 - ldr r7, [sp, 0x78] - mov r9, r7 - ldr r7, [sp, 0x7C] - mov r10, r7 - ldr r7, [sp, 0x80] - mov r12, r7 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0xC] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x10] - lsls r1, 24 - lsrs r7, r1, 24 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x14] - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - str r6, [sp, 0x18] - mov r0, r8 - lsls r0, 24 - lsrs r4, r0, 24 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x1C] - mov r2, r10 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x20] - mov r0, r12 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x24] - ldr r0, [sp, 0x4] - bl IsInvalidBg_ - cmp r0, 0 - beq _08002592 - b _080026EE -_08002592: - ldr r0, [sp, 0x4] - bl IsTileMapOutsideWram - cmp r0, 0 - beq _0800259E - b _080026EE -_0800259E: - ldr r0, [sp, 0x4] - movs r1, 0x4 - bl GetBgControlAttribute - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x30] - ldr r0, [sp, 0x4] - movs r1, 0x1 - bl GetBgMetricTextMode - lsls r0, 21 - lsrs r0, 16 - str r0, [sp, 0x28] - ldr r0, [sp, 0x4] - movs r1, 0x2 - bl GetBgMetricTextMode - lsls r0, 21 - lsrs r0, 16 - str r0, [sp, 0x2C] - ldr r0, [sp, 0x4] - bl GetBgType - cmp r0, 0 - beq _080025D8 - cmp r0, 0x1 - beq _08002674 - b _080026EE -_080025D8: - ldr r1, [sp, 0x10] - adds r0, r1, 0 - muls r0, r7 - ldr r2, [sp, 0xC] - adds r0, r2 - lsls r0, 1 - ldr r1, [sp, 0x8] - adds r6, r1, r0 - adds r0, r5, r4 - cmp r5, r0 - blt _080025F0 - b _080026EE -_080025F0: - ldr r2, [sp, 0x18] - subs r2, r7, r2 - str r2, [sp, 0x34] - str r0, [sp, 0x38] -_080025F8: - ldr r4, [sp, 0x14] - ldr r7, [sp, 0x18] - adds r0, r4, r7 - adds r1, r5, 0x1 - str r1, [sp, 0x3C] - cmp r4, r0 - bge _0800265A - ldr r2, [sp, 0x4] - lsls r0, r2, 4 - ldr r1, =gUnknown_030008FC - adds r0, r1 - mov r10, r0 - ldr r7, [sp, 0x20] - lsls r7, 16 - mov r9, r7 - ldr r1, [sp, 0x24] - lsls r0, r1, 16 - asrs r0, 16 - mov r8, r0 -_0800261E: - ldr r2, [sp, 0x2C] - str r2, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - ldr r2, [sp, 0x30] - ldr r3, [sp, 0x28] - bl GetTileMapIndexFromCoords - lsls r0, 16 - lsrs r0, 15 - mov r7, r10 - ldr r1, [r7] - adds r1, r0 - mov r0, r8 - str r0, [sp] - adds r0, r6, 0 - ldr r2, [sp, 0x1C] - mov r7, r9 - asrs r3, r7, 16 - bl CopyTileMapEntry - adds r6, 0x2 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r1, [sp, 0x14] - ldr r2, [sp, 0x18] - adds r0, r1, r2 - cmp r4, r0 - blt _0800261E -_0800265A: - ldr r5, [sp, 0x34] - lsls r0, r5, 1 - adds r6, r0 - ldr r7, [sp, 0x3C] - lsls r0, r7, 16 - lsrs r5, r0, 16 - ldr r0, [sp, 0x38] - cmp r5, r0 - blt _080025F8 - b _080026EE - .pool -_08002674: - ldr r1, [sp, 0x10] - adds r0, r1, 0 - muls r0, r7 - ldr r2, [sp, 0xC] - adds r0, r2 - ldr r1, [sp, 0x8] - adds r6, r1, r0 - ldr r0, [sp, 0x4] - movs r1, 0x1 - bl GetBgMetricAffineMode - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - adds r0, r5, r4 - cmp r5, r0 - bge _080026EE - ldr r2, [sp, 0x18] - subs r2, r7, r2 - str r2, [sp, 0x34] - str r0, [sp, 0x38] - ldr r7, =gUnknown_030008FC - mov r10, r7 - ldr r0, [sp, 0x4] - lsls r0, 4 - mov r8, r0 -_080026A8: - ldr r4, [sp, 0x14] - ldr r1, [sp, 0x18] - adds r0, r4, r1 - adds r2, r5, 0x1 - str r2, [sp, 0x3C] - cmp r4, r0 - bge _080026DE - mov r3, r8 - add r3, r10 - mov r7, r9 - muls r7, r5 - mov r12, r7 - adds r2, r0, 0 -_080026C2: - ldr r1, [r3] - mov r5, r12 - adds r0, r5, r4 - adds r1, r0 - ldrb r0, [r6] - ldr r7, [sp, 0x20] - adds r0, r7 - strb r0, [r1] - adds r6, 0x1 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r2 - blt _080026C2 -_080026DE: - ldr r0, [sp, 0x34] - adds r6, r0 - ldr r1, [sp, 0x3C] - lsls r0, r1, 16 - lsrs r5, r0, 16 - ldr r2, [sp, 0x38] - cmp r5, r2 - blt _080026A8 -_080026EE: - add sp, 0x40 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end CopyRectToBgTilemapBufferRect - - thumb_func_start FillBgTilemapBufferRect_Palette0 -@ void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height) -FillBgTilemapBufferRect_Palette0: @ 8002704 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r4, 24 - lsrs r4, 24 - mov r9, r4 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - bl IsInvalidBg_ - cmp r0, 0 - bne _080027F0 - adds r0, r6, 0 - bl IsTileMapOutsideWram - cmp r0, 0 - bne _080027F0 - adds r0, r6, 0 - bl GetBgType - cmp r0, 0 - beq _08002756 - cmp r0, 0x1 - beq _080027A0 - b _080027F0 -_08002756: - adds r3, r7, 0 - adds r5, r3, r5 - cmp r3, r5 - bge _080027F0 - adds r7, r5, 0 - lsls r1, r6, 4 - ldr r0, =gUnknown_030008FC - adds r1, r0 - mov r12, r1 -_08002768: - mov r2, r10 - mov r1, r9 - adds r0, r2, r1 - adds r6, r3, 0x1 - cmp r2, r0 - bge _08002790 - mov r5, r12 - ldr r4, [r5] - lsls r3, 5 - adds r1, r0, 0 -_0800277C: - adds r0, r3, r2 - lsls r0, 1 - adds r0, r4 - mov r5, r8 - strh r5, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r1 - blt _0800277C -_08002790: - lsls r0, r6, 16 - lsrs r3, r0, 16 - cmp r3, r7 - blt _08002768 - b _080027F0 - .pool -_080027A0: - adds r0, r6, 0 - movs r1, 0x1 - bl GetBgMetricAffineMode - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - adds r3, r7, 0 - adds r5, r3, r5 - cmp r3, r5 - bge _080027F0 - adds r7, r5, 0 - lsls r6, 4 - mov r12, r6 -_080027BC: - mov r2, r10 - mov r1, r9 - adds r0, r2, r1 - adds r6, r3, 0x1 - cmp r2, r0 - bge _080027E8 - ldr r5, =gUnknown_030008FC - add r5, r12 - ldr r1, [sp] - adds r4, r3, 0 - muls r4, r1 - adds r3, r0, 0 -_080027D4: - ldr r0, [r5] - adds r1, r4, r2 - adds r0, r1 - mov r1, r8 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r3 - blt _080027D4 -_080027E8: - lsls r0, r6, 16 - lsrs r3, r0, 16 - cmp r3, r7 - blt _080027BC -_080027F0: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end FillBgTilemapBufferRect_Palette0 - - thumb_func_start FillBgTilemapBufferRect -@ void FillBgTilemapBufferRect(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height, u8 palette) -FillBgTilemapBufferRect: @ 8002804 - push {r4-r6,lr} - sub sp, 0x10 - ldr r4, [sp, 0x20] - ldr r5, [sp, 0x24] - ldr r6, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r4, 0 - str r4, [sp, 0xC] - bl WriteSequenceToBgTilemapBuffer - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end FillBgTilemapBufferRect - - thumb_func_start WriteSequenceToBgTilemapBuffer -@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot, u16 tileNumDelta) -WriteSequenceToBgTilemapBuffer: @ 8002840 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - ldr r4, [sp, 0x4C] - ldr r5, [sp, 0x50] - ldr r6, [sp, 0x54] - ldr r7, [sp, 0x58] - mov r8, r7 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - add r0, sp, 0x4 - strh r1, [r0] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x8] - lsls r3, 24 - lsrs r7, r3, 24 - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - lsls r5, 24 - lsrs r4, r5, 24 - lsls r6, 24 - lsrs r6, 24 - str r6, [sp, 0xC] - mov r0, r8 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x10] - mov r0, r9 - bl IsInvalidBg_ - cmp r0, 0 - beq _0800288E - b _080029D4 -_0800288E: - mov r0, r9 - bl IsTileMapOutsideWram - cmp r0, 0 - beq _0800289A - b _080029D4 -_0800289A: - mov r0, r9 - movs r1, 0x4 - bl GetBgControlAttribute - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x1C] - mov r0, r9 - movs r1, 0x1 - bl GetBgMetricTextMode - lsls r0, 21 - lsrs r0, 16 - str r0, [sp, 0x14] - mov r0, r9 - movs r1, 0x2 - bl GetBgMetricTextMode - lsls r0, 21 - lsrs r0, 16 - str r0, [sp, 0x18] - mov r0, r9 - bl GetBgType - cmp r0, 0 - beq _080028D4 - cmp r0, 0x1 - beq _0800295C - b _080029D4 -_080028D4: - adds r5, r7, 0 - adds r0, r5, r4 - cmp r5, r0 - bge _080029D4 - str r0, [sp, 0x24] - add r7, sp, 0x4 -_080028E0: - ldr r4, [sp, 0x8] - mov r1, r10 - adds r0, r4, r1 - adds r2, r5, 0x1 - mov r8, r2 - cmp r4, r0 - bge _08002944 - mov r3, r9 - lsls r1, r3, 4 - ldr r0, =gUnknown_030008FC - adds r6, r1, r0 -_080028F6: - ldr r0, [sp, 0x18] - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - ldr r2, [sp, 0x1C] - ldr r3, [sp, 0x14] - bl GetTileMapIndexFromCoords - lsls r0, 16 - lsrs r0, 15 - ldr r1, [r6] - adds r1, r0 - movs r0, 0 - str r0, [sp] - add r0, sp, 0x4 - ldr r2, [sp, 0xC] - movs r3, 0 - bl CopyTileMapEntry - ldrh r0, [r7] - movs r2, 0xFC - lsls r2, 8 - adds r1, r2, 0 - adds r2, r0, 0 - ands r2, r1 - ldr r3, [sp, 0x10] - adds r0, r3 - ldr r3, =0x000003ff - adds r1, r3, 0 - ands r0, r1 - adds r2, r0 - strh r2, [r7] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, [sp, 0x8] - add r0, r10 - cmp r4, r0 - blt _080028F6 -_08002944: - mov r1, r8 - lsls r0, r1, 16 - lsrs r5, r0, 16 - ldr r2, [sp, 0x24] - cmp r5, r2 - blt _080028E0 - b _080029D4 - .pool -_0800295C: - mov r0, r9 - movs r1, 0x1 - bl GetBgMetricAffineMode - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x20] - adds r5, r7, 0 - adds r0, r5, r4 - cmp r5, r0 - bge _080029D4 - str r0, [sp, 0x24] - mov r3, r9 - lsls r3, 4 - mov r12, r3 -_0800297A: - ldr r4, [sp, 0x8] - mov r7, r10 - adds r0, r4, r7 - adds r1, r5, 0x1 - mov r8, r1 - cmp r4, r0 - bge _080029C8 - ldr r2, =gUnknown_030008FC - add r2, r12 - str r2, [sp, 0x28] - ldr r7, [sp, 0x20] - adds r3, r5, 0 - muls r3, r7 - add r2, sp, 0x4 - movs r1, 0xFC - lsls r1, 8 - mov r9, r1 - ldr r7, =0x000003ff - adds r5, r7, 0 - adds r6, r0, 0 -_080029A2: - ldr r0, [sp, 0x28] - ldr r1, [r0] - adds r0, r3, r4 - adds r1, r0 - ldrh r0, [r2] - strb r0, [r1] - ldrh r0, [r2] - mov r1, r9 - ands r1, r0 - ldr r7, [sp, 0x10] - adds r0, r7 - ands r0, r5 - adds r1, r0 - strh r1, [r2] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r6 - blt _080029A2 -_080029C8: - mov r1, r8 - lsls r0, r1, 16 - lsrs r5, r0, 16 - ldr r2, [sp, 0x24] - cmp r5, r2 - blt _0800297A -_080029D4: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end WriteSequenceToBgTilemapBuffer - - thumb_func_start GetBgMetricTextMode -@ u16 GetBgMetricTextMode(u8 bg, u8 whichMetric) -GetBgMetricTextMode: @ 80029EC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - adds r5, r4, 0 - movs r1, 0x4 - bl GetBgControlAttribute - lsls r0, 24 - lsrs r0, 24 - cmp r4, 0x1 - beq _08002A2C - cmp r4, 0x1 - bgt _08002A10 - cmp r4, 0 - beq _08002A16 - b _08002A52 -_08002A10: - cmp r5, 0x2 - beq _08002A3E - b _08002A52 -_08002A16: - cmp r0, 0x2 - bgt _08002A24 - cmp r0, 0x1 - bge _08002A4E -_08002A1E: - cmp r0, 0 - beq _08002A46 - b _08002A52 -_08002A24: - cmp r0, 0x3 - bne _08002A52 - movs r0, 0x4 - b _08002A54 -_08002A2C: - cmp r0, 0x1 - beq _08002A4E - cmp r0, 0x1 - ble _08002A1E - cmp r0, 0x2 - beq _08002A46 - cmp r0, 0x3 - bne _08002A52 - b _08002A4E -_08002A3E: - cmp r0, 0 - blt _08002A52 - cmp r0, 0x1 - bgt _08002A4A -_08002A46: - movs r0, 0x1 - b _08002A54 -_08002A4A: - cmp r0, 0x3 - bgt _08002A52 -_08002A4E: - movs r0, 0x2 - b _08002A54 -_08002A52: - movs r0, 0 -_08002A54: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetBgMetricTextMode - - thumb_func_start GetBgMetricAffineMode -@ u16 GetBgMetricAffineMode(u8 bg, u8 whichMetric) -GetBgMetricAffineMode: @ 8002A5C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - movs r1, 0x4 - bl GetBgControlAttribute - lsls r0, 24 - lsrs r1, r0, 24 - adds r0, r1, 0 - cmp r4, 0 - beq _08002A84 - cmp r4, 0 - blt _08002AAC - cmp r4, 0x2 - bgt _08002AAC - movs r0, 0x10 - lsls r0, r1 - b _08002AAE -_08002A84: - cmp r1, 0x1 - beq _08002AA0 - cmp r1, 0x1 - bgt _08002A92 - cmp r1, 0 - beq _08002A9C - b _08002AAC -_08002A92: - cmp r0, 0x2 - beq _08002AA4 - cmp r0, 0x3 - beq _08002AA8 - b _08002AAC -_08002A9C: - movs r0, 0x1 - b _08002AAE -_08002AA0: - movs r0, 0x4 - b _08002AAE -_08002AA4: - movs r0, 0x10 - b _08002AAE -_08002AA8: - movs r0, 0x40 - b _08002AAE -_08002AAC: - movs r0, 0 -_08002AAE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetBgMetricAffineMode - - thumb_func_start GetTileMapIndexFromCoords -@ u32 GetTileMapIndexFromCoords(u32 x, u32 y, u32 screenSize, u32 screenWidth, u32 screenHeight) -GetTileMapIndexFromCoords: @ 8002AB4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [sp, 0x8] - subs r3, 0x1 - ands r4, r3 - subs r0, 0x1 - ands r1, r0 - cmp r2, 0x1 - beq _08002AD8 - cmp r2, 0x1 - ble _08002AE0 - cmp r2, 0x2 - beq _08002AE0 - cmp r2, 0x3 - bne _08002AE0 - cmp r1, 0x1F - ble _08002AD8 - adds r1, 0x20 -_08002AD8: - cmp r4, 0x1F - ble _08002AE0 - subs r4, 0x20 - adds r1, 0x20 -_08002AE0: - lsls r0, r1, 5 - adds r0, r4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetTileMapIndexFromCoords - - thumb_func_start CopyTileMapEntry -@ void CopyTileMapEntry(u16 *src, u16 *dest, s32 palette1, u16 tileOffset, u32 palette2) -CopyTileMapEntry: @ 8002AEC - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - ldr r5, [sp, 0x10] - cmp r2, 0x10 - beq _08002B14 - cmp r2, 0x10 - bgt _08002B34 - cmp r2, 0 - blt _08002B34 - ldrh r0, [r4] - adds r0, r3 - ldr r3, =0x00000fff - adds r1, r3, 0 - ands r0, r1 - adds r1, r2, r5 - lsls r1, 12 - b _08002B3A - .pool -_08002B14: - ldrh r1, [r6] - movs r0, 0xFC - lsls r0, 8 - ands r1, r0 - lsls r2, r5, 12 - adds r2, r1, r2 - ldrh r0, [r4] - adds r0, r3 - ldr r3, =0x000003ff - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - b _08002B3C - .pool -_08002B34: - ldrh r0, [r4] - adds r0, r3 - lsls r1, r5, 12 -_08002B3A: - adds r0, r1 -_08002B3C: - lsls r0, 16 - lsrs r1, r0, 16 - strh r1, [r6] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end CopyTileMapEntry - - thumb_func_start GetBgType -@ u16 GetBgType(u8 bg) -GetBgType: @ 8002B48 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl GetBgMode - lsls r0, 24 - lsrs r0, 24 - cmp r4, 0x2 - beq _08002B76 - cmp r4, 0x2 - ble _08002B66 - cmp r4, 0x3 - beq _08002B86 - b _08002B8E -_08002B66: - cmp r5, 0 - blt _08002B8E - cmp r0, 0x1 - bgt _08002B8E - cmp r0, 0 - blt _08002B8E -_08002B72: - movs r0, 0 - b _08002B90 -_08002B76: - cmp r0, 0 - beq _08002B72 - cmp r0, 0 - blt _08002B8E - cmp r0, 0x2 - bgt _08002B8E -_08002B82: - movs r0, 0x1 - b _08002B90 -_08002B86: - cmp r0, 0 - beq _08002B72 - cmp r0, 0x2 - beq _08002B82 -_08002B8E: - ldr r0, =0x0000ffff -_08002B90: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end GetBgType - - thumb_func_start IsInvalidBg_ -@ bool8 IsInvalidBg_(u8 bg) -IsInvalidBg_: @ 8002B9C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _08002BAA - movs r0, 0 - b _08002BAC -_08002BAA: - movs r0, 0x1 -_08002BAC: - pop {r1} - bx r1 - thumb_func_end IsInvalidBg_ - - thumb_func_start IsTileMapOutsideWram -@ bool8 IsTileMapOutsideWram(u8 bg) -IsTileMapOutsideWram: @ 8002BB0 - push {lr} - lsls r0, 24 - ldr r1, =gUnknown_030008F8 - lsrs r0, 20 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - ldr r0, =0x03008000 - cmp r1, r0 - bhi _08002BD4 - cmp r1, 0 - beq _08002BD4 - movs r0, 0 - b _08002BD6 - .pool -_08002BD4: - movs r0, 0x1 -_08002BD6: - pop {r1} - bx r1 - thumb_func_end IsTileMapOutsideWram - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/big_shroomish_barboach.s b/asm/big_shroomish_barboach.s deleted file mode 100644 index 585dbf356..000000000 --- a/asm/big_shroomish_barboach.s +++ /dev/null @@ -1,489 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_80F97C8 -sub_80F97C8: @ 80F97C8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r0, 0 - movs r1, 0 - bl GetMonData - lsls r0, 16 - str r0, [sp, 0x4] - lsrs r0, 16 - str r0, [sp] - adds r0, r5, 0 - movs r1, 0x27 - bl GetMonData - adds r7, r0, 0 - movs r6, 0xF - ands r7, r6 - adds r0, r5, 0 - movs r1, 0x28 - bl GetMonData - mov r8, r0 - mov r1, r8 - ands r1, r6 - mov r8, r1 - adds r0, r5, 0 - movs r1, 0x29 - bl GetMonData - mov r9, r0 - mov r3, r9 - ands r3, r6 - mov r9, r3 - adds r0, r5, 0 - movs r1, 0x2A - bl GetMonData - mov r10, r0 - ands r0, r6 - mov r10, r0 - adds r0, r5, 0 - movs r1, 0x2B - bl GetMonData - adds r4, r0, 0 - ands r4, r6 - adds r0, r5, 0 - movs r1, 0x2C - bl GetMonData - adds r2, r0, 0 - ands r2, r6 - mov r1, r8 - mov r3, r9 - eors r1, r3 - mov r8, r1 - mov r0, r8 - muls r0, r7 - movs r1, 0xFF - ldr r3, [sp] - ands r3, r1 - eors r0, r3 - eors r4, r2 - mov r1, r10 - muls r1, r4 - ldr r3, [sp, 0x4] - lsrs r2, r3, 24 - eors r1, r2 - lsls r0, 8 - adds r0, r1 - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80F97C8 - - thumb_func_start sub_80F986C -sub_80F986C: @ 80F986C - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0x1 - ldr r3, =gUnknown_0858D8F0 -_080F9876: - lsls r0, r1, 3 - adds r0, r3 - ldrh r0, [r0, 0x4] - cmp r2, r0 - bcs _080F988C - subs r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _080F9898 - .pool -_080F988C: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xE - bls _080F9876 - adds r0, r1, 0 -_080F9898: - pop {r1} - bx r1 - thumb_func_end sub_80F986C - - thumb_func_start sub_80F989C -sub_80F989C: @ 80F989C - push {r4-r7,lr} - sub sp, 0x8 - adds r6, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r6, 16 - lsrs r6, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl sub_80C0630 - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r6, 0 - bl sub_80F986C - lsls r0, 24 - ldr r1, =gUnknown_0858D8F0 - lsrs r0, 21 - adds r0, r1 - ldrh r1, [r0] - str r1, [sp] - movs r2, 0 - str r2, [sp, 0x4] - ldrb r2, [r0, 0x2] - movs r3, 0 - ldrh r4, [r0, 0x4] - movs r5, 0 - adds r0, r6, 0 - movs r1, 0 - subs r0, r4 - sbcs r1, r5 - bl __udivdi3 - ldr r2, [sp] - ldr r3, [sp, 0x4] - adds r2, r0 - adcs r3, r1 - str r2, [sp] - str r3, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0 - bl __muldi3 - movs r2, 0xA - movs r3, 0 - bl __udivdi3 - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80F989C - - thumb_func_start sub_80F9910 -sub_80F9910: @ 80F9910 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r4, r1, 2 - adds r4, r1 - lsls r4, 1 - adds r0, r4, 0 - bl __floatsidf - cmp r4, 0 - bge _080F992C - ldr r3, _080F9974 - ldr r2, _080F9970 - bl __adddf3 -_080F992C: - ldr r2, _080F9978 - ldr r3, _080F997C - bl __divdf3 - bl __fixunsdfsi - adds r4, r0, 0 - movs r1, 0xA - bl __udivsi3 - adds r1, r0, 0 - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x8 - bl ConvertIntToDecimalStringN - adds r5, r0, 0 - ldr r1, _080F9980 - bl StringAppend - adds r5, r0, 0 - adds r0, r4, 0 - movs r1, 0xA - bl __umodsi3 - adds r1, r0, 0 - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalStringN - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_080F9970: .4byte 0x41f00000 -_080F9974: .4byte 0x00000000 -_080F9978: .4byte 0x40396666 -_080F997C: .4byte 0x66666666 -_080F9980: .4byte gUnknown_085EED24 - thumb_func_end sub_80F9910 - - thumb_func_start sub_80F9984 -sub_80F9984: @ 80F9984 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r1, 0 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r1, =gScriptResult - ldrh r0, [r1] - cmp r0, 0xFF - bne _080F99A0 - movs r0, 0 - b _080F9A0A - .pool -_080F99A0: - ldrh r1, [r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0x1 - beq _080F99C2 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - cmp r0, r6 - beq _080F99CC -_080F99C2: - movs r0, 0x1 - b _080F9A0A - .pool -_080F99CC: - mov r4, sp - adds r0, r5, 0 - bl sub_80F97C8 - strh r0, [r4] - mov r0, sp - ldrh r1, [r0] - adds r0, r6, 0 - bl sub_80F989C - adds r5, r0, 0 - ldrh r1, [r7] - adds r0, r6, 0 - bl sub_80F989C - adds r4, r0, 0 - ldr r0, =gStringVar2 - adds r1, r5, 0 - bl sub_80F9910 - cmp r5, r4 - bls _080F9A08 - mov r0, sp - ldrh r0, [r0] - strh r0, [r7] - movs r0, 0x3 - b _080F9A0A - .pool -_080F9A08: - movs r0, 0x2 -_080F9A0A: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80F9984 - - thumb_func_start sub_80F9A14 -sub_80F9A14: @ 80F9A14 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - ldrh r1, [r5] - adds r0, r4, 0 - bl sub_80F989C - adds r1, r0, 0 - ldr r0, =gStringVar3 - bl sub_80F9910 - ldr r0, =gStringVar1 - movs r1, 0xB - muls r1, r4 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldrh r1, [r5] - movs r0, 0x80 - lsls r0, 8 - cmp r1, r0 - bne _080F9A64 - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085ECF6B - bl StringCopy - b _080F9A6E - .pool -_080F9A64: - ldr r0, =gStringVar2 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy -_080F9A6E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9A14 - - thumb_func_start InitSeedotSizeRecord -InitSeedotSizeRecord: @ 80F9A7C - push {lr} - ldr r0, =0x00004047 - movs r1, 0x80 - lsls r1, 8 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end InitSeedotSizeRecord - - thumb_func_start sub_80F9A90 -sub_80F9A90: @ 80F9A90 - push {lr} - ldr r0, =0x00004047 - bl GetVarPointer - adds r1, r0, 0 - movs r0, 0x95 - lsls r0, 1 - bl sub_80F9A14 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9A90 - - thumb_func_start sub_80F9AAC -sub_80F9AAC: @ 80F9AAC - push {r4,lr} - ldr r0, =0x00004047 - bl GetVarPointer - adds r1, r0, 0 - ldr r4, =gScriptResult - movs r0, 0x95 - lsls r0, 1 - bl sub_80F9984 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9AAC - - thumb_func_start InitLotadSizeRecord -InitLotadSizeRecord: @ 80F9AD4 - push {lr} - ldr r0, =0x0000404f - movs r1, 0x80 - lsls r1, 8 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end InitLotadSizeRecord - - thumb_func_start sub_80F9AE8 -sub_80F9AE8: @ 80F9AE8 - push {lr} - ldr r0, =0x0000404f - bl GetVarPointer - adds r1, r0, 0 - ldr r0, =0x00000127 - bl sub_80F9A14 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9AE8 - - thumb_func_start sub_80F9B04 -sub_80F9B04: @ 80F9B04 - push {r4,lr} - ldr r0, =0x0000404f - bl GetVarPointer - adds r1, r0, 0 - ldr r4, =gScriptResult - ldr r0, =0x00000127 - bl sub_80F9984 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9B04 - - thumb_func_start sub_80F9B30 -sub_80F9B30: @ 80F9B30 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - movs r7, 0 - add r4, sp, 0x8 - movs r0, 0x1 - strb r0, [r4] - ldr r1, =gUnknown_0858D970 - mov r0, sp - movs r2, 0x7 - bl memcpy - mov r8, r4 - cmp r6, 0xA - bhi _080F9BAC - cmp r5, 0x40 - bhi _080F9BAC - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x000031a8 - adds r0, r1 - adds r0, r6 - strb r5, [r0] - movs r5, 0 -_080F9B6A: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _080F9B9C - adds r0, r4, 0 - movs r1, 0x6 - bl GetMonData - cmp r0, 0 - bne _080F9B9C - mov r1, sp - adds r0, r1, r6 - ldrb r1, [r0] - adds r0, r4, 0 - mov r2, r8 - bl SetMonData - movs r7, 0x1 -_080F9B9C: - adds r5, 0x1 - cmp r5, 0x5 - ble _080F9B6A - cmp r7, 0 - beq _080F9BAC - ldr r0, =0x0000089b - bl FlagSet -_080F9BAC: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9B30 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/braille_puzzles.s b/asm/braille_puzzles.s index 7015f1d7a..ceaddbdf0 100644 --- a/asm/braille_puzzles.s +++ b/asm/braille_puzzles.s @@ -73,7 +73,7 @@ sub_817963C: @ 817963C bl PlaySE ldr r0, =0x000008af bl FlagSet - bl script_env_2_disable + bl ScriptContext2_Disable pop {r0} bx r0 .pool @@ -91,7 +91,7 @@ sub_81796AC: @ 81796AC lsls r1, 1 cmp r0, r1 bne _081796F4 - bl calc_player_party_count + bl CalculatePlayerPartyCount ldr r0, =gPlayerPartyCount ldrb r1, [r0] movs r0, 0x64 @@ -218,7 +218,7 @@ sub_8179778: @ 8179778 bne _081797D0 adds r0, r5, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts bl InstallCameraPanAheadCallback _081797D0: pop {r4,r5} @@ -326,7 +326,7 @@ sub_8179860: @ 8179860 movs r0, 0x8B lsls r0, 4 bl FlagSet - bl script_env_2_disable + bl ScriptContext2_Disable pop {r0} bx r0 .pool @@ -421,7 +421,7 @@ sub_8179944: @ 8179944 bl PlaySE ldr r0, =0x000008b2 bl FlagSet - bl script_env_2_disable + bl ScriptContext2_Disable pop {r0} bx r0 .pool diff --git a/asm/cable_car.s b/asm/cable_car.s index cefd2ef89..9307c54ff 100644 --- a/asm/cable_car.s +++ b/asm/cable_car.s @@ -31,7 +31,7 @@ _0814FC8E: sub_814FC9C: @ 814FC9C push {lr} sub sp, 0x4 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =sub_814FC70 movs r1, 0x1 bl CreateTask diff --git a/asm/cable_club.s b/asm/cable_club.s index 73288455f..21713e0be 100644 --- a/asm/cable_club.s +++ b/asm/cable_club.s @@ -74,7 +74,7 @@ sub_80B23B0: @ 80B23B0 adds r0, r4, 0 movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow adds r0, r4, 0 movs r1, 0x3 bl CopyWindowToVram @@ -738,7 +738,7 @@ _080B2994: bl sub_800ABAC ldr r4, =gUnknown_03005DB8 strb r0, [r4] - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r1, =gUnknown_03005DB4 strb r0, [r1] ldrb r0, [r4] @@ -751,7 +751,7 @@ _080B2994: ldrb r0, [r0] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_02024488 + ldr r5, =gBattleScripting + 0x14 adds r0, r5 movs r1, 0xB movs r2, 0 @@ -828,7 +828,7 @@ _080B2A6C: bl sub_800ABAC ldr r4, =gUnknown_03005DB8 strb r0, [r4] - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r1, =gUnknown_03005DB4 strb r0, [r1] ldrb r0, [r4] @@ -841,7 +841,7 @@ _080B2A6C: ldrb r0, [r0] movs r6, 0x64 muls r0, r6 - ldr r5, =gUnknown_02024488 + ldr r5, =gBattleScripting + 0x14 adds r0, r5 movs r1, 0xB movs r2, 0 @@ -999,7 +999,7 @@ _080B2BEC: adds r0, r1 ldrh r0, [r0, 0x12] bl sub_80B241C - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts lsls r0, r4, 24 lsrs r0, 24 bl DestroyTask @@ -1038,7 +1038,7 @@ sub_80B2C30: @ 80B2C30 cmp r4, r0 bne _080B2C9C movs r4, 0 - ldr r6, =gUnknown_020229E8 + ldr r6, =gLinkPlayers b _080B2C7E .pool _080B2C5C: @@ -1093,7 +1093,7 @@ sub_80B2CB0: @ 80B2CB0 adds r4, r0 ldrh r0, [r4, 0x12] bl sub_80B241C - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts ldrb r0, [r4, 0x12] bl RemoveWindow adds r0, r5, 0 @@ -1124,7 +1124,7 @@ sub_80B2CEC: @ 80B2CEC bl sub_8098374 ldrb r0, [r4, 0x12] bl RemoveWindow - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r5, 0 bl DestroyTask pop {r4,r5} @@ -1152,7 +1152,7 @@ sub_80B2D2C: @ 80B2D2C ldrb r0, [r4, 0x12] bl RemoveWindow bl textbox_close - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r5, 0 bl DestroyTask pop {r4,r5} @@ -1367,7 +1367,7 @@ _080B2F0C: movs r4, 0 cmp r7, r5 bge _080B2F74 - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers ldrb r2, [r0] ldrh r3, [r0, 0x1A] subs r1, r2, 0x1 @@ -1429,7 +1429,7 @@ _080B2F82: b _080B2FC6 .pool _080B2FA8: - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r6, 0 bl DestroyTask b _080B2FC6 @@ -1438,7 +1438,7 @@ _080B2FB4: ldrb r0, [r0] cmp r0, 0 bne _080B2FC6 - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r6, 0 bl DestroyTask _080B2FC6: @@ -1848,7 +1848,7 @@ _080B3346: b _080B33A0 .pool _080B3354: - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers ldr r0, [r0, 0x4] movs r1, 0x1 ands r0, r1 @@ -1867,7 +1867,7 @@ _080B3378: ldrh r0, [r0] bl sub_80B3260 bl overworld_free_bg_tilemaps - ldr r1, =gUnknown_02038BCA + ldr r1, =gTrainerBattleOpponent_A movs r2, 0x80 lsls r2, 4 adds r0, r2, 0 @@ -1962,7 +1962,7 @@ _080B3458: cmp r4, r0 bne _080B3532 movs r4, 0 - ldr r5, =gUnknown_020229E8 + ldr r5, =gLinkPlayers b _080B349A .pool _080B3474: @@ -2018,7 +2018,7 @@ _080B34CE: strh r0, [r6] b _080B3532 _080B34DE: - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers ldr r0, [r0, 0x4] movs r1, 0x1 ands r0, r1 @@ -2033,14 +2033,14 @@ _080B34FC: lsls r0, 1 bl PlayNewMapMusic__default_for_battle _080B3504: - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers ldr r0, =0x00002211 str r0, [r1, 0x14] ldr r0, =gSpecialVar_0x8004 ldrh r0, [r0] bl sub_80B3260 bl overworld_free_bg_tilemaps - ldr r1, =gUnknown_02038BCA + ldr r1, =gTrainerBattleOpponent_A movs r3, 0x80 lsls r3, 4 adds r0, r3, 0 @@ -2087,7 +2087,7 @@ _080B357A: movs r2, 0 cmp r4, r3 bge _080B35AC - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers ldrb r0, [r1] subs r0, 0x4 cmp r0, 0x1 @@ -2185,8 +2185,8 @@ sub_80B360C: @ 80B360C b _080B36B2 .pool _080B3670: - ldr r4, =gUnknown_020229E8 - bl link_get_multiplayer_id + ldr r4, =gLinkPlayers + bl GetMultiplayerId eors r0, r5 lsls r0, 24 lsrs r0, 24 @@ -2201,8 +2201,8 @@ _080B3670: b _080B36B2 .pool _080B3694: - ldr r4, =gUnknown_020229E8 - bl link_get_multiplayer_id + ldr r4, =gLinkPlayers + bl GetMultiplayerId eors r0, r5 lsls r0, 24 lsrs r0, 24 @@ -2342,7 +2342,7 @@ _080B37B8: bl sub_8197AE8 adds r0, r4, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _080B37CC: pop {r4,r5} pop {r0} @@ -2362,7 +2362,7 @@ sub_80B37D4: @ 80B37D4 adds r1, r4, 0 adds r2, r5, 0 bl SetTaskFuncWithFollowupFunc - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop pop {r4,r5} pop {r0} bx r0 @@ -2396,7 +2396,7 @@ _080B3824: beq _080B3870 b _080B3884 _080B382E: - bl script_env_2_enable + bl ScriptContext2_Enable movs r0, 0x1 movs r1, 0 bl fade_screen @@ -2467,7 +2467,7 @@ _080B38BC: beq _080B3908 b _080B391C _080B38C6: - bl script_env_2_enable + bl ScriptContext2_Enable movs r0, 0x1 movs r1, 0 bl fade_screen @@ -2575,7 +2575,7 @@ sub_80B39A4: @ 80B39A4 ldr r0, =sub_80B3728 movs r1, 0x50 bl CreateTask - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop pop {r0} bx r0 .pool @@ -2605,7 +2605,7 @@ sub_80B39D4: @ 80B39D4 lsls r1, r4, 3 subs r1, r4 lsls r1, 2 - ldr r2, =gUnknown_020229F0 + ldr r2, =gLinkPlayers + 8 adds r1, r2 bl StringCopy adds r0, r4, 0 @@ -2695,7 +2695,7 @@ sub_80B3AAC: @ 80B3AAC ldrb r0, [r0] cmp r0, 0 bne _080B3AC4 - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask _080B3AC4: diff --git a/asm/calculate_base_damage.s b/asm/calculate_base_damage.s deleted file mode 100644 index 5aabfc4c3..000000000 --- a/asm/calculate_base_damage.s +++ /dev/null @@ -1,1045 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_806957C -sub_806957C: @ 806957C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - adds r6, r0, 0 - str r1, [sp, 0x4] - str r2, [sp, 0x8] - ldr r0, [sp, 0x50] - ldr r1, [sp, 0x54] - ldr r2, [sp, 0x58] - ldr r4, [sp, 0x5C] - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0xC] - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x14] - movs r5, 0 - cmp r3, 0 - bne _080695D4 - ldr r2, =gBattleMovePower - ldr r1, =gBattleMoves - ldr r3, [sp, 0x8] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x1] - strh r0, [r2] - b _080695D8 - .pool -_080695D4: - ldr r0, =gBattleMovePower - strh r3, [r0] -_080695D8: - cmp r7, 0 - bne _080695F8 - ldr r1, =gBattleMoves - ldr r7, [sp, 0x8] - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - mov r10, r0 - b _08069602 - .pool -_080695F8: - movs r0, 0x3F - mov r10, r0 - mov r1, r10 - ands r1, r7 - mov r10, r1 -_08069602: - ldrh r7, [r6, 0x2] - ldr r2, [sp, 0x4] - ldrh r2, [r2, 0x4] - str r2, [sp, 0x18] - ldrh r3, [r6, 0x8] - mov r8, r3 - ldr r0, [sp, 0x4] - ldrh r0, [r0, 0xA] - str r0, [sp, 0x1C] - ldrh r0, [r6, 0x2E] - cmp r0, 0xAF - bne _08069634 - ldr r1, =gEnigmaBerries - ldr r2, [sp, 0x10] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r3, [r0, 0x7] - mov r9, r3 - ldrb r0, [r0, 0x1A] - b _0806964A - .pool -_08069634: - ldrh r0, [r6, 0x2E] - bl ItemId_GetHoldEffect - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldrh r0, [r6, 0x2E] - bl ItemId_GetHoldEffectParam - lsls r0, 24 - lsrs r0, 24 -_0806964A: - str r0, [sp, 0x24] - ldr r1, [sp, 0x4] - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0806967E - ldr r1, =gEnigmaBerries - ldr r2, [sp, 0x14] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x7] - str r0, [sp, 0x20] - b _08069694 - .pool -_0806966C: - ldr r0, [sp, 0x24] - adds r0, 0x64 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 - b _0806977C -_0806967E: - ldr r3, [sp, 0x4] - ldrh r0, [r3, 0x2E] - bl ItemId_GetHoldEffect - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x20] - ldr r1, [sp, 0x4] - ldrh r0, [r1, 0x2E] - bl ItemId_GetHoldEffectParam -_08069694: - adds r0, r6, 0 - adds r0, 0x20 - ldrb r1, [r0] - str r0, [sp, 0x28] - cmp r1, 0x25 - beq _080696A4 - cmp r1, 0x4A - bne _080696A8 -_080696A4: - lsls r0, r7, 17 - lsrs r7, r0, 16 -_080696A8: - ldr r0, =0x00000867 - ldr r1, [sp, 0x10] - bl sub_8069ED8 - lsls r0, 24 - cmp r0, 0 - beq _080696C4 - movs r0, 0x6E - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 -_080696C4: - ldr r0, =0x0000086b - ldr r1, [sp, 0x14] - bl sub_8069ED8 - lsls r0, 24 - cmp r0, 0 - beq _080696E4 - movs r0, 0x6E - ldr r2, [sp, 0x18] - muls r0, r2 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] -_080696E4: - ldr r4, =0x0000086d - adds r0, r4, 0 - ldr r1, [sp, 0x10] - bl sub_8069ED8 - lsls r0, 24 - cmp r0, 0 - beq _08069708 - movs r0, 0x6E - mov r3, r8 - muls r3, r0 - adds r0, r3, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_08069708: - adds r0, r4, 0 - ldr r1, [sp, 0x14] - bl sub_8069ED8 - lsls r0, 24 - cmp r0, 0 - beq _08069728 - movs r0, 0x6E - ldr r1, [sp, 0x1C] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x1C] -_08069728: - movs r2, 0 - ldr r4, =gHoldEffectToType - ldr r3, [sp, 0x4] - adds r3, 0x20 - str r3, [sp, 0x2C] - adds r3, r4, 0 -_08069734: - lsls r1, r2, 1 - ldrb r0, [r3] - cmp r9, r0 - bne _08069774 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r10, r0 - bne _08069774 - mov r1, r10 - cmp r1, 0x8 - bls _0806966C - ldr r0, [sp, 0x24] - adds r0, 0x64 - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - b _0806977C - .pool -_08069774: - adds r3, 0x2 - adds r2, 0x1 - cmp r2, 0x10 - bls _08069734 -_0806977C: - mov r3, r9 - cmp r3, 0x1D - bne _08069790 - movs r0, 0x96 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 -_08069790: - mov r0, r9 - cmp r0, 0x22 - bne _080697C6 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x003f0100 - ands r0, r1 - cmp r0, 0 - bne _080697C6 - ldr r1, =0xfffffe69 - adds r0, r1, 0 - ldrh r2, [r6] - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080697C6 - movs r0, 0x96 - mov r3, r8 - muls r3, r0 - adds r0, r3, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_080697C6: - ldr r0, [sp, 0x20] - cmp r0, 0x22 - bne _080697FC - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x003f0100 - ands r0, r1 - cmp r0, 0 - bne _080697FC - ldr r1, =0xfffffe69 - adds r0, r1, 0 - ldr r2, [sp, 0x4] - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080697FC - movs r0, 0x96 - ldr r3, [sp, 0x1C] - muls r0, r3 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x1C] -_080697FC: - mov r0, r9 - cmp r0, 0x23 - bne _08069812 - ldrh r1, [r6] - ldr r0, =0x00000175 - cmp r1, r0 - bne _08069812 - mov r1, r8 - lsls r0, r1, 17 - lsrs r0, 16 - mov r8, r0 -_08069812: - ldr r2, [sp, 0x20] - cmp r2, 0x24 - bne _0806982A - ldr r3, [sp, 0x4] - ldrh r1, [r3] - ldr r0, =0x00000175 - cmp r1, r0 - bne _0806982A - ldr r1, [sp, 0x1C] - lsls r0, r1, 17 - lsrs r0, 16 - str r0, [sp, 0x1C] -_0806982A: - mov r2, r9 - cmp r2, 0x2D - bne _0806983E - ldrh r0, [r6] - cmp r0, 0x19 - bne _0806983E - mov r3, r8 - lsls r0, r3, 17 - lsrs r0, 16 - mov r8, r0 -_0806983E: - ldr r0, [sp, 0x20] - cmp r0, 0x40 - bne _08069854 - ldr r1, [sp, 0x4] - ldrh r0, [r1] - cmp r0, 0x84 - bne _08069854 - ldr r2, [sp, 0x18] - lsls r0, r2, 17 - lsrs r0, 16 - str r0, [sp, 0x18] -_08069854: - mov r3, r9 - cmp r3, 0x41 - bne _0806986A - ldrh r0, [r6] - subs r0, 0x68 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _0806986A - lsls r0, r7, 17 - lsrs r7, r0, 16 -_0806986A: - ldr r1, [sp, 0x2C] - ldrb r0, [r1] - cmp r0, 0x2F - bne _08069882 - mov r2, r10 - cmp r2, 0xA - beq _0806987C - cmp r2, 0xF - bne _08069882 -_0806987C: - mov r3, r8 - lsrs r3, 1 - mov r8, r3 -_08069882: - ldr r0, [sp, 0x28] - ldrb r4, [r0] - cmp r4, 0x37 - bne _08069898 - movs r0, 0x96 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 -_08069898: - cmp r4, 0x39 - bne _080698C6 - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x3A - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - beq _080698C6 - movs r0, 0x96 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_080698C6: - ldr r2, [sp, 0x28] - ldrb r0, [r2] - cmp r0, 0x3A - bne _080698F8 - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x39 - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - beq _080698F8 - movs r0, 0x96 - mov r3, r8 - muls r3, r0 - adds r0, r3, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_080698F8: - ldr r1, [sp, 0x28] - ldrb r0, [r1] - cmp r0, 0x3E - bne _08069914 - ldr r0, [r6, 0x4C] - cmp r0, 0 - beq _08069914 - movs r0, 0x96 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 -_08069914: - ldr r2, [sp, 0x2C] - ldrb r0, [r2] - cmp r0, 0x3F - bne _08069936 - ldr r3, [sp, 0x4] - ldr r0, [r3, 0x4C] - cmp r0, 0 - beq _08069936 - movs r0, 0x96 - ldr r1, [sp, 0x18] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] -_08069936: - mov r2, r10 - cmp r2, 0xD - bne _0806995A - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0 - movs r3, 0xFD - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - beq _0806995A - ldr r1, =gBattleMovePower - ldrh r0, [r1] - lsrs r0, 1 - strh r0, [r1] -_0806995A: - mov r3, r10 - cmp r3, 0xA - bne _0806997E - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0 - movs r3, 0xFE - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - beq _0806997E - ldr r1, =gBattleMovePower - ldrh r0, [r1] - lsrs r0, 1 - strh r0, [r1] -_0806997E: - mov r0, r10 - cmp r0, 0xC - bne _080699AE - ldr r1, [sp, 0x28] - ldrb r0, [r1] - cmp r0, 0x41 - bne _080699AE - ldrh r0, [r6, 0x2C] - movs r1, 0x3 - bl __udivsi3 - ldrh r1, [r6, 0x28] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _080699AE - ldr r4, =gBattleMovePower - ldrh r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4] -_080699AE: - mov r2, r10 - cmp r2, 0xA - bne _080699DE - ldr r3, [sp, 0x28] - ldrb r0, [r3] - cmp r0, 0x42 - bne _080699DE - ldrh r0, [r6, 0x2C] - movs r1, 0x3 - bl __udivsi3 - ldrh r1, [r6, 0x28] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _080699DE - ldr r4, =gBattleMovePower - ldrh r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4] -_080699DE: - mov r0, r10 - cmp r0, 0xB - bne _08069A0E - ldr r1, [sp, 0x28] - ldrb r0, [r1] - cmp r0, 0x43 - bne _08069A0E - ldrh r0, [r6, 0x2C] - movs r1, 0x3 - bl __udivsi3 - ldrh r1, [r6, 0x28] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _08069A0E - ldr r4, =gBattleMovePower - ldrh r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4] -_08069A0E: - mov r2, r10 - cmp r2, 0x6 - bne _08069A3E - ldr r3, [sp, 0x28] - ldrb r0, [r3] - cmp r0, 0x44 - bne _08069A3E - ldrh r0, [r6, 0x2C] - movs r1, 0x3 - bl __udivsi3 - ldrh r1, [r6, 0x28] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _08069A3E - ldr r4, =gBattleMovePower - ldrh r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4] -_08069A3E: - ldr r2, =gBattleMoves - ldr r0, =gCurrentMove - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x7 - bne _08069A58 - ldr r0, [sp, 0x18] - lsrs r0, 1 - str r0, [sp, 0x18] -_08069A58: - mov r1, r10 - cmp r1, 0x8 - bls _08069A60 - b _08069BC2 -_08069A60: - ldr r0, =gCritMultiplier - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x2 - bne _08069AA0 - movs r0, 0x19 - ldrsb r0, [r6, r0] - cmp r0, 0x6 - ble _08069A9C - ldr r2, =gUnknown_08329D2E - b _08069AA6 - .pool -_08069A9C: - adds r5, r7, 0 - b _08069ABE -_08069AA0: - ldr r2, =gUnknown_08329D2E - movs r0, 0x19 - ldrsb r0, [r6, r0] -_08069AA6: - lsls r0, 1 - adds r1, r0, r2 - ldrb r1, [r1] - adds r5, r7, 0 - muls r5, r1 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r0] - adds r0, r5, 0 - bl __divsi3 - adds r5, r0, 0 -_08069ABE: - ldr r0, =gBattleMovePower - ldrh r0, [r0] - muls r5, r0 - adds r0, r6, 0 - adds r0, 0x2A - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x5 - bl __divsi3 - adds r0, 0x2 - muls r5, r0 - ldrb r0, [r4] - cmp r0, 0x2 - bne _08069AFC - ldr r2, [sp, 0x4] - movs r0, 0x1A - ldrsb r0, [r2, r0] - cmp r0, 0x5 - bgt _08069AF8 - ldr r2, =gUnknown_08329D2E - ldr r3, [sp, 0x4] - movs r0, 0x1A - ldrsb r0, [r3, r0] - b _08069B04 - .pool -_08069AF8: - ldr r3, [sp, 0x18] - b _08069B1E -_08069AFC: - ldr r2, =gUnknown_08329D2E - ldr r1, [sp, 0x4] - movs r0, 0x1A - ldrsb r0, [r1, r0] -_08069B04: - lsls r0, 1 - adds r1, r0, r2 - ldrb r1, [r1] - ldr r7, [sp, 0x18] - adds r3, r7, 0 - muls r3, r1 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r0] - adds r0, r3, 0 - bl __divsi3 - adds r3, r0, 0 -_08069B1E: - adds r0, r5, 0 - adds r1, r3, 0 - bl __divsi3 - adds r5, r0, 0 - movs r1, 0x32 - bl __divsi3 - adds r5, r0, 0 - ldr r0, [r6, 0x4C] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08069B48 - ldr r1, [sp, 0x28] - ldrb r0, [r1] - cmp r0, 0x3E - beq _08069B48 - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069B48: - movs r0, 0x1 - ldr r2, [sp, 0xC] - ands r0, r2 - cmp r0, 0 - beq _08069B8A - ldrb r1, [r4] - cmp r1, 0x1 - bne _08069B8A - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - beq _08069B84 - movs r0, 0x2 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08069B84 - adds r0, r5, 0 - movs r1, 0x3 - bl __divsi3 - lsls r5, r0, 1 - b _08069B8A - .pool -_08069B84: - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069B8A: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08069BBC - ldr r0, =gBattleMoves - ldr r3, [sp, 0x8] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, 0x8 - bne _08069BBC - movs r0, 0x2 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08069BBC - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069BBC: - cmp r5, 0 - bne _08069BC2 - movs r5, 0x1 -_08069BC2: - mov r7, r10 - cmp r7, 0x9 - bne _08069BCA - movs r5, 0 -_08069BCA: - mov r0, r10 - cmp r0, 0x9 - bhi _08069BD2 - b _08069DD4 -_08069BD2: - ldr r0, =gCritMultiplier - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x2 - bne _08069BFC - movs r0, 0x1C - ldrsb r0, [r6, r0] - cmp r0, 0x6 - ble _08069BF8 - ldr r2, =gUnknown_08329D2E - b _08069C02 - .pool -_08069BF8: - mov r5, r8 - b _08069C1A -_08069BFC: - ldr r2, =gUnknown_08329D2E - movs r0, 0x1C - ldrsb r0, [r6, r0] -_08069C02: - lsls r0, 1 - adds r1, r0, r2 - ldrb r1, [r1] - mov r5, r8 - muls r5, r1 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r0] - adds r0, r5, 0 - bl __divsi3 - adds r5, r0, 0 -_08069C1A: - ldr r0, =gBattleMovePower - ldrh r0, [r0] - muls r5, r0 - adds r0, r6, 0 - adds r0, 0x2A - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x5 - bl __divsi3 - adds r0, 0x2 - muls r5, r0 - ldrb r0, [r4] - cmp r0, 0x2 - bne _08069C54 - ldr r1, [sp, 0x4] - movs r0, 0x1D - ldrsb r0, [r1, r0] - cmp r0, 0x5 - bgt _08069C50 - ldr r2, =gUnknown_08329D2E - b _08069C5C - .pool -_08069C50: - ldr r3, [sp, 0x1C] - b _08069C76 -_08069C54: - ldr r2, =gUnknown_08329D2E - ldr r7, [sp, 0x4] - movs r0, 0x1D - ldrsb r0, [r7, r0] -_08069C5C: - lsls r0, 1 - adds r1, r0, r2 - ldrb r1, [r1] - ldr r6, [sp, 0x1C] - adds r3, r6, 0 - muls r3, r1 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r0] - adds r0, r3, 0 - bl __divsi3 - adds r3, r0, 0 -_08069C76: - adds r0, r5, 0 - adds r1, r3, 0 - bl __divsi3 - adds r5, r0, 0 - movs r1, 0x32 - bl __divsi3 - adds r5, r0, 0 - movs r0, 0x2 - ldr r7, [sp, 0xC] - ands r0, r7 - cmp r0, 0 - beq _08069CCA - ldrb r1, [r4] - cmp r1, 0x1 - bne _08069CCA - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - beq _08069CC4 - movs r0, 0x2 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08069CC4 - adds r0, r5, 0 - movs r1, 0x3 - bl __divsi3 - lsls r5, r0, 1 - b _08069CCA - .pool -_08069CC4: - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069CCA: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08069CFC - ldr r0, =gBattleMoves - ldr r2, [sp, 0x8] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, 0x8 - bne _08069CFC - movs r0, 0x2 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08069CFC - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069CFC: - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08069DAC - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - bne _08069DAC - ldr r2, =gBattleWeather - ldrh r1, [r2] - movs r0, 0x1 - ands r0, r1 - adds r4, r2, 0 - cmp r0, 0 - beq _08069D64 - mov r3, r10 - cmp r3, 0xA - beq _08069D50 - cmp r3, 0xB - beq _08069D58 - b _08069D64 - .pool -_08069D50: - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 - b _08069D64 -_08069D58: - lsls r0, r5, 4 - subs r0, r5 - movs r1, 0xA - bl __divsi3 - adds r5, r0, 0 -_08069D64: - ldrh r1, [r4] - movs r0, 0x9F - ands r0, r1 - cmp r0, 0 - beq _08069D7C - ldr r0, =gCurrentMove - ldrh r0, [r0] - cmp r0, 0x4C - bne _08069D7C - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069D7C: - ldrh r1, [r4] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08069DAC - mov r6, r10 - cmp r6, 0xA - beq _08069D98 - cmp r6, 0xB - beq _08069DA6 - b _08069DAC - .pool -_08069D98: - lsls r0, r5, 4 - subs r0, r5 - movs r1, 0xA - bl __divsi3 - adds r5, r0, 0 - b _08069DAC -_08069DA6: - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069DAC: - ldr r0, =gBattleResources - ldr r0, [r0] - ldr r0, [r0, 0x4] - ldr r7, [sp, 0x10] - lsls r1, r7, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08069DD4 - mov r0, r10 - cmp r0, 0xA - bne _08069DD4 - lsls r0, r5, 4 - subs r0, r5 - movs r1, 0xA - bl __divsi3 - adds r5, r0, 0 -_08069DD4: - adds r0, r5, 0x2 - add sp, 0x30 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806957C - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/clear_save_data_screen.s b/asm/clear_save_data_screen.s index 9eff4a775..27c32feb5 100644 --- a/asm/clear_save_data_screen.s +++ b/asm/clear_save_data_screen.s @@ -41,7 +41,7 @@ sub_817ACE4: @ 817ACE4 str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, =gUnknown_085F06D8 movs r1, 0x2 movs r2, 0xE @@ -95,7 +95,7 @@ _0817AD68: movs r0, 0 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 diff --git a/asm/clock.s b/asm/clock.s index 9a40213f5..01c7e964e 100644 --- a/asm/clock.s +++ b/asm/clock.s @@ -78,7 +78,7 @@ sub_809E7E8: @ 809E7E8 adds r0, r4, 0 bl sub_80AEFBC adds r0, r4, 0 - bl sub_806DE44 + bl UpdatePartyPokerusTime adds r0, r4, 0 bl sub_8137904 adds r0, r4, 0 @@ -90,7 +90,7 @@ sub_809E7E8: @ 809E7E8 adds r0, r4, 0 bl sub_813945C adds r0, r4, 0 - bl sub_8177584 + bl SetRandomLotteryNumber ldrh r0, [r5] strh r0, [r6] _0809E84E: diff --git a/asm/coins.s b/asm/coins.s index 88e515b47..ea55dd85c 100644 --- a/asm/coins.s +++ b/asm/coins.s @@ -5,148 +5,8 @@ .text - thumb_func_start PrintCoinsString -@ void PrintCoinsString(s32 coinAmount) -PrintCoinsString: @ 8145B54 - push {r4,lr} - sub sp, 0xC - adds r1, r0, 0 - ldr r0, =gStringVar1 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DAB - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x40 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - ldr r0, =gUnknown_0203AB9C - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - bl Print - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end PrintCoinsString - - thumb_func_start ShowCoinsWindow -@ void ShowCoinsWindow(s32 coinAmount, u8 x, u8 y) -ShowCoinsWindow: @ 8145BAC - push {r4,r5,lr} - sub sp, 0x18 - adds r5, r0, 0 - adds r4, r1, 0 - adds r3, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x00000141 - str r0, [sp, 0xC] - add r0, sp, 0x10 - movs r1, 0 - adds r2, r4, 0 - bl rbox_template_set - ldr r4, =gUnknown_0203AB9C - add r0, sp, 0x10 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl FillWindowPixelBuffer - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r2, 0x85 - lsls r2, 2 - movs r1, 0 - movs r3, 0xE - bl SetWindowBorderStyle - adds r0, r5, 0 - bl PrintCoinsString - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ShowCoinsWindow - - thumb_func_start HideCoinsWindow -@ void HideCoinsWindow() -HideCoinsWindow: @ 8145C14 - push {r4,lr} - ldr r4, =gUnknown_0203AB9C - ldrb r0, [r4] - movs r1, 0x1 - bl sub_819746C - ldrb r0, [r4] - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end HideCoinsWindow - - thumb_func_start GetCoins -@ u16 GetCoins() -GetCoins: @ 8145C30 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =0x00000494 - adds r1, r0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xAC - ldr r0, [r0] - ldrh r1, [r1] - eors r0, r1 - lsls r0, 16 - lsrs r0, 16 - bx lr - .pool - thumb_func_end GetCoins - - thumb_func_start SetCoins -@ void SetCoins(u16 amount) -SetCoins: @ 8145C58 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - adds r1, 0xAC - ldr r1, [r1] - eors r0, r1 - ldr r1, =0x00000494 - adds r2, r1 - strh r0, [r2] - bx lr - .pool - thumb_func_end SetCoins - thumb_func_start AddCoins -@ bool8 AddCoins(u16 amount) +@ bool8 AddCoins(u16 toAdd) AddCoins: @ 8145C80 push {r4,lr} lsls r0, 16 @@ -187,7 +47,7 @@ _08145CC0: thumb_func_end AddCoins thumb_func_start SubtractCoins -@ bool8 SubtractCoins(u16 amount) +@ bool8 SubtractCoins(u16 toSub) SubtractCoins: @ 8145CCC push {r4,lr} lsls r0, 16 diff --git a/asm/contest.s b/asm/contest.s index 0e2f45740..9425e262d 100644 --- a/asm/contest.s +++ b/asm/contest.s @@ -837,7 +837,7 @@ sub_80D7DE8: @ 80D7DE8 lsls r1, 16 cmp r1, 0 bgt _080D7E2A - bl link_get_multiplayer_id + bl GetMultiplayerId adds r0, r4, 0 bl DestroyTask ldr r0, =gUnknown_02039F34 @@ -1415,19 +1415,19 @@ sub_80D833C: @ 80D833C lsls r0, 24 cmp r0, 0 bne _080D83CC - ldr r0, =gUnknown_02022E2C + ldr r0, =gDisplayedStringBattle ldr r1, =gUnknown_0827D507 bl StringCopy b _080D83D4 .pool _080D83CC: - ldr r0, =gUnknown_02022E2C + ldr r0, =gDisplayedStringBattle ldr r1, =gUnknown_0827D531 bl StringCopy _080D83D4: bl sub_80DB89C ldr r4, =gStringVar4 - ldr r1, =gUnknown_02022E2C + ldr r1, =gDisplayedStringBattle adds r0, r4, 0 bl StringExpandPlaceholders adds r0, r4, 0 @@ -1752,19 +1752,19 @@ _080D868E: lsls r0, 24 cmp r0, 0 bne _080D86DC - ldr r0, =gUnknown_02022E2C + ldr r0, =gDisplayedStringBattle ldr r1, =gUnknown_0827D507 bl StringCopy b _080D86E4 .pool _080D86DC: - ldr r0, =gUnknown_02022E2C + ldr r0, =gDisplayedStringBattle ldr r1, =gUnknown_0827D531 bl StringCopy _080D86E4: bl sub_80DB89C ldr r4, =gStringVar4 - ldr r1, =gUnknown_02022E2C + ldr r1, =gDisplayedStringBattle adds r0, r4, 0 bl StringExpandPlaceholders adds r0, r4, 0 @@ -5599,8 +5599,8 @@ _080DA860: thumb_func_start sub_80DA874 sub_80DA874: @ 80DA874 push {lr} - bl script_env_2_disable - bl script_env_2_enable_and_set_ctx_running + bl ScriptContext2_Disable + bl EnableBothScriptContexts pop {r0} bx r0 thumb_func_end sub_80DA874 @@ -6406,7 +6406,7 @@ sub_80DAED4: @ 80DAED4 adds r5, r0, 0 lsls r4, r1, 24 lsrs r4, 24 - ldr r0, =gUnknown_02022E2C + ldr r0, =gDisplayedStringBattle ldr r1, =gUnknown_085ED1AB bl StringCopy adds r1, r0, 0 @@ -6458,7 +6458,7 @@ sub_80DAF1C: @ 80DAF1C add r0, sp, 0x4 adds r1, r4, 0 bl sub_80DAED4 - ldr r4, =gUnknown_02022E2C + ldr r4, =gDisplayedStringBattle movs r0, 0x7 adds r1, r4, 0 movs r2, 0x60 @@ -6514,7 +6514,7 @@ sub_80DAFA0: @ 80DAFA0 ldr r0, =gUnknown_02039F26 adds r4, r0 ldrb r0, [r4] - ldr r1, =gUnknown_02022E2C + ldr r1, =gDisplayedStringBattle movs r2, 0x7 str r2, [sp] movs r2, 0x5 diff --git a/asm/contest_link_80F57C4.s b/asm/contest_link_80F57C4.s index 851ec8709..19aabe85f 100644 --- a/asm/contest_link_80F57C4.s +++ b/asm/contest_link_80F57C4.s @@ -278,7 +278,7 @@ sub_80F5A74: @ 80F5A74 lsls r1, r5, 6 ldr r0, =gUnknown_02039E00 adds r7, r1, r0 - ldr r6, =gUnknown_02022E2C + ldr r6, =gDisplayedStringBattle ldr r0, =gUnknown_02039F25 ldrb r0, [r0] cmp r5, r0 @@ -291,7 +291,7 @@ _080F5A96: adds r1, r7, 0x2 adds r0, r6, 0 bl StringCopy - ldr r4, =gUnknown_02022E2C + ldr r4, =gDisplayedStringBattle adds r0, r5, 0 adds r1, r4, 0 movs r2, 0 @@ -5196,7 +5196,7 @@ _080F83FE: sub_80F840C: @ 80F840C push {lr} sub sp, 0x4 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =sub_80F83E0 movs r1, 0xA bl CreateTask @@ -5252,7 +5252,7 @@ _080F8476: sub_80F8484: @ 80F8484 push {lr} sub sp, 0x4 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =sub_80F8458 movs r1, 0xA bl CreateTask @@ -5285,7 +5285,7 @@ sub_80F84C4: @ 80F84C4 adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r6, =sub_80FC580 adds r0, r6, 0 movs r1, 0 @@ -5599,8 +5599,8 @@ _080F874C: negs r3, r3 movs r0, 0 bl saved_warp2_set - bl script_env_2_disable - bl script_env_2_enable_and_set_ctx_running + bl ScriptContext2_Disable + bl EnableBothScriptContexts _080F877E: pop {r4-r6} pop {r0} @@ -5639,8 +5639,8 @@ sub_80F87B4: @ 80F87B4 bne _080F87D0 adds r0, r1, 0 bl DestroyTask - bl script_env_2_disable - bl script_env_2_enable_and_set_ctx_running + bl ScriptContext2_Disable + bl EnableBothScriptContexts _080F87D0: pop {r0} bx r0 diff --git a/asm/contest_link_80FC4F4.s b/asm/contest_link_80FC4F4.s index d3984fb0d..0d6116766 100644 --- a/asm/contest_link_80FC4F4.s +++ b/asm/contest_link_80FC4F4.s @@ -138,7 +138,7 @@ sub_80FC5DC: @ 80FC5DC ldrb r0, [r0] cmp r0, 0 beq _080FC650 - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r1, =gUnknown_02039F25 strb r0, [r1] bl sub_8009FCC @@ -158,7 +158,7 @@ _080FC60C: ldrb r2, [r4] cmp r3, r2 bge _080FC64A - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers ldrb r0, [r1] subs r0, 0x1 adds r6, r4, 0 @@ -276,7 +276,7 @@ _080FC6F8: beq _080FC7C0 b _080FC7DC _080FC6FE: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _080FC738 @@ -318,7 +318,7 @@ _080FC758: ldrb r0, [r0] cmp r5, r0 bge _080FC798 - ldr r6, =gUnknown_020229E8 + ldr r6, =gLinkPlayers _080FC770: lsls r4, r5, 6 ldr r0, =gUnknown_02039E00 @@ -408,7 +408,7 @@ sub_80FC804: @ 80FC804 b _080FC880 .pool _080FC830: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _080FC87A @@ -490,7 +490,7 @@ _080FC8DE: ldr r1, =gUnknown_020228C4 ldrh r0, [r4, 0x1A] strb r0, [r1] - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _080FC904 @@ -1145,7 +1145,7 @@ _080FCE92: ldr r1, =gUnknown_020228C4 movs r0, 0x6E strb r0, [r1] - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _080FCEB8 diff --git a/asm/contest_painting.s b/asm/contest_painting.s index 156e46050..d8dec9f2a 100644 --- a/asm/contest_painting.s +++ b/asm/contest_painting.s @@ -438,7 +438,7 @@ _081301A6: str r1, [sp, 0x8] movs r1, 0x1 adds r2, r4, 0 - bl Print + bl PrintTextOnWindow movs r0, 0x1 bl CopyBgTilemapBufferToVram _081301D4: diff --git a/asm/daycare.s b/asm/daycare.s index 66066c51c..711d63e42 100644 --- a/asm/daycare.s +++ b/asm/daycare.s @@ -29,7 +29,7 @@ pokemon_get_nick_: @ 806FA4C adds r4, r1, 0 movs r1, 0x2 mov r2, sp - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r0, r4, 0 mov r1, sp bl StringCopy10 @@ -50,7 +50,7 @@ _0806FA74: muls r0, r4 adds r0, r6, r0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _0806FA8A adds r0, r5, 0x1 @@ -90,7 +90,7 @@ _0806FAB6: adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _0806FAE4 adds r0, r7, 0x1 @@ -98,7 +98,7 @@ _0806FAB6: lsrs r7, r0, 24 adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r1, r0, 0 cmp r1, 0 bne _0806FAE4 @@ -138,7 +138,7 @@ _0806FB0E: muls r0, r4 adds r0, r5, r0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 bne _0806FB24 lsls r0, r4, 24 @@ -226,15 +226,15 @@ _0806FBBC: movs r2, 0x50 bl memcpy adds r0, r5, 0 - bl pokemon_restore_pp + bl BoxMonRestorePP adds r1, r5, 0 adds r1, 0x88 movs r0, 0 str r0, [r1] adds r0, r6, 0 - bl zero_pokemon_struct + bl ZeroMonData bl party_compaction - bl calc_player_party_count + bl CalculatePlayerPartyCount pop {r4-r6} pop {r0} bx r0 @@ -290,12 +290,12 @@ sub_806FC48: @ 806FC48 adds r4, 0x8C adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _0806FC9E adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r6, r0, 0 cmp r6, 0 bne _0806FC9E @@ -304,7 +304,7 @@ sub_806FC48: @ 806FC48 movs r2, 0x50 bl memcpy adds r0, r4, 0 - bl zero_pokemon_boxed_data + bl ZeroBoxMonData adds r4, 0x50 adds r0, r5, 0 adds r0, 0x50 @@ -335,7 +335,7 @@ sub_806FCA4: @ 806FCA4 ldr r7, =0x0000ffff _0806FCAC: adds r0, r4, 0 - bl sub_806DF74 + bl TryIncrementMonLevel lsls r0, 24 cmp r0, 0 beq _0806FCE8 @@ -347,14 +347,14 @@ _0806FCC4: movs r6, 0 cmp r0, r7 bne _0806FCD4 - ldr r0, =gUnknown_020244E2 + ldr r0, =gMoveToLearn ldrh r1, [r0] adds r0, r4, 0 - bl sub_8069424 + bl DeleteFirstMoveAndGiveMoveToMon _0806FCD4: adds r0, r4, 0 adds r1, r6, 0 - bl sub_8069318 + bl MonTryLearningNewMove lsls r0, 16 lsrs r0, 16 cmp r0, 0 @@ -363,7 +363,7 @@ _0806FCD4: ble _0806FCAC _0806FCE8: adds r0, r4, 0 - bl pokemon_calc_effective_stats + bl CalculateMonStats pop {r4-r7} pop {r0} bx r0 @@ -379,7 +379,7 @@ sub_806FCF8: @ 806FCF8 bl pokemon_get_nick_ adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData lsls r0, 16 lsrs r7, r0, 16 adds r0, r5, 0 @@ -427,13 +427,13 @@ _0806FD46: bl sub_806FF80 _0806FD74: adds r0, r5, 0 - bl zero_pokemon_boxed_data + bl ZeroBoxMonData adds r1, r5, 0 adds r1, 0x88 movs r0, 0 str r0, [r1] bl party_compaction - bl calc_player_party_count + bl CalculatePlayerPartyCount adds r0, r7, 0 add sp, 0x68 pop {r4-r7} @@ -492,15 +492,15 @@ sub_806FDEC: @ 806FDEC bl memcpy adds r0, r4, 0 movs r1, 0x19 - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r0, r5 str r0, [sp, 0x50] add r2, sp, 0x50 mov r0, sp movs r1, 0x19 - bl SetMonData_encrypted + bl SetBoxMonData mov r0, sp - bl sub_80690C0 + bl GetLevelFromBoxMonExp lsls r0, 24 lsrs r0, 24 add sp, 0x54 @@ -513,7 +513,7 @@ sub_806FDEC: @ 806FDEC sub_806FE28: @ 806FE28 push {r4,r5,lr} adds r5, r0, 0 - bl sub_80690C0 + bl GetLevelFromBoxMonExp adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -647,7 +647,7 @@ sub_806FF30: @ 806FF30 ldr r0, [r6] adds r0, r1 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 bne _0806FF60 movs r0, 0 @@ -703,7 +703,7 @@ _0806FF9E: sub_806FFB0: @ 806FFB0 push {r4,lr} adds r4, r0, 0 - bl zero_pokemon_boxed_data + bl ZeroBoxMonData adds r1, r4, 0 adds r1, 0x88 movs r0, 0 @@ -829,7 +829,7 @@ _08070090: movs r0, 0x8C muls r0, r4 adds r0, r6, r0 - bl pokemon_roll_gender + bl GetBoxMonGender lsls r0, 24 lsrs r0, 24 cmp r0, 0xFE @@ -846,7 +846,7 @@ _080700AE: muls r0, r4 adds r0, r6, r0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData lsls r1, r4, 2 add r1, sp str r0, [r1] @@ -872,7 +872,7 @@ _080700E2: muls r0, r7 adds r0, r6, r0 movs r1, 0xC - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0xC3 bne _080700FE bl Random @@ -931,7 +931,7 @@ _08070160: adds r0, r5, r0 movs r1, 0 movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData bl GetNatureFromPersonality lsls r0, 24 lsrs r7, r0, 24 @@ -1145,7 +1145,7 @@ _08070304: muls r0, r1 add r0, r8 movs r1, 0x27 - bl pokemon_getattr_encrypted + bl GetBoxMonData add r2, sp, 0x10 strb r0, [r2] mov r0, r9 @@ -1160,7 +1160,7 @@ _08070322: muls r0, r1 add r0, r8 movs r1, 0x28 - bl pokemon_getattr_encrypted + bl GetBoxMonData strb r0, [r4] mov r0, r9 movs r1, 0x28 @@ -1173,7 +1173,7 @@ _0807033C: muls r0, r1 add r0, r8 movs r1, 0x29 - bl pokemon_getattr_encrypted + bl GetBoxMonData strb r0, [r4] mov r0, r9 movs r1, 0x29 @@ -1186,7 +1186,7 @@ _08070356: muls r0, r1 add r0, r8 movs r1, 0x2A - bl pokemon_getattr_encrypted + bl GetBoxMonData strb r0, [r4] mov r0, r9 movs r1, 0x2A @@ -1199,7 +1199,7 @@ _08070370: muls r0, r1 add r0, r8 movs r1, 0x2B - bl pokemon_getattr_encrypted + bl GetBoxMonData strb r0, [r4] mov r0, r9 movs r1, 0x2B @@ -1215,7 +1215,7 @@ _08070390: muls r0, r1 add r0, r8 movs r1, 0x2C - bl pokemon_getattr_encrypted + bl GetBoxMonData strb r0, [r4] mov r0, r9 movs r1, 0x2C @@ -1380,7 +1380,7 @@ _080704C4: lsls r0, 16 lsrs r0, 16 ldr r1, =gUnknown_020249C4 - bl sub_806E204 + bl GetLevelUpMovesBySpecies lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x4] @@ -1392,14 +1392,14 @@ _080704F2: adds r5, 0xD mov r0, r10 adds r1, r5, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData lsls r4, r6, 1 mov r2, r8 adds r1, r4, r2 strh r0, [r1] mov r0, r9 adds r1, r5, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData ldr r1, =gUnknown_02024A4C adds r4, r1 strh r0, [r4] @@ -1439,7 +1439,7 @@ _08070546: adds r1, r0, 0 adds r0, r7, 0 str r2, [sp, 0x8] - bl pokemon_moveset_pad_ + bl GiveMoveToMon lsls r0, 16 lsrs r0, 16 ldr r2, [sp, 0x8] @@ -1447,7 +1447,7 @@ _08070546: bne _08070596 ldrh r1, [r4] adds r0, r7, 0 - bl sub_8069424 + bl DeleteFirstMoveAndGiveMoveToMon b _08070596 .pool _0807058C: @@ -1495,19 +1495,19 @@ _080705C2: lsls r1, r5, 24 lsrs r1, 24 adds r0, r7, 0 - bl sub_806E00C + bl CanMonLearnTMHM cmp r0, 0 beq _080705FE ldrh r1, [r4] adds r0, r7, 0 - bl pokemon_moveset_pad_ + bl GiveMoveToMon lsls r0, 16 lsrs r0, 16 cmp r0, r6 bne _080705FE ldrh r1, [r4] adds r0, r7, 0 - bl sub_8069424 + bl DeleteFirstMoveAndGiveMoveToMon _080705FE: adds r0, r5, 0x1 lsls r0, 16 @@ -1601,7 +1601,7 @@ _0807068A: adds r1, r0, 0 adds r0, r7, 0 str r2, [sp, 0x8] - bl pokemon_moveset_pad_ + bl GiveMoveToMon lsls r0, 16 lsrs r0, 16 ldr r2, [sp, 0x8] @@ -1609,7 +1609,7 @@ _0807068A: bne _080706E4 ldrh r1, [r4] adds r0, r7, 0 - bl sub_8069424 + bl DeleteFirstMoveAndGiveMoveToMon b _080706E4 .pool _080706D8: @@ -1689,13 +1689,13 @@ incense_effects: @ 8070744 _0807075C: adds r0, r5, 0 movs r1, 0xC - bl pokemon_getattr_encrypted + bl GetBoxMonData lsls r0, 16 lsrs r6, r0, 16 adds r0, r5, 0 adds r0, 0x8C movs r1, 0xC - bl pokemon_getattr_encrypted + bl GetBoxMonData lsls r0, 16 lsrs r2, r0, 16 ldrh r0, [r4] @@ -1732,12 +1732,12 @@ sub_80707A4: @ 80707A4 adds r4, r1, 0 adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r5, r0, 0 adds r4, 0x8C adds r0, r4, 0 movs r1, 0xC - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r5, 0xCA beq _080707C6 cmp r0, 0xCA @@ -1747,14 +1747,14 @@ _080707C6: lsls r4, 1 adds r0, r6, 0 adds r1, r4, 0 - bl pokemon_moveset_pad_ + bl GiveMoveToMon lsls r0, 16 ldr r1, =0xffff0000 cmp r0, r1 bne _080707E2 adds r0, r6, 0 adds r1, r4, 0 - bl sub_8069424 + bl DeleteFirstMoveAndGiveMoveToMon _080707E2: pop {r4-r6} pop {r0} @@ -1779,7 +1779,7 @@ _080707FE: adds r5, r7, r0 adds r0, r5, 0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData lsls r1, r4, 1 add r1, sp strh r0, [r1] @@ -1795,7 +1795,7 @@ _080707FE: b _0807083E _08070826: adds r0, r5, 0 - bl pokemon_roll_gender + bl GetBoxMonGender lsls r0, 24 lsrs r0, 24 cmp r0, 0xFE @@ -1856,7 +1856,7 @@ _0807088C: movs r0, 0x8C muls r0, r1 adds r0, r7, r0 - bl pokemon_roll_gender + bl GetBoxMonGender lsls r0, 24 lsrs r0, 24 cmp r0, 0xFE @@ -1928,7 +1928,7 @@ _08070918: movs r2, 0x64 bl memcpy bl party_compaction - bl calc_player_party_count + bl CalculatePlayerPartyCount adds r0, r6, 0 bl sub_8070710 add sp, 0x6C @@ -1960,7 +1960,7 @@ sub_8070954: @ 8070954 adds r1, r5, 0 movs r2, 0x5 movs r3, 0x20 - bl create_pokemon_set_level + bl CreateMon movs r0, 0x12 add r0, sp mov r8, r0 @@ -2050,7 +2050,7 @@ sub_8070A0C: @ 8070A0C adds r1, r5, 0 movs r2, 0x5 movs r3, 0x20 - bl create_pokemon_set_level + bl CreateMon movs r0, 0x12 add r0, sp mov r9, r0 @@ -2122,7 +2122,7 @@ _08070ACE: muls r4, r0 adds r0, r6, r4 movs r1, 0x5 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _08070AEE adds r1, r6, 0 @@ -2275,7 +2275,7 @@ sub_8070C04: @ 8070C04 sub sp, 0xC adds r4, r0, 0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _08070C2E ldr r1, =gStringVar1 @@ -2284,7 +2284,7 @@ sub_8070C04: @ 8070C04 adds r0, r4, 0 movs r1, 0x7 mov r2, sp - bl pokemon_getattr_encrypted + bl GetBoxMonData ldr r0, =gStringVar3 mov r1, sp bl StringCopy @@ -2292,7 +2292,7 @@ _08070C2E: adds r4, 0x8C adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _08070C44 ldr r1, =gStringVar2 @@ -2324,7 +2324,7 @@ sub_8070C58: @ 8070C58 muls r0, r5 adds r0, r4 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData lsls r0, 16 lsrs r0, 16 pop {r4,r5} @@ -2468,20 +2468,20 @@ _08070D7E: adds r4, r0, r4 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData strh r0, [r5] adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr_encrypted + bl GetBoxMonData ldr r1, [sp, 0x2C] stm r1!, {r0} str r1, [sp, 0x2C] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r1, r0, 0 ldrh r0, [r5] - bl pokemon_species_get_gender_info + bl GetGenderFromSpeciesAndPersonality lsls r0, 24 lsrs r0, 24 ldr r2, [sp, 0x28] @@ -2751,7 +2751,7 @@ sub_8070F98: @ 8070F98 push {r4,lr} adds r4, r0, 0 adds r0, r1, 0 - bl pokemon_roll_gender + bl GetBoxMonGender adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -3100,7 +3100,7 @@ _0807124E: bl RemoveWindow adds r0, r5, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts b _080712B4 .pool _08071284: @@ -3122,7 +3122,7 @@ _08071284: bl RemoveWindow adds r0, r5, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _080712B4: pop {r4,r5} pop {r0} diff --git a/asm/decoration.s b/asm/decoration.s index 26449f85d..f56567375 100644 --- a/asm/decoration.s +++ b/asm/decoration.s @@ -13,7 +13,7 @@ sub_8126968: @ 8126968 cmp r0, 0x7 bhi _0812697E ldr r2, =gUnknown_0203A14C - ldr r1, =gUnknown_0203BC40 + ldr r1, =gDecorationInventories lsls r0, 3 adds r0, r1 ldr r0, [r0] @@ -161,7 +161,7 @@ sub_8126ABC: @ 8126ABC ldr r1, =gUnknown_0203A150 movs r0, 0 strb r0, [r1] - bl script_env_2_enable + bl ScriptContext2_Enable bl sub_8126A88 bl sub_8126C08 pop {r0} @@ -461,7 +461,7 @@ sub_8126D6C: @ 8126D6C cmp r0, 0 bne _08126D98 ldr r0, =gUnknown_0823B4E8 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript adds r0, r4, 0 bl DestroyTask b _08126D9E @@ -669,7 +669,7 @@ _08126F2C: adds r0, r5, 0 movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow movs r0, 0 bl schedule_bg_copy_tilemap_to_vram add sp, 0xC @@ -742,7 +742,7 @@ _08126FA2: movs r1, 0x1 adds r2, r4, 0 adds r3, r7, 0 - bl Print + bl PrintTextOnWindow mov r0, r8 bl sub_8161AD0 adds r1, r0, 0 @@ -756,7 +756,7 @@ _08126FA2: movs r0, 0xBA strb r0, [r6] adds r6, 0x1 - ldr r1, =gUnknown_0203BC40 + ldr r1, =gDecorationInventories mov r2, r8 lsls r0, r2, 3 adds r0, r1 @@ -780,7 +780,7 @@ _08126FA2: movs r1, 0x1 adds r2, r4, 0 adds r3, r7, 0 - bl Print + bl PrintTextOnWindow add sp, 0x18 pop {r3-r5} mov r8, r3 @@ -883,7 +883,7 @@ sub_81270E8: @ 81270E8 ldrb r0, [r4] bl sub_8161A38 ldr r2, =gUnknown_0203A14C - ldr r1, =gUnknown_0203BC40 + ldr r1, =gDecorationInventories ldrb r0, [r4] lsls r0, 3 adds r0, r1 @@ -1614,7 +1614,7 @@ sub_8127744: @ 8127744 b _08127782 .pool _08127770: - ldr r1, =gUnknown_085A5C08 + ldr r1, =gDecorations ldr r0, =gUnknown_0203A14C ldr r0, [r0] adds r0, r4 @@ -1632,7 +1632,7 @@ _08127782: adds r0, r5, 0 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r4,r5} pop {r0} @@ -1740,7 +1740,7 @@ _08127842: mov r3, r8 ldrb r0, [r3] lsls r0, 3 - ldr r1, =gUnknown_0203BC40 + ldr r1, =gDecorationInventories adds r0, r1 ldrb r0, [r0, 0x4] cmp r2, r0 @@ -1807,7 +1807,7 @@ _081278E2: bls _08127842 movs r5, 0 movs r6, 0 - ldr r3, =gUnknown_0203BC40 + ldr r3, =gDecorationInventories mov r8, r3 _081278F4: ldr r0, =gSaveBlock1Ptr @@ -2193,7 +2193,7 @@ _08127BF0: ldr r0, =gUnknown_085A5C24 adds r0, r4, r0 str r0, [sp, 0x1C] - ldr r0, =gUnknown_085A5C08 + ldr r0, =gDecorations adds r0, r4, r0 str r0, [sp, 0x24] ldr r3, [sp, 0x8] @@ -2267,7 +2267,7 @@ _08127C8E: movs r6, 0 _08127C90: ldr r3, [sp, 0x18] - ldr r4, =gUnknown_085A5C08 + ldr r4, =gDecorations adds r0, r3, r4 ldrb r0, [r0] ldr r4, [sp, 0x20] @@ -2360,7 +2360,7 @@ sub_8127D38: @ 8127D38 lsrs r4, r1, 16 lsls r2, 16 lsrs r2, 16 - ldr r1, =gUnknown_085A5C08 + ldr r1, =gDecorations lsls r0, r2, 5 adds r0, r1 ldrb r0, [r0, 0x12] @@ -2954,7 +2954,7 @@ sub_812826C: @ 812826C push {lr} lsls r0, 24 lsrs r3, r0, 24 - ldr r2, =gUnknown_085A5C08 + ldr r2, =gDecorations ldr r0, =gUnknown_0203A172 ldrb r1, [r0] ldr r0, =gUnknown_0203A14C @@ -3826,7 +3826,7 @@ sub_8128950: @ 8128950 adds r0, r1 ldrb r1, [r0] lsls r1, 5 - ldr r0, =gUnknown_085A5C08 + ldr r0, =gDecorations adds r1, r0 adds r0, r5, 0 bl sub_812853C @@ -3888,7 +3888,7 @@ sub_81289F0: @ 81289F0 bl sub_8197434 adds r0, r4, 0 bl sub_8128AAC - ldr r2, =gUnknown_085A5C08 + ldr r2, =gDecorations ldr r0, =gUnknown_0203A172 ldrb r1, [r0] ldr r0, =gUnknown_0203A14C @@ -3926,7 +3926,7 @@ _08128A44: subs r0, 0x7 strh r0, [r2] ldr r0, =gUnknown_08275D1F - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript _08128A64: ldr r2, =gSprites ldr r0, =gUnknown_0203AA38 @@ -4132,7 +4132,7 @@ c1_overworld_prev_quest: @ 8128BEC b _08128C4C .pool _08128C10: - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 @@ -4194,11 +4194,11 @@ _08128C96: b _08128CAC _08128C9C: ldr r0, =gUnknown_08275D0C - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _08128CAC .pool _08128CA8: - bl script_env_2_enable + bl ScriptContext2_Enable _08128CAC: ldrh r0, [r4, 0x4] adds r0, 0x1 @@ -4225,7 +4225,7 @@ _08128CCA: thumb_func_start sub_8128CD4 sub_8128CD4: @ 8128CD4 push {r4,lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl pal_fill_black ldr r0, =sub_8128C64 movs r1, 0x8 @@ -5071,7 +5071,7 @@ gpu_pal_decompress_alloc_tag_and_upload: @ 8129334 lsrs r4, 24 bl sub_8129048 lsls r4, 5 - ldr r0, =gUnknown_085A5C08 + ldr r0, =gDecorations adds r4, r0 str r4, [r5] ldrb r0, [r4, 0x11] @@ -5253,7 +5253,7 @@ AddDecorationIconObjectFromFieldObject: @ 81294C0 adds r0, r6, 0 bl sub_8129048 lsls r4, 5 - ldr r0, =gUnknown_085A5C08 + ldr r0, =gDecorations adds r4, r0 str r4, [r6] ldrb r0, [r4, 0x11] @@ -5539,7 +5539,7 @@ _08129738: b _08129796 .pool _08129744: - ldr r3, =gUnknown_085A5C08 + ldr r3, =gDecorations ldr r2, =gUnknown_0203A17C ldr r1, =gUnknown_0203AA44 ldrh r0, [r4] @@ -5646,7 +5646,7 @@ _08129808: adds r0, r1 ldrb r0, [r0] lsls r0, 5 - ldr r7, =gUnknown_085A5C08 + ldr r7, =gDecorations adds r0, r7 ldrb r2, [r0, 0x11] ldr r7, =gUnknown_0203A17C @@ -5787,7 +5787,7 @@ _08129928: bne _08129994 bl DrawWholeMapView ldr r0, =gUnknown_08275D2E - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript movs r0, 0 movs r1, 0x1 bl sub_8197434 @@ -5796,7 +5796,7 @@ _08129928: b _08129994 .pool _08129954: - bl script_env_2_enable + bl ScriptContext2_Enable adds r0, r5, 0 bl sub_8127814 bl pal_fill_black @@ -6271,7 +6271,7 @@ sub_8129D8C: @ 8129D8C push {lr} adds r2, r1, 0 lsls r0, 24 - ldr r1, =gUnknown_085A5C08 + ldr r1, =gDecorations lsrs r0, 19 adds r0, r1 ldrb r1, [r0, 0x12] @@ -6568,7 +6568,7 @@ _08129FD2: ldrb r0, [r1] cmp r0, 0 beq _0812A024 - ldr r0, =gUnknown_085A5C08 + ldr r0, =gDecorations ldrb r2, [r1] lsls r1, r2, 5 adds r1, r0 @@ -6651,7 +6651,7 @@ _0812A072: ands r2, r0 cmp r1, 0 beq _0812A0BA - ldr r0, =gUnknown_085A5C08 + ldr r0, =gDecorations lsls r1, 5 adds r1, r0 ldrb r0, [r1, 0x11] @@ -6952,11 +6952,11 @@ _0812A2F6: b _0812A30C _0812A2FC: ldr r0, =gUnknown_08275D0C - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _0812A30C .pool _0812A308: - bl script_env_2_enable + bl ScriptContext2_Enable _0812A30C: ldrh r0, [r4, 0x4] adds r0, 0x1 diff --git a/asm/decoration_inventory.s b/asm/decoration_inventory.s new file mode 100644 index 000000000..52d490c20 --- /dev/null +++ b/asm/decoration_inventory.s @@ -0,0 +1,459 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + + thumb_func_start SetDecorationInventoriesPointers +SetDecorationInventoriesPointers: @ 81617F4 + push {r4,lr} + ldr r0, =gDecorationInventories + mov r12, r0 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r2, =0x00002734 + adds r0, r1, r2 + mov r4, r12 + str r0, [r4] + movs r3, 0xA + strb r3, [r4, 0x4] + adds r2, 0xA + adds r0, r1, r2 + str r0, [r4, 0x8] + strb r3, [r4, 0xC] + ldr r4, =0x00002748 + adds r0, r1, r4 + mov r2, r12 + str r0, [r2, 0x10] + strb r3, [r2, 0x14] + adds r4, 0xA + adds r0, r1, r4 + str r0, [r2, 0x18] + movs r2, 0x1E + mov r0, r12 + strb r2, [r0, 0x1C] + adds r4, 0x1E + adds r0, r1, r4 + mov r4, r12 + str r0, [r4, 0x20] + mov r0, r12 + adds r0, 0x24 + strb r2, [r0] + ldr r2, =0x0000278e + adds r0, r1, r2 + str r0, [r4, 0x28] + mov r0, r12 + adds r0, 0x2C + strb r3, [r0] + ldr r4, =0x00002798 + adds r0, r1, r4 + mov r2, r12 + str r0, [r2, 0x30] + adds r2, 0x34 + movs r0, 0x28 + strb r0, [r2] + adds r4, 0x28 + adds r1, r4 + mov r0, r12 + str r1, [r0, 0x38] + adds r0, 0x3C + strb r3, [r0] + bl sub_8126968 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end SetDecorationInventoriesPointers + + thumb_func_start ClearDecorationInventory +ClearDecorationInventory: @ 8161880 + push {r4,r5,lr} + lsls r0, 24 + movs r3, 0 + ldr r1, =gDecorationInventories + lsrs r2, r0, 21 + adds r0, r2, r1 + ldrb r0, [r0, 0x4] + cmp r3, r0 + bcs _081618AA + adds r5, r1, 0 + movs r4, 0 +_08161896: + adds r0, r2, r5 + ldr r1, [r0] + adds r1, r3 + strb r4, [r1] + adds r1, r3, 0x1 + lsls r1, 24 + lsrs r3, r1, 24 + ldrb r0, [r0, 0x4] + cmp r3, r0 + bcc _08161896 +_081618AA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ClearDecorationInventory + + thumb_func_start ClearDecorationInventories +ClearDecorationInventories: @ 81618B4 + push {r4,lr} + movs r4, 0 +_081618B8: + adds r0, r4, 0 + bl ClearDecorationInventory + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081618B8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end ClearDecorationInventories + + thumb_func_start sub_81618D0 +sub_81618D0: @ 81618D0 + push {r4,lr} + lsls r0, 24 + movs r2, 0 + ldr r1, =gDecorationInventories + lsrs r0, 21 + adds r0, r1 + movs r1, 0x4 + ldrsb r1, [r0, r1] + cmp r2, r1 + bge _0816190C + adds r4, r0, 0 + adds r3, r1, 0 +_081618E8: + lsls r0, r2, 24 + asrs r1, r0, 24 + ldr r0, [r4] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08161900 + adds r0, r1, 0 + b _08161910 + .pool +_08161900: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, r3 + blt _081618E8 +_0816190C: + movs r0, 0x1 + negs r0, r0 +_08161910: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81618D0 + + thumb_func_start sub_8161918 +sub_8161918: @ 8161918 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =gDecorations + lsls r0, r3, 5 + adds r0, r1 + ldrb r0, [r0, 0x13] + movs r2, 0 + ldr r1, =gDecorationInventories + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x4] + cmp r2, r1 + bcs _08161956 + ldr r4, [r0] +_08161936: + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, r3 + bne _0816194C + movs r0, 0x1 + b _08161958 + .pool +_0816194C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r1 + bcc _08161936 +_08161956: + movs r0, 0 +_08161958: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8161918 + + thumb_func_start DecorationAdd +DecorationAdd: @ 8161960 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r4, 0 + beq _081619A0 + ldr r1, =gDecorations + lsls r0, r4, 5 + adds r0, r1 + ldrb r5, [r0, 0x13] + adds r0, r5, 0 + bl sub_81618D0 + lsls r0, 24 + asrs r2, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _081619A0 + ldr r0, =gDecorationInventories + lsls r1, r5, 3 + adds r1, r0 + ldr r0, [r1] + adds r0, r2 + strb r4, [r0] + movs r0, 0x1 + b _081619A2 + .pool +_081619A0: + movs r0, 0 +_081619A2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end DecorationAdd + + thumb_func_start DecorationCheckSpace +DecorationCheckSpace: @ 81619A8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081619D4 + ldr r1, =gDecorations + lsls r0, 5 + adds r0, r1 + ldrb r0, [r0, 0x13] + bl sub_81618D0 + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _081619D4 + movs r0, 0x1 + b _081619D6 + .pool +_081619D4: + movs r0, 0 +_081619D6: + pop {r1} + bx r1 + thumb_func_end DecorationCheckSpace + + thumb_func_start DecorationRemove +DecorationRemove: @ 81619DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + cmp r5, 0 + bne _081619F8 + b _08161A26 +_081619EA: + movs r0, 0 + strb r0, [r1] + adds r0, r6, 0 + bl sub_8161A38 + movs r0, 0x1 + b _08161A28 +_081619F8: + ldr r2, =gDecorationInventories + ldr r1, =gDecorations + lsls r0, r5, 5 + adds r0, r1 + ldrb r4, [r0, 0x13] + lsls r0, r4, 3 + adds r0, r2 + ldrb r1, [r0, 0x4] + cmp r3, r1 + bcs _08161A26 + adds r6, r4, 0 + adds r4, r0, 0 + adds r2, r1, 0 +_08161A12: + ldr r0, [r4] + adds r1, r0, r3 + ldrb r0, [r1] + cmp r0, r5 + beq _081619EA + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r2 + bcc _08161A12 +_08161A26: + movs r0, 0 +_08161A28: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end DecorationRemove + + thumb_func_start sub_8161A38 +sub_8161A38: @ 8161A38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + movs r6, 0 + ldr r2, =gDecorationInventories + lsrs r0, 21 + adds r1, r0, r2 + ldrb r3, [r1, 0x4] + cmp r6, r3 + bcs _08161ABC + adds r7, r0, 0 + mov r10, r1 + mov r0, r10 + str r0, [sp] +_08161A5C: + adds r1, r6, 0x1 + lsls r0, r1, 24 + lsrs r3, r0, 24 + adds r2, r7, 0 + mov r12, r1 + mov r1, r10 + ldrb r1, [r1, 0x4] + cmp r3, r1 + bcs _08161AAE + ldr r0, =gDecorationInventories + mov r9, r0 + adds r1, r0, 0 + mov r8, r1 +_08161A76: + mov r0, r9 + adds r5, r2, r0 + ldr r1, [r5] + adds r0, r1, r3 + ldrb r4, [r0] + adds r2, r4, 0 + cmp r2, 0 + beq _08161A9C + adds r0, r1, r6 + ldrb r1, [r0] + cmp r1, 0 + beq _08161A92 + cmp r1, r2 + bls _08161A9C +_08161A92: + ldrb r1, [r0] + strb r4, [r0] + ldr r0, [r5] + adds r0, r3 + strb r1, [r0] +_08161A9C: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r2, r7, 0 + mov r1, r8 + adds r0, r2, r1 + ldrb r0, [r0, 0x4] + cmp r3, r0 + bcc _08161A76 +_08161AAE: + mov r3, r12 + lsls r0, r3, 24 + lsrs r6, r0, 24 + ldr r0, [sp] + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcc _08161A5C +_08161ABC: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161A38 + + thumb_func_start sub_8161AD0 +sub_8161AD0: @ 8161AD0 + push {r4,r5,lr} + lsls r0, 24 + movs r4, 0 + movs r3, 0 + ldr r2, =gDecorationInventories + lsrs r1, r0, 21 + adds r0, r1, r2 + ldrb r0, [r0, 0x4] + cmp r4, r0 + bcs _08161B04 + adds r5, r2, 0 +_08161AE6: + adds r2, r1, r5 + ldr r0, [r2] + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _08161AF8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_08161AF8: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r2, [r2, 0x4] + cmp r3, r2 + bcc _08161AE6 +_08161B04: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8161AD0 + + thumb_func_start sub_8161B10 +sub_8161B10: @ 8161B10 + push {r4,r5,lr} + movs r5, 0 + movs r4, 0 +_08161B16: + adds r0, r4, 0 + bl sub_8161AD0 + adds r0, r5, r0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _08161B16 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8161B10 + + .align 2, 0 @ Don't pad with nop. + \ No newline at end of file diff --git a/asm/easy_chat.s b/asm/easy_chat.s index 7d5e0df40..d123b23f2 100644 --- a/asm/easy_chat.s +++ b/asm/easy_chat.s @@ -5910,7 +5910,7 @@ sub_811D028: @ 811D028 str r4, [sp] str r5, [sp, 0x4] str r6, [sp, 0x8] - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r4-r6} pop {r0} diff --git a/asm/egg_hatch.s b/asm/egg_hatch.s index d1d26b62a..52a659663 100644 --- a/asm/egg_hatch.s +++ b/asm/egg_hatch.s @@ -104,7 +104,7 @@ _080713AE: ldr r1, [sp, 0x3C] movs r2, 0x5 movs r3, 0x20 - bl create_pokemon_set_level + bl CreateMon movs r4, 0 _0807141E: adds r1, r4, 0 @@ -246,9 +246,9 @@ sub_80714B8: @ 80714B8 movs r1, 0x23 bl SetMonData adds r0, r5, 0 - bl sub_806E924 + bl MonRestorePP adds r0, r5, 0 - bl pokemon_calc_effective_stats + bl CalculateMonStats add sp, 0x14 pop {r4,r5} pop {r0} @@ -468,7 +468,7 @@ sub_807172C: @ 807172C thumb_func_start sub_8071740 sub_8071740: @ 8071740 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =sub_8071760 movs r1, 0xA bl CreateTask @@ -1104,7 +1104,7 @@ _08071D3C: ldrb r0, [r0, 0x4] muls r0, r6 adds r0, r5 - bl pokemon_get_gender + bl GetMonGender adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -1735,7 +1735,7 @@ sub_8072214: @ 8072214 thumb_func_start sub_807228C sub_807228C: @ 807228C push {r4-r6,lr} - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 lsrs r6, r0, 24 movs r5, 0 diff --git a/asm/evolution_scene.s b/asm/evolution_scene.s index 45ca5f0aa..01b495c09 100644 --- a/asm/evolution_scene.s +++ b/asm/evolution_scene.s @@ -1044,7 +1044,7 @@ _0813E416: mov r9, r0 ldr r1, [sp, 0x4] movs r2, 0x64 - bl memcpy_pokemon + bl CopyMon ldrb r0, [r6] muls r0, r5 adds r0, r4 @@ -1130,8 +1130,8 @@ _0813E4A0: ldrb r0, [r4] muls r0, r6 adds r0, r5 - bl pokemon_calc_effective_stats - bl calc_player_party_count + bl CalculateMonStats + bl CalculatePlayerPartyCount ldr r0, =gEvolutionTable mov r4, r8 add r4, r10 @@ -1643,7 +1643,7 @@ _0813E99E: movs r1, 0xB bl SetMonData mov r0, r9 - bl pokemon_calc_effective_stats + bl CalculateMonStats ldrh r1, [r4, 0xA] ldrh r2, [r4, 0xC] mov r0, r9 @@ -1679,7 +1679,7 @@ _0813EA2A: adds r4, r0, r1 ldrb r1, [r4, 0x10] mov r0, r9 - bl sub_8069318 + bl MonTryLearningNewMove lsls r0, 16 lsrs r6, r0, 16 cmp r6, 0 @@ -1897,8 +1897,8 @@ _0813EC2A: bl PlayFanfare ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0xC] - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r0, =gTasks @@ -1994,8 +1994,8 @@ _0813ED16: bl sub_804F574 ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x10] - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r0, =gTasks @@ -2023,8 +2023,8 @@ _0813ED56: _0813ED62: ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x14] - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r0, =gTasks @@ -2048,8 +2048,8 @@ _0813ED90: bne _0813EDCE ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x18] - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r0, =gTasks @@ -2237,7 +2237,7 @@ _0813EF3E: lsls r2, 24 lsrs r2, 24 ldr r3, =sub_813DD7C - ldr r4, =gUnknown_020244E2 + ldr r4, =gMoveToLearn ldrh r4, [r4] str r4, [sp] bl sub_81BFA38 @@ -2282,15 +2282,15 @@ _0813EFC8: lsls r0, 16 lsrs r4, r0, 16 adds r0, r4, 0 - bl sub_806E804 + bl IsHMMove2 cmp r0, 0 beq _0813F014 ldr r0, =gUnknown_085CC270 ldr r3, =0x000004cc adds r0, r3 ldr r0, [r0] - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r1, =gTasks @@ -2317,12 +2317,12 @@ _0813F014: lsrs r4, 24 mov r0, r9 adds r1, r4, 0 - bl sub_806B9A8 - ldr r0, =gUnknown_020244E2 + bl RemoveMonPPBonus + ldr r0, =gMoveToLearn ldrh r1, [r0] mov r0, r9 adds r2, r4, 0 - bl sub_80691F4 + bl SetMonMoveSlot ldr r0, =gTasks mov r3, r8 adds r1, r3, r7 @@ -2338,8 +2338,8 @@ _0813F05C: lsls r1, 2 adds r0, r1 ldr r0, [r0] - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r0, =gTasks @@ -2367,8 +2367,8 @@ _0813F09E: _0813F0AA: ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x1C] - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r0, =gTasks @@ -2395,8 +2395,8 @@ _0813F0D8: lsls r1, 2 adds r0, r1 ldr r0, [r0] - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r1, =gTasks @@ -2411,8 +2411,8 @@ _0813F0D8: _0813F120: ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x20] - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r1, =gTasks @@ -2431,8 +2431,8 @@ _0813F120: _0813F154: ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x24] - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle movs r1, 0 bl battle_show_message_maybe ldr r1, =gTasks @@ -2827,7 +2827,7 @@ _0813F4F2: movs r1, 0xB bl SetMonData mov r0, r9 - bl pokemon_calc_effective_stats + bl CalculateMonStats ldrh r1, [r4, 0xA] ldrh r2, [r4, 0xC] mov r0, r9 @@ -2870,7 +2870,7 @@ _0813F58C: adds r5, r0, r1 ldrb r1, [r5, 0x10] mov r0, r9 - bl sub_8069318 + bl MonTryLearningNewMove lsls r0, 16 lsrs r6, r0, 16 mov r8, r4 @@ -3064,8 +3064,8 @@ _0813F762: bl PlayFanfare ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0xC] - bl get_battle_strings_ - ldr r1, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r1, =gDisplayedStringBattle movs r0, 0 movs r2, 0x1 bl sub_807F1A8 @@ -3163,8 +3163,8 @@ _0813F852: bl sub_804F574 ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x10] - bl get_battle_strings_ - ldr r1, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r1, =gDisplayedStringBattle movs r0, 0 movs r2, 0x1 bl sub_807F1A8 @@ -3193,8 +3193,8 @@ _0813F892: _0813F89E: ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x14] - bl get_battle_strings_ - ldr r1, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r1, =gDisplayedStringBattle movs r0, 0 movs r2, 0x1 bl sub_807F1A8 @@ -3219,8 +3219,8 @@ _0813F8CC: bne _0813F90C ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x18] - bl get_battle_strings_ - ldr r1, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r1, =gDisplayedStringBattle movs r0, 0 movs r2, 0x1 bl sub_807F1A8 @@ -3299,8 +3299,8 @@ _0813F98C: lsls r1, 3 adds r0, r1 ldr r0, [r0] - bl get_battle_strings_ - ldr r1, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r1, =gDisplayedStringBattle movs r0, 0 movs r2, 0x1 bl sub_807F1A8 @@ -3336,8 +3336,8 @@ _0813F9E4: lsls r1, 3 adds r0, r1 ldr r0, [r0] - bl get_battle_strings_ - ldr r1, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r1, =gDisplayedStringBattle movs r0, 0 movs r2, 0x1 bl sub_807F1A8 @@ -3388,7 +3388,7 @@ _0813FA3E: lsls r2, 24 lsrs r2, 24 ldr r3, =sub_813DF70 - ldr r4, =gUnknown_020244E2 + ldr r4, =gMoveToLearn ldrh r4, [r4] str r4, [sp] bl sub_81BFA38 @@ -3434,15 +3434,15 @@ _0813FAEC: lsls r0, 16 lsrs r4, r0, 16 adds r0, r4, 0 - bl sub_806E804 + bl IsHMMove2 cmp r0, 0 beq _0813FB3C ldr r0, =gUnknown_085CC270 ldr r1, =0x000004cc adds r0, r1 ldr r0, [r0] - bl get_battle_strings_ - ldr r1, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r1, =gDisplayedStringBattle movs r0, 0 movs r2, 0x1 bl sub_807F1A8 @@ -3470,19 +3470,19 @@ _0813FB3C: lsrs r4, 24 mov r0, r9 adds r1, r4, 0 - bl sub_806B9A8 - ldr r0, =gUnknown_020244E2 + bl RemoveMonPPBonus + ldr r0, =gMoveToLearn ldrh r1, [r0] mov r0, r9 adds r2, r4, 0 - bl sub_80691F4 + bl SetMonMoveSlot ldr r0, =gUnknown_085CC270 movs r1, 0xCF lsls r1, 2 adds r0, r1 ldr r0, [r0] - bl get_battle_strings_ - ldr r1, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r1, =gDisplayedStringBattle movs r0, 0 movs r2, 0x1 bl sub_807F1A8 @@ -3511,8 +3511,8 @@ _0813FBB2: _0813FBBE: ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x1C] - bl get_battle_strings_ - ldr r1, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r1, =gDisplayedStringBattle movs r0, 0 movs r2, 0x1 bl sub_807F1A8 @@ -3540,8 +3540,8 @@ _0813FBEC: lsls r1, 2 adds r0, r1 ldr r0, [r0] - bl get_battle_strings_ - ldr r1, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r1, =gDisplayedStringBattle movs r0, 0 movs r2, 0x1 bl sub_807F1A8 @@ -3557,8 +3557,8 @@ _0813FBEC: _0813FC38: ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x20] - bl get_battle_strings_ - ldr r1, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r1, =gDisplayedStringBattle movs r0, 0 movs r2, 0x1 bl sub_807F1A8 @@ -3578,8 +3578,8 @@ _0813FC38: _0813FC70: ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x24] - bl get_battle_strings_ - ldr r1, =gUnknown_02022E2C + bl StrCpyDecodeToDisplayedStringBattle + ldr r1, =gDisplayedStringBattle movs r0, 0 movs r2, 0x1 bl sub_807F1A8 diff --git a/asm/field_control_avatar.s b/asm/field_control_avatar.s index 4f29f2b3a..c44d77e3f 100644 --- a/asm/field_control_avatar.s +++ b/asm/field_control_avatar.s @@ -456,7 +456,7 @@ _0809C214: bl PlaySE _0809C244: adds r0, r4, 0 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript movs r0, 0x1 _0809C24C: pop {r4} @@ -689,7 +689,7 @@ _0809C442: adds r1, r0, 0 ldr r0, =gScriptLastTalked ldrb r0, [r0] - bl sub_8099188 + bl GetRamScript adds r1, r0, 0 _0809C44E: pop {r4-r7} @@ -1175,7 +1175,7 @@ sub_809C868: @ 809C868 cmp r0, 0x2 bne _0809C894 ldr r0, =gUnknown_08290B0F - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript movs r0, 0x1 b _0809C896 .pool @@ -1204,7 +1204,7 @@ sub_809C89C: @ 809C89C cmp r0, 0x1 bne _0809C8D4 ldr r0, =gUnknown_08290B5A - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript movs r0, 0x1 b _0809C8D6 .pool @@ -1278,7 +1278,7 @@ mapheader_trigger_activate_at__run_now: @ 809C938 bl mapheader_trigger_activate_at cmp r0, 0 beq _0809C964 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript movs r0, 0x1 b _0809C966 .pool @@ -1312,7 +1312,7 @@ _0809C988: beq _0809C9A4 ldr r0, =gUnknown_08252BE8 _0809C996: - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript movs r0, 0x1 b _0809C9EA .pool @@ -1366,7 +1366,7 @@ per_step_scripts: @ 809C9F4 b _0809CB24 _0809CA04: bl sub_80B215C - bl happiness_algorithm_step + bl AdjustFriendship_step bl sub_81D4998 ldr r0, =gPlayerAvatar ldrb r1, [r0] @@ -1386,7 +1386,7 @@ _0809CA04: cmp r0, 0x1 bne _0809CA48 ldr r0, =gUnknown_082736BC - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _0809CB28 .pool _0809CA48: @@ -1397,7 +1397,7 @@ _0809CA48: movs r0, 0xD bl IncrementGameStat ldr r0, =gUnknown_08291FC0 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _0809CB28 .pool _0809CA64: @@ -1407,7 +1407,7 @@ _0809CA64: cmp r0, 0x1 bne _0809CA7C ldr r0, =gUnknown_08273D1F - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _0809CB28 .pool _0809CA7C: @@ -1417,7 +1417,7 @@ _0809CA7C: cmp r0, 0x1 bne _0809CA94 ldr r0, =gUnknown_08238EAF - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _0809CB28 .pool _0809CA94: @@ -1425,7 +1425,7 @@ _0809CA94: cmp r0, 0x1 bne _0809CAA8 ldr r0, =gUnknown_081DF7BA - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _0809CB28 .pool _0809CAA8: @@ -1433,7 +1433,7 @@ _0809CAA8: cmp r0, 0x1 bne _0809CABC ldr r0, =gUnknown_081F49EC - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _0809CB28 .pool _0809CABC: @@ -1441,7 +1441,7 @@ _0809CABC: cmp r0, 0x1 bne _0809CAD0 ldr r0, =gUnknown_081FA4D6 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _0809CB28 .pool _0809CAD0: @@ -1449,7 +1449,7 @@ _0809CAD0: cmp r0, 0x1 bne _0809CAE4 ldr r0, =gUnknown_0821307B - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _0809CB28 .pool _0809CAE4: @@ -1457,11 +1457,11 @@ _0809CAE4: cmp r0, 0x1 bne _0809CAF8 ldr r0, =gUnknown_08224175 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _0809CB28 .pool _0809CAF8: - bl safari_step + bl SafariZoneTakeStep lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1471,7 +1471,7 @@ _0809CAF8: cmp r0, 0x1 bne _0809CB1C ldr r0, =gUnknown_0823C050 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _0809CB28 .pool _0809CB1C: @@ -1500,8 +1500,8 @@ sub_809CB30: @ 809CB30 .pool thumb_func_end sub_809CB30 - thumb_func_start happiness_algorithm_step -happiness_algorithm_step: @ 809CB44 + thumb_func_start AdjustFriendship_step +AdjustFriendship_step: @ 809CB44 push {r4,r5,lr} ldr r0, =0x0000402a bl GetVarPointer @@ -1519,7 +1519,7 @@ happiness_algorithm_step: @ 809CB44 _0809CB62: adds r0, r5, 0 movs r1, 0x5 - bl happiness_algorithm + bl AdjustFriendship adds r5, 0x64 subs r4, 0x1 cmp r4, 0 @@ -1529,7 +1529,7 @@ _0809CB72: pop {r0} bx r0 .pool - thumb_func_end happiness_algorithm_step + thumb_func_end AdjustFriendship_step thumb_func_start overworld_poison_timer_set overworld_poison_timer_set: @ 809CB80 @@ -1765,7 +1765,7 @@ _0809CD50: cmp r0, 0x1 bne _0809CD6C ldr r0, =gUnknown_082A8350 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript movs r0, 0x1 b _0809CD8C .pool diff --git a/asm/field_effect.s b/asm/field_effect.s index 03789eada..6277c127b 100644 --- a/asm/field_effect.s +++ b/asm/field_effect.s @@ -897,7 +897,7 @@ sub_80B6128: @ 80B6128 thumb_func_start sub_80B61A0 sub_80B61A0: @ 80B61A0 push {r4,lr} - bl calc_player_party_count + bl CalculatePlayerPartyCount adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -1071,7 +1071,7 @@ _080B62E6: thumb_func_start sub_80B62F4 sub_80B62F4: @ 80B62F4 push {r4,lr} - bl calc_player_party_count + bl CalculatePlayerPartyCount adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -1960,7 +1960,7 @@ mapldr_080842E8: @ 80B69FC ldr r0, =task00_8084310 movs r1, 0 bl CreateTask - bl script_env_2_enable + bl ScriptContext2_Enable bl player_bitmagic ldr r1, =gUnknown_03005DAC movs r0, 0 @@ -2056,7 +2056,7 @@ mapldr_08084390: @ 80B6AA4 movs r1, 0x3 bl FieldObjectTurn _080B6AE6: - bl script_env_2_enable + bl ScriptContext2_Enable bl player_bitmagic ldr r1, =gUnknown_03005DAC movs r0, 0 @@ -2099,7 +2099,7 @@ _080B6B3E: lsls r0, 24 cmp r0, 0 bne _080B6B58 - bl script_env_2_disable + bl ScriptContext2_Disable bl sub_809757C adds r0, r5, 0 bl DestroyTask @@ -2115,7 +2115,7 @@ sub_80B6B68: @ 80B6B68 push {lr} bl sub_8085784 bl pal_fill_for_maplights - bl script_env_2_enable + bl ScriptContext2_Enable bl player_bitmagic ldr r0, =sub_80B6B94 movs r1, 0 @@ -2457,7 +2457,7 @@ sub_80B6E18: @ 80B6E18 ldr r1, =gPlayerAvatar movs r0, 0 strb r0, [r1, 0x6] - bl script_env_2_disable + bl ScriptContext2_Disable bl CameraObjectReset1 bl sub_809757C bl InstallCameraPanAheadCallback @@ -2782,7 +2782,7 @@ sub_80B70B4: @ 80B70B4 push {lr} bl sub_8085784 bl pal_fill_for_maplights - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =sub_80B70DC movs r1, 0 bl CreateTask @@ -3076,7 +3076,7 @@ sub_80B72F4: @ 80B72F4 cmp r0, 0 beq _080B7338 bl CameraObjectReset1 - bl script_env_2_disable + bl ScriptContext2_Disable movs r0, 0x4 bl GetGoSpeed0AnimId adds r1, r0, 0 @@ -3161,7 +3161,7 @@ _080B7396: sub_80B73D0: @ 80B73D0 push {r4,lr} adds r4, r0, 0 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r1, =gPlayerAvatar movs r0, 0x1 strb r0, [r1, 0x6] @@ -3180,7 +3180,7 @@ waterfall_1_do_anim_probably: @ 80B73F0 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl script_env_2_enable + bl ScriptContext2_Enable adds r0, r5, 0 bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 @@ -3267,7 +3267,7 @@ _080B748E: lsrs r4, r0, 24 cmp r4, 0 bne _080B74C4 - bl script_env_2_disable + bl ScriptContext2_Disable ldr r0, =gPlayerAvatar strb r4, [r0, 0x6] ldr r0, =sub_80B7384 @@ -3362,7 +3362,7 @@ dive_1_lock: @ 80B7544 dive_2_unknown: @ 80B7558 push {r4,lr} adds r4, r0, 0 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r1, =gUnknown_02038C08 movs r2, 0x26 ldrsh r0, [r4, r2] @@ -3749,7 +3749,7 @@ mapldr_080851BC: @ 80B7868 push {lr} bl sub_8085784 bl pal_fill_for_maplights - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =gUnknown_03005DAC movs r1, 0 str r1, [r0] @@ -3918,7 +3918,7 @@ sub_80B79BC: @ 80B79BC ldr r1, =gPlayerAvatar movs r0, 0 strb r0, [r1, 0x6] - bl script_env_2_disable + bl ScriptContext2_Disable bl sub_809757C ldr r0, =sub_80B7890 bl FindTaskIdByFunc @@ -4286,7 +4286,7 @@ _080B7CC4: thumb_func_start sub_80B7CC8 sub_80B7CC8: @ 80B7CC8 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl player_bitmagic ldr r0, =sub_80B7CE4 movs r1, 0x50 @@ -4460,7 +4460,7 @@ mapldr_080859D4: @ 80B7E48 push {lr} bl sub_8085784 bl pal_fill_for_maplights - bl script_env_2_enable + bl ScriptContext2_Enable bl player_bitmagic ldr r1, =gUnknown_03005DAC movs r0, 0 @@ -4582,7 +4582,7 @@ _080B7F32: negs r0, r0 ands r0, r1 strb r0, [r6, 0x1] - bl script_env_2_disable + bl ScriptContext2_Disable bl sub_809757C ldr r0, =sub_80B7E94 bl FindTaskIdByFunc @@ -4671,7 +4671,7 @@ sub_80B7FDC: @ 80B7FDC sub_80B800C: @ 80B800C push {r4,lr} adds r4, r0, 0 - bl script_env_2_enable + bl ScriptContext2_Enable bl player_bitmagic bl CameraObjectReset2 bl player_get_direction_lower_nybble @@ -4905,7 +4905,7 @@ mapldr_08085D88: @ 80B8200 push {lr} bl sub_8085784 bl pal_fill_for_maplights - bl script_env_2_enable + bl ScriptContext2_Enable bl player_bitmagic ldr r1, =gUnknown_03005DAC movs r0, 0 @@ -5192,7 +5192,7 @@ sub_80B8410: @ 80B8410 lsrs r0, 28 cmp r1, r0 bne _080B8484 - bl script_env_2_disable + bl ScriptContext2_Disable bl CameraObjectReset1 bl sub_809757C ldr r0, =sub_80B8250 @@ -6333,7 +6333,7 @@ sub_80B8DB4: @ 80B8DB4 mov r6, r8 push {r6} adds r4, r0, 0 - bl script_env_2_enable + bl ScriptContext2_Enable bl player_bitmagic ldr r5, =gPlayerAvatar movs r0, 0x1 @@ -6528,7 +6528,7 @@ sub_80B8F24: @ 80B8F24 movs r1, 0x1 bl sub_81555AC bl sub_809757C - bl script_env_2_disable + bl ScriptContext2_Disable movs r0, 0x9 bl FieldEffectActiveListRemove ldr r0, =sub_80B8D84 diff --git a/asm/field_player_avatar.s b/asm/field_player_avatar.s index e9fee369a..f21fdacae 100644 --- a/asm/field_player_avatar.s +++ b/asm/field_player_avatar.s @@ -3452,7 +3452,7 @@ _0808C360: sub_808C3A4: @ 808C3A4 push {r4,lr} adds r4, r0, 0 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r1, =gPlayerAvatar movs r0, 0x1 strb r0, [r1, 0x6] @@ -3574,7 +3574,7 @@ sub_808C484: @ 808C484 ldr r1, =gPlayerAvatar movs r0, 0 strb r0, [r1, 0x6] - bl script_env_2_disable + bl ScriptContext2_Disable ldr r0, =taskFF_bump_boulder bl FindTaskIdByFunc lsls r0, 24 @@ -3752,7 +3752,7 @@ sub_808C61C: @ 808C61C ldr r1, =gPlayerAvatar movs r0, 0x1 strb r0, [r1, 0x6] - bl script_env_2_enable + bl ScriptContext2_Enable movs r0, 0x2D bl PlaySE movs r0, 0x1 @@ -3872,7 +3872,7 @@ sub_808C6FC: @ 808C6FC lsrs r1, 24 adds r0, r5, 0 bl FieldObjectSetSpecialAnim - bl script_env_2_disable + bl ScriptContext2_Disable ldr r1, =gPlayerAvatar movs r0, 0 strb r0, [r1, 0x6] @@ -3895,7 +3895,7 @@ sub_808C750: @ 808C750 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl script_env_2_enable + bl ScriptContext2_Enable bl sav1_reset_battle_music_maybe bl sub_8085898 ldr r2, =gPlayerAvatar @@ -4008,7 +4008,7 @@ sub_808C814: @ 808C814 bl FieldObjectSetSpecialAnim movs r0, 0 strb r0, [r6, 0x6] - bl script_env_2_disable + bl ScriptContext2_Disable ldrb r1, [r4, 0x1A] lsls r0, r1, 4 adds r0, r1 @@ -4082,7 +4082,7 @@ _0808C8D2: fish0: @ 808C8F8 push {r4,lr} adds r4, r0, 0 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r1, =gPlayerAvatar movs r0, 0x1 strb r0, [r1, 0x6] @@ -4294,7 +4294,7 @@ _0808CA94: movs r0, 0 movs r1, 0x1 add r2, sp, 0xC - bl Print + bl PrintTextOnWindow ldrh r0, [r4, 0xC] adds r0, 0x1 strh r0, [r4, 0xC] @@ -4405,7 +4405,7 @@ fish6: @ 808CB6C movs r0, 0 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -4636,7 +4636,7 @@ _0808CD58: ldr r1, =gPlayerAvatar movs r0, 0 strb r0, [r1, 0x6] - bl script_env_2_disable + bl ScriptContext2_Disable ldrh r0, [r5, 0x26] lsls r0, 24 lsrs r0, 24 @@ -4857,7 +4857,7 @@ fishF: @ 808CF2C bne _0808CF68 ldr r0, =gPlayerAvatar strb r1, [r0, 0x6] - bl script_env_2_disable + bl ScriptContext2_Disable bl sub_809757C movs r0, 0 movs r1, 0x1 diff --git a/asm/field_poison.s b/asm/field_poison.s index c4008c33e..8948b2762 100644 --- a/asm/field_poison.s +++ b/asm/field_poison.s @@ -73,7 +73,7 @@ sub_80F95C0: @ 80F95C0 str r0, [sp] adds r0, r4, 0 movs r1, 0x7 - bl happiness_algorithm + bl AdjustFriendship adds r0, r4, 0 movs r1, 0x37 mov r2, sp @@ -227,7 +227,7 @@ _080F9714: ldr r0, =gScriptResult strh r1, [r0] _080F9718: - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r6, 0 bl DestroyTask _080F9722: @@ -243,7 +243,7 @@ sub_80F972C: @ 80F972C ldr r0, =sub_80F9654 movs r1, 0x50 bl CreateTask - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop pop {r0} bx r0 .pool diff --git a/asm/field_region_map.s b/asm/field_region_map.s index dc3cd7034..fc0a38de6 100644 --- a/asm/field_region_map.s +++ b/asm/field_region_map.s @@ -172,7 +172,7 @@ _08170300: str r4, [sp, 0x8] movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 bl schedule_bg_copy_tilemap_to_vram movs r0, 0 @@ -303,7 +303,7 @@ sub_8170428: @ 8170428 str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 bl schedule_bg_copy_tilemap_to_vram b _08170470 diff --git a/asm/field_tasks.s b/asm/field_tasks.s index d053f565f..26761b8d1 100644 --- a/asm/field_tasks.s +++ b/asm/field_tasks.s @@ -80,7 +80,7 @@ sub_809D908: @ 809D908 lsls r1, 3 ldr r0, =gTasks + 0x8 adds r4, r1, r0 - bl script_env_2_is_enabled + bl ScriptContext2_IsEnabled lsls r0, 24 cmp r0, 0 bne _0809D930 diff --git a/asm/fldeff_80F9BCC.s b/asm/fldeff_80F9BCC.s index 960c8e244..e332a8841 100644 --- a/asm/fldeff_80F9BCC.s +++ b/asm/fldeff_80F9BCC.s @@ -648,7 +648,7 @@ sub_80FA0DC: @ 80FA0DC lsrs r0, 24 str r0, [r1] ldr r0, =gUnknown_08275A86 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript pop {r0} bx r0 .pool @@ -769,7 +769,7 @@ sub_80FA1D8: @ 80FA1D8 push {lr} movs r1, 0x37 bl FieldEffectStop - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r0} bx r0 thumb_func_end sub_80FA1D8 @@ -783,7 +783,7 @@ sub_80FA1E8: @ 80FA1E8 lsrs r0, 24 str r0, [r1] ldr r0, =gUnknown_08275ADF - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript pop {r0} bx r0 .pool @@ -942,7 +942,7 @@ sub_80FA33C: @ 80FA33C push {lr} movs r1, 0x38 bl FieldEffectStop - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r0} bx r0 thumb_func_end sub_80FA33C @@ -956,7 +956,7 @@ sub_80FA34C: @ 80FA34C lsrs r0, 24 str r0, [r1] ldr r0, =gUnknown_08275B38 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript pop {r0} bx r0 .pool @@ -1077,7 +1077,7 @@ sub_80FA448: @ 80FA448 push {lr} movs r1, 0x39 bl FieldEffectStop - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r0} bx r0 thumb_func_end sub_80FA448 @@ -1195,7 +1195,7 @@ _080FA540: bl CurrentMapDrawMetatileAt movs r0, 0x3D bl FieldEffectActiveListRemove - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r5, 0 bl DestroyTask b _080FA574 @@ -1801,7 +1801,7 @@ _080FAA5E: sub_80FAA7C: @ 80FAA7C push {r4,lr} sub sp, 0x4 - bl script_env_2_enable + bl ScriptContext2_Enable mov r4, sp adds r4, 0x2 mov r0, sp @@ -2012,7 +2012,7 @@ sub_80FAC68: @ 80FAC68 push {lr} movs r1, 0x34 bl FieldEffectStop - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r0} bx r0 thumb_func_end sub_80FAC68 @@ -2414,7 +2414,7 @@ sub_80FAFD4: @ 80FAFD4 bl SetPlayerAvatarTransitionFlags adds r0, r4, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r4} pop {r0} bx r0 diff --git a/asm/fldeff_strength.s b/asm/fldeff_strength.s index e96a9c066..3dc64467e 100644 --- a/asm/fldeff_strength.s +++ b/asm/fldeff_strength.s @@ -45,7 +45,7 @@ sub_8145E0C: @ 8145E0C lsrs r0, 24 str r0, [r1] ldr r0, =gUnknown_082908FD - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript pop {r0} bx r0 .pool @@ -85,7 +85,7 @@ sub_8145E74: @ 8145E74 push {lr} movs r0, 0x28 bl FieldEffectActiveListRemove - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r0} bx r0 thumb_func_end sub_8145E74 diff --git a/asm/fldeff_sweetscent.s b/asm/fldeff_sweetscent.s new file mode 100644 index 000000000..a297dd41d --- /dev/null +++ b/asm/fldeff_sweetscent.s @@ -0,0 +1,220 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start SetUpFieldMove_SweetScent +SetUpFieldMove_SweetScent: @ 8159EF0 + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =hm2_sweet_scent + str r0, [r1] + movs r0, 0x1 + bx lr + .pool + thumb_func_end SetUpFieldMove_SweetScent + + thumb_func_start hm2_sweet_scent +hm2_sweet_scent: @ 8159F10 + push {lr} + movs r0, 0x33 + bl FieldEffectStart + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end hm2_sweet_scent + + thumb_func_start FldEff_SweetScent +FldEff_SweetScent: @ 8159F2C + push {lr} + bl sub_80AC3D0 + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_8159F5C + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end FldEff_SweetScent + + thumb_func_start sub_8159F5C +sub_8159F5C: @ 8159F5C + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0xEC + bl PlaySE + ldr r5, =gPlttBufferUnfaded + ldr r1, =gPaletteDecompressionBuffer + movs r4, 0x80 + lsls r4, 1 + adds r0, r5, 0 + adds r2, r4, 0 + bl CpuFastSet + ldr r0, =gPlttBufferFaded + adds r1, r5, 0 + adds r2, r4, 0 + bl CpuFastSet + bl GetPlayerAvatarObjectId + ldr r2, =gSprites + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + mvns r0, r0 + movs r1, 0x1F + str r1, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x8 + bl BeginNormalPaletteFade + ldr r0, =sub_8159FEC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + movs r0, 0x33 + bl FieldEffectActiveListRemove + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159F5C + + thumb_func_start sub_8159FEC +sub_8159FEC: @ 8159FEC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _0815A088 + bl sub_81BE72C + movs r0, 0x40 + movs r1, 0x8 + movs r2, 0x1F + bl BlendPalettes + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r4, r1, r0 + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0x40 + bne _0815A084 + strh r6, [r4, 0x8] + bl SweetScentWildEncounter + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815A044 + adds r0, r5, 0 + bl DestroyTask + b _0815A088 + .pool +_0815A044: + ldr r0, =sub_815A090 + str r0, [r4] + bl GetPlayerAvatarObjectId + ldr r2, =gSprites + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + mvns r0, r0 + movs r1, 0x1F + str r1, [sp] + movs r1, 0x4 + movs r2, 0x8 + movs r3, 0 + bl BeginNormalPaletteFade + bl sub_81BE6B8 + b _0815A088 + .pool +_0815A084: + adds r0, r1, 0x1 + strh r0, [r4, 0x8] +_0815A088: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8159FEC + + thumb_func_start sub_815A090 +sub_815A090: @ 815A090 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0815A0BE + ldr r0, =gPaletteDecompressionBuffer + ldr r1, =gPlttBufferUnfaded + movs r2, 0x80 + lsls r2, 1 + bl CpuFastSet + bl sub_80AC3E4 + ldr r0, =gUnknown_08290CAE + bl ScriptContext1_SetupScript + adds r0, r4, 0 + bl DestroyTask +_0815A0BE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A090 + + .align 2, 0 @ Don't pad with nop. + \ No newline at end of file diff --git a/asm/fldeff_teleport.s b/asm/fldeff_teleport.s index 0e14cd418..f3dc3ec9b 100644 --- a/asm/fldeff_teleport.s +++ b/asm/fldeff_teleport.s @@ -48,8 +48,8 @@ hm_teleport_run_dp02scr: @ 817C8FC .pool thumb_func_end hm_teleport_run_dp02scr - thumb_func_start sub_817C91C -sub_817C91C: @ 817C91C + thumb_func_start FldEff_UseTeleport +FldEff_UseTeleport: @ 817C91C push {lr} bl oei_task_add lsls r0, 24 @@ -69,7 +69,7 @@ sub_817C91C: @ 817C91C pop {r1} bx r1 .pool - thumb_func_end sub_817C91C + thumb_func_end FldEff_UseTeleport thumb_func_start sub_817C94C sub_817C94C: @ 817C94C diff --git a/asm/hall_of_fame.s b/asm/hall_of_fame.s index 1f7a56418..4dbea35d5 100644 --- a/asm/hall_of_fame.s +++ b/asm/hall_of_fame.s @@ -2441,7 +2441,7 @@ sub_8174A88: @ 8174A88 ldrh r0, [r7, 0x8] lsls r0, 23 lsrs r0, 23 - bl sub_806E3C0 + bl SpeciesToPokedexNum lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x0000ffff @@ -2572,7 +2572,7 @@ _08174B8C: lsls r0, r1, 23 lsrs r0, 23 ldr r1, [r7, 0x4] - bl pokemon_species_get_gender_info + bl GetGenderFromSpeciesAndPersonality lsls r0, 24 lsrs r0, 24 cmp r0, 0 diff --git a/asm/intro.s b/asm/intro.s index 26ed312d6..efd52e7fd 100644 --- a/asm/intro.s +++ b/asm/intro.s @@ -307,7 +307,7 @@ c2_copyright_1: @ 816CEAC bl sub_815355C lsls r0, 16 lsrs r0, 16 - bl InitSaveBlockPointersWithRandomOffset + bl SetSaveBlocksPointers bl sub_808447C bl ResetSaveCounters movs r0, 0 diff --git a/asm/item_use.s b/asm/item_use.s index 8d3c0ce41..442b5681a 100644 --- a/asm/item_use.s +++ b/asm/item_use.s @@ -218,7 +218,7 @@ CleanUpAfterFailingToUseRegisteredKeyItemOnField: @ 80FD1F8 adds r0, r4, 0 bl DestroyTask bl sub_80984F4 - bl script_env_2_disable + bl ScriptContext2_Disable pop {r4} pop {r0} bx r0 @@ -396,7 +396,7 @@ _080FD378: bl GetOnOffBike _080FD37E: bl sub_80984F4 - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r4, 0 bl DestroyTask pop {r4} @@ -687,7 +687,7 @@ sub_80FD5CC: @ 80FD5CC movs r1, 0x1 bl sub_8197434 bl sub_80984F4 - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r4, 0 bl DestroyTask pop {r4} @@ -1665,9 +1665,9 @@ sub_80FDD74: @ 80FDD74 ldrh r0, [r0] movs r1, 0x1 bl RemoveBagItem - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =gUnknown_08274482 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript adds r0, r4, 0 bl DestroyTask pop {r4} @@ -1727,9 +1727,9 @@ sub_80FDE08: @ 80FDE08 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =gUnknown_082744C0 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript adds r0, r4, 0 bl DestroyTask pop {r4} @@ -1786,9 +1786,9 @@ sub_80FDE7C: @ 80FDE7C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =gUnknown_08242CFC - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript adds r0, r4, 0 bl DestroyTask pop {r4} @@ -2357,7 +2357,7 @@ ItemUseInBattle_PokeBall: @ 80FE394 lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 - bl sub_806B8B0 + bl PlayerPartyAndPokemonStorageFull lsls r0, 24 cmp r0, 0 bne _080FE3D0 diff --git a/asm/lilycove_lady.s b/asm/lilycove_lady.s new file mode 100644 index 000000000..debcc3fbe --- /dev/null +++ b/asm/lilycove_lady.s @@ -0,0 +1,1931 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start GetLilycoveLadyId +GetLilycoveLadyId: @ 818D9AC + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end GetLilycoveLadyId + + thumb_func_start sub_818D9C0 +sub_818D9C0: @ 818D9C0 + push {r4,r5,lr} + ldr r5, =0x00004010 + ldr r4, =gUnknown_0860B07E + bl GetLilycoveLadyId + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r1, [r0] + adds r0, r5, 0 + bl VarSet + bl GetLilycoveLadyId + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0818DA20 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r0, =0x00003b58 + adds r1, r0 + ldr r0, =0x00004011 + ldr r2, =gUnknown_0860B074 + ldrb r1, [r1, 0xD] + lsls r1, 1 + adds r1, r2 + ldrh r1, [r1] + bl VarSet + ldr r1, =gScriptResult + movs r0, 0x1 + b _0818DA24 + .pool +_0818DA20: + ldr r1, =gScriptResult + movs r0, 0 +_0818DA24: + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818D9C0 + + thumb_func_start SetLilycoveLady +SetLilycoveLady: @ 818DA30 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r1, [r0, 0xB] + lsls r1, 8 + ldrb r0, [r0, 0xA] + orrs r0, r1 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 17 + adds r1, r0, 0 + cmp r0, 0x1 + beq _0818DA68 + cmp r0, 0x1 + bgt _0818DA5C + cmp r0, 0 + beq _0818DA62 + b _0818DA72 + .pool +_0818DA5C: + cmp r1, 0x2 + beq _0818DA6E + b _0818DA72 +_0818DA62: + bl SetLilycoveQuizLady + b _0818DA72 +_0818DA68: + bl SetLilycoveFavourLady + b _0818DA72 +_0818DA6E: + bl SetLilycoveContestLady +_0818DA72: + pop {r0} + bx r0 + thumb_func_end SetLilycoveLady + + thumb_func_start sub_818DA78 +sub_818DA78: @ 818DA78 + push {lr} + bl GetLilycoveLadyId + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0818DA9C + cmp r0, 0x1 + bgt _0818DA90 + cmp r0, 0 + beq _0818DA96 + b _0818DAA6 +_0818DA90: + cmp r0, 0x2 + beq _0818DAA2 + b _0818DAA6 +_0818DA96: + bl sub_818E004 + b _0818DAA6 +_0818DA9C: + bl sub_818DBC4 + b _0818DAA6 +_0818DAA2: + bl sub_818E674 +_0818DAA6: + pop {r0} + bx r0 + thumb_func_end sub_818DA78 + +@ unused + thumb_func_start SetLilycoveLadyRandomly +SetLilycoveLadyRandomly: @ 818DAAC + push {lr} + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _0818DADC + cmp r0, 0x1 + bgt _0818DAD0 + cmp r0, 0 + beq _0818DAD6 + b _0818DAE6 +_0818DAD0: + cmp r1, 0x2 + beq _0818DAE2 + b _0818DAE6 +_0818DAD6: + bl SetLilycoveQuizLady + b _0818DAE6 +_0818DADC: + bl SetLilycoveFavourLady + b _0818DAE6 +_0818DAE2: + bl SetLilycoveContestLady +_0818DAE6: + pop {r0} + bx r0 + thumb_func_end SetLilycoveLadyRandomly + + thumb_func_start sub_818DAEC +sub_818DAEC: @ 818DAEC + push {r4,lr} + ldr r4, =gScriptResult + bl GetLilycoveLadyId + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DAEC + + thumb_func_start sub_818DB04 +sub_818DB04: @ 818DB04 + push {lr} + adds r1, r0, 0 + movs r2, 0 + b _0818DB14 +_0818DB0C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, 0x2 +_0818DB14: + ldrh r0, [r1] + cmp r0, 0 + bne _0818DB0C + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_818DB04 + + thumb_func_start sub_818DB20 +sub_818DB20: @ 818DB20 + push {r4-r6,lr} + bl Random + ldr r5, =gUnknown_0203CD64 + ldr r4, [r5] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + strb r0, [r4, 0xC] + ldr r6, =gUnknown_0860B2EC + ldr r0, [r5] + ldrb r0, [r0, 0xC] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + bl sub_818DB04 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + ldr r2, [r5] + ldrb r1, [r2, 0xC] + lsls r1, 2 + adds r1, r6 + ldr r1, [r1] + lsrs r0, 23 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2, 0x10] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DB20 + + thumb_func_start SetLilycoveFavourLady +SetLilycoveFavourLady: @ 818DB7C + push {lr} + ldr r2, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r2] + movs r3, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + strb r3, [r0, 0x1] + ldr r1, [r2] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r0, [r2] + strb r3, [r0, 0x2] + ldr r0, [r2] + strb r3, [r0, 0x3] + ldr r1, [r2] + strh r3, [r1, 0xE] + ldr r0, =gGameLanguage + ldrb r0, [r0] + strb r0, [r1, 0x12] + bl sub_818DB20 + pop {r0} + bx r0 + .pool + thumb_func_end SetLilycoveFavourLady + + thumb_func_start sub_818DBC4 +sub_818DBC4: @ 818DBC4 + ldr r3, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r3] + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r3] + strb r2, [r0, 0x1] + bx lr + .pool + thumb_func_end sub_818DBC4 + + thumb_func_start sub_818DBE8 +sub_818DBE8: @ 818DBE8 + push {lr} + ldr r1, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _0818DC0C + movs r0, 0x2 + b _0818DC16 + .pool +_0818DC0C: + cmp r0, 0x1 + beq _0818DC14 + movs r0, 0 + b _0818DC16 +_0818DC14: + movs r0, 0x1 +_0818DC16: + pop {r1} + bx r1 + thumb_func_end sub_818DBE8 + + thumb_func_start sub_818DC1C +sub_818DC1C: @ 818DC1C + lsls r0, 24 + ldr r1, =gUnknown_0860B224 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .pool + thumb_func_end sub_818DC1C + + thumb_func_start sub_818DC2C +sub_818DC2C: @ 818DC2C + push {r4,lr} + ldr r1, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldr r4, =gStringVar1 + ldrb r0, [r0, 0xC] + bl sub_818DC1C + adds r1, r0, 0 + adds r0, r4, 0 + bl StringCopy + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DC2C + + thumb_func_start sub_818DC60 +sub_818DC60: @ 818DC60 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r2, =0x00003b58 + adds r0, r1, r2 + str r0, [r5] + ldrb r0, [r0, 0x4] + cmp r0, 0xFF + bne _0818DC84 + movs r0, 0 + b _0818DC9C + .pool +_0818DC84: + ldr r4, =gStringVar3 + ldr r0, =0x00003b5c + adds r1, r0 + adds r0, r4, 0 + bl StringCopy7 + ldr r0, [r5] + ldrb r1, [r0, 0x12] + adds r0, r4, 0 + bl ConvertInternationalString + movs r0, 0x1 +_0818DC9C: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818DC60 + + thumb_func_start sub_818DCAC +sub_818DCAC: @ 818DCAC + push {r4,lr} + adds r4, r0, 0 + lsls r0, r1, 16 + lsrs r0, 16 + bl ItemId_GetItem + adds r1, r0, 0 + adds r0, r4, 0 + bl StringCopy + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_818DCAC + + thumb_func_start sub_818DCC8 +sub_818DCC8: @ 818DCC8 + push {lr} + ldr r2, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r0, =0x00003b58 + adds r1, r0 + str r1, [r2] + ldr r0, =gStringVar2 + ldrh r1, [r1, 0xE] + bl sub_818DCAC + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DCC8 + + thumb_func_start sub_818DCF4 +sub_818DCF4: @ 818DCF4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0xFF + movs r2, 0x8 + bl memset + adds r0, r4, 0 + adds r1, r5, 0 + bl StringCopy7 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_818DCF4 + + thumb_func_start sub_818DD14 +sub_818DD14: @ 818DD14 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r1, r0, r2 + str r1, [r5] + ldr r1, =0x00003b5c + adds r0, r1 + ldr r4, =gStringVar3 + adds r1, r4, 0 + bl sub_818DCF4 + ldr r0, [r5] + ldrb r1, [r0, 0x12] + adds r0, r4, 0 + bl ConvertInternationalString + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DD14 + + thumb_func_start sub_818DD54 +sub_818DD54: @ 818DD54 + ldr r1, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r1, [r0, 0x2] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_818DD54 + + thumb_func_start sub_818DD78 +sub_818DD78: @ 818DD78 + push {lr} + bl sub_81AAC50 + pop {r0} + bx r0 + thumb_func_end sub_818DD78 + + thumb_func_start sub_818DD84 +sub_818DD84: @ 818DD84 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r5, r0, 16 + ldr r4, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r4] + ldr r1, =gUnknown_0860B2EC + mov r8, r1 + ldrb r0, [r0, 0xC] + lsls r0, 2 + add r0, r8 + ldr r0, [r0] + bl sub_818DB04 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x1] + ldr r0, =gStringVar2 + adds r1, r5, 0 + bl sub_818DCAC + ldr r1, [r4] + strh r5, [r1, 0xE] + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r1, 0x4 + bl sub_818DCF4 + ldr r1, [r4] + ldr r0, =gGameLanguage + ldrb r0, [r0] + strb r0, [r1, 0x12] + movs r7, 0 + movs r3, 0 + cmp r7, r6 + bcs _0818DE36 + mov r12, r8 +_0818DDDC: + ldr r2, [r4] + ldrb r0, [r2, 0xC] + lsls r0, 2 + add r0, r12 + ldr r1, [r0] + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r5 + bne _0818DE28 + movs r7, 0x1 + ldrb r0, [r2, 0x3] + adds r0, 0x1 + strb r0, [r2, 0x3] + ldr r0, [r4] + strb r7, [r0, 0x2] + ldr r1, [r4] + ldrh r0, [r1, 0x10] + cmp r0, r5 + bne _0818DE36 + movs r0, 0x5 + strb r0, [r1, 0x3] + b _0818DE36 + .pool +_0818DE28: + movs r0, 0 + strb r0, [r2, 0x2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r6 + bcc _0818DDDC +_0818DE36: + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818DD84 + + thumb_func_start sub_818DE44 +sub_818DE44: @ 818DE44 + push {lr} + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl sub_818DD84 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_818DE44 + + thumb_func_start sub_818DE5C +sub_818DE5C: @ 818DE5C + push {lr} + ldr r1, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x3] + movs r1, 0 + cmp r0, 0x4 + bls _0818DE74 + movs r1, 0x1 +_0818DE74: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_818DE5C + + thumb_func_start sub_818DE88 +sub_818DE88: @ 818DE88 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =gStringVar2 + bl sub_818DCAC + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DE88 + + thumb_func_start sub_818DEA0 +sub_818DEA0: @ 818DEA0 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r5] + ldr r1, =gUnknown_0860B304 + ldrb r0, [r0, 0xC] + lsls r0, 1 + adds r0, r1 + ldrh r4, [r0] + adds r0, r4, 0 + bl sub_818DE88 + ldr r1, [r5] + movs r0, 0x2 + strb r0, [r1, 0x1] + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818DEA0 + + thumb_func_start sub_818DEDC +sub_818DEDC: @ 818DEDC + push {lr} + bl SetLilycoveFavourLady + ldr r0, =gUnknown_0203CD64 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DEDC + + thumb_func_start sub_818DEF4 +sub_818DEF4: @ 818DEF4 + push {lr} + bl EnableBothScriptContexts + pop {r0} + bx r0 + thumb_func_end sub_818DEF4 + + thumb_func_start sub_818DF00 +sub_818DF00: @ 818DF00 + push {r4-r7,lr} + bl Random + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0xF + ands r4, r0 + movs r3, 0 + ldr r5, =gUnknown_0203CD68 + ldr r1, =gUnknown_0860B1A4 + lsls r0, r4, 2 + adds r6, r0, r1 + adds r7, r5, 0 +_0818DF1A: + ldr r2, [r5] + lsls r1, r3, 1 + adds r2, 0x2 + adds r2, r1 + ldr r0, [r6] + adds r1, r0 + ldrh r0, [r1] + strh r0, [r2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x8 + bls _0818DF1A + ldr r2, [r7] + ldr r0, =gUnknown_0860B1E4 + lsls r1, r4, 1 + adds r0, r1, r0 + ldrh r0, [r0] + strh r0, [r2, 0x14] + ldr r0, =gUnknown_0860B204 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r2, 0x28] + adds r2, 0x2B + strb r4, [r2] + ldr r1, [r7] + movs r0, 0xFF + strb r0, [r1, 0x18] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DF00 + + thumb_func_start SetLilycoveQuizLady +SetLilycoveQuizLady: @ 818DF68 + push {r4-r6,lr} + ldr r2, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + movs r3, 0 + adds r4, r2, 0 + ldr r6, =gGameLanguage + adds r5, r4, 0 + ldr r0, =0x0000ffff + adds r2, r0, 0 +_0818DF8A: + ldr r1, [r5] + lsls r0, r3, 1 + adds r1, 0x2 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r2 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x8 + bls _0818DF8A + ldr r0, [r4] + ldr r1, =0x0000ffff + strh r1, [r0, 0x14] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x16] + movs r3, 0 + adds r5, r4, 0 + movs r2, 0 +_0818DFB4: + ldr r0, [r5] + lsls r1, r3, 1 + adds r0, 0x20 + adds r0, r1 + strh r2, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0818DFB4 + ldr r0, [r4] + movs r2, 0 + movs r1, 0 + strh r1, [r0, 0x28] + adds r0, 0x2A + strb r2, [r0] + ldr r0, [r4] + adds r0, 0x2C + movs r1, 0x10 + strb r1, [r0] + ldr r0, [r4] + ldrb r1, [r6] + adds r0, 0x2D + strb r1, [r0] + bl sub_818DF00 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end SetLilycoveQuizLady + + thumb_func_start sub_818E004 +sub_818E004: @ 818E004 + ldr r2, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + ldr r0, [r2] + adds r0, 0x2A + strb r1, [r0] + ldr r1, [r2] + ldr r0, =0x0000ffff + strh r0, [r1, 0x16] + bx lr + .pool + thumb_func_end sub_818E004 + + thumb_func_start sub_818E038 +sub_818E038: @ 818E038 + push {lr} + ldr r1, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _0818E05C + movs r0, 0x2 + b _0818E066 + .pool +_0818E05C: + cmp r0, 0x1 + beq _0818E064 + movs r0, 0 + b _0818E066 +_0818E064: + movs r0, 0x1 +_0818E066: + pop {r1} + bx r1 + thumb_func_end sub_818E038 + + thumb_func_start sub_818E06C +sub_818E06C: @ 818E06C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gSaveBlock1Ptr + ldr r4, [r0] + ldr r0, =0x00003b58 + adds r7, r4, r0 + ldrh r0, [r7, 0x14] + bl sub_811F8D8 + cmp r0, 0 + bne _0818E0EC + ldr r1, =0x00003b83 + adds r0, r4, r1 + ldrb r5, [r0] + ldr r0, =0x00003b5a + adds r0, r4 + mov r8, r0 + adds r1, r4 + mov r10, r1 + ldr r6, =gUnknown_0860B1E4 +_0818E09A: + adds r5, 0x1 + cmp r5, 0xF + ble _0818E0A2 + movs r5, 0 +_0818E0A2: + lsls r4, r5, 1 + adds r0, r4, r6 + ldrh r0, [r0] + bl sub_811F8D8 + cmp r0, 0 + beq _0818E09A + movs r3, 0 + ldr r0, =gUnknown_0860B1E4 + mov r12, r0 + lsls r1, r5, 2 + ldr r0, =gUnknown_0860B204 + mov r9, r0 + ldr r0, =gUnknown_0860B1A4 + adds r6, r1, r0 + mov r2, r8 +_0818E0C2: + lsls r0, r3, 1 + ldr r1, [r6] + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x8 + ble _0818E0C2 + mov r1, r12 + adds r0, r4, r1 + ldrh r0, [r0] + strh r0, [r7, 0x14] + mov r1, r9 + adds r0, r4, r1 + ldrh r0, [r0] + strh r0, [r7, 0x28] + mov r0, r10 + strb r5, [r0] + movs r0, 0xFF + strb r0, [r7, 0x18] +_0818E0EC: + bl sub_818E13C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0818E118 + movs r0, 0x2 + b _0818E12C + .pool +_0818E118: + cmp r0, 0x2 + beq _0818E126 + bl sub_818E1F4 + lsls r0, 24 + cmp r0, 0 + beq _0818E12A +_0818E126: + movs r0, 0x1 + b _0818E12C +_0818E12A: + movs r0, 0 +_0818E12C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818E06C + + thumb_func_start sub_818E13C +sub_818E13C: @ 818E13C + push {r4-r7,lr} + movs r7, 0x1 + ldr r5, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r2, =0x00003b58 + adds r0, r1, r2 + str r0, [r5] + ldrb r0, [r0, 0x18] + cmp r0, 0xFF + bne _0818E174 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085EEB7E + bl StringCopy7 + movs r7, 0 + b _0818E1DC + .pool +_0818E174: + ldr r4, =gStringVar1 + ldr r0, =0x00003b70 + adds r1, r0 + adds r0, r4, 0 + bl StringCopy7 + ldr r0, [r5] + adds r0, 0x2D + ldrb r1, [r0] + adds r0, r4, 0 + bl ConvertInternationalString + ldr r0, [r5] + adds r0, 0x18 + bl sub_818E258 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + bl sub_818E258 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0818E1DC + ldr r0, [r5] + movs r2, 0 + cmp r2, r4 + bcs _0818E1DC + ldr r1, [r6] + ldrb r0, [r0, 0x18] + ldrb r1, [r1] + cmp r0, r1 + bne _0818E1DA +_0818E1BA: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r4 + bcs _0818E1DC + ldr r0, =gUnknown_0203CD68 + ldr r1, [r0] + adds r1, 0x18 + adds r1, r2 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, r2 + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + beq _0818E1BA +_0818E1DA: + movs r7, 0x2 +_0818E1DC: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818E13C + + thumb_func_start sub_818E1F4 +sub_818E1F4: @ 818E1F4 + push {r4-r6,lr} + ldr r3, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r2, =0x00003b58 + adds r0, r1, r2 + str r0, [r3] + movs r5, 0 + movs r4, 0 + ldr r0, =0x00003b78 + adds r1, r0 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrh r1, [r1] + adds r6, r3, 0 + adds r3, r0, 0 + ldrb r2, [r2, 0xA] + cmp r1, r2 + bne _0818E23A +_0818E21A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bhi _0818E23C + ldr r1, [r6] + lsls r0, r4, 1 + adds r1, 0x20 + adds r1, r0 + ldr r0, [r3] + adds r0, 0xA + adds r0, r4 + ldrh r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + beq _0818E21A +_0818E23A: + movs r5, 0x1 +_0818E23C: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818E1F4 + + thumb_func_start sub_818E258 +sub_818E258: @ 818E258 + push {lr} + movs r2, 0 + adds r1, r0, 0 + b _0818E268 +_0818E260: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, 0x1 +_0818E268: + ldrb r0, [r1] + cmp r0, 0xFF + bne _0818E260 + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_818E258 + + thumb_func_start sub_818E274 +sub_818E274: @ 818E274 + push {r4,lr} + ldr r4, =gStringVar1 + ldr r0, =gUnknown_0203CD68 + ldr r0, [r0] + ldrh r0, [r0, 0x28] + bl ItemId_GetItem + adds r1, r0, 0 + adds r0, r4, 0 + bl StringCopy + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E274 + + thumb_func_start sub_818E298 +sub_818E298: @ 818E298 + push {r4,lr} + ldr r4, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r4] + bl sub_818E13C + lsls r0, 24 + cmp r0, 0 + beq _0818E2C0 + movs r0, 0 + b _0818E2CC + .pool +_0818E2C0: + ldr r0, [r4] + ldr r1, =gGameLanguage + ldrb r1, [r1] + adds r0, 0x2D + strb r1, [r0] + movs r0, 0x1 +_0818E2CC: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818E298 + + thumb_func_start sub_818E2D8 +sub_818E2D8: @ 818E2D8 + ldr r2, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r3, =0x00003b58 + adds r1, r0, r3 + str r1, [r2] + ldr r1, =0x00003b82 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_818E2D8 + + thumb_func_start sub_818E2FC +sub_818E2FC: @ 818E2FC + push {lr} + bl easy_chat_input_maybe + pop {r0} + bx r0 + thumb_func_end sub_818E2FC + + thumb_func_start sub_818E308 +sub_818E308: @ 818E308 + push {r4-r6,lr} + ldr r5, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r5] + ldr r6, =gStringVar1 + ldrh r1, [r0, 0x14] + adds r0, r6, 0 + bl CopyEasyChatWord + ldr r4, =gStringVar2 + ldr r0, [r5] + ldrh r1, [r0, 0x16] + adds r0, r4, 0 + bl CopyEasyChatWord + adds r0, r6, 0 + adds r1, r4, 0 + bl StringCompare + movs r1, 0 + cmp r0, 0 + bne _0818E33C + movs r1, 0x1 +_0818E33C: + adds r0, r1, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818E308 + + thumb_func_start sub_818E358 +sub_818E358: @ 818E358 + ldr r1, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldr r1, =gSpecialVar_0x8005 + ldrh r0, [r0, 0x28] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_818E358 + + thumb_func_start sub_818E37C +sub_818E37C: @ 818E37C + ldr r1, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + movs r1, 0x1 + strb r1, [r0, 0x1] + bx lr + .pool + thumb_func_end sub_818E37C + + thumb_func_start sub_818E39C +sub_818E39C: @ 818E39C + ldr r1, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + movs r1, 0x2 + strb r1, [r0, 0x1] + bx lr + .pool + thumb_func_end sub_818E39C + + thumb_func_start sub_818E3BC +sub_818E3BC: @ 818E3BC + ldr r1, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldr r1, =0x0000ffff + strh r1, [r0, 0x16] + bx lr + .pool + thumb_func_end sub_818E3BC + + thumb_func_start sub_818E3E0 +sub_818E3E0: @ 818E3E0 + push {lr} + bl sub_81AAC70 + pop {r0} + bx r0 + thumb_func_end sub_818E3E0 + + thumb_func_start sub_818E3EC +sub_818E3EC: @ 818E3EC + push {r4,lr} + ldr r4, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r4] + bl sub_818E298 + lsls r0, 24 + cmp r0, 0 + beq _0818E41C + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x2B + ldrb r1, [r1] + adds r0, 0x2C + b _0818E422 + .pool +_0818E41C: + ldr r0, [r4] + adds r0, 0x2C + movs r1, 0x10 +_0818E422: + strb r1, [r0] + bl sub_818DF00 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_818E3EC + + thumb_func_start sub_818E430 +sub_818E430: @ 818E430 + push {r4,r5,lr} + ldr r1, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + movs r2, 0 + adds r5, r1, 0 + adds r4, r5, 0 + ldr r0, =0x0000ffff + adds r3, r0, 0 +_0818E448: + ldr r1, [r4] + lsls r0, r2, 1 + adds r1, 0x2 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bls _0818E448 + ldr r1, [r5] + ldr r0, =0x0000ffff + strh r0, [r1, 0x14] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E430 + + thumb_func_start sub_818E47C +sub_818E47C: @ 818E47C + push {lr} + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x11 + strh r0, [r1] + bl easy_chat_input_maybe + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E47C + + thumb_func_start sub_818E490 +sub_818E490: @ 818E490 + push {lr} + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + movs r1, 0x1 + bl RemoveBagItem + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E490 + + thumb_func_start sub_818E4A4 +sub_818E4A4: @ 818E4A4 + push {r4-r6,lr} + ldr r2, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r2] + ldr r1, =gUnknown_0203CE7C + ldrh r1, [r1] + strh r1, [r0, 0x28] + movs r3, 0 + adds r4, r2, 0 + ldr r6, =gSaveBlock2Ptr + adds r5, r4, 0 + adds r2, r6, 0 +_0818E4C2: + ldr r1, [r5] + lsls r0, r3, 1 + adds r1, 0x20 + adds r1, r0 + ldr r0, [r2] + adds r0, 0xA + adds r0, r3 + ldrb r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0818E4C2 + ldr r0, [r4] + adds r0, 0x18 + ldr r1, [r6] + bl StringCopy7 + ldr r0, [r4] + ldr r1, =gGameLanguage + ldrb r1, [r1] + adds r0, 0x2D + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E4A4 + + thumb_func_start sub_818E510 +sub_818E510: @ 818E510 + ldr r2, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r3, =0x00003b58 + adds r1, r0, r3 + str r1, [r2] + ldr r1, =0x00003b82 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_818E510 + + thumb_func_start sub_818E538 +sub_818E538: @ 818E538 + push {lr} + ldr r2, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r0, =0x00003b58 + adds r1, r0 + str r1, [r2] + ldr r0, =gStringVar3 + ldrh r1, [r1, 0x14] + bl CopyEasyChatWord + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E538 + + thumb_func_start sub_818E564 +sub_818E564: @ 818E564 + push {lr} + bl EnableBothScriptContexts + pop {r0} + bx r0 + thumb_func_end sub_818E564 + + thumb_func_start sub_818E570 +sub_818E570: @ 818E570 + push {r4-r7,lr} + ldr r2, =gUnknown_0203CD68 + ldr r1, =gSaveBlock1Ptr + ldr r1, [r1] + ldr r4, =0x00003b58 + adds r3, r1, r4 + str r3, [r2] + adds r6, r0, 0 + adds r6, 0x2C + ldrb r4, [r6] + adds r7, r2, 0 + cmp r4, 0xF + bhi _0818E5EC + ldrb r0, [r3] + cmp r0, 0 + bne _0818E5EC + movs r5, 0 + ldr r2, =0x00003b83 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r4, r0 + bne _0818E5E4 + adds r4, r7, 0 +_0818E59E: + bl Random + ldr r2, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + adds r2, 0x2B + strb r0, [r2] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bhi _0818E5C6 + ldr r0, [r4] + adds r0, 0x2B + ldrb r1, [r6] + ldrb r0, [r0] + cmp r1, r0 + beq _0818E59E +_0818E5C6: + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0x2B + ldrb r0, [r6] + ldr r7, =gUnknown_0203CD68 + ldrb r4, [r2] + cmp r0, r4 + bne _0818E5E4 + ldrb r1, [r2] + adds r3, r1, 0x1 + adds r0, r3, 0 + asrs r0, 4 + lsls r0, 4 + subs r0, r3, r0 + strb r0, [r2] +_0818E5E4: + ldr r0, [r7] + ldrb r1, [r6] + adds r0, 0x2C + strb r1, [r0] +_0818E5EC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E570 + + thumb_func_start sub_818E604 +sub_818E604: @ 818E604 + push {r4,lr} + ldr r4, =gUnknown_0203CD6C + ldr r1, [r4] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r0, [r4] + movs r1, 0 + strb r1, [r0, 0x2] + ldr r0, [r4] + strb r1, [r0, 0x3] + ldr r0, [r4] + strb r1, [r0, 0xC] + bl Random + ldr r4, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + strb r0, [r4, 0xD] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E604 + + thumb_func_start SetLilycoveContestLady +SetLilycoveContestLady: @ 818E638 + push {r4,lr} + ldr r4, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r4] + movs r2, 0 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r4] + strb r2, [r0, 0x1] + bl sub_818E604 + ldr r1, [r4] + ldr r0, =gGameLanguage + ldrb r0, [r0] + strb r0, [r1, 0xE] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end SetLilycoveContestLady + + thumb_func_start sub_818E674 +sub_818E674: @ 818E674 + push {lr} + ldr r2, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r2] + movs r3, 0 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r2] + strb r3, [r0, 0x1] + ldr r2, [r2] + ldrb r0, [r2, 0x2] + cmp r0, 0x5 + beq _0818E69A + ldrb r0, [r2, 0x3] + cmp r0, 0x5 + bne _0818E69E +_0818E69A: + bl sub_818E604 +_0818E69E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E674 + + thumb_func_start sub_818E6B0 +sub_818E6B0: @ 818E6B0 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r4, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r3, =0x00003b58 + adds r1, r0, r3 + str r1, [r4] + ldrb r0, [r1, 0xC] + cmp r0, r2 + bhi _0818E6EA + strb r2, [r1, 0xC] + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0xFF + movs r2, 0x8 + bl memset + ldr r1, [r4] + ldr r0, =gSaveBlock2Ptr + adds r1, 0x4 + ldr r0, [r0] + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + ldr r1, [r4] + ldr r0, =gGameLanguage + ldrb r0, [r0] + strb r0, [r1, 0xE] +_0818E6EA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E6B0 + + thumb_func_start sub_818E704 +sub_818E704: @ 818E704 + push {r4,r5,lr} + adds r2, r0, 0 + movs r3, 0 + movs r4, 0 + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r5, =0x00003b58 + adds r0, r5 + str r0, [r1] + ldrb r0, [r0, 0xD] + adds r5, r1, 0 + cmp r0, 0x4 + bhi _0818E76A + lsls r0, 2 + ldr r1, =_0818E73C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0818E73C: + .4byte _0818E750 + .4byte _0818E754 + .4byte _0818E758 + .4byte _0818E75C + .4byte _0818E760 +_0818E750: + ldrb r0, [r2, 0x1] + b _0818E762 +_0818E754: + ldrb r0, [r2, 0x2] + b _0818E762 +_0818E758: + ldrb r0, [r2, 0x3] + b _0818E762 +_0818E75C: + ldrb r0, [r2, 0x4] + b _0818E762 +_0818E760: + ldrb r0, [r2, 0x5] +_0818E762: + cmp r0, 0 + beq _0818E76A + adds r3, r0, 0 + movs r4, 0x1 +_0818E76A: + cmp r4, 0x1 + bne _0818E784 + adds r0, r3, 0 + bl sub_818E6B0 + ldr r0, =gUnknown_0203CD6C + ldr r1, [r0] + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + b _0818E78C + .pool +_0818E784: + ldr r1, [r5] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] +_0818E78C: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_818E704 + + thumb_func_start sub_818E794 +sub_818E794: @ 818E794 + push {r4,r5,lr} + adds r5, r1, 0 + ldr r4, =gUnknown_0203CD6C + ldr r1, =gSaveBlock1Ptr + ldr r1, [r1] + ldr r2, =0x00003b58 + adds r1, r2 + str r1, [r4] + ldr r2, =gUnknown_0860B324 + ldrb r1, [r1, 0xD] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + ldr r1, =gUnknown_0860B310 + ldr r0, [r4] + ldrb r0, [r0, 0xD] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl StringCopy10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E794 + + thumb_func_start sub_818E7E0 +sub_818E7E0: @ 818E7E0 + push {r4,lr} + adds r3, r1, 0 + ldr r2, =gUnknown_0203CD6C + ldr r1, =gSaveBlock1Ptr + ldr r1, [r1] + ldr r4, =0x00003b58 + adds r1, r4 + str r1, [r2] + ldrb r2, [r1, 0xD] + strb r2, [r0] + ldr r2, =gUnknown_0860B310 + ldrb r0, [r1, 0xD] + lsls r0, 2 + adds r0, r2 + ldr r1, [r0] + adds r0, r3, 0 + bl StringCopy + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E7E0 + + thumb_func_start sub_818E81C +sub_818E81C: @ 818E81C + push {r4,lr} + ldr r3, =gUnknown_0203CD6C + ldr r1, =gSaveBlock1Ptr + ldr r1, [r1] + ldr r4, =0x00003b58 + adds r2, r1, r4 + str r2, [r3] + ldr r2, =0x00003b5c + adds r1, r2 + bl StringCopy + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E81C + + thumb_func_start sub_818E848 +sub_818E848: @ 818E848 + ldr r2, =gUnknown_0203CD6C + ldr r1, =gSaveBlock1Ptr + ldr r1, [r1] + ldr r3, =0x00003b58 + adds r1, r3 + str r1, [r2] + ldrb r1, [r1, 0xE] + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_818E848 + + thumb_func_start sub_818E868 +sub_818E868: @ 818E868 + push {lr} + lsls r1, 24 + ldr r2, =gUnknown_0860B338 + lsrs r1, 22 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E868 + + thumb_func_start sub_818E880 +sub_818E880: @ 818E880 + push {lr} + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x2] + cmp r0, 0x4 + bls _0818E8A4 + movs r0, 0x1 + b _0818E8AE + .pool +_0818E8A4: + cmp r0, 0 + beq _0818E8AC + movs r0, 0 + b _0818E8AE +_0818E8AC: + movs r0, 0x2 +_0818E8AE: + pop {r1} + bx r1 + thumb_func_end sub_818E880 + + thumb_func_start sub_818E8B4 +sub_818E8B4: @ 818E8B4 + push {lr} + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _0818E8D8 + movs r0, 0 + b _0818E8DA + .pool +_0818E8D8: + movs r0, 0x1 +_0818E8DA: + pop {r1} + bx r1 + thumb_func_end sub_818E8B4 + + thumb_func_start sub_818E8E0 +sub_818E8E0: @ 818E8E0 + push {r4,lr} + movs r3, 0 + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r4, =0x00003b58 + adds r2, r0, r4 + str r2, [r1] + ldrb r0, [r2, 0x2] + cmp r0, 0x4 + bhi _0818E8FC + ldrb r0, [r2, 0x3] + cmp r0, 0x4 + bls _0818E8FE +_0818E8FC: + movs r3, 0x1 +_0818E8FE: + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818E8E0 + + thumb_func_start sub_818E914 +sub_818E914: @ 818E914 + push {lr} + ldr r0, =gStringVar2 + ldr r1, =gStringVar1 + bl sub_818E794 + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E914 + + thumb_func_start sub_818E92C +sub_818E92C: @ 818E92C + push {lr} + ldr r1, =c2_exit_to_overworld_2_switch + movs r0, 0x3 + bl sub_81357FC + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E92C + + thumb_func_start sub_818E940 +sub_818E940: @ 818E940 + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + movs r1, 0x1 + strb r1, [r0, 0x1] + bx lr + .pool + thumb_func_end sub_818E940 + + thumb_func_start sub_818E960 +sub_818E960: @ 818E960 + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldr r2, =gSpecialVar_0x8005 + ldr r1, =gUnknown_0860B34C + ldrb r0, [r0, 0xD] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_818E960 + + thumb_func_start sub_818E990 +sub_818E990: @ 818E990 + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0xD] + bx lr + .pool + thumb_func_end sub_818E990 + + +.align 2, 0 @ Don't pad with nop. diff --git a/asm/link.s b/asm/link.s index 91d0e513b..76f5058eb 100644 --- a/asm/link.s +++ b/asm/link.s @@ -1002,7 +1002,7 @@ _08009C70: lsls r0, r6, 3 subs r0, r6 lsls r0, 2 - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers adds r2, r0, r1 adds r1, r2, 0 mov r0, r8 @@ -1406,7 +1406,7 @@ sub_8009FF8: @ 8009FF8 cmp r2, r4 bge _0800A030 movs r7, 0xFF - ldr r3, =gUnknown_020229E8 + ldr r3, =gLinkPlayers _0800A010: ldrh r0, [r3] adds r1, r7, 0 @@ -1488,7 +1488,7 @@ sub_800A07C: @ 800A07C adds r2, r0, 0 cmp r2, 0 blt _0800A0A4 - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers lsls r1, r2, 3 subs r1, r2 lsls r1, 2 @@ -1555,7 +1555,7 @@ _0800A0FC: bl sub_80097E8 _0800A10E: movs r6, 0 - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers movs r5, 0 b _0800A134 .pool @@ -1582,7 +1582,7 @@ _0800A134: lsrs r0, 24 cmp r7, r0 bne _0800A1AC - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers ldr r1, [r0, 0x14] ldr r0, =0x00001133 cmp r1, r0 @@ -1625,8 +1625,8 @@ _0800A1AC: ldr r6, =gUnknown_03000D5C movs r0, 0x3 str r0, [r6] - ldr r4, =gUnknown_020229E8 - bl link_get_multiplayer_id + ldr r4, =gLinkPlayers + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -1635,7 +1635,7 @@ _0800A1AC: adds r4, 0x14 adds r1, r4 ldr r5, [r1] - bl link_get_multiplayer_id + bl GetMultiplayerId movs r1, 0x1 eors r0, r1 lsls r0, 24 @@ -1692,7 +1692,7 @@ sub_800A23C: @ 800A23C push {r4-r6,lr} movs r6, 0 movs r4, 0 - ldr r5, =gUnknown_020229E8 + ldr r5, =gLinkPlayers b _0800A26C .pool _0800A24C: @@ -1746,7 +1746,7 @@ _0800A298: sub_800A2A4: @ 800A2A4 lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -1760,7 +1760,7 @@ sub_800A2A4: @ 800A2A4 thumb_func_start sub_800A2BC sub_800A2BC: @ 800A2BC push {r4,r5,lr} - ldr r5, =gUnknown_020229E8 + ldr r5, =gLinkPlayers movs r4, 0x4 _0800A2C2: adds r0, r5, 0 @@ -1802,7 +1802,7 @@ sub_800A2F4: @ 800A2F4 b _0800A34A .pool _0800A30C: - bl link_get_multiplayer_id + bl GetMultiplayerId strb r0, [r4, 0x9] movs r0, 0x1 strb r0, [r4, 0x8] @@ -1916,7 +1916,7 @@ sub_800A3EC: @ 800A3EC thumb_func_start sub_800A3F8 sub_800A3F8: @ 800A3F8 push {lr} - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r0, =0x00004444 bl sub_8009D90 ldr r1, =gUnknown_020223C0 @@ -1969,8 +1969,8 @@ sub_800A458: @ 800A458 .pool thumb_func_end sub_800A458 - thumb_func_start link_get_multiplayer_id -link_get_multiplayer_id: @ 800A468 + thumb_func_start GetMultiplayerId +GetMultiplayerId: @ 800A468 push {lr} ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] @@ -1989,12 +1989,12 @@ _0800A484: _0800A48C: pop {r1} bx r1 - thumb_func_end link_get_multiplayer_id + thumb_func_end GetMultiplayerId thumb_func_start bitmask_all_link_players_but_self bitmask_all_link_players_but_self: @ 800A490 push {lr} - bl link_get_multiplayer_id + bl GetMultiplayerId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -2554,7 +2554,7 @@ task00_link_test: @ 800A850 movs r2, 0xA movs r3, 0x2 bl sub_800A6E8 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 movs r1, 0xF @@ -2713,10 +2713,10 @@ sub_800AA04: @ 800AA04 push {r4-r7,lr} ldr r1, =gUnknown_03003100 strb r0, [r1] - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r1, =gUnknown_03003120 strb r0, [r1] - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers ldr r3, =gUnknown_02022A74 movs r2, 0x4 _0800AA18: @@ -2767,7 +2767,7 @@ sub_800AA60: @ 800AA60 mov r9, r0 cmp r3, r1 bge _0800AAB4 - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers mov r12, r0 ldr r0, =gUnknown_02022A74 ldr r2, =0x00002288 @@ -2859,7 +2859,7 @@ sub_800AB18: @ 800AB18 cmp r4, r0 bcs _0800AB78 ldr r6, =gUnknown_02022A74 - ldr r5, =gUnknown_020229E8 + ldr r5, =gLinkPlayers movs r0, 0x8 adds r0, r6 mov r8, r0 @@ -3150,7 +3150,7 @@ sub_800AD88: @ 800AD88 cmp r1, r3 bge _0800ADB6 ldr r5, =gUnknown_030030F0 - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers _0800AD9E: ldrh r0, [r4, 0x1A] cmp r0, 0x1 @@ -3818,7 +3818,7 @@ sub_800B3A4: @ 800B3A4 lsls r2, r0, 3 subs r2, r0 lsls r2, 2 - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers adds r2, r0 adds r1, r2, 0 adds r0, r4, 0 @@ -9927,7 +9927,7 @@ _0800E3D0: subs r0, r4 lsls r0, 2 str r0, [sp, 0x1C] - ldr r7, =gUnknown_020229F0 + ldr r7, =gLinkPlayers + 8 mov r10, r7 ldr r6, =0x00003b98 movs r4, 0 @@ -9979,12 +9979,12 @@ _0800E434: b _0800E4AC .pool _0800E45C: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 cmp r4, r0 beq _0800E4A6 - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers adds r0, r5, r2 ldrh r0, [r0, 0x1A] cmp r0, 0x1 @@ -10258,7 +10258,7 @@ _0800E64A: bl CpuSet mov r0, r9 strh r5, [r0] - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers ldr r2, =0x01000046 bl CpuSet add sp, 0x8 @@ -12301,7 +12301,7 @@ sub_800F820: @ 800F820 movs r0, 0x88 lsls r0, 7 bl sub_800FD14 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _0800F83C @@ -13124,7 +13124,7 @@ _0800FEC8: negs r4, r0 orrs r4, r0 lsrs r4, 31 - bl link_get_multiplayer_id + bl GetMultiplayerId adds r1, r5, 0 adds r1, 0x7D strb r0, [r1] @@ -13206,7 +13206,7 @@ rfufunc_80F9F44: @ 800FF4C b _0800FF9C .pool _0800FF84: - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r1, =gUnknown_03003090 lsls r0, 24 lsrs r0, 20 @@ -13296,7 +13296,7 @@ rfufunc_80FA020: @ 8010028 ldr r5, =gUnknown_03005000 ldr r0, [r5, 0x70] mov r8, r0 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r6, r0, 24 ldrb r0, [r5, 0xC] @@ -13606,7 +13606,7 @@ _080102AC: thumb_func_start sub_80102B8 sub_80102B8: @ 80102B8 push {r4,r5,lr} - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 beq _080102E6 @@ -13713,7 +13713,7 @@ _0801037A: thumb_func_start sub_8010390 sub_8010390: @ 8010390 push {r4,lr} - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 beq _080103CC @@ -14563,7 +14563,7 @@ _08010A28: cmp r4, 0x3 ble _08010A28 adds r6, r2, 0 - ldr r5, =gUnknown_020229E8 + ldr r5, =gLinkPlayers movs r4, 0x4 _08010A3C: adds r0, r5, 0 @@ -14717,7 +14717,7 @@ _08010B8C: lsls r2, r4, 8 ldr r0, =gUnknown_020223C4 adds r2, r0 - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers lsls r0, r4, 3 subs r0, r4 lsls r0, 2 @@ -14759,7 +14759,7 @@ _08010BE2: adds r2, 0x1 cmp r2, 0x3 ble _08010BE2 - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers adds r0, r5, 0 adds r0, 0x14 movs r2, 0x8C @@ -14777,7 +14777,7 @@ _08010C0A: ldrb r0, [r1, 0xD] strb r0, [r5, 0xF] movs r2, 0 - ldr r3, =gUnknown_020229E8 + ldr r3, =gLinkPlayers mov r12, r3 adds r4, r5, 0 adds r4, 0x10 @@ -15254,7 +15254,7 @@ sub_8010FCC: @ 8010FCC sub_801100C: @ 801100C push {r4,lr} movs r4, 0x80 - ldr r3, =gUnknown_020229E8 + ldr r3, =gLinkPlayers lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -15367,7 +15367,7 @@ sub_80110B8: @ 80110B8 mov r8, r1 movs r4, 0 movs r6, 0x1 - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers mov r12, r2 ldr r0, =0x00000cde adds r0, r3 @@ -18888,7 +18888,7 @@ _08012ED0: strb r0, [r6, 0xC] b _08012F50 _08012EE6: - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask ldr r1, =gScriptResult @@ -18897,7 +18897,7 @@ _08012EE6: b _08012F50 .pool _08012EFC: - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask ldr r1, =gScriptResult @@ -20767,7 +20767,7 @@ sub_8013F90: @ 8013F90 lsrs r6, r0, 24 ldr r0, =gUnknown_02022C40 mov r8, r0 - bl link_get_multiplayer_id + bl GetMultiplayerId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -20815,7 +20815,7 @@ _08013FFC: lsrs r0, 24 cmp r0, 0x3 bne _080140BC - bl link_get_multiplayer_id + bl GetMultiplayerId adds r1, r0, 0 ldr r0, =gEnemyParty movs r2, 0x1 @@ -20860,7 +20860,7 @@ _08014070: cmp r0, 0x3 bne _080140BC ldr r4, =gUnknown_020321C0 - bl link_get_multiplayer_id + bl GetMultiplayerId adds r1, r0, 0 movs r0, 0x1 eors r1, r0 @@ -20913,7 +20913,7 @@ sub_80140E0: @ 80140E0 b _0801419E .pool _08014104: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _08014114 @@ -20933,7 +20933,7 @@ _0801411C: cmp r4, r0 bne _0801419E movs r4, 0 - ldr r5, =gUnknown_020229E8 + ldr r5, =gLinkPlayers b _08014152 .pool _08014138: @@ -20960,7 +20960,7 @@ _08014152: lsrs r0, 24 cmp r0, 0x2 bne _08014190 - bl link_get_multiplayer_id + bl GetMultiplayerId movs r1, 0x1 eors r0, r1 lsls r0, 24 @@ -21014,7 +21014,7 @@ _080141D4: lsls r0, 24 cmp r0, 0 bne _080141F2 - bl link_get_multiplayer_id + bl GetMultiplayerId movs r1, 0x1 eors r0, r1 lsls r0, 24 @@ -21041,12 +21041,12 @@ sub_8014210: @ 8014210 bl sp000_heal_pokemon bl copy_player_party_to_sav1 bl copy_bags_and_unk_data_from_save_blocks - ldr r5, =gUnknown_020229E8 + ldr r5, =gLinkPlayers ldr r0, =0x00002211 str r0, [r5, 0x14] - bl link_get_multiplayer_id + bl GetMultiplayerId adds r4, r0, 0 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r4, 24 lsrs r4, 24 lsls r1, r4, 3 @@ -21056,9 +21056,9 @@ sub_8014210: @ 8014210 lsls r0, 24 lsrs r0, 24 strh r0, [r1, 0x18] - bl link_get_multiplayer_id + bl GetMultiplayerId adds r4, r0, 0 - bl link_get_multiplayer_id + bl GetMultiplayerId movs r2, 0x1 eors r4, r2 lsls r4, 24 @@ -21162,7 +21162,7 @@ sub_8014304: @ 8014304 bl sub_8009FCC ldr r1, =gUnknown_03005DB8 strb r0, [r1] - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r1, =gUnknown_03005DB4 strb r0, [r1] bl sub_809D2BC @@ -21487,7 +21487,7 @@ _080146C4: b _08014764 .pool _080146D8: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _080146E8 @@ -21551,7 +21551,7 @@ _08014764: ldrb r0, [r0] cmp r0, 0x44 beq _0801477C - bl script_env_2_disable + bl ScriptContext2_Disable _0801477C: add sp, 0x4 pop {r4} @@ -21632,7 +21632,7 @@ _08014818: .4byte _080148B8 .4byte _08014854 _08014854: - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers ldr r0, =0x00002211 str r0, [r1, 0x14] movs r2, 0 @@ -21645,7 +21645,7 @@ _08014854: ldrb r0, [r6] movs r5, 0x64 muls r0, r5 - ldr r4, =gUnknown_02024488 + ldr r4, =gBattleScripting + 0x14 adds r0, r4 movs r1, 0xB bl GetMonData @@ -21673,12 +21673,12 @@ _080148B8: adds r0, r4, 0 bl DestroyTask _080148C2: - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts movs r0, 0x1 strh r0, [r7] b _080149B2 _080148CC: - bl script_env_context_is_running + bl ScriptContext1_IsScriptSetUp lsls r0, 24 cmp r0, 0 bne _080149B2 @@ -21756,7 +21756,7 @@ _08014980: strh r0, [r7] b _080149B2 _08014986: - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask b _080149B2 @@ -21771,7 +21771,7 @@ _0801499C: cmp r0, 0 bne _080149B2 bl sub_800E084 - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask _080149B2: @@ -23529,7 +23529,7 @@ _08015A02: strh r1, [r4] bl _08016878 _08015A0A: - bl script_env_2_is_enabled + bl ScriptContext2_IsEnabled lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -23815,7 +23815,7 @@ _08015CB2: bl sub_800FE50 ldr r0, =gStringVar4 ldr r2, =gUnknown_082EEB80 - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers ldrb r1, [r1, 0x13] lsls r1, 2 adds r1, r2 @@ -23963,7 +23963,7 @@ _08015E32: ldrb r2, [r4] movs r1, 0x40 orrs r1, r2 - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers ldrb r2, [r2, 0x13] bl sub_8017D9C strb r5, [r4] @@ -24020,12 +24020,12 @@ _08015EC4: bne _08015ED2 bl _08016878 _08015ED2: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _08015F2C ldr r5, =gStringVar1 - bl link_get_multiplayer_id + bl GetMultiplayerId movs r1, 0x1 eors r0, r1 lsls r0, 24 @@ -24033,7 +24033,7 @@ _08015ED2: lsls r1, r0, 3 subs r1, r0 lsls r1, 2 - ldr r4, =gUnknown_020229F0 + ldr r4, =gLinkPlayers + 8 adds r1, r4 adds r0, r5, 0 bl StringCopy @@ -25123,7 +25123,7 @@ sub_80168DC: @ 80168DC cmp r0, 0 beq _0801692C ldr r0, =gStringVar4 - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers adds r1, 0x2F ldrb r1, [r1] adds r2, r5, 0 @@ -26501,7 +26501,7 @@ sub_80173B0: @ 80173B0 thumb_func_start sub_80173D4 sub_80173D4: @ 80173D4 push {lr} - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r0} bx r0 thumb_func_end sub_80173D4 @@ -27828,10 +27828,10 @@ sub_8017E00: @ 8017E00 lsls r1, 24 lsrs r4, r1, 24 adds r6, r4, 0 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r3, r0, 24 - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers movs r0, 0x1 adds r1, r3, 0 eors r1, r0 @@ -28285,7 +28285,7 @@ sub_801818C: @ 801818C push {r4,lr} adds r4, r0, 0 bl sub_80173B0 - bl script_env_2_disable + bl ScriptContext2_Disable bl sub_8098524 ldr r1, =gUnknown_02022C2C movs r0, 0 @@ -28311,7 +28311,7 @@ _080181BC: thumb_func_start sub_80181CC sub_80181CC: @ 80181CC push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl sub_80983E8 pop {r0} bx r0 @@ -28369,7 +28369,7 @@ sub_8018220: @ 8018220 lsls r2, 24 lsrs r2, 24 str r2, [sp] - bl link_get_multiplayer_id + bl GetMultiplayerId movs r1, 0x1 eors r0, r1 lsls r0, 24 @@ -30557,7 +30557,7 @@ _080194B4: movs r0, 0xB strb r0, [r5, 0x8] ldr r0, =gStringVar1 - ldr r1, =gUnknown_020229F0 + ldr r1, =gLinkPlayers + 8 bl StringCopy b _08019922 .pool @@ -30670,7 +30670,7 @@ _0801959C: cmp r0, 0x1 bne _080195AA ldr r0, =gStringVar1 - ldr r1, =gUnknown_020229F0 + ldr r1, =gLinkPlayers + 8 bl StringCopy _080195AA: movs r0, 0xF @@ -31424,7 +31424,7 @@ sub_8019B3C: @ 8019B3C b _08019B9E .pool _08019B84: - bl script_env_2_is_enabled + bl ScriptContext2_IsEnabled lsls r0, 24 cmp r0, 0 bne _08019B96 @@ -33391,7 +33391,7 @@ _0801AAE4: adds r5, r4, r0 _0801AB0A: adds r0, r4, 0 - bl zero_pokemon_struct + bl ZeroMonData adds r4, 0x64 cmp r4, r5 ble _0801AB0A @@ -33411,8 +33411,8 @@ _0801AB1E: ble _0801AB1E movs r0, 0x32 bl IncrementGameStat - bl calc_player_party_count - ldr r0, =gUnknown_02038BCA + bl CalculatePlayerPartyCount + ldr r0, =gTrainerBattleOpponent_A movs r2, 0xC0 lsls r2, 4 adds r1, r2, 0 @@ -33783,7 +33783,7 @@ _0801AEA6: _0801AEE0: bl sub_800AC34 ldr r4, =gUnknown_020223C4 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 16 adds r0, r4 @@ -34149,7 +34149,7 @@ sub_801B1E8: @ 801B1E8 bl sub_801B330 bl sub_801B368 bl sub_801B9F8 - bl killram + bl ClearRamScript bl sub_809D4D8 bl sub_809D570 ldr r0, =gSaveBlock2Ptr @@ -39699,7 +39699,7 @@ sub_801DDD0: @ 801DDD0 strb r0, [r4, 0x1A] bl sub_8009FCC strb r0, [r4, 0xD] - bl link_get_multiplayer_id + bl GetMultiplayerId strb r0, [r4, 0x13] strb r5, [r4, 0x17] strb r5, [r4, 0x18] @@ -43761,7 +43761,7 @@ sub_801FDDC: @ 801FDDC str r4, [sp, 0x4] str r6, [sp, 0x8] movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r0, [r5] ldrb r0, [r0, 0x18] ldr r2, =gUnknown_085EAE66 @@ -43771,7 +43771,7 @@ sub_801FDDC: @ 801FDDC str r6, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r0, [r5] ldrb r0, [r0, 0x18] movs r1, 0x1 @@ -45508,7 +45508,7 @@ _08020CAC: lsls r0, 24 lsrs r0, 24 mov r8, r0 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r7, r0, 24 mov r0, r8 @@ -45893,7 +45893,7 @@ _08020FCC: lsls r1, r5, 3 subs r1, r5 lsls r1, 2 - ldr r2, =gUnknown_020229F0 + ldr r2, =gLinkPlayers + 8 adds r1, r2 bl StringCopy adds r0, r5, 0x1 @@ -48339,8 +48339,8 @@ _08022494: bl RemoveWindow adds r0, r4, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running - bl script_env_2_disable + bl EnableBothScriptContexts + bl ScriptContext2_Disable mov r0, r9 b _080224BE _080224BA: @@ -48362,7 +48362,7 @@ _080224C0: thumb_func_start sub_80224D0 sub_80224D0: @ 80224D0 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =sub_8022250 movs r1, 0 bl CreateTask @@ -52672,8 +52672,8 @@ SetBerryPowder: @ 802467C .pool thumb_func_end SetBerryPowder - thumb_func_start sub_8024690 -sub_8024690: @ 8024690 + thumb_func_start ApplyNewEncyprtionKeyToBerryPowder +ApplyNewEncyprtionKeyToBerryPowder: @ 8024690 push {lr} adds r1, r0, 0 ldr r0, =gSaveBlock2Ptr @@ -52681,11 +52681,11 @@ sub_8024690: @ 8024690 movs r2, 0xFA lsls r2, 1 adds r0, r2 - bl apply_u32_xor_crypto + bl ApplyNewEncyprtionKeyToWord pop {r0} bx r0 .pool - thumb_func_end sub_8024690 + thumb_func_end ApplyNewEncyprtionKeyToBerryPowder thumb_func_start sub_80246AC sub_80246AC: @ 80246AC @@ -52875,7 +52875,7 @@ sub_80247D4: @ 80247D4 movs r1, 0x1 mov r2, r9 mov r3, r8 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r3,r4} mov r8, r3 @@ -52917,7 +52917,7 @@ sub_802482C: @ 802482C adds r0, r6, 0 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow str r4, [sp] adds r0, r6, 0 mov r1, r8 @@ -52968,7 +52968,7 @@ sub_80248B0: @ 80248B0 movs r1, 0 movs r2, 0x1 movs r3, 0x1 - bl rbox_template_set + bl SetWindowTemplateFields ldr r4, =gUnknown_02022C94 add r0, sp, 0x10 bl AddWindow @@ -53038,7 +53038,7 @@ sub_802493C: @ 802493C bl sub_8024A30 ldr r0, [r4] str r5, [r0] - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r1, [r4] adds r1, 0x28 strb r0, [r1] @@ -53262,7 +53262,7 @@ _08024B2C: lsrs r5, r0, 24 cmp r5, 0xA bls _08024B2C - bl link_get_multiplayer_id + bl GetMultiplayerId movs r1, 0 lsls r0, 24 cmp r0, 0 @@ -53274,7 +53274,7 @@ _08024B6A: bl sub_8009FCC mov r1, r8 strb r0, [r1] - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r3, [sp, 0x18] strb r0, [r3] movs r5, 0x1 @@ -56002,7 +56002,7 @@ sub_80261F8: @ 80261F8 push {r4,lr} adds r4, r0, 0 adds r0, r1, 0 - bl sub_806EBA4 + bl IsMonShiny strb r0, [r4] pop {r4} pop {r0} @@ -58660,7 +58660,7 @@ _0802768C: lsls r0, r2, 3 subs r0, r2 lsls r0, 2 - ldr r1, =gUnknown_020229F0 + ldr r1, =gLinkPlayers + 8 _08027694: adds r0, r1 pop {r1} @@ -59368,7 +59368,7 @@ _08027BC8: bl RemoveWindow adds r0, r4, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _08027BE2: add sp, 0x8 pop {r4-r7} @@ -59432,7 +59432,7 @@ sub_8027BEC: @ 8027BEC adds r0, r7, 0 movs r1, 0x1 adds r2, r4, 0 - bl Print + bl PrintTextOnWindow movs r6, 0 ldr r2, =gStringVar1 mov r8, r2 @@ -59474,7 +59474,7 @@ _08027C76: adds r0, r7, 0 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r2, [sp, 0x18] lsls r3, r2, 3 subs r3, r5 @@ -59491,7 +59491,7 @@ _08027C76: adds r0, r7, 0 movs r1, 0x1 mov r2, r8 - bl Print + bl PrintTextOnWindow adds r6, 0x1 cmp r6, 0x2 ble _08027C76 @@ -59535,7 +59535,7 @@ _08027D48: lsls r0, r4, 3 subs r0, r4 lsls r0, 2 - ldr r1, =gUnknown_020229F0 + ldr r1, =gLinkPlayers + 8 adds r0, r1 lsls r1, r4, 2 adds r1, r5 @@ -60509,7 +60509,7 @@ _080284C6: thumb_func_start sub_80284CC sub_80284CC: @ 80284CC push {lr} - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r1, =gUnknown_02022C9C lsls r0, 24 lsrs r0, 22 @@ -60536,7 +60536,7 @@ sub_80284CC: @ 80284CC thumb_func_start sub_8028504 sub_8028504: @ 8028504 push {lr} - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r1, =gUnknown_02022C9C lsls r0, 24 lsrs r0, 22 @@ -60665,7 +60665,7 @@ _080285F0: strh r0, [r5, 0x2E] movs r4, 0 _080285FE: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 @@ -62582,7 +62582,7 @@ _080294DC: ldrb r0, [r0] movs r1, 0x11 bl FillWindowPixelBuffer - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -62870,8 +62870,8 @@ _08029774: str r3, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 - bl Print - bl link_get_multiplayer_id + bl PrintTextOnWindow + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -62926,7 +62926,7 @@ _080297CC: str r1, [sp, 0x8] movs r1, 0x1 add r2, sp, 0xC - bl Print + bl PrintTextOnWindow ldr r2, =gUnknown_02022CF8 ldr r0, [r2] add r0, r10 @@ -62941,7 +62941,7 @@ _080297CC: movs r1, 0x1 ldr r2, =gUnknown_085EDE5D lsrs r3, 24 - bl Print + bl PrintTextOnWindow adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @@ -63080,7 +63080,7 @@ _0802996C: movs r5, 0 str r5, [sp, 0x8] mov r2, r8 - bl Print + bl PrintTextOnWindow ldr r0, [r4] add r0, r9 ldrb r0, [r0] @@ -63091,7 +63091,7 @@ _0802996C: str r5, [sp, 0x8] movs r1, 0x1 movs r3, 0x44 - bl Print + bl PrintTextOnWindow mov r9, r5 ldr r0, [sp, 0xC] cmp r9, r0 @@ -63099,7 +63099,7 @@ _0802996C: b _08029B2A _080299E2: movs r4, 0 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 cmp r9, r0 @@ -63219,7 +63219,7 @@ _08029AE0: str r1, [sp, 0x8] movs r1, 0x1 ldr r2, =gStringVar4 - bl Print + bl PrintTextOnWindow _08029B10: adds r0, r7, 0x1 lsls r0, 24 @@ -63347,7 +63347,7 @@ _08029BFC: str r1, [sp, 0x8] movs r1, 0x1 adds r2, r6, 0 - bl Print + bl PrintTextOnWindow b _08029F88 .pool _08029C60: @@ -63513,7 +63513,7 @@ _08029DA0: str r6, [sp, 0x8] movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow bl sub_81AFBF0 bl sub_802762C lsls r0, 16 @@ -63539,7 +63539,7 @@ _08029DA0: movs r1, 0x1 adds r2, r7, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow bl sub_80279C8 lsls r0, 24 lsrs r4, r0, 24 @@ -63585,7 +63585,7 @@ _08029EA8: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow _08029EC8: ldr r4, =gUnknown_02022CF8 ldr r0, [r4] @@ -63819,7 +63819,7 @@ _0802A0CC: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, [r7] add r0, r10 ldrb r0, [r0] @@ -63831,7 +63831,7 @@ _0802A0CC: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r0, [r7] add r0, r10 ldrb r0, [r0] @@ -63844,7 +63844,7 @@ _0802A0CC: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r0, [r7] add r0, r10 ldrb r0, [r0] @@ -63856,7 +63856,7 @@ _0802A0CC: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, [r7] add r0, r8 ldrb r0, [r0] @@ -63923,7 +63923,7 @@ _0802A1DC: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r0, [r7] add r0, r8 ldrb r0, [r0] @@ -63936,7 +63936,7 @@ _0802A1DC: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r0, [r7] add r0, r8 ldrb r0, [r0] @@ -63953,7 +63953,7 @@ _0802A1DC: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, [r7] add r0, r8 ldrb r0, [r0] @@ -64243,7 +64243,7 @@ _0802A4AC: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, [r5] adds r0, r4 ldrb r0, [r0] @@ -64403,7 +64403,7 @@ _0802A610: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, [r6] adds r0, r4 ldrb r0, [r0] @@ -64840,7 +64840,7 @@ sub_802A9A8: @ 802A9A8 strh r1, [r0, 0x8] str r6, [r0] strb r4, [r0, 0x4] - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r1, [r5] strb r0, [r1, 0x6] ldr r0, [r5] @@ -64928,7 +64928,7 @@ sub_802AA94: @ 802AA94 strh r5, [r0] str r5, [r4, 0x1C] str r5, [r4, 0x5C] - bl link_get_multiplayer_id + bl GetMultiplayerId movs r1, 0 lsls r0, 24 cmp r0, 0 @@ -67368,7 +67368,7 @@ _0802BDFE: ldr r2, [sp] cmp r0, 0 beq _0802BE38 - ldr r1, =gUnknown_020229F0 + ldr r1, =gLinkPlayers + 8 add r1, r9 adds r0, r7, 0 bl StringCopy @@ -70279,7 +70279,7 @@ _0802D46A: str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, [r5] ldrb r0, [r0, 0x12] movs r1, 0x2 @@ -70363,7 +70363,7 @@ _0802D516: str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, [r5] ldrb r0, [r0, 0x12] movs r1, 0x2 @@ -70481,7 +70481,7 @@ _0802D606: str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, [r5] ldrb r0, [r0, 0x12] movs r1, 0x2 @@ -70561,7 +70561,7 @@ _0802D6AA: str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, [r5] ldrb r0, [r0, 0x12] movs r1, 0x2 @@ -70760,7 +70760,7 @@ sub_802D7E8: @ 802D7E8 str r1, [sp, 0x4] str r3, [sp, 0x8] movs r1, 0x1 - bl Print + bl PrintTextOnWindow ldr r0, [r5] ldrb r0, [r0, 0x12] movs r1, 0x2 @@ -70814,7 +70814,7 @@ sub_802D884: @ 802D884 str r5, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, [r4] ldrb r0, [r0, 0x12] movs r1, 0x2 @@ -70867,7 +70867,7 @@ sub_802D8FC: @ 802D8FC str r5, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, [r4] ldrb r0, [r0, 0x12] movs r1, 0x2 @@ -72365,7 +72365,7 @@ _0802E4DC: bl RemoveWindow adds r0, r4, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _0802E4F6: add sp, 0x8 pop {r4-r7} @@ -72425,7 +72425,7 @@ sub_802E500: @ 802E500 adds r0, r4, 0 movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow movs r6, 0 adds r7, r4, 0 movs r0, 0xFF @@ -72453,7 +72453,7 @@ _0802E58A: adds r0, r7, 0 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, [sp, 0x20] ldm r0!, {r1} str r0, [sp, 0x20] @@ -72480,7 +72480,7 @@ _0802E58A: adds r0, r7, 0 movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow movs r0, 0x80 lsls r0, 21 add r8, r0 @@ -73093,7 +73093,7 @@ sub_802EAB0: @ 802EAB0 ldrh r0, [r1, 0x4] strh r0, [r4, 0x16] _0802EAD8: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _0802EB1A diff --git a/asm/load_save.s b/asm/load_save.s index 589e001c1..2b4be8e67 100644 --- a/asm/load_save.s +++ b/asm/load_save.s @@ -5,97 +5,9 @@ .text - thumb_func_start CheckForFlashMemory -@ void CheckForFlashMemory() -CheckForFlashMemory: @ 8076B68 - push {lr} - bl IdentifyFlash - lsls r0, 16 - cmp r0, 0 - bne _08076B84 - ldr r1, =gFlashMemoryPresent - movs r0, 0x1 - str r0, [r1] - bl StartFlashMemoryTimer - b _08076B8A - .pool -_08076B84: - ldr r1, =gFlashMemoryPresent - movs r0, 0 - str r0, [r1] -_08076B8A: - pop {r0} - bx r0 - .pool - thumb_func_end CheckForFlashMemory - thumb_func_start ClearSav2 -ClearSav2: @ 8076B94 - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02024A54 - ldr r2, =0x010007d6 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end ClearSav2 - - thumb_func_start ClearSav1 -ClearSav1: @ 8076BB8 - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02025A00 - ldr r2, =0x01001f04 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end ClearSav1 - - thumb_func_start InitSaveBlockPointersWithRandomOffset -@ void InitSaveBlockPointersWithRandomOffset(u8 offset) -InitSaveBlockPointersWithRandomOffset: @ 8076BDC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r5, =gSaveBlock1Ptr - bl Random - adds r4, r0 - movs r0, 0x7C - ands r4, r0 - ldr r1, =gSaveBlock2Ptr - ldr r0, =gUnknown_02024A54 - adds r0, r4, r0 - str r0, [r1] - ldr r0, =gUnknown_02025A00 - adds r0, r4, r0 - str r0, [r5] - ldr r1, =gUnknown_03005D94 - ldr r0, =gUnknown_02029808 - adds r4, r0 - str r4, [r1] - bl SetBagItemsPointers - bl sub_81617F4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end InitSaveBlockPointersWithRandomOffset - - thumb_func_start saveblock_randomize_and_relocate -saveblock_randomize_and_relocate: @ 8076C2C + thumb_func_start MoveSaveBlocks_ResetHeap +MoveSaveBlocks_ResetHeap: @ 8076C2C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -126,7 +38,7 @@ saveblock_randomize_and_relocate: @ 8076C2C ldr r0, =0x02000f2c adds r2, r7, 0 bl memcpy - ldr r0, =gUnknown_03005D94 + ldr r0, =gPokemonStoragePtr mov r8, r0 ldr r1, [r0] ldr r0, =0x000083d0 @@ -141,7 +53,7 @@ saveblock_randomize_and_relocate: @ 8076C2C adds r1, r0 ldrb r0, [r4, 0xD] adds r0, r1 - bl InitSaveBlockPointersWithRandomOffset + bl SetSaveBlocksPointers ldr r1, =gSaveBlock2Ptr ldr r0, [r1] adds r1, r4, 0 @@ -173,7 +85,7 @@ saveblock_randomize_and_relocate: @ 8076C2C lsrs r0, 16 adds r4, r0 adds r0, r4, 0 - bl saveblock_apply_crypto + bl ApplyNewEncyprtionKeyToAllEncryptedData ldr r1, =gSaveBlock2Ptr ldr r0, [r1] adds r0, 0xAC @@ -187,7 +99,7 @@ saveblock_randomize_and_relocate: @ 8076C2C pop {r0} bx r0 .pool - thumb_func_end saveblock_randomize_and_relocate + thumb_func_end MoveSaveBlocks_ResetHeap thumb_func_start sav2_x1_query_bit1 sav2_x1_query_bit1: @ 8076D24 @@ -713,8 +625,8 @@ ApplyNewEncyprtionKeyToHword: @ 8077100 .pool thumb_func_end ApplyNewEncyprtionKeyToHword - thumb_func_start apply_u32_xor_crypto -apply_u32_xor_crypto: @ 8077118 + thumb_func_start ApplyNewEncyprtionKeyToWord +ApplyNewEncyprtionKeyToWord: @ 8077118 ldr r2, =gSaveBlock2Ptr ldr r3, [r2] adds r3, 0xAC @@ -725,24 +637,24 @@ apply_u32_xor_crypto: @ 8077118 str r2, [r0] bx lr .pool - thumb_func_end apply_u32_xor_crypto + thumb_func_end ApplyNewEncyprtionKeyToWord - thumb_func_start saveblock_apply_crypto -saveblock_apply_crypto: @ 8077130 + thumb_func_start ApplyNewEncyprtionKeyToAllEncryptedData +ApplyNewEncyprtionKeyToAllEncryptedData: @ 8077130 push {r4,r5,lr} adds r4, r0, 0 - bl sub_8084864 + bl ApplyNewEncyprtionKeyToGameStats adds r0, r4, 0 bl ApplyNewEncyprtionKeyToBagItems_ adds r0, r4, 0 - bl sub_8024690 + bl ApplyNewEncyprtionKeyToBerryPowder ldr r5, =gSaveBlock1Ptr ldr r0, [r5] movs r1, 0x92 lsls r1, 3 adds r0, r1 adds r1, r4, 0 - bl apply_u32_xor_crypto + bl ApplyNewEncyprtionKeyToWord ldr r0, [r5] ldr r1, =0x00000494 adds r0, r1 @@ -752,6 +664,6 @@ saveblock_apply_crypto: @ 8077130 pop {r0} bx r0 .pool - thumb_func_end saveblock_apply_crypto + thumb_func_end ApplyNewEncyprtionKeyToAllEncryptedData .align 2, 0 @ Don't pad with nop. diff --git a/asm/lottery_corner.s b/asm/lottery_corner.s deleted file mode 100644 index fff59640f..000000000 --- a/asm/lottery_corner.s +++ /dev/null @@ -1,381 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start ResetLotteryCorner -ResetLotteryCorner: @ 8177558 - push {r4,lr} - bl Random - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl Random - lsls r0, 16 - orrs r0, r4 - bl sub_8177814 - ldr r0, =0x00004045 - movs r1, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ResetLotteryCorner - - thumb_func_start sub_8177584 -sub_8177584: @ 8177584 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl Random - lsls r0, 16 - lsrs r1, r0, 16 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _081775B4 - ldr r5, =0x41c64e6d - ldr r3, =0x00003039 - adds r2, r0, 0 -_081775A4: - adds r0, r1, 0 - muls r0, r5 - adds r1, r0, r3 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r2 - bne _081775A4 -_081775B4: - adds r0, r1, 0 - bl sub_8177814 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177584 - - thumb_func_start sub_81775CC -sub_81775CC: @ 81775CC - push {lr} - bl sub_817783C - ldr r1, =gScriptResult - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81775CC - - thumb_func_start sub_81775E0 -sub_81775E0: @ 81775E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r1, =gSpecialVar_0x8004 - movs r0, 0 - strh r0, [r1] - movs r0, 0 - str r0, [sp, 0x4] - movs r1, 0 - str r1, [sp] - movs r7, 0 -_081775FC: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _08177658 - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _0817764E - adds r0, r4, 0 - movs r1, 0x1 - bl GetMonData - adds r1, r0, 0 - ldr r0, =gScriptResult - ldrh r0, [r0] - lsls r1, 16 - lsrs r1, 16 - bl sub_817778C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSpecialVar_0x8004 - ldrh r2, [r1] - cmp r0, r2 - bls _0817764E - cmp r0, 0x1 - bls _0817764E - subs r0, 0x1 - strh r0, [r1] - movs r0, 0xE - str r0, [sp] - str r7, [sp, 0x4] -_0817764E: - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x5 - bls _081775FC -_08177658: - movs r7, 0 - ldr r1, =gUnknown_03005D94 - mov r9, r1 -_0817765E: - movs r6, 0 - adds r2, r7, 0x1 - mov r10, r2 - lsls r0, r7, 2 - adds r0, r7 - mov r8, r0 -_0817766A: - mov r1, r8 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 5 - adds r5, r0, 0x4 - mov r2, r9 - ldr r0, [r2] - adds r0, r5 - lsls r1, r6, 2 - adds r1, r6 - lsls r4, r1, 4 - adds r0, r4 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _081776D2 - mov r1, r9 - ldr r0, [r1] - adds r0, r5 - adds r0, r4 - movs r1, 0x2D - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _081776D2 - mov r2, r9 - ldr r0, [r2] - adds r0, r5 - adds r0, r4 - movs r1, 0x1 - bl pokemon_getattr_encrypted - adds r1, r0, 0 - ldr r0, =gScriptResult - ldrh r0, [r0] - lsls r1, 16 - lsrs r1, 16 - bl sub_817778C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSpecialVar_0x8004 - ldrh r2, [r1] - cmp r0, r2 - bls _081776D2 - cmp r0, 0x1 - bls _081776D2 - subs r0, 0x1 - strh r0, [r1] - str r7, [sp] - str r6, [sp, 0x4] -_081776D2: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x1D - bls _0817766A - mov r1, r10 - lsls r0, r1, 16 - lsrs r7, r0, 16 - cmp r7, 0xD - bls _0817765E - ldr r3, =gSpecialVar_0x8004 - ldrh r0, [r3] - cmp r0, 0 - beq _0817776E - ldr r2, =gSpecialVar_0x8005 - ldr r1, =gUnknown_085E7080 - subs r0, 0x1 - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - ldr r2, [sp] - cmp r2, 0xE - bne _0817773C - ldr r1, =gSpecialVar_0x8006 - movs r0, 0 - strh r0, [r1] - movs r0, 0x64 - ldr r1, [sp, 0x4] - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r2, =gStringVar1 - movs r1, 0x2 - bl GetMonData - b _08177768 - .pool -_0817773C: - ldr r1, =gSpecialVar_0x8006 - movs r0, 0x1 - strh r0, [r1] - ldr r2, =gUnknown_03005D94 - ldr r1, [sp] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - adds r1, 0x4 - ldr r0, [r2] - adds r0, r1 - ldr r2, [sp, 0x4] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 4 - adds r0, r1 - ldr r2, =gStringVar1 - movs r1, 0x2 - bl pokemon_getattr_encrypted -_08177768: - ldr r0, =gStringVar1 - bl StringGetEnd10 -_0817776E: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81775E0 - - thumb_func_start sub_817778C -sub_817778C: @ 817778C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r5, r1, 16 - movs r0, 0 - mov r8, r0 - movs r7, 0 - ldr r1, =gUnknown_0203BCEC - mov r10, r1 - ldr r0, =gUnknown_0203BCEE - mov r9, r0 -_081777AC: - adds r0, r6, 0 - movs r1, 0xA - bl __umodsi3 - adds r4, r0, 0 - mov r1, r10 - strh r4, [r1] - adds r0, r5, 0 - movs r1, 0xA - bl __umodsi3 - mov r1, r9 - strh r0, [r1] - lsls r4, 16 - lsls r0, 16 - cmp r4, r0 - bne _081777FA - adds r0, r6, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r5, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x4 - bls _081777AC -_081777FA: - mov r0, r8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817778C - - thumb_func_start sub_8177814 -sub_8177814: @ 8177814 - push {r4,lr} - adds r1, r0, 0 - lsrs r4, r1, 16 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x0000404b - bl VarSet - ldr r0, =0x0000404c - adds r1, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177814 - - thumb_func_start sub_817783C -sub_817783C: @ 817783C - push {r4,lr} - ldr r0, =0x0000404b - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x0000404c - bl VarGet - lsls r0, 16 - orrs r0, r4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817783C - - thumb_func_start sub_8177864 -sub_8177864: @ 8177864 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_8177814 - pop {r0} - bx r0 - thumb_func_end sub_8177864 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/main_menu.s b/asm/main_menu.s index 24923524b..0fa716115 100644 --- a/asm/main_menu.s +++ b/asm/main_menu.s @@ -4509,7 +4509,7 @@ CreateMainMenuErrorWindow: @ 8031E18 movs r1, 0x1 adds r2, r4, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0x7 bl PutWindowTilemap movs r0, 0x7 diff --git a/asm/mauville_old_man.s b/asm/mauville_old_man.s index e0b987f26..05d15601c 100644 --- a/asm/mauville_old_man.s +++ b/asm/mauville_old_man.s @@ -339,7 +339,7 @@ sub_8120340: @ 8120340 ldr r0, =gSpecialVar_0x8004 ldrb r0, [r0] bl sub_81206C0 - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop pop {r0} bx r0 .pool @@ -810,7 +810,7 @@ sub_8120708: @ 8120708 movs r1, 0x1 adds r2, r5, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, =gUnknown_03002F84 strb r4, [r0] movs r0, 0 @@ -1231,7 +1231,7 @@ _08120A7E: ldr r0, =gMPlay_SE2 movs r1, 0x2 bl m4aMPlayFadeOutTemporarily - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r6, 0 bl DestroyTask b _08120B50 @@ -2292,7 +2292,7 @@ _08121272: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow movs r0, 0x80 lsls r0, 21 adds r5, r0 @@ -2321,7 +2321,7 @@ _081212AA: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldrb r4, [r5] bl sub_8120ED8 adds r1, r0, 0 @@ -2398,7 +2398,7 @@ _08121364: bl sub_80E2A78 adds r0, r6, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _08121376: pop {r4-r6} pop {r0} diff --git a/asm/menu_helpers.s b/asm/menu_helpers.s index f01fc8569..acc3065ea 100644 --- a/asm/menu_helpers.s +++ b/asm/menu_helpers.s @@ -587,8 +587,8 @@ _08122208: bx r1 thumb_func_end sub_81221EC - thumb_func_start atk2D_jumpifarraynotequal -atk2D_jumpifarraynotequal: @ 812220C + thumb_func_start sub_812220C +sub_812220C: @ 812220C push {r4-r6,lr} adds r6, r2, 0 ldr r2, [sp, 0x10] @@ -633,7 +633,7 @@ _08122254: pop {r4-r6} pop {r0} bx r0 - thumb_func_end atk2D_jumpifarraynotequal + thumb_func_end sub_812220C thumb_func_start sub_812225C sub_812225C: @ 812225C diff --git a/asm/money.s b/asm/money.s index 41f2b2532..0d7cf569f 100644 --- a/asm/money.s +++ b/asm/money.s @@ -5,100 +5,9 @@ .text - thumb_func_start DecryptMoney -@ int DecryptMoney(u32 *moneyPointer) -DecryptMoney: @ 80E5114 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - adds r1, 0xAC - ldr r0, [r0] - ldr r1, [r1] - eors r0, r1 - bx lr - .pool - thumb_func_end DecryptMoney - thumb_func_start SetMoney -@ void SetMoney(u32 *moneyPointer, u32 moneyAmount) -SetMoney: @ 80E5128 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - adds r2, 0xAC - ldr r2, [r2] - eors r2, r1 - str r2, [r0] - bx lr - .pool - thumb_func_end SetMoney - thumb_func_start IsEnoughMoney -@ bool8 IsEnoughMoney(u32 *moneyPointer, u32 price) -IsEnoughMoney: @ 80E513C - push {r4,lr} - adds r4, r1, 0 - bl DecryptMoney - cmp r0, r4 - bcs _080E514C - movs r0, 0 - b _080E514E -_080E514C: - movs r0, 0x1 -_080E514E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end IsEnoughMoney - thumb_func_start add_money -@ void add_money(int *money_ptr, int amount) -add_money: @ 80E5154 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - bl DecryptMoney - adds r5, r0, 0 - adds r0, r5, r4 - ldr r5, =0x000f423f - adds r4, r5, 0 - cmp r0, r5 - bhi _080E5178 - adds r5, r0, 0 - adds r0, r6, 0 - bl DecryptMoney - cmp r5, r0 - bcs _080E5178 - adds r5, r4, 0 -_080E5178: - adds r0, r6, 0 - adds r1, r5, 0 - bl SetMoney - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end add_money - - thumb_func_start subtract_money -@ void subtract_money(int *money_ptr, int amount) -subtract_money: @ 80E518C - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - bl DecryptMoney - adds r1, r0, 0 - cmp r1, r4 - bcs _080E51A0 - movs r1, 0 - b _080E51A2 -_080E51A0: - subs r1, r4 -_080E51A2: - adds r0, r5, 0 - bl SetMoney - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end subtract_money thumb_func_start sub_80E51B0 sub_80E51B0: @ 80E51B0 @@ -128,7 +37,7 @@ sub_80E51D4: @ 80E51D4 adds r0, r1 ldr r1, =gSpecialVar_0x8005 ldrh r1, [r1] - bl subtract_money + bl SubtractMoney pop {r0} bx r0 .pool @@ -207,7 +116,7 @@ _080E5264: adds r0, r7, 0 movs r1, 0x1 mov r3, r8 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r3} mov r8, r3 @@ -293,7 +202,7 @@ sub_80E52EC: @ 80E52EC add r0, sp, 0x10 movs r1, 0 adds r2, r4, 0 - bl rbox_template_set + bl SetWindowTemplateFields ldr r4, =gUnknown_02039F98 add r0, sp, 0x10 bl AddWindow diff --git a/asm/mystery_event_menu.s b/asm/mystery_event_menu.s index 003fa80f5..27ab158ad 100644 --- a/asm/mystery_event_menu.s +++ b/asm/mystery_event_menu.s @@ -19,7 +19,7 @@ sub_8178944: @ 8178944 sub_8178958: @ 8178958 push {lr} movs r2, 0 - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers ldrh r0, [r1, 0x1A] ldrh r1, [r1, 0x36] cmp r0, r1 diff --git a/asm/mystery_event_script.s b/asm/mystery_event_script.s index 389b8146a..07c940f58 100644 --- a/asm/mystery_event_script.s +++ b/asm/mystery_event_script.s @@ -59,10 +59,10 @@ sub_8153820: @ 8153820 adds r5, r1, 0 ldr r1, =gUnknown_082DED2C ldr r2, =gUnknown_082DED2C + 0x44 - bl script_env_init + bl InitScriptContext adds r0, r4, 0 adds r1, r5, 0 - bl script_setup_bytecode_script + bl SetupBytecodeScript str r5, [r4, 0x64] movs r0, 0 str r0, [r4, 0x68] @@ -78,7 +78,7 @@ sub_8153820: @ 8153820 sub_8153850: @ 8153850 push {r4,lr} adds r4, r0, 0 - bl script_main_handler + bl RunScriptCommand lsls r0, 24 cmp r0, 0 beq _08153868 @@ -317,7 +317,7 @@ _08153A1A: thumb_func_start script_status_stop_and_ret_1 script_status_stop_and_ret_1: @ 8153A24 push {lr} - bl script_stop + bl StopScript movs r0, 0x1 pop {r1} bx r1 @@ -327,23 +327,23 @@ script_status_stop_and_ret_1: @ 8153A24 sub_8153A30: @ 8153A30 push {r4-r7,lr} adds r7, r0, 0 - bl script_read_word + bl ScriptReadWord str r0, [r7, 0x68] adds r0, r7, 0 - bl script_read_halfword + bl ScriptReadHalfword adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r7, 0 - bl script_read_word + bl ScriptReadWord adds r6, r0, 0 adds r0, r7, 0 - bl script_read_halfword + bl ScriptReadHalfword adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r7, 0 - bl script_read_word + bl ScriptReadWord adds r3, r0, 0 adds r0, r5, 0 adds r1, r6, 0 @@ -388,7 +388,7 @@ sub_8153A94: @ 8153A94 adds r0, 0x1 str r0, [r4, 0x8] adds r0, r4, 0 - bl script_read_word + bl ScriptReadWord ldr r1, [r4, 0x68] subs r0, r1 ldr r1, [r4, 0x64] @@ -413,7 +413,7 @@ _08153ABE: sub_8153ACC: @ 8153ACC push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord ldr r1, [r4, 0x68] subs r0, r1 ldr r1, [r4, 0x64] @@ -435,7 +435,7 @@ sub_8153AE8: @ 8153AE8 bl sub_80E162C mov r8, r0 adds r0, r7, 0 - bl script_read_word + bl ScriptReadWord adds r4, r0, 0 ldr r0, [r7, 0x68] subs r4, r0 @@ -513,7 +513,7 @@ sub_8153BB0: @ 8153BB0 ldrb r1, [r2] adds r2, 0x1 str r2, [r4, 0x8] - bl sub_80F9B30 + bl GiveGiftRibbonToParty ldr r0, =gStringVar4 ldr r1, =gUnknown_08674B6A bl StringExpandPlaceholders @@ -547,14 +547,14 @@ sub_8153BE4: @ 8153BE4 adds r1, 0x1 str r1, [r4, 0x8] adds r0, r4, 0 - bl script_read_word + bl ScriptReadWord adds r5, r0, 0 ldr r0, [r4, 0x68] subs r5, r0 ldr r0, [r4, 0x64] adds r5, r0 adds r0, r4, 0 - bl script_read_word + bl ScriptReadWord adds r1, r0, 0 ldr r0, [r4, 0x68] subs r1, r0 @@ -567,7 +567,7 @@ sub_8153BE4: @ 8153BE4 adds r0, r5, 0 mov r2, r9 mov r3, r8 - bl sub_80990FC + bl InitRamScript movs r0, 0 add sp, 0x4 pop {r3,r4} @@ -626,7 +626,7 @@ sub_8153C9C: @ 8153C9C ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword adds r2, r0, 0 lsls r2, 16 lsrs r2, 16 @@ -646,7 +646,7 @@ sub_8153CC8: @ 8153CC8 push {r7} sub sp, 0x88 adds r6, r0, 0 - bl script_read_word + bl ScriptReadWord ldr r1, [r6, 0x68] subs r0, r1 ldr r1, [r6, 0x64] @@ -691,7 +691,7 @@ _08153D22: b _08153DB6 .pool _08153D4C: - ldr r7, =gUnknown_020246E0 + ldr r7, =gPlayerParty + 500 adds r0, r7, 0 adds r1, r5, 0 movs r2, 0x64 @@ -730,7 +730,7 @@ _08153D86: bl sub_80D460C _08153DA4: bl party_compaction - bl calc_player_party_count + bl CalculatePlayerPartyCount ldr r0, =gStringVar4 ldr r1, =gUnknown_08674BF0 bl StringExpandPlaceholders @@ -751,7 +751,7 @@ _08153DB6: sub_8153DD4: @ 8153DD4 push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord adds r1, r0, 0 ldr r0, [r4, 0x68] subs r1, r0 @@ -797,17 +797,17 @@ sub_8153E1C: @ 8153E1C sub_8153E40: @ 8153E40 push {r4-r6,lr} adds r6, r0, 0 - bl script_read_word + bl ScriptReadWord adds r5, r0, 0 adds r0, r6, 0 - bl script_read_word + bl ScriptReadWord adds r4, r0, 0 ldr r0, [r6, 0x68] subs r4, r0 ldr r0, [r6, 0x64] adds r4, r0 adds r0, r6, 0 - bl script_read_word + bl ScriptReadWord adds r1, r0, 0 ldr r0, [r6, 0x68] subs r1, r0 @@ -833,17 +833,17 @@ _08153E7E: sub_8153E88: @ 8153E88 push {r4-r6,lr} adds r6, r0, 0 - bl script_read_word + bl ScriptReadWord adds r5, r0, 0 adds r0, r6, 0 - bl script_read_word + bl ScriptReadWord adds r4, r0, 0 ldr r0, [r6, 0x68] subs r4, r0 ldr r0, [r6, 0x64] adds r4, r0 adds r0, r6, 0 - bl script_read_word + bl ScriptReadWord adds r1, r0, 0 ldr r0, [r6, 0x68] subs r1, r0 diff --git a/asm/naming_screen.s b/asm/naming_screen.s index b385fc444..d67f1425d 100644 --- a/asm/naming_screen.s +++ b/asm/naming_screen.s @@ -730,7 +730,7 @@ pokemon_store: @ 80E33D8 ldrb r0, [r0] cmp r0, 0x2 bne _080E342C - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x5 @@ -3276,7 +3276,7 @@ sub_80E4894: @ 80E4894 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r0, [r5] adds r0, r4 ldrb r0, [r0] @@ -3328,7 +3328,7 @@ sub_80E48E8: @ 80E48E8 movs r1, 0x1 add r2, sp, 0xC movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r0, [r5] adds r0, r4 ldrb r0, [r0] @@ -3865,7 +3865,7 @@ _080E4D76: str r1, [sp, 0x8] movs r1, 0x1 add r2, sp, 0xC - bl Print + bl PrintTextOnWindow adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 diff --git a/asm/new_game.s b/asm/new_game.s deleted file mode 100644 index 5a13e5f3e..000000000 --- a/asm/new_game.s +++ /dev/null @@ -1,142 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - - - thumb_func_start NewGameInitData -@ void NewGameInitData() -NewGameInitData: @ 80844A0 - push {r4,r5,lr} - ldr r0, =gSaveFileStatus - ldrh r0, [r0] - cmp r0, 0 - beq _080844AE - cmp r0, 0x2 - bne _080844B2 -_080844AE: - bl RtcReset -_080844B2: - ldr r1, =gDifferentSaveFile - movs r0, 0x1 - strb r0, [r1] - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - adds r0, 0xAC - movs r5, 0 - str r5, [r0] - bl ZeroPlayerPartyMons - bl ZeroEnemyPartyMons - bl ResetPokedex - bl sub_8084400 - bl ClearSav1 - bl ClearMailData - ldr r0, [r4] - strb r5, [r0, 0x9] - ldr r0, [r4] - adds r0, 0xA8 - str r5, [r0] - bl InitPlayerTrainerId - bl PlayTimeCounter_Reset - bl ClearPokedexFlags - bl InitEventData - bl ClearTVShowData - bl ResetGabbyAndTy - bl ResetSecretBases - bl ClearBerryTrees - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - ldr r1, =0x00000bb8 - bl SetMoney - movs r0, 0 - bl SetCoins - bl ResetLinkContestBoolean - bl ResetGameStats - bl ClearAllContestWinnerPics - bl InitLinkBattleRecords - bl InitSeedotSizeRecord - bl InitLotadSizeRecord - ldr r0, =gPlayerPartyCount - strb r5, [r0] - bl ZeroPlayerPartyMons - bl ResetPokemonStorageSystem - bl ClearRoamerData - bl ClearRoamerLocationData - ldr r0, [r4] - ldr r1, =0x00000496 - adds r0, r1 - strh r5, [r0] - bl ClearBag - bl NewGameInitPCItems - bl ClearPokeblocks - bl ClearDecorationInventories - bl InitEasyChatPhrases - bl SetMauvilleOldMan - bl InitDewfordTrend - bl ResetFanClub - bl ResetLotteryCorner - bl WarpToTruck - ldr r0, =gUnknown_082715DE - bl ScriptContext2_RunNewScript - bl ResetMiniGamesResults - bl copy_strings_to_sav1 - bl SetLilycoveLady - bl sub_819FAA0 - bl sub_81A4B14 - bl sub_8195E10 - bl sub_801AFD8 - bl sub_800E5AC - bl sub_81D54BC - bl ResetContestLinkResults - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end NewGameInitData - - thumb_func_start ResetMiniGamesResults -ResetMiniGamesResults: @ 80845CC - push {r4-r6,lr} - sub sp, 0x4 - mov r0, sp - movs r5, 0 - strh r5, [r0] - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - movs r0, 0xF6 - lsls r0, 1 - adds r1, r0 - ldr r6, =0x01000008 - mov r0, sp - adds r2, r6, 0 - bl CpuSet - ldr r0, [r4] - movs r1, 0xFA - lsls r1, 1 - adds r0, r1 - movs r1, 0 - bl SetBerryPowder - bl ResetPokeJumpResults - mov r0, sp - adds r0, 0x2 - strh r5, [r0] - ldr r1, [r4] - movs r2, 0x83 - lsls r2, 2 - adds r1, r2 - adds r2, r6, 0 - bl CpuSet - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ResetMiniGamesResults - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/option_menu.s b/asm/option_menu.s index cc6acc5ac..214e23094 100644 --- a/asm/option_menu.s +++ b/asm/option_menu.s @@ -833,7 +833,7 @@ _080BABAE: movs r1, 0x1 add r2, sp, 0xC adds r3, r6, 0 - bl Print + bl PrintTextOnWindow add sp, 0x1C pop {r4-r6} pop {r0} @@ -1470,7 +1470,7 @@ sub_80BB0D0: @ 80BB0D0 str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -1505,7 +1505,7 @@ _080BB114: movs r0, 0x1 movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 diff --git a/asm/player_pc.s b/asm/player_pc.s index dc76f8138..92b8d46c9 100644 --- a/asm/player_pc.s +++ b/asm/player_pc.s @@ -380,16 +380,16 @@ sub_816B148: @ 816B148 cmp r0, 0 bne _0816B174 ldr r0, =gUnknown_081F863F - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _0816B184 .pool _0816B174: ldr r0, =gUnknown_081F958F - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _0816B184 .pool _0816B180: - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _0816B184: adds r0, r4, 0 bl DestroyTask @@ -472,7 +472,7 @@ sub_816B21C: @ 816B21C movs r1, 0x1 adds r2, r4, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r4} pop {r0} @@ -966,7 +966,7 @@ sub_816B5F8: @ 816B5F8 adds r0, r4, 0 movs r1, 0x1 adds r2, r6, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 bl schedule_bg_copy_tilemap_to_vram ldr r4, =gUnknown_0203BCB8 @@ -1484,7 +1484,7 @@ sub_816BABC: @ 816BABC push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 cmp r0, 0 bne _0816BAD4 @@ -1968,7 +1968,7 @@ _0816BE8E: adds r0, r6, 0 movs r1, 0x7 adds r2, r4, 0 - bl Print + bl PrintTextOnWindow _0816BED4: add sp, 0xC pop {r4-r6} @@ -2019,7 +2019,7 @@ _0816BF32: movs r1, 0x1 adds r2, r4, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r4,r5} pop {r0} @@ -2252,7 +2252,7 @@ sub_816C110: @ 816C110 movs r1, 0x8 str r1, [sp] movs r1, 0x32 - bl atk2D_jumpifarraynotequal + bl sub_812220C add sp, 0x4 pop {r0} bx r0 @@ -2317,7 +2317,7 @@ _0816C186: str r1, [sp, 0x8] movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow ldr r0, [r4] ldr r1, =0x00000662 adds r0, r1 @@ -2448,7 +2448,7 @@ sub_816C2C0: @ 816C2C0 movs r1, 0x1 adds r2, r4, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r4-r6} pop {r0} @@ -2909,7 +2909,7 @@ sub_816C6BC: @ 816C6BC adds r0, r6, 0 movs r1, 0x1 adds r2, r4, 0 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r4-r6} pop {r0} diff --git a/asm/pokedex.s b/asm/pokedex.s index 14deef48d..c24701b76 100644 --- a/asm/pokedex.s +++ b/asm/pokedex.s @@ -9377,8 +9377,8 @@ sub_80C0620: @ 80C0620 .pool thumb_func_end sub_80C0620 - thumb_func_start sub_80C0630 -sub_80C0630: @ 80C0630 + thumb_func_start GetPokedexHeightWeight +GetPokedexHeightWeight: @ 80C0630 push {lr} lsls r0, 16 lsrs r2, r0, 16 @@ -9406,7 +9406,7 @@ _080C065C: pop {r1} bx r1 .pool - thumb_func_end sub_80C0630 + thumb_func_end GetPokedexHeightWeight thumb_func_start pokedex_flag_operation @ u8 pokedex_flag_operation(u16 nationalPokedexNum, u8 op) diff --git a/asm/pokedex_area_screen.s b/asm/pokedex_area_screen.s index 7cb1f37c9..b599b365c 100644 --- a/asm/pokedex_area_screen.s +++ b/asm/pokedex_area_screen.s @@ -304,7 +304,7 @@ _0813CCB8: adds r0, 0x10 adds r1, r2, 0 adds r1, 0x11 - bl sub_8161F64 + bl GetRoamerLocation ldr r1, [r5] ldrb r0, [r1, 0x10] ldrb r1, [r1, 0x11] diff --git a/asm/pokemon_1.s b/asm/pokemon_1.s index e10ed54c5..45a863c67 100644 --- a/asm/pokemon_1.s +++ b/asm/pokemon_1.s @@ -5,1069 +5,8 @@ .text - thumb_func_start zero_pokemon_boxed_data -@ void zero_pokemon_boxed_data(pokemon *mon) -zero_pokemon_boxed_data: @ 8067A74 - push {lr} - adds r2, r0, 0 - movs r1, 0 - movs r3, 0 -_08067A7C: - adds r0, r2, r1 - strb r3, [r0] - adds r1, 0x1 - cmp r1, 0x4F - bls _08067A7C - pop {r0} - bx r0 - thumb_func_end zero_pokemon_boxed_data - thumb_func_start zero_pokemon_struct -@ void zero_pokemon_struct(pokemon *mon) -zero_pokemon_struct: @ 8067A8C - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - bl zero_pokemon_boxed_data - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x37 - mov r2, sp - bl SetMonData - adds r0, r4, 0 - movs r1, 0x38 - mov r2, sp - bl SetMonData - adds r0, r4, 0 - movs r1, 0x39 - mov r2, sp - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3A - mov r2, sp - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3B - mov r2, sp - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3C - mov r2, sp - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3D - mov r2, sp - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3E - mov r2, sp - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3F - mov r2, sp - bl SetMonData - movs r0, 0xFF - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x40 - mov r2, sp - bl SetMonData - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end zero_pokemon_struct - thumb_func_start ZeroPlayerPartyMons -@ void ZeroPlayerPartyMons() -ZeroPlayerPartyMons: @ 8067B0C - push {r4,r5,lr} - ldr r4, =gPlayerParty - movs r0, 0xFA - lsls r0, 1 - adds r5, r4, r0 -_08067B16: - adds r0, r4, 0 - bl zero_pokemon_struct - adds r4, 0x64 - cmp r4, r5 - ble _08067B16 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ZeroPlayerPartyMons - - thumb_func_start ZeroEnemyPartyMons -ZeroEnemyPartyMons: @ 8067B2C - push {r4,r5,lr} - ldr r4, =gEnemyParty - movs r0, 0xFA - lsls r0, 1 - adds r5, r4, r0 -_08067B36: - adds r0, r4, 0 - bl zero_pokemon_struct - adds r4, 0x64 - cmp r4, r5 - ble _08067B36 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ZeroEnemyPartyMons - - thumb_func_start create_pokemon_set_level -@ void create_pokemon_set_level(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) -create_pokemon_set_level: @ 8067B4C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x1C - mov r8, r0 - adds r6, r1, 0 - ldr r4, [sp, 0x34] - ldr r7, [sp, 0x38] - ldr r5, [sp, 0x3C] - lsls r6, 16 - lsrs r6, 16 - add r0, sp, 0x10 - strb r2, [r0] - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - mov r0, r8 - str r3, [sp, 0x18] - bl zero_pokemon_struct - str r4, [sp] - str r7, [sp, 0x4] - str r5, [sp, 0x8] - ldr r0, [sp, 0x40] - str r0, [sp, 0xC] - mov r0, r8 - adds r1, r6, 0 - add r2, sp, 0x10 - ldrb r2, [r2] - ldr r3, [sp, 0x18] - bl create_pokemon - mov r0, r8 - movs r1, 0x38 - add r2, sp, 0x10 - bl SetMonData - movs r0, 0xFF - str r0, [sp, 0x14] - add r2, sp, 0x14 - mov r0, r8 - movs r1, 0x40 - bl SetMonData - mov r0, r8 - bl pokemon_calc_effective_stats - add sp, 0x1C - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end create_pokemon_set_level - - thumb_func_start create_pokemon -@ void create_pokemon(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) -create_pokemon: @ 8067BBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r7, r0, 0 - ldr r4, [sp, 0x40] - ldr r0, [sp, 0x48] - movs r5, 0xE - add r5, sp - strh r1, [r5] - add r6, sp, 0x10 - strb r2, [r6] - mov r5, sp - adds r5, 0x11 - strb r3, [r5] - lsls r4, 24 - lsrs r4, 24 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - adds r0, r7, 0 - bl zero_pokemon_boxed_data - cmp r4, 0 - beq _08067BF8 - ldr r0, [sp, 0x44] - str r0, [sp, 0x14] - b _08067C0C -_08067BF8: - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x14] -_08067C0C: - add r2, sp, 0x14 - adds r0, r7, 0 - movs r1, 0 - bl SetMonData_encrypted - add r0, sp, 0x18 - mov r9, r0 - add r5, sp, 0xC - mov r1, r10 - cmp r1, 0x2 - bne _08067C64 - ldr r2, =0xffff0000 - mov r8, r2 - ldr r6, =0x0000ffff -_08067C28: - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x18] - adds r1, r4, 0 - mov r3, r8 - ands r1, r3 - lsrs r1, 16 - ands r4, r6 - eors r1, r4 - ldr r2, [sp, 0x14] - adds r0, r2, 0 - ands r0, r3 - lsrs r0, 16 - eors r1, r0 - ands r2, r6 - eors r1, r2 - cmp r1, 0x7 - bls _08067C28 - b _08067C8A - .pool -_08067C64: - mov r0, r10 - cmp r0, 0x1 - bne _08067C70 - ldr r0, [sp, 0x4C] - str r0, [sp, 0x18] - b _08067C8A -_08067C70: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0xA] - ldrb r0, [r2, 0xB] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0xC] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0xD] - lsls r0, 24 - orrs r1, r0 - str r1, [sp, 0x18] -_08067C8A: - adds r0, r7, 0 - movs r1, 0x1 - mov r2, r9 - bl SetMonData_encrypted - adds r0, r7, 0 - bl pokemon_calc_checksum - strh r0, [r5] - adds r0, r7, 0 - movs r1, 0x9 - adds r2, r5, 0 - bl SetMonData_encrypted - adds r0, r7, 0 - bl pokemon_encrypt - mov r0, sp - ldrh r1, [r0, 0xE] - bl GetSpeciesName - adds r0, r7, 0 - movs r1, 0x2 - mov r2, sp - bl SetMonData_encrypted - ldr r2, =gGameLanguage - adds r0, r7, 0 - movs r1, 0x3 - bl SetMonData_encrypted - ldr r5, =gSaveBlock2Ptr - ldr r2, [r5] - adds r0, r7, 0 - movs r1, 0x7 - bl SetMonData_encrypted - adds r0, r7, 0 - movs r1, 0xB - mov r2, sp - adds r2, 0xE - bl SetMonData_encrypted - ldr r4, =gBaseStats - mov r2, sp - ldrh r1, [r2, 0xE] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - adds r2, r1, 0 - muls r2, r0 - mov r3, sp - ldrb r0, [r3, 0x10] - lsls r0, 2 - ldr r1, =gExperienceTables - adds r0, r1 - adds r2, r0 - adds r0, r7, 0 - movs r1, 0x19 - bl SetMonData_encrypted - mov r1, sp - ldrh r0, [r1, 0xE] - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - adds r4, 0x12 - adds r2, r4 - adds r0, r7, 0 - movs r1, 0x20 - bl SetMonData_encrypted - bl sav1_map_get_name - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - adds r0, r7, 0 - movs r1, 0x23 - mov r2, r9 - bl SetMonData_encrypted - adds r0, r7, 0 - movs r1, 0x24 - add r2, sp, 0x10 - bl SetMonData_encrypted - ldr r2, =gGameVersion - adds r0, r7, 0 - movs r1, 0x25 - bl SetMonData_encrypted - movs r0, 0x4 - str r0, [sp, 0x18] - adds r0, r7, 0 - movs r1, 0x26 - mov r2, r9 - bl SetMonData_encrypted - ldr r2, [r5] - adds r2, 0x8 - adds r0, r7, 0 - movs r1, 0x31 - bl SetMonData_encrypted - mov r2, sp - ldrb r0, [r2, 0x11] - cmp r0, 0x1F - bhi _08067DC8 - adds r0, r7, 0 - movs r1, 0x27 - adds r2, 0x11 - bl SetMonData_encrypted - adds r0, r7, 0 - movs r1, 0x28 - mov r2, sp - adds r2, 0x11 - bl SetMonData_encrypted - adds r0, r7, 0 - movs r1, 0x29 - mov r2, sp - adds r2, 0x11 - bl SetMonData_encrypted - adds r0, r7, 0 - movs r1, 0x2A - mov r2, sp - adds r2, 0x11 - bl SetMonData_encrypted - adds r0, r7, 0 - movs r1, 0x2B - mov r2, sp - adds r2, 0x11 - bl SetMonData_encrypted - adds r0, r7, 0 - movs r1, 0x2C - mov r2, sp - adds r2, 0x11 - bl SetMonData_encrypted - b _08067E50 - .pool -_08067DC8: - bl Random - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] - movs r3, 0x1F - mov r8, r3 - ands r0, r3 - str r0, [sp, 0x1C] - add r4, sp, 0x1C - adds r0, r7, 0 - movs r1, 0x27 - adds r2, r4, 0 - bl SetMonData_encrypted - ldr r0, [sp, 0x18] - movs r6, 0xF8 - lsls r6, 2 - ands r0, r6 - lsrs r0, 5 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x28 - adds r2, r4, 0 - bl SetMonData_encrypted - ldr r0, [sp, 0x18] - movs r5, 0xF8 - lsls r5, 7 - ands r0, r5 - lsrs r0, 10 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x29 - adds r2, r4, 0 - bl SetMonData_encrypted - bl Random - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] - mov r1, r8 - ands r0, r1 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x2A - adds r2, r4, 0 - bl SetMonData_encrypted - ldr r0, [sp, 0x18] - ands r0, r6 - lsrs r0, 5 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x2B - adds r2, r4, 0 - bl SetMonData_encrypted - ldr r0, [sp, 0x18] - ands r0, r5 - lsrs r0, 10 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x2C - adds r2, r4, 0 - bl SetMonData_encrypted -_08067E50: - ldr r2, =gBaseStats - mov r3, sp - ldrh r1, [r3, 0xE] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x17] - cmp r0, 0 - beq _08067E76 - ldr r0, [sp, 0x14] - movs r1, 0x1 - ands r0, r1 - str r0, [sp, 0x18] - adds r0, r7, 0 - movs r1, 0x2E - mov r2, r9 - bl SetMonData_encrypted -_08067E76: - adds r0, r7, 0 - bl sub_8069270 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end create_pokemon - - thumb_func_start pokemon_make_with_nature -pokemon_make_with_nature: @ 8067E90 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - mov r9, r0 - ldr r0, [sp, 0x2C] - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - lsls r0, 24 - lsrs r5, r0, 24 -_08067EB0: - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08067EB0 - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - mov r0, r9 - mov r1, r8 - adds r2, r7, 0 - adds r3, r6, 0 - bl create_pokemon_set_level - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end pokemon_make_with_nature - - thumb_func_start sub_8067EF8 -sub_8067EF8: @ 8067EF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - str r0, [sp, 0x10] - ldr r4, [sp, 0x38] - ldr r5, [sp, 0x3C] - ldr r0, [sp, 0x40] - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - lsls r4, 24 - lsrs r4, 24 - mov r8, r4 - lsls r5, 24 - lsrs r6, r5, 24 - lsls r0, 24 - lsrs r1, r0, 24 - mov r9, r1 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1B - bhi _08067F9E -_08067F38: - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - movs r0, 0xC0 - lsls r0, 18 - ands r0, r4 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r4 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r4 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r4 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _08067F38 - adds r0, r7, 0 - adds r1, r4, 0 - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r8, r0 - bne _08067F38 - mov r0, r9 - subs r0, 0x1 - cmp r5, r0 - bne _08067F38 - b _08067FCE -_08067F9E: - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _08067F9E - adds r0, r7, 0 - adds r1, r4, 0 - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r8, r0 - bne _08067F9E -_08067FCE: - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - ldr r0, [sp, 0x10] - adds r1, r7, 0 - ldr r2, [sp, 0x14] - mov r3, r10 - bl create_pokemon_set_level - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8067EF8 - - thumb_func_start sub_8067FF8 -sub_8067FF8: @ 8067FF8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - mov r8, r0 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 24 - lsrs r7, r2, 24 -_0806800A: - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r5, r4, 16 - lsls r0, 16 - orrs r5, r0 - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - adds r0, r6, 0 - adds r1, r4, 0 - bl pokemon_species_get_gender_info - lsls r0, 24 - cmp r0, 0 - bne _0806800A - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - str r0, [sp, 0x8] - str r5, [sp, 0xC] - mov r0, r8 - adds r1, r6, 0 - adds r2, r7, 0 - movs r3, 0x20 - bl create_pokemon_set_level - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8067FF8 - - thumb_func_start sub_8068060 -sub_8068060: @ 8068060 - push {r4,lr} - sub sp, 0x14 - adds r4, r0, 0 - str r3, [sp, 0x10] - ldr r3, [sp, 0x1C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - str r3, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - adds r0, r4, 0 - movs r3, 0 - bl create_pokemon_set_level - adds r0, r4, 0 - movs r1, 0x42 - add r2, sp, 0x10 - bl SetMonData - adds r0, r4, 0 - bl pokemon_calc_effective_stats - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8068060 - - thumb_func_start sub_80680A0 -sub_80680A0: @ 80680A0 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r3, 0 - ldr r3, [sp, 0x1C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - str r3, [sp, 0xC] - adds r0, r5, 0 - movs r3, 0 - bl create_pokemon_set_level - adds r0, r5, 0 - movs r1, 0x27 - adds r2, r4, 0 - bl SetMonData - adds r2, r4, 0x1 - adds r0, r5, 0 - movs r1, 0x28 - bl SetMonData - adds r2, r4, 0x2 - adds r0, r5, 0 - movs r1, 0x29 - bl SetMonData - adds r2, r4, 0x3 - adds r0, r5, 0 - movs r1, 0x2A - bl SetMonData - adds r2, r4, 0x4 - adds r0, r5, 0 - movs r1, 0x2B - bl SetMonData - adds r4, 0x5 - adds r0, r5, 0 - movs r1, 0x2C - adds r2, r4, 0 - bl SetMonData - adds r0, r5, 0 - bl pokemon_calc_effective_stats - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80680A0 - - thumb_func_start pokemon_make_ev_something -pokemon_make_ev_something: @ 8068114 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r7, r0, 0 - ldr r0, [sp, 0x2C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r6, 0 - str r6, [sp] - str r6, [sp, 0x4] - str r6, [sp, 0x8] - str r6, [sp, 0xC] - adds r0, r7, 0 - bl create_pokemon_set_level - mov r4, r8 - movs r1, 0x1 - movs r5, 0x5 -_08068148: - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _08068152 - adds r6, 0x1 -_08068152: - lsrs r4, 1 - subs r5, 0x1 - cmp r5, 0 - bge _08068148 - movs r0, 0xFF - lsls r0, 1 - adds r1, r6, 0 - bl __divsi3 - add r1, sp, 0x10 - strh r0, [r1] - movs r4, 0x1 - movs r5, 0 -_0806816C: - mov r0, r8 - ands r0, r4 - cmp r0, 0 - beq _08068180 - adds r1, r5, 0 - adds r1, 0x1A - adds r0, r7, 0 - add r2, sp, 0x10 - bl SetMonData -_08068180: - lsls r0, r4, 25 - lsrs r4, r0, 24 - adds r5, 0x1 - cmp r5, 0x5 - ble _0806816C - adds r0, r7, 0 - bl pokemon_calc_effective_stats - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end pokemon_make_ev_something - - thumb_func_start sub_806819C -sub_806819C: @ 806819C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x34 - adds r7, r0, 0 - adds r6, r1, 0 - ldrh r1, [r6] - ldrb r2, [r6, 0xC] - movs r3, 0x1 - str r3, [sp] - ldr r0, [r6, 0x1C] - str r0, [sp, 0x4] - str r3, [sp, 0x8] - ldr r0, [r6, 0x14] - str r0, [sp, 0xC] - adds r0, r7, 0 - movs r3, 0 - bl create_pokemon_set_level - movs r5, 0 - add r0, sp, 0x30 - mov r9, r0 - movs r1, 0x31 - add r1, sp - mov r8, r1 - adds r4, r6, 0x4 -_080681D2: - ldrh r1, [r4] - lsls r2, r5, 24 - lsrs r2, 24 - adds r0, r7, 0 - bl sub_80691F4 - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _080681D2 - adds r2, r6, 0 - adds r2, 0xD - adds r0, r7, 0 - movs r1, 0x15 - bl SetMonData - adds r2, r6, 0x2 - adds r0, r7, 0 - movs r1, 0xC - bl SetMonData - adds r2, r6, 0 - adds r2, 0x2B - adds r0, r7, 0 - movs r1, 0x20 - bl SetMonData - adds r1, r6, 0 - adds r1, 0x20 - add r0, sp, 0x10 - bl StringCopy - add r0, sp, 0x10 - ldrb r0, [r0] - cmp r0, 0xFC - bne _08068230 - add r0, sp, 0x10 - ldrb r0, [r0, 0x1] - cmp r0, 0x15 - bne _08068230 - movs r0, 0x1 - mov r1, r9 - strb r0, [r1] - add r0, sp, 0x10 - bl StripExtCtrlCodes - b _08068236 -_08068230: - movs r0, 0x2 - mov r1, r9 - strb r0, [r1] -_08068236: - adds r0, r7, 0 - movs r1, 0x3 - mov r2, r9 - bl SetMonData - adds r0, r7, 0 - movs r1, 0x2 - add r2, sp, 0x10 - bl SetMonData - adds r2, r6, 0 - adds r2, 0xE - adds r0, r7, 0 - movs r1, 0x1A - bl SetMonData - adds r2, r6, 0 - adds r2, 0xF - adds r0, r7, 0 - movs r1, 0x1B - bl SetMonData - adds r2, r6, 0 - adds r2, 0x10 - adds r0, r7, 0 - movs r1, 0x1C - bl SetMonData - adds r2, r6, 0 - adds r2, 0x11 - adds r0, r7, 0 - movs r1, 0x1D - bl SetMonData - adds r2, r6, 0 - adds r2, 0x12 - adds r0, r7, 0 - movs r1, 0x1E - bl SetMonData - adds r2, r6, 0 - adds r2, 0x13 - adds r0, r7, 0 - movs r1, 0x1F - bl SetMonData - ldrb r0, [r6, 0x1B] - lsrs r0, 7 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2E - mov r2, r8 - bl SetMonData - ldrb r0, [r6, 0x18] - lsls r0, 27 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x27 - mov r2, r8 - bl SetMonData - ldrh r0, [r6, 0x18] - lsls r0, 22 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x28 - mov r2, r8 - bl SetMonData - ldrb r0, [r6, 0x19] - lsls r0, 25 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x29 - mov r2, r8 - bl SetMonData - ldr r0, [r6, 0x18] - lsls r0, 12 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2A - mov r2, r8 - bl SetMonData - ldrh r0, [r6, 0x1A] - lsls r0, 23 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2B - mov r2, r8 - bl SetMonData - ldrb r0, [r6, 0x1B] - lsls r0, 26 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2C - mov r2, r8 - bl SetMonData - adds r0, r7, 0 - bl sub_806E924 - adds r0, r7, 0 - bl pokemon_calc_effective_stats - add sp, 0x34 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_806819C thumb_func_start sub_8068338 sub_8068338: @ 8068338 @@ -1114,7 +53,7 @@ _0806837C: adds r0, r7, 0 adds r2, r3, 0 movs r3, 0 - bl create_pokemon_set_level + bl CreateMon movs r5, 0 movs r0, 0xD adds r0, r6 @@ -1150,7 +89,7 @@ _080683D2: lsls r2, r5, 24 lsrs r2, 24 adds r0, r7, 0 - bl sub_80691F4 + bl SetMonMoveSlot adds r4, 0x2 adds r5, 0x1 cmp r5, 0x3 @@ -1284,9 +223,9 @@ _08068430: mov r2, r8 bl SetMonData adds r0, r7, 0 - bl sub_806E924 + bl MonRestorePP adds r0, r7, 0 - bl pokemon_calc_effective_stats + bl CalculateMonStats add sp, 0x58 pop {r3-r5} mov r8, r3 @@ -1358,7 +297,7 @@ sub_8068528: @ 8068528 str r0, [sp, 0xC] adds r0, r7, 0 movs r3, 0x1F - bl create_pokemon_set_level + bl CreateMon mov r1, r9 adds r2, r5, r1 adds r2, 0xE @@ -1377,7 +316,7 @@ _080685BE: lsls r2, r4, 24 lsrs r2, 24 adds r0, r7, 0 - bl sub_80691F4 + bl SetMonMoveSlot adds r5, 0x2 adds r4, 0x1 cmp r4, 0x3 @@ -1416,7 +355,7 @@ _080685E0: movs r1, 0x7 bl SetMonData adds r0, r7, 0 - bl pokemon_calc_effective_stats + bl CalculateMonStats add sp, 0x14 pop {r3,r4} mov r8, r3 @@ -1477,7 +416,7 @@ _08068664: ldr r1, [sp, 0x14] mov r2, r10 mov r3, r9 - bl create_pokemon_set_level + bl CreateMon mov r5, r8 movs r1, 0x1 movs r4, 0x5 @@ -1517,7 +456,7 @@ _080686DA: cmp r4, 0x5 ble _080686C6 adds r0, r7, 0 - bl pokemon_calc_effective_stats + bl CalculateMonStats add sp, 0x18 pop {r3-r5} mov r8, r3 @@ -1720,8 +659,8 @@ _08068738: .pool thumb_func_end sub_80686FC - thumb_func_start sub_80688A8 -sub_80688A8: @ 80688A8 + thumb_func_start CreateObedientMon +CreateObedientMon: @ 80688A8 push {r4-r7,lr} mov r7, r8 push {r7} @@ -1748,7 +687,7 @@ sub_80688A8: @ 80688A8 str r5, [sp, 0x8] str r7, [sp, 0xC] mov r0, r8 - bl create_pokemon_set_level + bl CreateMon mov r0, r8 movs r1, 0x50 add r2, sp, 0x10 @@ -1759,7 +698,7 @@ sub_80688A8: @ 80688A8 pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_80688A8 + thumb_func_end CreateObedientMon thumb_func_start sub_80688F8 sub_80688F8: @ 80688F8 @@ -1845,8 +784,8 @@ _08068990: cmp r2, 0 beq _080689F4 _080689B6: - ldr r4, =gUnknown_020229E8 - bl link_get_multiplayer_id + ldr r4, =gLinkPlayers + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -2050,13 +989,13 @@ sub_8068B48: @ 8068B48 b _08068B78 .pool _08068B6C: - bl link_get_multiplayer_id + bl GetMultiplayerId movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 _08068B78: - ldr r3, =gUnknown_020229E8 + ldr r3, =gLinkPlayers lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -2098,13 +1037,13 @@ sub_8068BB0: @ 8068BB0 b _08068BE0 .pool _08068BD4: - bl link_get_multiplayer_id + bl GetMultiplayerId movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 _08068BE0: - ldr r3, =gUnknown_020229E8 + ldr r3, =gLinkPlayers lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -2152,7 +1091,7 @@ DoScriptedWildBattle: @ 8068C18 adds r1, r5, 0 adds r2, r4, 0 movs r3, 0x20 - bl sub_80688A8 + bl CreateObedientMon cmp r6, 0 beq _08068C60 add r0, sp, 0x10 @@ -2172,9 +1111,9 @@ _08068C60: .pool thumb_func_end DoScriptedWildBattle - thumb_func_start pokemon_calc_checksum -@ int pokemon_calc_checksum(pokemon *mon) -pokemon_calc_checksum: @ 8068C78 + thumb_func_start CalculateBoxMonChecksum +@ int CalculateBoxMonChecksum(pokemon *mon) +CalculateBoxMonChecksum: @ 8068C78 push {r4-r7,lr} mov r7, r8 push {r7} @@ -2182,22 +1121,22 @@ pokemon_calc_checksum: @ 8068C78 movs r6, 0 ldr r1, [r4] movs r2, 0 - bl pokemon_data_permutator + bl GetSubstruct adds r5, r0, 0 ldr r1, [r4] adds r0, r4, 0 movs r2, 0x1 - bl pokemon_data_permutator + bl GetSubstruct adds r7, r0, 0 ldr r1, [r4] adds r0, r4, 0 movs r2, 0x2 - bl pokemon_data_permutator + bl GetSubstruct mov r8, r0 ldr r1, [r4] adds r0, r4, 0 movs r2, 0x3 - bl pokemon_data_permutator + bl GetSubstruct adds r3, r0, 0 movs r1, 0x5 _08068CB2: @@ -2248,10 +1187,10 @@ _08068CEE: pop {r4-r7} pop {r1} bx r1 - thumb_func_end pokemon_calc_checksum + thumb_func_end CalculateBoxMonChecksum - thumb_func_start pokemon_calc_effective_stats -pokemon_calc_effective_stats: @ 8068D0C + thumb_func_start CalculateMonStats +CalculateMonStats: @ 8068D0C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -2335,7 +1274,7 @@ pokemon_calc_effective_stats: @ 8068D0C lsls r0, 16 lsrs r7, r0, 16 adds r0, r5, 0 - bl level_by_exp + bl GetLevelFromMonExp lsls r0, 24 lsrs r0, 24 str r0, [sp] @@ -2598,7 +1537,7 @@ _08068FF4: pop {r4-r7} pop {r0} bx r0 - thumb_func_end pokemon_calc_effective_stats + thumb_func_end CalculateMonStats thumb_func_start sub_8069004 sub_8069004: @ 8069004 @@ -2631,15 +1570,15 @@ sub_8069004: @ 8069004 mov r2, sp bl SetMonData adds r0, r4, 0 - bl pokemon_calc_effective_stats + bl CalculateMonStats add sp, 0x4 pop {r4} pop {r0} bx r0 thumb_func_end sub_8069004 - thumb_func_start level_by_exp -level_by_exp: @ 8069054 + thumb_func_start GetLevelFromMonExp +GetLevelFromMonExp: @ 8069054 push {r4-r6,lr} adds r5, r0, 0 movs r1, 0xB @@ -2690,22 +1629,22 @@ _080690AA: pop {r1} bx r1 .pool - thumb_func_end level_by_exp + thumb_func_end GetLevelFromMonExp - thumb_func_start sub_80690C0 -sub_80690C0: @ 80690C0 + thumb_func_start GetLevelFromBoxMonExp +GetLevelFromBoxMonExp: @ 80690C0 push {r4-r6,lr} adds r5, r0, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x19 movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r3, r0, 0 movs r2, 0x1 ldr r6, =gExperienceTables @@ -2744,22 +1683,22 @@ _08069116: pop {r1} bx r1 .pool - thumb_func_end sub_80690C0 + thumb_func_end GetLevelFromBoxMonExp - thumb_func_start pokemon_moveset_pad_ -pokemon_moveset_pad_: @ 806912C + thumb_func_start GiveMoveToMon +GiveMoveToMon: @ 806912C push {lr} lsls r1, 16 lsrs r1, 16 - bl pokemon_moveset_pad + bl GiveMoveToBoxMon lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 - thumb_func_end pokemon_moveset_pad_ + thumb_func_end GiveMoveToMon - thumb_func_start pokemon_moveset_pad -pokemon_moveset_pad: @ 8069140 + thumb_func_start GiveMoveToBoxMon +GiveMoveToBoxMon: @ 8069140 push {r4-r7,lr} sub sp, 0x4 adds r7, r0, 0 @@ -2773,7 +1712,7 @@ _0806914E: adds r0, r7, 0 adds r1, r4, 0 movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData lsls r0, 16 lsrs r0, 16 cmp r0, 0 @@ -2781,7 +1720,7 @@ _0806914E: adds r0, r7, 0 adds r1, r4, 0 mov r2, sp - bl SetMonData_encrypted + bl SetBoxMonData adds r1, r5, 0 adds r1, 0x11 ldrh r0, [r6] @@ -2791,7 +1730,7 @@ _0806914E: ldr r0, =gBattleMoves + 0x4 @ PP offset adds r2, r0 adds r0, r7, 0 - bl SetMonData_encrypted + bl SetBoxMonData ldrh r0, [r6] b _080691A4 .pool @@ -2813,10 +1752,10 @@ _080691A4: pop {r1} bx r1 .pool - thumb_func_end pokemon_moveset_pad + thumb_func_end GiveMoveToBoxMon - thumb_func_start sub_80691B0 -sub_80691B0: @ 80691B0 + thumb_func_start GiveMoveToBattleMon +GiveMoveToBattleMon: @ 80691B0 push {r4,r5,lr} lsls r1, 16 lsrs r4, r1, 16 @@ -2852,10 +1791,10 @@ _080691EA: pop {r1} bx r1 .pool - thumb_func_end sub_80691B0 + thumb_func_end GiveMoveToBattleMon - thumb_func_start sub_80691F4 -sub_80691F4: @ 80691F4 + thumb_func_start SetMonMoveSlot +SetMonMoveSlot: @ 80691F4 push {r4,r5,lr} sub sp, 0x4 adds r5, r0, 0 @@ -2885,10 +1824,10 @@ sub_80691F4: @ 80691F4 pop {r0} bx r0 .pool - thumb_func_end sub_80691F4 + thumb_func_end SetMonMoveSlot - thumb_func_start sub_8069234 -sub_8069234: @ 8069234 + thumb_func_start SetBattleMonMoveSlot +SetBattleMonMoveSlot: @ 8069234 push {r4,lr} lsls r1, 16 lsrs r1, 16 @@ -2912,18 +1851,18 @@ sub_8069234: @ 8069234 pop {r0} bx r0 .pool - thumb_func_end sub_8069234 + thumb_func_end SetBattleMonMoveSlot - thumb_func_start sub_8069264 -sub_8069264: @ 8069264 + thumb_func_start GiveMonInitialMoveset +GiveMonInitialMoveset: @ 8069264 push {lr} - bl sub_8069270 + bl GiveBoxMonInitialMoveset pop {r0} bx r0 - thumb_func_end sub_8069264 + thumb_func_end GiveMonInitialMoveset - thumb_func_start sub_8069270 -sub_8069270: @ 8069270 + thumb_func_start GiveBoxMonInitialMoveset +GiveBoxMonInitialMoveset: @ 8069270 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -2933,16 +1872,16 @@ sub_8069270: @ 8069270 mov r8, r0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 - bl sub_80690C0 + bl GetLevelFromBoxMonExp lsls r0, 24 lsrs r0, 24 mov r10, r0 - ldr r0, =gLevelUpLearnsetPointers + ldr r0, =gLevelUpLearnsets lsls r6, r4, 2 adds r0, r6, r0 ldr r0, [r0] @@ -2954,7 +1893,7 @@ sub_8069270: @ 8069270 mov r9, r2 movs r3, 0 _080692AE: - ldr r0, =gLevelUpLearnsetPointers + ldr r0, =gLevelUpLearnsets adds r7, r6, r0 ldr r0, [r7] adds r0, r3, r0 @@ -2974,7 +1913,7 @@ _080692AE: mov r0, r8 adds r1, r4, 0 str r3, [sp] - bl pokemon_moveset_pad + bl GiveMoveToBoxMon lsls r0, 16 mov r1, r9 lsrs r5, r1, 16 @@ -2983,7 +1922,7 @@ _080692AE: bne _080692F0 mov r0, r8 adds r1, r4, 0 - bl sub_80694D0 + bl DeleteFirstMoveAndGiveMoveToBoxMon ldr r3, [sp] _080692F0: adds r3, 0x2 @@ -3002,10 +1941,10 @@ _080692FC: pop {r0} bx r0 .pool - thumb_func_end sub_8069270 + thumb_func_end GiveBoxMonInitialMoveset - thumb_func_start sub_8069318 -sub_8069318: @ 8069318 + thumb_func_start MonTryLearningNewMove +MonTryLearningNewMove: @ 8069318 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -3033,11 +1972,11 @@ sub_8069318: @ 8069318 mov r10, r0 cmp r4, 0 beq _080693B0 - ldr r4, =gUnknown_020244E8 + ldr r4, =sLearningMoveTableID mov r1, sp ldrb r1, [r1] strb r1, [r4] - ldr r2, =gLevelUpLearnsetPointers + ldr r2, =gLevelUpLearnsets mov r5, r9 lsls r3, r5, 2 adds r5, r3, r2 @@ -3078,11 +2017,11 @@ _080693A8: cmp r0, r4 bne _08069384 _080693B0: - ldr r3, =gLevelUpLearnsetPointers + ldr r3, =gLevelUpLearnsets mov r1, r9 lsls r4, r1, 2 adds r1, r4, r3 - ldr r2, =gUnknown_020244E8 + ldr r2, =sLearningMoveTableID ldrb r0, [r2] ldr r1, [r1] lsls r0, 1 @@ -3099,7 +2038,7 @@ _080693B0: cmp r0, r1 bne _08069402 _080693D8: - ldr r2, =gUnknown_020244E2 + ldr r2, =gMoveToLearn mov r0, r12 adds r1, r3, r0 ldrb r0, [r6] @@ -3115,7 +2054,7 @@ _080693D8: strb r0, [r6] ldrh r1, [r2] mov r0, r8 - bl pokemon_moveset_pad_ + bl GiveMoveToMon lsls r0, 16 lsrs r0, 16 str r0, [sp] @@ -3131,10 +2070,10 @@ _08069404: pop {r1} bx r1 .pool - thumb_func_end sub_8069318 + thumb_func_end MonTryLearningNewMove - thumb_func_start sub_8069424 -sub_8069424: @ 8069424 + thumb_func_start DeleteFirstMoveAndGiveMoveToMon +DeleteFirstMoveAndGiveMoveToMon: @ 8069424 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -3216,10 +2155,10 @@ _08069494: pop {r0} bx r0 .pool - thumb_func_end sub_8069424 + thumb_func_end DeleteFirstMoveAndGiveMoveToMon - thumb_func_start sub_80694D0 -sub_80694D0: @ 80694D0 + thumb_func_start DeleteFirstMoveAndGiveMoveToBoxMon +DeleteFirstMoveAndGiveMoveToBoxMon: @ 80694D0 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -3239,13 +2178,13 @@ _080694EC: adds r1, 0xE adds r0, r6, 0 movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData strh r0, [r5] adds r1, r4, 0 adds r1, 0x12 adds r0, r6, 0 movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r1, r7, r4 strb r0, [r1] adds r5, 0x2 @@ -3255,7 +2194,7 @@ _080694EC: adds r0, r6, 0 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData mov r1, r9 strb r0, [r1] ldrb r0, [r1] @@ -3279,12 +2218,12 @@ _08069540: adds r1, 0xD adds r0, r6, 0 adds r2, r5, 0 - bl SetMonData_encrypted + bl SetBoxMonData adds r1, r4, 0 adds r1, 0x11 adds r2, r7, r4 adds r0, r6, 0 - bl SetMonData_encrypted + bl SetBoxMonData adds r5, 0x2 adds r4, 0x1 cmp r4, 0x3 @@ -3292,7 +2231,7 @@ _08069540: adds r0, r6, 0 movs r1, 0x15 mov r2, r9 - bl SetMonData_encrypted + bl SetBoxMonData add sp, 0x10 pop {r3,r4} mov r8, r3 @@ -3301,6 +2240,6 @@ _08069540: pop {r0} bx r0 .pool - thumb_func_end sub_80694D0 + thumb_func_end DeleteFirstMoveAndGiveMoveToBoxMon .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokemon_2.s b/asm/pokemon_2.s index 2346d0916..7b587ad5c 100644 --- a/asm/pokemon_2.s +++ b/asm/pokemon_2.s @@ -5,8 +5,8 @@ .text - thumb_func_start sub_8069DEC -sub_8069DEC: @ 8069DEC + thumb_func_start CountAliveMonsInBattle +CountAliveMonsInBattle: @ 8069DEC push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 @@ -115,10 +115,10 @@ _08069EC2: pop {r1} bx r1 .pool - thumb_func_end sub_8069DEC + thumb_func_end CountAliveMonsInBattle - thumb_func_start sub_8069ED8 -sub_8069ED8: @ 8069ED8 + thumb_func_start ShouldGetStatBadgeBoost +ShouldGetStatBadgeBoost: @ 8069ED8 push {r4,r5,lr} lsls r0, 16 lsrs r5, r0, 16 @@ -140,7 +140,7 @@ sub_8069ED8: @ 8069ED8 ands r0, r1 cmp r0, 0 beq _08069F10 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] movs r0, 0x80 lsls r0, 3 @@ -162,7 +162,7 @@ _08069F2E: pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_8069ED8 + thumb_func_end ShouldGetStatBadgeBoost thumb_func_start sub_8069F34 sub_8069F34: @ 8069F34 @@ -186,7 +186,7 @@ sub_8069F34: @ 8069F34 .pool _08069F5C: movs r0, 0 - bl sub_8069DEC + bl CountAliveMonsInBattle lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -228,29 +228,29 @@ _08069FA6: bx r1 thumb_func_end sub_8069F34 - thumb_func_start pokemon_get_gender -pokemon_get_gender: @ 8069FB4 + thumb_func_start GetMonGender +GetMonGender: @ 8069FB4 push {lr} - bl pokemon_roll_gender + bl GetBoxMonGender lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 - thumb_func_end pokemon_get_gender + thumb_func_end GetMonGender - thumb_func_start pokemon_roll_gender -pokemon_roll_gender: @ 8069FC4 + thumb_func_start GetBoxMonGender +GetBoxMonGender: @ 8069FC4 push {r4,r5,lr} adds r4, r0, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r2, r0, 0 ldr r1, =gBaseStats lsls r0, r5, 3 @@ -286,10 +286,10 @@ _0806A01A: pop {r4,r5} pop {r1} bx r1 - thumb_func_end pokemon_roll_gender + thumb_func_end GetBoxMonGender - thumb_func_start pokemon_species_get_gender_info -pokemon_species_get_gender_info: @ 806A020 + thumb_func_start GetGenderFromSpeciesAndPersonality +GetGenderFromSpeciesAndPersonality: @ 806A020 push {lr} adds r3, r1, 0 lsls r0, 16 @@ -326,7 +326,7 @@ _0806A060: _0806A062: pop {r1} bx r1 - thumb_func_end pokemon_species_get_gender_info + thumb_func_end GetGenderFromSpeciesAndPersonality thumb_func_start sub_806A068 sub_806A068: @ 806A068 @@ -544,9 +544,9 @@ _0806A20A: .pool thumb_func_end sub_806A1C0 - thumb_func_start pokemon_encrypt -@ void pokemon_encrypt(pokemon *mon) -pokemon_encrypt: @ 806A228 + thumb_func_start EncryptBoxMon +@ void EncryptBoxMon(pokemon *mon) +EncryptBoxMon: @ 806A228 push {r4,lr} adds r3, r0, 0 movs r4, 0 @@ -566,11 +566,11 @@ _0806A232: pop {r4} pop {r0} bx r0 - thumb_func_end pokemon_encrypt + thumb_func_end EncryptBoxMon - thumb_func_start pokemon_decrypt -@ void pokemon_decrypt(pokemon *mon) -pokemon_decrypt: @ 806A24C + thumb_func_start DecryptBoxMon +@ void DecryptBoxMon(pokemon *mon) +DecryptBoxMon: @ 806A24C push {r4,lr} adds r3, r0, 0 movs r4, 0 @@ -590,11 +590,11 @@ _0806A256: pop {r4} pop {r0} bx r0 - thumb_func_end pokemon_decrypt + thumb_func_end DecryptBoxMon - thumb_func_start pokemon_data_permutator -@ int pokemon_data_permutator(pokemon *mon, int a2, u8 a3) -pokemon_data_permutator: @ 806A270 + thumb_func_start GetSubstruct +@ int GetSubstruct(pokemon *mon, int a2, u8 a3) +GetSubstruct: @ 806A270 push {r4-r6,lr} adds r5, r0, 0 adds r0, r1, 0 @@ -980,7 +980,7 @@ _0806A510: pop {r4-r6} pop {r1} bx r1 - thumb_func_end pokemon_data_permutator + thumb_func_end GetSubstruct thumb_func_start GetMonData @ int GetMonData(pokemon *mon, enum pokemon_data_request req, void *data) @@ -1132,16 +1132,16 @@ _0806A65E: _0806A666: adds r0, r4, 0 adds r1, r3, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData _0806A66E: pop {r4} pop {r1} bx r1 thumb_func_end GetMonData - thumb_func_start pokemon_getattr_encrypted -@ int pokemon_getattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) -pokemon_getattr_encrypted: @ 806A674 + thumb_func_start GetBoxMonData +@ int GetBoxMonData(pokemon *mon, enum pokemon_data_request req, void *data) +GetBoxMonData: @ 806A674 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -1160,28 +1160,28 @@ pokemon_getattr_encrypted: @ 806A674 ble _0806A6F2 ldr r1, [r0] movs r2, 0 - bl pokemon_data_permutator + bl GetSubstruct mov r9, r0 mov r0, r8 ldr r1, [r0] movs r2, 0x1 - bl pokemon_data_permutator + bl GetSubstruct mov r10, r0 mov r2, r8 ldr r1, [r2] mov r0, r8 movs r2, 0x2 - bl pokemon_data_permutator + bl GetSubstruct adds r7, r0, 0 mov r0, r8 ldr r1, [r0] movs r2, 0x3 - bl pokemon_data_permutator + bl GetSubstruct adds r5, r0, 0 mov r0, r8 - bl pokemon_decrypt + bl DecryptBoxMon mov r0, r8 - bl pokemon_calc_checksum + bl CalculateBoxMonChecksum lsls r0, 16 lsrs r0, 16 mov r1, r8 @@ -1925,7 +1925,7 @@ _0806AC8C: cmp r6, 0xA ble _0806AC98 mov r0, r8 - bl pokemon_encrypt + bl EncryptBoxMon _0806AC98: adds r0, r4, 0 add sp, 0x4 @@ -1936,7 +1936,7 @@ _0806AC98: pop {r4-r7} pop {r1} bx r1 - thumb_func_end pokemon_getattr_encrypted + thumb_func_end GetBoxMonData thumb_func_start SetMonData @ int SetMonData(pokemon *mon, enum pokemon_data_request req, void *data) @@ -2056,15 +2056,15 @@ _0806AD86: b _0806AD96 _0806AD90: adds r0, r3, 0 - bl SetMonData_encrypted + bl SetBoxMonData _0806AD96: pop {r0} bx r0 thumb_func_end SetMonData - thumb_func_start SetMonData_encrypted -@ int SetMonData_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) -SetMonData_encrypted: @ 806AD9C + thumb_func_start SetBoxMonData +@ int SetBoxMonData(pokemon *mon, enum pokemon_data_request req, void *data) +SetBoxMonData: @ 806AD9C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -2083,27 +2083,27 @@ SetMonData_encrypted: @ 806AD9C ldr r1, [r7] adds r0, r7, 0 movs r2, 0 - bl pokemon_data_permutator + bl GetSubstruct mov r8, r0 ldr r1, [r7] adds r0, r7, 0 movs r2, 0x1 - bl pokemon_data_permutator + bl GetSubstruct mov r9, r0 ldr r1, [r7] adds r0, r7, 0 movs r2, 0x2 - bl pokemon_data_permutator + bl GetSubstruct adds r6, r0, 0 ldr r1, [r7] adds r0, r7, 0 movs r2, 0x3 - bl pokemon_data_permutator + bl GetSubstruct adds r5, r0, 0 adds r0, r7, 0 - bl pokemon_decrypt + bl DecryptBoxMon adds r0, r7, 0 - bl pokemon_calc_checksum + bl CalculateBoxMonChecksum lsls r0, 16 lsrs r0, 16 ldrh r1, [r7, 0x1C] @@ -2120,7 +2120,7 @@ SetMonData_encrypted: @ 806AD9C orrs r0, r1 strb r0, [r5, 0x7] adds r0, r7, 0 - bl pokemon_encrypt + bl EncryptBoxMon b _0806B3EC _0806AE1C: mov r0, r10 @@ -2850,10 +2850,10 @@ _0806B3D8: cmp r0, 0xA ble _0806B3EC adds r0, r7, 0 - bl pokemon_calc_checksum + bl CalculateBoxMonChecksum strh r0, [r7, 0x1C] adds r0, r7, 0 - bl pokemon_encrypt + bl EncryptBoxMon _0806B3EC: pop {r3-r5} mov r8, r3 @@ -2863,20 +2863,20 @@ _0806B3EC: pop {r0} bx r0 .pool - thumb_func_end SetMonData_encrypted + thumb_func_end SetBoxMonData - thumb_func_start memcpy_pokemon -@ void *memcpy_pokemon(void *dest, void *src, unsigned int size) -memcpy_pokemon: @ 806B408 + thumb_func_start CopyMon +@ void *CopyMon(void *dest, void *src, unsigned int size) +CopyMon: @ 806B408 push {lr} bl memcpy pop {r0} bx r0 - thumb_func_end memcpy_pokemon + thumb_func_end CopyMon - thumb_func_start pokemon_catch -@ int pokemon_catch(pokemon *mon) -pokemon_catch: @ 806B414 + thumb_func_start GiveMonToPlayer +@ int GiveMonToPlayer(pokemon *mon) +GiveMonToPlayer: @ 806B414 push {r4-r6,lr} adds r6, r0, 0 ldr r4, =gSaveBlock2Ptr @@ -2915,7 +2915,7 @@ _0806B446: adds r0, r4, 0 adds r1, r6, 0 movs r2, 0x64 - bl memcpy_pokemon + bl CopyMon ldr r1, =gPlayerPartyCount adds r0, r5, 0x1 strb r0, [r1] @@ -2924,18 +2924,18 @@ _0806B446: .pool _0806B480: adds r0, r6, 0 - bl pokemon_add_to_pc + bl SendMonToPC lsls r0, 24 lsrs r0, 24 _0806B48A: pop {r4-r6} pop {r1} bx r1 - thumb_func_end pokemon_catch + thumb_func_end GiveMonToPlayer - thumb_func_start pokemon_add_to_pc -@ int pokemon_add_to_pc(pokemon *mon) -pokemon_add_to_pc: @ 806B490 + thumb_func_start SendMonToPC +@ int SendMonToPC(pokemon *mon) +SendMonToPC: @ 806B490 push {r4-r7,lr} mov r7, r8 push {r7} @@ -2959,15 +2959,15 @@ _0806B4B2: adds r4, r0, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 bne _0806B514 mov r0, r8 - bl sub_806E924 + bl MonRestorePP adds r0, r4, 0 mov r1, r8 movs r2, 0x50 - bl memcpy_pokemon + bl CopyMon ldr r0, =gSpecialVar_0x8012 strh r5, [r0] ldr r0, =gSpecialVar_0x8013 @@ -3008,11 +3008,11 @@ _0806B530: pop {r4-r7} pop {r1} bx r1 - thumb_func_end pokemon_add_to_pc + thumb_func_end SendMonToPC - thumb_func_start calc_player_party_count -@ u8 calc_player_party_count() -calc_player_party_count: @ 806B53C + thumb_func_start CalculatePlayerPartyCount +@ u8 CalculatePlayerPartyCount() +CalculatePlayerPartyCount: @ 806B53C push {r4,lr} ldr r0, =gPlayerPartyCount movs r1, 0 @@ -3045,11 +3045,11 @@ _0806B572: pop {r1} bx r1 .pool - thumb_func_end calc_player_party_count + thumb_func_end CalculatePlayerPartyCount - thumb_func_start calc_enemy_party_count -@ u8 calc_enemy_party_count() -calc_enemy_party_count: @ 806B580 + thumb_func_start CalculateEnemyPartyCount +@ u8 CalculateEnemyPartyCount() +CalculateEnemyPartyCount: @ 806B580 push {r4,lr} ldr r0, =gUnknown_020244EA movs r1, 0 @@ -3082,13 +3082,13 @@ _0806B5B6: pop {r1} bx r1 .pool - thumb_func_end calc_enemy_party_count + thumb_func_end CalculateEnemyPartyCount - thumb_func_start sub_806B5C4 -sub_806B5C4: @ 806B5C4 + thumb_func_start GetMonsStateToDoubles +GetMonsStateToDoubles: @ 806B5C4 push {r4-r6,lr} movs r6, 0 - bl calc_player_party_count + bl CalculatePlayerPartyCount ldr r1, =gPlayerPartyCount ldrb r0, [r1] cmp r0, 0x1 @@ -3140,11 +3140,11 @@ _0806B628: pop {r1} bx r1 .pool - thumb_func_end sub_806B5C4 + thumb_func_end GetMonsStateToDoubles - thumb_func_start CheckPlayerPartySize -@ u8 CheckPlayerPartySize() -CheckPlayerPartySize: @ 806B638 + thumb_func_start GetMonsStateToDoubles_2 +@ u8 GetMonsStateToDoubles_2() +GetMonsStateToDoubles_2: @ 806B638 push {r4-r6,lr} movs r6, 0 movs r5, 0 @@ -3190,11 +3190,11 @@ _0806B68C: pop {r4-r6} pop {r1} bx r1 - thumb_func_end CheckPlayerPartySize + thumb_func_end GetMonsStateToDoubles_2 - thumb_func_start sub_806B694 -@ int sub_806B694(u16 a1, int a2) -sub_806B694: @ 806B694 + thumb_func_start GetAbilityBySpecies +@ int GetAbilityBySpecies(u16 a1, int a2) +GetAbilityBySpecies: @ 806B694 push {lr} lsls r0, 16 lsrs r3, r0, 16 @@ -3224,7 +3224,7 @@ _0806B6C6: pop {r1} bx r1 .pool - thumb_func_end sub_806B694 + thumb_func_end GetAbilityBySpecies thumb_func_start GetMonAbility @ u8 GetMonAbility(pokemon *mon) @@ -3245,7 +3245,7 @@ GetMonAbility: @ 806B6D8 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl sub_806B694 + bl GetAbilityBySpecies lsls r0, 24 lsrs r0, 24 pop {r4,r5} @@ -3253,8 +3253,8 @@ GetMonAbility: @ 806B6D8 bx r1 thumb_func_end GetMonAbility - thumb_func_start create_enemy_party -create_enemy_party: @ 806B70C + thumb_func_start CreateSecretBaseEnemyParty +CreateSecretBaseEnemyParty: @ 806B70C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -3311,7 +3311,7 @@ _0806B730: str r0, [sp, 0xC] adds r0, r5, 0 movs r3, 0xF - bl create_pokemon_set_level + bl CreateMon ldr r1, =gBattleResources ldr r0, [r1] adds r1, r7, 0 @@ -3392,12 +3392,12 @@ _0806B80A: pop {r0} bx r0 .pool - thumb_func_end create_enemy_party + thumb_func_end CreateSecretBaseEnemyParty - thumb_func_start sub_806B830 -sub_806B830: @ 806B830 + thumb_func_start GetSecretBaseTrainerPicIndex +GetSecretBaseTrainerPicIndex: @ 806B830 push {r4,r5,lr} - ldr r5, =gUnknown_08329EB8 + ldr r5, =gSecretBaseTrainerClasses ldr r0, =gBattleResources ldr r0, [r0] ldr r4, [r0] @@ -3421,12 +3421,12 @@ sub_806B830: @ 806B830 pop {r1} bx r1 .pool - thumb_func_end sub_806B830 + thumb_func_end GetSecretBaseTrainerPicIndex - thumb_func_start sub_806B870 -sub_806B870: @ 806B870 + thumb_func_start GetSecretBaseTrainerNameIndex +GetSecretBaseTrainerNameIndex: @ 806B870 push {r4,r5,lr} - ldr r5, =gUnknown_08329EB8 + ldr r5, =gSecretBaseTrainerClasses ldr r0, =gBattleResources ldr r0, [r0] ldr r4, [r0] @@ -3450,10 +3450,10 @@ sub_806B870: @ 806B870 pop {r1} bx r1 .pool - thumb_func_end sub_806B870 + thumb_func_end GetSecretBaseTrainerNameIndex - thumb_func_start sub_806B8B0 -sub_806B8B0: @ 806B8B0 + thumb_func_start PlayerPartyAndPokemonStorageFull +PlayerPartyAndPokemonStorageFull: @ 806B8B0 push {r4,lr} movs r4, 0 _0806B8B4: @@ -3473,17 +3473,17 @@ _0806B8D0: adds r4, 0x1 cmp r4, 0x5 ble _0806B8B4 - bl sub_806B8E4 + bl PokemonStorageFull lsls r0, 24 lsrs r0, 24 _0806B8DE: pop {r4} pop {r1} bx r1 - thumb_func_end sub_806B8B0 + thumb_func_end PlayerPartyAndPokemonStorageFull - thumb_func_start sub_806B8E4 -sub_806B8E4: @ 806B8E4 + thumb_func_start PokemonStorageFull +PokemonStorageFull: @ 806B8E4 push {r4-r6,lr} movs r6, 0 _0806B8E8: @@ -3494,7 +3494,7 @@ _0806B8EC: lsrs r1, 24 lsrs r0, r5, 24 movs r2, 0xB - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox cmp r0, 0 bne _0806B900 movs r0, 0 @@ -3511,7 +3511,7 @@ _0806B90E: pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_806B8E4 + thumb_func_end PokemonStorageFull thumb_func_start GetSpeciesName @ void GetSpeciesName(u8 *dest, u16 speciesId) @@ -3559,9 +3559,9 @@ _0806B954: bx r0 thumb_func_end GetSpeciesName - thumb_func_start CalcPPWithPPUps -@ u16 CalcPPWithPPUps(u16 moveId, s32 ppUpCounts, u8 monMoveIndex) -CalcPPWithPPUps: @ 806B960 + thumb_func_start CalculatePPWithBonus +@ u16 CalculatePPWithBonus(u16 moveId, s32 ppUpCounts, u8 monMoveIndex) +CalculatePPWithBonus: @ 806B960 push {r4,lr} lsls r0, 16 lsrs r0, 16 @@ -3593,10 +3593,10 @@ CalcPPWithPPUps: @ 806B960 pop {r1} bx r1 .pool - thumb_func_end CalcPPWithPPUps + thumb_func_end CalculatePPWithBonus - thumb_func_start sub_806B9A8 -sub_806B9A8: @ 806B9A8 + thumb_func_start RemoveMonPPBonus +RemoveMonPPBonus: @ 806B9A8 push {r4,r5,lr} sub sp, 0x4 adds r5, r0, 0 @@ -3624,10 +3624,10 @@ sub_806B9A8: @ 806B9A8 pop {r0} bx r0 .pool - thumb_func_end sub_806B9A8 + thumb_func_end RemoveMonPPBonus - thumb_func_start sub_806B9E4 -sub_806B9E4: @ 806B9E4 + thumb_func_start RemoveBattleMonPPBonus +RemoveBattleMonPPBonus: @ 806B9E4 lsls r1, 24 lsrs r1, 24 adds r0, 0x3B @@ -3639,10 +3639,10 @@ sub_806B9E4: @ 806B9E4 strb r1, [r0] bx lr .pool - thumb_func_end sub_806B9E4 + thumb_func_end RemoveBattleMonPPBonus - thumb_func_start battle_data_fill -battle_data_fill: @ 806B9FC + thumb_func_start CopyPlayerPartyMonToBattleData +CopyPlayerPartyMonToBattleData: @ 806B9FC push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -3925,7 +3925,7 @@ _0806BA4E: ldrh r0, [r7] ldrb r1, [r7, 0x17] lsrs r1, 7 - bl sub_806B694 + bl GetAbilityBySpecies adds r1, r7, 0 adds r1, 0x20 strb r0, [r1] @@ -3987,6 +3987,6 @@ _0806BCB2: pop {r0} bx r0 .pool - thumb_func_end battle_data_fill + thumb_func_end CopyPlayerPartyMonToBattleData .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokemon_3.s b/asm/pokemon_3.s index 22c72f443..15d24d795 100644 --- a/asm/pokemon_3.s +++ b/asm/pokemon_3.s @@ -5,1963 +5,6 @@ .text - thumb_func_start ExecuteTableBasedItemEffect_ -@ bool8 ExecuteTableBasedItemEffect_(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex) -ExecuteTableBasedItemEffect_: @ 806BD04 - push {r4,lr} - sub sp, 0x4 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r4, 0 - str r4, [sp] - bl ExecuteTableBasedItemEffect - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end ExecuteTableBasedItemEffect_ - - thumb_func_start ExecuteTableBasedItemEffect -@ bool8 ExecuteTableBasedItemEffect(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex, u8 a5) -ExecuteTableBasedItemEffect: @ 806BD28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x44 - mov r8, r0 - ldr r0, [sp, 0x64] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0xC] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - movs r0, 0x1 - str r0, [sp, 0x20] - movs r1, 0x6 - str r1, [sp, 0x28] - movs r2, 0 - str r2, [sp, 0x30] - movs r3, 0x4 - str r3, [sp, 0x38] - movs r5, 0 - str r5, [sp, 0x3C] - mov r0, r8 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _0806BDBC - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806BDA8 - ldr r2, =gEnigmaBerries - ldr r0, =gUnknown_020244B8 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x7] - b _0806BDC4 - .pool -_0806BDA8: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003226 - adds r0, r2 - ldrb r0, [r0] - b _0806BDC4 - .pool -_0806BDBC: - bl ItemId_GetHoldEffect - lsls r0, 24 - lsrs r0, 24 -_0806BDC4: - str r0, [sp, 0x34] - ldr r1, =gUnknown_0202420F - ldr r0, =gUnknown_020244B8 - ldrb r2, [r0] - strb r2, [r1] - ldr r0, =gMain - ldr r3, =0x00000439 - adds r0, r3 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0806BE64 - ldr r0, =gActiveBank - strb r2, [r0] - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - negs r1, r0 - orrs r1, r0 - lsrs r1, 31 - str r1, [sp, 0x1C] - ldr r0, =gNoOfAllBanks - ldr r4, [sp, 0xC] - subs r4, 0xD - ldrb r0, [r0] - cmp r1, r0 - bge _0806BE70 - ldr r2, =gBattlePartyID - lsls r0, r1, 1 - adds r0, r2 - ldrh r3, [r0] - ldr r5, [sp, 0x10] - lsls r0, r5, 16 - lsrs r1, r0, 16 - adds r5, r0, 0 - cmp r3, r1 - bne _0806BE3C - ldr r0, [sp, 0x1C] - str r0, [sp, 0x38] - b _0806BE70 - .pool -_0806BE3C: - ldr r1, [sp, 0x1C] - adds r1, 0x2 - str r1, [sp, 0x1C] - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r1, r0 - bge _0806BE70 - lsls r0, r1, 1 - adds r0, r2 - ldrh r1, [r0] - lsrs r0, r5, 16 - cmp r1, r0 - bne _0806BE3C - ldr r2, [sp, 0x1C] - lsls r0, r2, 24 - lsrs r0, 24 - str r0, [sp, 0x38] - b _0806BE70 - .pool -_0806BE64: - ldr r0, =gActiveBank - strb r1, [r0] - movs r3, 0x4 - str r3, [sp, 0x38] - ldr r4, [sp, 0xC] - subs r4, 0xD -_0806BE70: - lsls r0, r4, 16 - lsrs r0, 16 - cmp r0, 0xA5 - bhi _0806BEF0 - ldr r1, =gItemEffectInfoPointers - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - bne _0806BE94 - ldr r5, [sp, 0xC] - cmp r5, 0xAF - beq _0806BE9A - b _0806BEF0 - .pool -_0806BE94: - ldr r1, [sp, 0xC] - cmp r1, 0xAF - bne _0806BEF6 -_0806BE9A: - ldr r0, =gMain - ldr r2, =0x00000439 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806BECC - ldr r0, =gActiveBank - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0202440C - adds r0, r1 - b _0806BEF6 - .pool -_0806BECC: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x00003214 - adds r3, r0, r3 - str r3, [sp, 0x24] - b _0806BEF8 - .pool -_0806BEE0: - mov r0, r8 - movs r2, 0 - ldr r3, [sp, 0x10] - bl sub_813DA40 - movs r0, 0 - bl _0806CD5C -_0806BEF0: - movs r0, 0x1 - bl _0806CD5C -_0806BEF6: - str r0, [sp, 0x24] -_0806BEF8: - movs r5, 0 - str r5, [sp, 0x1C] -_0806BEFC: - ldr r0, [sp, 0x1C] - cmp r0, 0x5 - bls _0806BF06 - bl _0806CD4C -_0806BF06: - lsls r0, 2 - ldr r1, =_0806BF14 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806BF14: - .4byte _0806BF2C - .4byte _0806BFFC - .4byte _0806C08C - .4byte _0806C120 - .4byte _0806C300 - .4byte _0806C9BE -_0806BF2C: - ldr r1, [sp, 0x24] - ldr r3, [sp, 0x1C] - adds r2, r1, r3 - ldrb r1, [r2] - movs r0, 0x80 - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - beq _0806BF76 - ldr r0, =gMain - ldr r5, =0x00000439 - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806BF76 - ldr r0, [sp, 0x38] - cmp r0, 0x4 - beq _0806BF76 - ldr r1, =gBattleMons - movs r0, 0x58 - ldr r2, [sp, 0x38] - muls r0, r2 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0xF0 - lsls r0, 12 - ands r0, r1 - cmp r0, 0 - beq _0806BF76 - ldr r0, =0xfff0ffff - ands r1, r0 - str r1, [r2] - movs r3, 0 - str r3, [sp, 0x20] -_0806BF76: - ldrb r1, [r6] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - beq _0806BFA4 - ldr r1, =gBattleMons - ldr r0, =gActiveBank - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r3, 0x80 - lsls r3, 13 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - bne _0806BFA4 - orrs r1, r3 - str r1, [r2] - movs r5, 0 - str r5, [sp, 0x20] -_0806BFA4: - ldrb r0, [r6] - movs r3, 0xF - ands r3, r0 - cmp r3, 0 - bne _0806BFB2 - bl _0806CD4C -_0806BFB2: - ldr r6, =gBattleMons - ldr r5, =gActiveBank - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r6 - ldrb r2, [r1, 0x19] - movs r0, 0x19 - ldrsb r0, [r1, r0] - cmp r0, 0xB - ble _0806BFCC - bl _0806CD4C -_0806BFCC: - adds r0, r2, r3 - strb r0, [r1, 0x19] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r6 - movs r0, 0x19 - ldrsb r0, [r1, r0] - cmp r0, 0xC - bgt _0806BFE0 - b _0806C110 -_0806BFE0: - movs r0, 0xC - strb r0, [r1, 0x19] - b _0806C110 - .pool -_0806BFFC: - ldr r1, [sp, 0x24] - ldr r3, [sp, 0x1C] - adds r2, r1, r3 - ldrb r1, [r2] - movs r0, 0xF0 - ands r0, r1 - lsls r3, r0, 24 - adds r6, r2, 0 - cmp r3, 0 - beq _0806C042 - ldr r7, =gBattleMons - ldr r5, =gActiveBank - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r7 - ldrb r2, [r1, 0x1A] - movs r0, 0x1A - ldrsb r0, [r1, r0] - cmp r0, 0xB - bgt _0806C042 - lsrs r0, r3, 28 - adds r0, r2, r0 - strb r0, [r1, 0x1A] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r7 - movs r0, 0x1A - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _0806C03E - movs r0, 0xC - strb r0, [r1, 0x1A] -_0806C03E: - movs r5, 0 - str r5, [sp, 0x20] -_0806C042: - ldrb r0, [r6] - movs r3, 0xF - ands r3, r0 - cmp r3, 0 - bne _0806C050 - bl _0806CD4C -_0806C050: - ldr r6, =gBattleMons - ldr r5, =gActiveBank - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r6 - ldrb r2, [r1, 0x1B] - movs r0, 0x1B - ldrsb r0, [r1, r0] - cmp r0, 0xB - ble _0806C06A - bl _0806CD4C -_0806C06A: - adds r0, r2, r3 - strb r0, [r1, 0x1B] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r6 - movs r0, 0x1B - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _0806C110 - movs r0, 0xC - strb r0, [r1, 0x1B] - b _0806C110 - .pool -_0806C08C: - ldr r1, [sp, 0x24] - ldr r3, [sp, 0x1C] - adds r2, r1, r3 - ldrb r1, [r2] - movs r0, 0xF0 - ands r0, r1 - lsls r3, r0, 24 - adds r6, r2, 0 - cmp r3, 0 - beq _0806C0D2 - ldr r7, =gBattleMons - ldr r5, =gActiveBank - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r7 - ldrb r2, [r1, 0x1E] - movs r0, 0x1E - ldrsb r0, [r1, r0] - cmp r0, 0xB - bgt _0806C0D2 - lsrs r0, r3, 28 - adds r0, r2, r0 - strb r0, [r1, 0x1E] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r7 - movs r0, 0x1E - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _0806C0CE - movs r0, 0xC - strb r0, [r1, 0x1E] -_0806C0CE: - movs r5, 0 - str r5, [sp, 0x20] -_0806C0D2: - ldrb r0, [r6] - movs r3, 0xF - ands r3, r0 - cmp r3, 0 - bne _0806C0E0 - bl _0806CD4C -_0806C0E0: - ldr r6, =gBattleMons - ldr r5, =gActiveBank - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r6 - ldrb r2, [r1, 0x1C] - movs r0, 0x1C - ldrsb r0, [r1, r0] - cmp r0, 0xB - ble _0806C0FA - bl _0806CD4C -_0806C0FA: - adds r0, r2, r3 - strb r0, [r1, 0x1C] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r6 - movs r0, 0x1C - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _0806C110 - movs r0, 0xC - strb r0, [r1, 0x1C] -_0806C110: - movs r0, 0 - str r0, [sp, 0x20] - bl _0806CD4C - .pool -_0806C120: - ldr r1, [sp, 0x24] - ldr r3, [sp, 0x1C] - adds r2, r1, r3 - ldrb r1, [r2] - movs r0, 0x80 - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - beq _0806C168 - ldr r5, =gSideTimers - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x4] - cmp r0, 0 - bne _0806C168 - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - movs r0, 0x5 - strb r0, [r1, 0x4] - movs r5, 0 - str r5, [sp, 0x20] -_0806C168: - ldrb r1, [r6] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0806C1CA - mov r0, r8 - movs r1, 0x38 - movs r2, 0 - bl GetMonData - cmp r0, 0x64 - beq _0806C1CA - ldr r5, =gExperienceTables - mov r0, r8 - movs r1, 0x38 - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - mov r0, r8 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r4, 0x1 - lsls r4, 2 - ldr r2, =gBaseStats - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r1 - adds r4, r0 - adds r4, r5 - ldr r0, [r4] - str r0, [sp] - mov r0, r8 - movs r1, 0x19 - mov r2, sp - bl SetMonData - mov r0, r8 - bl pokemon_calc_effective_stats - movs r0, 0 - str r0, [sp, 0x20] -_0806C1CA: - ldrb r1, [r6] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0806C206 - mov r0, r8 - ldr r1, [sp, 0x10] - movs r2, 0x7 - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C206 - ldr r1, [sp, 0x38] - cmp r1, 0x4 - beq _0806C202 - ldr r1, =gBattleMons - movs r0, 0x58 - ldr r3, [sp, 0x38] - adds r2, r3, 0 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] -_0806C202: - movs r5, 0 - str r5, [sp, 0x20] -_0806C206: - ldrb r1, [r6] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0806C226 - ldr r2, =0x00000f88 - mov r0, r8 - ldr r1, [sp, 0x10] - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C226 - movs r0, 0 - str r0, [sp, 0x20] -_0806C226: - ldrb r1, [r6] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0806C246 - mov r0, r8 - ldr r1, [sp, 0x10] - movs r2, 0x10 - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C246 - movs r1, 0 - str r1, [sp, 0x20] -_0806C246: - ldrb r1, [r6] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0806C266 - mov r0, r8 - ldr r1, [sp, 0x10] - movs r2, 0x20 - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C266 - movs r2, 0 - str r2, [sp, 0x20] -_0806C266: - ldrb r1, [r6] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806C286 - mov r0, r8 - ldr r1, [sp, 0x10] - movs r2, 0x40 - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C286 - movs r3, 0 - str r3, [sp, 0x20] -_0806C286: - ldrb r1, [r6] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0806C294 - bl _0806CD4C -_0806C294: - ldr r0, =gMain - ldr r5, =0x00000439 - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0806C2A8 - bl _0806CD4C -_0806C2A8: - ldr r0, [sp, 0x38] - cmp r0, 0x4 - bne _0806C2B2 - bl _0806CD4C -_0806C2B2: - ldr r1, =gBattleMons - movs r0, 0x58 - ldr r2, [sp, 0x38] - muls r0, r2 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0806C2CC - bl _0806CD4C -_0806C2CC: - movs r0, 0x8 - negs r0, r0 - ands r1, r0 - str r1, [r2] - movs r3, 0 - str r3, [sp, 0x20] - bl _0806CD4C - .pool -_0806C300: - ldr r5, [sp, 0x24] - ldr r1, [sp, 0x1C] - adds r0, r5, r1 - ldrb r0, [r0] - mov r10, r0 - movs r0, 0x20 - mov r2, r10 - ands r0, r2 - cmp r0, 0 - beq _0806C3D8 - movs r0, 0xDF - ands r2, r0 - mov r10, r2 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl GetMonData - ldr r1, =gUnknown_08329D22 - ldr r3, [sp, 0x14] - adds r1, r3, r1 - ldrb r1, [r1] - ands r0, r1 - lsls r1, r3, 1 - lsrs r0, r1 - str r0, [sp] - adds r5, r3, 0 - adds r5, 0xD - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x2C] - ldr r0, [sp] - cmp r0, 0x2 - bhi _0806C3D8 - ldr r0, [sp, 0x2C] - cmp r0, 0x4 - bls _0806C3D8 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl GetMonData - ldr r1, =gUnknown_08329D2A - ldr r2, [sp, 0x14] - adds r1, r2, r1 - ldrb r1, [r1] - adds r0, r1 - str r0, [sp] - mov r0, r8 - movs r1, 0x15 - mov r2, sp - bl SetMonData - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp] - lsls r1, 24 - lsrs r1, 24 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r3, [sp, 0x2C] - subs r0, r3 - str r0, [sp] - ldr r4, [sp, 0x14] - adds r4, 0x11 - mov r0, r8 - adds r1, r4, 0 - movs r2, 0 - bl GetMonData - ldr r1, [sp] - adds r0, r1 - str r0, [sp] - mov r0, r8 - adds r1, r4, 0 - mov r2, sp - bl SetMonData - movs r5, 0 - str r5, [sp, 0x20] -_0806C3D8: - movs r0, 0 - str r0, [sp, 0x2C] - mov r1, r10 - cmp r1, 0 - bne _0806C3E6 - bl _0806CD4C -_0806C3E6: - movs r0, 0x1 - mov r2, r10 - ands r0, r2 - cmp r0, 0 - bne _0806C3F2 - b _0806C9AA -_0806C3F2: - ldr r3, [sp, 0x2C] - cmp r3, 0x7 - bls _0806C3FA - b _0806C9AA -_0806C3FA: - lsls r0, r3, 2 - ldr r1, =_0806C410 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806C410: - .4byte _0806C430 - .4byte _0806C430 - .4byte _0806C4DC - .4byte _0806C700 - .4byte _0806C9AA - .4byte _0806C9AA - .4byte _0806C9AA - .4byte _0806C994 -_0806C430: - mov r0, r8 - bl sub_806DC8C - lsls r0, 16 - lsrs r6, r0, 16 - ldr r5, [sp, 0x24] - ldr r1, [sp, 0x28] - adds r0, r5, r1 - ldrb r5, [r0] - ldr r0, =gUnknown_08329EC2 - ldr r2, [sp, 0x2C] - adds r0, r2, r0 - ldrb r1, [r0] - mov r0, r8 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - str r1, [sp, 0x4] - lsls r0, r5, 24 - asrs r2, r0, 24 - cmp r2, 0 - ble _0806C498 - ldr r0, =0x000001fd - cmp r6, r0 - bls _0806C466 - b _0806BEF0 -_0806C466: - adds r3, r1, 0 - cmp r3, 0x63 - ble _0806C46E - b _0806C9AA -_0806C46E: - adds r1, r3, r2 - cmp r1, 0x64 - ble _0806C484 - adds r0, r2, 0 - adds r0, 0x64 - subs r5, r0, r1 - b _0806C486 - .pool -_0806C484: - adds r5, r2, 0 -_0806C486: - adds r1, r6, r5 - movs r0, 0xFF - lsls r0, 1 - cmp r1, r0 - bls _0806C494 - adds r0, r5, r0 - subs r5, r0, r1 -_0806C494: - adds r0, r3, r5 - b _0806C4B2 -_0806C498: - cmp r1, 0 - bne _0806C4A8 - movs r3, 0x1 - str r3, [sp, 0x3C] - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - b _0806C83E -_0806C4A8: - adds r0, r1, r2 - str r0, [sp, 0x4] - cmp r0, 0 - bge _0806C4B4 - movs r0, 0 -_0806C4B2: - str r0, [sp, 0x4] -_0806C4B4: - ldr r0, =gUnknown_08329EC2 - ldr r5, [sp, 0x2C] - adds r0, r5, r0 - ldrb r1, [r0] - add r2, sp, 0x4 - mov r0, r8 - bl SetMonData - mov r0, r8 - bl pokemon_calc_effective_stats - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] - b _0806C978 - .pool -_0806C4DC: - movs r0, 0x10 - mov r1, r10 - ands r0, r1 - cmp r0, 0 - beq _0806C59C - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl GetMonData - cmp r0, 0 - beq _0806C4FC - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - b _0806C83E -_0806C4FC: - ldr r0, =gMain - ldr r2, =0x00000439 - adds r0, r2 - ldrb r1, [r0] - movs r4, 0x2 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806C5B2 - ldr r3, [sp, 0x38] - cmp r3, 0x4 - beq _0806C55C - ldr r2, =gAbsentBankFlags - ldr r1, =gBitTable - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r0] - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] - ldr r1, =gBattlePartyID - lsls r0, r3, 1 - adds r0, r1 - ldrb r0, [r0] - bl pokemon_order_func - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, [sp, 0x38] - bl battle_data_fill - ldr r0, =gActiveBank - ldrb r0, [r0] - b _0806C574 - .pool -_0806C55C: - ldr r3, =gAbsentBankFlags - ldr r1, =gBitTable - ldr r2, =gActiveBank - ldrb r0, [r2] - eors r0, r4 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldrb r0, [r3] - bics r0, r1 - strb r0, [r3] - ldrb r0, [r2] -_0806C574: - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0806C5B2 - ldr r1, =gUnknown_03005D10 - ldrb r0, [r1, 0x4] - cmp r0, 0xFE - bhi _0806C5B2 - adds r0, 0x1 - strb r0, [r1, 0x4] - b _0806C5B2 - .pool -_0806C59C: - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl GetMonData - cmp r0, 0 - bne _0806C5B2 - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - b _0806C83E -_0806C5B2: - ldr r1, [sp, 0x28] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] - ldr r5, [sp, 0x24] - adds r1, r5, r1 - ldrb r1, [r1] - str r1, [sp] - adds r0, r1, 0 - cmp r0, 0xFE - beq _0806C5F4 - cmp r0, 0xFE - bhi _0806C5D4 - cmp r0, 0xFD - beq _0806C60A - b _0806C612 -_0806C5D4: - cmp r1, 0xFF - bne _0806C612 - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl GetMonData - subs r4, r0 - str r4, [sp] - b _0806C612 -_0806C5F4: - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - lsrs r0, 1 - str r0, [sp] - cmp r0, 0 - bne _0806C612 - movs r0, 0x1 - b _0806C610 -_0806C60A: - ldr r0, =gBattleScripting - adds r0, 0x23 - ldrb r0, [r0] -_0806C610: - str r0, [sp] -_0806C612: - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl GetMonData - cmp r4, r0 - beq _0806C6F0 - ldr r0, [sp, 0x18] - cmp r0, 0 - bne _0806C6E4 - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl GetMonData - ldr r1, [sp] - adds r0, r1 - str r0, [sp] - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - ldr r1, [sp] - cmp r1, r0 - bls _0806C65E - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - str r0, [sp] -_0806C65E: - mov r0, r8 - movs r1, 0x39 - mov r2, sp - bl SetMonData - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806C6EC - ldr r2, [sp, 0x38] - cmp r2, 0x4 - beq _0806C6EC - ldr r1, =gBattleMons - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldr r1, [sp] - strh r1, [r0, 0x28] - movs r0, 0x10 - mov r3, r10 - ands r0, r3 - cmp r0, 0 - bne _0806C6EC - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0806C6EC - ldr r1, =gUnknown_03005D10 - ldrb r0, [r1, 0x3] - cmp r0, 0xFE - bhi _0806C6AE - adds r0, 0x1 - strb r0, [r1, 0x3] -_0806C6AE: - ldrb r5, [r4] - add r0, sp, 0x38 - ldrb r0, [r0] - strb r0, [r4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x00_a_b_0 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - strb r5, [r4] - b _0806C6EC - .pool -_0806C6E4: - ldr r1, =gBattleMoveDamage - ldr r0, [sp] - negs r0, r0 - str r0, [r1] -_0806C6EC: - movs r1, 0 - str r1, [sp, 0x20] -_0806C6F0: - movs r0, 0xEF - mov r2, r10 - ands r2, r0 - mov r10, r2 - b _0806C9AA - .pool -_0806C700: - movs r7, 0x2 - mov r0, r10 - ands r0, r7 - cmp r0, 0 - beq _0806C70C - b _0806C858 -_0806C70C: - movs r5, 0 - ldr r3, [sp, 0x28] - adds r3, 0x1 - str r3, [sp, 0x40] -_0806C714: - movs r0, 0x11 - adds r0, r5 - mov r9, r0 - mov r0, r8 - mov r1, r9 - movs r2, 0 - bl GetMonData - str r0, [sp] - adds r7, r5, 0 - adds r7, 0xD - mov r0, r8 - adds r1, r7, 0 - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r5, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - adds r2, r6, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp] - cmp r1, r0 - beq _0806C832 - ldr r2, [sp, 0x24] - ldr r3, [sp, 0x28] - adds r0, r2, r3 - ldrb r0, [r0] - adds r0, r1, r0 - str r0, [sp] - mov r0, r8 - adds r1, r7, 0 - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - adds r2, r6, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp] - cmp r1, r0 - bls _0806C7CC - mov r0, r8 - adds r1, r7, 0 - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - adds r2, r6, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] -_0806C7CC: - mov r0, r8 - mov r1, r9 - mov r2, sp - bl SetMonData - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806C82E - ldr r2, [sp, 0x38] - cmp r2, 0x4 - beq _0806C82E - ldr r4, =gBattleMons - movs r0, 0x58 - adds r3, r2, 0 - muls r3, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 14 - ands r1, r0 - cmp r1, 0 - bne _0806C82E - ldr r1, =gDisableStructs - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gBitTable - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0806C82E - adds r0, r5, r3 - adds r1, r4, 0 - adds r1, 0x24 - adds r0, r1 - ldr r1, [sp] - strb r1, [r0] -_0806C82E: - movs r3, 0 - str r3, [sp, 0x20] -_0806C832: - adds r5, 0x1 - cmp r5, 0x3 - bgt _0806C83A - b _0806C714 -_0806C83A: - ldr r5, [sp, 0x40] - lsls r0, r5, 24 -_0806C83E: - lsrs r0, 24 - str r0, [sp, 0x28] - b _0806C9AA - .pool -_0806C858: - ldr r6, [sp, 0x14] - adds r6, 0x11 - mov r0, r8 - adds r1, r6, 0 - movs r2, 0 - bl GetMonData - str r0, [sp] - ldr r5, [sp, 0x14] - adds r5, 0xD - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp] - cmp r2, r0 - bne _0806C8A0 - b _0806C9AA -_0806C8A0: - ldr r1, [sp, 0x28] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] - ldr r0, [sp, 0x24] - adds r1, r0, r1 - ldrb r0, [r1] - adds r0, r2, r0 - str r0, [sp] - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp] - cmp r1, r0 - bls _0806C914 - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] -_0806C914: - mov r0, r8 - adds r1, r6, 0 - mov r2, sp - bl SetMonData - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _0806C978 - ldr r2, [sp, 0x38] - cmp r2, 0x4 - beq _0806C978 - ldr r4, =gBattleMons - movs r0, 0x58 - adds r3, r2, 0 - muls r3, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0806C978 - ldr r1, =gDisableStructs - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gBitTable - ldr r5, [sp, 0x14] - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0806C978 - adds r0, r5, r3 - adds r1, r4, 0 - adds r1, 0x24 - adds r0, r1 - ldr r1, [sp] - strb r1, [r0] -_0806C978: - movs r0, 0 - str r0, [sp, 0x20] - b _0806C9AA - .pool -_0806C994: - mov r0, r8 - movs r1, 0x2 - ldr r2, [sp, 0xC] - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _0806C9AA - bl _0806BEE0 -_0806C9AA: - ldr r1, [sp, 0x2C] - adds r1, 0x1 - str r1, [sp, 0x2C] - mov r2, r10 - lsrs r2, 1 - mov r10, r2 - cmp r2, 0 - beq _0806C9BC - b _0806C3E6 -_0806C9BC: - b _0806CD4C -_0806C9BE: - ldr r3, [sp, 0x24] - ldr r5, [sp, 0x1C] - adds r0, r3, r5 - ldrb r0, [r0] - mov r10, r0 - movs r0, 0 - str r0, [sp, 0x2C] - mov r1, r10 - cmp r1, 0 - bne _0806C9D4 - b _0806CD4C -_0806C9D4: - movs r0, 0x1 - mov r2, r10 - ands r0, r2 - cmp r0, 0 - bne _0806C9E0 - b _0806CD3A -_0806C9E0: - ldr r3, [sp, 0x2C] - cmp r3, 0x7 - bls _0806C9E8 - b _0806CD3A -_0806C9E8: - lsls r0, r3, 2 - ldr r1, =_0806C9F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806C9F8: - .4byte _0806CA18 - .4byte _0806CA18 - .4byte _0806CA18 - .4byte _0806CA18 - .4byte _0806CAB8 - .4byte _0806CB94 - .4byte _0806CC00 - .4byte _0806CC68 -_0806CA18: - mov r0, r8 - bl sub_806DC8C - lsls r0, 16 - lsrs r6, r0, 16 - ldr r5, [sp, 0x24] - ldr r1, [sp, 0x28] - adds r0, r5, r1 - ldrb r5, [r0] - ldr r0, =gUnknown_08329EC2 - ldr r4, [sp, 0x2C] - adds r4, 0x2 - adds r0, r4, r0 - ldrb r1, [r0] - mov r0, r8 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - str r1, [sp, 0x4] - lsls r0, r5, 24 - asrs r2, r0, 24 - cmp r2, 0 - ble _0806CA84 - ldr r0, =0x000001fd - cmp r6, r0 - bls _0806CA52 - bl _0806BEF0 -_0806CA52: - adds r3, r1, 0 - cmp r3, 0x63 - ble _0806CA5A - b _0806CD3A -_0806CA5A: - adds r1, r3, r2 - cmp r1, 0x64 - ble _0806CA70 - adds r0, r2, 0 - adds r0, 0x64 - subs r5, r0, r1 - b _0806CA72 - .pool -_0806CA70: - adds r5, r2, 0 -_0806CA72: - adds r1, r6, r5 - movs r0, 0xFF - lsls r0, 1 - cmp r1, r0 - bls _0806CA80 - adds r0, r5, r0 - subs r5, r0, r1 -_0806CA80: - adds r0, r3, r5 - b _0806CA98 -_0806CA84: - cmp r1, 0 - bne _0806CA8E - movs r2, 0x1 - str r2, [sp, 0x3C] - b _0806CD30 -_0806CA8E: - adds r0, r1, r2 - str r0, [sp, 0x4] - cmp r0, 0 - bge _0806CA9A - movs r0, 0 -_0806CA98: - str r0, [sp, 0x4] -_0806CA9A: - ldr r0, =gUnknown_08329EC2 - adds r0, r4, r0 - ldrb r1, [r0] - add r2, sp, 0x4 - mov r0, r8 - bl SetMonData - mov r0, r8 - bl pokemon_calc_effective_stats - movs r3, 0 - str r3, [sp, 0x20] - b _0806CD30 - .pool -_0806CAB8: - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl GetMonData - ldr r1, =gUnknown_08329D22 - ldr r5, [sp, 0x14] - adds r1, r5, r1 - ldrb r1, [r1] - ands r0, r1 - lsls r1, r5, 1 - lsrs r0, r1 - str r0, [sp] - adds r6, r5, 0 - adds r6, 0xD - mov r0, r8 - adds r1, r6, 0 - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [sp] - cmp r0, 0x2 - bls _0806CB0A - b _0806CD3A -_0806CB0A: - cmp r5, 0x4 - bhi _0806CB10 - b _0806CD3A -_0806CB10: - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl GetMonData - str r0, [sp] - ldr r1, =gUnknown_08329D26 - ldr r2, [sp, 0x14] - adds r1, r2, r1 - ldrb r2, [r1] - ands r2, r0 - str r2, [sp] - ldr r0, =gUnknown_08329D2A - ldr r3, [sp, 0x14] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - adds r2, r0 - str r2, [sp] - mov r0, r8 - movs r1, 0x15 - mov r2, sp - bl SetMonData - mov r0, r8 - adds r1, r6, 0 - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp] - lsls r1, 24 - lsrs r1, 24 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - subs r0, r5 - str r0, [sp] - ldr r4, [sp, 0x14] - adds r4, 0x11 - mov r0, r8 - adds r1, r4, 0 - movs r2, 0 - bl GetMonData - ldr r1, [sp] - adds r0, r1 - str r0, [sp] - mov r0, r8 - adds r1, r4, 0 - mov r2, sp - bl SetMonData - movs r5, 0 - str r5, [sp, 0x20] - b _0806CD3A - .pool -_0806CB94: - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl GetMonData - cmp r0, 0x63 - bls _0806CBA4 - b _0806CD30 -_0806CBA4: - ldr r0, [sp, 0x20] - cmp r0, 0 - beq _0806CBB2 - ldr r1, [sp, 0x3C] - cmp r1, 0 - bne _0806CBB2 - b _0806CD30 -_0806CBB2: - bl sub_806F104 - lsls r0, 24 - cmp r0, 0 - beq _0806CBBE - b _0806CD30 -_0806CBBE: - ldr r2, [sp, 0x30] - cmp r2, 0 - beq _0806CBC6 - b _0806CD30 -_0806CBC6: - ldr r3, [sp, 0x24] - ldr r5, [sp, 0x28] - adds r0, r3, r5 - ldrb r0, [r0] - str r0, [sp, 0x30] - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - str r5, [sp, 0x8] - ldr r0, [sp, 0x30] - lsls r4, r0, 24 - asrs r1, r4, 24 - cmp r1, 0 - ble _0806CCCC - ldr r2, [sp, 0x34] - cmp r2, 0x1B - bne _0806CCCC - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, r5, r0 - str r0, [sp, 0x8] - adds r2, r4, 0 - b _0806CCD8 -_0806CC00: - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl GetMonData - cmp r0, 0x63 - bhi _0806CC10 - b _0806CD30 -_0806CC10: - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl GetMonData - cmp r0, 0xC7 - bls _0806CC20 - b _0806CD30 -_0806CC20: - ldr r0, [sp, 0x20] - cmp r0, 0 - beq _0806CC2E - ldr r1, [sp, 0x3C] - cmp r1, 0 - bne _0806CC2E - b _0806CD30 -_0806CC2E: - bl sub_806F104 - lsls r0, 24 - cmp r0, 0 - bne _0806CD30 - ldr r2, [sp, 0x30] - cmp r2, 0 - bne _0806CD30 - ldr r3, [sp, 0x24] - ldr r5, [sp, 0x28] - adds r0, r3, r5 - ldrb r0, [r0] - str r0, [sp, 0x30] - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - str r4, [sp, 0x8] - ldr r0, [sp, 0x30] - lsls r5, r0, 24 - asrs r1, r5, 24 - cmp r1, 0 - ble _0806CCCC - ldr r2, [sp, 0x34] - cmp r2, 0x1B - beq _0806CCBA - b _0806CCCC -_0806CC68: - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl GetMonData - cmp r0, 0xC7 - bls _0806CD30 - ldr r0, [sp, 0x20] - cmp r0, 0 - beq _0806CC82 - ldr r1, [sp, 0x3C] - cmp r1, 0 - beq _0806CD30 -_0806CC82: - bl sub_806F104 - lsls r0, 24 - cmp r0, 0 - bne _0806CD30 - ldr r2, [sp, 0x30] - cmp r2, 0 - bne _0806CD30 - ldr r3, [sp, 0x24] - ldr r5, [sp, 0x28] - adds r0, r3, r5 - ldrb r0, [r0] - str r0, [sp, 0x30] - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - str r4, [sp, 0x8] - ldr r0, [sp, 0x30] - lsls r5, r0, 24 - asrs r1, r5, 24 - cmp r1, 0 - ble _0806CCCC - ldr r2, [sp, 0x34] - cmp r2, 0x1B - bne _0806CCCC -_0806CCBA: - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, r4, r0 - str r0, [sp, 0x8] - adds r2, r5, 0 - b _0806CCD8 -_0806CCCC: - ldr r3, [sp, 0x30] - lsls r2, r3, 24 - asrs r1, r2, 24 - ldr r0, [sp, 0x8] - adds r0, r1 - str r0, [sp, 0x8] -_0806CCD8: - cmp r2, 0 - ble _0806CD0E - mov r0, r8 - movs r1, 0x26 - movs r2, 0 - bl GetMonData - cmp r0, 0xB - bne _0806CCF0 - ldr r0, [sp, 0x8] - adds r0, 0x1 - str r0, [sp, 0x8] -_0806CCF0: - mov r0, r8 - movs r1, 0x23 - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - bl sav1_map_get_name - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _0806CD0E - ldr r0, [sp, 0x8] - adds r0, 0x1 - str r0, [sp, 0x8] -_0806CD0E: - ldr r0, [sp, 0x8] - cmp r0, 0 - bge _0806CD18 - movs r0, 0 - str r0, [sp, 0x8] -_0806CD18: - ldr r0, [sp, 0x8] - cmp r0, 0xFF - ble _0806CD22 - movs r0, 0xFF - str r0, [sp, 0x8] -_0806CD22: - add r2, sp, 0x8 - mov r0, r8 - movs r1, 0x20 - bl SetMonData - movs r5, 0 - str r5, [sp, 0x20] -_0806CD30: - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] -_0806CD3A: - ldr r0, [sp, 0x2C] - adds r0, 0x1 - str r0, [sp, 0x2C] - mov r1, r10 - lsrs r1, 1 - mov r10, r1 - cmp r1, 0 - beq _0806CD4C - b _0806C9D4 -_0806CD4C: - ldr r2, [sp, 0x1C] - adds r2, 0x1 - str r2, [sp, 0x1C] - cmp r2, 0x5 - bgt _0806CD5A - bl _0806BEFC -_0806CD5A: - ldr r0, [sp, 0x20] -_0806CD5C: - add sp, 0x44 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end ExecuteTableBasedItemEffect - thumb_func_start HealStatusConditions @ bool8 HealStatusConditions(struct pokemon *a1, int a2, u32 healMask, u8 a4) HealStatusConditions: @ 806CD6C @@ -2017,8 +60,8 @@ _0806CDD2: bx r1 thumb_func_end HealStatusConditions - thumb_func_start sub_806CDDC -sub_806CDDC: @ 806CDDC + thumb_func_start GetItemEffectParamOffset +GetItemEffectParamOffset: @ 806CDDC push {r4-r7,lr} lsls r0, 16 lsrs r3, r0, 16 @@ -2027,7 +70,7 @@ sub_806CDDC: @ 806CDDC lsls r2, 24 lsrs r5, r2, 24 movs r7, 0x6 - ldr r1, =gItemEffectInfoPointers + ldr r1, =gItemEffectTable adds r0, r3, 0 subs r0, 0xD lsls r0, 2 @@ -2050,7 +93,7 @@ _0806CE0C: lsls r0, r1, 3 subs r0, r1 lsls r0, 2 - ldr r1, =gUnknown_0202440C + ldr r1, =gEnigmaBerries + 8 adds r0, r1 _0806CE1A: mov r12, r0 @@ -2194,7 +237,7 @@ _0806CF1C: pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_806CDDC + thumb_func_end GetItemEffectParamOffset thumb_func_start sub_806CF24 sub_806CF24: @ 806CF24 @@ -2217,7 +260,7 @@ sub_806CF24: @ 806CF24 ldr r1, =gUnknown_085CB38A bl StringCopy ldr r0, =gUnknown_085CB3AA - bl get_battle_strings_ + bl StrCpyDecodeToDisplayedStringBattle pop {r0} bx r0 .pool @@ -2245,7 +288,7 @@ sub_806CF78: @ 806CF78 lsls r0, r1, 3 subs r0, r1 lsls r0, 2 - ldr r1, =gUnknown_0202440C + ldr r1, =gEnigmaBerries + 8 adds r7, r0, r1 b _0806CFD8 .pool @@ -2257,7 +300,7 @@ _0806CFB8: b _0806CFD6 .pool _0806CFCC: - ldr r1, =gItemEffectInfoPointers + ldr r1, =gItemEffectTable subs r0, 0xD lsls r0, 2 adds r0, r1 @@ -2299,7 +342,7 @@ _0806D020: mov r1, r8 strb r0, [r1] ldr r0, =gUnknown_085CA459 - bl get_battle_strings_ + bl StrCpyDecodeToDisplayedStringBattle _0806D02E: adds r6, 0x2 adds r5, 0x1 @@ -2315,9 +358,9 @@ _0806D02E: ldrb r0, [r0] strb r0, [r1] ldr r0, =gUnknown_085CA424 - bl get_battle_strings_ + bl StrCpyDecodeToDisplayedStringBattle _0806D04E: - ldr r0, =gUnknown_02022E2C + ldr r0, =gDisplayedStringBattle pop {r3} mov r8, r3 pop {r4-r7} @@ -3328,8 +1371,8 @@ _0806D7D4: sub_806D7EC: @ 806D7EC push {r4,r5,lr} movs r5, 0 - ldr r4, =gUnknown_020229E8 - bl link_get_multiplayer_id + ldr r4, =gLinkPlayers + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -3366,7 +1409,7 @@ sub_806D82C: @ 806D82C lsls r0, 24 lsrs r0, 24 movs r3, 0 - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -3400,7 +1443,7 @@ sub_806D864: @ 806D864 lsls r0, 16 lsrs r3, r0, 16 movs r2, 0 - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers b _0806D87C .pool _0806D874: @@ -3514,8 +1557,8 @@ _0806D92E: bx r1 thumb_func_end nature_stat_mod - thumb_func_start happiness_algorithm -happiness_algorithm: @ 806D934 + thumb_func_start AdjustFriendship +AdjustFriendship: @ 806D934 push {r4-r7,lr} sub sp, 0x4 adds r7, r0, 0 @@ -3614,7 +1657,7 @@ _0806D9F0: cmp r0, 0 beq _0806DAC2 ldr r2, =gTrainers - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -3717,10 +1760,10 @@ _0806DAC2: pop {r0} bx r0 .pool - thumb_func_end happiness_algorithm + thumb_func_end AdjustFriendship - thumb_func_start sub_806DADC -sub_806DADC: @ 806DADC + thumb_func_start MonGainEVs +MonGainEVs: @ 806DADC push {r4-r7,lr} mov r7, r8 push {r7} @@ -3752,7 +1795,7 @@ _0806DAF0: _0806DB14: mov r0, r8 movs r1, 0 - bl sub_806DDE4 + bl CheckPartyHasHadPokerus lsls r0, 24 movs r2, 0x1 cmp r0, 0 @@ -3930,10 +1973,10 @@ _0806DC7A: pop {r0} bx r0 .pool - thumb_func_end sub_806DADC + thumb_func_end MonGainEVs - thumb_func_start sub_806DC8C -sub_806DC8C: @ 806DC8C + thumb_func_start GetMonEVCount +GetMonEVCount: @ 806DC8C push {r4-r6,lr} adds r6, r0, 0 movs r5, 0 @@ -3954,10 +1997,10 @@ _0806DC94: pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_806DC8C + thumb_func_end GetMonEVCount - thumb_func_start sub_806DCB4 -sub_806DCB4: @ 806DCB4 + thumb_func_start RandomlyGivePartyPokerus +RandomlyGivePartyPokerus: @ 806DCB4 push {r4-r6,lr} sub sp, 0x4 adds r6, r0, 0 @@ -4004,7 +2047,7 @@ _0806DCDA: adds r0, r1 ldrb r1, [r0] adds r0, r6, 0 - bl sub_806DDE4 + bl CheckPartyHasHadPokerus lsls r0, 24 cmp r0, 0 bne _0806DD70 @@ -4053,10 +2096,10 @@ _0806DD70: pop {r0} bx r0 .pool - thumb_func_end sub_806DCB4 + thumb_func_end RandomlyGivePartyPokerus - thumb_func_start sub_806DD7C -sub_806DD7C: @ 806DD7C + thumb_func_start CheckPartyPokerus +CheckPartyPokerus: @ 806DD7C push {r4-r7,lr} sub sp, 0x4 adds r7, r0, 0 @@ -4110,10 +2153,10 @@ _0806DDD8: pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_806DD7C + thumb_func_end CheckPartyPokerus - thumb_func_start sub_806DDE4 -sub_806DDE4: @ 806DDE4 + thumb_func_start CheckPartyHasHadPokerus +CheckPartyHasHadPokerus: @ 806DDE4 push {r4-r7,lr} sub sp, 0x4 adds r7, r0, 0 @@ -4163,10 +2206,10 @@ _0806DE38: pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_806DDE4 + thumb_func_end CheckPartyHasHadPokerus - thumb_func_start sub_806DE44 -sub_806DE44: @ 806DE44 + thumb_func_start UpdatePartyPokerusTime +UpdatePartyPokerusTime: @ 806DE44 push {r4-r7,lr} sub sp, 0x4 lsls r0, 16 @@ -4232,10 +2275,10 @@ _0806DEB2: pop {r0} bx r0 .pool - thumb_func_end sub_806DE44 + thumb_func_end UpdatePartyPokerusTime - thumb_func_start sub_806DEC4 -sub_806DEC4: @ 806DEC4 + thumb_func_start PartySpreadPokerus +PartySpreadPokerus: @ 806DEC4 push {r4-r7,lr} sub sp, 0x4 adds r7, r0, 0 @@ -4319,10 +2362,10 @@ _0806DF6A: pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_806DEC4 + thumb_func_end PartySpreadPokerus - thumb_func_start sub_806DF74 -sub_806DF74: @ 806DF74 + thumb_func_start TryIncrementMonLevel +TryIncrementMonLevel: @ 806DF74 push {r4-r6,lr} sub sp, 0x8 adds r5, r0, 0 @@ -4394,10 +2437,10 @@ _0806E004: pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_806DF74 + thumb_func_end TryIncrementMonLevel - thumb_func_start sub_806E00C -sub_806E00C: @ 806E00C + thumb_func_start CanMonLearnTMHM +CanMonLearnTMHM: @ 806E00C push {r4,r5,lr} lsls r1, 24 lsrs r4, r1, 24 @@ -4442,10 +2485,10 @@ _0806E05A: pop {r1} bx r1 .pool - thumb_func_end sub_806E00C + thumb_func_end CanMonLearnTMHM - thumb_func_start sub_806E064 -sub_806E064: @ 806E064 + thumb_func_start CanSpeciesLearnTMHM +CanSpeciesLearnTMHM: @ 806E064 push {r4,lr} lsls r0, 16 lsrs r3, r0, 16 @@ -4487,10 +2530,10 @@ _0806E0AA: pop {r1} bx r1 .pool - thumb_func_end sub_806E064 + thumb_func_end CanSpeciesLearnTMHM - thumb_func_start sub_806E0B4 -sub_806E0B4: @ 806E0B4 + thumb_func_start GetMoveRelearnerMoves +GetMoveRelearnerMoves: @ 806E0B4 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -4528,7 +2571,7 @@ _0806E0EA: cmp r5, 0x3 ble _0806E0EA movs r5, 0 - ldr r6, =gLevelUpLearnsetPointers + ldr r6, =gLevelUpLearnsets lsls r1, r7, 2 adds r2, r1, r6 ldr r3, [r2] @@ -4562,7 +2605,7 @@ _0806E118: cmp r1, r0 beq _0806E168 ldr r0, [sp, 0x14] - ldr r1, =gLevelUpLearnsetPointers + ldr r1, =gLevelUpLearnsets adds r6, r0, r1 ldr r2, =0x000001ff mov r8, r2 @@ -4598,7 +2641,7 @@ _0806E168: cmp r2, r0 beq _0806E1AC ldr r1, [sp, 0x14] - ldr r2, =gLevelUpLearnsetPointers + ldr r2, =gLevelUpLearnsets adds r6, r1, r2 ldr r0, =0x000001ff mov r8, r0 @@ -4658,16 +2701,16 @@ _0806E1E4: pop {r1} bx r1 .pool - thumb_func_end sub_806E0B4 + thumb_func_end GetMoveRelearnerMoves - thumb_func_start sub_806E204 -sub_806E204: @ 806E204 + thumb_func_start GetLevelUpMovesBySpecies +GetLevelUpMovesBySpecies: @ 806E204 push {r4-r7,lr} adds r6, r1, 0 lsls r0, 16 movs r5, 0 movs r4, 0 - ldr r1, =gLevelUpLearnsetPointers + ldr r1, =gLevelUpLearnsets lsrs r0, 14 adds r0, r1 ldr r2, [r0] @@ -4703,10 +2746,10 @@ _0806E248: pop {r1} bx r1 .pool - thumb_func_end sub_806E204 + thumb_func_end GetLevelUpMovesBySpecies - thumb_func_start sub_806E25C -sub_806E25C: @ 806E25C + thumb_func_start GetNumberOfRelearnableMoves +GetNumberOfRelearnableMoves: @ 806E25C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -4752,7 +2795,7 @@ _0806E2A0: cmp r5, 0x3 ble _0806E2A0 movs r5, 0 - ldr r3, =gLevelUpLearnsetPointers + ldr r3, =gLevelUpLearnsets ldr r2, [sp, 0x38] adds r1, r2, r3 ldr r0, [r1] @@ -4788,7 +2831,7 @@ _0806E2D0: cmp r1, r0 beq _0806E322 ldr r0, [sp, 0x38] - ldr r1, =gLevelUpLearnsetPointers + ldr r1, =gLevelUpLearnsets adds r6, r0, r1 ldr r2, =0x000001ff mov r8, r2 @@ -4825,7 +2868,7 @@ _0806E322: cmp r2, r0 beq _0806E368 ldr r2, [sp, 0x38] - ldr r0, =gLevelUpLearnsetPointers + ldr r0, =gLevelUpLearnsets adds r6, r2, r0 ldr r2, =0x000001ff mov r8, r2 @@ -4886,10 +2929,10 @@ _0806E3A2: pop {r1} bx r1 .pool - thumb_func_end sub_806E25C + thumb_func_end GetNumberOfRelearnableMoves - thumb_func_start sub_806E3C0 -sub_806E3C0: @ 806E3C0 + thumb_func_start SpeciesToPokedexNum +SpeciesToPokedexNum: @ 806E3C0 push {r4,lr} lsls r0, 16 lsrs r4, r0, 16 @@ -4916,7 +2959,7 @@ _0806E3F2: pop {r4} pop {r1} bx r1 - thumb_func_end sub_806E3C0 + thumb_func_end SpeciesToPokedexNum thumb_func_start sub_806E3F8 sub_806E3F8: @ 806E3F8 @@ -4993,7 +3036,7 @@ _0806E470: ands r0, r1 cmp r0, 0 beq _0806E494 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r0, [r0] bl sub_8162BD8 lsls r0, 24 @@ -5010,7 +3053,7 @@ _0806E494: b _0806E4B2 _0806E4A2: ldr r2, =gTrainers - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -5121,7 +3164,7 @@ _0806E5F2: b _0806E646 .pool _0806E604: - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -5375,12 +3418,12 @@ _0806E7F8: .pool thumb_func_end sub_806E7CC - thumb_func_start sub_806E804 -sub_806E804: @ 806E804 + thumb_func_start IsHMMove2 +IsHMMove2: @ 806E804 push {r4,lr} lsls r0, 16 lsrs r3, r0, 16 - ldr r2, =gUnknown_08329EEA + ldr r2, =gHMMoves ldrh r0, [r2] ldr r1, =0x0000ffff cmp r0, r1 @@ -5406,7 +3449,7 @@ _0806E838: pop {r4} pop {r1} bx r1 - thumb_func_end sub_806E804 + thumb_func_end IsHMMove2 thumb_func_start sub_806E840 sub_806E840: @ 806E840 @@ -5423,15 +3466,15 @@ sub_806E840: @ 806E840 .pool thumb_func_end sub_806E840 - thumb_func_start sub_806E858 -sub_806E858: @ 806E858 + thumb_func_start GetMonFlavourRelation +GetMonFlavourRelation: @ 806E858 push {r4,lr} lsls r4, r1, 24 lsrs r4, 24 bl GetNature lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_085B25A0 + ldr r2, =gPokeblockFlavorCompatibilityTable lsls r1, r0, 2 adds r1, r0 adds r1, r4 @@ -5442,17 +3485,17 @@ sub_806E858: @ 806E858 pop {r1} bx r1 .pool - thumb_func_end sub_806E858 + thumb_func_end GetMonFlavourRelation - thumb_func_start sub_806E880 -sub_806E880: @ 806E880 + thumb_func_start GetFlavourRelationByPersonality +GetFlavourRelationByPersonality: @ 806E880 push {r4,lr} lsls r4, r1, 24 lsrs r4, 24 bl GetNatureFromPersonality lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_085B25A0 + ldr r2, =gPokeblockFlavorCompatibilityTable lsls r1, r0, 2 adds r1, r0 adds r1, r4 @@ -5463,10 +3506,10 @@ sub_806E880: @ 806E880 pop {r1} bx r1 .pool - thumb_func_end sub_806E880 + thumb_func_end GetFlavourRelationByPersonality - thumb_func_start sub_806E8A8 -sub_806E8A8: @ 806E8A8 + thumb_func_start IsTradedMon +IsTradedMon: @ 806E8A8 push {r4,lr} sub sp, 0x8 adds r4, r0, 0 @@ -5478,17 +3521,17 @@ sub_806E8A8: @ 806E8A8 movs r2, 0 bl GetMonData mov r1, sp - bl sub_806E8D4 + bl IsOtherTrainer lsls r0, 24 lsrs r0, 24 add sp, 0x8 pop {r4} pop {r1} bx r1 - thumb_func_end sub_806E8A8 + thumb_func_end IsTradedMon - thumb_func_start sub_806E8D4 -sub_806E8D4: @ 806E8D4 + thumb_func_start IsOtherTrainer +IsOtherTrainer: @ 806E8D4 push {r4,r5,lr} adds r5, r1, 0 ldr r1, =gSaveBlock2Ptr @@ -5531,18 +3574,18 @@ _0806E91E: pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_806E8D4 + thumb_func_end IsOtherTrainer - thumb_func_start sub_806E924 -sub_806E924: @ 806E924 + thumb_func_start MonRestorePP +MonRestorePP: @ 806E924 push {lr} - bl pokemon_restore_pp + bl BoxMonRestorePP pop {r0} bx r0 - thumb_func_end sub_806E924 + thumb_func_end MonRestorePP - thumb_func_start pokemon_restore_pp -pokemon_restore_pp: @ 806E930 + thumb_func_start BoxMonRestorePP +BoxMonRestorePP: @ 806E930 push {r4-r6,lr} sub sp, 0x4 adds r5, r0, 0 @@ -5553,34 +3596,34 @@ _0806E938: adds r0, r5, 0 adds r1, r4, 0 movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _0806E984 adds r0, r5, 0 adds r1, r4, 0 movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x15 movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 lsls r2, r6, 24 lsrs r2, 24 adds r0, r4, 0 - bl CalcPPWithPPUps + bl CalculatePPWithBonus mov r1, sp strb r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r5, 0 mov r2, sp - bl SetMonData_encrypted + bl SetBoxMonData _0806E984: adds r6, 0x1 cmp r6, 0x3 @@ -5589,7 +3632,7 @@ _0806E984: pop {r4-r6} pop {r0} bx r0 - thumb_func_end pokemon_restore_pp + thumb_func_end BoxMonRestorePP thumb_func_start sub_806E994 sub_806E994: @ 806E994 @@ -5655,15 +3698,15 @@ _0806E9F6: strb r0, [r4, 0x4] ldr r0, =gUnknown_085CB2A1 ldr r1, =gStringVar4 - bl get_battle_strings + bl StrCpyDecodeBattle pop {r4,r5} pop {r0} bx r0 .pool thumb_func_end sub_806E994 - thumb_func_start sub_806EA40 -sub_806EA40: @ 806EA40 + thumb_func_start GetWildMonTableIdInAlteringCave +GetWildMonTableIdInAlteringCave: @ 806EA40 push {lr} lsls r0, 16 lsrs r3, r0, 16 @@ -5685,10 +3728,10 @@ _0806EA58: _0806EA62: pop {r1} bx r1 - thumb_func_end sub_806EA40 + thumb_func_end GetWildMonTableIdInAlteringCave - thumb_func_start sub_806EA68 -sub_806EA68: @ 806EA68 + thumb_func_start SetWildMonHeldItem +SetWildMonHeldItem: @ 806EA68 push {r4-r7,lr} mov r7, r8 push {r7} @@ -5740,7 +3783,7 @@ _0806EAC6: cmp r1, r0 bne _0806EB2C adds r0, r4, 0 - bl sub_806EA40 + bl GetWildMonTableIdInAlteringCave adds r2, r0, 0 cmp r2, 0 beq _0806EB04 @@ -5748,7 +3791,7 @@ _0806EAC6: bcc _0806EB90 ldr r0, =gEnemyParty lsls r2, 2 - ldr r1, =gUnknown_08329EFE + ldr r1, =gAlteringCaveWildMonHeldItems b _0806EB6C .pool _0806EB04: @@ -5821,10 +3864,10 @@ _0806EB90: pop {r0} bx r0 .pool - thumb_func_end sub_806EA68 + thumb_func_end SetWildMonHeldItem - thumb_func_start sub_806EBA4 -sub_806EBA4: @ 806EBA4 + thumb_func_start IsMonShiny +IsMonShiny: @ 806EBA4 push {r4,r5,lr} adds r4, r0, 0 movs r1, 0x1 @@ -5837,16 +3880,16 @@ sub_806EBA4: @ 806EBA4 bl GetMonData adds r1, r0, 0 adds r0, r5, 0 - bl sub_806EBD0 + bl IsShinyOtIdPersonality lsls r0, 24 lsrs r0, 24 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_806EBA4 + thumb_func_end IsMonShiny - thumb_func_start sub_806EBD0 -sub_806EBD0: @ 806EBD0 + thumb_func_start IsShinyOtIdPersonality +IsShinyOtIdPersonality: @ 806EBD0 push {r4,lr} movs r4, 0 lsrs r2, r0, 16 @@ -5866,7 +3909,7 @@ _0806EBEA: pop {r1} bx r1 .pool - thumb_func_end sub_806EBD0 + thumb_func_end IsShinyOtIdPersonality thumb_func_start sub_806EBF8 sub_806EBF8: @ 806EBF8 @@ -5895,10 +3938,10 @@ _0806EC28: b _0806EC64 .pool _0806EC3C: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -6241,10 +4284,10 @@ sub_806EF08: @ 806EF08 lsls r0, 24 lsrs r4, r0, 24 movs r5, 0 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -6278,7 +4321,7 @@ _0806EF4C: ands r5, r0 _0806EF56: movs r2, 0 - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers ldrh r0, [r4, 0x18] adds r1, r5, 0 cmp r0, r1 @@ -6310,7 +4353,7 @@ sub_806EF84: @ 806EF84 lsls r1, 24 lsrs r1, 24 movs r4, 0 - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers lsls r0, r1, 3 subs r0, r1 lsls r0, 2 diff --git a/asm/front_pic_anim.s b/asm/pokemon_animation.s similarity index 100% rename from asm/front_pic_anim.s rename to asm/pokemon_animation.s diff --git a/asm/pokemon_item_effect.s b/asm/pokemon_item_effect.s new file mode 100644 index 000000000..2002343eb --- /dev/null +++ b/asm/pokemon_item_effect.s @@ -0,0 +1,1967 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + + thumb_func_start ExecuteTableBasedItemEffect_ +@ bool8 ExecuteTableBasedItemEffect_(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex) +ExecuteTableBasedItemEffect_: @ 806BD04 + push {r4,lr} + sub sp, 0x4 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r4, 0 + str r4, [sp] + bl ExecuteTableBasedItemEffect + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end ExecuteTableBasedItemEffect_ + + thumb_func_start ExecuteTableBasedItemEffect +@ bool8 ExecuteTableBasedItemEffect(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex, u8 a5) +ExecuteTableBasedItemEffect: @ 806BD28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + mov r8, r0 + ldr r0, [sp, 0x64] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0xC] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + movs r0, 0x1 + str r0, [sp, 0x20] + movs r1, 0x6 + str r1, [sp, 0x28] + movs r2, 0 + str r2, [sp, 0x30] + movs r3, 0x4 + str r3, [sp, 0x38] + movs r5, 0 + str r5, [sp, 0x3C] + mov r0, r8 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0806BDBC + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806BDA8 + ldr r2, =gEnigmaBerries + ldr r0, =gUnknown_020244B8 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x7] + b _0806BDC4 + .pool +_0806BDA8: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003226 + adds r0, r2 + ldrb r0, [r0] + b _0806BDC4 + .pool +_0806BDBC: + bl ItemId_GetHoldEffect + lsls r0, 24 + lsrs r0, 24 +_0806BDC4: + str r0, [sp, 0x34] + ldr r1, =gUnknown_0202420F + ldr r0, =gUnknown_020244B8 + ldrb r2, [r0] + strb r2, [r1] + ldr r0, =gMain + ldr r3, =0x00000439 + adds r0, r3 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0806BE64 + ldr r0, =gActiveBank + strb r2, [r0] + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + str r1, [sp, 0x1C] + ldr r0, =gNoOfAllBanks + ldr r4, [sp, 0xC] + subs r4, 0xD + ldrb r0, [r0] + cmp r1, r0 + bge _0806BE70 + ldr r2, =gBattlePartyID + lsls r0, r1, 1 + adds r0, r2 + ldrh r3, [r0] + ldr r5, [sp, 0x10] + lsls r0, r5, 16 + lsrs r1, r0, 16 + adds r5, r0, 0 + cmp r3, r1 + bne _0806BE3C + ldr r0, [sp, 0x1C] + str r0, [sp, 0x38] + b _0806BE70 + .pool +_0806BE3C: + ldr r1, [sp, 0x1C] + adds r1, 0x2 + str r1, [sp, 0x1C] + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r1, r0 + bge _0806BE70 + lsls r0, r1, 1 + adds r0, r2 + ldrh r1, [r0] + lsrs r0, r5, 16 + cmp r1, r0 + bne _0806BE3C + ldr r2, [sp, 0x1C] + lsls r0, r2, 24 + lsrs r0, 24 + str r0, [sp, 0x38] + b _0806BE70 + .pool +_0806BE64: + ldr r0, =gActiveBank + strb r1, [r0] + movs r3, 0x4 + str r3, [sp, 0x38] + ldr r4, [sp, 0xC] + subs r4, 0xD +_0806BE70: + lsls r0, r4, 16 + lsrs r0, 16 + cmp r0, 0xA5 + bhi _0806BEF0 + ldr r1, =gItemEffectTable + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _0806BE94 + ldr r5, [sp, 0xC] + cmp r5, 0xAF + beq _0806BE9A + b _0806BEF0 + .pool +_0806BE94: + ldr r1, [sp, 0xC] + cmp r1, 0xAF + bne _0806BEF6 +_0806BE9A: + ldr r0, =gMain + ldr r2, =0x00000439 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806BECC + ldr r0, =gActiveBank + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =gEnigmaBerries + 8 + adds r0, r1 + b _0806BEF6 + .pool +_0806BECC: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r3, =0x00003214 + adds r3, r0, r3 + str r3, [sp, 0x24] + b _0806BEF8 + .pool +_0806BEE0: + mov r0, r8 + movs r2, 0 + ldr r3, [sp, 0x10] + bl sub_813DA40 + movs r0, 0 + bl _0806CD5C +_0806BEF0: + movs r0, 0x1 + bl _0806CD5C +_0806BEF6: + str r0, [sp, 0x24] +_0806BEF8: + movs r5, 0 + str r5, [sp, 0x1C] +_0806BEFC: + ldr r0, [sp, 0x1C] + cmp r0, 0x5 + bls _0806BF06 + bl _0806CD4C +_0806BF06: + lsls r0, 2 + ldr r1, =_0806BF14 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806BF14: + .4byte _0806BF2C + .4byte _0806BFFC + .4byte _0806C08C + .4byte _0806C120 + .4byte _0806C300 + .4byte _0806C9BE +_0806BF2C: + ldr r1, [sp, 0x24] + ldr r3, [sp, 0x1C] + adds r2, r1, r3 + ldrb r1, [r2] + movs r0, 0x80 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + beq _0806BF76 + ldr r0, =gMain + ldr r5, =0x00000439 + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806BF76 + ldr r0, [sp, 0x38] + cmp r0, 0x4 + beq _0806BF76 + ldr r1, =gBattleMons + movs r0, 0x58 + ldr r2, [sp, 0x38] + muls r0, r2 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0xF0 + lsls r0, 12 + ands r0, r1 + cmp r0, 0 + beq _0806BF76 + ldr r0, =0xfff0ffff + ands r1, r0 + str r1, [r2] + movs r3, 0 + str r3, [sp, 0x20] +_0806BF76: + ldrb r1, [r6] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + beq _0806BFA4 + ldr r1, =gBattleMons + ldr r0, =gActiveBank + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 13 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + bne _0806BFA4 + orrs r1, r3 + str r1, [r2] + movs r5, 0 + str r5, [sp, 0x20] +_0806BFA4: + ldrb r0, [r6] + movs r3, 0xF + ands r3, r0 + cmp r3, 0 + bne _0806BFB2 + bl _0806CD4C +_0806BFB2: + ldr r6, =gBattleMons + ldr r5, =gActiveBank + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r6 + ldrb r2, [r1, 0x19] + movs r0, 0x19 + ldrsb r0, [r1, r0] + cmp r0, 0xB + ble _0806BFCC + bl _0806CD4C +_0806BFCC: + adds r0, r2, r3 + strb r0, [r1, 0x19] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r6 + movs r0, 0x19 + ldrsb r0, [r1, r0] + cmp r0, 0xC + bgt _0806BFE0 + b _0806C110 +_0806BFE0: + movs r0, 0xC + strb r0, [r1, 0x19] + b _0806C110 + .pool +_0806BFFC: + ldr r1, [sp, 0x24] + ldr r3, [sp, 0x1C] + adds r2, r1, r3 + ldrb r1, [r2] + movs r0, 0xF0 + ands r0, r1 + lsls r3, r0, 24 + adds r6, r2, 0 + cmp r3, 0 + beq _0806C042 + ldr r7, =gBattleMons + ldr r5, =gActiveBank + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r7 + ldrb r2, [r1, 0x1A] + movs r0, 0x1A + ldrsb r0, [r1, r0] + cmp r0, 0xB + bgt _0806C042 + lsrs r0, r3, 28 + adds r0, r2, r0 + strb r0, [r1, 0x1A] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r7 + movs r0, 0x1A + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _0806C03E + movs r0, 0xC + strb r0, [r1, 0x1A] +_0806C03E: + movs r5, 0 + str r5, [sp, 0x20] +_0806C042: + ldrb r0, [r6] + movs r3, 0xF + ands r3, r0 + cmp r3, 0 + bne _0806C050 + bl _0806CD4C +_0806C050: + ldr r6, =gBattleMons + ldr r5, =gActiveBank + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r6 + ldrb r2, [r1, 0x1B] + movs r0, 0x1B + ldrsb r0, [r1, r0] + cmp r0, 0xB + ble _0806C06A + bl _0806CD4C +_0806C06A: + adds r0, r2, r3 + strb r0, [r1, 0x1B] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r6 + movs r0, 0x1B + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _0806C110 + movs r0, 0xC + strb r0, [r1, 0x1B] + b _0806C110 + .pool +_0806C08C: + ldr r1, [sp, 0x24] + ldr r3, [sp, 0x1C] + adds r2, r1, r3 + ldrb r1, [r2] + movs r0, 0xF0 + ands r0, r1 + lsls r3, r0, 24 + adds r6, r2, 0 + cmp r3, 0 + beq _0806C0D2 + ldr r7, =gBattleMons + ldr r5, =gActiveBank + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r7 + ldrb r2, [r1, 0x1E] + movs r0, 0x1E + ldrsb r0, [r1, r0] + cmp r0, 0xB + bgt _0806C0D2 + lsrs r0, r3, 28 + adds r0, r2, r0 + strb r0, [r1, 0x1E] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r7 + movs r0, 0x1E + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _0806C0CE + movs r0, 0xC + strb r0, [r1, 0x1E] +_0806C0CE: + movs r5, 0 + str r5, [sp, 0x20] +_0806C0D2: + ldrb r0, [r6] + movs r3, 0xF + ands r3, r0 + cmp r3, 0 + bne _0806C0E0 + bl _0806CD4C +_0806C0E0: + ldr r6, =gBattleMons + ldr r5, =gActiveBank + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r6 + ldrb r2, [r1, 0x1C] + movs r0, 0x1C + ldrsb r0, [r1, r0] + cmp r0, 0xB + ble _0806C0FA + bl _0806CD4C +_0806C0FA: + adds r0, r2, r3 + strb r0, [r1, 0x1C] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r6 + movs r0, 0x1C + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _0806C110 + movs r0, 0xC + strb r0, [r1, 0x1C] +_0806C110: + movs r0, 0 + str r0, [sp, 0x20] + bl _0806CD4C + .pool +_0806C120: + ldr r1, [sp, 0x24] + ldr r3, [sp, 0x1C] + adds r2, r1, r3 + ldrb r1, [r2] + movs r0, 0x80 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + beq _0806C168 + ldr r5, =gSideTimers + ldr r4, =gActiveBank + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _0806C168 + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + movs r0, 0x5 + strb r0, [r1, 0x4] + movs r5, 0 + str r5, [sp, 0x20] +_0806C168: + ldrb r1, [r6] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0806C1CA + mov r0, r8 + movs r1, 0x38 + movs r2, 0 + bl GetMonData + cmp r0, 0x64 + beq _0806C1CA + ldr r5, =gExperienceTables + mov r0, r8 + movs r1, 0x38 + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + mov r0, r8 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r4, 0x1 + lsls r4, 2 + ldr r2, =gBaseStats + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r1 + adds r4, r0 + adds r4, r5 + ldr r0, [r4] + str r0, [sp] + mov r0, r8 + movs r1, 0x19 + mov r2, sp + bl SetMonData + mov r0, r8 + bl CalculateMonStats + movs r0, 0 + str r0, [sp, 0x20] +_0806C1CA: + ldrb r1, [r6] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0806C206 + mov r0, r8 + ldr r1, [sp, 0x10] + movs r2, 0x7 + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C206 + ldr r1, [sp, 0x38] + cmp r1, 0x4 + beq _0806C202 + ldr r1, =gBattleMons + movs r0, 0x58 + ldr r3, [sp, 0x38] + adds r2, r3, 0 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] +_0806C202: + movs r5, 0 + str r5, [sp, 0x20] +_0806C206: + ldrb r1, [r6] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0806C226 + ldr r2, =0x00000f88 + mov r0, r8 + ldr r1, [sp, 0x10] + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C226 + movs r0, 0 + str r0, [sp, 0x20] +_0806C226: + ldrb r1, [r6] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0806C246 + mov r0, r8 + ldr r1, [sp, 0x10] + movs r2, 0x10 + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C246 + movs r1, 0 + str r1, [sp, 0x20] +_0806C246: + ldrb r1, [r6] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0806C266 + mov r0, r8 + ldr r1, [sp, 0x10] + movs r2, 0x20 + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C266 + movs r2, 0 + str r2, [sp, 0x20] +_0806C266: + ldrb r1, [r6] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806C286 + mov r0, r8 + ldr r1, [sp, 0x10] + movs r2, 0x40 + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C286 + movs r3, 0 + str r3, [sp, 0x20] +_0806C286: + ldrb r1, [r6] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0806C294 + bl _0806CD4C +_0806C294: + ldr r0, =gMain + ldr r5, =0x00000439 + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0806C2A8 + bl _0806CD4C +_0806C2A8: + ldr r0, [sp, 0x38] + cmp r0, 0x4 + bne _0806C2B2 + bl _0806CD4C +_0806C2B2: + ldr r1, =gBattleMons + movs r0, 0x58 + ldr r2, [sp, 0x38] + muls r0, r2 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0806C2CC + bl _0806CD4C +_0806C2CC: + movs r0, 0x8 + negs r0, r0 + ands r1, r0 + str r1, [r2] + movs r3, 0 + str r3, [sp, 0x20] + bl _0806CD4C + .pool +_0806C300: + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x1C] + adds r0, r5, r1 + ldrb r0, [r0] + mov r10, r0 + movs r0, 0x20 + mov r2, r10 + ands r0, r2 + cmp r0, 0 + beq _0806C3D8 + movs r0, 0xDF + ands r2, r0 + mov r10, r2 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl GetMonData + ldr r1, =gUnknown_08329D22 + ldr r3, [sp, 0x14] + adds r1, r3, r1 + ldrb r1, [r1] + ands r0, r1 + lsls r1, r3, 1 + lsrs r0, r1 + str r0, [sp] + adds r5, r3, 0 + adds r5, 0xD + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x2C] + ldr r0, [sp] + cmp r0, 0x2 + bhi _0806C3D8 + ldr r0, [sp, 0x2C] + cmp r0, 0x4 + bls _0806C3D8 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl GetMonData + ldr r1, =gUnknown_08329D2A + ldr r2, [sp, 0x14] + adds r1, r2, r1 + ldrb r1, [r1] + adds r0, r1 + str r0, [sp] + mov r0, r8 + movs r1, 0x15 + mov r2, sp + bl SetMonData + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp] + lsls r1, 24 + lsrs r1, 24 + ldr r2, [sp, 0x14] + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r0, 24 + ldr r3, [sp, 0x2C] + subs r0, r3 + str r0, [sp] + ldr r4, [sp, 0x14] + adds r4, 0x11 + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + bl GetMonData + ldr r1, [sp] + adds r0, r1 + str r0, [sp] + mov r0, r8 + adds r1, r4, 0 + mov r2, sp + bl SetMonData + movs r5, 0 + str r5, [sp, 0x20] +_0806C3D8: + movs r0, 0 + str r0, [sp, 0x2C] + mov r1, r10 + cmp r1, 0 + bne _0806C3E6 + bl _0806CD4C +_0806C3E6: + movs r0, 0x1 + mov r2, r10 + ands r0, r2 + cmp r0, 0 + bne _0806C3F2 + b _0806C9AA +_0806C3F2: + ldr r3, [sp, 0x2C] + cmp r3, 0x7 + bls _0806C3FA + b _0806C9AA +_0806C3FA: + lsls r0, r3, 2 + ldr r1, =_0806C410 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806C410: + .4byte _0806C430 + .4byte _0806C430 + .4byte _0806C4DC + .4byte _0806C700 + .4byte _0806C9AA + .4byte _0806C9AA + .4byte _0806C9AA + .4byte _0806C994 +_0806C430: + mov r0, r8 + bl GetMonEVCount + lsls r0, 16 + lsrs r6, r0, 16 + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x28] + adds r0, r5, r1 + ldrb r5, [r0] + ldr r0, =gUnknown_08329EC2 + ldr r2, [sp, 0x2C] + adds r0, r2, r0 + ldrb r1, [r0] + mov r0, r8 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + str r1, [sp, 0x4] + lsls r0, r5, 24 + asrs r2, r0, 24 + cmp r2, 0 + ble _0806C498 + ldr r0, =0x000001fd + cmp r6, r0 + bls _0806C466 + b _0806BEF0 +_0806C466: + adds r3, r1, 0 + cmp r3, 0x63 + ble _0806C46E + b _0806C9AA +_0806C46E: + adds r1, r3, r2 + cmp r1, 0x64 + ble _0806C484 + adds r0, r2, 0 + adds r0, 0x64 + subs r5, r0, r1 + b _0806C486 + .pool +_0806C484: + adds r5, r2, 0 +_0806C486: + adds r1, r6, r5 + movs r0, 0xFF + lsls r0, 1 + cmp r1, r0 + bls _0806C494 + adds r0, r5, r0 + subs r5, r0, r1 +_0806C494: + adds r0, r3, r5 + b _0806C4B2 +_0806C498: + cmp r1, 0 + bne _0806C4A8 + movs r3, 0x1 + str r3, [sp, 0x3C] + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + b _0806C83E +_0806C4A8: + adds r0, r1, r2 + str r0, [sp, 0x4] + cmp r0, 0 + bge _0806C4B4 + movs r0, 0 +_0806C4B2: + str r0, [sp, 0x4] +_0806C4B4: + ldr r0, =gUnknown_08329EC2 + ldr r5, [sp, 0x2C] + adds r0, r5, r0 + ldrb r1, [r0] + add r2, sp, 0x4 + mov r0, r8 + bl SetMonData + mov r0, r8 + bl CalculateMonStats + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + b _0806C978 + .pool +_0806C4DC: + movs r0, 0x10 + mov r1, r10 + ands r0, r1 + cmp r0, 0 + beq _0806C59C + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl GetMonData + cmp r0, 0 + beq _0806C4FC + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + b _0806C83E +_0806C4FC: + ldr r0, =gMain + ldr r2, =0x00000439 + adds r0, r2 + ldrb r1, [r0] + movs r4, 0x2 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806C5B2 + ldr r3, [sp, 0x38] + cmp r3, 0x4 + beq _0806C55C + ldr r2, =gAbsentBankFlags + ldr r1, =gBitTable + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r0] + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + ldr r1, =gBattlePartyID + lsls r0, r3, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, [sp, 0x38] + bl CopyPlayerPartyMonToBattleData + ldr r0, =gActiveBank + ldrb r0, [r0] + b _0806C574 + .pool +_0806C55C: + ldr r3, =gAbsentBankFlags + ldr r1, =gBitTable + ldr r2, =gActiveBank + ldrb r0, [r2] + eors r0, r4 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldrb r0, [r3] + bics r0, r1 + strb r0, [r3] + ldrb r0, [r2] +_0806C574: + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0806C5B2 + ldr r1, =gBattleResults + ldrb r0, [r1, 0x4] + cmp r0, 0xFE + bhi _0806C5B2 + adds r0, 0x1 + strb r0, [r1, 0x4] + b _0806C5B2 + .pool +_0806C59C: + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl GetMonData + cmp r0, 0 + bne _0806C5B2 + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + b _0806C83E +_0806C5B2: + ldr r1, [sp, 0x28] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + ldr r5, [sp, 0x24] + adds r1, r5, r1 + ldrb r1, [r1] + str r1, [sp] + adds r0, r1, 0 + cmp r0, 0xFE + beq _0806C5F4 + cmp r0, 0xFE + bhi _0806C5D4 + cmp r0, 0xFD + beq _0806C60A + b _0806C612 +_0806C5D4: + cmp r1, 0xFF + bne _0806C612 + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl GetMonData + subs r4, r0 + str r4, [sp] + b _0806C612 +_0806C5F4: + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + lsrs r0, 1 + str r0, [sp] + cmp r0, 0 + bne _0806C612 + movs r0, 0x1 + b _0806C610 +_0806C60A: + ldr r0, =gBattleScripting + adds r0, 0x23 + ldrb r0, [r0] +_0806C610: + str r0, [sp] +_0806C612: + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl GetMonData + cmp r4, r0 + beq _0806C6F0 + ldr r0, [sp, 0x18] + cmp r0, 0 + bne _0806C6E4 + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl GetMonData + ldr r1, [sp] + adds r0, r1 + str r0, [sp] + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + ldr r1, [sp] + cmp r1, r0 + bls _0806C65E + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + str r0, [sp] +_0806C65E: + mov r0, r8 + movs r1, 0x39 + mov r2, sp + bl SetMonData + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806C6EC + ldr r2, [sp, 0x38] + cmp r2, 0x4 + beq _0806C6EC + ldr r1, =gBattleMons + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldr r1, [sp] + strh r1, [r0, 0x28] + movs r0, 0x10 + mov r3, r10 + ands r0, r3 + cmp r0, 0 + bne _0806C6EC + ldr r4, =gActiveBank + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0806C6EC + ldr r1, =gBattleResults + ldrb r0, [r1, 0x3] + cmp r0, 0xFE + bhi _0806C6AE + adds r0, 0x1 + strb r0, [r1, 0x3] +_0806C6AE: + ldrb r5, [r4] + add r0, sp, 0x38 + ldrb r0, [r0] + strb r0, [r4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x00_a_b_0 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + strb r5, [r4] + b _0806C6EC + .pool +_0806C6E4: + ldr r1, =gBattleMoveDamage + ldr r0, [sp] + negs r0, r0 + str r0, [r1] +_0806C6EC: + movs r1, 0 + str r1, [sp, 0x20] +_0806C6F0: + movs r0, 0xEF + mov r2, r10 + ands r2, r0 + mov r10, r2 + b _0806C9AA + .pool +_0806C700: + movs r7, 0x2 + mov r0, r10 + ands r0, r7 + cmp r0, 0 + beq _0806C70C + b _0806C858 +_0806C70C: + movs r5, 0 + ldr r3, [sp, 0x28] + adds r3, 0x1 + str r3, [sp, 0x40] +_0806C714: + movs r0, 0x11 + adds r0, r5 + mov r9, r0 + mov r0, r8 + mov r1, r9 + movs r2, 0 + bl GetMonData + str r0, [sp] + adds r7, r5, 0 + adds r7, 0xD + mov r0, r8 + adds r1, r7, 0 + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r5, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + adds r2, r6, 0 + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp] + cmp r1, r0 + beq _0806C832 + ldr r2, [sp, 0x24] + ldr r3, [sp, 0x28] + adds r0, r2, r3 + ldrb r0, [r0] + adds r0, r1, r0 + str r0, [sp] + mov r0, r8 + adds r1, r7, 0 + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + adds r2, r6, 0 + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp] + cmp r1, r0 + bls _0806C7CC + mov r0, r8 + adds r1, r7, 0 + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + adds r2, r6, 0 + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] +_0806C7CC: + mov r0, r8 + mov r1, r9 + mov r2, sp + bl SetMonData + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806C82E + ldr r2, [sp, 0x38] + cmp r2, 0x4 + beq _0806C82E + ldr r4, =gBattleMons + movs r0, 0x58 + adds r3, r2, 0 + muls r3, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 14 + ands r1, r0 + cmp r1, 0 + bne _0806C82E + ldr r1, =gDisableStructs + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gBitTable + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0806C82E + adds r0, r5, r3 + adds r1, r4, 0 + adds r1, 0x24 + adds r0, r1 + ldr r1, [sp] + strb r1, [r0] +_0806C82E: + movs r3, 0 + str r3, [sp, 0x20] +_0806C832: + adds r5, 0x1 + cmp r5, 0x3 + bgt _0806C83A + b _0806C714 +_0806C83A: + ldr r5, [sp, 0x40] + lsls r0, r5, 24 +_0806C83E: + lsrs r0, 24 + str r0, [sp, 0x28] + b _0806C9AA + .pool +_0806C858: + ldr r6, [sp, 0x14] + adds r6, 0x11 + mov r0, r8 + adds r1, r6, 0 + movs r2, 0 + bl GetMonData + str r0, [sp] + ldr r5, [sp, 0x14] + adds r5, 0xD + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp] + cmp r2, r0 + bne _0806C8A0 + b _0806C9AA +_0806C8A0: + ldr r1, [sp, 0x28] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + ldr r0, [sp, 0x24] + adds r1, r0, r1 + ldrb r0, [r1] + adds r0, r2, r0 + str r0, [sp] + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp] + cmp r1, r0 + bls _0806C914 + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] +_0806C914: + mov r0, r8 + adds r1, r6, 0 + mov r2, sp + bl SetMonData + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0806C978 + ldr r2, [sp, 0x38] + cmp r2, 0x4 + beq _0806C978 + ldr r4, =gBattleMons + movs r0, 0x58 + adds r3, r2, 0 + muls r3, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0806C978 + ldr r1, =gDisableStructs + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gBitTable + ldr r5, [sp, 0x14] + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0806C978 + adds r0, r5, r3 + adds r1, r4, 0 + adds r1, 0x24 + adds r0, r1 + ldr r1, [sp] + strb r1, [r0] +_0806C978: + movs r0, 0 + str r0, [sp, 0x20] + b _0806C9AA + .pool +_0806C994: + mov r0, r8 + movs r1, 0x2 + ldr r2, [sp, 0xC] + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0806C9AA + bl _0806BEE0 +_0806C9AA: + ldr r1, [sp, 0x2C] + adds r1, 0x1 + str r1, [sp, 0x2C] + mov r2, r10 + lsrs r2, 1 + mov r10, r2 + cmp r2, 0 + beq _0806C9BC + b _0806C3E6 +_0806C9BC: + b _0806CD4C +_0806C9BE: + ldr r3, [sp, 0x24] + ldr r5, [sp, 0x1C] + adds r0, r3, r5 + ldrb r0, [r0] + mov r10, r0 + movs r0, 0 + str r0, [sp, 0x2C] + mov r1, r10 + cmp r1, 0 + bne _0806C9D4 + b _0806CD4C +_0806C9D4: + movs r0, 0x1 + mov r2, r10 + ands r0, r2 + cmp r0, 0 + bne _0806C9E0 + b _0806CD3A +_0806C9E0: + ldr r3, [sp, 0x2C] + cmp r3, 0x7 + bls _0806C9E8 + b _0806CD3A +_0806C9E8: + lsls r0, r3, 2 + ldr r1, =_0806C9F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806C9F8: + .4byte _0806CA18 + .4byte _0806CA18 + .4byte _0806CA18 + .4byte _0806CA18 + .4byte _0806CAB8 + .4byte _0806CB94 + .4byte _0806CC00 + .4byte _0806CC68 +_0806CA18: + mov r0, r8 + bl GetMonEVCount + lsls r0, 16 + lsrs r6, r0, 16 + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x28] + adds r0, r5, r1 + ldrb r5, [r0] + ldr r0, =gUnknown_08329EC2 + ldr r4, [sp, 0x2C] + adds r4, 0x2 + adds r0, r4, r0 + ldrb r1, [r0] + mov r0, r8 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + str r1, [sp, 0x4] + lsls r0, r5, 24 + asrs r2, r0, 24 + cmp r2, 0 + ble _0806CA84 + ldr r0, =0x000001fd + cmp r6, r0 + bls _0806CA52 + bl _0806BEF0 +_0806CA52: + adds r3, r1, 0 + cmp r3, 0x63 + ble _0806CA5A + b _0806CD3A +_0806CA5A: + adds r1, r3, r2 + cmp r1, 0x64 + ble _0806CA70 + adds r0, r2, 0 + adds r0, 0x64 + subs r5, r0, r1 + b _0806CA72 + .pool +_0806CA70: + adds r5, r2, 0 +_0806CA72: + adds r1, r6, r5 + movs r0, 0xFF + lsls r0, 1 + cmp r1, r0 + bls _0806CA80 + adds r0, r5, r0 + subs r5, r0, r1 +_0806CA80: + adds r0, r3, r5 + b _0806CA98 +_0806CA84: + cmp r1, 0 + bne _0806CA8E + movs r2, 0x1 + str r2, [sp, 0x3C] + b _0806CD30 +_0806CA8E: + adds r0, r1, r2 + str r0, [sp, 0x4] + cmp r0, 0 + bge _0806CA9A + movs r0, 0 +_0806CA98: + str r0, [sp, 0x4] +_0806CA9A: + ldr r0, =gUnknown_08329EC2 + adds r0, r4, r0 + ldrb r1, [r0] + add r2, sp, 0x4 + mov r0, r8 + bl SetMonData + mov r0, r8 + bl CalculateMonStats + movs r3, 0 + str r3, [sp, 0x20] + b _0806CD30 + .pool +_0806CAB8: + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl GetMonData + ldr r1, =gUnknown_08329D22 + ldr r5, [sp, 0x14] + adds r1, r5, r1 + ldrb r1, [r1] + ands r0, r1 + lsls r1, r5, 1 + lsrs r0, r1 + str r0, [sp] + adds r6, r5, 0 + adds r6, 0xD + mov r0, r8 + adds r1, r6, 0 + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [sp] + cmp r0, 0x2 + bls _0806CB0A + b _0806CD3A +_0806CB0A: + cmp r5, 0x4 + bhi _0806CB10 + b _0806CD3A +_0806CB10: + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl GetMonData + str r0, [sp] + ldr r1, =gUnknown_08329D26 + ldr r2, [sp, 0x14] + adds r1, r2, r1 + ldrb r2, [r1] + ands r2, r0 + str r2, [sp] + ldr r0, =gUnknown_08329D2A + ldr r3, [sp, 0x14] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + adds r2, r0 + str r2, [sp] + mov r0, r8 + movs r1, 0x15 + mov r2, sp + bl SetMonData + mov r0, r8 + adds r1, r6, 0 + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp] + lsls r1, 24 + lsrs r1, 24 + ldr r2, [sp, 0x14] + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r0, 24 + subs r0, r5 + str r0, [sp] + ldr r4, [sp, 0x14] + adds r4, 0x11 + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + bl GetMonData + ldr r1, [sp] + adds r0, r1 + str r0, [sp] + mov r0, r8 + adds r1, r4, 0 + mov r2, sp + bl SetMonData + movs r5, 0 + str r5, [sp, 0x20] + b _0806CD3A + .pool +_0806CB94: + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl GetMonData + cmp r0, 0x63 + bls _0806CBA4 + b _0806CD30 +_0806CBA4: + ldr r0, [sp, 0x20] + cmp r0, 0 + beq _0806CBB2 + ldr r1, [sp, 0x3C] + cmp r1, 0 + bne _0806CBB2 + b _0806CD30 +_0806CBB2: + bl sub_806F104 + lsls r0, 24 + cmp r0, 0 + beq _0806CBBE + b _0806CD30 +_0806CBBE: + ldr r2, [sp, 0x30] + cmp r2, 0 + beq _0806CBC6 + b _0806CD30 +_0806CBC6: + ldr r3, [sp, 0x24] + ldr r5, [sp, 0x28] + adds r0, r3, r5 + ldrb r0, [r0] + str r0, [sp, 0x30] + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + str r5, [sp, 0x8] + ldr r0, [sp, 0x30] + lsls r4, r0, 24 + asrs r1, r4, 24 + cmp r1, 0 + ble _0806CCCC + ldr r2, [sp, 0x34] + cmp r2, 0x1B + bne _0806CCCC + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, r5, r0 + str r0, [sp, 0x8] + adds r2, r4, 0 + b _0806CCD8 +_0806CC00: + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl GetMonData + cmp r0, 0x63 + bhi _0806CC10 + b _0806CD30 +_0806CC10: + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl GetMonData + cmp r0, 0xC7 + bls _0806CC20 + b _0806CD30 +_0806CC20: + ldr r0, [sp, 0x20] + cmp r0, 0 + beq _0806CC2E + ldr r1, [sp, 0x3C] + cmp r1, 0 + bne _0806CC2E + b _0806CD30 +_0806CC2E: + bl sub_806F104 + lsls r0, 24 + cmp r0, 0 + bne _0806CD30 + ldr r2, [sp, 0x30] + cmp r2, 0 + bne _0806CD30 + ldr r3, [sp, 0x24] + ldr r5, [sp, 0x28] + adds r0, r3, r5 + ldrb r0, [r0] + str r0, [sp, 0x30] + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + str r4, [sp, 0x8] + ldr r0, [sp, 0x30] + lsls r5, r0, 24 + asrs r1, r5, 24 + cmp r1, 0 + ble _0806CCCC + ldr r2, [sp, 0x34] + cmp r2, 0x1B + beq _0806CCBA + b _0806CCCC +_0806CC68: + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl GetMonData + cmp r0, 0xC7 + bls _0806CD30 + ldr r0, [sp, 0x20] + cmp r0, 0 + beq _0806CC82 + ldr r1, [sp, 0x3C] + cmp r1, 0 + beq _0806CD30 +_0806CC82: + bl sub_806F104 + lsls r0, 24 + cmp r0, 0 + bne _0806CD30 + ldr r2, [sp, 0x30] + cmp r2, 0 + bne _0806CD30 + ldr r3, [sp, 0x24] + ldr r5, [sp, 0x28] + adds r0, r3, r5 + ldrb r0, [r0] + str r0, [sp, 0x30] + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + str r4, [sp, 0x8] + ldr r0, [sp, 0x30] + lsls r5, r0, 24 + asrs r1, r5, 24 + cmp r1, 0 + ble _0806CCCC + ldr r2, [sp, 0x34] + cmp r2, 0x1B + bne _0806CCCC +_0806CCBA: + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, r4, r0 + str r0, [sp, 0x8] + adds r2, r5, 0 + b _0806CCD8 +_0806CCCC: + ldr r3, [sp, 0x30] + lsls r2, r3, 24 + asrs r1, r2, 24 + ldr r0, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x8] +_0806CCD8: + cmp r2, 0 + ble _0806CD0E + mov r0, r8 + movs r1, 0x26 + movs r2, 0 + bl GetMonData + cmp r0, 0xB + bne _0806CCF0 + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x8] +_0806CCF0: + mov r0, r8 + movs r1, 0x23 + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + bl sav1_map_get_name + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0806CD0E + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x8] +_0806CD0E: + ldr r0, [sp, 0x8] + cmp r0, 0 + bge _0806CD18 + movs r0, 0 + str r0, [sp, 0x8] +_0806CD18: + ldr r0, [sp, 0x8] + cmp r0, 0xFF + ble _0806CD22 + movs r0, 0xFF + str r0, [sp, 0x8] +_0806CD22: + add r2, sp, 0x8 + mov r0, r8 + movs r1, 0x20 + bl SetMonData + movs r5, 0 + str r5, [sp, 0x20] +_0806CD30: + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] +_0806CD3A: + ldr r0, [sp, 0x2C] + adds r0, 0x1 + str r0, [sp, 0x2C] + mov r1, r10 + lsrs r1, 1 + mov r10, r1 + cmp r1, 0 + beq _0806CD4C + b _0806C9D4 +_0806CD4C: + ldr r2, [sp, 0x1C] + adds r2, 0x1 + str r2, [sp, 0x1C] + cmp r2, 0x5 + bgt _0806CD5A + bl _0806BEFC +_0806CD5A: + ldr r0, [sp, 0x20] +_0806CD5C: + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end ExecuteTableBasedItemEffect + + .align 2, 0 @ Don't pad with nop. + \ No newline at end of file diff --git a/asm/porthole.s b/asm/porthole.s index 42ecc303a..282f6f584 100644 --- a/asm/porthole.s +++ b/asm/porthole.s @@ -246,7 +246,7 @@ sub_80FB768: @ 80FB768 ldr r0, =sub_80FB5E8 movs r1, 0x50 bl CreateTask - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 .pool diff --git a/asm/record_mixing.s b/asm/record_mixing.s index 9efd38fe0..a28af9a9a 100644 --- a/asm/record_mixing.s +++ b/asm/record_mixing.s @@ -110,7 +110,7 @@ sub_80E6CA0: @ 80E6CA0 ldr r2, =0x00001124 adds r1, r5, r2 bl sub_81659DC - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _080E6D1C @@ -182,7 +182,7 @@ sub_80E6D54: @ 80E6D54 bl sub_81659DC adds r0, r4, 0 bl TaskDummy4 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _080E6DEE @@ -278,7 +278,7 @@ _080E6E60: ldr r0, [r5] adds r0, r4 bl sub_80E8AC0 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _080E6EFA @@ -470,7 +470,7 @@ sub_80E70F4: @ 80E70F4 movs r1, 0x1 adds r2, r4, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -677,7 +677,7 @@ _080E72F8: bl sub_8197434 adds r0, r4, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _080E730A: pop {r4,r5} pop {r0} @@ -999,7 +999,7 @@ _080E75AC: b _080E75FC .pool _080E75D0: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _080E75FC @@ -1291,7 +1291,7 @@ sub_80E7808: @ 80E7808 thumb_func_start sub_80E7810 sub_80E7810: @ 80E7810 push {lr} - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 pop {r1} @@ -1405,7 +1405,7 @@ sub_80E78C4: @ 80E78C4 muls r0, r1 mov r2, r9 adds r6, r2, r0 - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers lsls r0, r1, 3 subs r0, r1 lsls r0, 2 @@ -1481,7 +1481,7 @@ sub_80E7948: @ 80E7948 cmp r0, 0x1 bne _080E79FE adds r7, r6, 0 - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers ldr r1, [r5] lsls r0, r1, 3 subs r0, r1 @@ -1567,7 +1567,7 @@ sub_80E7A14: @ 80E7A14 ldr r1, [r6] movs r2, 0x40 bl memcpy - bl sub_818D9AC + bl GetLilycoveLadyId lsls r0, 24 cmp r0, 0 bne _080E7A60 @@ -1735,7 +1735,7 @@ sub_80E7B60: @ 80E7B60 lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x38] - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers ldrh r0, [r0, 0x4] bl SeedRng2 bl sub_8009FCC @@ -1797,7 +1797,7 @@ _080E7BF8: muls r0, r1 ldr r2, [sp, 0x2C] adds r7, r2, r0 - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers mov r3, r8 lsls r0, r3, 3 subs r0, r3 @@ -2280,7 +2280,7 @@ sub_80E7F68: @ 80E7F68 ldrh r1, [r4] bl VarSet ldr r0, =gStringVar1 - ldr r1, =gUnknown_020229F0 + ldr r1, =gLinkPlayers + 8 bl StringCopy ldrh r1, [r4] ldr r0, =0x00000113 diff --git a/asm/rom_8184DA4.s b/asm/recorded_battle.s similarity index 97% rename from asm/rom_8184DA4.s rename to asm/recorded_battle.s index f22214f93..5a4a811e6 100644 --- a/asm/rom_8184DA4.s +++ b/asm/recorded_battle.s @@ -122,7 +122,7 @@ _08184EAC: ands r5, r0 cmp r5, 0 beq _08184F64 - bl link_get_multiplayer_id + bl GetMultiplayerId ldr r1, =gUnknown_0203C7B4 strb r0, [r1] bl sub_8009FCC @@ -132,7 +132,7 @@ _08184EAC: movs r5, 0 ldr r0, =gUnknown_0203CC80 mov r9, r0 - ldr r6, =gUnknown_020229E8 + ldr r6, =gLinkPlayers movs r0, 0x8 adds r0, r6 mov r8, r0 @@ -174,7 +174,7 @@ _08184EDC: .pool _08184F3C: adds r5, 0x1 - ldr r0, =gUnknown_020229F0 + ldr r0, =gLinkPlayers + 8 adds r1, r3, r0 ldr r0, =gUnknown_0203CC84 adds r2, r4, r0 @@ -495,7 +495,7 @@ sub_81851A8: @ 81851A8 cmp r0, 0 beq _0818525E movs r5, 0 - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers b _081851DA .pool _081851D0: @@ -873,12 +873,12 @@ _081854DC: adds r0, r7, r3 str r2, [r0] _081854E2: - ldr r4, =gUnknown_02038BCA + ldr r4, =gTrainerBattleOpponent_A ldrh r1, [r4] ldr r5, =0x000004f4 adds r0, r7, r5 strh r1, [r0] - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r1, [r0] ldr r2, =0x000004f6 adds r0, r7, r2 @@ -944,7 +944,7 @@ _081854E2: str r0, [r1] ldr r4, =0xfffffed4 adds r1, r4, 0 - ldr r5, =gUnknown_02038BCA + ldr r5, =gTrainerBattleOpponent_A ldrh r5, [r5] adds r0, r1, r5 lsls r0, 16 @@ -957,7 +957,7 @@ _08185580: ldr r0, =0x00000504 adds r3, r7, r0 mov r10, r9 - ldr r1, =gUnknown_02038BCA + ldr r1, =gTrainerBattleOpponent_A mov r12, r1 adds r2, r4, 0 mov r8, r2 @@ -981,7 +981,7 @@ _08185592: ble _08185592 mov r0, r9 ldr r2, [r0] - ldr r1, =gUnknown_02038BCA + ldr r1, =gTrainerBattleOpponent_A ldrh r0, [r1] ldr r3, =0xfffffed4 adds r0, r3 @@ -1002,7 +1002,7 @@ _08185592: ldr r2, =0x0000050e adds r4, r7, r2 mov r10, r9 - ldr r5, =gUnknown_02038BCA + ldr r5, =gTrainerBattleOpponent_A mov r8, r5 adds r5, r3, 0 _081855E6: @@ -1032,7 +1032,7 @@ _08185664: ldr r1, =0x0000050e adds r4, r7, r1 mov r10, r9 - ldr r2, =gUnknown_02038BCA + ldr r2, =gTrainerBattleOpponent_A mov r8, r2 adds r5, r3, 0 _08185672: @@ -1057,7 +1057,7 @@ _08185672: _08185696: mov r1, r9 ldr r2, [r1] - ldr r3, =gUnknown_02038BCA + ldr r3, =gTrainerBattleOpponent_A ldrh r0, [r3] ldr r4, =0xfffffed4 adds r0, r4 @@ -1070,7 +1070,7 @@ _08185696: b _08185856 .pool _081856C4: - ldr r3, =gUnknown_02038BCC + ldr r3, =gTrainerBattleOpponent_B ldrh r3, [r3] adds r0, r1, r3 lsls r0, 16 @@ -1083,7 +1083,7 @@ _081856D4: ldr r4, =0x00000504 adds r3, r7, r4 mov r10, r9 - ldr r5, =gUnknown_02038BCC + ldr r5, =gTrainerBattleOpponent_B mov r12, r5 ldr r0, =0xfffffed4 mov r8, r0 @@ -1107,7 +1107,7 @@ _081856E6: ble _081856E6 mov r0, r9 ldr r2, [r0] - ldr r1, =gUnknown_02038BCC + ldr r1, =gTrainerBattleOpponent_B ldrh r0, [r1] ldr r3, =0xfffffed4 adds r0, r3 @@ -1128,7 +1128,7 @@ _081856E6: ldr r2, =0x0000050e adds r4, r7, r2 mov r10, r9 - ldr r5, =gUnknown_02038BCC + ldr r5, =gTrainerBattleOpponent_B mov r8, r5 adds r5, r3, 0 _0818573A: @@ -1158,7 +1158,7 @@ _08185784: ldr r1, =0x0000050e adds r4, r7, r1 mov r10, r9 - ldr r2, =gUnknown_02038BCC + ldr r2, =gTrainerBattleOpponent_B mov r8, r2 adds r5, r3, 0 _08185792: @@ -1183,7 +1183,7 @@ _08185792: _081857B6: mov r1, r9 ldr r2, [r1] - ldr r3, =gUnknown_02038BCC + ldr r3, =gTrainerBattleOpponent_B ldrh r0, [r3] ldr r4, =0xfffffed4 adds r0, r4 @@ -1259,7 +1259,7 @@ _08185856: adds r0, r7, r2 strb r1, [r0] _0818585C: - ldr r3, =gUnknown_02038BCA + ldr r3, =gTrainerBattleOpponent_A ldrh r0, [r3] ldr r1, =0x0000018f cmp r0, r1 @@ -1284,7 +1284,7 @@ _0818585C: ldr r0, =0x0000050e adds r4, r7, r0 mov r10, r9 - ldr r1, =gUnknown_02038BCA + ldr r1, =gTrainerBattleOpponent_A mov r8, r1 adds r5, r3, 0 _08185894: @@ -1310,14 +1310,14 @@ _08185894: ble _08185894 mov r3, r9 ldr r2, [r3] - ldr r4, =gUnknown_02038BCA + ldr r4, =gTrainerBattleOpponent_A ldrh r1, [r4] ldr r5, =0xfffffe70 adds r1, r5 b _081859AC .pool _08185900: - ldr r3, =gUnknown_02038BCC + ldr r3, =gTrainerBattleOpponent_B ldrh r0, [r3] cmp r0, r1 bls _0818597C @@ -1341,7 +1341,7 @@ _08185900: ldr r0, =0x0000050e adds r4, r7, r0 mov r10, r9 - ldr r1, =gUnknown_02038BCC + ldr r1, =gTrainerBattleOpponent_B mov r8, r1 adds r5, r3, 0 _08185936: @@ -1367,7 +1367,7 @@ _08185936: ble _08185936 mov r3, r9 ldr r2, [r3] - ldr r4, =gUnknown_02038BCC + ldr r4, =gTrainerBattleOpponent_B ldrh r1, [r4] ldr r5, =0xfffffe70 adds r1, r5 @@ -1542,9 +1542,9 @@ sub_8185AB0: @ 8185AB0 ldr r0, =gBattleTypeFlags movs r1, 0 str r1, [r0] - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A strh r1, [r0] - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B strh r1, [r0] ldr r0, =gUnknown_02038BCE strh r1, [r0] @@ -1624,7 +1624,7 @@ _08185B7C: cmp r6, 0x5 ble _08185B7C movs r6, 0 - ldr r3, =gUnknown_020229E8 + ldr r3, =gLinkPlayers mov r8, r3 mov r0, r8 adds r0, 0x8 @@ -1715,12 +1715,12 @@ _08185C2A: lsls r1, 17 orrs r0, r1 str r0, [r2] - ldr r1, =gUnknown_02038BCA + ldr r1, =gTrainerBattleOpponent_A ldr r2, =0x000004f4 adds r0, r7, r2 ldrh r0, [r0] strh r0, [r1] - ldr r1, =gUnknown_02038BCC + ldr r1, =gTrainerBattleOpponent_B adds r3, 0xE adds r0, r7, r3 ldrh r0, [r0] @@ -2007,7 +2007,7 @@ _08185F02: sub_8185F40: @ 8185F40 push {r4,r5,lr} movs r2, 0 - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers ldr r3, =gActiveBank ldrh r1, [r0, 0x18] adds r4, r0, 0 @@ -2115,7 +2115,7 @@ sub_8185FD0: @ 8185FD0 movs r3, 0 ldr r7, =gUnknown_0203CC70 adds r6, r4, 0 - ldr r5, =gUnknown_02024090 + ldr r5, =gBattleMons + 0xC movs r4, 0x58 _08186000: lsls r2, r3, 1 @@ -2192,7 +2192,7 @@ _0818608A: movs r1, 0x58 mov r0, r10 muls r0, r1 - ldr r3, =gUnknown_02024090 + ldr r3, =gBattleMons + 0xC adds r1, r0, r3 _081860AA: ldrh r0, [r1] @@ -2227,7 +2227,7 @@ _081860DE: lsls r0, r5, 1 adds r5, 0x1 adds r0, r7 - ldr r1, =gUnknown_02024090 + ldr r1, =gBattleMons + 0xC adds r3, r0, r1 lsls r0, r4, 3 mov r6, r8 @@ -2341,7 +2341,7 @@ _081861A6: adds r1, r2, r5 ldrb r0, [r4] adds r0, r7 - ldr r3, =gUnknown_020240A8 + ldr r3, =gBattleMons + 0x24 adds r0, r3 ldrb r0, [r0] strb r0, [r1] @@ -2638,13 +2638,13 @@ _081863FC: .pool thumb_func_end sub_818603C - thumb_func_start sub_8186438 -sub_8186438: @ 8186438 + thumb_func_start GetAiScriptsInRecordedBattle +GetAiScriptsInRecordedBattle: @ 8186438 ldr r0, =gUnknown_0203C7BC ldr r0, [r0] bx lr .pool - thumb_func_end sub_8186438 + thumb_func_end GetAiScriptsInRecordedBattle thumb_func_start sub_8186444 sub_8186444: @ 8186444 diff --git a/asm/region_map.s b/asm/region_map.s index 7a0a5dae3..a6112ab61 100644 --- a/asm/region_map.s +++ b/asm/region_map.s @@ -3461,7 +3461,7 @@ _0812480C: movs r0, 0x2 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 bl schedule_bg_copy_tilemap_to_vram b _0812489C @@ -3607,7 +3607,7 @@ _08124926: movs r0, 0x1 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, [r5] ldrb r0, [r0, 0xB] ldr r1, [r4] @@ -3628,7 +3628,7 @@ _08124926: movs r0, 0x1 movs r1, 0x1 adds r2, r4, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 bl schedule_bg_copy_tilemap_to_vram ldr r0, =gUnknown_03001180 @@ -3674,7 +3674,7 @@ _081249FC: movs r0, 0 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 bl schedule_bg_copy_tilemap_to_vram ldr r0, =gUnknown_03001180 diff --git a/asm/reset_rtc_screen.s b/asm/reset_rtc_screen.s index ccef727ff..076ddbf0b 100644 --- a/asm/reset_rtc_screen.s +++ b/asm/reset_rtc_screen.s @@ -460,7 +460,7 @@ sub_809EBC4: @ 809EBC4 mov r0, r10 movs r1, 0x1 ldr r3, [sp, 0xC] - bl Print + bl PrintTextOnWindow add sp, 0x10 pop {r3-r5} mov r8, r3 @@ -523,7 +523,7 @@ sub_809ECB4: @ 809ECB4 adds r0, r4, 0 movs r1, 0x1 movs r3, 0x7E - bl Print + bl PrintTextOnWindow movs r0, 0 bl schedule_bg_copy_tilemap_to_vram add sp, 0xC @@ -976,7 +976,7 @@ sub_809F0C0: @ 809F0C0 movs r1, 0x1 adds r2, r4, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 bl schedule_bg_copy_tilemap_to_vram add sp, 0xC @@ -1020,7 +1020,7 @@ _0809F11C: movs r0, 0 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r1, =gLocalTime ldrh r3, [r1] ldrb r0, [r1, 0x2] @@ -1041,7 +1041,7 @@ _0809F11C: movs r0, 0 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r1, 0 diff --git a/asm/reshow_battle_screen.s b/asm/reshow_battle_screen.s index beec0a089..10fd6c6ce 100644 --- a/asm/reshow_battle_screen.s +++ b/asm/reshow_battle_screen.s @@ -905,7 +905,7 @@ _080A9B1E: _080A9B24: lsls r0, 24 lsrs r6, r0, 24 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r4, r5, r0 strb r6, [r4] adds r0, r5, 0 @@ -976,7 +976,7 @@ _080A9BB8: cmp r0, 0x2 bne _080A9BF0 _080A9BD4: - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r5, r0 ldrb r0, [r0] movs r1, 0x1 @@ -984,7 +984,7 @@ _080A9BD4: b _080A9BFC .pool _080A9BF0: - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r5, r0 ldrb r0, [r0] movs r1, 0 diff --git a/asm/roamer.s b/asm/roamer.s new file mode 100644 index 000000000..f6b48f10f --- /dev/null +++ b/asm/roamer.s @@ -0,0 +1,502 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + + thumb_func_start ClearRoamerData +ClearRoamerData: @ 8161B34 + push {r4,r5,lr} + ldr r5, =gSaveBlock1Ptr + ldr r0, [r5] + ldr r4, =0x000031dc + adds r0, r4 + movs r1, 0 + movs r2, 0x1C + bl memset + ldr r0, [r5] + adds r0, r4 + ldr r1, =0x00000197 + strh r1, [r0, 0x8] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ClearRoamerData + + thumb_func_start ClearRoamerLocationData +ClearRoamerLocationData: @ 8161B60 + push {r4-r6,lr} + movs r2, 0 + ldr r6, =sRoamerLocation + ldr r4, =sLocationHistory + movs r3, 0 + adds r5, r4, 0x1 +_08161B6C: + lsls r1, r2, 1 + adds r0, r1, r4 + strb r3, [r0] + adds r1, r5 + strb r3, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _08161B6C + movs r0, 0 + strb r0, [r6] + strb r0, [r6, 0x1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ClearRoamerLocationData + + thumb_func_start CreateInitialRoamerMon +CreateInitialRoamerMon: @ 8161B94 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 16 + cmp r0, 0 + bne _08161BBC + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r2, =0x000031dc + adds r1, r2 + ldr r2, =0x00000197 + b _08161BC8 + .pool +_08161BBC: + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r2, =0x000031dc + adds r1, r2 + movs r2, 0xCC + lsls r2, 1 +_08161BC8: + strh r2, [r1, 0x8] + adds r7, r0, 0 + ldr r6, =gEnemyParty + ldr r0, [r7] + ldr r5, =0x000031dc + adds r0, r5 + ldrh r1, [r0, 0x8] + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + adds r0, r6, 0 + movs r2, 0x28 + movs r3, 0x20 + bl CreateMon + ldr r0, [r7] + adds r0, r5 + movs r1, 0x28 + strb r1, [r0, 0xC] + ldr r0, [r7] + adds r0, r5 + strb r4, [r0, 0xD] + ldr r0, [r7] + adds r0, r5 + movs r1, 0x1 + strb r1, [r0, 0x13] + adds r0, r6, 0 + movs r1, 0x42 + bl GetMonData + ldr r1, [r7] + adds r1, r5 + str r0, [r1] + adds r0, r6, 0 + movs r1, 0 + bl GetMonData + ldr r1, [r7] + adds r1, r5 + str r0, [r1, 0x4] + adds r0, r6, 0 + movs r1, 0x3A + bl GetMonData + ldr r1, [r7] + adds r1, r5 + movs r2, 0 + mov r8, r2 + strh r0, [r1, 0xA] + adds r0, r6, 0 + movs r1, 0x16 + bl GetMonData + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0xE] + adds r0, r6, 0 + movs r1, 0x17 + bl GetMonData + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0xF] + adds r0, r6, 0 + movs r1, 0x18 + bl GetMonData + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0x10] + adds r0, r6, 0 + movs r1, 0x21 + bl GetMonData + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0x11] + adds r0, r6, 0 + movs r1, 0x2F + bl GetMonData + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0x12] + ldr r4, =sRoamerLocation + mov r0, r8 + strb r0, [r4] + bl Random + ldr r5, =sRoamerLocations + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + adds r1, r5 + ldrb r0, [r1] + strb r0, [r4, 0x1] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end CreateInitialRoamerMon + + thumb_func_start InitRoamer +InitRoamer: @ 8161CBC + push {lr} + bl ClearRoamerData + bl ClearRoamerLocationData + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + bl CreateInitialRoamerMon + pop {r0} + bx r0 + .pool + thumb_func_end InitRoamer + + thumb_func_start UpdateLocationHistoryForRoamer +UpdateLocationHistoryForRoamer: @ 8161CD8 + ldr r0, =sLocationHistory + ldrb r1, [r0, 0x2] + strb r1, [r0, 0x4] + ldrb r1, [r0, 0x3] + strb r1, [r0, 0x5] + ldrb r1, [r0] + strb r1, [r0, 0x2] + ldrb r1, [r0, 0x1] + strb r1, [r0, 0x3] + ldr r1, =gSaveBlock1Ptr + ldr r2, [r1] + ldrb r1, [r2, 0x4] + strb r1, [r0] + ldrb r1, [r2, 0x5] + strb r1, [r0, 0x1] + bx lr + .pool + thumb_func_end UpdateLocationHistoryForRoamer + + thumb_func_start RoamerMoveToOtherLocationSet +RoamerMoveToOtherLocationSet: @ 8161D00 + push {r4,r5,lr} + movs r1, 0 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x000031dc + adds r0, r2 + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _08161D3E + ldr r0, =sRoamerLocation + strb r1, [r0] + ldr r5, =sRoamerLocations + adds r4, r0, 0 +_08161D1A: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + adds r1, r5 + ldrb r1, [r1] + ldrb r0, [r4, 0x1] + cmp r0, r1 + beq _08161D1A + strb r1, [r4, 0x1] +_08161D3E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end RoamerMoveToOtherLocationSet + + thumb_func_start RoamerMove +RoamerMove: @ 8161D54 + push {r4-r7,lr} + movs r4, 0 + bl Random + lsls r0, 16 + movs r1, 0xF0 + lsls r1, 12 + ands r1, r0 + cmp r1, 0 + bne _08161D6E + bl RoamerMoveToOtherLocationSet + b _08161DE2 +_08161D6E: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x000031dc + adds r0, r1 + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _08161DE2 + ldr r7, =sRoamerLocation + ldr r3, =sRoamerLocations +_08161D80: + lsls r0, r4, 1 + adds r0, r4 + lsls r2, r0, 1 + adds r1, r2, r3 + ldrb r0, [r7, 0x1] + ldrb r1, [r1] + cmp r0, r1 + bne _08161DD8 + ldr r6, =sRoamerLocations + adds r5, r2, 0x1 + ldr r4, =sLocationHistory +_08161D96: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, r5 + adds r0, r6 + ldrb r1, [r0] + ldrb r0, [r4, 0x4] + cmp r0, 0 + bne _08161DBA + ldrb r0, [r4, 0x5] + cmp r0, r1 + beq _08161D96 +_08161DBA: + cmp r1, 0xFF + beq _08161D96 + strb r1, [r7, 0x1] + b _08161DE2 + .pool +_08161DD8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _08161D80 +_08161DE2: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end RoamerMove + + thumb_func_start IsRoamerAt +IsRoamerAt: @ 8161DE8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r3, =0x000031dc + adds r0, r3 + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _08161E20 + ldr r0, =sRoamerLocation + ldrb r3, [r0] + cmp r2, r3 + bne _08161E20 + ldrb r0, [r0, 0x1] + cmp r1, r0 + bne _08161E20 + movs r0, 0x1 + b _08161E22 + .pool +_08161E20: + movs r0, 0 +_08161E22: + pop {r1} + bx r1 + thumb_func_end IsRoamerAt + + thumb_func_start CreateRoamerMonInstance +CreateRoamerMonInstance: @ 8161E28 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =gEnemyParty + bl ZeroEnemyPartyMons + ldr r4, =gSaveBlock1Ptr + ldr r0, [r4] + ldr r1, =0x000031dc + adds r0, r1 + ldrh r1, [r0, 0x8] + ldrb r2, [r0, 0xC] + ldr r3, [r0] + ldr r0, [r0, 0x4] + str r0, [sp] + adds r0, r5, 0 + bl CreateMonWithIVsPersonality + ldr r2, [r4] + ldr r0, =0x000031e9 + adds r2, r0 + adds r0, r5, 0 + movs r1, 0x37 + bl SetMonData + ldr r2, [r4] + ldr r1, =0x000031e6 + adds r2, r1 + adds r0, r5, 0 + movs r1, 0x39 + bl SetMonData + ldr r2, [r4] + ldr r0, =0x000031ea + adds r2, r0 + adds r0, r5, 0 + movs r1, 0x16 + bl SetMonData + ldr r2, [r4] + ldr r1, =0x000031eb + adds r2, r1 + adds r0, r5, 0 + movs r1, 0x17 + bl SetMonData + ldr r2, [r4] + ldr r0, =0x000031ec + adds r2, r0 + adds r0, r5, 0 + movs r1, 0x18 + bl SetMonData + ldr r2, [r4] + ldr r1, =0x000031ed + adds r2, r1 + adds r0, r5, 0 + movs r1, 0x21 + bl SetMonData + ldr r2, [r4] + ldr r0, =0x000031ee + adds r2, r0 + adds r0, r5, 0 + movs r1, 0x2F + bl SetMonData + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end CreateRoamerMonInstance + + thumb_func_start TryStartRoamerEncounter +TryStartRoamerEncounter: @ 8161EDC + push {lr} + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldrb r0, [r1, 0x4] + ldrb r1, [r1, 0x5] + bl IsRoamerAt + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08161F10 + bl Random + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + cmp r1, 0 + bne _08161F10 + bl CreateRoamerMonInstance + movs r0, 0x1 + b _08161F12 + .pool +_08161F10: + movs r0, 0 +_08161F12: + pop {r1} + bx r1 + thumb_func_end TryStartRoamerEncounter + + thumb_func_start UpdateRoamerHPStatus +UpdateRoamerHPStatus: @ 8161F18 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x39 + bl GetMonData + ldr r5, =gSaveBlock1Ptr + ldr r1, [r5] + ldr r4, =0x000031dc + adds r1, r4 + strh r0, [r1, 0xA] + adds r0, r6, 0 + movs r1, 0x37 + bl GetMonData + ldr r1, [r5] + adds r1, r4 + strb r0, [r1, 0xD] + bl RoamerMoveToOtherLocationSet + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end UpdateRoamerHPStatus + + thumb_func_start SetRoamerInactive +SetRoamerInactive: @ 8161F4C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x000031dc + adds r0, r1 + movs r1, 0 + strb r1, [r0, 0x13] + bx lr + .pool + thumb_func_end SetRoamerInactive + + thumb_func_start GetRoamerLocation +GetRoamerLocation: @ 8161F64 + ldr r3, =sRoamerLocation + ldrb r2, [r3] + strb r2, [r0] + ldrb r0, [r3, 0x1] + strb r0, [r1] + bx lr + .pool + thumb_func_end GetRoamerLocation + + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom3.s b/asm/rom3.s index 88c5a015b..ac74e0735 100644 --- a/asm/rom3.s +++ b/asm/rom3.s @@ -96,7 +96,7 @@ _080326B8: adds r0, r4, 0 movs r2, 0x2 movs r3, 0x20 - bl create_pokemon_set_level + bl CreateMon str r5, [sp, 0x10] adds r0, r4, 0 movs r1, 0xC @@ -294,7 +294,7 @@ _080328F0: cmp r1, 0 beq _08032918 ldr r1, =gBattleBankFunc - ldr r0, =sub_815936C + ldr r0, =SetBankFuncToSafariBufferRunCommand b _08032934 .pool _08032918: @@ -468,7 +468,7 @@ _08032AAA: ldrb r5, [r0] movs r0, 0 mov r10, r0 - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers mov r12, r1 adds r7, r4, 0 mov r8, r0 @@ -492,7 +492,7 @@ _08032AE4: cmp r0, 0x3 bne _08032B06 _08032AE8: - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers adds r0, r4, r0 ldrb r0, [r0, 0x18] movs r1, 0 @@ -507,7 +507,7 @@ _08032AFC: _08032B06: cmp r10, r5 bne _08032B56 - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers adds r3, r4, r0 ldrh r1, [r3, 0x18] lsls r1, 2 @@ -544,7 +544,7 @@ _08032B4C: ldrh r0, [r3, 0x18] b _08032C24 _08032B56: - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers adds r0, r4, r2 ldrh r1, [r0, 0x18] movs r3, 0x1 @@ -895,7 +895,7 @@ _08032E2E: b _0803303C .pool _08032E8C: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r5, r0, 24 ldr r0, [r4] @@ -909,7 +909,7 @@ _08032E8C: _08032EA4: movs r0, 0 mov r10, r0 - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers mov r12, r1 ldr r7, =gBanksBySide mov r8, r0 @@ -933,7 +933,7 @@ _08032EE0: cmp r0, 0x3 bne _08032F02 _08032EE4: - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers adds r0, r4, r0 ldrb r0, [r0, 0x18] movs r1, 0 @@ -948,7 +948,7 @@ _08032EF8: _08032F02: cmp r10, r5 bne _08032F52 - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers adds r3, r4, r0 ldrh r1, [r3, 0x18] lsls r1, 2 @@ -985,7 +985,7 @@ _08032F48: ldrh r0, [r3, 0x18] b _08033020 _08032F52: - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers adds r0, r4, r2 ldrh r1, [r0, 0x18] movs r3, 0x1 @@ -2600,7 +2600,7 @@ dp01_build_cmdbuf_x10_TODO: @ 8033BE4 ldrh r0, [r0] mov r1, r12 strh r0, [r1, 0x2] - ldr r0, =gUnknown_02024208 + ldr r0, =gLastUsedItem ldrh r0, [r0] strh r0, [r1, 0x4] ldr r0, =gLastUsedAbility @@ -2633,7 +2633,7 @@ dp01_build_cmdbuf_x10_TODO: @ 8033BE4 strb r0, [r7, 0xB] movs r3, 0 mov r9, r2 - ldr r0, =gUnknown_02022F78 + ldr r0, =gBattleTextBuff3 mov r8, r0 adds r2, 0x10 ldr r0, =gBattleMons @@ -2715,7 +2715,7 @@ dp01_build_cmdbuf_x11_TODO: @ 8033CFC ldrh r0, [r0] mov r1, r12 strh r0, [r1, 0x2] - ldr r0, =gUnknown_02024208 + ldr r0, =gLastUsedItem ldrh r0, [r0] strh r0, [r1, 0x4] ldr r0, =gLastUsedAbility @@ -2731,7 +2731,7 @@ dp01_build_cmdbuf_x11_TODO: @ 8033CFC strb r0, [r1, 0x8] movs r3, 0 mov r9, r2 - ldr r7, =gUnknown_02022F78 + ldr r7, =gBattleTextBuff3 mov r8, r7 mov r4, r9 adds r4, 0x10 diff --git a/asm/rom4.s b/asm/rom4.s index b36de6f2e..a3125efc4 100644 --- a/asm/rom4.s +++ b/asm/rom4.s @@ -16,7 +16,7 @@ sub_8084620: @ 8084620 lsls r0, 3 adds r4, r0 adds r0, r4, 0 - bl DecryptMoney + bl GetMoney adds r1, r0, 0 lsrs r1, 1 adds r0, r4, 0 @@ -131,8 +131,8 @@ sub_8084788: @ 8084788 bl FlagReset bl sub_8085B2C bl wild_pokemon_reroll - bl mapnumbers_history_shift_sav1_0_2_4_out - bl sub_8161D00 + bl UpdateLocationHistoryForRoamer + bl RoamerMoveToOtherLocationSet pop {r0} bx r0 .pool @@ -238,8 +238,8 @@ _08084854: .pool thumb_func_end sav12_xor_set - thumb_func_start sub_8084864 -sub_8084864: @ 8084864 + thumb_func_start ApplyNewEncyprtionKeyToGameStats +ApplyNewEncyprtionKeyToGameStats: @ 8084864 push {r4-r6,lr} adds r5, r0, 0 movs r4, 0 @@ -251,7 +251,7 @@ _0808486C: ldr r0, [r6] adds r0, r1 adds r1, r5, 0 - bl apply_u32_xor_crypto + bl ApplyNewEncyprtionKeyToWord adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @@ -261,7 +261,7 @@ _0808486C: pop {r0} bx r0 .pool - thumb_func_end sub_8084864 + thumb_func_end ApplyNewEncyprtionKeyToGameStats thumb_func_start CopyFieldObjectTemplatesToSav1 @ void CopyFieldObjectTemplatesToSav1() @@ -1402,8 +1402,8 @@ _08085116: cmp r4, 0xC ble _08085116 bl sub_80A0A2C - bl mapnumbers_history_shift_sav1_0_2_4_out - bl sub_8161D54 + bl UpdateLocationHistoryForRoamer + bl RoamerMove bl sub_80AEE20 bl wild_encounter_reset_coro_args bl mapheader_run_script_with_tag_x5 @@ -1493,8 +1493,8 @@ _08085200: bl update_sav1_flash_used_on_map bl sav1_reset_battle_music_maybe bl mapheader_run_script_with_tag_x3 - bl mapnumbers_history_shift_sav1_0_2_4_out - bl sub_8161D00 + bl UpdateLocationHistoryForRoamer + bl RoamerMoveToOtherLocationSet ldrh r1, [r4, 0x12] ldr r0, =0x00000169 cmp r1, r0 @@ -2592,7 +2592,7 @@ _08085A88: _08085AA4: movs r0, 0x1 mov r9, r0 - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 lsrs r0, 24 mov r8, r0 @@ -3015,7 +3015,7 @@ c1_overworld_normal: @ 8085DAC adds r1, r5, 0 adds r2, r4, 0 bl process_overworld_input - bl script_env_2_is_enabled + bl ScriptContext2_IsEnabled lsls r0, 24 cmp r0, 0 bne _08085DFA @@ -3023,7 +3023,7 @@ c1_overworld_normal: @ 8085DAC bl sub_809C014 cmp r0, 0x1 bne _08085DF0 - bl script_env_2_enable + bl ScriptContext2_Enable bl HideMapNamePopUpWindow b _08085DFA _08085DF0: @@ -3059,7 +3059,7 @@ _08085E18: @ void c2_overworld_basic() c2_overworld_basic: @ 8085E24 push {lr} - bl script_env_2_run_current_script + bl ScriptContext2_RunScript bl RunTasks bl AnimateSprites bl CameraUpdate @@ -3172,8 +3172,8 @@ CB2_NewGame: @ 8085EF8 bl NewGameInitData bl player_avatar_init_params_reset bl PlayTimeCounter_Start - bl script_env_1_init - bl script_env_2_disable + bl ScriptContext1_Init + bl ScriptContext2_Disable ldr r1, =gUnknown_03005DAC ldr r0, =sub_80FB4E0 str r0, [r1] @@ -3212,8 +3212,8 @@ c2_whiteout: @ 8085F58 bl ResetSafariZoneFlag_ bl sub_8084620 bl player_avatar_init_params_reset - bl script_env_1_init - bl script_env_2_disable + bl ScriptContext1_Init + bl ScriptContext2_Disable ldr r1, =gUnknown_03005DAC ldr r0, =sub_80AF3C8 str r0, [r1] @@ -3238,8 +3238,8 @@ _08085FB0: c2_load_new_map: @ 8085FCC push {lr} bl sub_808631C - bl script_env_1_init - bl script_env_2_disable + bl ScriptContext1_Init + bl ScriptContext2_Disable movs r0, 0 bl set_callback1 ldr r0, =c2_change_map @@ -3278,8 +3278,8 @@ sub_8086024: @ 8086024 cmp r0, 0 bne _08086046 bl sub_808631C - bl script_env_1_init - bl script_env_2_disable + bl ScriptContext1_Init + bl ScriptContext2_Disable movs r0, 0 bl set_callback1 _08086046: @@ -3408,8 +3408,8 @@ _08086174: ldr r0, =sub_80AF214 _08086178: str r0, [r1] - bl script_env_1_init - bl script_env_2_disable + bl ScriptContext1_Init + bl ScriptContext2_Disable bl c2_exit_to_overworld_2_switch pop {r0} bx r0 @@ -3546,8 +3546,8 @@ _080862BA: bl sub_8087D74 _080862BE: bl PlayTimeCounter_Start - bl script_env_1_init - bl script_env_2_disable + bl ScriptContext1_Init + bl ScriptContext2_Disable bl sub_8195E10 bl sav2_x1_query_bit1 cmp r0, 0x1 @@ -3711,9 +3711,9 @@ _08086414: .4byte _0808650E _0808644C: bl overworld_bg_setup - bl script_env_1_init - bl script_env_2_disable - bl saveblock_randomize_and_relocate_ + bl ScriptContext1_Init + bl ScriptContext2_Disable + bl MoveSaveBlocks_ResetHeap_ bl sub_80867D8 b _08086506 _08086462: @@ -3838,7 +3838,7 @@ _08086570: bl mli0_load_map b _08086622 _0808657C: - bl saveblock_randomize_and_relocate_ + bl MoveSaveBlocks_ResetHeap_ bl sub_80867D8 b _08086622 _08086586: @@ -3941,7 +3941,7 @@ _0808664C: beq _0808668A b _0808668E _08086656: - bl saveblock_randomize_and_relocate_ + bl MoveSaveBlocks_ResetHeap_ bl sub_80867D8 movs r0, 0 bl sub_8086988 @@ -4006,7 +4006,7 @@ _080866B4: .4byte _0808679A _080866EC: bl sub_808631C - bl saveblock_randomize_and_relocate_ + bl MoveSaveBlocks_ResetHeap_ bl sub_80867D8 b _08086792 _080866FA: @@ -4106,14 +4106,14 @@ _080867B4: bx r0 thumb_func_end do_load_map_stuff_loop - thumb_func_start saveblock_randomize_and_relocate_ -saveblock_randomize_and_relocate_: @ 80867C8 + thumb_func_start MoveSaveBlocks_ResetHeap_ +MoveSaveBlocks_ResetHeap_: @ 80867C8 push {lr} bl sub_81BE6AC - bl saveblock_randomize_and_relocate + bl MoveSaveBlocks_ResetHeap pop {r0} bx r0 - thumb_func_end saveblock_randomize_and_relocate_ + thumb_func_end MoveSaveBlocks_ResetHeap_ thumb_func_start sub_80867D8 sub_80867D8: @ 80867D8 @@ -4490,7 +4490,7 @@ sub_8086B14: @ 8086B14 ldrb r0, [r0] cmp r6, r0 bcs _08086B7E - ldr r7, =gUnknown_020229E8 + ldr r7, =gLinkPlayers _08086B44: lsls r5, r6, 24 lsrs r5, 24 @@ -4538,7 +4538,7 @@ sub_8086B9C: @ 8086B9C ldrb r0, [r0] cmp r4, r0 bcs _08086BCA - ldr r5, =gUnknown_020229E8 + ldr r5, =gLinkPlayers _08086BAA: lsls r0, r4, 24 lsrs r0, 24 @@ -5170,7 +5170,7 @@ _080870A2: sub_80870B0: @ 80870B0 push {r4,lr} adds r4, r0, 0 - bl script_env_2_is_enabled + bl ScriptContext2_IsEnabled lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -5212,7 +5212,7 @@ sub_80870EC: @ 80870EC thumb_func_start sub_80870F8 sub_80870F8: @ 80870F8 push {r4,lr} - bl script_env_2_is_enabled + bl ScriptContext2_IsEnabled lsls r0, 24 lsrs r0, 24 movs r4, 0x11 @@ -5237,7 +5237,7 @@ sub_808711C: @ 808711C cmp r0, 0x2 bhi _08087134 movs r4, 0x1A - bl script_env_2_disable + bl ScriptContext2_Disable ldr r0, =sub_80870EC bl c1_link_related_func_set _08087134: @@ -5256,7 +5256,7 @@ sub_8087140: @ 8087140 cmp r0, 0x2 bhi _08087158 movs r4, 0x1A - bl script_env_2_disable + bl ScriptContext2_Disable ldr r0, =sub_80870EC bl c1_link_related_func_set _08087158: @@ -5336,7 +5336,7 @@ _080871D4: cmp r0, 0x1 bne _080871EA ldr r0, =gUnknown_08277513 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript ldr r0, =sub_80871C0 bl c1_link_related_func_set _080871EA: @@ -5751,7 +5751,7 @@ _0808750A: thumb_func_start sub_8087510 sub_8087510: @ 8087510 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 thumb_func_end sub_8087510 @@ -5762,7 +5762,7 @@ sub_808751C: @ 808751C movs r0, 0x6 bl PlaySE bl sub_809FA9C - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 thumb_func_end sub_808751C @@ -5774,8 +5774,8 @@ sub_8087530: @ 8087530 movs r0, 0x5 bl PlaySE adds r0, r4, 0 - bl script_env_1_execute_new_script - bl script_env_2_enable + bl ScriptContext1_SetupScript + bl ScriptContext2_Enable pop {r4} pop {r0} bx r0 @@ -5787,8 +5787,8 @@ sub_808754C: @ 808754C movs r0, 0x6 bl PlaySE ldr r0, =gUnknown_082774EF - bl script_env_1_execute_new_script - bl script_env_2_enable + bl ScriptContext1_SetupScript + bl ScriptContext2_Enable pop {r0} bx r0 .pool @@ -5801,8 +5801,8 @@ sub_8087568: @ 8087568 movs r0, 0x5 bl PlaySE adds r0, r4, 0 - bl script_env_1_execute_new_script - bl script_env_2_enable + bl ScriptContext1_SetupScript + bl ScriptContext2_Enable pop {r4} pop {r0} bx r0 @@ -5812,8 +5812,8 @@ sub_8087568: @ 8087568 sub_8087584: @ 8087584 push {lr} ldr r0, =gUnknown_08277509 - bl script_env_1_execute_new_script - bl script_env_2_enable + bl ScriptContext1_SetupScript + bl ScriptContext2_Enable pop {r0} bx r0 .pool diff --git a/asm/rom6.s b/asm/rom6.s index 4ccc2e05f..18de40366 100644 --- a/asm/rom6.s +++ b/asm/rom6.s @@ -67,7 +67,7 @@ task08_080C9820: @ 813549C lsls r0, 24 lsrs r5, r0, 24 adds r6, r5, 0 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r1, =gPlayerAvatar movs r0, 0x1 strb r0, [r1, 0x6] @@ -308,7 +308,7 @@ sub_81356C4: @ 81356C4 lsrs r0, 24 str r0, [r1] ldr r0, =gUnknown_082907F0 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript pop {r0} bx r0 .pool @@ -344,7 +344,7 @@ sub_8135714: @ 8135714 bl PlaySE movs r0, 0x25 bl FieldEffectActiveListRemove - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r0} bx r0 thumb_func_end sub_8135714 @@ -1205,7 +1205,7 @@ sub_8135F04: @ 8135F04 adds r1, r3 ldr r5, [r2] adds r5, r1 - ldr r2, =gUnknown_085B262C + ldr r2, =gPokeblockNames ldrb r1, [r5] lsls r1, 2 adds r1, r2 @@ -2583,7 +2583,7 @@ sub_8136AB4: @ 8136AB4 movs r1, 0 bl sub_8198070 ldr r0, =gStringVar1 - ldr r3, =gUnknown_085B262C + ldr r3, =gPokeblockNames ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldr r1, =gUnknown_0203CE7C @@ -2784,7 +2784,7 @@ sub_8136C8C: @ 8136C8C lsls r4, 16 lsrs r4, 16 ldr r0, =gBattleTextBuff1 - ldr r3, =gUnknown_085B262C + ldr r3, =gPokeblockNames ldr r2, [r5] ldrh r1, [r7] lsls r1, 3 @@ -2838,9 +2838,9 @@ sub_8136D2C: @ 8136D2C lsrs r4, 24 ldr r5, =gUnknown_0203CE7C ldrb r0, [r5] - bl sub_80FC3E8 + bl SafariZoneActivatePokeblockFeeder ldr r0, =gStringVar1 - ldr r3, =gUnknown_085B262C + ldr r3, =gPokeblockNames ldr r1, =gSaveBlock1Ptr ldr r2, [r1] ldrh r1, [r5] @@ -3188,7 +3188,7 @@ sub_8136FE4: @ 8136FE4 lsrs r0, 24 movs r6, 0 movs r4, 0 - ldr r1, =gUnknown_085B25A0 + ldr r1, =gPokeblockFlavorCompatibilityTable mov r9, r1 lsls r1, r0, 2 adds r7, r1, r0 @@ -3236,7 +3236,7 @@ sub_8137044: @ 8137044 movs r1, 0 bl sub_8136F9C lsls r0, 24 - ldr r1, =gUnknown_085B262C + ldr r1, =gPokeblockNames lsrs r0, 22 adds r0, r1 ldr r1, [r0] @@ -3255,7 +3255,7 @@ sub_8137068: @ 8137068 lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 - ldr r7, =gUnknown_085B262C + ldr r7, =gPokeblockNames _08137074: lsls r1, r4, 3 ldr r0, =gUnknown_085B2720 @@ -3408,7 +3408,7 @@ sub_81371B4: @ 81371B4 ldr r0, =0x00000888 bl FlagSet ldr r0, =gUnknown_082926F8 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript pop {r0} bx r0 .pool @@ -4353,7 +4353,7 @@ sub_81379D8: @ 81379D8 lsls r0, 24 cmp r0, 0 beq _081379F2 - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask _081379F2: @@ -4640,7 +4640,7 @@ sub_8137C28: @ 8137C28 push {lr} ldr r0, =sub_8174194 bl SetMainCallback2 - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 .pool @@ -4663,7 +4663,7 @@ sub_8137C3C: @ 8137C3C mapldr_080CA5C0: @ 8137C5C push {lr} sub sp, 0x4 - bl script_env_2_enable + bl ScriptContext2_Enable bl sub_8085784 bl sp109_CreatePCMenu bl sub_80E2514 @@ -4707,7 +4707,7 @@ sub_8137CB4: @ 8137CB4 push {lr} ldr r0, =sub_8177888 bl SetMainCallback2 - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 .pool @@ -4721,7 +4721,7 @@ Special_ViewWallClock: @ 8137CC8 str r1, [r0, 0x8] ldr r0, =Cb2_ViewWallClock bl SetMainCallback2 - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 .pool @@ -5396,7 +5396,7 @@ sub_8138240: @ 8138240 mov r7, r8 push {r7} movs r6, 0 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r7, r0, 24 bl sub_8009FCC @@ -5416,7 +5416,7 @@ _08138262: lsls r1, r4, 3 subs r1, r4 lsls r1, 2 - ldr r2, =gUnknown_020229F0 + ldr r2, =gLinkPlayers + 8 adds r1, r2 bl StringCopy adds r0, r6, 0x1 @@ -5459,7 +5459,7 @@ SpawnLinkPartnerFieldObject: @ 81382A0 adds r0, r4, 0 movs r2, 0x8 bl memcpy - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 mov r10, r0 @@ -5531,7 +5531,7 @@ _08138350: _08138358: cmp r10, r6 beq _0813840A - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers lsls r2, r6, 3 subs r1, r2, r6 lsls r1, 2 @@ -6192,7 +6192,7 @@ sub_8138910: @ 8138910 bne _08138970 adds r0, r6, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts b _08138970 .pool _0813896C: @@ -7545,7 +7545,7 @@ sub_81393C8: @ 81393C8 muls r0, r1 ldr r1, =gPlayerParty adds r0, r1 - bl sub_806DC8C + bl GetMonEVCount lsls r0, 16 ldr r1, =0x01fd0000 cmp r0, r1 @@ -7630,7 +7630,7 @@ sub_813946C: @ 813946C adds r0, r5, 0 movs r2, 0x7 movs r3, 0x20 - bl create_pokemon_set_level + bl CreateMon movs r1, 0x1 add r0, sp, 0x10 strh r1, [r0] @@ -7676,7 +7676,7 @@ sub_81394D8: @ 81394D8 bl sub_8133EDC lsls r0, 16 lsrs r6, r0, 16 - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 @@ -7724,7 +7724,7 @@ sub_8139540: @ 8139540 push {lr} ldr r0, =gPlayerParty movs r1, 0x3F - bl sub_806DD7C + bl CheckPartyPokerus lsls r0, 24 cmp r0, 0 beq _08139558 @@ -7829,7 +7829,7 @@ sub_8139620: @ 8139620 lsls r0, 24 lsrs r0, 24 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r0} bx r0 thumb_func_end sub_8139620 @@ -7885,7 +7885,7 @@ _08139684: thumb_func_start sub_8139688 sub_8139688: @ 8139688 push {r4-r6,lr} - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 lsrs r6, r0, 24 movs r5, 0 @@ -8204,7 +8204,7 @@ _081398FC: thumb_func_start sub_813990C sub_813990C: @ 813990C push {r4,r5,lr} - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 @@ -8236,8 +8236,8 @@ _08139944: bx r1 thumb_func_end sub_813990C - thumb_func_start in_multi_battle_room_with_var_condition -in_multi_battle_room_with_var_condition: @ 813994C + thumb_func_start InMultiBattleRoom +InMultiBattleRoom: @ 813994C push {lr} ldr r0, =gSaveBlock1Ptr ldr r0, [r0] @@ -8259,7 +8259,7 @@ _08139978: _0813997A: pop {r1} bx r1 - thumb_func_end in_multi_battle_room_with_var_condition + thumb_func_end InMultiBattleRoom thumb_func_start sub_8139980 sub_8139980: @ 8139980 @@ -8488,7 +8488,7 @@ sub_8139AF4: @ 8139AF4 bl PlaySE adds r0, r5, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts bl InstallCameraPanAheadCallback _08139B54: pop {r4,r5} @@ -8530,7 +8530,7 @@ sub_8139B60: @ 8139B60 str r1, [sp, 0x8] movs r1, 0x1 adds r2, r4, 0 - bl Print + bl PrintTextOnWindow ldr r6, =gUnknown_085B2BB4 ldr r4, =gSpecialVar_0x8005 ldrh r0, [r4] @@ -8555,7 +8555,7 @@ sub_8139B60: @ 8139B60 mov r1, r8 str r1, [sp, 0x8] movs r1, 0x1 - bl Print + bl PrintTextOnWindow ldrb r0, [r5] bl PutWindowTilemap ldrb r0, [r5] @@ -9406,7 +9406,7 @@ sub_813A2DC: @ 813A2DC lsls r0, 3 ldr r1, =gTasks adds r6, r0, r1 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =gUnknown_0203AB68 movs r5, 0 strh r5, [r0] @@ -9680,7 +9680,7 @@ _0813A558: bl sub_813A738 ldr r0, =sub_813A600 str r0, [r6] - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _0813A566: pop {r4-r6} pop {r0} @@ -9741,7 +9741,7 @@ sub_813A570: @ 813A570 bl RemoveWindow adds r0, r5, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts add sp, 0x4 pop {r4,r5} pop {r0} @@ -9784,7 +9784,7 @@ sub_813A630: @ 813A630 lsrs r2, r0, 24 cmp r2, 0xFF bne _0813A64C - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts b _0813A65C .pool _0813A64C: @@ -9808,7 +9808,7 @@ sub_813A664: @ 813A664 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl script_env_2_enable + bl ScriptContext2_Enable adds r0, r4, 0 bl sub_813A694 ldr r1, =gTasks @@ -9940,7 +9940,7 @@ nullsub_55: @ 813A768 sub_813A76C: @ 813A76C push {r4-r6,lr} movs r4, 0 - ldr r6, =gUnknown_020229E8 + ldr r6, =gLinkPlayers ldr r0, =0x0000401f adds r5, r0, 0 _0813A776: @@ -10149,7 +10149,7 @@ sub_813A8FC: @ 813A8FC str r1, [sp, 0x8] movs r1, 0x1 add r2, sp, 0xC - bl Print + bl PrintTextOnWindow add sp, 0x2C pop {r0} bx r0 @@ -10644,7 +10644,7 @@ sub_813AD34: @ 813AD34 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow b _0813ADAC .pool _0813AD90: @@ -10660,7 +10660,7 @@ _0813AD90: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow _0813ADAC: add sp, 0xC pop {r4-r7} @@ -10764,7 +10764,7 @@ _0813AE1E: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrh r0, [r6, 0x22] lsls r0, 24 lsrs r0, 24 @@ -10975,7 +10975,7 @@ _0813B05C: movs r0, 0x2 _0813B06A: strh r0, [r1] - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _0813B070: adds r0, r7, 0 bl DestroyTask @@ -11092,7 +11092,7 @@ sub_813B160: @ 813B160 lsls r0, 24 cmp r0, 0 bne _0813B17C - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask _0813B17C: @@ -11229,7 +11229,7 @@ _0813B27E: bl get_pokemon_by_box_and_pos movs r1, 0xB movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 bne _0813B2C0 bl get_unknown_box_id @@ -11640,7 +11640,7 @@ _0813B5E4: beq _0813B5F2 b _0813B7C6 _0813B5F2: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _0813B5FE @@ -11662,7 +11662,7 @@ _0813B614: bne _0813B622 b _0813B7C6 _0813B622: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 beq _0813B62E @@ -11729,7 +11729,7 @@ _0813B6B4: beq _0813B6C2 b _0813B7C6 _0813B6C2: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _0813B790 @@ -11747,7 +11747,7 @@ _0813B6E4: ands r1, r0 cmp r1, 0 beq _0813B7C6 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 beq _0813B790 @@ -11769,7 +11769,7 @@ _0813B708: b _0813B7C6 .pool _0813B728: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _0813B74C @@ -11833,7 +11833,7 @@ _0813B7B4: ldr r1, =gUnknown_0203AB70 ldr r1, [r1] str r1, [r0] - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask _0813B7C6: @@ -12026,7 +12026,7 @@ _0813B8F4: bne _0813B94E mov r0, r9 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _0813B94E: pop {r3-r5} mov r8, r3 diff --git a/asm/rom_8034C54.s b/asm/rom_8034C54.s index c83e3aab7..2690b0f98 100644 --- a/asm/rom_8034C54.s +++ b/asm/rom_8034C54.s @@ -1493,7 +1493,7 @@ _0803584C: cmp r1, 0 beq _080358C4 ldr r2, =gTrainers - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -1900,7 +1900,7 @@ _08035C68: beq _08035CE2 cmp r2, 0x1 bne _08035CAE - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers ldr r0, =gBattleScripting adds r0, 0x25 ldrb r1, [r0] @@ -1924,7 +1924,7 @@ _08035CA4: bne _08035D68 b _08035CFC _08035CAE: - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers ldr r0, =gBattleScripting adds r0, 0x25 ldrb r1, [r0] @@ -1950,7 +1950,7 @@ _08035CD8: _08035CE2: cmp r2, 0x1 bne _08035D20 - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers ldr r0, =gBattleScripting adds r0, 0x25 ldrb r1, [r0] @@ -1971,7 +1971,7 @@ _08035CFC: b _08035D68 .pool _08035D20: - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers ldr r0, =gBattleScripting adds r0, 0x25 ldrb r1, [r0] @@ -2046,7 +2046,7 @@ _08035DAC: movs r5, 0 movs r6, 0x3 _08035DBC: - ldr r0, =gUnknown_020229F0 + ldr r0, =gLinkPlayers + 8 adds r1, r5, r0 subs r0, 0x8 adds r4, r5, r0 @@ -2121,7 +2121,7 @@ _08035E44: adds r6, r5, 0 eors r6, r0 adds r1, r6, 0 - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers lsls r0, r5, 3 subs r0, r5 lsls r0, 2 @@ -2603,7 +2603,7 @@ _080362F8: cmp r1, 0 beq _08036350 ldr r2, =gTrainers - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -2740,7 +2740,7 @@ _0803645C: cmp r1, 0 beq _0803648C ldr r2, =gTrainers - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -2850,7 +2850,7 @@ _08036568: cmp r1, 0 beq _08036598 ldr r2, =gTrainers - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -2961,7 +2961,7 @@ _08036674: cmp r1, 0 beq _080366AC ldr r2, =gTrainers - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 @@ -3062,16481 +3062,4 @@ _08036758: bx r1 thumb_func_end sub_80363C4 - thumb_func_start sub_8036760 -sub_8036760: @ 8036760 - push {lr} - bl saveblock_randomize_and_relocate - bl sub_8056F28 - bl dp11_init - bl init_uns_table_pokemon_copy - bl sub_8185F84 - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080367CC - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _08036798 - bl sub_80367D4 - b _080367BA - .pool -_08036798: - movs r0, 0x80 - lsls r0, 15 - ands r1, r0 - cmp r1, 0 - bne _080367B4 - bl battle_wireless_setup_if_required_maybe - ldr r0, =sub_8037ADC - bl SetMainCallback2 - b _080367BA - .pool -_080367B4: - ldr r0, =intro_end - bl SetMainCallback2 -_080367BA: - ldr r1, =gBattleCommunication - movs r0, 0 - strb r0, [r1] - b _080367D0 - .pool -_080367CC: - bl sub_80367D4 -_080367D0: - pop {r0} - bx r0 - thumb_func_end sub_8036760 - - thumb_func_start sub_80367D4 -sub_80367D4: @ 80367D4 - push {r4,r5,lr} - sub sp, 0x4 - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - str r0, [sp] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - mov r0, sp - bl CpuSet - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - ldr r1, =0x00005051 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - ldr r0, =gUnknown_02022E24 - movs r2, 0xF0 - strh r2, [r0] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _08036870 - ldr r0, =gUnknown_02038BCE - ldrh r1, [r0] - ldr r0, =0x00000c03 - cmp r1, r0 - beq _08036870 - ldr r1, =gUnknown_02022E26 - movs r0, 0x9F - strh r0, [r1] - ldr r0, =gUnknown_02022E28 - strh r2, [r0] - ldr r1, =gUnknown_02022E2A - movs r0, 0x20 - strh r0, [r1] - b _080368BE - .pool -_08036870: - ldr r0, =gUnknown_02022E26 - ldr r2, =0x00005051 - adds r1, r2, 0 - strh r1, [r0] - bl dp12_8087EA4 - ldr r0, =gUnknown_02038C28 - movs r3, 0xF0 - movs r5, 0xF0 - lsls r5, 3 - adds r2, r0, r5 - movs r1, 0x4F -_08036888: - strh r3, [r0] - strh r3, [r2] - adds r2, 0x2 - adds r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08036888 - movs r1, 0x50 - ldr r4, =gUnknown_0831AC70 - ldr r0, =gUnknown_02038C28 - ldr r3, =0x0000ff10 - movs r5, 0x82 - lsls r5, 4 - adds r2, r0, r5 - adds r0, 0xA0 -_080368A6: - strh r3, [r0] - strh r3, [r2] - adds r2, 0x2 - adds r0, 0x2 - adds r1, 0x1 - cmp r1, 0x9F - ble _080368A6 - ldr r0, [r4] - ldr r1, [r4, 0x4] - ldr r2, [r4, 0x8] - bl sub_80BA038 -_080368BE: - bl ResetPaletteFade - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r0, =gUnknown_02022E18 - strh r1, [r0] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - ldr r0, =gUnknown_02022E1C - strh r1, [r0] - ldr r0, =gUnknown_02022E1E - strh r1, [r0] - ldr r0, =gUnknown_02022E20 - strh r1, [r0] - ldr r0, =gUnknown_02022E22 - strh r1, [r0] - bl sub_80B0BD0 - ldr r2, =gUnknown_02022FF0 - strb r0, [r2] - ldr r4, =gBattleTypeFlags - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _080368FE - movs r0, 0x8 - strb r0, [r2] -_080368FE: - bl c2_berry_program_update_menu - bl sub_8035AA4 - bl ResetSpriteData - bl ResetTasks - bl sub_8036154 - bl FreeAllSpritePalettes - ldr r1, =gReservedSpritePaletteCount - movs r0, 0x4 - strb r0, [r1] - ldr r0, =vblank_cb_08078BB4 - bl SetVBlankCallback - bl sub_803269C - ldr r2, [r4] - movs r1, 0xA0 - lsls r1, 1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - beq _0803693E - ldr r1, =0x00400040 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - bne _08036994 -_0803693E: - ldr r0, =sub_8037458 - bl SetMainCallback2 - b _080369AE - .pool -_08036994: - movs r0, 0x40 - ands r2, r0 - cmp r2, 0 - beq _080369A8 - ldr r0, =sub_8037DF4 - bl SetMainCallback2 - b _080369AE - .pool -_080369A8: - ldr r0, =sub_8036FAC - bl SetMainCallback2 -_080369AE: - ldr r5, =gBattleTypeFlags - ldr r0, [r5] - ldr r1, =0x01000002 - ands r0, r1 - cmp r0, 0 - bne _080369E8 - ldr r4, =gEnemyParty - ldr r0, =gUnknown_02038BCA - ldrh r1, [r0] - adds r0, r4, 0 - movs r2, 0x1 - bl LoadTrainerParty - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _080369E4 - movs r1, 0x96 - lsls r1, 1 - adds r0, r4, r1 - ldr r1, =gUnknown_02038BCC - ldrh r1, [r1] - movs r2, 0 - bl LoadTrainerParty -_080369E4: - bl sub_806EA68 -_080369E8: - ldr r1, =gMain - ldr r2, =0x00000439 - adds r1, r2 - ldrb r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r5, =0x00000ca9 - adds r1, r5 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r4, =gPlayerParty - movs r0, 0xFA - lsls r0, 1 - adds r5, r4, r0 -_08036A10: - adds r0, r4, 0 - movs r1, 0x3 - bl happiness_algorithm - adds r4, 0x64 - cmp r4, r5 - ble _08036A10 - movs r1, 0 - ldr r0, =gBattleCommunication - strb r1, [r0] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80367D4 - - thumb_func_start sub_8036A5C -sub_8036A5C: @ 8036A5C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r6, 0 - mov r9, r6 - movs r0, 0xCE - lsls r0, 1 - mov r10, r0 - mov r8, r6 -_08036A72: - movs r0, 0x64 - mov r4, r9 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData - adds r1, r0, 0 - cmp r5, 0 - beq _08036AEE - cmp r5, r10 - beq _08036ABA - cmp r7, 0 - beq _08036ABA - cmp r1, 0 - bne _08036ABA - movs r0, 0x1 - mov r2, r8 - lsls r0, r2 - orrs r6, r0 - lsls r0, r6, 16 - lsrs r6, r0, 16 -_08036ABA: - cmp r5, 0 - beq _08036AEE - cmp r7, 0 - beq _08036AD6 - cmp r5, r10 - beq _08036ACA - cmp r1, 0 - beq _08036AD6 -_08036ACA: - movs r0, 0x2 - mov r1, r8 - lsls r0, r1 - orrs r6, r0 - lsls r0, r6, 16 - lsrs r6, r0, 16 -_08036AD6: - cmp r5, 0 - beq _08036AEE - cmp r5, r10 - beq _08036AEE - cmp r7, 0 - bne _08036AEE - movs r0, 0x3 - mov r2, r8 - lsls r0, r2 - orrs r6, r0 - lsls r0, r6, 16 - lsrs r6, r0, 16 -_08036AEE: - movs r0, 0x2 - add r8, r0 - movs r1, 0x1 - add r9, r1 - mov r2, r9 - cmp r2, 0x5 - ble _08036A72 - ldr r4, =gBattleStruct - ldr r0, [r4] - movs r1, 0xC1 - lsls r1, 1 - adds r0, r1 - strb r6, [r0] - ldr r0, [r4] - ldr r5, =0x00000183 - adds r0, r5 - lsrs r1, r6, 8 - strb r1, [r0] - ldr r0, =0x000008d2 - bl FlagGet - ldr r1, [r4] - adds r1, r5 - lsls r0, 7 - ldrb r2, [r1] - orrs r0, r2 - strb r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8036A5C - - thumb_func_start sub_8036B44 -sub_8036B44: @ 8036B44 - push {r4-r7,lr} - ldr r0, =gBattleStruct - ldr r5, [r0] - movs r0, 0xC2 - lsls r0, 1 - adds r4, r5, r0 - bl sub_80E162C - cmp r0, 0x1 - bne _08036BC0 - movs r2, 0 - ldr r7, =gSaveBlock1Ptr - movs r1, 0xC6 - lsls r1, 1 - adds r5, r1 - adds r6, r7, 0 - ldr r3, =0x000031f8 -_08036B66: - adds r0, r4, r2 - ldr r1, [r6] - adds r1, r3 - adds r1, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x5 - ble _08036B66 - adds r1, r4, r2 - movs r0, 0xFF - strb r0, [r1] - movs r2, 0 - adds r3, r5, 0 - ldr r6, =gSaveBlock1Ptr - ldr r5, =0x00003214 -_08036B86: - adds r0, r3, r2 - ldr r1, [r6] - adds r1, r5 - adds r1, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x11 - ble _08036B86 - ldr r0, [r7] - ldr r1, =0x00003226 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r4, 0x7] - ldr r0, [r7] - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - b _08036C00 - .pool -_08036BC0: - movs r0, 0xAF - bl ItemIdToBerryType - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - adds r3, r0, 0 - movs r2, 0 - movs r0, 0xC6 - lsls r0, 1 - adds r5, r0 -_08036BD8: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x5 - ble _08036BD8 - adds r1, r4, r2 - movs r0, 0xFF - strb r0, [r1] - adds r0, r5, 0 - movs r2, 0 - adds r1, r0, 0 - adds r1, 0x11 -_08036BF4: - strb r2, [r1] - subs r1, 0x1 - cmp r1, r0 - bge _08036BF4 - movs r0, 0 - strb r0, [r4, 0x7] -_08036C00: - strb r0, [r4, 0x1A] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8036B44 - - thumb_func_start berry_801017C -berry_801017C: @ 8036C08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08036C20 - b _08036D4C -_08036C20: - bl sub_80E162C - cmp r0, 0x1 - bne _08036CDC - movs r5, 0 - ldr r3, =gEnigmaBerries - ldr r0, =gSaveBlock1Ptr - mov r8, r0 - adds r6, r3, 0 - mov r4, r8 - ldr r2, =0x000031f8 - adds r7, r3, 0 - adds r7, 0x38 -_08036C3A: - adds r1, r5, r6 - ldr r0, [r4] - adds r0, r2 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r5, r7 - ldr r0, [r4] - adds r0, r2 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r5, 0x1 - cmp r5, 0x5 - ble _08036C3A - adds r1, r5, r3 - movs r0, 0xFF - strb r0, [r1] - adds r0, r3, 0 - adds r0, 0x38 - adds r0, r5, r0 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - movs r5, 0 - adds r7, r3, 0 - adds r7, 0x8 - ldr r4, =gSaveBlock1Ptr - ldr r2, =0x00003214 - adds r6, r3, 0 - adds r6, 0x40 -_08036C78: - adds r1, r5, r7 - ldr r0, [r4] - adds r0, r2 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r5, r6 - ldr r0, [r4] - adds r0, r2 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r5, 0x1 - cmp r5, 0x11 - ble _08036C78 - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00003226 - adds r0, r2 - ldrb r1, [r0] - strb r1, [r3, 0x7] - ldrb r0, [r0] - adds r1, r3, 0 - adds r1, 0x3F - strb r0, [r1] - mov r4, r8 - ldr r0, [r4] - ldr r1, =0x00003227 - adds r0, r1 - ldrb r1, [r0] - strb r1, [r3, 0x1A] - ldrb r1, [r0] - adds r0, r3, 0 - adds r0, 0x52 - strb r1, [r0] - b _08036EA0 - .pool -_08036CDC: - movs r0, 0xAF - bl ItemIdToBerryType - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - adds r6, r0, 0 - movs r5, 0 - ldr r4, =gEnigmaBerries - adds r7, r4, 0 - adds r7, 0x38 - adds r3, r4, 0 -_08036CF6: - adds r1, r5, r4 - adds r2, r6, r5 - ldrb r0, [r2] - strb r0, [r1] - adds r1, r5, r7 - ldrb r0, [r2] - strb r0, [r1] - adds r5, 0x1 - cmp r5, 0x5 - ble _08036CF6 - adds r1, r5, r3 - movs r0, 0xFF - strb r0, [r1] - adds r0, r3, 0 - adds r0, 0x38 - adds r0, r5, r0 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - movs r5, 0 - adds r4, r3, 0 - adds r4, 0x8 - movs r1, 0 - adds r2, r3, 0 - adds r2, 0x40 -_08036D28: - adds r0, r5, r4 - strb r1, [r0] - adds r0, r5, r2 - strb r1, [r0] - adds r5, 0x1 - cmp r5, 0x11 - ble _08036D28 - movs r1, 0 - strb r1, [r3, 0x7] - adds r0, r3, 0 - adds r0, 0x3F - strb r1, [r0] - strb r1, [r3, 0x1A] - adds r0, 0x13 - strb r1, [r0] - b _08036EA0 - .pool -_08036D4C: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08036DF0 - movs r0, 0x80 - lsls r0, 1 - ands r1, r0 - movs r2, 0x4 - mov r8, r2 - cmp r1, 0 - beq _08036D66 - movs r4, 0x2 - mov r8, r4 -_08036D66: - movs r5, 0 - cmp r5, r8 - blt _08036D6E - b _08036EA0 -_08036D6E: - ldr r0, =gUnknown_020229E8 - mov r12, r0 - ldr r3, =gEnigmaBerries - adds r6, r3, 0 - movs r1, 0x8 - adds r1, r6 - mov r9, r1 -_08036D7C: - lsls r1, r5, 8 - ldr r0, =gUnknown_020223C8 - adds r7, r1, r0 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r12 - ldrb r3, [r0, 0x18] - movs r4, 0 - adds r5, 0x1 - mov r10, r5 - lsls r1, r3, 3 - subs r0, r1, r3 - adds r5, r1, 0 - lsls r0, 2 - adds r1, r0, r6 -_08036D9C: - adds r0, r7, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r1, 0x1 - adds r4, 0x1 - cmp r4, 0x5 - ble _08036D9C - subs r0, r5, r3 - lsls r0, 2 - adds r1, r4, r0 - adds r1, r6 - movs r2, 0xFF - strb r2, [r1] - movs r4, 0 - mov r2, r9 - adds r1, r0, r2 - adds r2, r7, 0 - adds r2, 0x8 -_08036DC0: - adds r0, r2, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r1, 0x1 - adds r4, 0x1 - cmp r4, 0x11 - ble _08036DC0 - subs r0, r5, r3 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r7, 0x7] - strb r1, [r0, 0x7] - ldrb r1, [r7, 0x1A] - strb r1, [r0, 0x1A] - mov r5, r10 - cmp r5, r8 - blt _08036D7C - b _08036EA0 - .pool -_08036DF0: - movs r5, 0 - ldr r4, =gEnigmaBerries - mov r9, r4 -_08036DF6: - lsls r0, r5, 8 - ldr r1, =gUnknown_020223C8 - adds r7, r0, r1 - movs r4, 0 - adds r2, r5, 0x1 - mov r10, r2 - lsls r0, r5, 3 - mov r8, r0 - adds r1, r5, 0x2 - mov r12, r1 - subs r1, r0, r5 - mov r2, r12 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - mov r2, r9 - adds r3, r0, r2 - lsls r1, 2 - adds r2, r1, r2 -_08036E1C: - adds r0, r7, r4 - ldrb r1, [r0] - strb r1, [r2] - ldrb r0, [r0] - strb r0, [r3] - adds r3, 0x1 - adds r2, 0x1 - adds r4, 0x1 - cmp r4, 0x5 - ble _08036E1C - mov r0, r8 - subs r3, r0, r5 - lsls r3, 2 - adds r1, r4, r3 - add r1, r9 - ldrb r0, [r1] - movs r2, 0xFF - orrs r0, r2 - strb r0, [r1] - mov r0, r12 - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - adds r1, r4, r2 - add r1, r9 - ldrb r0, [r1] - movs r4, 0xFF - orrs r0, r4 - strb r0, [r1] - movs r4, 0 - ldr r0, =gEnigmaBerries - adds r0, 0x8 - adds r2, r0 - adds r3, r0 - adds r6, r7, 0 - adds r6, 0x8 -_08036E64: - adds r0, r6, r4 - ldrb r1, [r0] - strb r1, [r3] - ldrb r0, [r0] - strb r0, [r2] - adds r2, 0x1 - adds r3, 0x1 - adds r4, 0x1 - cmp r4, 0x11 - ble _08036E64 - mov r0, r8 - subs r2, r0, r5 - lsls r2, 2 - add r2, r9 - ldrb r0, [r7, 0x7] - strb r0, [r2, 0x7] - mov r1, r12 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r9 - ldrb r1, [r7, 0x7] - strb r1, [r0, 0x7] - ldrb r1, [r7, 0x1A] - strb r1, [r2, 0x1A] - ldrb r1, [r7, 0x1A] - strb r1, [r0, 0x1A] - mov r5, r10 - cmp r5, 0x1 - ble _08036DF6 -_08036EA0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end berry_801017C - - thumb_func_start sub_8036EB8 -sub_8036EB8: @ 8036EB8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - movs r6, 0 - ldr r0, =gUnknown_020223C4 - ldrh r2, [r0] - movs r1, 0x80 - lsls r1, 1 - mov r12, r0 - cmp r2, r1 - bne _08036EFC - cmp r3, 0 - bne _08036EEC - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r2, 0xC - b _08036EF2 - .pool -_08036EEC: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r2, 0x8 -_08036EF2: - orrs r1, r2 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08036EFC: - cmp r6, 0 - bne _08036FA0 - movs r2, 0 - cmp r2, r4 - bge _08036F20 - ldr r1, =gUnknown_020223C4 - mov r8, r1 - movs r5, 0x80 - lsls r5, 1 -_08036F0E: - adds r1, r5 - adds r2, 0x1 - cmp r2, r4 - bge _08036F20 - mov r7, r8 - ldrh r0, [r7] - ldrh r7, [r1] - cmp r0, r7 - beq _08036F0E -_08036F20: - cmp r2, r4 - bne _08036F48 - cmp r3, 0 - bne _08036F38 - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r2, 0xC - b _08036F3E - .pool -_08036F38: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r2, 0x8 -_08036F3E: - orrs r1, r2 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08036F48: - cmp r6, 0 - bne _08036FA0 - movs r2, 0 - ldr r5, =gBattleTypeFlags - cmp r2, r4 - bge _08036F8A - mov r0, r12 - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 2 - cmp r1, r0 - beq _08036F82 -_08036F60: - lsls r0, r2, 8 - add r0, r12 - ldrh r0, [r0] - movs r1, 0xC0 - lsls r1, 2 - cmp r0, r1 - bls _08036F72 - cmp r2, r3 - bne _08036F8A -_08036F72: - adds r2, 0x1 - cmp r2, r4 - bge _08036F8A - lsls r0, r2, 8 - add r0, r12 - ldrh r0, [r0] - cmp r0, r1 - bne _08036F60 -_08036F82: - cmp r2, r3 - beq _08036F60 - cmp r2, r3 - bge _08036F60 -_08036F8A: - cmp r2, r4 - bne _08036F98 - ldr r0, [r5] - movs r1, 0xC - b _08036F9C - .pool -_08036F98: - ldr r0, [r5] - movs r1, 0x8 -_08036F9C: - orrs r0, r1 - str r0, [r5] -_08036FA0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8036EB8 - - thumb_func_start sub_8036FAC -sub_8036FAC: @ 8036FAC - push {r4-r6,lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gBattleScripting - adds r0, 0x25 - strb r6, [r0] - movs r0, 0x1 - adds r5, r6, 0 - eors r5, r0 - ldr r0, =gBattleCommunication - ldrb r0, [r0] - cmp r0, 0x12 - bls _08036FD8 - b _0803744C -_08036FD8: - lsls r0, 2 - ldr r1, =_08036FF0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08036FF0: - .4byte _0803703C - .4byte _08037080 - .4byte _08037144 - .4byte _080371D8 - .4byte _08037200 - .4byte _0803742C - .4byte _08037438 - .4byte _08037230 - .4byte _08037258 - .4byte _0803742C - .4byte _08037438 - .4byte _08037288 - .4byte _080372B0 - .4byte _0803742C - .4byte _08037438 - .4byte _08037318 - .4byte _08037378 - .4byte _080373A0 - .4byte _080373E0 -_0803703C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08037068 - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - bl sub_805EF14 - ldr r1, =gBattleCommunication - movs r0, 0x1 - strb r0, [r1] -_08037068: - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - bne _08037072 - b _0803744C -_08037072: - bl sub_800E0E8 - b _0803744C - .pool -_08037080: - ldr r2, =gBattleTypeFlags - ldr r1, [r2] - movs r6, 0x2 - adds r0, r1, 0 - ands r0, r6 - cmp r0, 0 - beq _08037124 - ldr r0, =gUnknown_03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08037098 - b _0803744C -_08037098: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080370EE - ldr r4, =gBattleStruct - ldr r0, [r4] - movs r5, 0xC0 - lsls r5, 1 - adds r0, r5 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - ldr r2, =0x00000181 - adds r1, r0, r2 - movs r0, 0x3 - strb r0, [r1] - bl sub_8036A5C - bl sub_8036B44 - ldr r0, =gUnknown_02038BCA - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 4 - cmp r1, r0 - bne _080370D8 - ldr r0, =gUnknown_020229E8 - movs r1, 0 - strh r1, [r0, 0x18] - movs r1, 0x1 - strh r1, [r0, 0x34] -_080370D8: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - adds r1, r5 - movs r2, 0x20 - bl link_0800A448 - ldr r0, =gBattleCommunication - strb r6, [r0] -_080370EE: - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - bne _080370F8 - b _0803744C -_080370F8: - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _0803744C - .pool -_08037124: - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _08037134 - movs r0, 0x4 - orrs r1, r0 - str r1, [r2] -_08037134: - ldr r1, =gBattleCommunication - movs r0, 0xF - strb r0, [r1] - bl berry_801017C - b _0803744C - .pool -_08037144: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037152 - b _0803744C -_08037152: - bl sub_800A5B4 - movs r0, 0x2 - adds r1, r6, 0 - bl sub_8036EB8 - bl berry_801017C - ldr r0, =task00_0800F6FC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gTasks - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r1 - movs r1, 0 - movs r0, 0x87 - lsls r0, 1 - strh r0, [r2, 0xA] - movs r0, 0x5A - strh r0, [r2, 0xC] - strh r1, [r2, 0x12] - ldr r0, =gBattleStruct - ldr r3, [r0] - movs r4, 0xC1 - lsls r4, 1 - adds r0, r3, r4 - ldrb r1, [r0] - adds r4, 0x1 - adds r0, r3, r4 - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - strh r1, [r2, 0xE] - ldr r1, =gUnknown_020223C4 - lsls r4, r5, 8 - adds r1, 0x2 - adds r4, r1 - ldrh r0, [r4] - strh r0, [r2, 0x10] - lsls r0, r6, 8 - adds r0, r1 - ldrh r0, [r0] - bl sub_8185F90 - ldrh r0, [r4] - bl sub_8185F90 - bl sub_8068AA4 - ldr r1, =gBattleCommunication - b _08037446 - .pool -_080371D8: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080371E4 - b _0803744C -_080371E4: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gPlayerParty - movs r2, 0xC8 - bl link_0800A448 - ldr r1, =gBattleCommunication - b _08037446 - .pool -_08037200: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _0803720E - b _0803744C -_0803720E: - bl sub_800A5B4 - ldr r0, =gEnemyParty - lsls r1, r5, 8 - ldr r2, =gUnknown_020223C4 - adds r1, r2 - movs r2, 0xC8 - bl memcpy - ldr r1, =gBattleCommunication - b _08037446 - .pool -_08037230: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _0803723C - b _0803744C -_0803723C: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_020245B4 - movs r2, 0xC8 - bl link_0800A448 - ldr r1, =gBattleCommunication - b _08037446 - .pool -_08037258: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037266 - b _0803744C -_08037266: - bl sub_800A5B4 - ldr r0, =gUnknown_0202480C - lsls r1, r5, 8 - ldr r2, =gUnknown_020223C4 - adds r1, r2 - movs r2, 0xC8 - bl memcpy - ldr r1, =gBattleCommunication - b _08037446 - .pool -_08037288: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08037294 - b _0803744C -_08037294: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0202467C - movs r2, 0xC8 - bl link_0800A448 - ldr r1, =gBattleCommunication - b _08037446 - .pool -_080372B0: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _080372BE - b _0803744C -_080372BE: - bl sub_800A5B4 - ldr r4, =gUnknown_020248D4 - lsls r1, r5, 8 - ldr r0, =gUnknown_020223C4 - adds r1, r0 - adds r0, r4, 0 - movs r2, 0xC8 - bl memcpy - ldr r1, =0xfffffe70 - adds r0, r4, r1 - bl shedinja_something - ldr r2, =0xfffffed4 - adds r0, r4, r2 - bl shedinja_something - adds r0, r4, 0 - subs r0, 0xC8 - bl shedinja_something - adds r0, r4, 0 - subs r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - ldr r1, =gBattleCommunication - b _08037446 - .pool -_08037318: - bl sub_8032768 - bl sub_8184E58 - ldr r2, =gBattleCommunication - movs r0, 0 - strb r0, [r2, 0x1] - strb r0, [r2, 0x2] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08037372 - movs r3, 0 - ldr r1, =gUnknown_020229E8 - ldrb r0, [r1] - adds r5, r2, 0 - cmp r0, 0x3 - bne _08037356 - movs r4, 0xFF - adds r2, r1, 0 -_08037344: - adds r2, 0x1C - adds r3, 0x1 - cmp r3, 0x1 - bgt _08037356 - ldrh r1, [r2] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x3 - beq _08037344 -_08037356: - cmp r3, 0x2 - bne _0803736C - movs r0, 0x10 - strb r0, [r5] - b _0803744C - .pool -_0803736C: - movs r0, 0x12 - strb r0, [r5] - b _0803744C -_08037372: - movs r0, 0x12 - strb r0, [r2] - b _0803744C -_08037378: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0803744C - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203BD2C - movs r2, 0x4 - bl link_0800A448 - ldr r1, =gBattleCommunication - b _08037446 - .pool -_080373A0: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - bne _0803744C - bl sub_800A5B4 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080373CA - ldr r0, =gUnknown_0203BD2C - lsls r1, r5, 8 - ldr r2, =gUnknown_020223C4 - adds r1, r2 - movs r2, 0x4 - bl memcpy -_080373CA: - ldr r1, =gBattleCommunication - b _08037446 - .pool -_080373E0: - ldr r0, =gUnknown_02024333 - adds r1, r0, 0x1 - bl battle_load_something - lsls r0, 24 - cmp r0, 0 - beq _0803744C - ldr r2, =gUnknown_03005D00 - ldr r1, =gMain - ldr r0, [r1] - str r0, [r2] - ldr r0, =sub_8039EF0 - str r0, [r1] - ldr r0, =sub_8038420 - bl SetMainCallback2 - ldr r2, =gBattleTypeFlags - ldr r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0803744C - movs r0, 0x20 - orrs r1, r0 - str r1, [r2] - b _0803744C - .pool -_0803742C: - ldr r0, =gBattleCommunication - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - movs r1, 0x1 - strb r1, [r0, 0x1] -_08037438: - ldr r1, =gBattleCommunication - ldrb r0, [r1, 0x1] - subs r0, 0x1 - strb r0, [r1, 0x1] - lsls r0, 24 - cmp r0, 0 - bne _0803744C -_08037446: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0803744C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8036FAC - - thumb_func_start sub_8037458 -sub_8037458: @ 8037458 - push {r4-r7,lr} - sub sp, 0x4 - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gBattleScripting - adds r0, 0x25 - strb r6, [r0] - movs r0, 0x1 - adds r7, r6, 0 - eors r7, r0 - ldr r0, =gBattleCommunication - ldrb r0, [r0] - cmp r0, 0x10 - bls _08037486 - b _080379D6 -_08037486: - lsls r0, 2 - ldr r1, =_0803749C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803749C: - .4byte _080374E0 - .4byte _08037518 - .4byte _0803761C - .4byte _08037670 - .4byte _08037694 - .4byte _08037710 - .4byte _08037734 - .4byte _080377B0 - .4byte _080377CC - .4byte _080377FC - .4byte _08037818 - .4byte _08037848 - .4byte _08037864 - .4byte _08037908 - .4byte _0803793A - .4byte _0803795C - .4byte _080379A0 -_080374E0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0803750C - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - bl sub_805EF14 - ldr r1, =gBattleCommunication - movs r0, 0x1 - strb r0, [r1] -_0803750C: - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - beq _08037518 - bl sub_800E0E8 -_08037518: - ldr r2, =gBattleTypeFlags - ldr r1, [r2] - movs r3, 0x2 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _080375FC - ldr r0, =gUnknown_03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08037530 - b _080379D6 -_08037530: - ldr r6, =gUnknown_020229E8 - movs r0, 0 - strh r0, [r6, 0x18] - strh r3, [r6, 0x34] - adds r1, r6, 0 - adds r1, 0x50 - movs r0, 0x1 - strh r0, [r1] - adds r1, 0x1C - movs r0, 0x3 - strh r0, [r1] - adds r0, r6, 0 - adds r0, 0x40 - ldr r4, =gUnknown_02038BCA - ldrh r1, [r4] - bl sub_8162E20 - adds r0, r6, 0 - adds r0, 0x5C - ldr r5, =gUnknown_02038BCC - ldrh r1, [r5] - bl sub_8162E20 - ldrh r1, [r4] - mov r0, sp - bl sub_8165B88 - mov r0, sp - ldrb r0, [r0] - adds r1, r6, 0 - adds r1, 0x52 - strh r0, [r1] - ldrh r1, [r5] - mov r0, sp - bl sub_8165B88 - mov r0, sp - ldrb r1, [r0] - adds r0, r6, 0 - adds r0, 0x6E - strh r1, [r0] - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080375C4 - ldr r4, =gBattleStruct - ldr r0, [r4] - movs r5, 0xC0 - lsls r5, 1 - adds r0, r5 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - ldr r2, =0x00000181 - adds r1, r0, r2 - movs r0, 0x3 - strb r0, [r1] - bl sub_8036A5C - bl sub_8036B44 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - adds r1, r5 - movs r2, 0x20 - bl link_0800A448 - ldr r1, =gBattleCommunication - movs r0, 0x2 - strb r0, [r1] -_080375C4: - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - bne _080375CE - b _080379D6 -_080375CE: - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _080379D6 - .pool -_080375FC: - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _0803760C - movs r0, 0x4 - orrs r1, r0 - str r1, [r2] -_0803760C: - ldr r1, =gBattleCommunication - movs r0, 0xD - strb r0, [r1] - bl berry_801017C - b _080379D6 - .pool -_0803761C: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _0803762A - b _080379D6 -_0803762A: - bl sub_800A5B4 - movs r0, 0x2 - adds r1, r6, 0 - bl sub_8036EB8 - bl berry_801017C - ldr r0, =task00_0800F6FC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - movs r0, 0x87 - lsls r0, 1 - strh r0, [r1, 0xA] - movs r0, 0x5A - strh r0, [r1, 0xC] - strh r2, [r1, 0x12] - adds r0, 0xEB - strh r0, [r1, 0xE] - strh r0, [r1, 0x10] - b _08037986 - .pool -_08037670: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _0803767C - b _080379D6 -_0803767C: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gPlayerParty -_08037686: - movs r2, 0xC8 - bl link_0800A448 - b _08037986 - .pool -_08037694: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _080376A2 - b _080379D6 -_080376A2: - bl sub_800A5B4 - ldr r0, =gUnknown_020229E8 - lsls r1, r6, 3 - subs r1, r6 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x18] - cmp r0, 0 - beq _080376E8 - ldr r4, =gPlayerParty - lsls r1, r7, 8 - ldr r5, =gUnknown_020223C4 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0xC8 - bl memcpy - movs r0, 0x96 - lsls r0, 1 - adds r4, r0 - lsls r1, r6, 8 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0xC8 - bl memcpy - b _08037986 - .pool -_080376E8: - ldr r4, =gPlayerParty - lsls r1, r6, 8 - ldr r5, =gUnknown_020223C4 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0xC8 - bl memcpy - movs r1, 0x96 - lsls r1, 1 - adds r4, r1 - lsls r1, r7, 8 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0xC8 - b _08037982 - .pool -_08037710: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _0803771C - b _080379D6 -_0803771C: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_020245B4 - movs r2, 0x64 - bl link_0800A448 - b _08037986 - .pool -_08037734: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037742 - b _080379D6 -_08037742: - bl sub_800A5B4 - ldr r0, =gUnknown_020229E8 - lsls r1, r6, 3 - subs r1, r6 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x18] - cmp r0, 0 - beq _08037788 - ldr r4, =gUnknown_020245B4 - lsls r1, r7, 8 - ldr r5, =gUnknown_020223C4 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy - movs r2, 0x96 - lsls r2, 1 - adds r4, r2 - lsls r1, r6, 8 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy - b _08037986 - .pool -_08037788: - ldr r4, =gUnknown_020245B4 - lsls r1, r6, 8 - ldr r5, =gUnknown_020223C4 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy - movs r0, 0x96 - lsls r0, 1 - adds r4, r0 - lsls r1, r7, 8 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0x64 - b _08037982 - .pool -_080377B0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080377BC - b _080379D6 -_080377BC: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gEnemyParty - b _08037686 - .pool -_080377CC: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _080377DA - b _080379D6 -_080377DA: - bl sub_800A5B4 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _080377EA - b _08037986 -_080377EA: - ldr r0, =gEnemyParty - ldr r1, =gUnknown_020223C4 - movs r2, 0xC8 - b _08037982 - .pool -_080377FC: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08037808 - b _080379D6 -_08037808: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0202480C - b _08037686 - .pool -_08037818: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037826 - b _080379D6 -_08037826: - bl sub_800A5B4 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _08037836 - b _08037986 -_08037836: - ldr r0, =gUnknown_0202480C - ldr r1, =gUnknown_020223C4 - movs r2, 0xC8 - b _08037982 - .pool -_08037848: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08037854 - b _080379D6 -_08037854: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_020248D4 - b _08037686 - .pool -_08037864: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037872 - b _080379D6 -_08037872: - bl sub_800A5B4 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - beq _0803788A - ldr r0, =gUnknown_020248D4 - ldr r1, =gUnknown_020223C4 - movs r2, 0xC8 - bl memcpy -_0803788A: - ldr r4, =gPlayerParty - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0xC8 - bl shedinja_something - movs r1, 0x96 - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - movs r2, 0xC8 - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - movs r1, 0xFA - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - ldr r4, =gEnemyParty - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0xC8 - bl shedinja_something - movs r2, 0x96 - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - movs r1, 0xC8 - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - movs r2, 0xFA - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - b _08037986 - .pool -_08037908: - bl sub_8032768 - bl sub_8184E58 - ldr r2, =gBattleCommunication - movs r0, 0 - strb r0, [r2, 0x1] - strb r0, [r2, 0x2] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08037934 - movs r0, 0xE - strb r0, [r2] - b _080379D6 - .pool -_08037934: - movs r0, 0x10 - strb r0, [r2] - b _080379D6 -_0803793A: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080379D6 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203BD2C - movs r2, 0x4 - bl link_0800A448 - b _08037986 - .pool -_0803795C: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - bne _080379D6 - bl sub_800A5B4 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - bne _08037986 - ldr r0, =gUnknown_0203BD2C - lsls r1, r7, 8 - ldr r2, =gUnknown_020223C4 - adds r1, r2 - movs r2, 0x4 -_08037982: - bl memcpy -_08037986: - ldr r1, =gBattleCommunication - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080379D6 - .pool -_080379A0: - ldr r0, =gUnknown_02024333 - adds r1, r0, 0x1 - bl battle_load_something - lsls r0, 24 - cmp r0, 0 - beq _080379D6 - bl sub_8166188 - ldr r2, =gUnknown_03005D00 - ldr r1, =gMain - ldr r0, [r1] - str r0, [r2] - ldr r0, =sub_8039EF0 - str r0, [r1] - ldr r0, =sub_8038420 - bl SetMainCallback2 - ldr r2, =gBattleTypeFlags - ldr r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080379D6 - movs r0, 0x20 - orrs r1, r0 - str r1, [r2] -_080379D6: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8037458 - - thumb_func_start sub_80379F8 -sub_80379F8: @ 80379F8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0 - mov r8, r0 - ldr r6, =gUnknown_02022FF8 - mov r10, r6 -_08037A12: - ldr r1, [sp] - add r1, r8 - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - mov r1, r8 - lsls r5, r1, 5 - strh r0, [r6] - adds r0, r4, 0 - movs r1, 0xC - bl GetMonData - strh r0, [r6, 0x2] - movs r0, 0x4 - add r0, r10 - mov r9, r0 - adds r7, r5, r0 - adds r0, r4, 0 - movs r1, 0x2 - adds r2, r7, 0 - bl GetMonData - adds r0, r4, 0 - movs r1, 0x38 - bl GetMonData - strb r0, [r6, 0xF] - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - strh r0, [r6, 0x10] - adds r0, r4, 0 - movs r1, 0x3A - bl GetMonData - strh r0, [r6, 0x12] - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData - mov r1, r10 - adds r1, 0x14 - adds r5, r1 - str r0, [r5] - adds r0, r4, 0 - movs r1, 0 - bl GetMonData - str r0, [r6, 0x18] - adds r0, r4, 0 - bl pokemon_get_gender - strb r0, [r6, 0x1C] - adds r0, r7, 0 - bl StripExtCtrlCodes - adds r0, r4, 0 - movs r1, 0x3 - bl GetMonData - cmp r0, 0x1 - beq _08037AA4 - adds r0, r7, 0 - movs r1, 0 - bl sub_81DB4DC -_08037AA4: - adds r6, 0x20 - movs r1, 0x1 - add r8, r1 - mov r0, r8 - cmp r0, 0x2 - ble _08037A12 - ldr r0, =gUnknown_02023058 - ldr r0, [r0] - mov r1, r9 - subs r1, 0x4 - movs r2, 0x60 - bl memcpy - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80379F8 - - thumb_func_start sub_8037ADC -sub_8037ADC: @ 8037ADC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0x4 - mov r9, r0 - movs r4, 0xF - ldr r6, =gBattleTypeFlags - ldr r0, [r6] - movs r1, 0x80 - lsls r1, 1 - ands r0, r1 - cmp r0, 0 - beq _08037B02 - movs r1, 0x2 - mov r9, r1 - movs r4, 0x3 -_08037B02: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gBattleScripting - adds r0, 0x25 - movs r2, 0 - mov r8, r2 - strb r7, [r0] - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0xB4 - str r1, [sp] - adds r0, 0xAC - mov r10, r0 - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - ldr r5, =gBattleCommunication - ldrb r0, [r5] - cmp r0, 0x1 - beq _08037BA4 - cmp r0, 0x1 - bgt _08037B50 - cmp r0, 0 - beq _08037B5E - b _08037D0A - .pool -_08037B50: - cmp r0, 0x2 - bne _08037B56 - b _08037C64 -_08037B56: - cmp r0, 0x3 - bne _08037B5C - b _08037C9E -_08037B5C: - b _08037D0A -_08037B5E: - ldr r0, =gUnknown_03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08037B68 - b _08037D0A -_08037B68: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08037B74 - b _08037D0A -_08037B74: - ldr r4, =gUnknown_02023058 - movs r0, 0x60 - bl Alloc - str r0, [r4] - movs r0, 0 - bl sub_80379F8 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - movs r2, 0x60 - bl link_0800A448 - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _08037D0A - .pool -_08037BA4: - bl sub_800A550 - adds r1, r4, 0 - ands r1, r0 - cmp r1, r4 - beq _08037BB2 - b _08037D0A -_08037BB2: - bl sub_800A5B4 - movs r5, 0 - cmp r8, r9 - bge _08037C2E - lsls r0, r7, 3 - subs r0, r7 - lsls r6, r0, 2 - mov r8, r5 - ldr r4, =gUnknown_020223C4 -_08037BC6: - cmp r5, r7 - beq _08037C1E - mov r2, r9 - cmp r2, 0x4 - bne _08037C14 - ldr r2, =gUnknown_020229E8 - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _08037BF8 - adds r0, r6, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08037C04 - b _08037C1E - .pool -_08037BF8: - adds r0, r6, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08037C1E -_08037C04: - ldr r0, =gUnknown_02022FF8 - adds r1, r4, 0 - movs r2, 0x60 - bl memcpy - b _08037C1E - .pool -_08037C14: - ldr r0, =gUnknown_02022FF8 - adds r1, r4, 0 - movs r2, 0x60 - bl memcpy -_08037C1E: - movs r2, 0x80 - lsls r2, 1 - adds r4, r2 - movs r0, 0x1C - add r8, r0 - adds r5, 0x1 - cmp r5, r9 - blt _08037BC6 -_08037C2E: - ldr r1, =gBattleCommunication - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =gMain - ldr r0, [r1, 0x8] - ldr r2, [sp] - str r0, [r2] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - mov r2, r10 - str r0, [r2] - ldr r0, =sub_8037ADC - str r0, [r1, 0x8] - bl sub_81B9150 - b _08037D0A - .pool -_08037C64: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08037D0A - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08037D0A - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - beq _08037C98 - bl sub_800ADF8 - b _08037D0A - .pool -_08037C98: - bl sub_800AC34 - b _08037D0A -_08037C9E: - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - beq _08037CE4 - bl sub_8010500 - lsls r0, 24 - cmp r0, 0 - beq _08037D0A - mov r1, r10 - ldr r0, [r1] - str r0, [r6] - ldr r1, =gMain - ldr r2, [sp] - ldr r0, [r2] - str r0, [r1, 0x8] - ldr r0, =sub_80367D4 - bl SetMainCallback2 - ldr r4, =gUnknown_02023058 - ldr r0, [r4] - bl Free - mov r0, r8 - str r0, [r4] - b _08037D0A - .pool -_08037CE4: - ldr r0, =gUnknown_03003124 - ldrb r5, [r0] - cmp r5, 0 - bne _08037D0A - mov r1, r10 - ldr r0, [r1] - str r0, [r6] - ldr r1, =gMain - ldr r2, [sp] - ldr r0, [r2] - str r0, [r1, 0x8] - ldr r0, =sub_80367D4 - bl SetMainCallback2 - ldr r4, =gUnknown_02023058 - ldr r0, [r4] - bl Free - str r5, [r4] -_08037D0A: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8037ADC - - thumb_func_start intro_end -intro_end: @ 8037D2C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gBattleStruct - ldr r0, [r0] - movs r1, 0xB4 - adds r1, r0 - mov r8, r1 - adds r7, r0, 0 - adds r7, 0xAC - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - ldr r5, =gBattleCommunication - ldrb r0, [r5] - cmp r0, 0 - beq _08037D64 - cmp r0, 0x1 - beq _08037DA4 - b _08037DD6 - .pool -_08037D64: - ldr r4, =gUnknown_02023058 - movs r0, 0x60 - bl Alloc - str r0, [r4] - movs r0, 0x3 - bl sub_80379F8 - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldr r1, =gMain - ldr r0, [r1, 0x8] - mov r2, r8 - str r0, [r2] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - str r0, [r7] - ldr r0, =intro_end - str r0, [r1, 0x8] - bl sub_81B9150 - b _08037DD6 - .pool -_08037DA4: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08037DD6 - movs r0, 0x2 - strb r0, [r5] - ldr r1, =gBattleTypeFlags - ldr r0, [r7] - str r0, [r1] - ldr r1, =gMain - mov r2, r8 - ldr r0, [r2] - str r0, [r1, 0x8] - ldr r0, =sub_80367D4 - bl SetMainCallback2 - ldr r4, =gUnknown_02023058 - ldr r0, [r4] - bl Free - str r6, [r4] -_08037DD6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end intro_end - - thumb_func_start sub_8037DF4 -sub_8037DF4: @ 8037DF4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gBattleScripting - adds r0, 0x25 - strb r7, [r0] - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - ldr r0, =gBattleCommunication - ldrb r0, [r0] - cmp r0, 0xA - bls _08037E20 - b _080383F8 -_08037E20: - lsls r0, 2 - ldr r1, =_08037E38 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08037E38: - .4byte _08037E64 - .4byte _08037EA8 - .4byte _08037F50 - .4byte _08038026 - .4byte _0803804C - .4byte _08038140 - .4byte _08038164 - .4byte _080382CC - .4byte _0803832C - .4byte _0803836C - .4byte _080383BC -_08037E64: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08037E90 - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - bl sub_805EF14 - ldr r1, =gBattleCommunication - movs r0, 0x1 - strb r0, [r1] -_08037E90: - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - bne _08037E9A - b _080383F8 -_08037E9A: - bl sub_800E0E8 - b _080383F8 - .pool -_08037EA8: - ldr r2, =gBattleTypeFlags - ldr r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08037F30 - ldr r0, =gUnknown_03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08037EBE - b _080383F8 -_08037EBE: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08037F02 - ldr r4, =gBattleStruct - ldr r0, [r4] - movs r5, 0xC0 - lsls r5, 1 - adds r0, r5 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - ldr r2, =0x00000181 - adds r1, r0, r2 - movs r0, 0x3 - strb r0, [r1] - bl sub_8036A5C - bl sub_8036B44 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - adds r1, r5 - movs r2, 0x20 - bl link_0800A448 - ldr r1, =gBattleCommunication - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08037F02: - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - bne _08037F0C - b _080383F8 -_08037F0C: - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _080383F8 - .pool -_08037F30: - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _08037F40 - movs r0, 0x4 - orrs r1, r0 - str r1, [r2] -_08037F40: - ldr r1, =gBattleCommunication - movs r0, 0x7 - strb r0, [r1] - bl berry_801017C - b _080383F8 - .pool -_08037F50: - bl sub_800A550 - movs r1, 0xF - ands r1, r0 - cmp r1, 0xF - beq _08037F5E - b _080383F8 -_08037F5E: - bl sub_800A5B4 - movs r0, 0x4 - adds r1, r7, 0 - bl sub_8036EB8 - bl berry_801017C - bl sub_8068AA4 - ldr r0, =task00_0800F6FC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x87 - lsls r1, 1 - strh r1, [r0, 0xA] - movs r1, 0x5A - strh r1, [r0, 0xC] - strh r2, [r0, 0x12] - strh r2, [r0, 0xE] - strh r2, [r0, 0x10] - ldr r1, =gUnknown_020223C4 - adds r4, r0, 0 - adds r5, r1, 0x2 - movs r7, 0x3F - movs r6, 0x3 -_08037FA4: - ldrh r0, [r5] - str r2, [sp] - bl sub_8185F90 - ldr r0, =gUnknown_020229E8 - ldr r2, [sp] - adds r0, r2, r0 - ldrh r0, [r0, 0x18] - cmp r0, 0x1 - beq _08037FE6 - cmp r0, 0x1 - bgt _08037FD4 - cmp r0, 0 - beq _08037FDE - b _0803800C - .pool -_08037FD4: - cmp r0, 0x2 - beq _08037FEE - cmp r0, 0x3 - beq _08037FFE - b _0803800C -_08037FDE: - ldrh r0, [r5] - adds r1, r7, 0 - ands r1, r0 - b _08037FF6 -_08037FE6: - ldrh r0, [r5] - adds r1, r7, 0 - ands r1, r0 - b _08038006 -_08037FEE: - ldrh r0, [r5] - adds r1, r7, 0 - ands r1, r0 - lsls r1, 6 -_08037FF6: - ldrh r0, [r4, 0xE] - orrs r1, r0 - strh r1, [r4, 0xE] - b _0803800C -_08037FFE: - ldrh r0, [r5] - adds r1, r7, 0 - ands r1, r0 - lsls r1, 6 -_08038006: - ldrh r0, [r4, 0x10] - orrs r1, r0 - strh r1, [r4, 0x10] -_0803800C: - movs r0, 0x80 - lsls r0, 1 - adds r5, r0 - adds r2, 0x1C - subs r6, 0x1 - cmp r6, 0 - bge _08037FA4 - bl ZeroEnemyPartyMons - ldr r1, =gBattleCommunication - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08038026: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08038032 - b _080383F8 -_08038032: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gPlayerParty - movs r2, 0xC8 - bl link_0800A448 - b _080383A6 - .pool -_0803804C: - bl sub_800A550 - movs r1, 0xF - ands r1, r0 - cmp r1, 0xF - beq _0803805A - b _080383F8 -_0803805A: - bl sub_800A5B4 - movs r6, 0 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - mov r8, r0 - ldr r4, =gUnknown_020223C4 - movs r5, 0 -_0803806C: - cmp r6, r7 - bne _080380A0 - ldr r0, =gUnknown_020229E8 - adds r0, r5, r0 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _0803808C - cmp r0, 0x1 - bge _08038098 - cmp r0, 0 - beq _08038090 - b _0803812A - .pool -_0803808C: - cmp r0, 0x3 - bne _0803812A -_08038090: - ldr r0, =gPlayerParty - b _08038110 - .pool -_08038098: - ldr r0, =gUnknown_02024618 - b _08038110 - .pool -_080380A0: - ldr r2, =gUnknown_020229E8 - adds r0, r5, r2 - ldrh r1, [r0, 0x18] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _080380C4 - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080380D2 - b _080380F8 - .pool -_080380C4: - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080380F8 -_080380D2: - adds r0, r5, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _080380E4 - cmp r0, 0x1 - bge _080380F0 - cmp r0, 0 - beq _080380E8 - b _0803812A -_080380E4: - cmp r0, 0x3 - bne _0803812A -_080380E8: - ldr r0, =gPlayerParty - b _08038110 - .pool -_080380F0: - ldr r0, =gUnknown_02024618 - b _08038110 - .pool -_080380F8: - adds r0, r5, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _0803810A - cmp r0, 0x1 - bge _08038120 - cmp r0, 0 - beq _0803810E - b _0803812A -_0803810A: - cmp r0, 0x3 - bne _0803812A -_0803810E: - ldr r0, =gEnemyParty -_08038110: - adds r1, r4, 0 - movs r2, 0xC8 - bl memcpy - b _0803812A - .pool -_08038120: - ldr r0, =gUnknown_02024870 - adds r1, r4, 0 - movs r2, 0xC8 - bl memcpy -_0803812A: - movs r2, 0x80 - lsls r2, 1 - adds r4, r2 - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _0803806C - b _080383A6 - .pool -_08038140: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _0803814C - b _080383F8 -_0803814C: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_020245B4 - movs r2, 0x64 - bl link_0800A448 - b _080383A6 - .pool -_08038164: - bl sub_800A550 - movs r1, 0xF - ands r1, r0 - cmp r1, 0xF - beq _08038172 - b _080383F8 -_08038172: - bl sub_800A5B4 - movs r6, 0 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - mov r8, r0 - ldr r4, =gUnknown_020223C4 - movs r5, 0 -_08038184: - cmp r6, r7 - bne _080381B8 - ldr r0, =gUnknown_020229E8 - adds r0, r5, r0 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _080381A4 - cmp r0, 0x1 - bge _080381B0 - cmp r0, 0 - beq _080381A8 - b _08038242 - .pool -_080381A4: - cmp r0, 0x3 - bne _08038242 -_080381A8: - ldr r0, =gUnknown_020245B4 - b _08038228 - .pool -_080381B0: - ldr r0, =gUnknown_020246E0 - b _08038228 - .pool -_080381B8: - ldr r2, =gUnknown_020229E8 - adds r0, r5, r2 - ldrh r1, [r0, 0x18] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _080381DC - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080381EA - b _08038210 - .pool -_080381DC: - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08038210 -_080381EA: - adds r0, r5, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _080381FC - cmp r0, 0x1 - bge _08038208 - cmp r0, 0 - beq _08038200 - b _08038242 -_080381FC: - cmp r0, 0x3 - bne _08038242 -_08038200: - ldr r0, =gUnknown_020245B4 - b _08038228 - .pool -_08038208: - ldr r0, =gUnknown_020246E0 - b _08038228 - .pool -_08038210: - adds r0, r5, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _08038222 - cmp r0, 0x1 - bge _08038238 - cmp r0, 0 - beq _08038226 - b _08038242 -_08038222: - cmp r0, 0x3 - bne _08038242 -_08038226: - ldr r0, =gUnknown_0202480C -_08038228: - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - b _08038242 - .pool -_08038238: - ldr r0, =gUnknown_02024938 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy -_08038242: - movs r2, 0x80 - lsls r2, 1 - adds r4, r2 - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _08038184 - ldr r4, =gPlayerParty - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0xC8 - bl shedinja_something - movs r1, 0x96 - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - movs r2, 0xC8 - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - movs r1, 0xFA - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - ldr r4, =gEnemyParty - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0xC8 - bl shedinja_something - movs r2, 0x96 - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - movs r1, 0xC8 - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - movs r2, 0xFA - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - b _080383A6 - .pool -_080382CC: - bl sub_8032768 - bl sub_8184E58 - ldr r3, =gBattleCommunication - movs r0, 0 - strb r0, [r3, 0x1] - strb r0, [r3, 0x2] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08038326 - movs r6, 0 - ldr r0, =gUnknown_020229E8 - ldrb r1, [r0] - adds r4, r3, 0 - adds r2, r0, 0 - cmp r1, 0x3 - bne _0803830A - movs r3, 0xFF -_080382F8: - adds r2, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - bgt _0803830A - ldrh r1, [r2] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0x3 - beq _080382F8 -_0803830A: - cmp r6, 0x4 - bne _08038320 - movs r0, 0x8 - strb r0, [r4] - b _080383F8 - .pool -_08038320: - movs r0, 0xA - strb r0, [r4] - b _080383F8 -_08038326: - movs r0, 0xA - strb r0, [r3] - b _080383F8 -_0803832C: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080383F8 - ldr r0, =gBattleStruct - ldr r4, [r0] - movs r0, 0xC0 - lsls r0, 1 - adds r4, r0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - str r0, [r4] - ldr r0, =gUnknown_0203BD2C - ldr r0, [r0] - str r0, [r4, 0x4] - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - movs r2, 0x8 - bl link_0800A448 - b _080383A6 - .pool -_0803836C: - bl sub_800A550 - movs r1, 0xF - ands r1, r0 - cmp r1, 0xF - bne _080383F8 - bl sub_800A5B4 - movs r2, 0 - b _08038386 -_08038380: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_08038386: - cmp r2, 0x3 - bhi _080383A6 - ldr r4, =gUnknown_020223C4 - lsls r3, r2, 8 - adds r0, r3, r4 - ldrh r0, [r0] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08038380 - adds r1, r4, 0x4 - adds r1, r3, r1 - ldr r0, =gUnknown_0203BD2C - movs r2, 0x4 - bl memcpy -_080383A6: - ldr r1, =gBattleCommunication - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080383F8 - .pool -_080383BC: - ldr r0, =gUnknown_02024333 - adds r1, r0, 0x1 - bl battle_load_something - lsls r0, 24 - cmp r0, 0 - beq _080383F8 - ldr r2, =gUnknown_03005D00 - ldr r1, =gMain - ldr r0, [r1] - str r0, [r2] - ldr r0, =sub_8039EF0 - str r0, [r1] - ldr r0, =sub_8038420 - bl SetMainCallback2 - ldr r3, =gBattleTypeFlags - ldr r2, [r3] - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _080383F8 - ldr r0, =gUnknown_02038BCA - movs r4, 0x80 - lsls r4, 4 - adds r1, r4, 0 - strh r1, [r0] - movs r0, 0x20 - orrs r2, r0 - str r2, [r3] -_080383F8: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8037DF4 - - thumb_func_start sub_8038420 -sub_8038420: @ 8038420 - push {lr} - sub sp, 0x4 - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - bl RunTasks - ldr r0, =gMain - ldrh r1, [r0, 0x2C] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08038482 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08038482 - bl rfu_lacks_rfufunc - lsls r0, 24 - cmp r0, 0 - beq _08038482 - ldr r2, =gScriptResult - ldr r1, =gBattleOutcome - movs r0, 0x5 - strb r0, [r1] - movs r0, 0x5 - strh r0, [r2] - bl ResetPaletteFadeControl - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_80384E4 - bl SetMainCallback2 -_08038482: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038420 - - thumb_func_start sub_803849C -sub_803849C: @ 803849C - push {lr} - ldr r1, =gMain - ldr r0, =gUnknown_03005D00 - ldr r0, [r0] - str r0, [r1] - ldr r2, =gUnknown_02039B28 - movs r0, 0x3 - strb r0, [r2, 0x15] - ldr r0, =0x00000439 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - bl ZeroEnemyPartyMons - movs r0, 0x5A - bl m4aSongNumStop - bl sub_805F094 - bl dp11_free - bl sub_8057028 - pop {r0} - bx r0 - .pool - thumb_func_end sub_803849C - - thumb_func_start sub_80384E4 -sub_80384E4: @ 80384E4 - push {lr} - bl UpdatePaletteFade - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08038512 - ldr r0, =gMPlay_SE1 - bl m4aMPlayStop - ldr r0, =gMPlay_SE2 - bl m4aMPlayStop - bl sub_803849C - bl FreeAllWindowBuffers - ldr r0, =gMain - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_08038512: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80384E4 - - thumb_func_start sub_8038528 -sub_8038528: @ 8038528 - movs r1, 0 - strh r1, [r0, 0x2E] - ldr r1, =sub_8038538 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8038528 - - thumb_func_start sub_8038538 -sub_8038538: @ 8038538 - push {r4,r5,lr} - adds r3, r0, 0 - ldr r5, =0x0201c000 - movs r0, 0x2E - ldrsh r1, [r3, r0] - cmp r1, 0x1 - beq _0803856C - cmp r1, 0x1 - bgt _08038554 - cmp r1, 0 - beq _0803855A - b _080385DC - .pool -_08038554: - cmp r1, 0x2 - beq _080385C8 - b _080385DC -_0803855A: - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - strh r1, [r3, 0x30] - ldr r0, =0x00000281 - strh r0, [r3, 0x32] - strh r1, [r3, 0x34] - movs r0, 0x1 - strh r0, [r3, 0x36] -_0803856C: - ldrh r0, [r3, 0x36] - subs r0, 0x1 - strh r0, [r3, 0x36] - lsls r0, 16 - cmp r0, 0 - bne _080385DC - movs r0, 0x2 - strh r0, [r3, 0x36] - movs r4, 0x30 - ldrsh r2, [r3, r4] - movs r0, 0x34 - ldrsh r1, [r3, r0] - lsls r1, 5 - adds r2, r1 - movs r4, 0x32 - ldrsh r0, [r3, r4] - subs r0, r1 - movs r4, 0x3D - lsls r0, 1 - adds r0, r5 - lsls r2, 1 - adds r2, r5 - movs r1, 0x1C -_0803859A: - strh r4, [r2] - strh r4, [r0] - adds r0, 0x4 - adds r2, 0x4 - subs r1, 0x2 - cmp r1, 0 - bge _0803859A - ldrh r0, [r3, 0x34] - adds r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _080385DC - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - movs r0, 0x20 - strh r0, [r3, 0x30] - b _080385DC - .pool -_080385C8: - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bne _080385DC - ldr r0, =sub_8036760 - bl SetMainCallback2 -_080385DC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038538 - - thumb_func_start LoadTrainerParty -LoadTrainerParty: @ 80385E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - str r0, [sp, 0x10] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - movs r0, 0 - mov r9, r0 - movs r0, 0x80 - lsls r0, 3 - cmp r1, r0 - bne _08038610 - movs r0, 0 - b _080389E2 -_08038610: - ldr r4, =gBattleTypeFlags - ldr r0, [r4] - ldr r1, =0x043f0908 - ands r0, r1 - ldr r1, [sp, 0x14] - lsls r1, 2 - str r1, [sp, 0x20] - cmp r0, 0x8 - beq _08038624 - b _080389D2 -_08038624: - cmp r2, 0x1 - bne _0803862C - bl ZeroEnemyPartyMons -_0803862C: - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _08038668 - ldr r0, =gTrainers - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r1, r2, r3 - lsls r1, 3 - adds r1, r0 - adds r2, r1, 0 - adds r2, 0x20 - ldrb r1, [r2] - movs r4, 0x3 - str r4, [sp, 0x1C] - adds r4, r0, 0 - cmp r1, 0x3 - bhi _0803867C - adds r2, r1, 0 - str r2, [sp, 0x1C] - b _0803867C - .pool -_08038668: - ldr r1, =gTrainers - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r0, r2, r3 - lsls r0, 3 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - str r0, [sp, 0x1C] - adds r4, r1, 0 -_0803867C: - movs r0, 0 - str r0, [sp, 0x18] - b _080389B4 - .pool -_08038688: - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r0, r2, r3 - lsls r0, 3 - adds r1, r0, r4 - ldrb r0, [r1, 0x18] - cmp r0, 0x1 - bne _0803869E - movs r0, 0x80 - mov r10, r0 - b _080386B0 -_0803869E: - ldrb r1, [r1, 0x2] - movs r0, 0x80 - ands r0, r1 - movs r1, 0x88 - mov r10, r1 - cmp r0, 0 - beq _080386B0 - movs r2, 0x78 - mov r10, r2 -_080386B0: - movs r6, 0 - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r0, r2, r3 - lsls r0, 3 - adds r1, r4, 0x4 - adds r0, r1 - ldrb r0, [r0] - ldr r3, [sp, 0x18] - adds r3, 0x1 - str r3, [sp, 0x24] - cmp r0, 0xFF - beq _080386E6 - adds r3, r1, 0 -_080386CC: - ldr r0, [sp, 0x14] - adds r1, r2, r0 - lsls r1, 3 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _080386CC -_080386E6: - ldr r1, [sp, 0x20] - ldr r2, [sp, 0x14] - adds r0, r1, r2 - lsls r1, r0, 3 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08038794 - cmp r0, 0x1 - bgt _08038700 - cmp r0, 0 - beq _0803870E - b _080389AC -_08038700: - cmp r0, 0x2 - bne _08038706 - b _08038854 -_08038706: - cmp r0, 0x3 - bne _0803870C - b _080388E8 -_0803870C: - b _080389AC -_0803870E: - adds r0, r4, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r4, [r0] - movs r6, 0 - ldr r3, [sp, 0x18] - lsls r2, r3, 3 - adds r0, r2, r4 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - ldrb r0, [r0] - adds r5, r2, 0 - cmp r0, 0xFF - beq _08038750 - adds r3, r1, 0 - movs r7, 0xB -_08038734: - adds r0, r2, r4 - ldrh r0, [r0, 0x4] - adds r1, r0, 0 - muls r1, r7 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _08038734 -_08038750: - mov r2, r9 - lsls r0, r2, 8 - add r10, r0 - adds r4, r5, r4 - ldrh r1, [r4] - lsls r0, r1, 5 - subs r0, r1 - movs r1, 0xFF - bl __divsi3 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, [sp, 0x18] - movs r1, 0x64 - adds r0, r3, 0 - muls r0, r1 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldrh r1, [r4, 0x4] - ldrb r2, [r4, 0x2] - movs r3, 0x1 - str r3, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r3, 0x2 - str r3, [sp, 0x8] - movs r3, 0 - str r3, [sp, 0xC] - adds r3, r6, 0 - bl create_pokemon_set_level - b _080389AC - .pool -_08038794: - adds r0, r4, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r7, [r0] - movs r6, 0 - ldr r4, [sp, 0x18] - lsls r2, r4, 4 - adds r0, r2, r7 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - ldrb r0, [r0] - mov r8, r2 - cmp r0, 0xFF - beq _080387D6 - adds r3, r1, 0 - movs r4, 0xB -_080387BA: - adds r0, r2, r7 - ldrh r0, [r0, 0x4] - adds r1, r0, 0 - muls r1, r4 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _080387BA -_080387D6: - mov r2, r9 - lsls r0, r2, 8 - add r10, r0 - mov r3, r8 - adds r4, r3, r7 - ldrh r1, [r4] - lsls r0, r1, 5 - subs r0, r1 - movs r1, 0xFF - bl __divsi3 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [sp, 0x18] - movs r1, 0x64 - adds r5, r0, 0 - muls r5, r1 - ldr r2, [sp, 0x10] - adds r5, r2, r5 - ldrh r1, [r4, 0x4] - ldrb r2, [r4, 0x2] - movs r0, 0x1 - str r0, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r0, 0x2 - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - adds r0, r5, 0 - adds r3, r6, 0 - bl create_pokemon_set_level - movs r6, 0 - mov r0, r8 - adds r0, 0x6 - adds r4, r7, r0 -_08038820: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r5, 0 - adds r2, r4, 0 - bl SetMonData - adds r1, r6, 0 - adds r1, 0x11 - ldrh r0, [r4] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - ldr r0, =gBattleMoves + 0x4 @ PP offset - adds r2, r0 - adds r0, r5, 0 - bl SetMonData - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08038820 - b _080389AC - .pool -_08038854: - adds r0, r4, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r4, [r0] - movs r6, 0 - ldr r0, [sp, 0x18] - lsls r2, r0, 3 - adds r0, r2, r4 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - ldrb r0, [r0] - adds r5, r2, 0 - cmp r0, 0xFF - beq _08038896 - adds r3, r1, 0 - movs r7, 0xB -_0803887A: - adds r0, r2, r4 - ldrh r0, [r0, 0x4] - adds r1, r0, 0 - muls r1, r7 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _0803887A -_08038896: - mov r2, r9 - lsls r0, r2, 8 - add r10, r0 - adds r5, r4 - ldrh r1, [r5] - lsls r0, r1, 5 - subs r0, r1 - movs r1, 0xFF - bl __divsi3 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, [sp, 0x18] - movs r0, 0x64 - adds r4, r3, 0 - muls r4, r0 - ldr r1, [sp, 0x10] - adds r4, r1, r4 - ldrh r1, [r5, 0x4] - ldrb r2, [r5, 0x2] - movs r0, 0x1 - str r0, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r0, 0x2 - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - adds r0, r4, 0 - adds r3, r6, 0 - bl create_pokemon_set_level - adds r5, 0x6 - adds r0, r4, 0 - movs r1, 0xC - adds r2, r5, 0 - bl SetMonData - b _080389AC - .pool -_080388E8: - adds r0, r4, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r7, [r0] - movs r6, 0 - ldr r4, [sp, 0x18] - lsls r2, r4, 4 - adds r0, r2, r7 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - ldrb r0, [r0] - mov r8, r2 - cmp r0, 0xFF - beq _0803892A - adds r3, r1, 0 - movs r4, 0xB -_0803890E: - adds r0, r2, r7 - ldrh r0, [r0, 0x4] - adds r1, r0, 0 - muls r1, r4 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _0803890E -_0803892A: - mov r2, r9 - lsls r0, r2, 8 - add r10, r0 - mov r3, r8 - adds r5, r3, r7 - ldrh r1, [r5] - lsls r0, r1, 5 - subs r0, r1 - movs r1, 0xFF - bl __divsi3 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [sp, 0x18] - movs r1, 0x64 - adds r4, r0, 0 - muls r4, r1 - ldr r2, [sp, 0x10] - adds r4, r2, r4 - ldrh r1, [r5, 0x4] - ldrb r2, [r5, 0x2] - movs r0, 0x1 - str r0, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r0, 0x2 - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - adds r0, r4, 0 - adds r3, r6, 0 - bl create_pokemon_set_level - adds r5, 0x6 - adds r0, r4, 0 - movs r1, 0xC - adds r2, r5, 0 - bl SetMonData - movs r6, 0 - adds r5, r4, 0 - mov r0, r8 - adds r0, 0x8 - adds r4, r7, r0 -_08038982: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r5, 0 - adds r2, r4, 0 - bl SetMonData - adds r1, r6, 0 - adds r1, 0x11 - ldrh r0, [r4] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - ldr r0, =gBattleMoves + 0x4 @ PP offset - adds r2, r0 - adds r0, r5, 0 - bl SetMonData - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08038982 -_080389AC: - ldr r4, [sp, 0x24] - str r4, [sp, 0x18] - ldr r4, =gTrainers - ldr r0, [sp, 0x18] -_080389B4: - ldr r1, [sp, 0x1C] - cmp r0, r1 - bge _080389BC - b _08038688 -_080389BC: - ldr r2, =gBattleTypeFlags - ldr r1, =gTrainers - ldr r3, [sp, 0x20] - ldr r4, [sp, 0x14] - adds r0, r3, r4 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x18] - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] -_080389D2: - ldr r0, =gTrainers - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r1, r2, r3 - lsls r1, 3 - adds r1, r0 - adds r1, 0x20 - ldrb r0, [r1] -_080389E2: - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end LoadTrainerParty - - thumb_func_start sub_8038A04 -sub_8038A04: @ 8038A04 - push {lr} - ldr r0, =0x04000006 - ldrh r0, [r0] - subs r0, 0x6F - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x30 - bhi _08038A1E - movs r1, 0x98 - lsls r1, 8 - movs r0, 0x8 - bl SetGpuReg -_08038A1E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038A04 - - thumb_func_start vblank_cb_08078BB4 -vblank_cb_08078BB4: @ 8038A28 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x013f0102 - ands r0, r1 - cmp r0, 0 - bne _08038A3A - bl Random -_08038A3A: - ldr r0, =gUnknown_02022E14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =gUnknown_02022E16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =gUnknown_02022E18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =gUnknown_02022E1A - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, =gUnknown_02022E1C - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - ldr r0, =gUnknown_02022E1E - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - ldr r0, =gUnknown_02022E20 - ldrh r1, [r0] - movs r0, 0x1C - bl SetGpuReg - ldr r0, =gUnknown_02022E22 - ldrh r1, [r0] - movs r0, 0x1E - bl SetGpuReg - ldr r0, =gUnknown_02022E24 - ldrh r1, [r0] - movs r0, 0x40 - bl SetGpuReg - ldr r0, =gUnknown_02022E26 - ldrh r1, [r0] - movs r0, 0x44 - bl SetGpuReg - ldr r0, =gUnknown_02022E28 - ldrh r1, [r0] - movs r0, 0x42 - bl SetGpuReg - ldr r0, =gUnknown_02022E2A - ldrh r1, [r0] - movs r0, 0x46 - bl SetGpuReg - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end vblank_cb_08078BB4 - - thumb_func_start nullsub_17 -nullsub_17: @ 8038B00 - bx lr - thumb_func_end nullsub_17 - - thumb_func_start sub_8038B04 -sub_8038B04: @ 8038B04 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08038B24 - movs r1, 0x32 - ldrsh r0, [r5, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - lsrs r0, 8 - ldrh r1, [r5, 0x30] - adds r0, r1 - strh r0, [r5, 0x20] - b _08038B36 -_08038B24: - movs r1, 0x32 - ldrsh r0, [r5, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - asrs r0, 8 - ldrh r1, [r5, 0x30] - subs r1, r0 - strh r1, [r5, 0x20] -_08038B36: - movs r1, 0xC0 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r5, 0x32] - adds r0, r1 - strh r0, [r5, 0x32] - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08038B6A - ldr r4, =0x00002710 - adds r0, r4, 0 - bl FreeSpriteTilesByTag - adds r0, r4, 0 - bl FreeSpritePaletteByTag - adds r0, r5, 0 - bl FreeSpriteOamMatrix - adds r0, r5, 0 - bl DestroySprite -_08038B6A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038B04 - - thumb_func_start sub_8038B74 -sub_8038B74: @ 8038B74 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - ldr r0, =sub_8038B04 - str r0, [r4, 0x1C] - movs r0, 0x68 - bl PlaySE - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038B74 - - thumb_func_start sub_8038B94 -sub_8038B94: @ 8038B94 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - ldr r0, =gBattleScripting - adds r0, 0x25 - ldrb r2, [r0] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08038C04 - ldr r1, =gUnknown_020229E8 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x18] - cmp r0, 0x1 - beq _08038BF0 - cmp r0, 0x1 - bgt _08038BE8 - cmp r0, 0 - beq _08038C04 - b _08038C0C - .pool -_08038BE8: - cmp r0, 0x2 - beq _08038C04 - cmp r0, 0x3 - bne _08038C0C -_08038BF0: - ldr r0, =gEnemyParty - str r0, [sp, 0x4] - ldr r1, =gPlayerParty - str r1, [sp, 0x8] - b _08038C0C - .pool -_08038C04: - ldr r2, =gPlayerParty - str r2, [sp, 0x4] - ldr r3, =gEnemyParty - str r3, [sp, 0x8] -_08038C0C: - movs r7, 0 - movs r0, 0 - mov r8, r0 - ldr r1, [sp] - lsls r1, 2 - str r1, [sp, 0xC] - movs r2, 0xCE - lsls r2, 1 - mov r10, r2 - mov r9, r0 -_08038C20: - movs r0, 0x64 - mov r4, r8 - muls r4, r0 - ldr r3, [sp, 0x4] - adds r4, r3, r4 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData - adds r1, r0, 0 - cmp r5, 0 - beq _08038C90 - cmp r5, r10 - beq _08038C64 - cmp r6, 0 - beq _08038C64 - cmp r1, 0 - bne _08038C64 - movs r0, 0x1 - mov r2, r9 - lsls r0, r2 - orrs r7, r0 -_08038C64: - cmp r5, 0 - beq _08038C90 - cmp r6, 0 - beq _08038C7C - cmp r5, r10 - beq _08038C74 - cmp r1, 0 - beq _08038C7C -_08038C74: - movs r0, 0x2 - mov r3, r9 - lsls r0, r3 - orrs r7, r0 -_08038C7C: - cmp r5, 0 - beq _08038C90 - cmp r5, r10 - beq _08038C90 - cmp r6, 0 - bne _08038C90 - movs r0, 0x3 - mov r1, r9 - lsls r0, r1 - orrs r7, r0 -_08038C90: - movs r2, 0x2 - add r9, r2 - movs r3, 0x1 - add r8, r3 - mov r0, r8 - cmp r0, 0x5 - ble _08038C20 - ldr r1, =gTasks - ldr r2, [sp, 0xC] - ldr r3, [sp] - adds r0, r2, r3 - lsls r0, 3 - adds r0, r1 - strh r7, [r0, 0xE] - movs r7, 0 - movs r0, 0 - mov r8, r0 - movs r1, 0xCE - lsls r1, 1 - mov r10, r1 - mov r9, r0 -_08038CBA: - movs r0, 0x64 - mov r4, r8 - muls r4, r0 - ldr r2, [sp, 0x8] - adds r4, r2, r4 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData - adds r1, r0, 0 - cmp r5, 0 - beq _08038D2A - cmp r5, r10 - beq _08038CFE - cmp r6, 0 - beq _08038CFE - cmp r1, 0 - bne _08038CFE - movs r0, 0x1 - mov r3, r9 - lsls r0, r3 - orrs r7, r0 -_08038CFE: - cmp r5, 0 - beq _08038D2A - cmp r6, 0 - beq _08038D16 - cmp r5, r10 - beq _08038D0E - cmp r1, 0 - beq _08038D16 -_08038D0E: - movs r0, 0x2 - mov r1, r9 - lsls r0, r1 - orrs r7, r0 -_08038D16: - cmp r5, 0 - beq _08038D2A - cmp r5, r10 - beq _08038D2A - cmp r6, 0 - bne _08038D2A - movs r0, 0x3 - mov r2, r9 - lsls r0, r2 - orrs r7, r0 -_08038D2A: - movs r3, 0x2 - add r9, r3 - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x5 - ble _08038CBA - ldr r1, =gTasks - ldr r2, [sp, 0xC] - ldr r3, [sp] - adds r0, r2, r3 - lsls r0, 3 - adds r0, r1 - strh r7, [r0, 0x10] - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038B94 - - thumb_func_start sub_8038D64 -sub_8038D64: @ 8038D64 - push {r4,lr} - sub sp, 0x4 - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r2, 0x21 - negs r2, r2 - ands r1, r2 - str r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _08038DAC - ldr r0, =gMain - ldr r0, [r0, 0x8] - bl SetMainCallback2 - bl sub_8057028 - bl dp11_free - bl sub_805F094 - b _08038EB6 - .pool -_08038DAC: - str r0, [sp] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - mov r0, sp - bl CpuSet - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - ldr r4, =0x00005051 - movs r0, 0x44 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - ldr r1, =gUnknown_02022E24 - movs r0, 0xF0 - strh r0, [r1] - ldr r0, =gUnknown_02022E26 - strh r4, [r0] - bl dp12_8087EA4 - ldr r0, =gUnknown_02038C28 - movs r3, 0xF0 - movs r1, 0xF0 - lsls r1, 3 - adds r2, r0, r1 - movs r1, 0x4F -_08038DFE: - strh r3, [r0] - strh r3, [r2] - adds r2, 0x2 - adds r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08038DFE - movs r1, 0x50 - ldr r0, =gUnknown_02038C28 - ldr r3, =0x0000ff10 - movs r4, 0x82 - lsls r4, 4 - adds r2, r0, r4 - adds r0, 0xA0 -_08038E1A: - strh r3, [r0] - strh r3, [r2] - adds r2, 0x2 - adds r0, 0x2 - adds r1, 0x1 - cmp r1, 0x9F - ble _08038E1A - bl ResetPaletteFade - ldr r0, =gUnknown_02022E14 - movs r4, 0 - strh r4, [r0] - ldr r0, =gUnknown_02022E16 - strh r4, [r0] - ldr r0, =gUnknown_02022E18 - strh r4, [r0] - ldr r0, =gUnknown_02022E1A - strh r4, [r0] - ldr r0, =gUnknown_02022E1C - strh r4, [r0] - ldr r0, =gUnknown_02022E1E - strh r4, [r0] - ldr r0, =gUnknown_02022E20 - strh r4, [r0] - ldr r0, =gUnknown_02022E22 - strh r4, [r0] - bl c2_berry_program_update_menu - ldr r0, =gUnknown_08C004E0 - movs r1, 0 - movs r2, 0x40 - bl LoadCompressedPalette - bl sub_803570C - bl ResetSpriteData - bl ResetTasks - bl sub_8036154 - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - bl FreeAllSpritePalettes - ldr r1, =gReservedSpritePaletteCount - movs r0, 0x4 - strb r0, [r1] - ldr r0, =vblank_cb_08078BB4 - bl SetVBlankCallback - ldr r0, =task00_0800F6FC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x87 - lsls r2, 1 - strh r2, [r1, 0xA] - movs r2, 0x5A - strh r2, [r1, 0xC] - movs r2, 0x1 - strh r2, [r1, 0x12] - bl sub_8038B94 - ldr r0, =sub_8038F14 - bl SetMainCallback2 - ldr r0, =gBattleCommunication - strb r4, [r0] -_08038EB6: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038D64 - - thumb_func_start sub_8038F14 -sub_8038F14: @ 8038F14 - push {lr} - bl sub_8038F34 - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_8038F14 - - thumb_func_start sub_8038F34 -sub_8038F34: @ 8038F34 - push {r4-r6,lr} - sub sp, 0x8 - ldr r0, =gBattleCommunication - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x9 - bls _08038F44 - b _080391C6 -_08038F44: - lsls r0, r1, 2 - ldr r1, =_08038F58 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08038F58: - .4byte _08038F80 - .4byte _08038FA0 - .4byte _08038FC2 - .4byte _080390C8 - .4byte _08039100 - .4byte _08039118 - .4byte _0803912C - .4byte _0803914C - .4byte _08039166 - .4byte _08039184 -_08038F80: - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r1, =gBattleCommunication - movs r0, 0xFF - strb r0, [r1, 0x1] - b _08039174 - .pool -_08038FA0: - ldrb r0, [r4, 0x1] - subs r0, 0x1 - strb r0, [r4, 0x1] - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08038FB0 - b _080391C6 -_08038FB0: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _0803910C -_08038FC2: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08038FD0 - b _080391C6 -_08038FD0: - bl sub_8185FAC - ldr r2, =gMain - ldr r1, =0x00000439 - adds r2, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - movs r3, 0x2 - cmp r0, 0 - beq _08038FFC - movs r3, 0x4 -_08038FFC: - movs r4, 0 - ldr r6, =gSaveBlock2Ptr - cmp r4, r3 - bge _08039022 - ldr r1, =gUnknown_020229E8 - ldrb r0, [r1] - cmp r0, 0x3 - bne _08039022 - movs r5, 0xFF - adds r2, r1, 0 -_08039010: - adds r2, 0x1C - adds r4, 0x1 - cmp r4, r3 - bge _08039022 - ldrh r1, [r2] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0x3 - beq _08039010 -_08039022: - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _080390AC - cmp r4, r3 - bne _080390AC - ldr r0, =0x000008d2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08039074 - bl FreeAllWindowBuffers - ldr r0, =sub_80392A8 - bl SetMainCallback2 - b _080391C6 - .pool -_08039074: - ldr r2, =gMain - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _08039090 - ldr r0, [r2, 0x8] - b _080390B0 - .pool -_08039090: - ldr r0, =gUnknown_03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08039172 - ldr r0, =sub_80B3AF8 - movs r1, 0x5 - bl CreateTask - b _08039172 - .pool -_080390AC: - ldr r0, =gMain - ldr r0, [r0, 0x8] -_080390B0: - bl SetMainCallback2 - bl sub_8057028 - bl dp11_free - bl sub_805F094 - b _080391C6 - .pool -_080390C8: - movs r0, 0 - str r0, [sp, 0x4] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x4 - bl CpuSet - movs r4, 0 -_080390DA: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80363C4 - adds r4, 0x1 - cmp r4, 0x1 - ble _080390DA - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - b _08039172 - .pool -_08039100: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080391C6 -_0803910C: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _080391C6 - .pool -_08039118: - ldr r0, =sub_80B3AF8 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080391C6 - b _08039172 - .pool -_0803912C: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080391C6 - bl sub_800ADF8 - ldr r0, =gUnknown_0824978D - movs r1, 0 - bl battle_show_message_maybe - b _08039172 - .pool -_0803914C: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _080391C6 - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080391C6 - b _08039172 -_08039166: - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - bne _08039172 - bl sub_800AC34 -_08039172: - ldr r1, =gBattleCommunication -_08039174: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080391C6 - .pool -_08039184: - ldr r2, =gMain - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - adds r3, r2, 0 - cmp r0, 0 - beq _080391A6 - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - bne _080391A6 - ldr r0, =gUnknown_03003124 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080391C6 -_080391A6: - ldr r0, =0x00000439 - adds r2, r3, r0 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, [r3, 0x8] - bl SetMainCallback2 - bl sub_8057028 - bl dp11_free - bl sub_805F094 -_080391C6: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038F34 - - thumb_func_start sub_80391E0 -sub_80391E0: @ 80391E0 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - cmp r1, 0x6 - bhi _080392A0 - lsls r0, r1, 2 - ldr r1, =_08039200 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08039200: - .4byte _0803921C - .4byte _08039230 - .4byte _08039244 - .4byte _08039258 - .4byte _0803926C - .4byte _08039280 - .4byte _08039294 -_0803921C: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 30 - lsrs r0, 30 - b _080392A0 - .pool -_08039230: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 28 - lsrs r0, 30 - b _080392A0 - .pool -_08039244: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrh r0, [r1] - lsls r0, 23 - lsrs r0, 27 - b _080392A0 - .pool -_08039258: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 29 - lsrs r0, 30 - b _080392A0 - .pool -_0803926C: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 28 - lsrs r0, 31 - b _080392A0 - .pool -_08039280: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 26 - lsrs r0, 30 - b _080392A0 - .pool -_08039294: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] - lsls r0, 8 - lsrs r0, 22 -_080392A0: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80391E0 - - thumb_func_start sub_80392A8 -sub_80392A8: @ 80392A8 - push {r4,lr} - sub sp, 0x8 - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r4, 0 - str r4, [sp, 0x4] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x4 - bl CpuSet - bl ResetPaletteFade - ldr r0, =gUnknown_02022E14 - strh r4, [r0] - ldr r0, =gUnknown_02022E16 - strh r4, [r0] - ldr r0, =gUnknown_02022E18 - strh r4, [r0] - ldr r0, =gUnknown_02022E1A - strh r4, [r0] - ldr r0, =gUnknown_02022E1C - strh r4, [r0] - ldr r0, =gUnknown_02022E1E - strh r4, [r0] - ldr r0, =gUnknown_02022E20 - strh r4, [r0] - ldr r0, =gUnknown_02022E22 - strh r4, [r0] - bl c2_berry_program_update_menu - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - bl sub_803570C -_080392FE: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80363C4 - adds r4, 0x1 - cmp r4, 0x1 - ble _080392FE - bl ResetSpriteData - bl ResetTasks - bl FreeAllSpritePalettes - ldr r1, =gReservedSpritePaletteCount - movs r0, 0x4 - strb r0, [r1] - ldr r0, =vblank_cb_08078BB4 - bl SetVBlankCallback - ldr r0, =sub_803937C - bl SetMainCallback2 - movs r0, 0x1 - negs r0, r0 - movs r4, 0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r0, =gBattleCommunication - strb r4, [r0] - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80392A8 - - thumb_func_start sub_803937C -sub_803937C: @ 803937C - push {lr} - bl sub_803939C - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_803937C - - thumb_func_start sub_803939C -sub_803939C: @ 803939C - push {r4,r5,lr} - sub sp, 0x4 - ldr r0, =gBattleCommunication - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0xC - bls _080393AC - b _0803975E -_080393AC: - lsls r0, r1, 2 - ldr r1, =_080393C0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080393C0: - .4byte _080393F4 - .4byte _08039414 - .4byte _08039450 - .4byte _08039470 - .4byte _0803949C - .4byte _080394D8 - .4byte _0803957C - .4byte _08039704 - .4byte _080395CC - .4byte _08039610 - .4byte _08039678 - .4byte _080396A8 - .4byte _08039704 -_080393F4: - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r1, =gBattleCommunication - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_08039414: - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08039434 - ldr r0, =gUnknown_03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08039434 - ldr r0, =sub_80B3AF8 - movs r1, 0x5 - bl CreateTask -_08039434: - ldr r1, =gBattleCommunication - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_08039450: - ldr r0, =sub_80B3AF8 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - beq _0803945E - b _0803975E -_0803945E: - ldr r1, =gBattleCommunication - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_08039470: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0803947E - b _0803975E -_0803947E: - ldr r0, =gUnknown_085CD28F - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =gBattleCommunication - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_0803949C: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _080394AC - b _0803975E -_080394AC: - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldr r4, =gBattleCommunication - movs r0, 0x1 - strb r0, [r4, 0x1] - bl sub_8056B74 - b _080396EA - .pool -_080394D8: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08039500 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _080394EC - b _0803975E -_080394EC: - movs r0, 0x5 - bl PlaySE - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0 - b _0803951E - .pool -_08039500: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08039526 - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _08039510 - b _0803975E -_08039510: - movs r0, 0x5 - bl PlaySE - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0x1 -_0803951E: - strb r0, [r4, 0x1] - bl sub_8056B74 - b _0803975E -_08039526: - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08039560 - movs r0, 0x5 - bl PlaySE - ldr r4, =gBattleCommunication - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _08039540 - b _080396EA -_08039540: - str r5, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - bl sub_8185338 - strb r0, [r4, 0x1] - movs r0, 0xA - strb r0, [r4] - b _0803975E - .pool -_08039560: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0803956A - b _0803975E -_0803956A: - movs r0, 0x5 - bl PlaySE - ldr r1, =gBattleCommunication - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_0803957C: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0803958A - b _0803975E -_0803958A: - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080395B4 - bl sub_800ADF8 - ldr r0, =gUnknown_0824978D - movs r1, 0 - bl battle_show_message_maybe -_080395B4: - ldr r1, =gBattleCommunication - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_080395CC: - ldrb r0, [r4, 0x1] - subs r0, 0x1 - strb r0, [r4, 0x1] - lsls r0, 24 - cmp r0, 0 - beq _080395DA - b _0803975E -_080395DA: - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080395F6 - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - bne _080395F6 - bl sub_800AC34 -_080395F6: - ldr r1, =gBattleCommunication - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_08039610: - ldr r2, =gMain - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - adds r3, r2, 0 - cmp r0, 0 - beq _08039634 - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - bne _08039634 - ldr r0, =gUnknown_03003124 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08039634 - b _0803975E -_08039634: - ldr r0, =0x00000439 - adds r2, r3, r0 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08039650 - b _0803975E -_08039650: - ldr r0, [r3, 0x8] - bl SetMainCallback2 - bl sub_8057028 - bl dp11_free - bl sub_805F094 - b _0803975E - .pool -_08039678: - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - bne _080396A0 - movs r0, 0x37 - bl PlaySE - ldr r0, =gUnknown_085CD2CB -_08039686: - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C - movs r1, 0 - bl battle_show_message_maybe - movs r0, 0x80 - strb r0, [r4, 0x1] - b _080396EA - .pool -_080396A0: - ldr r0, =gUnknown_08242481 - b _08039686 - .pool -_080396A8: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803975E - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0803975E - ldr r4, =gBattleCommunication - ldrb r0, [r4, 0x1] - subs r0, 0x1 - strb r0, [r4, 0x1] - lsls r0, 24 - cmp r0, 0 - bne _0803975E - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080396EA - bl sub_800ADF8 - ldr r0, =gUnknown_0824978D - movs r1, 0 - bl battle_show_message_maybe -_080396EA: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0803975E - .pool -_08039704: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - bne _0803975E - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08039744 - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803975E - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - b _0803974A - .pool -_08039744: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] -_0803974A: - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gBattleCommunication - movs r0, 0x20 - strb r0, [r1, 0x1] - movs r0, 0x8 -_0803975C: - strb r0, [r1] -_0803975E: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803939C - - thumb_func_start shedinja_something -shedinja_something: @ 803976C - push {r4,r5,lr} - sub sp, 0x10 - adds r4, r0, 0 - add r5, sp, 0xC - movs r0, 0x1 - strb r0, [r5] - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - ldr r1, =0x0000012f - cmp r0, r1 - bne _080397B4 - adds r0, r4, 0 - movs r1, 0x3 - bl GetMonData - ldrb r1, [r5] - cmp r0, r1 - beq _080397B4 - adds r0, r4, 0 - movs r1, 0x2 - mov r2, sp - bl GetMonData - ldr r1, =gUnknown_0831ACA0 - mov r0, sp - bl StringCompareWithoutExtCtrlCodes - cmp r0, 0 - bne _080397B4 - adds r0, r4, 0 - movs r1, 0x3 - adds r2, r5, 0 - bl SetMonData -_080397B4: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end shedinja_something - - thumb_func_start sub_80397C4 -sub_80397C4: @ 80397C4 - ldr r2, =gUnknown_0831ABA0 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - lsls r1, 3 - adds r1, r0 - ldrb r0, [r1, 0x3] - lsls r0, 3 - bx lr - .pool - thumb_func_end sub_80397C4 - - thumb_func_start oac_poke_opponent -oac_poke_opponent: @ 80397DC - push {lr} - sub sp, 0x4 - ldr r1, =sub_803980C - str r1, [r0, 0x1C] - movs r1, 0 - bl StartSpriteAnimIfDifferent - movs r0, 0x80 - lsls r0, 10 - ldr r1, =0x00002108 - str r1, [sp] - movs r1, 0 - movs r2, 0xA - movs r3, 0xA - bl BeginNormalPaletteFade - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end oac_poke_opponent - - thumb_func_start sub_803980C -sub_803980C: @ 803980C - push {lr} - adds r2, r0, 0 - ldr r0, =gUnknown_020243FC - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0803982C - ldrh r0, [r2, 0x24] - adds r0, 0x2 - strh r0, [r2, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _0803982C - ldr r0, =sub_8039838 - str r0, [r2, 0x1C] -_0803982C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803980C - - thumb_func_start sub_8039838 -sub_8039838: @ 8039838 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08039880 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - bl sub_8076918 - ldr r1, =gUnknown_03005D70 - movs r2, 0x2E - ldrsh r0, [r4, r2] - adds r0, r1 - ldrb r0, [r0] - bl sub_80729D0 - ldr r0, =sub_8039894 - str r0, [r4, 0x1C] - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnimIfDifferent - movs r0, 0x80 - lsls r0, 10 - ldr r1, =0x00002108 - str r1, [sp] - movs r1, 0 - movs r2, 0xA - movs r3, 0 - bl BeginNormalPaletteFade -_08039880: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039838 - - thumb_func_start sub_8039894 -sub_8039894: @ 8039894 - push {lr} - adds r2, r0, 0 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080398B0 - ldrh r1, [r2, 0x32] - adds r0, r2, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_806ECEC -_080398B0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039894 - - thumb_func_start nullsub_18 -nullsub_18: @ 80398B8 - bx lr - thumb_func_end nullsub_18 - - thumb_func_start sub_80398BC -sub_80398BC: @ 80398BC - movs r1, 0x6 - strh r1, [r0, 0x34] - movs r1, 0x1 - strh r1, [r0, 0x36] - ldr r1, =sub_80398D0 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_80398BC - - thumb_func_start sub_80398D0 -sub_80398D0: @ 80398D0 - push {r4,lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x36] - subs r0, 0x1 - strh r0, [r3, 0x36] - lsls r0, 16 - cmp r0, 0 - bne _08039924 - movs r0, 0x8 - strh r0, [r3, 0x36] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r4, 0x5 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x34] - subs r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - bne _08039924 - ldrb r1, [r1] - adds r0, r4, 0 - ands r0, r1 - mov r1, r12 - strb r0, [r1] - ldr r0, =nullsub_18 - str r0, [r3, 0x1C] - ldr r0, =gUnknown_02022F88 - str r2, [r0] -_08039924: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80398D0 - - thumb_func_start sub_8039934 -sub_8039934: @ 8039934 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r0 - ldrh r0, [r0, 0x2E] - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r6, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - beq _0803995C - adds r4, r0, 0 - b _08039960 - .pool -_0803995C: - mov r0, r9 - ldrh r4, [r0, 0x32] -_08039960: - ldr r1, =gBattlePartyID - lsls r0, r6, 1 - adds r5, r0, r1 - ldrh r0, [r5] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r7, =gEnemyParty - adds r0, r7 - movs r1, 0 - bl GetMonData - cmp r4, 0xC9 - bne _080399E4 - ldrh r0, [r5] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - movs r1, 0 - bl GetMonData - adds r2, r0, 0 - movs r0, 0xC0 - lsls r0, 18 - ands r0, r2 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r2 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r2 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r2 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _080399D0 - movs r0, 0xC9 - b _080399DA - .pool -_080399D0: - movs r1, 0xCE - lsls r1, 1 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 -_080399DA: - ldr r1, =gUnknown_08300D38 - lsls r0, 2 - b _08039A1C - .pool -_080399E4: - ldr r0, =0x00000181 - cmp r4, r0 - bne _08039A08 - ldr r0, =gUnknown_08525F78 - ldr r1, =gUnknown_020244E4 - adds r1, r6, r1 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - b _08039A20 - .pool -_08039A08: - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - bls _08039A18 - ldr r0, =gUnknown_08300D38 - b _08039A1E - .pool -_08039A18: - ldr r1, =gUnknown_08300D38 - lsls r0, r4, 2 -_08039A1C: - adds r0, r1 -_08039A1E: - ldrb r0, [r0, 0x1] -_08039A20: - lsrs r1, r0, 3 - movs r0, 0x8 - subs r0, r1 - mov r1, r9 - strh r0, [r1, 0x34] - movs r0, 0x1 - strh r0, [r1, 0x36] - ldr r0, =sub_8039A48 - str r0, [r1, 0x1C] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039934 - - thumb_func_start sub_8039A48 -sub_8039A48: @ 8039A48 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x36] - subs r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - cmp r0, 0 - bne _08039AC8 - movs r0, 0x2 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x26] - adds r0, 0x8 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x34] - subs r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - cmp r0, 0 - bge _08039A7C - adds r0, r4, 0 - bl FreeSpriteOamMatrix - adds r0, r4, 0 - bl DestroySprite - b _08039AC8 -_08039A7C: - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - bl GetBankIdentity - ldr r1, =gUnknown_020244D4 - ldr r1, [r1] - lsls r0, 24 - lsrs r0, 22 - adds r1, 0x4 - adds r1, r0 - ldr r2, =gUnknown_020244E4 - movs r3, 0x2E - ldrsh r0, [r4, r3] - adds r0, r2 - ldrb r0, [r0] - lsls r0, 11 - ldr r1, [r1] - adds r1, r0 - movs r2, 0x34 - ldrsh r0, [r4, r2] - lsls r0, 8 - adds r1, r0 - movs r2, 0 - movs r0, 0xFF -_08039AAE: - strb r2, [r1] - adds r1, 0x1 - subs r0, 0x1 - cmp r0, 0 - bge _08039AAE - ldr r0, =gUnknown_020244E4 - movs r3, 0x2E - ldrsh r1, [r4, r3] - adds r1, r0 - ldrb r1, [r1] - adds r0, r4, 0 - bl StartSpriteAnim -_08039AC8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039A48 - - thumb_func_start sub_8039AD8 -sub_8039AD8: @ 8039AD8 - movs r1, 0x8 - strh r1, [r0, 0x34] - adds r1, r0, 0 - adds r1, 0x3E - ldrb r1, [r1] - lsls r1, 29 - lsrs r1, 31 - strh r1, [r0, 0x36] - ldr r1, =sub_8039AF4 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8039AD8 - - thumb_func_start sub_8039AF4 -sub_8039AF4: @ 8039AF4 - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x34] - subs r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - cmp r0, 0 - bne _08039B26 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - movs r0, 0x8 - strh r0, [r3, 0x34] -_08039B26: - pop {r0} - bx r0 - thumb_func_end sub_8039AF4 - - thumb_func_start sub_8039B2C -sub_8039B2C: @ 8039B2C - movs r1, 0x3E - adds r1, r0 - mov r12, r1 - movs r1, 0x1 - ldrh r2, [r0, 0x36] - ands r2, r1 - lsls r2, 2 - mov r1, r12 - ldrb r3, [r1] - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - movs r1, 0 - strh r1, [r0, 0x36] - ldr r1, =nullsub_18 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8039B2C - - thumb_func_start sub_8039B58 -sub_8039B58: @ 8039B58 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08039BA0 - ldr r0, =gHitMarker - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08039B80 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _08039B94 -_08039B80: - ldrh r0, [r4, 0x32] - bl sub_806F0D4 - lsls r0, 24 - cmp r0, 0 - beq _08039B94 - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAnim -_08039B94: - ldrh r1, [r4, 0x32] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x1 - bl sub_806ECEC -_08039BA0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039B58 - - thumb_func_start sub_8039BB4 -sub_8039BB4: @ 8039BB4 - ldr r1, =oac_poke_ally_ - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8039BB4 - - thumb_func_start oac_poke_ally_ -oac_poke_ally_: @ 8039BC0 - push {lr} - adds r2, r0, 0 - ldr r0, =gUnknown_020243FC - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08039BE4 - ldrh r0, [r2, 0x24] - subs r0, 0x2 - strh r0, [r2, 0x24] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _08039BE4 - ldr r0, =nullsub_19 - str r0, [r2, 0x1C] - strh r1, [r2, 0x30] -_08039BE4: - pop {r0} - bx r0 - .pool - thumb_func_end oac_poke_ally_ - - thumb_func_start sub_8039BF0 -sub_8039BF0: @ 8039BF0 - ldr r1, =nullsub_19 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8039BF0 - - thumb_func_start nullsub_19 -nullsub_19: @ 8039BFC - bx lr - thumb_func_end nullsub_19 - - thumb_func_start sub_8039C00 -sub_8039C00: @ 8039C00 - push {lr} - adds r2, r0, 0 - ldr r0, =gUnknown_020243FC - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08039C20 - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x32] - ldrh r1, [r2, 0x26] - adds r0, r1 - strh r0, [r2, 0x26] -_08039C20: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039C00 - - thumb_func_start dp11b_obj_instanciate -dp11b_obj_instanciate: @ 8039C28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - cmp r1, 0 - beq _08039C64 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r2, r4, 1 - adds r0, r2, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - b _08039C76 - .pool -_08039C64: - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r2, r4, 1 - adds r0, r2, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 -_08039C76: - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - bne _08039D2C - ldr r0, =objc_dp11b_pingpong - bl CreateInvisibleSpriteWithCallback - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, r8 - cmp r0, 0x1 - bne _08039CD0 - ldr r0, =gUnknown_03005D70 - adds r0, r4, r0 - ldrb r7, [r0] - ldr r2, =gUnknown_020244D0 - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r1, r6, r4 - lsls r1, 2 - adds r0, r1, r0 - strb r5, [r0, 0x2] - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1] - ldr r2, =gSprites - lsls r3, r5, 4 - adds r0, r3, r5 - lsls r0, 2 - adds r0, r2 - movs r1, 0x80 - b _08039CFE - .pool -_08039CD0: - ldr r0, =gBankSpriteIds - adds r0, r4, r0 - ldrb r7, [r0] - ldr r2, =gUnknown_020244D0 - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r1, r6, r4 - lsls r1, 2 - adds r0, r1, r0 - strb r5, [r0, 0x3] - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r2, =gSprites - lsls r3, r5, 4 - adds r0, r3, r5 - lsls r0, 2 - adds r0, r2 - movs r1, 0xC0 -_08039CFE: - strh r1, [r0, 0x2E] - adds r4, r2, 0 - adds r1, r3, r5 - lsls r1, 2 - adds r1, r4 - mov r2, r9 - lsls r0, r2, 24 - asrs r0, 24 - movs r2, 0 - strh r0, [r1, 0x30] - mov r3, r10 - lsls r0, r3, 24 - asrs r0, 24 - strh r0, [r1, 0x32] - strh r7, [r1, 0x34] - mov r0, r8 - strh r0, [r1, 0x36] - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r4 - strh r2, [r0, 0x24] - strh r2, [r0, 0x26] -_08039D2C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp11b_obj_instanciate - - thumb_func_start dp11b_obj_free -dp11b_obj_free: @ 8039D48 - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - bne _08039D9C - ldr r6, =gUnknown_020244D0 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r5, r0, 2 - adds r3, r5, r1 - ldrb r1, [r3] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08039DEA - ldr r2, =gSprites - ldrb r1, [r3, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x34] - lsls r1, 24 - lsrs r4, r1, 24 - bl DestroySprite - ldr r0, [r6] - ldr r1, [r0, 0x4] - adds r1, r5, r1 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - b _08039DD6 - .pool -_08039D9C: - ldr r6, =gUnknown_020244D0 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r5, r0, 2 - adds r3, r5, r1 - ldrb r1, [r3] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08039DEA - ldr r2, =gSprites - ldrb r1, [r3, 0x3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x34] - lsls r1, 24 - lsrs r4, r1, 24 - bl DestroySprite - ldr r0, [r6] - ldr r1, [r0, 0x4] - adds r1, r5, r1 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 -_08039DD6: - ands r0, r2 - strb r0, [r1] - ldr r0, =gSprites - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0x24] - strh r0, [r1, 0x26] -_08039DEA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp11b_obj_free - - thumb_func_start objc_dp11b_pingpong -objc_dp11b_pingpong: @ 8039DF8 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08039E10 - movs r2, 0x2E - ldrsh r0, [r4, r2] - b _08039E14 -_08039E10: - movs r1, 0x2E - ldrsh r0, [r4, r1] -_08039E14: - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl Sin - ldr r2, =gSprites - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 2 - adds r1, r2 - ldrh r2, [r4, 0x32] - adds r0, r2 - strh r0, [r1, 0x26] - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x2E] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end objc_dp11b_pingpong - - thumb_func_start sub_8039E44 -sub_8039E44: @ 8039E44 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08039E5C - ldrh r1, [r2, 0x32] - adds r0, r2, 0 - bl sub_806EEB4 -_08039E5C: - pop {r0} - bx r0 - thumb_func_end sub_8039E44 - - thumb_func_start sub_8039E60 -sub_8039E60: @ 8039E60 - push {r4,lr} - adds r4, r0, 0 - bl sub_8039E9C - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08039E7A - ldr r0, =nullsub_19 - str r0, [r4, 0x1C] -_08039E7A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039E60 - - thumb_func_start sub_8039E84 -sub_8039E84: @ 8039E84 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl StartSpriteAnim - ldr r0, =sub_8039E60 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039E84 - - thumb_func_start sub_8039E9C -sub_8039E9C: @ 8039E9C - push {lr} - adds r2, r0, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - bne _08039EBE - ldr r1, =gUnknown_0831ACE0 - adds r0, r2, 0 - adds r0, 0x2B - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - adds r0, 0x28 - strb r1, [r0] -_08039EBE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039E9C - - thumb_func_start nullsub_20 -nullsub_20: @ 8039EC8 - bx lr - thumb_func_end nullsub_20 - - thumb_func_start sub_8039ECC -sub_8039ECC: @ 8039ECC - push {lr} - bl sub_8039F40 - ldr r1, =gBattleCommunication - movs r0, 0 - strb r0, [r1, 0x1] - ldr r1, =gBattleMainFunc - ldr r0, =bc_8012FAC - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039ECC - - thumb_func_start sub_8039EF0 -sub_8039EF0: @ 8039EF0 - push {r4,r5,lr} - ldr r0, =gBattleMainFunc - ldr r0, [r0] - bl _call_via_r0 - ldr r1, =gActiveBank - movs r0, 0 - strb r0, [r1] - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r0, 0 - beq _08039F2A - ldr r5, =gBattleBankFunc - adds r4, r1, 0 -_08039F0C: - ldrb r0, [r4] - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - bl _call_via_r0 - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =gNoOfAllBanks - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _08039F0C -_08039F2A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039EF0 - - thumb_func_start sub_8039F40 -sub_8039F40: @ 8039F40 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - bl sub_803D580 - bl sub_803D6A0 - movs r2, 0 - movs r3, 0 - ldr r0, =gUnknown_02024260 - mov r10, r0 - ldr r1, =gUnknown_02024258 - mov r9, r1 - ldr r0, =gUnknown_02024250 - mov r8, r0 - ldr r1, =gUnknown_02024248 - mov r12, r1 - ldr r5, =gDisableStructs - movs r4, 0 - ldr r7, =gUnknown_02024240 - ldr r6, =gUnknown_02024268 -_08039F70: - ldr r0, =gStatuses3 - adds r0, r4, r0 - str r3, [r0] - movs r1, 0 -_08039F78: - adds r0, r5, r1 - strb r3, [r0] - adds r1, 0x1 - cmp r1, 0x1B - bls _08039F78 - movs r0, 0x2 - strb r0, [r5, 0x16] - ldr r1, =gUnknown_02024284 - adds r0, r2, r1 - strb r3, [r0] - mov r0, r12 - strh r3, [r0] - mov r1, r8 - strh r3, [r1] - mov r0, r9 - strh r3, [r0] - mov r1, r10 - strh r3, [r1] - ldr r0, =gUnknown_02024270 - adds r1, r2, r0 - movs r0, 0xFF - strb r0, [r1] - strh r3, [r6] - strh r3, [r7] - ldr r1, =gBattleResources - ldr r0, [r1] - ldr r0, [r0, 0x4] - adds r0, r4 - str r3, [r0] - ldr r1, =gUnknown_02024230 - adds r0, r4, r1 - str r3, [r0] - movs r0, 0x2 - add r10, r0 - add r9, r0 - add r8, r0 - add r12, r0 - adds r5, 0x1C - adds r4, 0x4 - adds r7, 0x2 - adds r6, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - ble _08039F70 - movs r5, 0 - ldr r3, =gSideTimers - ldr r4, =gUnknown_0202428E - movs r2, 0x1 -_08039FD8: - strh r5, [r4] - movs r1, 0 -_08039FDC: - adds r0, r3, r1 - strb r5, [r0] - adds r1, 0x1 - cmp r1, 0xB - bls _08039FDC - adds r3, 0xC - adds r4, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08039FD8 - movs r1, 0 - ldr r2, =gBankAttacker - strb r1, [r2] - ldr r0, =gBankTarget - strb r1, [r0] - ldr r2, =gBattleWeather - strh r1, [r2] - ldr r1, =gUnknown_020243D0 - movs r2, 0 - movs r3, 0 -_0803A004: - adds r0, r1, r2 - strb r3, [r0] - adds r2, 0x1 - cmp r2, 0x2B - bls _0803A004 - ldr r2, =gHitMarker - movs r0, 0 - str r0, [r2] - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _0803A090 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - bne _0803A0AE - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r1, [r0, 0x15] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0803A0AE - movs r0, 0x80 - b _0803A0AC - .pool -_0803A090: - ldr r0, =0x02000002 - ands r1, r0 - cmp r1, 0 - bne _0803A0AE - bl sub_8185FB8 - lsls r0, 24 - cmp r0, 0 - beq _0803A0AE - ldr r1, =gHitMarker - ldr r0, [r1] - movs r1, 0x80 - orrs r0, r1 - ldr r2, =gHitMarker -_0803A0AC: - str r0, [r2] -_0803A0AE: - ldr r3, =gBattleScripting - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x15] - lsls r0, 30 - lsrs r0, 31 - movs r1, 0 - strb r0, [r3, 0x1D] - ldr r0, =gUnknown_02024212 - strb r1, [r0] - ldr r0, =gBattleOutcome - strb r1, [r0] - ldr r0, =gBattleExecBuffer - str r1, [r0] - ldr r0, =gUnknown_0202432E - movs r2, 0 - strh r1, [r0] - ldr r1, =gBattleResources - ldr r0, [r1] - ldr r0, [r0, 0x8] - adds r0, 0x20 - strb r2, [r0] - ldr r0, [r1] - ldr r0, [r0, 0xC] - adds r0, 0x20 - strb r2, [r0] - ldr r5, =gUnknown_0202432C - ldr r6, =gBattleMoveDamage - ldr r7, =gUnknown_020243FC - ldr r0, =gUnknown_03005D54 - mov r8, r0 - ldr r1, =gAbsentBankFlags - mov r9, r1 - ldr r2, =gEnemyParty - mov r10, r2 - ldr r1, =gBattleCommunication - movs r2, 0 - adds r0, r1, 0x7 -_0803A0FA: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0803A0FA - movs r4, 0 - strh r4, [r5] - movs r0, 0 - str r0, [r6] - strh r0, [r7] - strb r4, [r3, 0x18] - strb r4, [r3, 0x19] - mov r0, r8 - strb r4, [r0] - mov r1, r9 - strb r4, [r1] - ldr r5, =gBattleStruct - ldr r0, [r5] - adds r0, 0x6C - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x79 - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x7A - strb r4, [r0] - mov r0, r10 - movs r1, 0xB - bl GetMonData - ldr r6, [r5] - adds r6, 0x7C - ldr r2, =gBaseStats - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x8] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x000004fb - bl __divsi3 - strb r0, [r6] - ldr r0, [r5] - adds r0, 0x7B - movs r1, 0x3 - strb r1, [r0] - ldr r0, [r5] - strb r4, [r0, 0x12] - ldr r0, [r5] - adds r0, 0x4A - movs r1, 0x1 - strb r1, [r0] - movs r2, 0 - movs r1, 0 - adds r6, r5, 0 -_0803A16A: - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0x98 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xB8 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xC8 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xD0 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xE0 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xE8 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xF0 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xF8 - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x7 - ble _0803A16A - movs r2, 0 - ldr r4, =gBattleStruct - movs r3, 0xA5 - lsls r3, 2 - movs r1, 0x6 -_0803A1BA: - ldr r0, [r4] - adds r0, r2, r0 - adds r0, r3 - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _0803A1BA - ldr r0, [r6] - adds r0, 0xDF - movs r1, 0 - strb r1, [r0] - ldr r0, [r6] - adds r0, 0x92 - strb r1, [r0] - bl Random - ldr r1, =gUnknown_02024330 - strh r0, [r1] - ldr r1, =gUnknown_03005D10 - movs r2, 0 - movs r3, 0 -_0803A1E4: - adds r0, r1, r2 - strb r3, [r0] - adds r2, 0x1 - cmp r2, 0x43 - bls _0803A1E4 - ldr r0, =gEnemyParty - bl sub_806EBA4 - ldr r3, =gUnknown_03005D10 - movs r1, 0x1 - ands r1, r0 - lsls r1, 6 - ldrb r2, [r3, 0x5] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x5] - ldr r2, =gBattleStruct - ldr r0, [r2] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x000002a1 - adds r0, r2 - strb r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039F40 - - thumb_func_start sub_803A284 -sub_803A284: @ 803A284 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, =gDisableStructs - ldr r5, =gActiveBank - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r1, sp - adds r0, r4 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldr r0, [r0] - str r0, [r1] - ldr r2, =gBattleMoves - ldr r3, =gCurrentMove - ldrh r1, [r3] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - mov r12, r4 - mov r9, r5 - ldr r6, =gStatuses3 - mov r10, r6 - cmp r0, 0x7F - beq _0803A35C - movs r5, 0 - mov r6, r9 - movs r4, 0x58 - ldr r2, =gBattleMons - adds r2, 0x18 - movs r1, 0x6 -_0803A2D4: - ldrb r0, [r6] - muls r0, r4 - adds r0, r5, r0 - adds r0, r2 - strb r1, [r0] - adds r5, 0x1 - cmp r5, 0x7 - ble _0803A2D4 - movs r5, 0 - ldr r7, =gNoOfAllBanks - ldrb r7, [r7] - cmp r5, r7 - bge _0803A348 - ldr r0, =gUnknown_020240D4 - mov r8, r0 - ldr r4, =gDisableStructs - ldr r3, =gStatuses3 -_0803A2F6: - movs r0, 0x58 - muls r0, r5 - mov r1, r8 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 19 - ands r0, r1 - cmp r0, 0 - beq _0803A31A - ldrb r0, [r4, 0x14] - ldr r6, =gActiveBank - ldrb r6, [r6] - cmp r0, r6 - bne _0803A31A - ldr r0, =0xfbffffff - ands r1, r0 - str r1, [r2] -_0803A31A: - ldr r1, [r3] - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _0803A33A - ldrb r0, [r4, 0x15] - ldr r7, =gActiveBank - ldrb r7, [r7] - cmp r0, r7 - bne _0803A33A - movs r0, 0x19 - negs r0, r0 - ands r1, r0 - str r1, [r3] - movs r0, 0 - strb r0, [r4, 0x15] -_0803A33A: - adds r4, 0x1C - adds r3, 0x4 - adds r5, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r5, r0 - blt _0803A2F6 -_0803A348: - ldr r1, =gCurrentMove - ldrh r0, [r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - ldr r2, =gBattleMoves - adds r1, r2 - ldrb r0, [r1] - cmp r0, 0x7F - bne _0803A414 -_0803A35C: - mov r3, r9 - ldrb r1, [r3] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - ldr r0, =gBattleMons - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0x15100007 - ands r0, r1 - str r0, [r2] - ldrb r1, [r3] - lsls r1, 2 - add r1, r10 - ldr r0, [r1] - ldr r2, =0x0003043f - ands r0, r2 - str r0, [r1] - movs r5, 0 - ldr r6, =gNoOfAllBanks - ldrb r6, [r6] - cmp r5, r6 - bge _0803A430 - mov r7, r9 - movs r6, 0 -_0803A390: - ldrb r0, [r7] - bl GetBankSide - adds r4, r0, 0 - lsls r0, r5, 24 - lsrs r0, 24 - bl GetBankSide - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803A3D0 - ldr r1, =gStatuses3 - lsls r0, r5, 2 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _0803A3D0 - ldr r0, =gDisableStructs - adds r0, r6, r0 - ldrb r0, [r0, 0x15] - ldrb r3, [r7] - cmp r0, r3 - bne _0803A3D0 - movs r0, 0x19 - negs r0, r0 - ands r1, r0 - movs r0, 0x10 - orrs r1, r0 - str r1, [r2] -_0803A3D0: - adds r6, 0x1C - adds r5, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r5, r0 - blt _0803A390 - ldr r6, =gDisableStructs - mov r12, r6 - ldr r7, =gActiveBank - mov r9, r7 - b _0803A430 - .pool -_0803A414: - mov r0, r9 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - ldr r1, =gBattleMons - adds r1, 0x50 - adds r0, r1 - movs r1, 0 - str r1, [r0] - mov r2, r9 - ldrb r0, [r2] - lsls r0, 2 - add r0, r10 - str r1, [r0] -_0803A430: - movs r5, 0 - ldr r3, =gBattleStruct - mov r8, r3 - ldr r6, =gUnknown_020244AC - mov r10, r6 - ldr r7, =gNoOfAllBanks - ldrb r7, [r7] - cmp r5, r7 - bge _0803A490 - ldr r3, =gUnknown_020240D4 - ldr r7, =gBitTable - ldr r6, =gActiveBank -_0803A448: - movs r0, 0x58 - muls r0, r5 - adds r4, r0, r3 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r7 - ldr r0, [r0] - lsls r2, r0, 16 - ldr r1, [r4] - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _0803A466 - bics r1, r2 - str r1, [r4] -_0803A466: - ldr r1, [r4] - movs r0, 0xE0 - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - beq _0803A486 - mov r2, r8 - ldr r0, [r2] - adds r0, r5, r0 - ldrb r0, [r0, 0x14] - ldrb r2, [r6] - cmp r0, r2 - bne _0803A486 - ldr r0, =0xffff1fff - ands r1, r0 - str r1, [r4] -_0803A486: - adds r5, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r5, r0 - blt _0803A448 -_0803A490: - mov r1, r9 - ldrb r0, [r1] - add r0, r10 - movs r1, 0 - strb r1, [r0] - mov r2, r9 - ldrb r0, [r2] - ldr r3, =gUnknown_020244B0 - adds r0, r3 - strb r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r6, r12 - adds r1, r0, r6 - movs r5, 0 - movs r2, 0 -_0803A4B4: - adds r0, r1, r5 - strb r2, [r0] - adds r5, 0x1 - cmp r5, 0x1B - bls _0803A4B4 - ldr r7, =gCurrentMove - ldrh r0, [r7] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - ldr r0, =gBattleMoves - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x7F - bne _0803A540 - mov r2, r9 - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - mov r1, sp - ldrb r1, [r1, 0xA] - strb r1, [r0, 0xA] - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - mov r1, sp - ldrb r1, [r1, 0x15] - strb r1, [r0, 0x15] - ldrb r0, [r2] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r12 - mov r0, sp - ldrb r2, [r0, 0xF] - lsls r2, 28 - movs r4, 0xF - lsrs r2, 28 - ldrb r3, [r1, 0xF] - movs r0, 0x10 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0xF] - mov r3, r9 - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - mov r1, sp - ldrb r1, [r1, 0xF] - lsrs r1, 4 - lsls r1, 4 - ldrb r2, [r0, 0xF] - ands r4, r2 - orrs r4, r1 - strb r4, [r0, 0xF] - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - mov r1, sp - ldrb r1, [r1, 0x14] - strb r1, [r0, 0x14] -_0803A540: - movs r0, 0 - ldr r6, =gBattleMoveFlags - strb r0, [r6] - mov r7, r9 - ldrb r1, [r7] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - movs r4, 0 - movs r1, 0x2 - strb r1, [r0, 0x16] - ldrb r0, [r7] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r12 - mov r0, sp - ldrb r0, [r0, 0x18] - movs r2, 0x2 - ands r2, r0 - ldrb r3, [r1, 0x18] - movs r0, 0x3 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x18] - ldrb r0, [r7] - lsls r0, 1 - ldr r1, =gUnknown_02024248 - adds r0, r1 - movs r2, 0 - strh r4, [r0] - ldrb r0, [r7] - lsls r0, 1 - ldr r3, =gUnknown_02024250 - adds r0, r3 - strh r4, [r0] - ldrb r0, [r7] - lsls r0, 1 - ldr r6, =gUnknown_02024258 - adds r0, r6 - strh r4, [r0] - ldrb r0, [r7] - lsls r0, 1 - ldr r7, =gUnknown_02024260 - adds r0, r7 - strh r4, [r0] - mov r1, r9 - ldrb r0, [r1] - lsls r0, 1 - ldr r3, =gUnknown_02024240 - adds r0, r3 - strh r4, [r0] - ldrb r0, [r1] - ldr r6, =gUnknown_02024270 - adds r0, r6 - movs r1, 0xFF - strb r1, [r0] - mov r7, r9 - ldrb r0, [r7] - mov r3, r8 - ldr r1, [r3] - lsls r0, 1 - adds r0, r1 - adds r0, 0x98 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 1 - adds r0, r1 - adds r0, 0x99 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE0 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE1 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE2 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE3 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE4 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE5 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE6 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE7 - strb r2, [r0] - ldr r1, [r3] - adds r1, 0x92 - ldrb r0, [r7] - lsls r0, 2 - ldr r6, =gBitTable - adds r0, r6 - ldr r2, [r0] - ldrb r0, [r1] - bics r0, r2 - strb r0, [r1] - movs r5, 0 - ldr r7, =gNoOfAllBanks - ldrb r7, [r7] - cmp r5, r7 - bge _0803A6B4 - mov r3, r9 - mov r7, r8 - movs r6, 0 -_0803A656: - ldrb r0, [r3] - cmp r5, r0 - beq _0803A68C - lsls r0, r5, 24 - lsrs r0, 24 - str r3, [sp, 0x1C] - bl GetBankSide - adds r4, r0, 0 - ldr r3, [sp, 0x1C] - ldrb r0, [r3] - bl GetBankSide - lsls r4, 24 - lsls r0, 24 - ldr r3, [sp, 0x1C] - cmp r4, r0 - beq _0803A68C - ldr r0, [r7] - lsls r1, r5, 1 - adds r0, r1, r0 - adds r0, 0x98 - strb r6, [r0] - ldr r0, [r7] - adds r1, r0 - adds r1, 0x99 - strb r6, [r1] -_0803A68C: - ldrb r0, [r3] - ldr r1, [r7] - lsls r0, 1 - lsls r2, r5, 3 - adds r0, r2 - adds r0, r1 - adds r0, 0xE0 - strb r6, [r0] - ldrb r0, [r3] - ldr r1, [r7] - lsls r0, 1 - adds r0, r2 - adds r0, r1 - adds r0, 0xE1 - strb r6, [r0] - adds r5, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r5, r0 - blt _0803A656 -_0803A6B4: - mov r1, r9 - ldrb r0, [r1] - mov r2, r8 - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - movs r2, 0 - strb r2, [r0] - mov r3, r9 - ldrb r0, [r3] - mov r6, r8 - ldr r1, [r6] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - strb r2, [r0] - ldr r0, =gBattleResources - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldrb r0, [r3] - lsls r0, 2 - adds r1, r0 - movs r2, 0 - str r2, [r1] - ldr r0, =gCurrentMove - strh r2, [r0] - ldr r0, [r6] - adds r0, 0xDA - movs r1, 0xFF - strb r1, [r0] - ldrb r0, [r3] - bl sub_81310F0 - mov r7, r9 - ldrb r0, [r7] - bl sub_8131130 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803A284 - - thumb_func_start sub_803A75C -sub_803A75C: @ 803A75C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r5, 0 - ldr r6, =gBattleMons - ldr r0, =gStatuses3 - mov r8, r0 - ldr r1, =gBattleStruct - mov r12, r1 - ldr r2, =gUnknown_020244AC - mov r9, r2 - ldr r3, =gUnknown_020244B0 - mov r10, r3 - ldr r7, =gProtectStructs - ldr r4, =gActiveBank - movs r3, 0x58 - adds r2, r6, 0 - adds r2, 0x18 - movs r1, 0x6 -_0803A788: - ldrb r0, [r4] - muls r0, r3 - adds r0, r5, r0 - adds r0, r2 - strb r1, [r0] - adds r5, 0x1 - cmp r5, 0x7 - ble _0803A788 - ldr r0, =gActiveBank - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r2, r6, 0 - adds r2, 0x50 - adds r0, r2 - movs r1, 0 - str r1, [r0] - ldr r3, =gActiveBank - ldrb r0, [r3] - lsls r0, 2 - add r0, r8 - str r1, [r0] - movs r5, 0 - ldr r6, =gNoOfAllBanks - ldrb r6, [r6] - cmp r5, r6 - bge _0803A830 - adds r3, r2, 0 - movs r4, 0 - ldr r0, =gBitTable - mov r8, r0 -_0803A7C6: - ldr r1, [r3] - movs r0, 0x80 - lsls r0, 19 - ands r0, r1 - cmp r0, 0 - beq _0803A7E6 - ldr r2, =gDisableStructs - adds r0, r4, r2 - ldrb r0, [r0, 0x14] - ldr r6, =gActiveBank - ldrb r6, [r6] - cmp r0, r6 - bne _0803A7E6 - ldr r0, =0xfbffffff - ands r1, r0 - str r1, [r3] -_0803A7E6: - ldr r1, =gActiveBank - ldrb r0, [r1] - lsls r0, 2 - add r0, r8 - ldr r0, [r0] - lsls r2, r0, 16 - ldr r1, [r3] - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _0803A800 - bics r1, r2 - str r1, [r3] -_0803A800: - ldr r1, [r3] - movs r0, 0xE0 - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - beq _0803A822 - mov r2, r12 - ldr r0, [r2] - adds r0, r5, r0 - ldrb r0, [r0, 0x14] - ldr r6, =gActiveBank - ldrb r6, [r6] - cmp r0, r6 - bne _0803A822 - ldr r0, =0xffff1fff - ands r1, r0 - str r1, [r3] -_0803A822: - adds r3, 0x58 - adds r4, 0x1C - adds r5, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r5, r0 - blt _0803A7C6 -_0803A830: - ldr r1, =gActiveBank - ldrb r0, [r1] - add r0, r9 - movs r1, 0 - strb r1, [r0] - ldr r2, =gActiveBank - ldrb r0, [r2] - add r0, r10 - strb r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r3, =gDisableStructs - adds r1, r0, r3 - movs r5, 0 - movs r2, 0 -_0803A852: - adds r0, r1, r5 - strb r2, [r0] - adds r5, 0x1 - cmp r5, 0x1B - bls _0803A852 - ldr r6, =gActiveBank - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - mov r9, r0 - ands r0, r2 - strb r0, [r1] - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r3, 0x3 - negs r3, r3 - mov r8, r3 - mov r0, r8 - ands r0, r2 - strb r0, [r1] - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r6, 0x5 - negs r6, r6 - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - ldr r0, =gActiveBank - ldrb r1, [r0] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - subs r3, 0x6 - mov r10, r3 - mov r0, r10 - ands r0, r2 - strb r0, [r1] - ldr r0, =gActiveBank - ldrb r1, [r0] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r2, =gActiveBank - ldrb r1, [r2] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r5, 0x21 - negs r5, r5 - adds r0, r5, 0 - ands r0, r2 - strb r0, [r1] - ldr r3, =gActiveBank - ldrb r1, [r3] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r4, 0x41 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1] - ldrb r1, [r3] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r3, 0x7F - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - ldr r0, =gActiveBank - ldrb r1, [r0] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1, 0x1] - mov r0, r9 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r2, =gActiveBank - ldrb r1, [r2] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1, 0x1] - mov r0, r8 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r0, =gActiveBank - ldrb r1, [r0] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1, 0x1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r2, =gActiveBank - ldrb r1, [r2] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1, 0x1] - movs r0, 0x19 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r1, =gActiveBank - ldrb r0, [r1] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x1] - ands r5, r1 - strb r5, [r0, 0x1] - ldr r2, =gActiveBank - ldrb r0, [r2] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x1] - ands r4, r1 - strb r4, [r0, 0x1] - ldrb r0, [r2] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x1] - ands r3, r1 - strb r3, [r0, 0x1] - ldrb r0, [r2] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x2] - mov r3, r9 - ands r3, r1 - strb r3, [r0, 0x2] - ldrb r0, [r2] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x2] - mov r2, r8 - ands r2, r1 - strb r2, [r0, 0x2] - ldr r3, =gActiveBank - ldrb r0, [r3] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x2] - ands r6, r1 - strb r6, [r0, 0x2] - ldrb r0, [r3] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x2] - mov r6, r10 - ands r6, r1 - strb r6, [r0, 0x2] - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =gDisableStructs - adds r0, r1 - movs r2, 0 - movs r1, 0x2 - strb r1, [r0, 0x16] - ldrb r0, [r3] - lsls r0, 1 - ldr r3, =gUnknown_02024248 - adds r0, r3 - movs r3, 0 - strh r2, [r0] - ldr r6, =gActiveBank - ldrb r0, [r6] - lsls r0, 1 - ldr r1, =gUnknown_02024250 - adds r0, r1 - strh r2, [r0] - ldrb r0, [r6] - lsls r0, 1 - ldr r6, =gUnknown_02024258 - adds r0, r6 - strh r2, [r0] - ldr r1, =gActiveBank - ldrb r0, [r1] - lsls r0, 1 - ldr r6, =gUnknown_02024260 - adds r0, r6 - strh r2, [r0] - ldrb r0, [r1] - lsls r0, 1 - ldr r1, =gUnknown_02024240 - adds r0, r1 - strh r2, [r0] - ldr r2, =gActiveBank - ldrb r0, [r2] - ldr r6, =gUnknown_02024270 - adds r0, r6 - movs r1, 0xFF - strb r1, [r0] - ldrb r0, [r2] - mov r2, r12 - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - strb r3, [r0] - ldr r6, =gActiveBank - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0x98 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0x99 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE0 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE1 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE2 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE3 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE4 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE5 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE6 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE7 - strb r3, [r0] - ldr r1, [r2] - adds r1, 0x92 - ldrb r0, [r6] - lsls r0, 2 - ldr r2, =gBitTable - adds r0, r2 - ldr r2, [r0] - ldrb r0, [r1] - bics r0, r2 - strb r0, [r1] - movs r5, 0 - ldr r3, =gNoOfAllBanks - ldrb r3, [r3] - cmp r5, r3 - bge _0803AB02 - adds r3, r6, 0 - mov r7, r12 - movs r6, 0 -_0803AAA4: - ldrb r0, [r3] - cmp r5, r0 - beq _0803AADA - lsls r0, r5, 24 - lsrs r0, 24 - str r3, [sp] - bl GetBankSide - adds r4, r0, 0 - ldr r3, [sp] - ldrb r0, [r3] - bl GetBankSide - lsls r4, 24 - lsls r0, 24 - ldr r3, [sp] - cmp r4, r0 - beq _0803AADA - ldr r0, [r7] - lsls r1, r5, 1 - adds r0, r1, r0 - adds r0, 0x98 - strb r6, [r0] - ldr r0, [r7] - adds r1, r0 - adds r1, 0x99 - strb r6, [r1] -_0803AADA: - ldrb r0, [r3] - ldr r1, [r7] - lsls r0, 1 - lsls r2, r5, 3 - adds r0, r2 - adds r0, r1 - adds r0, 0xE0 - strb r6, [r0] - ldrb r0, [r3] - ldr r1, [r7] - lsls r0, 1 - adds r0, r2 - adds r0, r1 - adds r0, 0xE1 - strb r6, [r0] - adds r5, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r5, r0 - blt _0803AAA4 -_0803AB02: - ldr r0, =gBattleResources - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldr r2, =gActiveBank - ldrb r0, [r2] - lsls r0, 2 - adds r1, r0 - movs r0, 0 - str r0, [r1] - ldr r4, =gBattleMons - ldrb r0, [r2] - movs r3, 0x58 - adds r2, r0, 0 - muls r2, r3 - b _0803AB6C - .pool -_0803AB6C: - adds r2, r4 - ldr r5, =gBaseStats - ldrh r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x6] - adds r2, 0x21 - strb r0, [r2] - ldr r6, =gActiveBank - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r3 - adds r1, r4 - ldrh r2, [r1] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x7] - adds r1, 0x22 - strb r0, [r1] - ldrb r0, [r6] - bl sub_81310F0 - ldrb r0, [r6] - bl sub_8131130 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803A75C - - thumb_func_start bc_8012FAC -bc_8012FAC: @ 803ABC0 - push {r4,r5,lr} - ldr r5, =gBattleCommunication - ldrb r0, [r5] - cmp r0, 0 - beq _0803ABD4 - cmp r0, 0x1 - beq _0803ABF8 - b _0803AC2E - .pool -_0803ABD4: - ldr r4, =gActiveBank - ldrb r0, [r5, 0x1] - strb r0, [r4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x00_a_b_0 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _0803AC2E - .pool -_0803ABF8: - ldr r0, =gBattleExecBuffer - ldr r2, [r0] - cmp r2, 0 - bne _0803AC2E - ldrb r0, [r5, 0x1] - adds r0, 0x1 - strb r0, [r5, 0x1] - ldr r1, =gNoOfAllBanks - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _0803AC2C - ldr r1, =gBattleMainFunc - ldr r0, =bc_load_battlefield - str r0, [r1] - b _0803AC2E - .pool -_0803AC2C: - strb r2, [r5] -_0803AC2E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end bc_8012FAC - - thumb_func_start bc_load_battlefield -bc_load_battlefield: @ 803AC34 - push {r4,r5,lr} - ldr r0, =gBattleExecBuffer - ldr r5, [r0] - cmp r5, 0 - bne _0803AC64 - movs r0, 0 - bl GetBankByPlayerAI - ldr r4, =gActiveBank - strb r0, [r4] - ldr r0, =gUnknown_02022FF0 - ldrb r1, [r0] - movs r0, 0 - bl dp01_build_cmdbuf_x2E_a - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =gBattleMainFunc - ldr r0, =sub_803AC84 - str r0, [r1] - ldr r0, =gBattleCommunication - strb r5, [r0] - strb r5, [r0, 0x1] -_0803AC64: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end bc_load_battlefield - - thumb_func_start sub_803AC84 -sub_803AC84: @ 803AC84 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gBattleExecBuffer - ldr r1, [r0] - cmp r1, 0 - beq _0803AC98 - b _0803AF4E -_0803AC98: - ldr r2, =gActiveBank - strb r1, [r2] - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r1, r0 - bcc _0803ACA6 - b _0803AF48 -_0803ACA6: - movs r7, 0x58 - ldr r0, =gBattleMons - mov r8, r0 - mov r9, r2 - movs r1, 0x48 - add r1, r8 - mov r10, r1 -_0803ACB4: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0803ACFC - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0803ACFC - ldrb r0, [r4] - muls r0, r7 - mov r2, r8 - adds r3, r0, r2 - movs r2, 0 - movs r1, 0 -_0803ACDA: - adds r0, r3, r2 - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x57 - bls _0803ACDA - b _0803ADCA - .pool -_0803ACFC: - mov r1, r9 - ldrb r0, [r1] - muls r0, r7 - mov r2, r8 - adds r3, r0, r2 - movs r2, 0 - ldr r6, =gBaseStats - ldr r5, =gBattleBufferB - ldr r4, =gActiveBank -_0803AD0E: - adds r0, r3, r2 - ldrb r1, [r4] - lsls r1, 9 - adds r1, 0x4 - adds r1, r2, r1 - adds r1, r5 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x57 - bls _0803AD0E - mov r1, r9 - ldrb r0, [r1] - adds r2, r0, 0 - muls r2, r7 - add r2, r8 - ldrh r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x6] - adds r2, 0x21 - strb r0, [r2] - mov r2, r9 - ldrb r0, [r2] - adds r2, r0, 0 - muls r2, r7 - add r2, r8 - ldrh r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x7] - adds r2, 0x22 - strb r0, [r2] - mov r1, r9 - ldrb r0, [r1] - adds r1, r0, 0 - muls r1, r7 - add r1, r8 - ldrh r0, [r1] - ldrb r1, [r1, 0x17] - lsrs r1, 7 - bl sub_806B694 - mov r2, r9 - ldrb r1, [r2] - muls r1, r7 - add r1, r8 - adds r1, 0x20 - strb r0, [r1] - ldrb r0, [r2] - bl GetBankSide - ldr r1, =gBattleStruct - lsls r0, 24 - lsrs r0, 23 - adds r0, 0xA8 - ldr r1, [r1] - adds r1, r0 - mov r2, r9 - ldrb r0, [r2] - muls r0, r7 - add r0, r8 - ldrh r0, [r0, 0x28] - strh r0, [r1] - movs r2, 0 - ldr r4, =gActiveBank - movs r5, 0x58 - ldr r1, =gUnknown_0202409C - adds r6, r4, 0 - movs r0, 0x18 - negs r0, r0 - adds r0, r1 - mov r12, r0 - movs r3, 0x6 -_0803ADAA: - ldrb r0, [r4] - muls r0, r5 - adds r0, r2, r0 - adds r0, r1 - strb r3, [r0] - adds r2, 0x1 - cmp r2, 0x7 - ble _0803ADAA - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r7 - mov r0, r12 - adds r0, 0x50 - adds r1, r0 - movs r0, 0 - str r0, [r1] -_0803ADCA: - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankIdentity - lsls r0, 24 - cmp r0, 0 - bne _0803ADE4 - movs r0, 0 - bl dp01_build_cmdbuf_x07_7_7_7 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803ADE4: - ldr r5, =gBattleTypeFlags - ldr r0, [r5] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0803AE60 - ldrb r0, [r4] - bl GetBankIdentity - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803AE0A - movs r0, 0 - bl dp01_build_cmdbuf_x07_7_7_7 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803AE0A: - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803AEC0 - ldr r0, [r5] - ldr r1, =0x063f0902 - ands r0, r1 - cmp r0, 0 - bne _0803AEC0 - ldrb r0, [r4] - muls r0, r7 - add r0, r8 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r4] - muls r1, r7 - add r1, r10 - ldr r2, [r1] - movs r1, 0x2 - bl SetPokedexFlag - b _0803AEC0 - .pool -_0803AE60: - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803AEC0 - ldr r0, [r5] - ldr r1, =0x063f0902 - ands r0, r1 - cmp r0, 0 - bne _0803AE96 - ldrb r0, [r4] - muls r0, r7 - add r0, r8 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r4] - muls r1, r7 - add r1, r10 - ldr r2, [r1] - movs r1, 0x2 - bl SetPokedexFlag -_0803AE96: - movs r0, 0 - bl dp01_build_cmdbuf_x04_4_4_4 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =gBattlePartyID - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - ldr r1, =gUnknown_03005D10 - strh r0, [r1, 0x20] -_0803AEC0: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0803AEF6 - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankIdentity - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _0803AEEA - ldrb r0, [r4] - bl GetBankIdentity - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0803AEF6 -_0803AEEA: - movs r0, 0 - bl dp01_build_cmdbuf_x07_7_7_7 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803AEF6: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0803AF20 - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankIdentity - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0803AF20 - movs r0, 0 - bl dp01_build_cmdbuf_x07_7_7_7 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803AF20: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0803AF32 - bl sub_81A56B4 -_0803AF32: - mov r1, r9 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =gNoOfAllBanks - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcs _0803AF48 - b _0803ACB4 -_0803AF48: - ldr r1, =gBattleMainFunc - ldr r0, =bc_801333C - str r0, [r1] -_0803AF4E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803AC84 - - thumb_func_start bc_801333C -bc_801333C: @ 803AF80 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x30 - ldr r0, =gBattleExecBuffer - ldr r0, [r0] - cmp r0, 0 - beq _0803AF92 - b _0803B10C -_0803AF92: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0803AFA0 - b _0803B0AC -_0803AFA0: - movs r7, 0 - add r0, sp, 0x4 - mov r8, r0 - mov r6, r8 - mov r5, sp -_0803AFAA: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gEnemyParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - cmp r0, 0 - beq _0803AFD0 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0803AFE8 -_0803AFD0: - ldr r0, =0x0000ffff - strh r0, [r5] - movs r0, 0 - b _0803AFFA - .pool -_0803AFE8: - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData -_0803AFFA: - str r0, [r6] - adds r6, 0x8 - adds r5, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _0803AFAA - movs r0, 0x1 - bl GetBankByPlayerAI - ldr r4, =gActiveBank - strb r0, [r4] - movs r0, 0 - mov r1, sp - movs r2, 0x80 - bl dp01_build_cmdbuf_x30_TODO - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - movs r7, 0 - mov r6, r8 - mov r5, sp -_0803B026: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - cmp r0, 0 - beq _0803B04C - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0803B060 -_0803B04C: - ldr r0, =0x0000ffff - strh r0, [r5] - movs r0, 0 - b _0803B072 - .pool -_0803B060: - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData -_0803B072: - str r0, [r6] - adds r6, 0x8 - adds r5, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _0803B026 - movs r0, 0 - bl GetBankByPlayerAI - ldr r4, =gActiveBank - strb r0, [r4] - movs r0, 0 - mov r1, sp - movs r2, 0x80 - bl dp01_build_cmdbuf_x30_TODO - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =gBattleMainFunc - ldr r0, =bc_battle_begin_message - b _0803B10A - .pool -_0803B0AC: - movs r7, 0 - add r6, sp, 0x4 - mov r5, sp -_0803B0B2: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - cmp r0, 0 - beq _0803B0D8 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0803B0E8 -_0803B0D8: - ldr r0, =0x0000ffff - strh r0, [r5] - movs r0, 0 - b _0803B0FA - .pool -_0803B0E8: - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData -_0803B0FA: - str r0, [r6] - adds r6, 0x8 - adds r5, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _0803B0B2 - ldr r1, =gBattleMainFunc - ldr r0, =bc_8013568 -_0803B10A: - str r0, [r1] -_0803B10C: - add sp, 0x30 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bc_801333C - - thumb_func_start bc_battle_begin_message -bc_battle_begin_message: @ 803B120 - push {lr} - ldr r0, =gBattleExecBuffer - ldr r0, [r0] - cmp r0, 0 - bne _0803B142 - movs r0, 0x1 - bl GetBankByPlayerAI - ldr r1, =gActiveBank - strb r0, [r1] - ldrb r1, [r1] - movs r0, 0 - bl b_std_message - ldr r1, =gBattleMainFunc - ldr r0, =sub_803B180 - str r0, [r1] -_0803B142: - pop {r0} - bx r0 - .pool - thumb_func_end bc_battle_begin_message - - thumb_func_start bc_8013568 -bc_8013568: @ 803B158 - push {lr} - ldr r0, =gBattleExecBuffer - ldr r0, [r0] - cmp r0, 0 - bne _0803B170 - ldr r1, =gBattleMainFunc - ldr r0, =sub_803B3CC - str r0, [r1] - movs r0, 0 - movs r1, 0 - bl b_std_message -_0803B170: - pop {r0} - bx r0 - .pool - thumb_func_end bc_8013568 - - thumb_func_start sub_803B180 -sub_803B180: @ 803B180 - push {lr} - ldr r0, =gBattleExecBuffer - ldr r0, [r0] - cmp r0, 0 - bne _0803B1D0 - ldr r0, =gBattleTypeFlags - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r2 - cmp r0, 0 - beq _0803B1B8 - movs r0, 0x80 - lsls r0, 18 - ands r0, r2 - cmp r0, 0 - beq _0803B1B8 - movs r1, 0x80 - lsls r1, 24 - ands r1, r2 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - b _0803B1BA - .pool -_0803B1B8: - movs r0, 0x1 -_0803B1BA: - bl GetBankByPlayerAI - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - bl b_std_message - ldr r1, =gBattleMainFunc - ldr r0, =sub_803B25C - str r0, [r1] -_0803B1D0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B180 - - thumb_func_start sub_803B1DC -sub_803B1DC: @ 803B1DC - push {r4,r5,lr} - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _0803B1FC - movs r0, 0x80 - lsls r0, 18 - ands r0, r1 - cmp r0, 0 - beq _0803B1FC - movs r5, 0x2 - cmp r1, 0 - bge _0803B1FE -_0803B1FC: - movs r5, 0x3 -_0803B1FE: - ldr r1, =gActiveBank - movs r0, 0 - strb r0, [r1] - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r0, 0 - beq _0803B23A - adds r4, r1, 0 -_0803B20E: - ldrb r0, [r4] - bl GetBankIdentity - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _0803B228 - movs r0, 0 - bl dp01_build_cmdbuf_x2F_2F_2F_2F - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803B228: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =gNoOfAllBanks - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B20E -_0803B23A: - ldr r1, =gBattleMainFunc - ldr r0, =bc_801362C - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B1DC - - thumb_func_start sub_803B25C -sub_803B25C: @ 803B25C - push {r4-r6,lr} - ldr r0, =gBattleTypeFlags - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r2 - cmp r0, 0 - beq _0803B298 - movs r0, 0x80 - lsls r0, 18 - ands r0, r2 - cmp r0, 0 - beq _0803B298 - movs r1, 0x80 - lsls r1, 24 - ands r1, r2 - negs r0, r1 - orrs r0, r1 - lsrs r5, r0, 31 - b _0803B29A - .pool -_0803B288: - ldr r1, =gBattleMainFunc - ldr r0, =sub_803B1DC - b _0803B2F0 - .pool -_0803B298: - movs r5, 0x1 -_0803B29A: - ldr r0, =gBattleExecBuffer - ldr r2, [r0] - cmp r2, 0 - bne _0803B2F2 - ldr r0, =gActiveBank - strb r2, [r0] - ldr r1, =gNoOfAllBanks - adds r4, r0, 0 - ldrb r1, [r1] - cmp r2, r1 - bcs _0803B2EC - adds r6, r4, 0 -_0803B2B2: - ldrb r0, [r4] - bl GetBankIdentity - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _0803B2D8 - movs r0, 0 - bl dp01_build_cmdbuf_x2F_2F_2F_2F - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x00008040 - ands r0, r1 - cmp r0, 0 - bne _0803B288 -_0803B2D8: - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - ldr r1, =gNoOfAllBanks - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gActiveBank - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B2B2 -_0803B2EC: - ldr r1, =gBattleMainFunc - ldr r0, =bc_801362C -_0803B2F0: - str r0, [r1] -_0803B2F2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B25C - - thumb_func_start bc_801362C -bc_801362C: @ 803B314 - push {r4-r7,lr} - ldr r0, =gBattleExecBuffer - ldr r1, [r0] - cmp r1, 0 - bne _0803B384 - ldr r2, =gActiveBank - strb r1, [r2] - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r1, r0 - bcs _0803B37E - adds r4, r2, 0 - ldr r6, =gBattleMons - movs r5, 0x58 - adds r7, r6, 0 - adds r7, 0x48 -_0803B334: - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803B36C - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x063f0902 - ands r0, r1 - cmp r0, 0 - bne _0803B36C - ldrb r0, [r4] - muls r0, r5 - adds r0, r6 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r4] - muls r1, r5 - adds r1, r7 - ldr r2, [r1] - movs r1, 0x2 - bl SetPokedexFlag -_0803B36C: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =gNoOfAllBanks - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B334 -_0803B37E: - ldr r1, =gBattleMainFunc - ldr r0, =sub_803B3CC - str r0, [r1] -_0803B384: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bc_801362C - - thumb_func_start sub_803B3AC -sub_803B3AC: @ 803B3AC - push {lr} - ldr r0, =gBattleExecBuffer - ldr r0, [r0] - cmp r0, 0 - bne _0803B3BC - ldr r1, =gBattleMainFunc - ldr r0, =sub_803B3CC - str r0, [r1] -_0803B3BC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B3AC - - thumb_func_start sub_803B3CC -sub_803B3CC: @ 803B3CC - push {lr} - ldr r0, =gBattleExecBuffer - ldr r0, [r0] - cmp r0, 0 - bne _0803B418 - ldr r1, =gBattleTypeFlags - ldr r2, [r1] - movs r0, 0x80 - lsls r0, 17 - ands r0, r2 - cmp r0, 0 - beq _0803B3F4 - movs r0, 0x80 - lsls r0, 18 - ands r0, r2 - cmp r0, 0 - beq _0803B3F4 - movs r3, 0x1 - cmp r2, 0 - bge _0803B3F6 -_0803B3F4: - movs r3, 0 -_0803B3F6: - ldr r0, [r1] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0803B412 - adds r0, r3, 0 - bl GetBankByPlayerAI - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - bl b_std_message -_0803B412: - ldr r1, =gBattleMainFunc - ldr r0, =sub_803B4C8 - str r0, [r1] -_0803B418: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B3CC - - thumb_func_start sub_803B42C -sub_803B42C: @ 803B42C - push {r4,r5,lr} - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _0803B44C - movs r0, 0x80 - lsls r0, 18 - ands r0, r1 - cmp r0, 0 - beq _0803B44C - movs r5, 0x3 - cmp r1, 0 - bge _0803B44E -_0803B44C: - movs r5, 0x2 -_0803B44E: - ldr r1, =gActiveBank - movs r0, 0 - strb r0, [r1] - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r0, 0 - beq _0803B48A - adds r4, r1, 0 -_0803B45E: - ldrb r0, [r4] - bl GetBankIdentity - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _0803B478 - movs r0, 0 - bl dp01_build_cmdbuf_x2F_2F_2F_2F - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803B478: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =gNoOfAllBanks - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B45E -_0803B48A: - ldr r2, =gBattleStruct - ldr r0, [r2] - adds r0, 0x4C - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xD9 - strb r1, [r0] - ldr r0, [r2] - movs r2, 0xD1 - lsls r2, 1 - adds r0, r2 - strb r1, [r0] - ldr r1, =gBattleMainFunc - ldr r0, =sub_803B628 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B42C - - thumb_func_start sub_803B4C8 -sub_803B4C8: @ 803B4C8 - push {r4-r6,lr} - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _0803B500 - movs r0, 0x80 - lsls r0, 18 - ands r0, r1 - cmp r0, 0 - beq _0803B500 - movs r6, 0x1 - cmp r1, 0 - bge _0803B502 - b _0803B500 - .pool -_0803B4F0: - ldr r1, =gBattleMainFunc - ldr r0, =sub_803B42C - b _0803B572 - .pool -_0803B500: - movs r6, 0 -_0803B502: - ldr r0, =gBattleExecBuffer - ldr r2, [r0] - cmp r2, 0 - bne _0803B574 - ldr r0, =gActiveBank - strb r2, [r0] - ldr r1, =gNoOfAllBanks - adds r4, r0, 0 - ldrb r1, [r1] - cmp r2, r1 - bcs _0803B554 - adds r5, r4, 0 -_0803B51A: - ldrb r0, [r4] - bl GetBankIdentity - lsls r0, 24 - lsrs r0, 24 - cmp r0, r6 - bne _0803B540 - movs r0, 0 - bl dp01_build_cmdbuf_x2F_2F_2F_2F - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0803B4F0 -_0803B540: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldr r1, =gNoOfAllBanks - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gActiveBank - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B51A -_0803B554: - ldr r2, =gBattleStruct - ldr r0, [r2] - adds r0, 0x4C - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xD9 - strb r1, [r0] - ldr r0, [r2] - movs r2, 0xD1 - lsls r2, 1 - adds r0, r2 - strb r1, [r0] - ldr r1, =gBattleMainFunc - ldr r0, =sub_803B628 -_0803B572: - str r0, [r1] -_0803B574: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B4C8 - - thumb_func_start sub_803B598 -sub_803B598: @ 803B598 - push {r4,r5,lr} - ldr r0, =gBattleExecBuffer - ldr r1, [r0] - cmp r1, 0 - bne _0803B606 - ldr r2, =gActiveBank - strb r1, [r2] - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r1, r0 - bcs _0803B5E6 - adds r4, r2, 0 - ldr r5, =gBattlePartyID -_0803B5B2: - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0803B5D4 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r5 - ldrb r1, [r0] - movs r0, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x05_a_b_c - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803B5D4: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =gNoOfAllBanks - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B5B2 -_0803B5E6: - ldr r2, =gBattleStruct - ldr r0, [r2] - adds r0, 0x4C - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xD9 - strb r1, [r0] - ldr r0, [r2] - movs r2, 0xD1 - lsls r2, 1 - adds r0, r2 - strb r1, [r0] - ldr r1, =gBattleMainFunc - ldr r0, =sub_803B628 - str r0, [r1] -_0803B606: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B598 - - thumb_func_start sub_803B628 -sub_803B628: @ 803B628 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - mov r9, r0 - ldr r0, =gBattleExecBuffer - ldr r0, [r0] - cmp r0, 0 - beq _0803B642 - b _0803B8B2 -_0803B642: - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, 0x4C - ldrb r0, [r0] - cmp r0, 0 - bne _0803B6C2 - movs r5, 0 - ldr r1, =gNoOfAllBanks - mov r10, r1 - ldrb r3, [r1] - cmp r5, r3 - bge _0803B668 - ldr r2, =gTurnOrder -_0803B65C: - adds r0, r5, r2 - strb r5, [r0] - adds r5, 0x1 - ldrb r0, [r1] - cmp r5, r0 - blt _0803B65C -_0803B668: - movs r5, 0 - b _0803B6B8 - .pool -_0803B67C: - adds r4, r5, 0x1 - mov r8, r4 - ldrb r1, [r1] - cmp r8, r1 - bge _0803B6B6 - ldr r6, =gTurnOrder - ldr r1, =gNoOfAllBanks - mov r10, r1 - lsls r7, r5, 24 -_0803B68E: - adds r0, r5, r6 - ldrb r0, [r0] - adds r1, r4, r6 - ldrb r1, [r1] - movs r2, 0x1 - bl b_first_side - lsls r0, 24 - cmp r0, 0 - beq _0803B6AC - lsls r1, r4, 24 - lsrs r1, 24 - lsrs r0, r7, 24 - bl sub_803CEDC -_0803B6AC: - adds r4, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _0803B68E -_0803B6B6: - mov r5, r8 -_0803B6B8: - mov r1, r10 - ldrb r0, [r1] - subs r0, 0x1 - cmp r5, r0 - blt _0803B67C -_0803B6C2: - ldr r5, =gBattleStruct - ldr r0, [r5] - movs r4, 0xD1 - lsls r4, 1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _0803B6FC - str r0, [sp] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0xFF - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - beq _0803B6FC - ldr r0, [r5] - adds r0, r4 - movs r1, 0x1 - strb r1, [r0] - b _0803B8B2 - .pool -_0803B6FC: - ldr r2, =gBattleStruct - ldr r0, [r2] - adds r0, 0x4C - ldr r1, =gNoOfAllBanks - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcs _0803B756 - ldr r5, =gTurnOrder - adds r4, r2, 0 -_0803B710: - ldr r0, [r4] - adds r0, 0x4C - ldrb r0, [r0] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r2, 0 - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - beq _0803B736 - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0803B736: - ldr r1, [r4] - adds r1, 0x4C - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r3, r9 - cmp r3, 0 - beq _0803B748 - b _0803B8B2 -_0803B748: - ldr r0, [r4] - adds r0, 0x4C - ldr r1, =gNoOfAllBanks - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B710 -_0803B756: - movs r0, 0 - str r0, [sp] - movs r0, 0x9 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0803B770 - b _0803B8B2 -_0803B770: - str r0, [sp] - movs r0, 0xB - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - beq _0803B786 - b _0803B8B2 -_0803B786: - ldr r2, =gBattleStruct - ldr r0, [r2] - adds r0, 0xD9 - ldr r1, =gNoOfAllBanks - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcs _0803B7DA - ldr r5, =gTurnOrder - adds r4, r2, 0 -_0803B79A: - ldr r0, [r4] - adds r0, 0xD9 - ldrb r0, [r0] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0 - movs r2, 0 - bl berry_effects_maybe - lsls r0, 24 - cmp r0, 0 - beq _0803B7BC - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0803B7BC: - ldr r1, [r4] - adds r1, 0xD9 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r0, r9 - cmp r0, 0 - bne _0803B8B2 - ldr r0, [r4] - adds r0, 0xD9 - ldr r1, =gNoOfAllBanks - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B79A -_0803B7DA: - movs r5, 0 - ldr r1, =gBattleStruct - mov r8, r1 - movs r7, 0x6 - ldr r6, =gUnknown_0202421C - ldr r2, =gUnknown_02024274 - movs r4, 0xFF - movs r3, 0 -_0803B7EA: - mov r1, r8 - ldr r0, [r1] - adds r0, r5, r0 - adds r0, 0x5C - strb r7, [r0] - adds r1, r5, r6 - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - strh r3, [r2] - adds r2, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0803B7EA - movs r0, 0 - bl sub_803D580 - bl sub_803D6A0 - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, 0x91 - ldr r1, =gAbsentBankFlags - ldrb r1, [r1] - strb r1, [r0] - ldr r0, =gUnknown_085CC23E - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =gBattleMainFunc - ldr r0, =sub_803BE74 - str r0, [r1] - bl sub_803F988 - ldr r1, =gBattleCommunication - movs r2, 0 - adds r0, r1, 0x7 -_0803B834: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0803B834 - movs r5, 0 - ldr r3, =gNoOfAllBanks - ldr r2, =gBattleStruct - ldr r6, =gBattleScripting - ldr r7, =gBattleMoveFlags - ldrb r0, [r3] - cmp r5, r0 - bge _0803B866 - ldr r0, =gBattleMons - movs r4, 0x9 - negs r4, r4 - adds r1, r0, 0 - adds r1, 0x50 -_0803B856: - ldr r0, [r1] - ands r0, r4 - str r0, [r1] - adds r1, 0x58 - adds r5, 0x1 - ldrb r0, [r3] - cmp r5, r0 - blt _0803B856 -_0803B866: - ldr r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - ldr r0, [r2] - movs r3, 0xD0 - lsls r3, 1 - adds r0, r3 - strb r1, [r0] - ldr r0, [r2] - adds r3, 0x1 - adds r0, r3 - strb r1, [r0] - movs r1, 0 - strb r1, [r6, 0x14] - ldr r0, [r2] - adds r0, 0x4D - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x3] - strb r1, [r7] - bl Random - ldr r1, =gUnknown_02024330 - strh r0, [r1] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0803B8B2 - bl StopCryAndClearCrySongs - ldr r0, =gUnknown_082DB8BE - bl b_call_bc_move_exec -_0803B8B2: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B628 - - thumb_func_start bc_8013B1C -bc_8013B1C: @ 803B904 - push {r4-r6,lr} - ldr r0, =gBattleExecBuffer - ldr r0, [r0] - cmp r0, 0 - bne _0803B994 - ldr r1, =gBattleMainFunc - ldr r0, =sub_803B9BC - str r0, [r1] - ldr r3, =gNoOfAllBanks - ldr r1, =gBattleCommunication - movs r2, 0 - adds r0, r1, 0x7 -_0803B91C: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0803B91C - movs r4, 0 - ldrb r3, [r3] - cmp r4, r3 - bge _0803B96E - ldr r5, =gBattleMons - adds r6, r5, 0 - adds r6, 0x4C -_0803B932: - movs r0, 0x58 - adds r2, r4, 0 - muls r2, r0 - adds r1, r5, 0 - adds r1, 0x50 - adds r1, r2, r1 - ldr r3, [r1] - subs r0, 0x61 - ands r3, r0 - str r3, [r1] - adds r2, r6 - ldr r0, [r2] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _0803B964 - movs r0, 0x80 - lsls r0, 5 - ands r3, r0 - cmp r3, 0 - beq _0803B964 - lsls r0, r4, 24 - lsrs r0, 24 - bl CancelMultiTurnMoves -_0803B964: - adds r4, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _0803B932 -_0803B96E: - ldr r2, =gBattleStruct - ldr r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - ldr r0, [r2] - movs r3, 0xD0 - lsls r3, 1 - adds r0, r3 - strb r1, [r0] - ldr r0, [r2] - adds r3, 0x1 - adds r0, r3 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x3] - ldr r0, =gBattleMoveFlags - strb r1, [r0] -_0803B994: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bc_8013B1C - - thumb_func_start sub_803B9BC -sub_803B9BC: @ 803B9BC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0x1 - bl sub_803D580 - ldr r0, =gBattleOutcome - ldrb r0, [r0] - cmp r0, 0 - bne _0803B9EA - bl sub_80401D0 - lsls r0, 24 - cmp r0, 0 - beq _0803B9DE - b _0803BB78 -_0803B9DE: - bl sub_8040924 - lsls r0, 24 - cmp r0, 0 - beq _0803B9EA - b _0803BB78 -_0803B9EA: - bl sub_8041728 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0803B9F8 - b _0803BB78 -_0803B9F8: - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, 0x4D - strb r1, [r0] - bl sub_8041364 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0803BA0E - b _0803BB78 -_0803BA0E: - movs r0, 0 - bl sub_803D580 - ldr r2, =gHitMarker - ldr r0, [r2] - ldr r1, =0xfffffdff - ands r0, r1 - ldr r1, =0xfff7ffff - ands r0, r1 - ldr r1, =0xffbfffff - ands r0, r1 - ldr r1, =0xffefffff - ands r0, r1 - str r0, [r2] - ldr r0, =gBattleScripting - strb r4, [r0, 0x18] - strb r4, [r0, 0x19] - strb r4, [r0, 0x14] - ldr r0, =gBattleMoveDamage - str r4, [r0] - ldr r0, =gBattleMoveFlags - strb r4, [r0] - ldr r1, =gBattleCommunication - movs r2, 0 - adds r0, r1, 0x4 -_0803BA40: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0803BA40 - ldr r0, =gBattleOutcome - ldrb r0, [r0] - cmp r0, 0 - beq _0803BA98 - ldr r1, =gFightStateTracker - movs r0, 0xC - strb r0, [r1] - ldr r1, =gBattleMainFunc - ldr r0, =bc_bs_exec - str r0, [r1] - b _0803BB78 - .pool -_0803BA98: - ldr r1, =gUnknown_03005D10 - ldrb r0, [r1, 0x13] - ldr r2, =gBattleStruct - mov r8, r2 - cmp r0, 0xFE - bhi _0803BAB2 - adds r0, 0x1 - strb r0, [r1, 0x13] - ldr r1, [r2] - adds r1, 0xDA - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0803BAB2: - movs r2, 0 - ldr r4, =gNoOfAllBanks - ldr r0, =gAbsentBankFlags - mov r12, r0 - ldr r1, =gUnknown_085CC23E - mov r9, r1 - ldrb r0, [r4] - cmp r2, r0 - bge _0803BAE0 - ldr r7, =gUnknown_0202421C - movs r6, 0xFF - movs r5, 0 - ldr r3, =gUnknown_02024274 -_0803BACC: - adds r1, r2, r7 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - strh r5, [r3] - adds r3, 0x2 - adds r2, 0x1 - ldrb r1, [r4] - cmp r2, r1 - blt _0803BACC -_0803BAE0: - movs r2, 0 - ldr r3, =gBattleStruct - movs r1, 0x6 -_0803BAE6: - ldr r0, [r3] - adds r0, r2, r0 - adds r0, 0x5C - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _0803BAE6 - mov r2, r8 - ldr r0, [r2] - adds r0, 0x91 - mov r2, r12 - ldrb r1, [r2] - strb r1, [r0] - mov r0, r9 - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =gBattleMainFunc - ldr r0, =sub_803BE74 - str r0, [r1] - bl Random - ldr r1, =gUnknown_02024330 - strh r0, [r1] - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 10 - ands r0, r1 - cmp r0, 0 - beq _0803BB5C - ldr r0, =gUnknown_082DB881 - bl b_call_bc_move_exec - b _0803BB78 - .pool -_0803BB5C: - movs r0, 0x80 - lsls r0, 11 - ands r1, r0 - cmp r1, 0 - beq _0803BB78 - mov r1, r8 - ldr r0, [r1] - adds r0, 0xDA - ldrb r0, [r0] - cmp r0, 0 - bne _0803BB78 - ldr r0, =gUnknown_082DB8BE - bl b_call_bc_move_exec -_0803BB78: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B9BC - - thumb_func_start sub_803BB88 -sub_803BB88: @ 803BB88 - push {r4-r7,lr} - sub sp, 0x4 - ldr r1, =gBattleMons - ldr r0, =gActiveBank - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0803BBB8 - ldr r1, =gEnigmaBerries - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x7] - b _0803BBC2 - .pool -_0803BBB8: - ldrh r0, [r1, 0x2E] - bl ItemId_GetHoldEffect - lsls r0, 24 - lsrs r2, r0, 24 -_0803BBC2: - ldr r1, =gUnknown_0202420F - ldr r3, =gActiveBank - ldrb r0, [r3] - strb r0, [r1] - cmp r2, 0x25 - bne _0803BBD0 - b _0803BD4C -_0803BBD0: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0803BBDE - b _0803BD4C -_0803BBDE: - ldr r1, =gBattleMons - ldrb r2, [r3] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x32 - bne _0803BBF2 - b _0803BD4C -_0803BBF2: - adds r0, r2, 0 - bl GetBankSide - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r5, r0 - bge _0803BC86 - movs r7, 0 -_0803BC08: - lsrs r4, r7, 24 - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _0803BC2C - ldr r1, =gBattleMons - movs r0, 0x58 - muls r0, r5 - adds r0, r1 - adds r2, r0, 0 - adds r2, 0x20 - ldrb r0, [r2] - cmp r0, 0x17 - bne _0803BC2C - b _0803BD54 -_0803BC2C: - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _0803BC76 - ldr r3, =gBattleMons - ldr r0, =gActiveBank - ldrb r0, [r0] - movs r2, 0x58 - muls r0, r2 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1A - beq _0803BC76 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0803BC76 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0803BC76 - adds r0, r5, 0 - muls r0, r2 - adds r0, r3 - adds r2, r0, 0 - adds r2, 0x20 - ldrb r0, [r2] - cmp r0, 0x47 - bne _0803BC76 - b _0803BD70 -_0803BC76: - movs r0, 0x80 - lsls r0, 17 - adds r7, r0 - adds r5, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r5, r0 - blt _0803BC08 -_0803BC86: - ldr r4, =gActiveBank - ldrb r1, [r4] - movs r0, 0 - str r0, [sp] - movs r0, 0xF - movs r2, 0x2A - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _0803BCF8 - ldr r6, =gBattleMons - ldrb r0, [r4] - movs r3, 0x58 - muls r0, r3 - adds r1, r0, r6 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x8 - beq _0803BCBE - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x8 - bne _0803BCF8 -_0803BCBE: - ldr r0, =gBattleScripting - subs r1, r5, 0x1 - strb r1, [r0, 0x17] - ldr r2, =gLastUsedAbility - adds r0, r1, 0 - muls r0, r3 - adds r0, r6 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r2] - ldr r1, =gBattleCommunication - movs r0, 0x2 - b _0803BD90 - .pool -_0803BCF8: - ldr r1, =gBattleMons - ldr r0, =gActiveBank - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0400e000 - ands r0, r1 - cmp r0, 0 - bne _0803BD22 - ldr r1, =gStatuses3 - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 3 - ands r0, r1 - cmp r0, 0 - beq _0803BD40 -_0803BD22: - ldr r1, =gBattleCommunication - movs r0, 0 - strb r0, [r1, 0x5] - movs r0, 0x1 - b _0803BD92 - .pool -_0803BD40: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0803BD8C -_0803BD4C: - movs r0, 0 - b _0803BD92 - .pool -_0803BD54: - ldr r0, =gBattleScripting - strb r5, [r0, 0x17] - ldr r1, =gLastUsedAbility - ldrb r0, [r2] - strb r0, [r1] - ldr r1, =gBattleCommunication - movs r0, 0x2 - b _0803BD90 - .pool -_0803BD70: - ldr r0, =gBattleScripting - strb r5, [r0, 0x17] - ldr r1, =gLastUsedAbility - ldrb r0, [r2] - strb r0, [r1] - ldr r1, =gBattleCommunication - movs r0, 0x2 - b _0803BD90 - .pool -_0803BD8C: - ldr r1, =gBattleCommunication - movs r0, 0x1 -_0803BD90: - strb r0, [r1, 0x5] -_0803BD92: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_803BB88 - - thumb_func_start sub_803BDA0 -sub_803BDA0: @ 803BDA0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - ldr r0, =gBattlePartyID - mov r8, r0 - ldr r1, =gUnknown_0203CF00 - mov r12, r1 - ldr r7, =gBattleStruct - lsls r0, r5, 1 - adds r4, r0, r5 - adds r6, r0, 0 -_0803BDBC: - mov r0, r12 - adds r2, r3, r0 - ldr r1, [r7] - adds r0, r4, r3 - adds r0, r1 - adds r0, 0x60 - ldrb r0, [r0] - strb r0, [r2] - adds r3, 0x1 - cmp r3, 0x2 - ble _0803BDBC - mov r1, r8 - adds r0, r6, r1 - ldrb r0, [r0] - bl pokemon_order_func - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r7, =gBattleStruct - ldr r0, [r7] - adds r0, r5, r0 - adds r0, 0x5C - ldrb r0, [r0] - bl pokemon_order_func - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B8FB0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0803BE4C - movs r3, 0 - adds r4, r7, 0 - adds r6, r5 - movs r0, 0x2 - adds r1, r5, 0 - eors r1, r0 - ldr r7, =gUnknown_0203CF00 - lsls r0, r1, 1 - adds r5, r0, r1 -_0803BE1A: - ldr r0, [r4] - adds r1, r6, r3 - adds r1, r0 - adds r1, 0x60 - adds r2, r3, r7 - ldrb r0, [r2] - strb r0, [r1] - ldr r1, [r4] - adds r0, r5, r3 - adds r0, r1 - adds r0, 0x60 - ldrb r1, [r2] - strb r1, [r0] - adds r3, 0x1 - cmp r3, 0x2 - ble _0803BE1A - b _0803BE66 - .pool -_0803BE4C: - movs r3, 0 - adds r2, r6, r5 - ldr r4, =gUnknown_0203CF00 -_0803BE52: - ldr r0, [r7] - adds r1, r2, r3 - adds r1, r0 - adds r1, 0x60 - adds r0, r3, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r3, 0x1 - cmp r3, 0x2 - ble _0803BE52 -_0803BE66: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803BDA0 - - thumb_func_start sub_803BE74 -sub_803BE74: @ 803BE74 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - ldr r0, =gBattleCommunication - movs r1, 0 - strb r1, [r0, 0x4] - ldr r0, =gActiveBank - strb r1, [r0] - ldr r0, =gNoOfAllBanks - bl _0803CD12 - .pool -_0803BE9C: - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankIdentity - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gBattleCommunication - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x8 - bls _0803BEB8 - bl _0803CD04 -_0803BEB8: - lsls r0, 2 - ldr r1, =_0803BED0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803BED0: - .4byte _0803BEF4 - .4byte _0803BF0C - .4byte _0803C02C - .4byte _0803C7D8 - .4byte _0803CAD0 - .4byte _0803CB84 - .4byte _0803CBC8 - .4byte _0803CBF4 - .4byte _0803CC38 -_0803BEF4: - bl sub_8185FD0 - ldr r1, =gBattleCommunication - ldr r0, =gActiveBank - ldrb r0, [r0] - adds r0, r1 - bl _0803CC20 - .pool -_0803BF0C: - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r4, =gBattleStruct - ldr r0, [r4] - adds r1, r0 - adds r1, 0x5C - movs r0, 0x6 - strb r0, [r1] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0803BF68 - movs r1, 0x2 - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _0803BF68 - eors r5, r1 - adds r0, r5, 0 - bl GetBankByPlayerAI - ldr r1, [r4] - adds r1, 0x91 - ldrb r1, [r1] - ldr r2, =gBitTable - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803BF68 - ldr r4, =gBattleCommunication - adds r0, r5, 0 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x5 - beq _0803BF68 - bl _0803CD04 -_0803BF68: - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, 0x91 - ldrb r3, [r0] - ldr r1, =gBitTable - ldr r4, =gActiveBank - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ands r3, r0 - cmp r3, 0 - beq _0803BFD0 - ldr r0, =gUnknown_0202421C - adds r0, r2, r0 - movs r1, 0xD - strb r1, [r0] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0803BFBC - ldr r0, =gBattleCommunication - ldrb r1, [r4] - adds r1, r0 - movs r0, 0x5 - strb r0, [r1] - bl _0803CD04 - .pool -_0803BFBC: - ldr r0, =gBattleCommunication - ldrb r1, [r4] - adds r1, r0 - movs r0, 0x4 - strb r0, [r1] - bl _0803CD04 - .pool -_0803BFD0: - ldr r1, =gBattleMons - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - bne _0803BFF0 - movs r0, 0x80 - lsls r0, 15 - ands r1, r0 - cmp r1, 0 - beq _0803C00C -_0803BFF0: - ldr r0, =gUnknown_0202421C - adds r0, r2, r0 - strb r3, [r0] - ldr r1, =gBattleCommunication - ldrb r0, [r4] - bl _0803CC72 - .pool -_0803C00C: - ldr r0, =gUnknown_0202421C - ldrb r1, [r0] - ldr r0, =gBattleBufferB - ldrb r2, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r2, r0 - movs r0, 0 - bl dp01_build_cmdbuf_x12_a_bb - bl _0803CB68 - .pool -_0803C02C: - ldr r3, =gBattleExecBuffer - ldr r1, =gBitTable - ldr r6, =gActiveBank - ldrb r5, [r6] - lsls r0, r5, 2 - adds r0, r1 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - beq _0803C058 - bl _0803CD04 -_0803C058: - ldr r4, =gBattleBufferB - lsls r0, r5, 9 - adds r4, 0x1 - adds r0, r4 - ldrb r1, [r0] - adds r0, r5, 0 - bl sub_8184FBC - ldr r1, =gUnknown_0202421C - ldrb r0, [r6] - adds r1, r0, r1 - lsls r0, 9 - adds r0, r4 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r6] - lsls r0, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0xC - bls _0803C084 - b _0803C6C4 -_0803C084: - lsls r0, 2 - ldr r1, =_0803C0A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803C0A8: - .4byte _0803C0DC - .4byte _0803C230 - .4byte _0803C268 - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C440 - .4byte _0803C48C - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C4B4 -_0803C0DC: - bl sub_80400C8 - lsls r0, 24 - cmp r0, 0 - beq _0803C134 - ldr r0, =gBattleCommunication - ldr r3, =gActiveBank - ldrb r1, [r3] - adds r1, r0 - movs r4, 0 - movs r0, 0x6 - strb r0, [r1] - ldrb r1, [r3] - ldr r2, =gBattleStruct - ldr r0, [r2] - adds r1, r0 - adds r1, 0x54 - strb r4, [r1] - ldrb r1, [r3] - ldr r0, [r2] - adds r1, r0 - adds r1, 0x84 - movs r0, 0x4 - strb r0, [r1] - ldrb r1, [r3] - ldr r2, [r2] - adds r2, r1, r2 - ldr r0, =gBattleBufferB - lsls r1, 9 - adds r0, 0x3 - adds r1, r0 - ldrb r0, [r1] - strb r0, [r2, 0xC] - bl _0803CD70 - .pool -_0803C134: - ldr r3, =gDisableStructs - ldr r5, =gActiveBank - ldrb r4, [r5] - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r3 - ldrh r2, [r0, 0x6] - cmp r2, 0 - beq _0803C188 - ldr r1, =gUnknown_02024274 - lsls r0, r4, 1 - adds r0, r1 - strh r2, [r0] - ldrb r2, [r5] - ldr r0, =gBattleStruct - ldr r1, [r0] - adds r1, r2, r1 - adds r1, 0x80 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0xC] - strb r0, [r1] - ldr r1, =gBattleCommunication - ldrb r0, [r5] - adds r0, r1 - movs r1, 0x4 - strb r1, [r0] - bl _0803CD70 - .pool -_0803C188: - add r2, sp, 0x4 - ldr r3, =gBattleMons - movs r1, 0x58 - adds r0, r4, 0 - muls r0, r1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r2, 0x10] - ldrb r0, [r5] - muls r0, r1 - adds r0, r3 - adds r0, 0x21 - ldrb r0, [r0] - strb r0, [r2, 0x12] - ldrb r0, [r5] - muls r0, r1 - adds r0, r3 - adds r0, 0x22 - ldrb r0, [r0] - strb r0, [r2, 0x13] - movs r4, 0 - mov r1, sp - adds r1, 0xC - str r1, [sp, 0x18] - add r2, sp, 0x10 - mov r10, r2 - mov r8, r3 - adds r7, r5, 0 - movs r6, 0x58 - movs r0, 0xC - add r0, r8 - mov r9, r0 - add r5, sp, 0x4 -_0803C1CA: - lsls r2, r4, 1 - ldrb r0, [r7] - muls r0, r6 - adds r0, r2, r0 - add r0, r9 - ldrh r0, [r0] - strh r0, [r5] - ldr r1, [sp, 0x18] - adds r3, r1, r4 - ldrb r0, [r7] - muls r0, r6 - adds r0, r4, r0 - mov r1, r8 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r3] - ldrb r0, [r7] - adds r1, r0, 0 - muls r1, r6 - adds r2, r1 - add r2, r9 - ldrh r0, [r2] - add r1, r8 - adds r1, 0x3B - ldrb r1, [r1] - lsls r2, r4, 24 - lsrs r2, 24 - bl CalcPPWithPPUps - mov r2, r10 - adds r1, r2, r4 - strb r0, [r1] - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _0803C1CA - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x1 - ands r1, r0 - movs r0, 0 - movs r2, 0 - add r3, sp, 0x4 - bl sub_8033E30 - b _0803C42E - .pool -_0803C230: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x021f0902 - ands r0, r1 - cmp r0, 0 - bne _0803C23E - b _0803C48C -_0803C23E: - ldr r4, =gActiveBank - ldrb r0, [r4] - movs r1, 0x1 - bl sub_8185008 - ldr r1, =gUnknown_02024220 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB879 - b _0803C784 - .pool -_0803C268: - ldr r5, =gActiveBank - ldrb r0, [r5] - ldr r3, =gBattleStruct - ldr r1, [r3] - adds r1, r0, r1 - adds r1, 0x58 - ldr r2, =gBattlePartyID - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1] - ldr r7, =gBattleMons - ldrb r2, [r5] - movs r6, 0x58 - adds r0, r2, 0 - muls r0, r6 - adds r1, r7, 0 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - ldr r0, =0x0400e000 - ands r1, r0 - cmp r1, 0 - bne _0803C2B8 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - bne _0803C2B8 - ldr r0, =gStatuses3 - lsls r1, r2, 2 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x80 - lsls r0, 3 - ands r1, r0 - cmp r1, 0 - beq _0803C2EC -_0803C2B8: - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r1, r0, 1 - adds r1, r0 - adds r1, 0x60 - ldr r0, [r3] - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0x6 - b _0803C400 - .pool -_0803C2EC: - str r1, [sp] - movs r0, 0xC - adds r1, r2, 0 - movs r2, 0x17 - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0803C374 - ldrb r1, [r5] - str r4, [sp] - movs r0, 0xC - movs r2, 0x47 - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0803C33C - ldrb r0, [r5] - muls r0, r6 - adds r1, r0, r7 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0803C33C - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0803C33C - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1A - bne _0803C374 -_0803C33C: - ldr r5, =gActiveBank - ldrb r1, [r5] - movs r0, 0 - str r0, [sp] - movs r0, 0xF - movs r2, 0x2A - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0803C3B0 - ldr r2, =gBattleMons - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x8 - beq _0803C374 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x8 - bne _0803C3B0 -_0803C374: - subs r1, r4, 0x1 - lsls r1, 4 - movs r0, 0x4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =gLastUsedAbility - ldrb r3, [r0] - ldr r4, =gBattleStruct - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r2, r0, 1 - adds r2, r0 - adds r2, 0x60 - ldr r0, [r4] - adds r0, r2 - str r0, [sp] - movs r0, 0 - movs r2, 0x6 - bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f - b _0803C42E - .pool -_0803C3B0: - ldr r0, =gActiveBank - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x2 - bne _0803C3D8 - ldr r0, =gUnknown_0202421C - ldrb r0, [r0] - cmp r0, 0x2 - bne _0803C3D8 - ldr r0, =gBattleStruct - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0x5C - b _0803C3EE - .pool -_0803C3D8: - ldrb r0, [r4] - cmp r0, 0x3 - bne _0803C410 - ldr r0, =gUnknown_0202421C - ldrb r0, [r0, 0x1] - cmp r0, 0x2 - bne _0803C410 - ldr r0, =gBattleStruct - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0x5D -_0803C3EE: - ldrb r2, [r0] - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - adds r0, 0x60 - adds r3, r0 - str r3, [sp] - movs r0, 0 - movs r1, 0 -_0803C400: - movs r3, 0 - bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f - b _0803C42E - .pool -_0803C410: - ldr r2, =gBattleStruct - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r1, r0, 1 - adds r1, r0 - adds r1, 0x60 - ldr r0, [r2] - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0 - movs r2, 0x6 - movs r3, 0 - bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f -_0803C42E: - ldr r0, =gActiveBank - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - b _0803C6C4 - .pool -_0803C440: - bl sub_806B8B0 - lsls r0, 24 - cmp r0, 0 - bne _0803C44C - b _0803C6C4 -_0803C44C: - ldr r1, =gUnknown_02024220 - ldr r3, =gActiveBank - ldrb r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DAB11 - str r1, [r0] - ldr r0, =gBattleCommunication - ldrb r1, [r3] - adds r1, r0 - movs r4, 0 - movs r0, 0x6 - strb r0, [r1] - ldrb r1, [r3] - ldr r2, =gBattleStruct - ldr r0, [r2] - adds r1, r0 - adds r1, 0x54 - strb r4, [r1] - ldrb r1, [r3] - b _0803C7A0 - .pool -_0803C48C: - ldr r2, =gBattleStruct - ldr r4, =gActiveBank - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - adds r0, 0x60 - ldr r1, [r2] - adds r1, r0 - movs r0, 0 - bl sub_8033E6C - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0803C6C4 - .pool -_0803C4B4: - ldr r4, =gBattleCommunication - ldr r5, =gActiveBank - ldrb r0, [r5] - adds r0, r4 - movs r1, 0x7 - strb r1, [r0] - ldrb r0, [r5] - bl GetBankIdentity - movs r6, 0x2 - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - movs r1, 0x1 - strb r1, [r0] - ldrb r0, [r5] - bl sub_8185008 - ldrb r0, [r5] - bl GetBankIdentity - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - ldr r1, =gBattleMons - lsls r0, 24 - lsrs r0, 24 - movs r7, 0x58 - muls r0, r7 - adds r4, r1, 0 - adds r4, 0x50 - adds r0, r4 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - bne _0803C532 - ldrb r0, [r5] - bl GetBankIdentity - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - adds r0, r4 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0803C550 -_0803C532: - movs r0, 0 - bl dp01_build_cmdbuf_x32_32_32_32 - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - bl _0803CD70 - .pool -_0803C550: - ldr r4, =gUnknown_0202421C - ldrb r0, [r5] - bl GetBankIdentity - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x2 - bne _0803C590 - ldrb r0, [r5] - bl GetBankIdentity - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_8185008 - b _0803C6AE - .pool -_0803C590: - ldrb r0, [r5] - bl GetBankIdentity - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0803C5B6 - ldrb r0, [r5] - bl GetBankIdentity - eors r0, r6 - b _0803C668 -_0803C5B6: - ldrb r0, [r5] - bl GetBankIdentity - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _0803C628 - ldr r4, =gProtectStructs - ldrb r0, [r5] - bl GetBankIdentity - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 20 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _0803C616 - ldr r4, =gDisableStructs - ldrb r0, [r5] - bl GetBankIdentity - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1, 0x6] - cmp r0, 0 - beq _0803C628 -_0803C616: - ldrb r0, [r5] - bl GetBankIdentity - eors r0, r6 - b _0803C668 - .pool -_0803C628: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0803C690 - ldr r4, =gUnknown_0202421C - ldr r6, =gActiveBank - ldrb r0, [r6] - bl GetBankIdentity - movs r5, 0x2 - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _0803C690 - ldr r1, =gRngValue - ldr r0, =gUnknown_0203BD30 - ldr r0, [r0] - str r0, [r1] - ldrb r0, [r6] - bl GetBankIdentity - eors r0, r5 -_0803C668: - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_8185008 - b _0803C6AE - .pool -_0803C690: - ldr r0, =gActiveBank - ldrb r0, [r0] - bl GetBankIdentity - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl sub_8185008 -_0803C6AE: - movs r0, 0 - bl dp01_build_cmdbuf_x32_32_32_32 - ldr r0, =gActiveBank - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - b _0803CD70 - .pool -_0803C6C4: - ldr r1, =gBattleTypeFlags - ldr r2, [r1] - movs r5, 0x8 - adds r0, r2, 0 - ands r0, r5 - adds r3, r1, 0 - cmp r0, 0 - beq _0803C720 - ldr r0, =0x043f0100 - ands r2, r0 - cmp r2, 0 - beq _0803C720 - ldr r0, =gBattleBufferB - ldr r4, =gActiveBank - ldrb r2, [r4] - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x3 - bne _0803C720 - ldr r1, =gUnknown_02024220 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB9BA - str r1, [r0] - ldr r1, =gBattleCommunication - ldrb r0, [r4] - adds r0, r1 - movs r3, 0 - strb r5, [r0] - b _0803C792 - .pool -_0803C720: - ldr r0, [r3] - ldr r1, =0x0200000a - ands r0, r1 - cmp r0, 0x8 - bne _0803C760 - ldr r0, =gBattleBufferB - ldr r4, =gActiveBank - ldrb r1, [r4] - lsls r1, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x3 - bne _0803C760 - ldr r0, =gUnknown_082DAAFE - bl b_call_bc_move_exec - ldr r1, =gBattleCommunication - ldrb r0, [r4] - adds r0, r1 - b _0803CC20 - .pool -_0803C760: - bl sub_803BB88 - lsls r0, 24 - cmp r0, 0 - beq _0803C7C4 - ldr r0, =gBattleBufferB - ldr r4, =gActiveBank - ldrb r2, [r4] - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x3 - bne _0803C7C4 - ldr r1, =gUnknown_02024220 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, =gUnknown_082DAB0B -_0803C784: - str r1, [r0] - ldr r0, =gBattleCommunication - ldrb r1, [r4] - adds r1, r0 - movs r3, 0 - movs r0, 0x6 - strb r0, [r1] -_0803C792: - ldrb r1, [r4] - ldr r2, =gBattleStruct - ldr r0, [r2] - adds r1, r0 - adds r1, 0x54 - strb r3, [r1] - ldrb r1, [r4] -_0803C7A0: - ldr r0, [r2] - adds r1, r0 - adds r1, 0x84 - movs r0, 0x1 - strb r0, [r1] - b _0803CD70 - .pool -_0803C7C4: - ldr r2, =gBattleCommunication - ldr r0, =gActiveBank - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803C7D8: - ldr r4, =gBattleExecBuffer - ldr r1, =gBitTable - ldr r3, =gActiveBank - ldrb r5, [r3] - lsls r0, r5, 2 - adds r0, r1 - ldr r2, [r0] - lsls r0, r2, 4 - movs r1, 0xF0 - lsls r1, 24 - orrs r0, r1 - orrs r0, r2 - lsls r1, r2, 8 - orrs r0, r1 - lsls r2, 12 - orrs r0, r2 - ldr r1, [r4] - ands r1, r0 - adds r4, r3, 0 - cmp r1, 0 - beq _0803C804 - b _0803CD04 -_0803C804: - ldr r1, =gUnknown_0202421C - adds r0, r5, r1 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x9 - bls _0803C812 - b _0803CD04 -_0803C812: - lsls r0, 2 - ldr r1, =_0803C830 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803C830: - .4byte _0803C858 - .4byte _0803C99C - .4byte _0803C9D4 - .4byte _0803CA0A - .4byte _0803CA2C - .4byte _0803CA40 - .4byte _0803CA54 - .4byte _0803CA84 - .4byte _0803CA98 - .4byte _0803CABC -_0803C858: - ldr r1, =gBattleBufferB - ldrb r3, [r4] - lsls r0, r3, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r1, [r0] - cmp r1, 0x3 - blt _0803C88A - cmp r1, 0x9 - ble _0803C878 - cmp r1, 0xF - beq _0803C87E - b _0803C88A - .pool -_0803C878: - adds r0, r3, r2 - strb r1, [r0] - b _0803CD70 -_0803C87E: - adds r1, r3, r2 - movs r0, 0x2 - strb r0, [r1] - bl sub_803CDF8 - b _0803CD70 -_0803C88A: - movs r0, 0x2 - bl sub_818603C - ldr r4, =gBattleBufferB - ldr r6, =gActiveBank - ldrb r3, [r6] - lsls r1, r3, 9 - adds r5, r4, 0x2 - adds r0, r1, r5 - ldrb r2, [r0] - adds r7, r4, 0x3 - adds r1, r7 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - ldr r0, =0x0000ffff - cmp r2, r0 - bne _0803C8D0 - ldr r0, =gBattleCommunication - adds r0, r3, r0 - movs r1, 0x1 - strb r1, [r0] - ldrb r0, [r6] - bl sub_8185008 - b _0803CD04 - .pool -_0803C8D0: - bl sub_803FB4C - lsls r0, 24 - cmp r0, 0 - beq _0803C91C - ldrb r0, [r6] - movs r1, 0x1 - bl sub_8185008 - ldr r0, =gBattleCommunication - ldrb r1, [r6] - adds r1, r0 - movs r3, 0 - movs r0, 0x6 - strb r0, [r1] - ldrb r1, [r6] - ldr r2, =gBattleStruct - ldr r0, [r2] - adds r1, r0 - adds r1, 0x54 - strb r3, [r1] - ldrb r0, [r6] - lsls r0, 9 - adds r1, r4, 0x1 - adds r0, r1 - strb r3, [r0] - ldrb r1, [r6] - ldr r0, [r2] - adds r1, r0 - adds r1, 0x84 - movs r0, 0x2 - strb r0, [r1] - b _0803CD70 - .pool -_0803C91C: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - bne _0803C942 - ldrb r0, [r6] - lsls r1, r0, 9 - adds r1, r5 - ldrb r1, [r1] - bl sub_8184FBC - ldrb r0, [r6] - lsls r1, r0, 9 - adds r1, r7 - ldrb r1, [r1] - bl sub_8184FBC -_0803C942: - ldrb r0, [r6] - ldr r4, =gBattleStruct - ldr r1, [r4] - adds r1, r0, r1 - adds r1, 0x80 - lsls r0, 9 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =gUnknown_02024274 - ldrb r2, [r6] - lsls r5, r2, 1 - adds r5, r0 - ldr r3, =gBattleMons - ldr r4, [r4] - adds r0, r2, r4 - adds r0, 0x80 - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x58 - muls r1, r2 - adds r0, r1 - adds r3, 0xC - adds r0, r3 - ldrh r0, [r0] - strh r0, [r5] - ldrb r0, [r6] - adds r4, r0, r4 - lsls r0, 9 - adds r0, r7 - ldrb r0, [r0] - strb r0, [r4, 0xC] - ldr r0, =gBattleCommunication - ldrb r1, [r6] - b _0803CB72 - .pool -_0803C99C: - ldr r2, =gBattleBufferB - ldr r5, =gActiveBank - ldrb r4, [r5] - lsls r1, r4, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r3, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r0, [r1] - lsls r0, 8 - orrs r3, r0 - cmp r3, 0 - bne _0803C9BA - b _0803CC1C -_0803C9BA: - ldr r0, =gUnknown_02024208 - strh r3, [r0] - ldr r0, =gBattleCommunication - ldrb r1, [r5] - b _0803CB72 - .pool -_0803C9D4: - ldr r0, =gBattleBufferB - ldr r4, =gActiveBank - ldrb r2, [r4] - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x6 - bne _0803CA04 - ldr r0, =gBattleCommunication - adds r0, r2, r0 - movs r1, 0x1 - strb r1, [r0] - ldrb r0, [r4] - bl sub_8185008 - b _0803CD04 - .pool -_0803CA04: - bl sub_803CDF8 - b _0803CB6E -_0803CA0A: - ldr r2, =gHitMarker - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 8 - orrs r0, r1 - str r0, [r2] - ldr r2, =gBattleCommunication - ldr r0, =gActiveBank - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CA2C: - ldr r2, =gBattleCommunication - ldr r0, =gActiveBank - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CA40: - ldr r2, =gBattleCommunication - ldr r0, =gActiveBank - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CA54: - ldr r3, =gBattleBufferB - ldr r0, =gActiveBank - ldrb r4, [r0] - lsls r1, r4, 9 - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r2, [r0] - adds r3, 0x2 - adds r1, r3 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - cmp r2, 0 - bne _0803CA72 - b _0803CC1C -_0803CA72: - ldr r1, =gBattleCommunication - adds r1, r4, r1 - b _0803CB74 - .pool -_0803CA84: - ldr r2, =gBattleCommunication - ldr r0, =gActiveBank - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CA98: - ldr r2, =gHitMarker - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 8 - orrs r0, r1 - str r0, [r2] - ldr r2, =gBattleCommunication - ldr r0, =gActiveBank - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CABC: - ldr r2, =gBattleCommunication - ldr r0, =gActiveBank - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CAD0: - ldr r3, =gBattleExecBuffer - ldr r6, =gBitTable - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 2 - adds r0, r6 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - beq _0803CAFA - b _0803CD04 -_0803CAFA: - bl sub_803CDB8 - lsls r0, 24 - lsrs r0, 24 - negs r1, r0 - orrs r1, r0 - lsrs r4, r1, 31 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x41 - ands r0, r1 - cmp r0, 0x1 - bne _0803CB3C - movs r1, 0x2 - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - bne _0803CB3C - adds r0, r5, 0 - eors r0, r1 - bl GetBankByPlayerAI - ldr r1, =gBattleStruct - ldr r1, [r1] - adds r1, 0x91 - ldrb r1, [r1] - lsls r0, 24 - lsrs r0, 22 - adds r0, r6 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0803CB5C -_0803CB3C: - movs r0, 0 - movs r1, 0 - adds r2, r4, 0 - bl sub_8034464 - b _0803CB66 - .pool -_0803CB5C: - movs r0, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl sub_8034464 -_0803CB66: - ldr r4, =gActiveBank -_0803CB68: - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803CB6E: - ldr r0, =gBattleCommunication - ldrb r1, [r4] -_0803CB72: - adds r1, r0 -_0803CB74: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0803CD04 - .pool -_0803CB84: - ldr r3, =gBattleExecBuffer - ldr r1, =gBitTable - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - beq _0803CBAE - b _0803CD04 -_0803CBAE: - ldr r1, =gBattleCommunication - ldrb r0, [r1, 0x4] - adds r0, 0x1 - strb r0, [r1, 0x4] - b _0803CD04 - .pool -_0803CBC8: - ldr r5, =gActiveBank - ldrb r2, [r5] - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r1, r2, r0 - adds r0, r1, 0 - adds r0, 0x54 - ldrb r0, [r0] - cmp r0, 0 - beq _0803CCB4 - ldr r0, =gBattleCommunication - adds r0, r2, r0 - adds r1, 0x84 - ldrb r1, [r1] - strb r1, [r0] - b _0803CD04 - .pool -_0803CBF4: - ldr r3, =gBattleExecBuffer - ldr r1, =gBitTable - ldr r0, =gActiveBank - ldrb r4, [r0] - lsls r0, r4, 2 - adds r0, r1 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - bne _0803CD04 -_0803CC1C: - ldr r0, =gBattleCommunication - adds r0, r4, r0 -_0803CC20: - movs r1, 0x1 - strb r1, [r0] - b _0803CD04 - .pool -_0803CC38: - ldr r5, =gActiveBank - ldrb r2, [r5] - ldr r4, =gBattleStruct - ldr r0, [r4] - adds r0, r2, r0 - adds r0, 0x54 - ldrb r0, [r0] - cmp r0, 0 - beq _0803CCB4 - ldr r0, =gBattleBufferB - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xD - bne _0803CC94 - ldr r2, =gHitMarker - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 8 - orrs r0, r1 - str r0, [r2] - ldr r1, =gUnknown_0202421C - ldrb r0, [r5] - adds r0, r1 - movs r1, 0x3 - strb r1, [r0] - ldr r1, =gBattleCommunication - ldrb r0, [r5] -_0803CC72: - adds r0, r1 - movs r1, 0x4 - strb r1, [r0] - b _0803CD04 - .pool -_0803CC94: - adds r0, r2, 0 - movs r1, 0x1 - bl sub_8185008 - ldr r2, =gBattleCommunication - ldrb r0, [r5] - adds r2, r0, r2 - ldr r1, [r4] - adds r0, r1 - adds r0, 0x84 - ldrb r0, [r0] - strb r0, [r2] - b _0803CD04 - .pool -_0803CCB4: - ldr r0, =gBankAttacker - strb r2, [r0] - ldr r7, =gBattlescriptCurrInstr - ldr r6, =gUnknown_02024220 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r6 - ldr r4, [r0] - str r4, [r7] - ldr r3, =gBattleExecBuffer - ldr r1, =gBitTable - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - bne _0803CCFA - ldr r0, =gBattleScriptingCommandsTable - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 -_0803CCFA: - ldrb r0, [r5] - lsls r0, 2 - adds r0, r6 - ldr r1, [r7] - str r1, [r0] -_0803CD04: - ldr r0, =gActiveBank - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, =gNoOfAllBanks - lsls r1, 24 - lsrs r1, 24 -_0803CD12: - adds r5, r0, 0 - ldrb r0, [r5] - cmp r1, r0 - bcs _0803CD1E - bl _0803BE9C -_0803CD1E: - ldr r0, =gBattleCommunication - ldrb r0, [r0, 0x4] - ldrb r1, [r5] - cmp r0, r1 - bne _0803CD70 - movs r0, 0x1 - bl sub_818603C - ldr r1, =gBattleMainFunc - ldr r0, =sub_803D2E8 - str r0, [r1] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0803CD70 - movs r4, 0 - ldrb r5, [r5] - cmp r4, r5 - bge _0803CD70 -_0803CD4A: - ldr r0, =gUnknown_0202421C - adds r0, r4, r0 - ldrb r0, [r0] - cmp r0, 0x2 - bne _0803CD66 - lsls r0, r4, 24 - lsrs r0, 24 - ldr r1, =gBattleStruct - ldr r1, [r1] - adds r1, r4, r1 - adds r1, 0x5C - ldrb r1, [r1] - bl sub_80571DC -_0803CD66: - adds r4, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _0803CD4A -_0803CD70: - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803BE74 - - thumb_func_start sub_803CDB8 -sub_803CDB8: @ 803CDB8 - push {r4,r5,lr} - movs r3, 0 - movs r1, 0 - ldr r0, =gNoOfAllBanks - ldrb r2, [r0] - adds r5, r0, 0 - cmp r3, r2 - bge _0803CDDA - ldr r4, =gBattleCommunication -_0803CDCA: - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x5 - bne _0803CDD4 - adds r3, 0x1 -_0803CDD4: - adds r1, 0x1 - cmp r1, r2 - blt _0803CDCA -_0803CDDA: - adds r0, r3, 0x1 - ldrb r5, [r5] - cmp r0, r5 - beq _0803CDF0 - movs r0, 0 - b _0803CDF2 - .pool -_0803CDF0: - movs r0, 0x1 -_0803CDF2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_803CDB8 - - thumb_func_start sub_803CDF8 -sub_803CDF8: @ 803CDF8 - push {r4-r7,lr} - ldr r7, =gActiveBank - ldrb r0, [r7] - ldr r6, =gBattleStruct - ldr r1, [r6] - adds r1, r0, r1 - adds r1, 0x5C - ldr r4, =gBattleBufferB - lsls r0, 9 - adds r2, r4, 0x1 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - lsls r1, r0, 9 - adds r1, r2 - ldrb r1, [r1] - bl sub_8184FBC - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _0803CEC6 - ldrb r0, [r7] - ldr r2, [r6] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r2, [r1] - movs r0, 0xF - ands r0, r2 - strb r0, [r1] - ldrb r0, [r7] - ldr r2, [r6] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - lsls r0, 9 - adds r5, r4, 0x2 - adds r0, r5 - ldrb r2, [r0] - movs r3, 0xF0 - adds r0, r3, 0 - ands r0, r2 - ldrb r2, [r1] - orrs r0, r2 - strb r0, [r1] - ldrb r1, [r7] - ldr r2, [r6] - lsls r0, r1, 1 - adds r0, r1 - adds r0, r2 - adds r0, 0x61 - lsls r1, 9 - adds r4, 0x3 - mov r12, r4 - add r1, r12 - ldrb r1, [r1] - strb r1, [r0] - ldrb r0, [r7] - movs r4, 0x2 - eors r0, r4 - ldr r2, [r6] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r2, [r1] - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - ldrb r0, [r7] - eors r0, r4 - ldr r2, [r6] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r0, [r7] - lsls r0, 9 - adds r0, r5 - ldrb r0, [r0] - ands r3, r0 - lsrs r3, 4 - ldrb r0, [r1] - orrs r3, r0 - strb r3, [r1] - ldrb r0, [r7] - eors r4, r0 - ldr r0, [r6] - lsls r1, r4, 1 - adds r1, r4 - adds r1, r0 - adds r1, 0x62 - ldrb r0, [r7] - lsls r0, 9 - add r0, r12 - ldrb r0, [r0] - strb r0, [r1] -_0803CEC6: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803CDF8 - - thumb_func_start sub_803CEDC -sub_803CEDC: @ 803CEDC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_0202407A - adds r4, r0, r2 - ldrb r5, [r4] - adds r2, r1, r2 - ldrb r3, [r2] - strb r3, [r4] - strb r5, [r2] - ldr r2, =gTurnOrder - adds r0, r2 - ldrb r5, [r0] - adds r1, r2 - ldrb r2, [r1] - strb r2, [r0] - strb r5, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803CEDC - - thumb_func_start b_first_side -b_first_side: @ 803CF10 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - bne _0803CFD8 - ldr r1, [sp, 0x8] - str r1, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - bne _0803CFD8 - ldr r1, =gBattleMons - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r0, r1 - adds r0, 0x20 - ldrb r3, [r0] - cmp r3, 0x21 - bne _0803CF7C - ldr r0, =gBattleWeather - ldrh r1, [r0] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0803CF8C -_0803CF7C: - cmp r3, 0x22 - bne _0803CF98 - ldr r0, =gBattleWeather - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _0803CF98 -_0803CF8C: - movs r3, 0x2 - b _0803CF9A - .pool -_0803CF98: - movs r3, 0x1 -_0803CF9A: - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - ldr r2, =gBattleMons - adds r0, r2 - adds r0, 0x20 - ldrb r2, [r0] - cmp r2, 0x21 - bne _0803CFBA - ldr r0, =gBattleWeather - ldrh r1, [r0] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0803CFCA -_0803CFBA: - cmp r2, 0x22 - bne _0803CFDA - ldr r0, =gBattleWeather - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _0803CFDA -_0803CFCA: - movs r7, 0x2 - b _0803CFDC - .pool -_0803CFD8: - movs r3, 0x1 -_0803CFDA: - movs r7, 0x1 -_0803CFDC: - ldr r1, =gBattleMons - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r4, r0, r1 - ldrh r0, [r4, 0x6] - muls r3, r0 - ldr r2, =gUnknown_08329D2E - movs r1, 0x1B - ldrsb r1, [r4, r1] - lsls r1, 1 - adds r0, r1, r2 - ldrb r0, [r0] - muls r0, r3 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - bl __divsi3 - mov r8, r0 - ldrh r0, [r4, 0x2E] - cmp r0, 0xAF - bne _0803D02C - ldr r1, =gEnigmaBerries - mov r3, r9 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r6, [r0, 0x7] - ldrb r5, [r0, 0x1A] - b _0803D040 - .pool -_0803D02C: - ldrh r0, [r4, 0x2E] - bl ItemId_GetHoldEffect - lsls r0, 24 - lsrs r6, r0, 24 - ldrh r0, [r4, 0x2E] - bl ItemId_GetHoldEffectParam - lsls r0, 24 - lsrs r5, r0, 24 -_0803D040: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x023f0102 - ands r0, r1 - cmp r0, 0 - bne _0803D074 - ldr r0, =0x00000869 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0803D074 - mov r0, r9 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0803D074 - movs r0, 0x6E - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - movs r1, 0x64 - bl __udivsi3 - mov r8, r0 -_0803D074: - cmp r6, 0x18 - bne _0803D07E - mov r2, r8 - lsrs r2, 1 - mov r8, r2 -_0803D07E: - ldr r1, =gBattleMons - movs r0, 0x58 - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0803D09C - mov r0, r8 - lsrs r0, 2 - mov r8, r0 -_0803D09C: - cmp r6, 0x1A - bne _0803D0B8 - ldr r0, =gUnknown_02024330 - ldrh r4, [r0] - lsls r0, r5, 16 - subs r0, r5 - movs r1, 0x64 - bl __divsi3 - cmp r4, r0 - bge _0803D0B8 - movs r1, 0x1 - negs r1, r1 - mov r8, r1 -_0803D0B8: - ldr r1, =gBattleMons - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - adds r4, r0, r1 - ldrh r0, [r4, 0x6] - adds r3, r0, 0 - muls r3, r7 - ldr r2, =gUnknown_08329D2E - movs r1, 0x1B - ldrsb r1, [r4, r1] - lsls r1, 1 - adds r0, r1, r2 - ldrb r0, [r0] - muls r0, r3 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - bl __divsi3 - adds r7, r0, 0 - ldrh r0, [r4, 0x2E] - cmp r0, 0xAF - bne _0803D118 - ldr r1, =gEnigmaBerries - mov r3, r10 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r6, [r0, 0x7] - ldrb r5, [r0, 0x1A] - b _0803D12C - .pool -_0803D118: - ldrh r0, [r4, 0x2E] - bl ItemId_GetHoldEffect - lsls r0, 24 - lsrs r6, r0, 24 - ldrh r0, [r4, 0x2E] - bl ItemId_GetHoldEffectParam - lsls r0, 24 - lsrs r5, r0, 24 -_0803D12C: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x023f0102 - ands r0, r1 - cmp r0, 0 - bne _0803D15C - ldr r0, =0x00000869 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0803D15C - mov r0, r10 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0803D15C - movs r0, 0x6E - muls r0, r7 - movs r1, 0x64 - bl __udivsi3 - adds r7, r0, 0 -_0803D15C: - cmp r6, 0x18 - bne _0803D162 - lsrs r7, 1 -_0803D162: - ldr r2, =gBattleMons - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0803D17E - lsrs r7, 2 -_0803D17E: - cmp r6, 0x1A - bne _0803D198 - ldr r0, =gUnknown_02024330 - ldrh r4, [r0] - lsls r0, r5, 16 - subs r0, r5 - movs r1, 0x64 - bl __divsi3 - cmp r4, r0 - bge _0803D198 - movs r7, 0x1 - negs r7, r7 -_0803D198: - ldr r2, [sp, 0x4] - cmp r2, 0 - beq _0803D1B8 - movs r3, 0 - b _0803D254 - .pool -_0803D1B8: - ldr r0, =gUnknown_0202421C - mov r3, r9 - adds r1, r3, r0 - ldrb r1, [r1] - adds r2, r0, 0 - cmp r1, 0 - bne _0803D208 - ldr r0, =gProtectStructs - lsls r1, r3, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - bge _0803D1E0 - movs r3, 0xA5 - b _0803D20A - .pool -_0803D1E0: - ldr r0, =gBattleStruct - ldr r0, [r0] - add r0, r9 - adds r0, 0x80 - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x58 - mov r3, r9 - muls r3, r1 - adds r1, r3, 0 - adds r0, r1 - ldr r1, =gBattleMons - adds r1, 0xC - adds r0, r1 - ldrh r3, [r0] - b _0803D20A - .pool -_0803D208: - movs r3, 0 -_0803D20A: - mov r1, r10 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _0803D254 - ldr r0, =gProtectStructs - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - bge _0803D22C - movs r2, 0xA5 - b _0803D256 - .pool -_0803D22C: - ldr r0, =gBattleStruct - ldr r0, [r0] - add r0, r10 - adds r0, 0x80 - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x58 - mov r2, r10 - muls r2, r1 - adds r1, r2, 0 - adds r0, r1 - ldr r1, =gBattleMons - adds r1, 0xC - adds r0, r1 - ldrh r2, [r0] - b _0803D256 - .pool -_0803D254: - movs r2, 0 -_0803D256: - ldr r4, =gBattleMoves - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r4 - movs r1, 0x7 - ldrsb r1, [r0, r1] - lsls r3, r2, 1 - cmp r1, 0 - bne _0803D27A - adds r0, r3, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x7] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _0803D2B8 -_0803D27A: - adds r0, r3, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x7] - lsls r0, 24 - asrs r0, 24 - cmp r1, r0 - bne _0803D2AE - cmp r8, r7 - bne _0803D2A4 - bl Random - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803D2A4 - movs r3, 0x2 - b _0803D2D4 - .pool -_0803D2A4: - cmp r8, r7 - bcs _0803D2D6 - movs r0, 0x1 - str r0, [sp, 0x8] - b _0803D2D6 -_0803D2AE: - cmp r1, r0 - bge _0803D2D6 - movs r1, 0x1 - str r1, [sp, 0x8] - b _0803D2D6 -_0803D2B8: - cmp r8, r7 - bne _0803D2CE - bl Random - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803D2CE - movs r2, 0x2 - str r2, [sp, 0x8] - b _0803D2D6 -_0803D2CE: - cmp r8, r7 - bcs _0803D2D6 - movs r3, 0x1 -_0803D2D4: - str r3, [sp, 0x8] -_0803D2D6: - ldr r0, [sp, 0x8] - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end b_first_side - - thumb_func_start sub_803D2E8 -sub_803D2E8: @ 803D2E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r3, 0 - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0803D354 - ldr r0, =gActiveBank - strb r3, [r0] - ldr r4, =gNoOfAllBanks - mov r8, r0 - ldrb r0, [r4] - cmp r3, r0 - bcc _0803D310 - b _0803D54A -_0803D310: - ldr r7, =gUnknown_0202407A - ldr r6, =gUnknown_0202421C - mov r2, r8 - ldr r5, =gTurnOrder -_0803D318: - adds r1, r3, r7 - ldrb r0, [r2] - adds r0, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r3, r5 - ldrb r0, [r2] - strb r0, [r1] - adds r3, 0x1 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r4] - cmp r0, r1 - bcc _0803D318 - b _0803D54A - .pool -_0803D354: - movs r2, 0x2 - ands r1, r2 - cmp r1, 0 - beq _0803D3A4 - ldr r0, =gActiveBank - strb r3, [r0] - ldr r1, =gNoOfAllBanks - mov r8, r0 - adds r2, r1, 0 - ldrb r2, [r2] - cmp r3, r2 - bcs _0803D3C0 - ldr r0, =gUnknown_0202421C - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x3 - beq _0803D3BE -_0803D376: - mov r7, r8 - ldrb r0, [r7] - adds r0, 0x1 - strb r0, [r7] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gNoOfAllBanks - ldrb r1, [r1] - cmp r0, r1 - bcs _0803D3C0 - ldrb r0, [r7] - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0803D376 - b _0803D3BE - .pool -_0803D3A4: - ldr r1, =gUnknown_0202421C - ldrb r0, [r1] - ldr r4, =gActiveBank - mov r8, r4 - cmp r0, 0x3 - bne _0803D3B4 - strb r3, [r4] - movs r3, 0x5 -_0803D3B4: - ldrb r0, [r1, 0x2] - cmp r0, 0x3 - bne _0803D3C0 - mov r7, r8 - strb r2, [r7] -_0803D3BE: - movs r3, 0x5 -_0803D3C0: - cmp r3, 0x5 - bne _0803D448 - ldr r6, =gUnknown_0202407A - ldr r1, =gUnknown_0202421C - mov r2, r8 - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r6] - ldr r2, =gTurnOrder - mov r3, r8 - ldrb r0, [r3] - strb r0, [r2] - movs r3, 0x1 - movs r5, 0 - adds r4, r1, 0 - ldr r7, =gBattleMainFunc - mov r10, r7 - ldr r0, =bc_80154A0 - mov r12, r0 - ldr r1, =gBattleStruct - mov r9, r1 - ldr r7, =gNoOfAllBanks - ldrb r7, [r7] - cmp r5, r7 - bge _0803D41A - adds r7, r6, 0 - adds r6, r4, 0 - adds r4, r2, 0 - ldr r2, =gNoOfAllBanks -_0803D3FC: - mov r0, r8 - ldrb r0, [r0] - cmp r5, r0 - beq _0803D412 - adds r1, r3, r7 - adds r0, r5, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, r4 - strb r5, [r0] - adds r3, 0x1 -_0803D412: - adds r5, 0x1 - ldrb r1, [r2] - cmp r5, r1 - blt _0803D3FC -_0803D41A: - mov r2, r12 - mov r3, r10 - str r2, [r3] - mov r4, r9 - ldr r0, [r4] - b _0803D554 - .pool -_0803D448: - movs r0, 0 - mov r7, r8 - strb r0, [r7] - ldr r1, =gNoOfAllBanks - ldrb r0, [r1] - cmp r0, 0 - beq _0803D48E - ldr r6, =gUnknown_0202421C - mov r2, r8 - ldr r5, =gUnknown_0202407A - ldr r4, =gTurnOrder -_0803D45E: - ldrb r0, [r2] - adds r0, r6 - ldrb r1, [r0] - subs r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0803D47C - adds r0, r3, r5 - strb r1, [r0] - adds r1, r3, r4 - mov r7, r8 - ldrb r0, [r7] - strb r0, [r1] - adds r3, 0x1 -_0803D47C: - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gNoOfAllBanks - ldrb r1, [r1] - cmp r0, r1 - bcc _0803D45E -_0803D48E: - movs r0, 0 - mov r2, r8 - strb r0, [r2] - ldr r4, =gNoOfAllBanks - ldrb r0, [r4] - cmp r0, 0 - beq _0803D4D2 - ldr r6, =gUnknown_0202421C - ldr r5, =gUnknown_0202407A - ldr r4, =gTurnOrder -_0803D4A2: - ldrb r0, [r2] - adds r0, r6 - ldrb r1, [r0] - subs r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _0803D4C0 - adds r0, r3, r5 - strb r1, [r0] - adds r1, r3, r4 - mov r7, r8 - ldrb r0, [r7] - strb r0, [r1] - adds r3, 0x1 -_0803D4C0: - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gNoOfAllBanks - ldrb r1, [r1] - cmp r0, r1 - bcc _0803D4A2 -_0803D4D2: - movs r5, 0 - b _0803D540 - .pool -_0803D4E8: - adds r4, r5, 0x1 - adds r7, r4, 0 - ldrb r1, [r1] - cmp r7, r1 - bge _0803D53E - ldr r6, =gUnknown_0202407A - lsls r2, r5, 24 - mov r8, r2 -_0803D4F8: - ldr r0, =gTurnOrder - adds r1, r5, r0 - ldrb r3, [r1] - adds r0, r4, r0 - ldrb r1, [r0] - adds r0, r5, r6 - ldrb r2, [r0] - cmp r2, 0x1 - beq _0803D534 - adds r0, r4, r6 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0803D534 - cmp r2, 0x2 - beq _0803D534 - cmp r0, 0x2 - beq _0803D534 - adds r0, r3, 0 - movs r2, 0 - bl b_first_side - lsls r0, 24 - cmp r0, 0 - beq _0803D534 - lsls r1, r4, 24 - lsrs r1, 24 - mov r3, r8 - lsrs r0, r3, 24 - bl sub_803CEDC -_0803D534: - adds r4, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _0803D4F8 -_0803D53E: - adds r5, r7, 0 -_0803D540: - ldr r1, =gNoOfAllBanks - ldrb r0, [r1] - subs r0, 0x1 - cmp r5, r0 - blt _0803D4E8 -_0803D54A: - ldr r1, =gBattleMainFunc - ldr r0, =bc_80154A0 - str r0, [r1] - ldr r0, =gBattleStruct - ldr r0, [r0] -_0803D554: - adds r0, 0x48 - movs r1, 0 - strb r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803D2E8 - - thumb_func_start sub_803D580 -sub_803D580: @ 803D580 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r1, =gActiveBank - movs r0, 0 - strb r0, [r1] - ldr r0, =gNoOfAllBanks - ldrb r2, [r0] - adds r5, r1, 0 - cmp r2, 0 - beq _0803D678 - ldr r7, =gProtectStructs - adds r6, r5, 0 - ldr r0, =gUnknown_020240D4 - mov r12, r0 - ldr r1, =gDisableStructs - mov r8, r1 - mov r10, r8 -_0803D5AE: - mov r2, r9 - cmp r2, 0 - beq _0803D5EC - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - b _0803D648 - .pool -_0803D5EC: - ldrb r0, [r6] - lsls r0, 4 - adds r2, r0, r7 - movs r1, 0 - mov r4, r10 - movs r3, 0 -_0803D5F8: - adds r0, r2, r1 - strb r3, [r0] - adds r1, 0x1 - cmp r1, 0xF - bls _0803D5F8 - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1, 0x16] - cmp r0, 0 - beq _0803D616 - subs r0, 0x1 - strb r0, [r1, 0x16] -_0803D616: - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1, 0x19] - cmp r0, 0 - beq _0803D648 - subs r0, 0x1 - strb r0, [r1, 0x19] - ldrb r2, [r5] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x19] - cmp r0, 0 - bne _0803D648 - movs r0, 0x58 - muls r2, r0 - add r2, r12 - ldr r0, [r2] - ldr r1, =0xffbfffff - ands r0, r1 - str r0, [r2] -_0803D648: - ldrb r2, [r5] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0xA] - cmp r0, 0 - bne _0803D666 - movs r0, 0x58 - muls r2, r0 - add r2, r12 - ldr r0, [r2] - ldr r1, =0xfeffffff - ands r0, r1 - str r0, [r2] -_0803D666: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gNoOfAllBanks - ldrb r1, [r1] - cmp r0, r1 - bcc _0803D5AE -_0803D678: - movs r0, 0 - ldr r2, =gSideTimers - strb r0, [r2, 0x8] - strb r0, [r2, 0x14] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803D580 - - thumb_func_start sub_803D6A0 -sub_803D6A0: @ 803D6A0 - push {r4-r6,lr} - ldr r2, =gActiveBank - movs r0, 0 - strb r0, [r2] - ldr r0, =gNoOfAllBanks - ldrb r1, [r0] - adds r6, r0, 0 - cmp r1, 0 - beq _0803D6DE - adds r3, r2, 0 - movs r4, 0 - ldr r5, =gSpecialStatuses -_0803D6B8: - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r5 - movs r1, 0 -_0803D6C4: - adds r0, r2, r1 - strb r4, [r0] - adds r1, 0x1 - cmp r1, 0x13 - bls _0803D6C4 - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r6] - cmp r0, r1 - bcc _0803D6B8 -_0803D6DE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803D6A0 - - thumb_func_start bc_80154A0 -bc_80154A0: @ 803D6F0 - push {r4-r7,lr} - ldr r0, =gHitMarker - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - bne _0803D7AE - ldr r2, =gBattleStruct - ldr r0, [r2] - adds r0, 0x48 - ldr r1, =gNoOfAllBanks - ldrb r0, [r0] - mov r12, r2 - adds r6, r1, 0 - ldrb r1, [r6] - cmp r0, r1 - bcs _0803D7AE - ldr r5, =gActiveBank - ldr r4, =gBankAttacker - movs r7, 0x84 - lsls r7, 1 -_0803D71C: - ldr r1, [r2] - adds r1, 0x48 - ldrb r0, [r1] - strb r0, [r4] - strb r0, [r5] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =gUnknown_02024274 - ldrb r3, [r5] - lsls r0, r3, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - bne _0803D7A0 - ldr r1, =gBattleMons - movs r0, 0x58 - muls r0, r3 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0803D7A0 - ldr r2, =gDisableStructs - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x18] - lsls r0, 31 - cmp r0, 0 - bne _0803D7A0 - ldr r0, =gProtectStructs - lsls r1, r3, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - blt _0803D7A0 - ldr r0, =gUnknown_082DB1FF - bl b_call_bc_move_exec - b _0803D7E8 - .pool -_0803D7A0: - mov r2, r12 - ldr r0, [r2] - adds r0, 0x48 - ldrb r0, [r0] - ldrb r1, [r6] - cmp r0, r1 - bcc _0803D71C -_0803D7AE: - bl b_clear_atk_up_if_hit_flag_unless_enraged - ldr r1, =gUnknown_02024082 - movs r0, 0 - strb r0, [r1] - ldr r1, =gFightStateTracker - ldr r0, =gUnknown_0202407A - movs r3, 0 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =gUnknown_02024400 - movs r2, 0 - strh r3, [r0] - ldr r0, =gBattleStruct - ldr r0, [r0] - strb r2, [r0, 0x13] - ldr r1, =gBattleMainFunc - ldr r0, =bc_bs_exec - str r0, [r1] - ldr r0, =gBattleCommunication - strb r2, [r0, 0x3] - strb r2, [r0, 0x4] - ldr r0, =gBattleScripting - strb r2, [r0, 0x16] - ldr r0, =gBattleResources - ldr r0, [r0] - ldr r0, [r0, 0x8] - adds r0, 0x20 - strb r2, [r0] -_0803D7E8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bc_80154A0 - - thumb_func_start bc_bs_exec -bc_bs_exec: @ 803D818 - push {r4-r6,lr} - ldr r6, =gBattleOutcome - ldrb r0, [r6] - ldr r2, =gFightStateTracker - cmp r0, 0 - beq _0803D828 - movs r0, 0xC - strb r0, [r2] -_0803D828: - ldr r5, =gBattleStruct - ldr r0, [r5] - adds r0, 0x4B - ldr r4, =gUnknown_02024082 - ldrb r1, [r4] - strb r1, [r0] - ldr r1, =gUnknown_0831BC0C - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =gNoOfAllBanks - ldrb r1, [r4] - ldrb r0, [r0] - cmp r1, r0 - bcc _0803D894 - ldr r2, =gHitMarker - ldr r0, [r2] - ldr r1, =0xffefffff - ands r0, r1 - str r0, [r2] - ldr r3, =gBattleMainFunc - ldr r2, =gUnknown_0831BC44 - ldrb r1, [r6] - movs r0, 0x7F - ands r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - str r0, [r3] - b _0803D8AC - .pool -_0803D894: - ldr r0, [r5] - adds r0, 0x4B - ldrb r0, [r0] - cmp r0, r1 - beq _0803D8AC - ldr r2, =gHitMarker - ldr r0, [r2] - ldr r1, =0xfffffdff - ands r0, r1 - ldr r1, =0xfff7ffff - ands r0, r1 - str r0, [r2] -_0803D8AC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bc_bs_exec - - thumb_func_start sub_803D8C0 -sub_803D8C0: @ 803D8C0 - push {r4,lr} - ldr r1, =gFightStateTracker - movs r0, 0 - strb r0, [r1] - ldr r1, =gBattleTypeFlags - ldr r2, [r1] - ldr r0, =0x02000002 - ands r0, r2 - cmp r0, 0 - beq _0803D920 - ldr r1, =gScriptResult - ldr r4, =gBattleOutcome - ldrb r0, [r4] - strh r0, [r1] - ldr r1, =gBattleTextBuff1 - ldrb r0, [r4] - strb r0, [r1] - movs r0, 0 - bl GetBankByPlayerAI - ldr r1, =gBankAttacker - strb r0, [r1] - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DAA35 - str r0, [r1] - ldrb r1, [r4] - movs r0, 0x7F - ands r0, r1 - strb r0, [r4] - b _0803DAA4 - .pool -_0803D920: - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0803D95C - ldr r0, =0x043f0900 - ands r2, r0 - cmp r2, 0 - beq _0803D95C - bl sub_805EA60 - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DAA87 - str r0, [r1] - ldr r0, =gUnknown_02038BCA - ldrh r1, [r0] - ldr r0, =0x000003fe - cmp r1, r0 - bne _0803D946 - b _0803DA8A -_0803D946: - b _0803DA94 - .pool -_0803D95C: - ldr r0, [r1] - movs r1, 0xA - ands r0, r1 - cmp r0, 0x8 - beq _0803D968 - b _0803DA9E -_0803D968: - bl sub_805EA60 - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DA92D - str r0, [r1] - ldr r2, =gTrainers - ldr r0, =gUnknown_02038BCA - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - subs r0, 0x3 - cmp r0, 0x32 - bls _0803D98A - b _0803DA94 -_0803D98A: - lsls r0, 2 - ldr r1, =_0803D9A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803D9A8: - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA74 - .4byte _0803DA8A - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA74 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA80 -_0803DA74: - ldr r0, =0x00000163 - bl PlayBGM - b _0803DAA4 - .pool -_0803DA80: - movs r0, 0xD4 - lsls r0, 1 - bl PlayBGM - b _0803DAA4 -_0803DA8A: - movs r0, 0xB1 - lsls r0, 1 - bl PlayBGM - b _0803DAA4 -_0803DA94: - movs r0, 0xCE - lsls r0, 1 - bl PlayBGM - b _0803DAA4 -_0803DA9E: - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DA96A - str r0, [r1] -_0803DAA4: - ldr r1, =gBattleMainFunc - ldr r0, =sub_803DCD8 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803D8C0 - - thumb_func_start sub_803DAC0 -sub_803DAC0: @ 803DAC0 - push {r4,lr} - ldr r1, =gFightStateTracker - movs r0, 0 - strb r0, [r1] - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - ldr r0, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0803DB7C - ldr r0, =0x003f0100 - ands r1, r0 - cmp r1, 0 - beq _0803DB44 - ldr r3, =gBattleOutcome - ldrb r2, [r3] - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _0803DB2C - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB9C8 - str r0, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r3] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1] - b _0803DB82 - .pool -_0803DB2C: - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DAA0B - str r0, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r3] - b _0803DB82 - .pool -_0803DB44: - ldr r1, =gBattleTextBuff1 - ldr r4, =gBattleOutcome - ldrb r0, [r4] - strb r0, [r1] - movs r0, 0 - bl GetBankByPlayerAI - ldr r1, =gBankAttacker - strb r0, [r1] - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DAA35 - str r0, [r1] - ldrb r1, [r4] - movs r0, 0x7F - ands r0, r1 - strb r0, [r4] - b _0803DB82 - .pool -_0803DB7C: - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DA96D - str r0, [r1] -_0803DB82: - ldr r1, =gBattleMainFunc - ldr r0, =sub_803DCD8 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DAC0 - - thumb_func_start sub_803DBA0 -sub_803DBA0: @ 803DBA0 - push {lr} - ldr r1, =gFightStateTracker - movs r0, 0 - strb r0, [r1] - ldr r1, =gBattleTypeFlags - ldr r2, [r1] - ldr r0, =0x003f0100 - ands r0, r2 - cmp r0, 0 - beq _0803DBFC - movs r0, 0x8 - ands r2, r0 - cmp r2, 0 - beq _0803DBFC - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB9C1 - str r0, [r1] - ldr r1, =gBattleOutcome - movs r0, 0x9 - strb r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1] - b _0803DC6A - .pool -_0803DBFC: - ldr r0, [r1] - movs r1, 0x80 - lsls r1, 19 - ands r0, r1 - cmp r0, 0 - beq _0803DC24 - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB9C1 - str r0, [r1] - ldr r1, =gBattleOutcome - movs r0, 0x9 - strb r0, [r1] - b _0803DC6A - .pool -_0803DC24: - ldr r1, =gProtectStructs - ldr r0, =gBankAttacker - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 27 - lsrs r0, 30 - cmp r0, 0x1 - beq _0803DC54 - cmp r0, 0x2 - beq _0803DC64 - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DAAF0 - b _0803DC68 - .pool -_0803DC54: - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DAADB - b _0803DC68 - .pool -_0803DC64: - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DAAE9 -_0803DC68: - str r0, [r1] -_0803DC6A: - ldr r1, =gBattleMainFunc - ldr r0, =sub_803DCD8 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DBA0 - - thumb_func_start bc_80158BC -bc_80158BC: @ 803DC84 - ldr r1, =gFightStateTracker - movs r0, 0 - strb r0, [r1] - ldr r1, =gBattleTextBuff1 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x7 - strb r0, [r1, 0x1] - ldr r2, =gBankAttacker - ldrb r0, [r2] - strb r0, [r1, 0x2] - ldr r3, =gBattlePartyID - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DAAF7 - str r0, [r1] - ldr r1, =gBattleMainFunc - ldr r0, =sub_803DCD8 - str r0, [r1] - bx lr - .pool - thumb_func_end bc_80158BC - - thumb_func_start sub_803DCD8 -sub_803DCD8: @ 803DCD8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gFightStateTracker - ldrb r0, [r0] - subs r0, 0xB - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _0803DCEE - b _0803DE10 -_0803DCEE: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - ldr r0, =0x023f0b92 - ands r1, r0 - cmp r1, 0 - bne _0803DDB6 - ldr r2, =gActiveBank - strb r1, [r2] - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r1, r0 - bcs _0803DDB2 - adds r5, r2, 0 - ldr r0, =gBattlePartyID - mov r8, r0 - movs r7, 0x64 - ldr r6, =gPlayerParty -_0803DD10: - ldrb r0, [r5] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0803DDA0 - ldr r4, =gUnknown_03005D10 - ldrh r0, [r4, 0x6] - cmp r0, 0 - bne _0803DD74 - ldrb r0, [r5] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r7 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r4, 0x6] - ldrb r0, [r5] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r7 - adds r0, r6 - movs r1, 0x2 - adds r2, r4, 0 - adds r2, 0x8 - bl GetMonData - b _0803DDA0 - .pool -_0803DD74: - ldrb r0, [r5] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r7 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r4, 0x26] - ldrb r0, [r5] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r7 - adds r0, r6 - movs r1, 0x2 - adds r2, r4, 0 - adds r2, 0x14 - bl GetMonData -_0803DDA0: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldr r1, =gNoOfAllBanks - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803DD10 -_0803DDB2: - bl sub_80EC728 -_0803DDB6: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x023f0b9a - ands r0, r1 - cmp r0, 0 - bne _0803DDD2 - ldr r0, =gUnknown_03005D10 - ldrb r1, [r0, 0x5] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0803DDD2 - bl sub_80EE184 -_0803DDD2: - bl sub_8186444 - movs r0, 0x3 - bl BeginFastPaletteFade - movs r0, 0x5 - bl FadeOutMapMusic - ldr r1, =gBattleMainFunc - ldr r0, =sub_803DE40 - str r0, [r1] - ldr r1, =gUnknown_030061E8 - ldr r0, =sub_8038420 - str r0, [r1] - b _0803DE2A - .pool -_0803DE10: - ldr r0, =gBattleExecBuffer - ldr r0, [r0] - cmp r0, 0 - bne _0803DE2A - ldr r1, =gBattleScriptingCommandsTable - ldr r0, =gBattlescriptCurrInstr - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 -_0803DE2A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DCD8 - - thumb_func_start sub_803DE40 -sub_803DE40: @ 803DE40 - push {lr} - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0803DE86 - bl ResetSpriteData - ldr r0, =gUnknown_03005D54 - ldrb r0, [r0] - cmp r0, 0 - beq _0803DE62 - ldr r0, =gBattleOutcome - ldrb r0, [r0] - cmp r0, 0x1 - beq _0803DE80 -_0803DE62: - ldr r1, =gBattleMainFunc - ldr r0, =c4_overworld - str r0, [r1] - b _0803DEA2 - .pool -_0803DE80: - ldr r1, =gBattleMainFunc - ldr r0, =bc_evolution_cutscene - str r0, [r1] -_0803DE86: - bl FreeAllWindowBuffers - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0803DEA2 - bl sub_805F094 - bl sub_8057028 - bl dp11_free -_0803DEA2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DE40 - - thumb_func_start bc_evolution_cutscene -bc_evolution_cutscene: @ 803DEB4 - push {r4-r6,lr} - ldr r0, =gUnknown_03005D54 - ldrb r1, [r0] - adds r3, r0, 0 - cmp r1, 0 - beq _0803DF2E -_0803DEC0: - movs r6, 0 -_0803DEC2: - ldrb r2, [r3] - ldr r0, =gBitTable - lsls r1, r6, 2 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _0803DF20 - bics r2, r1 - strb r2, [r3] - movs r0, 0x64 - adds r1, r6, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _0803DF20 - bl FreeAllWindowBuffers - ldr r0, =gBattleMainFunc - ldr r1, =sub_803DF48 - str r1, [r0] - lsls r3, r6, 24 - lsrs r3, 24 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl evolution_cutscene - b _0803DF34 - .pool -_0803DF20: - adds r6, 0x1 - ldr r3, =gUnknown_03005D54 - cmp r6, 0x5 - ble _0803DEC2 - ldrb r0, [r3] - cmp r0, 0 - bne _0803DEC0 -_0803DF2E: - ldr r1, =gBattleMainFunc - ldr r0, =c4_overworld - str r0, [r1] -_0803DF34: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bc_evolution_cutscene - - thumb_func_start sub_803DF48 -sub_803DF48: @ 803DF48 - push {lr} - ldr r0, =gMain - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _0803DF5A - ldr r1, =gBattleMainFunc - ldr r0, =bc_evolution_cutscene - str r0, [r1] -_0803DF5A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DF48 - - thumb_func_start c4_overworld -c4_overworld: @ 803DF70 - push {r4-r6,lr} - ldr r6, =gBattleTypeFlags - ldr r0, [r6] - movs r5, 0x2 - ands r0, r5 - cmp r0, 0 - bne _0803DF8C - ldr r4, =gPlayerParty - adds r0, r4, 0 - bl sub_806DCB4 - adds r0, r4, 0 - bl sub_806DEC4 -_0803DF8C: - ldr r4, [r6] - adds r0, r4, 0 - ands r0, r5 - cmp r0, 0 - beq _0803DF9E - ldr r0, =gUnknown_03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0803DFEC -_0803DF9E: - ldr r1, =gScriptResult - ldr r5, =gBattleOutcome - ldrb r0, [r5] - strh r0, [r1] - ldr r3, =gMain - ldr r0, =0x00000439 - adds r2, r3, r0 - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =gUnknown_03005D00 - ldr r0, [r0] - str r0, [r3] - movs r0, 0x80 - lsls r0, 3 - ands r4, r0 - cmp r4, 0 - beq _0803DFDE - ldr r0, =gEnemyParty - bl sub_8161F18 - ldrb r1, [r5] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0803DFDA - cmp r1, 0x7 - bne _0803DFDE -_0803DFDA: - bl sub_8161F4C -_0803DFDE: - movs r0, 0x5A - bl m4aSongNumStop - ldr r0, =gMain - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_0803DFEC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end c4_overworld - - thumb_func_start bc_move_exec_returning -bc_move_exec_returning: @ 803E018 - push {lr} - ldr r0, =gFightStateTracker - ldrb r0, [r0] - subs r0, 0xB - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0803E060 - ldr r3, =gBattleResources - ldr r0, [r3] - ldr r0, [r0, 0xC] - adds r1, r0, 0 - adds r1, 0x20 - ldrb r0, [r1] - cmp r0, 0 - beq _0803E03C - subs r0, 0x1 - strb r0, [r1] -_0803E03C: - ldr r2, =gBattleMainFunc - ldr r0, [r3] - ldr r1, [r0, 0xC] - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r2] - b _0803E07A - .pool -_0803E060: - ldr r0, =gBattleExecBuffer - ldr r0, [r0] - cmp r0, 0 - bne _0803E07A - ldr r1, =gBattleScriptingCommandsTable - ldr r0, =gBattlescriptCurrInstr - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 -_0803E07A: - pop {r0} - bx r0 - .pool - thumb_func_end bc_move_exec_returning - - thumb_func_start sub_803E08C -sub_803E08C: @ 803E08C - push {lr} - ldr r0, =gBattleExecBuffer - ldr r0, [r0] - cmp r0, 0 - bne _0803E0A8 - ldr r1, =gBattleScriptingCommandsTable - ldr r0, =gBattlescriptCurrInstr - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 -_0803E0A8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803E08C - - thumb_func_start sub_803E0B8 -sub_803E0B8: @ 803E0B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0x4 - str r0, [sp] - ldr r6, =gBankAttacker - ldr r1, =gTurnOrder - ldr r0, =gUnknown_02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r6] - ldr r1, =gBattleStruct - ldr r3, [r1] - adds r0, r3, 0 - adds r0, 0x91 - ldrb r2, [r0] - ldr r1, =gBitTable - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ands r2, r0 - cmp r2, 0 - beq _0803E110 - ldr r1, =gFightStateTracker - movs r0, 0xC - b _0803E83C - .pool -_0803E110: - ldr r1, =gCritMultiplier - movs r0, 0x1 - strb r0, [r1] - ldr r1, =gBattleScripting - movs r0, 0x1 - strb r0, [r1, 0xE] - ldr r5, =0x000001a3 - adds r0, r3, r5 - strb r2, [r0] - ldr r0, =gBattleMoveFlags - strb r2, [r0] - ldr r0, =gUnknown_02024212 - strb r2, [r0] - ldr r0, =gBattleCommunication - strb r2, [r0, 0x6] - ldr r2, =gCurrMovePos - ldr r0, =gUnknown_020241E9 - mov r9, r0 - ldrb r0, [r6] - ldr r3, =gBattleStruct - ldr r1, [r3] - adds r0, r1 - adds r0, 0x80 - ldrb r0, [r0] - mov r5, r9 - strb r0, [r5] - strb r0, [r2] - ldr r1, =gProtectStructs - ldrb r4, [r6] - lsls r0, r4, 4 - adds r3, r0, r1 - ldrb r1, [r3] - lsls r0, r1, 29 - mov r8, r2 - cmp r0, 0 - bge _0803E1BC - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldr r2, =gCurrentMove - ldr r1, =gUnknown_020241EC - movs r0, 0xA5 - strh r0, [r1] - strh r0, [r2] - ldr r2, =gHitMarker - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 4 - orrs r0, r1 - str r0, [r2] - movs r0, 0xA5 - movs r1, 0 - bl GetMoveTarget - ldrb r1, [r6] - ldr r3, =gBattleStruct - ldr r2, [r3] - b _0803E316 - .pool -_0803E1BC: - ldr r5, =gBattleMons - mov r10, r5 - movs r0, 0x58 - adds r5, r4, 0 - muls r5, r0 - mov r0, r10 - adds r0, 0x50 - adds r0, r5, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - bne _0803E1E2 - movs r7, 0x80 - lsls r7, 15 - ands r7, r1 - cmp r7, 0 - beq _0803E204 -_0803E1E2: - ldr r3, =gCurrentMove - ldr r2, =gUnknown_020241EC - ldr r1, =gUnknown_02024268 - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - strh r0, [r3] - b _0803E33C - .pool -_0803E204: - ldr r1, =gDisableStructs - mov r12, r1 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - add r0, r12 - ldrh r3, [r0, 0x6] - adds r1, r3, 0 - cmp r1, 0 - beq _0803E2DC - ldrb r2, [r0, 0xC] - lsls r0, r2, 1 - adds r0, r5 - mov r4, r10 - adds r4, 0xC - adds r0, r4 - ldrh r0, [r0] - cmp r1, r0 - bne _0803E268 - ldr r2, =gCurrentMove - ldr r0, =gUnknown_020241EC - strh r3, [r0] - strh r3, [r2] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r0, [r0, 0xC] - mov r3, r9 - strb r0, [r3] - mov r5, r8 - strb r0, [r5] - ldrh r0, [r2] - movs r1, 0 - bl GetMoveTarget - ldrb r1, [r6] - ldr r3, =gBattleStruct - ldr r2, [r3] - b _0803E316 - .pool -_0803E268: - cmp r1, 0 - beq _0803E2DC - cmp r1, r0 - beq _0803E2DC - mov r5, r9 - strb r2, [r5] - mov r0, r8 - strb r2, [r0] - ldr r3, =gCurrentMove - ldr r2, =gUnknown_020241EC - ldrb r0, [r0] - lsls r0, 1 - ldrb r1, [r6] - movs r5, 0x58 - muls r1, r5 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r2] - strh r0, [r3] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - movs r2, 0 - strh r7, [r0, 0x6] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - strb r2, [r0, 0xC] - ldrb r0, [r6] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r12 - ldrb r2, [r1, 0xE] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0xE] - ldrh r0, [r3] - movs r1, 0 - bl GetMoveTarget - ldrb r1, [r6] - ldr r3, =gBattleStruct - ldr r2, [r3] - b _0803E316 - .pool -_0803E2DC: - ldr r3, =gBattleMons - mov r5, r8 - ldrb r0, [r5] - lsls r0, 1 - ldr r4, =gBankAttacker - ldrb r2, [r4] - movs r1, 0x58 - muls r1, r2 - adds r0, r1 - adds r3, 0xC - adds r0, r3 - ldr r1, =gUnknown_02024274 - lsls r2, 1 - adds r2, r1 - ldrh r3, [r0] - ldrh r2, [r2] - cmp r3, r2 - beq _0803E334 - ldr r1, =gCurrentMove - ldr r0, =gUnknown_020241EC - strh r3, [r0] - strh r3, [r1] - ldrh r0, [r1] - movs r1, 0 - bl GetMoveTarget - ldrb r1, [r4] - ldr r2, =gBattleStruct - ldr r2, [r2] -_0803E316: - adds r1, r2 - strb r0, [r1, 0xC] - b _0803E33C - .pool -_0803E334: - ldr r1, =gCurrentMove - ldr r0, =gUnknown_020241EC - strh r3, [r0] - strh r3, [r1] -_0803E33C: - ldr r2, =gBattleMons - ldr r1, =gBankAttacker - ldrb r3, [r1] - movs r0, 0x58 - muls r0, r3 - adds r0, r2 - ldrh r0, [r0, 0x28] - mov r8, r1 - cmp r0, 0 - beq _0803E384 - adds r0, r3, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0803E37C - ldr r0, =gUnknown_03005D10 - ldr r1, =gCurrentMove - ldrh r1, [r1] - strh r1, [r0, 0x22] - b _0803E384 - .pool -_0803E37C: - ldr r0, =gUnknown_03005D10 - ldr r1, =gCurrentMove - ldrh r1, [r1] - strh r1, [r0, 0x24] -_0803E384: - mov r1, r8 - ldrb r0, [r1] - bl GetBankSide - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gSideTimers - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r5, r0, r1 - ldrb r0, [r5, 0x8] - cmp r0, 0 - beq _0803E400 - ldr r2, =gBattleMoves - ldr r0, =gCurrentMove - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x6] - cmp r0, 0 - bne _0803E400 - mov r3, r8 - ldrb r0, [r3] - bl GetBankSide - adds r4, r0, 0 - ldrb r0, [r5, 0x9] - bl GetBankSide - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803E400 - ldr r1, =gBattleMons - ldrb r2, [r5, 0x9] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _0803E400 - ldr r0, =gBankTarget - strb r2, [r0] - b _0803E76A - .pool -_0803E400: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - ldr r5, =gBankAttacker - mov r8, r5 - cmp r0, 0 - bne _0803E412 - b _0803E6E0 -_0803E412: - ldr r1, =gSideTimers - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r5, [r0, 0x8] - cmp r5, 0 - beq _0803E424 - b _0803E630 -_0803E424: - ldr r2, =gBattleMoves - ldr r0, =gCurrentMove - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _0803E440 - ldrb r0, [r4, 0x6] - cmp r0, 0x10 - bne _0803E440 - b _0803E630 -_0803E440: - ldr r3, =gBattleMons - ldr r2, =gBankAttacker - ldrb r6, [r2] - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, r6, r0 - ldrb r1, [r0, 0xC] - movs r0, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - mov r8, r2 - cmp r0, 0x1F - bne _0803E460 - b _0803E630 -_0803E460: - ldrb r0, [r4, 0x2] - cmp r0, 0xD - beq _0803E468 - b _0803E630 -_0803E468: - adds r0, r6, 0 - bl GetBankSide - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gActiveBank - strb r5, [r1] - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r5, r0 - bcs _0803E4E0 - adds r4, r1, 0 -_0803E480: - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _0803E4CE - ldr r0, =gBankAttacker - ldrb r1, [r0] - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r1, r0 - ldrb r0, [r1, 0xC] - ldrb r1, [r4] - cmp r0, r1 - beq _0803E4CE - ldr r1, =gBattleMons - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1F - bne _0803E4CE - adds r0, r2, 0 - bl sub_8048728 - lsls r0, 24 - lsrs r0, 24 - ldr r3, [sp] - cmp r0, r3 - bcs _0803E4CE - ldrb r0, [r4] - bl sub_8048728 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] -_0803E4CE: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =gNoOfAllBanks - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803E480 -_0803E4E0: - ldr r5, [sp] - cmp r5, 0x4 - beq _0803E4E8 - b _0803E5E2 -_0803E4E8: - ldr r2, =gBattleMoves - ldr r0, =gUnknown_020241EC - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x6] - ands r5, r0 - cmp r5, 0 - beq _0803E568 - ldr r0, =gBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0803E548 - bl Random - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803E544 - movs r0, 0x1 - b _0803E55A - .pool -_0803E544: - movs r0, 0x3 - b _0803E55A -_0803E548: - bl Random - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803E558 - movs r0, 0 - b _0803E55A -_0803E558: - movs r0, 0x2 -_0803E55A: - bl GetBankByPlayerAI - ldr r1, =gBankTarget - strb r0, [r1] - b _0803E578 - .pool -_0803E568: - ldr r2, =gBankTarget - ldr r0, =gBankAttacker - ldrb r0, [r0] - ldr r1, =gBattleStruct - ldr r1, [r1] - adds r0, r1 - ldrb r0, [r0, 0xC] - strb r0, [r2] -_0803E578: - ldr r7, =gAbsentBankFlags - ldrb r0, [r7] - ldr r1, =gBitTable - mov r8, r1 - ldr r5, =gBankTarget - ldrb r1, [r5] - lsls r1, 2 - add r1, r8 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _0803E592 - b _0803E76A -_0803E592: - ldr r6, =gBankAttacker - ldrb r0, [r6] - bl GetBankSide - adds r4, r0, 0 - ldrb r0, [r5] - bl GetBankSide - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803E5C4 - ldrb r0, [r5] - b _0803E758 - .pool -_0803E5C4: - ldrb r0, [r6] - bl GetBankIdentity - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - strb r0, [r5] - ldrb r1, [r7] - ldrb r2, [r5] - lsls r0, r2, 2 - add r0, r8 - b _0803E74E -_0803E5E2: - ldr r4, =gActiveBank - ldr r0, =gTurnOrder - ldr r3, [sp] - adds r0, r3, r0 - ldrb r0, [r0] - strb r0, [r4] - ldrb r0, [r4] - ldr r2, =gBattleMons - movs r1, 0x58 - muls r1, r0 - adds r1, r2 - adds r1, 0x20 - ldrb r1, [r1] - bl RecordAbilityBattle - ldr r2, =gSpecialStatuses - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] - ldr r1, =gBankTarget - ldrb r0, [r4] - strb r0, [r1] - b _0803E76A - .pool -_0803E630: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r4, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0803E6E0 - ldr r2, =gBattleMoves - ldr r0, =gUnknown_020241EC - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x6] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0803E6E0 - mov r5, r8 - ldrb r0, [r5] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0803E684 - bl Random - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0 - beq _0803E680 - movs r0, 0x1 - b _0803E696 - .pool -_0803E680: - movs r0, 0x3 - b _0803E696 -_0803E684: - bl Random - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0 - beq _0803E694 - movs r0, 0 - b _0803E696 -_0803E694: - movs r0, 0x2 -_0803E696: - bl GetBankByPlayerAI - ldr r1, =gBankTarget - strb r0, [r1] - ldr r0, =gAbsentBankFlags - ldrb r1, [r0] - ldr r2, =gBitTable - ldr r5, =gBankTarget - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0803E76A - ldr r0, =gBankAttacker - ldrb r0, [r0] - bl GetBankSide - adds r4, r0, 0 - ldrb r0, [r5] - bl GetBankSide - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803E76A - ldrb r0, [r5] - b _0803E758 - .pool -_0803E6E0: - ldr r5, =gBankTarget - mov r2, r8 - ldrb r0, [r2] - ldr r1, =gBattleStruct - ldr r1, [r1] - adds r0, r1 - ldrb r0, [r0, 0xC] - strb r0, [r5] - ldr r6, =gAbsentBankFlags - ldrb r1, [r6] - ldr r7, =gBitTable - ldrb r0, [r5] - lsls r0, 2 - adds r0, r7 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0803E76A - ldrb r0, [r2] - bl GetBankSide - adds r4, r0, 0 - ldrb r0, [r5] - bl GetBankSide - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803E730 - ldrb r0, [r5] - b _0803E758 - .pool -_0803E730: - mov r1, r8 - ldrb r0, [r1] - bl GetBankIdentity - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - strb r0, [r5] - ldrb r1, [r6] - ldrb r2, [r5] - lsls r0, r2, 2 - adds r0, r7 -_0803E74E: - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0803E76A - adds r0, r2, 0 -_0803E758: - bl GetBankIdentity - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByPlayerAI - strb r0, [r5] -_0803E76A: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 10 - ands r1, r2 - adds r5, r0, 0 - cmp r1, 0 - beq _0803E808 - ldr r0, =gProtectStructs - ldr r4, =gBankAttacker - ldrb r2, [r4] - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - lsls r0, 27 - cmp r0, 0 - bge _0803E808 - ldr r1, =gBattleMons - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0803E7B4 - ldr r1, =gFightStateTracker - movs r0, 0xC - b _0803E83C - .pool -_0803E7B4: - ldr r3, =gUnknown_02024230 - lsls r0, r2, 2 - adds r0, r3 - ldr r0, [r0] - cmp r0, 0 - beq _0803E7EC - ldr r1, =gBattleCommunication - movs r2, 0 - movs r0, 0x4 - strb r0, [r1, 0x5] - ldr r1, =gBattlescriptCurrInstr - ldrb r0, [r4] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - str r0, [r1] - ldrb r0, [r4] - lsls r0, 2 - adds r0, r3 - str r2, [r0] - b _0803E824 - .pool -_0803E7EC: - ldr r1, =gBattleCommunication - movs r0, 0x4 - strb r0, [r1, 0x5] - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB6AD - str r0, [r1] - b _0803E824 - .pool -_0803E808: - ldr r4, =gBattlescriptCurrInstr - ldr r3, =gUnknown_082D86A8 - ldr r2, =gBattleMoves - ldr r0, =gCurrentMove - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - str r0, [r4] -_0803E824: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0803E838 - ldr r0, =gBankAttacker - ldrb r0, [r0] - bl sub_81A56E8 -_0803E838: - ldr r1, =gFightStateTracker - movs r0, 0xA -_0803E83C: - strb r0, [r1] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803E0B8 - - thumb_func_start bs2_8016374 -bs2_8016374: @ 803E868 - push {r4,lr} - ldr r3, =gBankAttacker - ldr r1, =gTurnOrder - ldr r0, =gUnknown_02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r3] - ldr r0, =gUnknown_02022E14 - movs r2, 0 - strh r2, [r0] - ldr r0, =gUnknown_02022E16 - strh r2, [r0] - ldr r1, =gUnknown_020244AC - ldrb r0, [r3] - adds r0, r1 - strb r2, [r0] - ldr r1, =gUnknown_020244B0 - ldrb r0, [r3] - adds r0, r1 - strb r2, [r0] - ldr r2, =gBattleTextBuff1 - movs r0, 0xFD - strb r0, [r2] - movs r0, 0x7 - strb r0, [r2, 0x1] - ldrb r4, [r3] - strb r4, [r2, 0x2] - ldrb r0, [r3] - ldr r1, =gBattleStruct - ldr r1, [r1] - adds r0, r1 - adds r0, 0x58 - ldrb r0, [r0] - strb r0, [r2, 0x3] - movs r0, 0xFF - strb r0, [r2, 0x4] - ldr r0, =gBattleScripting - strb r4, [r0, 0x17] - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DAB15 - str r0, [r1] - ldr r1, =gFightStateTracker - movs r0, 0xA - strb r0, [r1] - ldr r1, =gUnknown_03005D10 - ldrb r0, [r1, 0x2] - cmp r0, 0xFE - bhi _0803E8CE - adds r0, 0x1 - strb r0, [r1, 0x2] -_0803E8CE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bs2_8016374 - - thumb_func_start sub_803E90C -sub_803E90C: @ 803E90C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, =gBankAttacker - ldr r2, =gBankTarget - ldr r1, =gTurnOrder - ldr r0, =gUnknown_02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - strb r0, [r4] - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldrb r0, [r4] - bl sub_8045868 - ldr r5, =gUnknown_02024208 - ldr r2, =gBattleBufferB - ldrb r1, [r4] - lsls r1, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r3, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r0, [r1] - lsls r0, 8 - orrs r3, r0 - strh r3, [r5] - cmp r3, 0xC - bhi _0803E998 - ldr r2, =gBattlescriptCurrInstr - ldr r1, =gUnknown_082DBD08 - ldrh r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - ldr r0, =gFightStateTracker - mov r10, r0 - b _0803EBF6 - .pool -_0803E998: - adds r0, r3, 0 - subs r0, 0x50 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _0803E9C0 - ldr r0, =gBattlescriptCurrInstr - ldr r1, =gUnknown_082DBD54 - ldr r1, [r1] - str r1, [r0] - ldr r1, =gFightStateTracker - mov r10, r1 - b _0803EBF6 - .pool -_0803E9C0: - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0803E9E8 - ldr r0, =gBattlescriptCurrInstr - ldr r1, =gUnknown_082DBD3C - ldr r1, [r1] - str r1, [r0] - ldr r2, =gFightStateTracker - mov r10, r2 - b _0803EBF6 - .pool -_0803E9E8: - ldr r3, =gBattleScripting - ldrb r0, [r4] - strb r0, [r3, 0x17] - lsls r0, 24 - lsrs r0, 25 - ldr r2, =gBattleStruct - ldr r1, [r2] - adds r0, r1 - adds r0, 0xC4 - ldrb r0, [r0] - subs r0, 0x1 - mov r8, r4 - ldr r1, =gBattlescriptCurrInstr - mov r9, r1 - ldr r6, =gUnknown_082DBD3C - mov r12, r3 - adds r7, r2, 0 - ldr r2, =gFightStateTracker - mov r10, r2 - cmp r0, 0x4 - bls _0803EA14 - b _0803EBDE -_0803EA14: - lsls r0, 2 - ldr r1, =_0803EA38 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803EA38: - .4byte _0803EBDE - .4byte _0803EBDE - .4byte _0803EA4C - .4byte _0803EAE0 - .4byte _0803EBB0 -_0803EA4C: - ldr r5, =gBattleCommunication - movs r0, 0 - strb r0, [r5, 0x5] - ldr r2, =gBankAttacker - ldrb r0, [r2] - lsrs r0, 1 - ldr r1, [r7] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - mov r8, r2 - cmp r0, 0 - beq _0803EA98 - movs r0, 0x3E - ands r0, r1 - ldr r1, =gBattlescriptCurrInstr - mov r9, r1 - ldr r6, =gUnknown_082DBD3C - ldr r2, =gFightStateTracker - mov r10, r2 - cmp r0, 0 - bne _0803EA7E - b _0803EBDE -_0803EA7E: - movs r0, 0x5 - strb r0, [r5, 0x5] - b _0803EBDE - .pool -_0803EA98: - ldr r0, =gBattlescriptCurrInstr - mov r9, r0 - ldr r6, =gUnknown_082DBD3C - ldr r1, =gFightStateTracker - mov r10, r1 - mov r4, r8 - adds r3, r7, 0 - adds r2, r5, 0 -_0803EAA8: - ldrb r1, [r4] - lsrs r1, 1 - ldr r0, [r3] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - lsrs r0, 1 - strb r0, [r1] - ldrb r0, [r2, 0x5] - adds r0, 0x1 - strb r0, [r2, 0x5] - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0803EAA8 - b _0803EBDE - .pool -_0803EAE0: - ldr r3, =gBattleCommunication - movs r0, 0x4 - strb r0, [r3, 0x5] - ldr r2, =gBankAttacker - ldrb r0, [r2] - lsrs r0, 1 - ldr r1, [r7] - adds r0, r1 - adds r6, r0, 0 - adds r6, 0xC6 - ldrb r1, [r6] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r8, r2 - cmp r5, 0 - beq _0803EB28 - movs r0, 0x5 - strb r0, [r3, 0x5] - ldr r2, =gBattlescriptCurrInstr - mov r9, r2 - ldr r6, =gUnknown_082DBD3C - ldr r0, =gFightStateTracker - mov r10, r0 - b _0803EBDE - .pool -_0803EB28: - ldr r3, =gBattleTextBuff1 - movs r4, 0xFD - strb r4, [r3] - movs r0, 0x5 - strb r0, [r3, 0x1] - movs r2, 0x1 - strb r2, [r3, 0x2] - movs r0, 0xFF - strb r0, [r3, 0x3] - ldr r1, =gBattleTextBuff2 - strb r4, [r1] - strb r5, [r1, 0x1] - movs r0, 0xD2 - strb r0, [r1, 0x2] - strb r5, [r1, 0x3] - subs r0, 0xD3 - strb r0, [r1, 0x4] - ldrb r0, [r6] - ands r2, r0 - ldr r1, =gBattlescriptCurrInstr - mov r9, r1 - ldr r6, =gUnknown_082DBD3C - ldr r0, =gFightStateTracker - mov r10, r0 - cmp r2, 0 - bne _0803EB8C - mov r5, r8 - adds r4, r7, 0 - adds r2, r3, 0 -_0803EB62: - ldrb r1, [r5] - lsrs r1, 1 - ldr r0, [r4] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - lsrs r0, 1 - strb r0, [r1] - ldrb r0, [r2, 0x2] - adds r0, 0x1 - strb r0, [r2, 0x2] - ldrb r0, [r5] - lsrs r0, 1 - ldr r1, [r4] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0803EB62 -_0803EB8C: - ldrb r0, [r3, 0x2] - adds r0, 0xE - movs r1, 0 - mov r2, r12 - strb r0, [r2, 0x10] - strb r1, [r2, 0x11] - b _0803EBDE - .pool -_0803EBB0: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803EBCC - ldr r1, =gBattleCommunication - movs r0, 0x2 - strb r0, [r1, 0x5] - b _0803EBD0 - .pool -_0803EBCC: - ldr r0, =gBattleCommunication - strb r1, [r0, 0x5] -_0803EBD0: - ldr r0, =gBankAttacker - mov r8, r0 - ldr r1, =gBattlescriptCurrInstr - mov r9, r1 - ldr r6, =gUnknown_082DBD3C - ldr r2, =gFightStateTracker - mov r10, r2 -_0803EBDE: - mov r1, r8 - ldrb r0, [r1] - lsrs r0, 1 - ldr r1, [r7] - adds r0, r1 - adds r0, 0xC4 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - mov r2, r9 - str r0, [r2] -_0803EBF6: - movs r0, 0xA - mov r1, r10 - strb r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803E90C - - thumb_func_start sub_803EC20 -sub_803EC20: @ 803EC20 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0 - ldr r1, =gBattleMons - movs r0, 0x58 - muls r0, r5 - adds r1, r0, r1 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0803EC54 - ldr r1, =gEnigmaBerries - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x7] - b _0803EC5E - .pool -_0803EC54: - ldrh r0, [r1, 0x2E] - bl ItemId_GetHoldEffect - lsls r0, 24 - lsrs r1, r0, 24 -_0803EC5E: - ldr r0, =gUnknown_0202420F - strb r5, [r0] - cmp r1, 0x25 - bne _0803EC9C - ldr r2, =gUnknown_02024208 - ldr r1, =gBattleMons - movs r0, 0x58 - muls r0, r5 - adds r0, r1 - ldrh r0, [r0, 0x2E] - strh r0, [r2] - ldr r0, =gProtectStructs - lsls r2, r5, 4 - adds r2, r0 - ldrb r1, [r2, 0x1] - movs r0, 0x19 - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2, 0x1] - b _0803ED70 - .pool -_0803EC9C: - ldr r0, =gBattleMons - mov r10, r0 - movs r2, 0x58 - mov r9, r2 - mov r0, r9 - muls r0, r5 - add r0, r10 - mov r8, r0 - adds r0, 0x20 - ldrb r6, [r0] - cmp r6, 0x32 - bne _0803ED5C - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0803ED38 - ldr r4, =gBattleStruct - ldr r1, [r4] - adds r1, 0x6C - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_81A9E28 - lsls r0, 24 - lsrs r1, r0, 24 - mov r2, r8 - ldrh r0, [r2, 0x6] - muls r0, r1 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - mov r2, r9 - muls r2, r1 - adds r1, r2, 0 - add r1, r10 - ldrh r1, [r1, 0x6] - bl __divsi3 - ldr r1, [r4] - adds r1, 0x6C - ldrb r2, [r1] - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 1 - adds r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - bl Random - movs r1, 0xFF - ands r1, r0 - cmp r4, r1 - bhi _0803ED0C - b _0803EE12 -_0803ED0C: - ldr r0, =gLastUsedAbility - strb r6, [r0] - ldr r0, =gProtectStructs - lsls r2, r5, 4 - adds r2, r0 - ldrb r1, [r2, 0x1] - movs r0, 0x19 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0x1] - b _0803ED70 - .pool -_0803ED38: - ldr r0, =gLastUsedAbility - strb r6, [r0] - ldr r0, =gProtectStructs - lsls r2, r5, 4 - adds r2, r0 - ldrb r1, [r2, 0x1] - movs r0, 0x19 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0x1] - b _0803ED70 - .pool -_0803ED5C: - ldr r1, =gBattleTypeFlags - ldr r2, [r1] - ldr r0, =0x043f0100 - ands r0, r2 - cmp r0, 0 - beq _0803ED80 - movs r0, 0x8 - ands r2, r0 - cmp r2, 0 - beq _0803ED80 -_0803ED70: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - b _0803EE12 - .pool -_0803ED80: - ldr r0, [r1] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0803EE06 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0803EDBC - bl sub_81A9E28 - lsls r0, 24 - lsrs r1, r0, 24 - ldr r4, =gBattleMons - movs r3, 0x58 - adds r0, r5, 0 - muls r0, r3 - adds r0, r4 - ldrh r0, [r0, 0x6] - muls r0, r1 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - muls r1, r3 - adds r1, r4 - b _0803EDDA - .pool -_0803EDBC: - ldr r3, =gBattleMons - movs r2, 0x58 - adds r0, r5, 0 - muls r0, r2 - adds r4, r0, r3 - movs r1, 0x1 - adds r0, r5, 0 - eors r0, r1 - muls r0, r2 - adds r1, r0, r3 - ldrh r0, [r4, 0x6] - ldrh r2, [r1, 0x6] - cmp r0, r2 - bcs _0803EE00 - lsls r0, 7 -_0803EDDA: - ldrh r1, [r1, 0x6] - bl __divsi3 - ldr r1, =gBattleStruct - ldr r1, [r1] - adds r1, 0x6C - ldrb r2, [r1] - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 1 - adds r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - bl Random - movs r1, 0xFF - ands r1, r0 - cmp r4, r1 - bls _0803EE06 -_0803EE00: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_0803EE06: - ldr r0, =gBattleStruct - ldr r1, [r0] - adds r1, 0x6C - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0803EE12: - cmp r7, 0 - beq _0803EE24 - ldr r1, =gUnknown_02024082 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - strb r0, [r1] - ldr r1, =gBattleOutcome - movs r0, 0x4 - strb r0, [r1] -_0803EE24: - adds r0, r7, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_803EC20 - - thumb_func_start sub_803EE48 -sub_803EE48: @ 803EE48 - push {r4-r6,lr} - ldr r4, =gBankAttacker - ldr r1, =gTurnOrder - ldr r5, =gUnknown_02024082 - ldrb r0, [r5] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r4] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0803EF0C - ldr r0, =gNoOfAllBanks - ldrb r1, [r0] - strb r1, [r5] - ldr r2, =gActiveBank - movs r0, 0 - strb r0, [r2] - lsls r1, 24 - cmp r1, 0 - beq _0803EEE0 - adds r4, r2, 0 - ldr r6, =gUnknown_0202421C - ldr r5, =gBattleOutcome -_0803EE7C: - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0803EEBC - ldrb r0, [r4] - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0803EECE - ldrb r0, [r5] - movs r1, 0x2 - b _0803EECA - .pool -_0803EEBC: - ldrb r0, [r4] - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0803EECE - ldrb r0, [r5] - movs r1, 0x1 -_0803EECA: - orrs r0, r1 - strb r0, [r5] -_0803EECE: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =gNoOfAllBanks - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803EE7C -_0803EEE0: - ldr r2, =gBattleOutcome - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x8 - orrs r0, r2 - b _0803EF96 - .pool -_0803EF0C: - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0803EF4C - ldrb r0, [r4] - bl sub_803EC20 - lsls r0, 24 - cmp r0, 0 - bne _0803EF98 - ldrb r0, [r4] - bl sub_8045868 - ldr r1, =gBattleCommunication - movs r0, 0x3 - strb r0, [r1, 0x5] - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DAB02 - str r0, [r1] - ldr r1, =gFightStateTracker - movs r0, 0xA - b _0803EF96 - .pool -_0803EF4C: - ldr r1, =gBattleMons - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0400e000 - ands r0, r1 - cmp r0, 0 - beq _0803EF8C - ldr r1, =gBattleCommunication - movs r0, 0x4 - strb r0, [r1, 0x5] - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DAB02 - str r0, [r1] - ldr r1, =gFightStateTracker - movs r0, 0xA - b _0803EF96 - .pool -_0803EF8C: - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - strb r0, [r5] - ldr r1, =gBattleOutcome - movs r0, 0x6 -_0803EF96: - strb r0, [r1] -_0803EF98: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803EE48 - - thumb_func_start sub_803EFA8 -sub_803EFA8: @ 803EFA8 - ldr r2, =gBankAttacker - ldr r1, =gTurnOrder - ldr r0, =gUnknown_02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DBD58 - ldr r0, [r0] - str r0, [r1] - ldr r1, =gFightStateTracker - movs r0, 0xA - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_803EFA8 - - thumb_func_start bs5_8016AC0 -bs5_8016AC0: @ 803EFF0 - ldr r2, =gBankAttacker - ldr r1, =gTurnOrder - ldr r0, =gUnknown_02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r1, =gUnknown_0203A04C - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - ldr r1, =gUnknown_02024208 - movs r0, 0x5 - strh r0, [r1] - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DBD08 - ldr r0, [r0, 0x14] - str r0, [r1] - ldr r1, =gFightStateTracker - movs r0, 0xA - strb r0, [r1] - bx lr - .pool - thumb_func_end bs5_8016AC0 - - thumb_func_start sub_803F050 -sub_803F050: @ 803F050 - push {r4-r6,lr} - ldr r3, =gBankAttacker - ldr r1, =gTurnOrder - ldr r0, =gUnknown_02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r3] - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r6, =gBattleCommunication - ldr r2, =gBattleBufferB - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - subs r0, 0x1 - strb r0, [r6, 0x5] - ldr r1, =gUnknown_02024208 - ldrb r0, [r3] - lsls r0, 9 - adds r2, 0x2 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1] - ldr r1, =gUnknown_03005D10 - ldrb r0, [r1, 0x1F] - cmp r0, 0xFE - bhi _0803F096 - adds r0, 0x1 - strb r0, [r1, 0x1F] -_0803F096: - ldr r2, =gBattleStruct - ldr r0, [r2] - adds r1, r0, 0 - adds r1, 0x7A - ldrb r0, [r1] - cmp r0, 0x2 - bhi _0803F0A8 - adds r0, 0x1 - strb r0, [r1] -_0803F0A8: - ldr r0, [r2] - adds r3, r0, 0 - adds r3, 0x7B - ldrb r5, [r3] - adds r4, r5, 0 - cmp r4, 0x1 - bls _0803F100 - ldr r2, =gUnknown_0831BCE0 - adds r0, 0x7A - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - ldrb r6, [r6, 0x5] - adds r0, r6 - adds r0, r2 - ldrb r0, [r0] - cmp r4, r0 - bcs _0803F0FC - movs r0, 0x1 - b _0803F0FE - .pool -_0803F0FC: - subs r0, r5, r0 -_0803F0FE: - strb r0, [r3] -_0803F100: - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DBD58 - ldr r0, [r0, 0x8] - str r0, [r1] - ldr r1, =gFightStateTracker - movs r0, 0xA - strb r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F050 - - thumb_func_start sub_803F120 -sub_803F120: @ 803F120 - push {r4,lr} - ldr r2, =gBankAttacker - ldr r1, =gTurnOrder - ldr r0, =gUnknown_02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =gUnknown_02022E14 - movs r4, 0 - strh r4, [r0] - ldr r0, =gUnknown_02022E16 - strh r4, [r0] - ldr r3, =gBattleStruct - ldr r0, [r3] - adds r2, r0, 0 - adds r2, 0x7C - ldr r1, =gUnknown_0831BCEF - adds r0, 0x79 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - ldrb r1, [r2] - adds r0, r1 - strb r0, [r2] - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0x7C - ldrb r0, [r1] - cmp r0, 0x14 - bls _0803F162 - movs r0, 0x14 - strb r0, [r1] -_0803F162: - ldr r0, [r3] - adds r2, r0, 0 - adds r2, 0x7B - ldr r1, =gUnknown_0831BCF3 - adds r0, 0x79 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - ldrb r1, [r2] - adds r0, r1 - strb r0, [r2] - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0x7B - ldrb r0, [r1] - cmp r0, 0x14 - bls _0803F188 - movs r0, 0x14 - strb r0, [r1] -_0803F188: - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0x79 - ldrb r0, [r1] - cmp r0, 0x2 - bhi _0803F1C4 - adds r0, 0x1 - strb r0, [r1] - ldr r0, =gBattleCommunication - strb r4, [r0, 0x5] - b _0803F1CA - .pool -_0803F1C4: - ldr r1, =gBattleCommunication - movs r0, 0x1 - strb r0, [r1, 0x5] -_0803F1CA: - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DBD58 - ldr r0, [r0, 0x4] - str r0, [r1] - ldr r1, =gFightStateTracker - movs r0, 0xA - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F120 - - thumb_func_start bs8_exit_by_flight -bs8_exit_by_flight: @ 803F1F0 - push {r4,lr} - ldr r2, =gBankAttacker - ldr r1, =gTurnOrder - ldr r4, =gUnknown_02024082 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - movs r0, 0x11 - bl PlaySE - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - strb r0, [r4] - ldr r1, =gBattleOutcome - movs r0, 0x4 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bs8_exit_by_flight - - thumb_func_start bs9_8016C9C -bs9_8016C9C: @ 803F22C - ldr r3, =gBankAttacker - ldr r1, =gTurnOrder - ldr r0, =gUnknown_02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - strb r2, [r3] - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r1, =gBattleTextBuff1 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x7 - strb r0, [r1, 0x1] - strb r2, [r1, 0x2] - ldr r2, =gBattlePartyID - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DBD58 - ldr r0, [r0, 0xC] - str r0, [r1] - ldr r1, =gFightStateTracker - movs r0, 0xA - strb r0, [r1] - ldr r1, =gUnknown_0202407A - movs r0, 0xC - strb r0, [r1, 0x1] - bx lr - .pool - thumb_func_end bs9_8016C9C - - thumb_func_start bsB_exit_by_move -bsB_exit_by_move: @ 803F2A4 - push {lr} - bl sub_8041728 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0803F2C0 - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, 0x4D - strb r1, [r0] - ldr r1, =gFightStateTracker - movs r0, 0xC - strb r0, [r1] -_0803F2C0: - pop {r0} - bx r0 - .pool - thumb_func_end bsB_exit_by_move - - thumb_func_start bsD_proceed -bsD_proceed: @ 803F2CC - ldr r1, =gUnknown_02024082 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r3, =gFightStateTracker - ldr r2, =gUnknown_0202407A - ldrb r0, [r1] - adds r0, r2 - ldrb r0, [r0] - strb r0, [r3] - ldr r2, =gHitMarker - ldr r0, [r2] - ldr r1, =0xf1e892af - ands r0, r1 - str r0, [r2] - bx lr - .pool - thumb_func_end bsD_proceed - - thumb_func_start bsC_8016D70 -bsC_8016D70: @ 803F300 - push {r4-r6,lr} - ldr r1, =gTurnOrder - ldr r2, =gUnknown_02024082 - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - ldr r6, =gBattleStruct - ldr r1, [r6] - adds r0, r1 - adds r0, 0x5C - movs r1, 0x6 - strb r1, [r0] - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - ldr r3, =gFightStateTracker - ldr r1, =gUnknown_0202407A - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r3] - bl sub_803D6A0 - ldr r2, =gHitMarker - ldr r0, [r2] - ldr r1, =0xf1e892af - ands r0, r1 - str r0, [r2] - ldr r0, =gCurrentMove - movs r1, 0 - strh r1, [r0] - ldr r0, =gBattleMoveDamage - movs r4, 0 - str r4, [r0] - ldr r0, =gBattleMoveFlags - strb r1, [r0] - ldr r5, =gBattleScripting - strb r1, [r5, 0x18] - strb r1, [r5, 0x19] - ldr r2, =gUnknown_02024250 - ldr r3, =gBankAttacker - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - strh r4, [r0] - ldr r2, =gUnknown_02024258 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - strh r4, [r0] - ldr r0, [r6] - strb r1, [r0, 0x13] - ldr r0, =gUnknown_02024400 - strh r4, [r0] - strb r1, [r5, 0x14] - ldr r0, =gBattleCommunication - strb r1, [r0, 0x3] - strb r1, [r0, 0x4] - strb r1, [r5, 0x16] - ldr r0, =gBattleResources - ldr r0, [r0] - ldr r0, [r0, 0x8] - adds r0, 0x20 - strb r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bsC_8016D70 - - thumb_func_start get_battle_side_of_something -get_battle_side_of_something: @ 803F3CC - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0 - cmp r1, 0xE - bhi _0803F47A - lsls r0, r1, 2 - ldr r1, =_0803F3E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803F3E8: - .4byte _0803F424 - .4byte _0803F430 - .4byte _0803F43C - .4byte _0803F458 - .4byte _0803F464 - .4byte _0803F458 - .4byte _0803F464 - .4byte _0803F448 - .4byte _0803F464 - .4byte _0803F464 - .4byte _0803F44C - .4byte _0803F464 - .4byte _0803F468 - .4byte _0803F46C - .4byte _0803F470 -_0803F424: - ldr r0, =gBankTarget - ldrb r0, [r0] - b _0803F47A - .pool -_0803F430: - ldr r0, =gBankAttacker - ldrb r0, [r0] - b _0803F47A - .pool -_0803F43C: - ldr r0, =gUnknown_0202420E - ldrb r0, [r0] - b _0803F47A - .pool -_0803F448: - movs r0, 0 - b _0803F47A -_0803F44C: - ldr r0, =gBattleScripting - ldrb r0, [r0, 0x17] - b _0803F47A - .pool -_0803F458: - ldr r0, =gUnknown_0202420D - ldrb r0, [r0] - b _0803F47A - .pool -_0803F464: - movs r0, 0 - b _0803F472 -_0803F468: - movs r0, 0x1 - b _0803F472 -_0803F46C: - movs r0, 0x2 - b _0803F472 -_0803F470: - movs r0, 0x3 -_0803F472: - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r0, 24 -_0803F47A: - pop {r1} - bx r1 - thumb_func_end get_battle_side_of_something - - thumb_func_start sub_803F480 -sub_803F480: @ 803F480 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r1, =gBattleMons - movs r4, 0x58 - muls r0, r4 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - mov r12, r1 - cmp r0, 0x2E - bne _0803F532 - movs r3, 0 - adds r0, r5, 0 - muls r0, r4 - adds r1, 0xC - adds r1, r0, r1 - b _0803F4BC - .pool -_0803F4B4: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - bgt _0803F4C2 -_0803F4BC: - ldrh r0, [r1] - cmp r0, r2 - bne _0803F4B4 -_0803F4C2: - cmp r3, 0x4 - beq _0803F532 - movs r7, 0x58 - adds r2, r5, 0 - muls r2, r7 - adds r0, r3, r2 - mov r6, r12 - adds r6, 0x24 - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0 - beq _0803F4DE - subs r0, 0x1 - strb r0, [r1] -_0803F4DE: - mov r0, r12 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0803F532 - ldr r1, =gDisableStructs - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gBitTable - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803F532 - ldr r4, =gActiveBank - strb r5, [r4] - adds r1, r3, 0 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r4] - muls r0, r7 - adds r0, r6 - adds r0, r3 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803F532: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F480 - - thumb_func_start sub_803F548 -sub_803F548: @ 803F548 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x4 - mov r8, r0 - adds r0, r5, 0 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - bge _0803F5F0 - ldr r1, =gBattleMons - movs r0, 0x58 - adds r7, r5, 0 - muls r7, r0 - adds r1, 0xC - mov r10, r1 -_0803F57E: - lsls r0, r4, 24 - lsrs r0, 24 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - adds r6, r4, 0x1 - cmp r9, r0 - beq _0803F5E6 - ldr r0, =gBattleMons - movs r3, 0x58 - adds r1, r4, 0 - muls r1, r3 - adds r1, r0 - adds r1, 0x20 - ldrb r1, [r1] - adds r4, r0, 0 - cmp r1, 0x2E - bne _0803F5E6 - movs r2, 0 - adds r0, r5, 0 - muls r0, r3 - adds r1, r4, 0 - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x8F - lsls r1, 1 - cmp r0, r1 - beq _0803F5CE - adds r3, r1, 0 - mov r0, r10 - adds r1, r7, r0 -_0803F5C0: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - bgt _0803F5CE - ldrh r0, [r1] - cmp r0, r3 - bne _0803F5C0 -_0803F5CE: - cmp r2, 0x4 - beq _0803F5E6 - mov r8, r2 - adds r1, r2, r7 - adds r0, r4, 0 - adds r0, 0x24 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _0803F5E6 - subs r0, 0x1 - strb r0, [r1] -_0803F5E6: - adds r4, r6, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _0803F57E -_0803F5F0: - mov r1, r8 - cmp r1, 0x4 - beq _0803F658 - ldr r6, =gBattleMons - movs r3, 0x58 - adds r0, r5, 0 - muls r0, r3 - adds r1, r6, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0803F658 - ldr r1, =gDisableStructs - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gBitTable - mov r4, r8 - lsls r0, r4, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803F658 - ldr r4, =gActiveBank - strb r5, [r4] - mov r1, r8 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r4] - muls r0, r3 - adds r2, r6, 0 - adds r2, 0x24 - adds r0, r2 - add r0, r8 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803F658: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F548 - - thumb_func_start sub_803F67C -sub_803F67C: @ 803F67C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r3, r0, 24 - movs r6, 0x4 - movs r1, 0 - ldr r0, =gNoOfAllBanks - mov r8, r0 - ldrb r0, [r0] - cmp r1, r0 - bge _0803F6FE - ldr r7, =gBattleMons - movs r2, 0x58 - mov r12, r2 - mov r5, r12 - muls r5, r3 - adds r0, r7, 0 - adds r0, 0xC - adds r2, r5, r0 - mov r10, r2 - mov r9, r5 -_0803F6AE: - mov r0, r12 - muls r0, r1 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - adds r4, r1, 0x1 - cmp r0, 0x2E - bne _0803F6F4 - cmp r1, r3 - beq _0803F6F4 - movs r2, 0 - mov r1, r10 - ldrh r0, [r1] - cmp r0, 0xC3 - beq _0803F6DE - ldr r1, =gUnknown_02024090 - add r1, r9 -_0803F6D0: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - bgt _0803F6DE - ldrh r0, [r1] - cmp r0, 0xC3 - bne _0803F6D0 -_0803F6DE: - cmp r2, 0x4 - beq _0803F6F4 - adds r6, r2, 0 - adds r0, r6, r5 - ldr r2, =gUnknown_020240A8 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _0803F6F4 - subs r0, 0x1 - strb r0, [r1] -_0803F6F4: - adds r1, r4, 0 - mov r0, r8 - ldrb r0, [r0] - cmp r1, r0 - blt _0803F6AE -_0803F6FE: - cmp r6, 0x4 - beq _0803F762 - ldr r7, =gBattleMons - movs r5, 0x58 - adds r0, r3, 0 - muls r0, r5 - adds r1, r7, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0803F762 - ldr r1, =gDisableStructs - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gBitTable - lsls r0, r6, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803F762 - ldr r4, =gActiveBank - strb r3, [r4] - adds r1, r6, 0 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r4] - muls r0, r5 - adds r2, r7, 0 - adds r2, 0x24 - adds r0, r2 - adds r0, r6 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803F762: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F67C - - thumb_func_start sub_803F790 -sub_803F790: @ 803F790 - push {r4,r5,lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0803F7D0 - movs r2, 0 - ldr r4, =gNoOfAllBanks - ldrb r0, [r4] - cmp r2, r0 - bge _0803F7EE - ldr r3, =gBattleExecBuffer - ldr r5, =gBitTable -_0803F7AC: - ldm r5!, {r1} - lsls r1, 28 - ldr r0, [r3] - orrs r0, r1 - str r0, [r3] - adds r2, 0x1 - ldrb r0, [r4] - cmp r2, r0 - blt _0803F7AC - b _0803F7EE - .pool -_0803F7D0: - movs r2, 0 - ldr r4, =gNoOfAllBanks - ldrb r0, [r4] - cmp r2, r0 - bge _0803F7EE - ldr r3, =gBattleExecBuffer - ldr r5, =gBitTable -_0803F7DE: - ldr r0, [r3] - ldm r5!, {r1} - orrs r0, r1 - str r0, [r3] - adds r2, 0x1 - ldrb r0, [r4] - cmp r2, r0 - blt _0803F7DE -_0803F7EE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F790 - - thumb_func_start dp01_battle_side_mark_buffer_for_execution -dp01_battle_side_mark_buffer_for_execution: @ 803F800 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0803F834 - ldr r2, =gBattleExecBuffer - ldr r1, =gBitTable - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - b _0803F844 - .pool -_0803F834: - ldr r2, =gBattleExecBuffer - ldr r1, =gBitTable - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - orrs r1, r0 - str r1, [r2] -_0803F844: - pop {r0} - bx r0 - .pool - thumb_func_end dp01_battle_side_mark_buffer_for_execution - - thumb_func_start sub_803F850 -sub_803F850: @ 803F850 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - movs r4, 0 - ldr r5, =gBattleExecBuffer - ldr r1, =gBitTable - lsls r0, r7, 2 - adds r6, r0, r1 - b _0803F87A - .pool -_0803F86C: - lsls r0, r4, 2 - ldr r1, [r6] - lsls r1, r0 - ldr r0, [r5] - orrs r0, r1 - str r0, [r5] - adds r4, 0x1 -_0803F87A: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - blt _0803F86C - ldr r2, =gBattleExecBuffer - movs r1, 0x80 - lsls r1, 21 - lsls r1, r7 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F850 - - thumb_func_start CancelMultiTurnMoves -CancelMultiTurnMoves: @ 803F8A0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gBattleMons - movs r2, 0x58 - adds r3, r0, 0 - muls r3, r2 - adds r1, 0x50 - adds r3, r1 - ldr r1, [r3] - ldr r2, =0xffffefff - ands r1, r2 - ldr r2, =0xfffff3ff - ands r1, r2 - movs r2, 0x71 - negs r2, r2 - ands r1, r2 - ldr r2, =0xfffffcff - ands r1, r2 - str r1, [r3] - ldr r1, =gStatuses3 - lsls r2, r0, 2 - adds r2, r1 - ldr r1, [r2] - ldr r3, =0xfffbff3f - ands r1, r3 - str r1, [r2] - ldr r2, =gDisableStructs - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x11] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x11] - movs r0, 0 - strb r0, [r1, 0x10] - bx lr - .pool - thumb_func_end CancelMultiTurnMoves - - thumb_func_start sub_803F90C -sub_803F90C: @ 803F90C - push {lr} - lsls r0, 24 - ldr r1, =gProtectStructs - lsrs r0, 20 - adds r1, r0, r1 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - bne _0803F952 - ldrb r2, [r1, 0x1] - lsls r0, r2, 30 - cmp r0, 0 - blt _0803F952 - lsls r0, r2, 26 - cmp r0, 0 - blt _0803F952 - lsls r0, r2, 25 - cmp r0, 0 - blt _0803F952 - lsrs r0, r2, 7 - cmp r0, 0 - bne _0803F952 - ldrb r1, [r1, 0x2] - lsls r0, r1, 31 - cmp r0, 0 - bne _0803F952 - lsls r0, r1, 30 - cmp r0, 0 - blt _0803F952 - lsls r0, r1, 29 - cmp r0, 0 - blt _0803F952 - lsls r0, r2, 31 - cmp r0, 0 - beq _0803F95C -_0803F952: - movs r0, 0x1 - b _0803F95E - .pool -_0803F95C: - movs r0, 0 -_0803F95E: - pop {r1} - bx r1 - thumb_func_end sub_803F90C - - thumb_func_start b_std_message -b_std_message: @ 803F964 - push {r4,lr} - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - ldr r4, =gActiveBank - strb r1, [r4] - movs r0, 0 - adds r1, r2, 0 - bl dp01_build_cmdbuf_x10_TODO - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end b_std_message - - thumb_func_start sub_803F988 -sub_803F988: @ 803F988 - push {r4-r6,lr} - movs r3, 0 - ldr r0, =gUnknown_020243FE - strb r3, [r0] - strb r3, [r0, 0x1] - movs r1, 0 - ldr r0, =gNoOfAllBanks - ldrb r2, [r0] - adds r6, r0, 0 - cmp r1, r2 - bge _0803F9B6 - ldr r5, =gBitTable - adds r4, r2, 0 - ldr r2, =gBattlePartyID -_0803F9A4: - ldrh r0, [r2] - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - orrs r3, r0 - adds r2, 0x4 - adds r1, 0x2 - cmp r1, r4 - blt _0803F9A4 -_0803F9B6: - movs r1, 0x1 - adds r2, r6, 0 - ldrb r0, [r2] - cmp r1, r0 - bge _0803F9D6 - ldr r5, =gUnknown_020243FE - movs r4, 0x2 -_0803F9C4: - adds r0, r1, 0 - ands r0, r4 - asrs r0, 1 - adds r0, r5 - strb r3, [r0] - adds r1, 0x2 - ldrb r0, [r2] - cmp r1, r0 - blt _0803F9C4 -_0803F9D6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F988 - - thumb_func_start sub_803F9EC -sub_803F9EC: @ 803F9EC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - adds r0, r5, 0 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803FA50 - movs r0, 0x2 - ands r0, r5 - lsls r0, 24 - lsrs r0, 25 - mov r12, r0 - ldr r1, =gUnknown_020243FE - adds r0, r1 - strb r4, [r0] - adds r5, r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r2, [r0] - mov r8, r1 - cmp r4, r2 - bge _0803FA4A - ldr r0, =gAbsentBankFlags - ldrb r7, [r0] - ldr r1, =gBitTable - adds r6, r2, 0 - ldr r3, =gBattlePartyID - adds r2, r1, 0 -_0803FA2E: - ldr r0, [r2] - ands r0, r7 - cmp r0, 0 - bne _0803FA40 - ldrh r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - orrs r4, r0 -_0803FA40: - adds r3, 0x4 - adds r2, 0x8 - adds r5, 0x2 - cmp r5, r6 - blt _0803FA2E -_0803FA4A: - mov r0, r12 - add r0, r8 - strb r4, [r0] -_0803FA50: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F9EC - - thumb_func_start sub_803FA70 -sub_803FA70: @ 803FA70 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803FA8C - adds r0, r4, 0 - bl sub_803F9EC - b _0803FAC2 -_0803FA8C: - movs r3, 0x1 - ldr r5, =gNoOfAllBanks - ldrb r0, [r5] - cmp r3, r0 - bge _0803FAC2 - ldr r0, =gUnknown_020243FE - mov r12, r0 - movs r7, 0x2 - ldr r6, =gBitTable - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r4, r0, r1 -_0803FAA4: - adds r2, r3, 0 - ands r2, r7 - asrs r2, 1 - add r2, r12 - ldrh r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - adds r3, 0x1 - ldrb r0, [r5] - cmp r3, r0 - blt _0803FAA4 -_0803FAC2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803FA70 - .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_8072304.s b/asm/rom_8072304.s index 16d2acf99..87c9f2567 100644 --- a/asm/rom_8072304.s +++ b/asm/rom_8072304.s @@ -962,7 +962,7 @@ sub_8072A88: @ 8072A88 lsls r5, r0, 2 movs r7, 0xD negs r7, r7 - ldr r2, =gUnknown_03005D70 + ldr r2, =gHealthBoxesIds mov r9, r2 _08072AB2: mov r1, r9 @@ -1071,7 +1071,7 @@ _08072B78: movs r5, 0x20 movs r4, 0x2C _08072B7C: - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r6, r0 ldrb r0, [r0] adds r1, r5, 0 @@ -1966,7 +1966,7 @@ _0807332E: ldr r2, =gBattlePartyID mov r8, r2 _08073336: - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds mov r1, r9 adds r6, r1, r0 ldrb r1, [r6] @@ -2224,7 +2224,7 @@ _0807355C: movs r2, 0x4 bl healthbar_draw_field_maybe _08073592: - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds add r0, r9 ldrb r1, [r0] lsls r0, r1, 4 @@ -3759,7 +3759,7 @@ sub_80741E8: @ 80741E8 adds r4, r1, 0 lsls r0, 24 lsrs r7, r0, 24 - ldr r5, =gUnknown_02022E2C + ldr r5, =gDisplayedStringBattle ldr r1, =gUnknown_085ED228 adds r0, r5, 0 bl StringCopy @@ -3774,7 +3774,7 @@ sub_80741E8: @ 80741E8 bl StringAppend adds r5, r0, 0 adds r0, r4, 0 - bl pokemon_get_gender + bl GetMonGender lsls r0, 24 lsrs r6, r0, 24 adds r0, r4, 0 @@ -3814,7 +3814,7 @@ _08074270: _08074272: adds r0, r5, 0 bl StringCopy - ldr r0, =gUnknown_02022E2C + ldr r0, =gDisplayedStringBattle add r1, sp, 0x10 str r1, [sp] movs r1, 0 @@ -4422,7 +4422,7 @@ sub_80747D8: @ 80747D8 ldr r1, =gUnknown_085CCB3C add r0, sp, 0x4 bl StringCopy - ldr r1, =gUnknown_0203A04C + ldr r1, =gNumSafariBalls ldrb r1, [r1] movs r2, 0 movs r3, 0x2 @@ -8512,7 +8512,7 @@ sub_8076918: @ 8076918 lsls r0, 24 lsrs r0, 24 adds r5, r0, 0 - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r0, r5, r0 ldrb r1, [r0] lsls r0, r1, 4 @@ -8635,7 +8635,7 @@ sub_80769F4: @ 80769F4 adds r3, r1, r2 movs r0, 0x1 strh r0, [r3, 0x2E] - ldr r0, =gUnknown_03005D70 + ldr r0, =gHealthBoxesIds adds r4, r0 ldrb r0, [r4] strh r0, [r3, 0x30] diff --git a/asm/rom_80A5C6C.s b/asm/rom_80A5C6C.s index aa31ce7f9..22e91ecdc 100644 --- a/asm/rom_80A5C6C.s +++ b/asm/rom_80A5C6C.s @@ -12,7 +12,7 @@ sub_80A5C6C: @ 80A5C6C lsrs r5, r0, 24 lsls r1, 24 lsrs r4, r1, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A5C8A @@ -70,7 +70,7 @@ _080A5CD8: b _080A5DB0 .pool _080A5D00: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A5D28 @@ -168,7 +168,7 @@ sub_80A5DB8: @ 80A5DB8 lsls r0, 24 cmp r0, 0 beq _080A5DDA - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A5DDA @@ -176,7 +176,7 @@ sub_80A5DB8: @ 80A5DB8 _080A5DDA: cmp r5, 0xC9 bne _080A5E90 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A5E04 @@ -399,7 +399,7 @@ sub_80A5FA0: @ 80A5FA0 lsrs r0, 24 cmp r0, 0x1 bne _080A5FFE - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A5FFE @@ -449,7 +449,7 @@ sub_80A600C: @ 80A600C lsls r0, 24 cmp r0, 0 beq _080A6030 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A603E @@ -527,7 +527,7 @@ sub_80A60AC: @ 80A60AC lsrs r1, 24 cmp r1, 0x1 bhi _080A6126 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A60E8 @@ -645,7 +645,7 @@ sub_80A6190: @ 80A6190 bl sub_80A5C6C lsls r0, 24 lsrs r6, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A6238 @@ -716,8 +716,8 @@ _080A6238: bx r1 thumb_func_end sub_80A6190 - thumb_func_start obj_id_for_side_relative_to_move -obj_id_for_side_relative_to_move: @ 80A6240 + thumb_func_start GetAnimBankSpriteId +GetAnimBankSpriteId: @ 80A6240 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 @@ -785,15 +785,15 @@ _080A62CA: pop {r1} bx r1 .pool - thumb_func_end obj_id_for_side_relative_to_move + thumb_func_end GetAnimBankSpriteId - thumb_func_start oamt_set_x3A_32 -oamt_set_x3A_32: @ 80A62D4 + thumb_func_start StoreSpriteCallbackInData6 +StoreSpriteCallbackInData6: @ 80A62D4 strh r1, [r0, 0x3A] lsrs r1, 16 strh r1, [r0, 0x3C] bx lr - thumb_func_end oamt_set_x3A_32 + thumb_func_end StoreSpriteCallbackInData6 thumb_func_start sub_80A62DC sub_80A62DC: @ 80A62DC @@ -1868,7 +1868,7 @@ sub_80A6A90: @ 80A6A90 lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A6ABC @@ -1942,7 +1942,7 @@ battle_type_is_double: @ 80A6B20 sub_80A6B30: @ 80A6B30 push {r4,lr} adds r4, r0, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -1988,7 +1988,7 @@ sub_80A6B90: @ 80A6B90 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -2046,7 +2046,7 @@ sub_80A6BFC: @ 80A6BFC ldr r0, =gUnknown_02023060 ldr r0, [r0] str r0, [r4, 0x4] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 @@ -2222,7 +2222,7 @@ sub_80A6D60: @ 80A6D60 adds r5, r2, 0 ldrb r0, [r4, 0x9] bl sub_80A6D10 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -2244,7 +2244,7 @@ _080A6D86: thumb_func_start sub_80A6D94 sub_80A6D94: @ 80A6D94 push {lr} - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A6DA4 @@ -2263,7 +2263,7 @@ sub_80A6DAC: @ 80A6DAC lsls r0, 24 cmp r0, 0 beq _080A6DBE - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A6DD4 @@ -2883,13 +2883,13 @@ _080A71F0: thumb_func_start sub_80A7238 sub_80A7238: @ 80A7238 push {r4,lr} - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A7268 ldr r4, =gSprites movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 4 @@ -2929,7 +2929,7 @@ sub_80A7270: @ 80A7270 ldrh r0, [r4, 0x2E] lsls r0, 24 lsrs r7, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A72A6 @@ -2968,7 +2968,7 @@ _080A72B4: movs r1, 0x80 orrs r0, r1 strb r0, [r2] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A7312 @@ -3357,7 +3357,7 @@ sub_80A75AC: @ 80A75AC movs r4, 0 cmp r0, 0 beq _080A7602 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A75F6 @@ -3432,7 +3432,7 @@ _080A7674: ldr r0, [sp] cmp r0, 0 beq _080A769A - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A7694 @@ -3449,7 +3449,7 @@ _080A769A: ldr r0, [sp, 0x4] cmp r0, 0 beq _080A76B0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A76B0 @@ -3483,7 +3483,7 @@ sub_80A76C4: @ 80A76C4 lsrs r3, 24 mov r8, r3 movs r4, 0 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A76F2 @@ -3703,7 +3703,7 @@ _080A785C: str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4-r7} pop {r0} bx r0 @@ -3846,7 +3846,7 @@ _080A798E: str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4-r7} pop {r0} bx r0 @@ -3858,7 +3858,7 @@ duplicate_obj_of_side_rel2move_in_transparent_mode: @ 80A79E8 push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0xFF @@ -4084,7 +4084,7 @@ sub_80A7B98: @ 80A7B98 lsrs r4, r0, 24 ldr r0, =gBattleAnimArgs ldrb r0, [r0] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0xFF @@ -4550,7 +4550,7 @@ _080A7F38: beq _080A7F42 b _080A8034 _080A7F42: - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A7F78 @@ -5014,7 +5014,7 @@ sub_80A82E4: @ 80A82E4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A8300 @@ -5056,7 +5056,7 @@ sub_80A8328: @ 80A8328 bl GetBankIdentity lsls r0, 24 lsrs r4, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A8344 @@ -5088,7 +5088,7 @@ GetBankIdentity_permutated: @ 80A8364 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A838A @@ -5363,7 +5363,7 @@ _080A85B2: bl CreateSprite lsls r0, 24 lsrs r4, r0, 24 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A85EE @@ -5412,7 +5412,7 @@ sub_80A861C: @ 80A861C lsls r1, 24 lsrs r1, 24 mov r9, r1 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 beq _080A86C4 @@ -5811,7 +5811,7 @@ _080A8946: lsls r0, 24 cmp r0, 0 beq _080A8998 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080A8998 @@ -5985,7 +5985,7 @@ _080A8AB6: strh r0, [r4, 0x38] ldr r1, =move_anim_8074EE0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A66DC str r0, [r4, 0x1C] pop {r4} @@ -6040,7 +6040,7 @@ _080A8B26: bl StartSpriteAnim ldr r1, =move_anim_8074EE0 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A66DC str r0, [r4, 0x1C] pop {r4} @@ -6083,7 +6083,7 @@ _080A8B9C: str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4} pop {r0} bx r0 @@ -6101,7 +6101,7 @@ sub_80A8BC4: @ 80A8BC4 ldr r0, =gTasks adds r5, r1, r0 movs r0, 0 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 movs r6, 0 @@ -6516,7 +6516,7 @@ _080A8F32: str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r4,r5} pop {r0} bx r0 diff --git a/asm/rom_80AEFFC.s b/asm/rom_80AEFFC.s index 2c7fe2898..23926a93e 100644 --- a/asm/rom_80AEFFC.s +++ b/asm/rom_80AEFFC.s @@ -163,7 +163,7 @@ _080AF120: thumb_func_start sub_80AF128 sub_80AF128: @ 80AF128 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl sub_8085784 bl pal_fill_black ldr r0, =task0A_nop_for_a_while @@ -184,7 +184,7 @@ task0A_asap_script_env_2_enable_and_set_ctx_running: @ 80AF148 bne _080AF160 adds r0, r4, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _080AF160: pop {r4} pop {r0} @@ -194,7 +194,7 @@ _080AF160: thumb_func_start sub_80AF168 sub_80AF168: @ 80AF168 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl sub_8085784 bl pal_fill_black ldr r0, =task0A_asap_script_env_2_enable_and_set_ctx_running @@ -208,7 +208,7 @@ sub_80AF168: @ 80AF168 thumb_func_start sub_80AF188 sub_80AF188: @ 80AF188 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl pal_fill_black ldr r0, =task0A_asap_script_env_2_enable_and_set_ctx_running movs r1, 0xA @@ -268,7 +268,7 @@ _080AF1FC: bl sub_80AF71C cmp r0, 0x1 bne _080AF20E - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r5, 0 bl DestroyTask _080AF20E: @@ -280,7 +280,7 @@ _080AF20E: thumb_func_start sub_80AF214 sub_80AF214: @ 80AF214 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl sub_8085784 bl palette_bg_faded_fill_black ldr r0, =task_mpl_807DD60 @@ -347,7 +347,7 @@ _080AF298: cmp r0, 0x1 bne _080AF2AE bl sub_8009F18 - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r5, 0 bl DestroyTask _080AF2AE: @@ -396,7 +396,7 @@ _080AF2F2: _080AF2FA: bl sub_8009F18 bl sub_8086C2C - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r5, 0 bl DestroyTask _080AF30C: @@ -408,7 +408,7 @@ _080AF30C: thumb_func_start sub_80AF314 sub_80AF314: @ 80AF314 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl sub_8085784 bl palette_bg_faded_fill_black ldr r0, =sub_80AF234 @@ -471,7 +471,7 @@ mapldr_default: @ 80AF398 bl sub_8085784 bl pal_fill_for_maplights bl sub_80AF334 - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 thumb_func_end mapldr_default @@ -482,7 +482,7 @@ sub_80AF3B0: @ 80AF3B0 bl sub_8085784 bl sub_80AF08C bl sub_80AF334 - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 thumb_func_end sub_80AF3B0 @@ -497,7 +497,7 @@ sub_80AF3C8: @ 80AF3C8 _080AF3D6: bl pal_fill_black bl sub_80AF334 - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 thumb_func_end sub_80AF3C8 @@ -512,7 +512,7 @@ sub_80AF3E8: @ 80AF3E8 ldr r0, =task0A_mpl_807E31C movs r1, 0xA bl CreateTask - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 .pool @@ -528,7 +528,7 @@ sub_80AF40C: @ 80AF40C ldr r0, =task_map_chg_seq_0807E2CC movs r1, 0xA bl CreateTask - bl script_env_2_enable + bl ScriptContext2_Enable movs r0, 0xE bl sub_8085540 pop {r0} @@ -655,7 +655,7 @@ _080AF536: strh r0, [r5, 0x8] b _080AF54A _080AF540: - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r4, 0 bl DestroyTask _080AF54A: @@ -744,7 +744,7 @@ _080AF5EC: strh r0, [r5, 0x8] b _080AF60A _080AF600: - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r4, 0 bl DestroyTask _080AF60A: @@ -773,7 +773,7 @@ task_map_chg_seq_0807E2CC: @ 80AF610 .pool _080AF634: bl player_bitmagic - bl script_env_2_enable + bl ScriptContext2_Enable ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -783,7 +783,7 @@ _080AF644: cmp r0, 0 beq _080AF65A bl sub_809757C - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r5, 0 bl DestroyTask _080AF65A: @@ -819,7 +819,7 @@ sub_80AF688: @ 80AF688 ldr r0, =sub_80AF660 movs r1, 0x50 bl CreateTask - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 .pool @@ -842,7 +842,7 @@ task_mpl_807E3C8: @ 80AF6B0 bl sub_80AF71C cmp r0, 0x1 bne _080AF6CC - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r4, 0 bl DestroyTask bl sub_80984F4 @@ -855,7 +855,7 @@ _080AF6CC: thumb_func_start sub_80AF6D4 sub_80AF6D4: @ 80AF6D4 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl pal_fill_black ldr r0, =task_mpl_807E3C8 movs r1, 0xA @@ -868,7 +868,7 @@ sub_80AF6D4: @ 80AF6D4 thumb_func_start sub_80AF6F0 sub_80AF6F0: @ 80AF6F0 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl sub_8085784 bl pal_fill_black ldr r0, =task_mpl_807E3C8 @@ -908,7 +908,7 @@ _080AF730: thumb_func_start sub_80AF734 sub_80AF734: @ 80AF734 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl music_something bl sub_80AF0B4 bl play_some_sound @@ -928,7 +928,7 @@ sub_80AF734: @ 80AF734 thumb_func_start sp13E_warp_to_last_warp sp13E_warp_to_last_warp: @ 80AF76C push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl music_something bl sub_80AF0B4 bl play_some_sound @@ -946,7 +946,7 @@ sp13E_warp_to_last_warp: @ 80AF76C thumb_func_start sub_80AF79C sub_80AF79C: @ 80AF79C push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl music_something movs r0, 0x3 movs r1, 0x8 @@ -966,7 +966,7 @@ sub_80AF79C: @ 80AF79C thumb_func_start sub_80AF7D0 sub_80AF7D0: @ 80AF7D0 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =gUnknown_03005DAC ldr r1, =mapldr_default str r1, [r0] @@ -996,7 +996,7 @@ sub_80AF80C: @ 80AF80C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl script_env_2_enable + bl ScriptContext2_Enable adds r0, r4, 0 movs r1, 0xA bl sub_80B6E4C @@ -1008,7 +1008,7 @@ sub_80AF80C: @ 80AF80C thumb_func_start sub_80AF828 sub_80AF828: @ 80AF828 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable movs r0, 0xA bl sub_80B75D8 pop {r0} @@ -1018,7 +1018,7 @@ sub_80AF828: @ 80AF828 thumb_func_start sub_80AF838 sub_80AF838: @ 80AF838 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable movs r0, 0xA bl sub_80B7A74 pop {r0} @@ -1028,7 +1028,7 @@ sub_80AF838: @ 80AF838 thumb_func_start sub_80AF848 sub_80AF848: @ 80AF848 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl music_something bl sub_80AF0B4 movs r0, 0x2D @@ -1049,7 +1049,7 @@ sub_80AF87C: @ 80AF87C push {lr} movs r0, 0x1 bl sub_8085540 - bl script_env_2_enable + bl ScriptContext2_Enable bl save_serialize_npcs bl music_something bl sub_80AF0B4 @@ -1069,7 +1069,7 @@ sub_80AF87C: @ 80AF87C thumb_func_start sub_80AF8B8 sub_80AF8B8: @ 80AF8B8 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl sub_80AF0B4 ldr r0, =sub_80AFA0C movs r1, 0xA @@ -1107,7 +1107,7 @@ _080AF908: beq _080AF92E b _080AF93E _080AF90E: - bl script_env_2_enable + bl ScriptContext2_Enable b _080AF926 _080AF914: bl sub_80AF710 @@ -1138,7 +1138,7 @@ _080AF93E: thumb_func_start sub_80AF948 sub_80AF948: @ 80AF948 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl music_something bl sub_80AF0B4 movs r0, 0x9 @@ -1252,7 +1252,7 @@ _080AFA34: b _080AFA7C _080AFA3A: bl player_bitmagic - bl script_env_2_enable + bl ScriptContext2_Enable b _080AFA64 _080AFA44: bl sub_80AF710 @@ -1480,7 +1480,7 @@ _080AFC1C: b _080AFC56 _080AFC22: bl player_bitmagic - bl script_env_2_enable + bl ScriptContext2_Enable b _080AFC3E _080AFC2C: bl sub_80AF710 @@ -1511,7 +1511,7 @@ _080AFC56: thumb_func_start sub_80AFC60 sub_80AFC60: @ 80AFC60 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl music_something bl sub_80AF0B4 bl play_some_sound @@ -1932,7 +1932,7 @@ sub_80AFF90: @ 80AFF90 lsls r0, 24 cmp r0, 0 bne _080AFFAC - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask _080AFFAC: @@ -2088,7 +2088,7 @@ _080B00B6: movs r1, 0x50 bl sub_80AFFDC bl sub_80AFFB8 - bl script_env_2_enable + bl ScriptContext2_Enable add sp, 0x8 pop {r4,r5} pop {r0} @@ -2172,7 +2172,7 @@ task0A_mpl_807E31C: @ 80B0160 .pool _080B0184: bl player_bitmagic - bl script_env_2_enable + bl ScriptContext2_Enable bl sub_808D194 ldrh r0, [r4, 0x8] adds r0, 0x1 @@ -2186,7 +2186,7 @@ _080B0198: cmp r0, 0x1 beq _080B01B6 bl sub_809757C - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r5, 0 bl DestroyTask _080B01B6: @@ -2223,7 +2223,7 @@ _080B01E4: b _080B023A _080B01EE: bl player_bitmagic - bl script_env_2_enable + bl ScriptContext2_Enable movs r0, 0x2D bl PlaySE bl sub_808D1C8 @@ -2263,7 +2263,7 @@ _080B023A: thumb_func_start sub_80B0244 sub_80B0244: @ 80B0244 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =sub_80AFA0C movs r1, 0xA bl CreateTask @@ -2278,7 +2278,7 @@ sub_80B0244: @ 80B0244 thumb_func_start sub_80B0268 sub_80B0268: @ 80B0268 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =gUnknown_03005DAC ldr r1, =mapldr_default str r1, [r0] @@ -2500,7 +2500,7 @@ _080B0450: lsls r0, 24 cmp r0, 0 bne _080B052C - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts movs r0, 0x3 strh r0, [r5] b _080B052C @@ -2590,7 +2590,7 @@ _080B04F2: ldrh r1, [r5, 0x14] movs r0, 0x4A bl SetGpuReg - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask _080B052C: @@ -2688,7 +2688,7 @@ task50_0807F0C8: @ 80B05CC bne _080B05E8 adds r0, r4, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _080B05E8: pop {r4} pop {r0} diff --git a/asm/rom_80C6FA0.s b/asm/rom_80C6FA0.s index 35215e80c..4c3ada218 100644 --- a/asm/rom_80C6FA0.s +++ b/asm/rom_80C6FA0.s @@ -5,8 +5,8 @@ .text - thumb_func_start sub_80C6FA0 -sub_80C6FA0: @ 80C6FA0 + thumb_func_start CountMonsInBox +CountMonsInBox: @ 80C6FA0 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 @@ -17,7 +17,7 @@ _080C6FAA: lsrs r1, 24 adds r0, r6, 0 movs r2, 0xB - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox cmp r0, 0 beq _080C6FC0 adds r0, r5, 0x1 @@ -34,7 +34,7 @@ _080C6FC0: pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_80C6FA0 + thumb_func_end CountMonsInBox thumb_func_start sub_80C6FD4 sub_80C6FD4: @ 80C6FD4 @@ -47,7 +47,7 @@ _080C6FDC: lsrs r1, 24 adds r0, r5, 0 movs r2, 0xB - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox cmp r0, 0 bne _080C6FF2 lsls r0, r4, 16 @@ -564,8 +564,8 @@ _080C73D0: lsrs r0, 24 movs r1, 0x1 bl sub_819746C - bl script_env_2_disable - bl script_env_2_enable_and_set_ctx_running + bl ScriptContext2_Disable + bl EnableBothScriptContexts ldrh r0, [r5, 0x26] lsls r0, 24 lsrs r0, 24 @@ -769,7 +769,7 @@ sub_80C7578: @ 80C7578 movs r0, 0 strh r0, [r1, 0x8] strh r0, [r1, 0xA] - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 .pool @@ -922,7 +922,7 @@ _080C76E2: lsls r0, 4 add r0, r8 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 bne _080C770C asrs r0, r6, 16 @@ -963,12 +963,12 @@ _080C772C: adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _080C7750 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _080C7710 _080C7750: @@ -1572,7 +1572,7 @@ sub_80C7BE4: @ 80C7BE4 ldr r0, [r1] adds r0, r4 ldrb r0, [r0] - bl sub_80C6FA0 + bl CountMonsInBox adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 @@ -3381,7 +3381,7 @@ _080C8CB0: .4byte _080C8D48 .4byte _080C8D68 _080C8CC8: - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x6 @@ -5189,7 +5189,7 @@ _080C9CE4: cmp r4, 0 bne _080C9D08 bl sub_80CABE0 - bl calc_player_party_count + bl CalculatePlayerPartyCount ldr r1, =gPlayerPartyCount strb r0, [r1] ldr r0, =gUnknown_02039D08 @@ -5321,7 +5321,7 @@ _080C9E18: cmp r4, 0 bne _080C9E3C bl sub_80CABE0 - bl calc_player_party_count + bl CalculatePlayerPartyCount ldr r1, =gPlayerPartyCount strb r0, [r1] ldr r0, =gUnknown_02039D08 @@ -5484,7 +5484,7 @@ _080C9FAC: adds r0, r1, 0 movs r1, 0xC mov r2, sp - bl set_pokemon_data_from_selected_box + bl SetBoxMonDataFromSelectedBox _080C9FB6: mov r0, sp ldrh r0, [r0] @@ -6108,7 +6108,7 @@ sub_80CA4FC: @ 80CA4FC movs r0, 0 movs r1, 0x1 movs r3, 0x6 - bl Print + bl PrintTextOnWindow ldr r2, [r6] ldr r1, =0x00000d1d adds r2, r1 @@ -6119,7 +6119,7 @@ sub_80CA4FC: @ 80CA4FC movs r0, 0 movs r1, 0x2 movs r3, 0x6 - bl Print + bl PrintTextOnWindow ldr r2, [r6] ldr r0, =0x00000d41 adds r2, r0 @@ -6130,7 +6130,7 @@ sub_80CA4FC: @ 80CA4FC movs r0, 0 movs r1, 0x2 movs r3, 0xA - bl Print + bl PrintTextOnWindow ldr r2, [r6] ldr r1, =0x00000d65 adds r2, r1 @@ -6141,7 +6141,7 @@ sub_80CA4FC: @ 80CA4FC movs r0, 0 movs r1, 0 movs r3, 0x6 - bl Print + bl PrintTextOnWindow b _080CA5E8 .pool _080CA588: @@ -6155,7 +6155,7 @@ _080CA588: movs r0, 0 movs r1, 0 movs r3, 0x6 - bl Print + bl PrintTextOnWindow ldr r2, [r6] ldr r1, =0x00000cf9 adds r2, r1 @@ -6166,7 +6166,7 @@ _080CA588: movs r0, 0 movs r1, 0x1 movs r3, 0x6 - bl Print + bl PrintTextOnWindow ldr r2, [r6] ldr r0, =0x00000d1d adds r2, r0 @@ -6177,7 +6177,7 @@ _080CA588: movs r0, 0 movs r1, 0x2 movs r3, 0x6 - bl Print + bl PrintTextOnWindow ldr r2, [r6] ldr r1, =0x00000d41 adds r2, r1 @@ -6188,7 +6188,7 @@ _080CA588: movs r0, 0 movs r1, 0x2 movs r3, 0xA - bl Print + bl PrintTextOnWindow _080CA5E8: movs r0, 0 movs r1, 0x2 @@ -7058,7 +7058,7 @@ _080CAD30: movs r0, 0x1 movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0x1 movs r1, 0x2 movs r2, 0xE @@ -7407,7 +7407,7 @@ _080CB048: mov r0, r9 adds r1, r6, 0 movs r2, 0x41 - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 @@ -7415,7 +7415,7 @@ _080CB048: mov r0, r9 adds r1, r6, 0 movs r2, 0 - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox adds r1, r0, 0 lsls r2, r5, 1 adds r2, r5 @@ -7491,7 +7491,7 @@ _080CB0F6: mov r0, r9 adds r1, r6, 0 movs r2, 0xC - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox cmp r0, 0 bne _080CB11C ldr r0, =gUnknown_02039D08 @@ -7534,7 +7534,7 @@ sub_80CB140: @ 80CB140 lsrs r7, r0, 24 adds r0, r7, 0 movs r1, 0x41 - bl get_pokemon_data_from_selected_box + bl GetBoxMonDataFromSelectedBox lsls r0, 16 lsrs r0, 16 mov r8, r0 @@ -7567,7 +7567,7 @@ sub_80CB140: @ 80CB140 lsrs r4, 16 adds r0, r7, 0 movs r1, 0 - bl get_pokemon_data_from_selected_box + bl GetBoxMonDataFromSelectedBox adds r1, r0, 0 movs r0, 0x2 str r0, [sp] @@ -7923,7 +7923,7 @@ _080CB3F8: ldrb r0, [r0] adds r1, r5, 0 movs r2, 0xC - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox cmp r0, 0 bne _080CB486 mov r2, r10 @@ -8235,7 +8235,7 @@ _080CB70A: adds r0, r6, 0 adds r1, r4, 0 movs r2, 0x41 - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox mov r2, r9 ldr r1, [r2] lsls r2, r5, 1 @@ -8249,7 +8249,7 @@ _080CB70A: adds r0, r6, 0 adds r1, r4, 0 movs r2, 0 - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox mov r2, r9 ldr r1, [r2] lsls r2, r5, 2 @@ -11920,7 +11920,7 @@ _080CD538: ldr r0, =gUnknown_02039D79 ldrb r0, [r0] movs r1, 0xB - bl get_pokemon_data_from_selected_box + bl GetBoxMonDataFromSelectedBox _080CD542: lsls r0, 16 lsrs r0, 16 @@ -12662,7 +12662,7 @@ sub_80CDBA0: @ 80CDBA0 b _080CDBC2 .pool _080CDBB4: - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x5 @@ -13284,12 +13284,12 @@ _080CE0C0: ldr r0, [r5] ldr r4, =0x000020a4 adds r0, r4 - bl pokemon_restore_pp + bl BoxMonRestorePP ldr r2, [r5] adds r2, r4 adds r0, r6, 0 adds r1, r7, 0 - bl sub_80D1F18 + bl CopyBoxMonFromAnyBox _080CE0D8: pop {r4-r7} pop {r0} @@ -13310,7 +13310,7 @@ sub_80CE0E8: @ 80CE0E8 muls r0, r1 ldr r1, =gPlayerParty adds r0, r1 - bl zero_pokemon_struct + bl ZeroMonData b _080CE10C .pool _080CE108: @@ -13947,7 +13947,7 @@ _080CE696: adds r2, 0x7 adds r3, r2 movs r2, 0x51 - bl sub_80D1ED0 + bl GetAndCopyBoxMonDataFromAnyBox lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 @@ -14255,7 +14255,7 @@ _080CE97E: adds r0, r5, 0 muls r0, r6 adds r0, r4 - bl zero_pokemon_struct + bl ZeroMonData adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 @@ -14323,7 +14323,7 @@ _080CEA08: ldrb r0, [r0] movs r1, 0x8 mov r2, sp - bl set_pokemon_data_from_selected_box + bl SetBoxMonDataFromSelectedBox _080CEA1C: add sp, 0x4 pop {r4} @@ -14662,7 +14662,7 @@ _080CEC86: adds r1, r2 str r0, [r1] adds r0, r6, 0 - bl pokemon_get_gender + bl GetMonGender lsls r0, 24 lsrs r0, 24 mov r9, r0 @@ -14683,7 +14683,7 @@ _080CED1E: adds r7, r4, 0 adds r0, r7, 0 movs r1, 0x41 - bl pokemon_getattr_encrypted + bl GetBoxMonData mov r2, r8 ldr r1, [r2] ldr r3, =0x00000ce4 @@ -14696,11 +14696,11 @@ _080CED1E: _080CED3A: adds r0, r7, 0 movs r1, 0x1 - bl pokemon_getattr_encrypted + bl GetBoxMonData mov r9, r0 adds r0, r7, 0 movs r1, 0x4 - bl pokemon_getattr_encrypted + bl GetBoxMonData lsls r0, 24 lsrs r0, 24 mov r10, r0 @@ -14716,7 +14716,7 @@ _080CED3A: _080CED6C: adds r0, r7, 0 movs r1, 0x2D - bl pokemon_getattr_encrypted + bl GetBoxMonData mov r3, r8 ldr r1, [r3] ldr r2, =0x00000ced @@ -14729,26 +14729,26 @@ _080CED7E: adds r2, r4 adds r0, r7, 0 movs r1, 0x2 - bl pokemon_getattr_encrypted + bl GetBoxMonData ldr r0, [r5] adds r0, r4 bl StringGetEnd10 adds r0, r7, 0 - bl sub_80690C0 + bl GetLevelFromBoxMonExp ldr r1, [r5] ldr r3, =0x00000cec adds r1, r3 strb r0, [r1] adds r0, r7, 0 movs r1, 0x8 - bl pokemon_getattr_encrypted + bl GetBoxMonData ldr r1, [r5] ldr r2, =0x00000ceb adds r1, r2 strb r0, [r1] adds r0, r7, 0 movs r1, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r2, r0, 0 ldr r1, [r5] movs r6, 0xCE @@ -14768,13 +14768,13 @@ _080CED7E: ldrh r0, [r4] adds r1, r6 ldr r1, [r1] - bl pokemon_species_get_gender_info + bl GetGenderFromSpeciesAndPersonality lsls r0, 24 lsrs r0, 24 mov r9, r0 adds r0, r7, 0 movs r1, 0xC - bl pokemon_getattr_encrypted + bl GetBoxMonData ldr r1, [r5] ldr r2, =0x00000ce6 adds r1, r2 @@ -17899,12 +17899,12 @@ sub_80D07B0: @ 80D07B0 lsrs r4, 24 adds r0, r4, 0 movs r1, 0x41 - bl get_pokemon_data_from_selected_box + bl GetBoxMonDataFromSelectedBox lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0 - bl get_pokemon_data_from_selected_box + bl GetBoxMonDataFromSelectedBox adds r1, r0, 0 cmp r5, 0 beq _080D0828 @@ -17963,7 +17963,7 @@ sub_80D0834: @ 80D0834 lsls r0, 24 lsrs r0, 24 movs r1, 0x41 - bl get_pokemon_data_from_selected_box + bl GetBoxMonDataFromSelectedBox lsls r0, 16 cmp r0, 0 beq _080D0878 @@ -18257,7 +18257,7 @@ _080D0A62: ldr r0, [r2] adds r0, r1 movs r1, 0x5 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _080D0A80 adds r0, r5, 0 @@ -18343,7 +18343,7 @@ _080D0B04: ldr r0, [r1] adds r0, r4 movs r1, 0x5 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _080D0B2C mov r0, r8 @@ -18351,7 +18351,7 @@ _080D0B04: adds r2, r4 ldr r0, [sp, 0x4] adds r1, r6, 0 - bl sub_80D1F18 + bl CopyBoxMonFromAnyBox _080D0B2C: adds r0, r6, 0x1 lsls r0, 24 @@ -18475,12 +18475,12 @@ _080D0C04: ldr r0, [r2] adds r0, r1 movs r1, 0x5 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _080D0C30 adds r0, r5, 0 movs r1, 0x5 - bl get_pokemon_data_from_selected_box + bl GetBoxMonDataFromSelectedBox cmp r0, 0 beq _080D0C30 movs r0, 0 @@ -18674,12 +18674,12 @@ sub_80D0D8C: @ 80D0D8C _080D0DC4: adds r0, r7, 0 movs r1, 0x5 - bl get_pokemon_data_from_selected_box + bl GetBoxMonDataFromSelectedBox cmp r0, 0 beq _080D0E42 adds r0, r7, 0 movs r1, 0xC - bl get_pokemon_data_from_selected_box + bl GetBoxMonDataFromSelectedBox b _080D0DFC _080D0DDA: cmp r7, 0x5 @@ -18808,7 +18808,7 @@ sub_80D0E90: @ 80D0E90 adds r0, r5, 0 movs r1, 0xC mov r2, sp - bl set_pokemon_data_from_selected_box + bl SetBoxMonDataFromSelectedBox adds r0, r5, 0 movs r1, 0x1 bl sub_80CB7AC @@ -18927,7 +18927,7 @@ sub_80D0FAC: @ 80D0FAC bne _080D101C adds r0, r7, 0 movs r1, 0xC - bl get_pokemon_data_from_selected_box + bl GetBoxMonDataFromSelectedBox lsls r0, 16 lsrs r6, r0, 16 mov r0, r8 @@ -18936,7 +18936,7 @@ sub_80D0FAC: @ 80D0FAC adds r2, r4 adds r0, r7, 0 movs r1, 0xC - bl set_pokemon_data_from_selected_box + bl SetBoxMonDataFromSelectedBox mov r1, r8 ldr r0, [r1] adds r0, r4 @@ -19024,7 +19024,7 @@ sub_80D1080: @ 80D1080 adds r2, r0 adds r0, r5, 0 movs r1, 0xC - bl set_pokemon_data_from_selected_box + bl SetBoxMonDataFromSelectedBox adds r0, r5, 0 movs r1, 0 bl sub_80CB7AC @@ -19090,7 +19090,7 @@ sub_80D1114: @ 80D1114 adds r0, r5, 0 movs r1, 0xC mov r2, sp - bl set_pokemon_data_from_selected_box + bl SetBoxMonDataFromSelectedBox adds r0, r5, 0 movs r1, 0x1 bl sub_80CB7AC @@ -20562,7 +20562,7 @@ nullsub_98: @ 80D1D08 thumb_func_start get_preferred_box @ char get_preferred_box() get_preferred_box: @ 80D1D0C - ldr r0, =gUnknown_03005D94 + ldr r0, =gPokemonStoragePtr ldr r0, [r0] ldrb r0, [r0] bx lr @@ -20576,7 +20576,7 @@ sub_80D1D18: @ 80D1D18 lsrs r1, r0, 24 cmp r1, 0xD bhi _080D1D28 - ldr r0, =gUnknown_03005D94 + ldr r0, =gPokemonStoragePtr ldr r0, [r0] strb r1, [r0] _080D1D28: @@ -20585,8 +20585,8 @@ _080D1D28: .pool thumb_func_end sub_80D1D18 - thumb_func_start get_pokemon_data_from_any_box -get_pokemon_data_from_any_box: @ 80D1D30 + thumb_func_start GetBoxMonDataFromAnyBox +GetBoxMonDataFromAnyBox: @ 80D1D30 push {r4,r5,lr} adds r5, r2, 0 lsls r0, 24 @@ -20597,7 +20597,7 @@ get_pokemon_data_from_any_box: @ 80D1D30 bhi _080D1D6C cmp r4, 0x1D bhi _080D1D6C - ldr r2, =gUnknown_03005D94 + ldr r2, =gPokemonStoragePtr lsls r0, r3, 2 adds r0, r3 lsls r1, r0, 4 @@ -20611,7 +20611,7 @@ get_pokemon_data_from_any_box: @ 80D1D30 lsls r1, 4 adds r0, r1 adds r1, r5, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData b _080D1D6E .pool _080D1D6C: @@ -20620,10 +20620,10 @@ _080D1D6E: pop {r4,r5} pop {r1} bx r1 - thumb_func_end get_pokemon_data_from_any_box + thumb_func_end GetBoxMonDataFromAnyBox - thumb_func_start set_pokemon_data_from_any_box -set_pokemon_data_from_any_box: @ 80D1D74 + thumb_func_start SetBoxMonDataFromAnyBox +SetBoxMonDataFromAnyBox: @ 80D1D74 push {r4-r6,lr} adds r5, r2, 0 adds r6, r3, 0 @@ -20635,7 +20635,7 @@ set_pokemon_data_from_any_box: @ 80D1D74 bhi _080D1DAC cmp r4, 0x1D bhi _080D1DAC - ldr r2, =gUnknown_03005D94 + ldr r2, =gPokemonStoragePtr lsls r0, r3, 2 adds r0, r3 lsls r1, r0, 4 @@ -20650,53 +20650,53 @@ set_pokemon_data_from_any_box: @ 80D1D74 adds r0, r1 adds r1, r5, 0 adds r2, r6, 0 - bl SetMonData_encrypted + bl SetBoxMonData _080D1DAC: pop {r4-r6} pop {r0} bx r0 .pool - thumb_func_end set_pokemon_data_from_any_box + thumb_func_end SetBoxMonDataFromAnyBox - thumb_func_start get_pokemon_data_from_selected_box -get_pokemon_data_from_selected_box: @ 80D1DB8 + thumb_func_start GetBoxMonDataFromSelectedBox +GetBoxMonDataFromSelectedBox: @ 80D1DB8 push {lr} adds r3, r0, 0 adds r2, r1, 0 lsls r3, 24 lsrs r3, 24 - ldr r0, =gUnknown_03005D94 + ldr r0, =gPokemonStoragePtr ldr r0, [r0] ldrb r0, [r0] adds r1, r3, 0 - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox pop {r1} bx r1 .pool - thumb_func_end get_pokemon_data_from_selected_box + thumb_func_end GetBoxMonDataFromSelectedBox - thumb_func_start set_pokemon_data_from_selected_box -set_pokemon_data_from_selected_box: @ 80D1DD8 + thumb_func_start SetBoxMonDataFromSelectedBox +SetBoxMonDataFromSelectedBox: @ 80D1DD8 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r3, r2, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_03005D94 + ldr r0, =gPokemonStoragePtr ldr r0, [r0] ldrb r0, [r0] adds r1, r4, 0 adds r2, r5, 0 - bl set_pokemon_data_from_any_box + bl SetBoxMonDataFromAnyBox pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end set_pokemon_data_from_selected_box + thumb_func_end SetBoxMonDataFromSelectedBox - thumb_func_start sub_80D1DFC -sub_80D1DFC: @ 80D1DFC + thumb_func_start GetBoxMonNickFromAnyBox +GetBoxMonNickFromAnyBox: @ 80D1DFC push {r4,r5,lr} adds r5, r2, 0 lsls r0, 24 @@ -20707,7 +20707,7 @@ sub_80D1DFC: @ 80D1DFC bhi _080D1E38 cmp r4, 0x1D bhi _080D1E38 - ldr r2, =gUnknown_03005D94 + ldr r2, =gPokemonStoragePtr lsls r0, r3, 2 adds r0, r3 lsls r1, r0, 4 @@ -20722,7 +20722,7 @@ sub_80D1DFC: @ 80D1DFC adds r0, r1 movs r1, 0x2 adds r2, r5, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData b _080D1E3C .pool _080D1E38: @@ -20732,7 +20732,7 @@ _080D1E3C: pop {r4,r5} pop {r0} bx r0 - thumb_func_end sub_80D1DFC + thumb_func_end GetBoxMonNickFromAnyBox thumb_func_start sub_80D1E44 sub_80D1E44: @ 80D1E44 @@ -20745,7 +20745,7 @@ sub_80D1E44: @ 80D1E44 bhi _080D1E84 cmp r2, 0x1D bhi _080D1E84 - ldr r6, =gUnknown_03005D94 + ldr r6, =gPokemonStoragePtr lsls r1, r0, 2 adds r1, r0 lsls r0, r1, 4 @@ -20759,13 +20759,13 @@ sub_80D1E44: @ 80D1E44 lsls r4, r1, 4 adds r0, r4 movs r1, 0x5 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _080D1E84 ldr r0, [r6] adds r0, r5 adds r0, r4 - bl sub_80690C0 + bl GetLevelFromBoxMonExp _080D1E84: movs r0, 0 pop {r4-r6} @@ -20774,8 +20774,8 @@ _080D1E84: .pool thumb_func_end sub_80D1E44 - thumb_func_start sub_80D1E90 -sub_80D1E90: @ 80D1E90 + thumb_func_start SetBoxMonNickFromAnyBox +SetBoxMonNickFromAnyBox: @ 80D1E90 push {r4,r5,lr} adds r5, r2, 0 lsls r0, 24 @@ -20786,7 +20786,7 @@ sub_80D1E90: @ 80D1E90 bhi _080D1EC6 cmp r4, 0x1D bhi _080D1EC6 - ldr r2, =gUnknown_03005D94 + ldr r2, =gPokemonStoragePtr lsls r0, r3, 2 adds r0, r3 lsls r1, r0, 4 @@ -20801,16 +20801,16 @@ sub_80D1E90: @ 80D1E90 adds r0, r1 movs r1, 0x2 adds r2, r5, 0 - bl SetMonData_encrypted + bl SetBoxMonData _080D1EC6: pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_80D1E90 + thumb_func_end SetBoxMonNickFromAnyBox - thumb_func_start sub_80D1ED0 -sub_80D1ED0: @ 80D1ED0 + thumb_func_start GetAndCopyBoxMonDataFromAnyBox +GetAndCopyBoxMonDataFromAnyBox: @ 80D1ED0 push {r4-r6,lr} adds r5, r2, 0 adds r6, r3, 0 @@ -20822,7 +20822,7 @@ sub_80D1ED0: @ 80D1ED0 bhi _080D1F10 cmp r4, 0x1D bhi _080D1F10 - ldr r2, =gUnknown_03005D94 + ldr r2, =gPokemonStoragePtr lsls r0, r3, 2 adds r0, r3 lsls r1, r0, 4 @@ -20837,7 +20837,7 @@ sub_80D1ED0: @ 80D1ED0 adds r0, r1 adds r1, r5, 0 adds r2, r6, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData b _080D1F12 .pool _080D1F10: @@ -20846,10 +20846,10 @@ _080D1F12: pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_80D1ED0 + thumb_func_end GetAndCopyBoxMonDataFromAnyBox - thumb_func_start sub_80D1F18 -sub_80D1F18: @ 80D1F18 + thumb_func_start CopyBoxMonFromAnyBox +CopyBoxMonFromAnyBox: @ 80D1F18 push {r4,r5,lr} adds r5, r2, 0 lsls r0, 24 @@ -20860,7 +20860,7 @@ sub_80D1F18: @ 80D1F18 bhi _080D1F4E cmp r1, 0x1D bhi _080D1F4E - ldr r0, =gUnknown_03005D94 + ldr r0, =gPokemonStoragePtr ldr r0, [r0] lsls r3, r1, 2 adds r3, r1 @@ -20881,7 +20881,7 @@ _080D1F4E: pop {r0} bx r0 .pool - thumb_func_end sub_80D1F18 + thumb_func_end CopyBoxMonFromAnyBox thumb_func_start sub_80D1F58 sub_80D1F58: @ 80D1F58 @@ -20895,7 +20895,7 @@ sub_80D1F58: @ 80D1F58 bhi _080D1F8E cmp r2, 0x1D bhi _080D1F8E - ldr r0, =gUnknown_03005D94 + ldr r0, =gPokemonStoragePtr ldr r1, [r0] lsls r3, r2, 2 adds r3, r2 @@ -20950,7 +20950,7 @@ sub_80D1F98: @ 80D1F98 bhi _080D2004 cmp r6, 0x1D bhi _080D2004 - ldr r2, =gUnknown_03005D94 + ldr r2, =gPokemonStoragePtr lsls r0, r7, 2 adds r0, r7 lsls r1, r0, 4 @@ -20972,7 +20972,7 @@ sub_80D1F98: @ 80D1F98 mov r1, r9 mov r2, r8 adds r3, r4, 0 - bl create_pokemon + bl CreateBoxMon _080D2004: add sp, 0x14 pop {r3,r4} @@ -20995,7 +20995,7 @@ sub_80D2018: @ 80D2018 bhi _080D2048 cmp r4, 0x1D bhi _080D2048 - ldr r2, =gUnknown_03005D94 + ldr r2, =gPokemonStoragePtr lsls r0, r3, 2 adds r0, r3 lsls r1, r0, 4 @@ -21008,7 +21008,7 @@ sub_80D2018: @ 80D2018 adds r1, r4 lsls r1, 4 adds r0, r1 - bl zero_pokemon_boxed_data + bl ZeroBoxMonData _080D2048: pop {r4} pop {r0} @@ -21028,7 +21028,7 @@ sub_80D2054: @ 80D2054 bhi _080D2088 cmp r4, 0x1D bhi _080D2088 - ldr r2, =gUnknown_03005D94 + ldr r2, =gPokemonStoragePtr lsls r0, r3, 2 adds r0, r3 lsls r1, r0, 4 @@ -21062,7 +21062,7 @@ get_pokemon_by_box_and_pos: @ 80D2094 bhi _080D20C8 cmp r4, 0x1D bhi _080D20C8 - ldr r2, =gUnknown_03005D94 + ldr r2, =gPokemonStoragePtr lsls r0, r3, 2 adds r0, r3 lsls r1, r0, 4 @@ -21095,7 +21095,7 @@ sav3_get_box_name: @ 80D20D0 movs r0, 0 b _080D20EC _080D20DE: - ldr r0, =gUnknown_03005D94 + ldr r0, =gPokemonStoragePtr lsls r1, r2, 3 adds r1, r2 ldr r2, =0x00008344 @@ -21118,7 +21118,7 @@ sub_80D20F8: @ 80D20F8 movs r0, 0 b _080D2112 _080D2106: - ldr r0, =gUnknown_03005D94 + ldr r0, =gPokemonStoragePtr ldr r0, [r0] ldr r2, =0x000083c2 adds r0, r2 @@ -21141,7 +21141,7 @@ sub_80D2120: @ 80D2120 bhi _080D213E cmp r1, 0x10 bhi _080D213E - ldr r0, =gUnknown_03005D94 + ldr r0, =gPokemonStoragePtr ldr r0, [r0] ldr r3, =0x000083c2 adds r0, r3 @@ -21195,7 +21195,7 @@ _080D218A: lsls r0, 4 add r0, r8 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 bne _080D21B4 asrs r0, r6, 16 @@ -21236,12 +21236,12 @@ _080D21D4: adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _080D21F8 adds r0, r4, 0 movs r1, 0x2D - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _080D21B8 _080D21F8: @@ -21271,7 +21271,7 @@ sub_80D2218: @ 80D2218 push {r7} sub sp, 0x4 movs r2, 0 - ldr r0, =gUnknown_03005D94 + ldr r0, =gPokemonStoragePtr mov r8, r0 movs r7, 0x4 _080D2228: @@ -21285,7 +21285,7 @@ _080D222E: adds r0, r4 movs r1, 0x5 str r2, [sp] - bl pokemon_getattr_encrypted + bl GetBoxMonData ldr r2, [sp] cmp r0, 0 bne _080D224C @@ -21321,7 +21321,7 @@ sub_80D2270: @ 80D2270 bhi _080D22C8 cmp r2, 0x1D bhi _080D22C8 - ldr r6, =gUnknown_03005D94 + ldr r6, =gPokemonStoragePtr lsls r1, r0, 2 adds r1, r0 lsls r0, r1, 4 @@ -21335,21 +21335,21 @@ sub_80D2270: @ 80D2270 lsls r4, r1, 4 adds r0, r4 movs r1, 0x5 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _080D22C8 ldr r0, [r6] adds r0, r5 adds r0, r4 movs r1, 0x6 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 bne _080D22C8 ldr r0, [r6] adds r0, r5 adds r0, r4 movs r1, 0x4 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 bne _080D22C8 movs r0, 0x1 @@ -21371,7 +21371,7 @@ sub_80D22D0: @ 80D22D0 push {r6,r7} movs r7, 0 movs r0, 0 - ldr r1, =gUnknown_03005D94 + ldr r1, =gPokemonStoragePtr mov r9, r1 _080D22E0: lsls r1, r0, 2 @@ -21390,7 +21390,7 @@ _080D22F4: adds r0, r4 adds r0, r5 movs r1, 0x5 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _080D231A mov r2, r9 @@ -21398,7 +21398,7 @@ _080D22F4: adds r0, r4 adds r0, r5 movs r1, 0x6 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 bne _080D231A adds r7, 0x1 @@ -21428,7 +21428,7 @@ sub_80D233C: @ 80D233C push {r6,r7} movs r7, 0 movs r0, 0 - ldr r1, =gUnknown_03005D94 + ldr r1, =gPokemonStoragePtr mov r9, r1 _080D234C: lsls r1, r0, 2 @@ -21447,7 +21447,7 @@ _080D2360: adds r0, r4 adds r0, r5 movs r1, 0x5 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 bne _080D2384 mov r2, r9 @@ -21455,7 +21455,7 @@ _080D2360: adds r0, r4 adds r0, r5 movs r1, 0x6 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _080D2386 _080D2384: @@ -21490,7 +21490,7 @@ sub_80D23A8: @ 80D23A8 strh r0, [r1, 0x2] movs r0, 0 mov r8, r0 - ldr r7, =gUnknown_03005D94 + ldr r7, =gPokemonStoragePtr movs r5, 0x4 _080D23C0: movs r6, 0 @@ -21500,14 +21500,14 @@ _080D23C4: adds r0, r5 adds r0, r4 movs r1, 0x5 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _080D2404 ldr r0, [r7] adds r0, r5 adds r0, r4 movs r1, 0x6 - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 bne _080D2404 ldr r0, [r7] @@ -21515,7 +21515,7 @@ _080D23C4: adds r0, r4 movs r1, 0x51 mov r2, sp - bl pokemon_getattr_encrypted + bl GetBoxMonData cmp r0, 0 beq _080D2404 movs r0, 0x1 @@ -24485,7 +24485,7 @@ sub_80D3A9C: @ 80D3A9C lsrs r0, 24 str r0, [r1] ldr r0, =gUnknown_08290705 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript pop {r0} bx r0 .pool @@ -25376,14 +25376,14 @@ _080D41D4: movs r0, 0 str r0, [r6] bl sub_80984F4 - bl script_env_2_disable + bl ScriptContext2_Disable bl unown_chamber_related lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne _080D422A ldr r0, =gUnknown_08267EDB - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript _080D422A: pop {r4-r6} pop {r0} @@ -25537,7 +25537,7 @@ sub_80D4354: @ 80D4354 bl PlaySE movs r0, 0x2 bl FieldEffectActiveListRemove - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r0} bx r0 thumb_func_end sub_80D4354 @@ -25781,13 +25781,13 @@ _080D4500: bls _080D4500 mov r0, r8 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 movs r1, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r1, r0, 0 adds r0, r4, 0 bl sub_80D45C8 @@ -26425,7 +26425,7 @@ _080D4A18: movs r1, 0x7 add r2, sp, 0xC adds r3, r4, 0 - bl Print + bl PrintTextOnWindow bl GetMapNamePopUpWindowId lsls r0, 24 lsrs r0, 24 @@ -27321,7 +27321,7 @@ sub_80D51AC: @ 80D51AC lsrs r5, r0, 24 ldr r4, =gBattleAnimArgs ldrb r0, [r4] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF @@ -27474,7 +27474,7 @@ sub_80D52D0: @ 80D52D0 bgt _080D52FC lsls r0, 24 lsrs r0, 24 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0xFF @@ -27688,7 +27688,7 @@ sub_80D5484: @ 80D5484 lsrs r5, r0, 24 ldr r4, =gBattleAnimArgs ldrb r0, [r4] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0xFF @@ -27912,7 +27912,7 @@ sub_80D5644: @ 80D5644 lsrs r4, 24 ldr r5, =gBattleAnimArgs ldrb r0, [r5] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 ldr r2, =gSprites @@ -28032,7 +28032,7 @@ sub_80D5738: @ 80D5738 movs r6, 0x1 ldr r4, =gBattleAnimArgs ldrb r0, [r4] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r7, r0, 24 movs r1, 0x8 @@ -28209,7 +28209,7 @@ _080D5894: strh r2, [r4, 0x36] ldr r1, =sub_80D58D4 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A6630 str r0, [r4, 0x1C] pop {r4} @@ -28229,7 +28229,7 @@ sub_80D58D4: @ 80D58D4 ldr r1, =sub_80A6630 str r1, [r0, 0x1C] ldr r1, =move_anim_8072740 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r0} bx r0 .pool @@ -28247,7 +28247,7 @@ sub_80D58F8: @ 80D58F8 strb r0, [r2] ldr r5, =gBattleAnimArgs ldrb r0, [r5, 0x4] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 ldrh r2, [r5] @@ -28260,7 +28260,7 @@ sub_80D58F8: @ 80D58F8 strh r2, [r4, 0x36] ldr r1, =sub_80D5944 adds r0, r4, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A6630 str r0, [r4, 0x1C] pop {r4,r5} @@ -28280,7 +28280,7 @@ sub_80D5944: @ 80D5944 ldr r1, =sub_80A6630 str r1, [r0, 0x1C] ldr r1, =move_anim_8072740 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 pop {r0} bx r0 .pool @@ -28503,7 +28503,7 @@ _080D5ADC: strb r0, [r2] ldr r1, =move_anim_8072740 adds r0, r5, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r0, =sub_80A6680 str r0, [r5, 0x1C] pop {r4-r6} @@ -28592,13 +28592,13 @@ _080D5B9C: bne _080D5C04 ldr r1, =move_anim_8072740 adds r0, r6, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 b _080D5C0C .pool _080D5C04: ldr r1, =sub_80D5C20 adds r0, r6, 0 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 _080D5C0C: ldr r0, =sub_80A6680 str r0, [r6, 0x1C] @@ -28661,7 +28661,7 @@ sub_80D5C50: @ 80D5C50 strh r0, [r5, 0xA] _080D5C82: ldrb r0, [r5] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId ldr r1, =gTasks lsls r4, r6, 2 adds r4, r6 @@ -28817,7 +28817,7 @@ sub_80D5DB0: @ 80D5DB0 cmp r0, 0 blt _080D5E10 ldrb r0, [r1] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r2, r0, 24 b _080D5E18 @@ -28944,7 +28944,7 @@ sub_80D5EB8: @ 80D5EB8 _080D5ED4: ldr r4, =gBattleAnimArgs ldrb r0, [r4, 0x8] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 ldr r2, =gTasks @@ -29145,7 +29145,7 @@ sub_80D6064: @ 80D6064 lsrs r4, 24 ldr r6, =gBattleAnimArgs ldrb r0, [r6, 0x6] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 @@ -29248,7 +29248,7 @@ sub_80D6134: @ 80D6134 lsrs r7, r0, 24 ldr r4, =gBattleAnimArgs ldrb r0, [r4, 0x4] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 mov r8, r0 @@ -29290,7 +29290,7 @@ _080D6184: strh r0, [r5, 0x12] ldrh r0, [r6, 0x6] strh r0, [r5, 0x14] - bl sub_80A4DF0 + bl IsContest lsls r0, 24 mov r8, r4 cmp r0, 0 @@ -29329,7 +29329,7 @@ _080D61DC: ldrsh r0, [r4, r3] cmp r0, 0 beq _080D6208 - bl sub_80A4DF0 + bl IsContest lsls r0, 24 cmp r0, 0 bne _080D6208 @@ -29366,7 +29366,7 @@ sub_80D622C: @ 80D622C lsrs r5, r0, 24 ldr r4, =gBattleAnimArgs ldrb r0, [r4, 0x4] - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 mov r8, r0 @@ -29599,7 +29599,7 @@ _080D63EE: ldrh r0, [r1, 0x8] strh r0, [r4, 0x1E] movs r0, 0x1 - bl obj_id_for_side_relative_to_move + bl GetAnimBankSpriteId lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x16] diff --git a/asm/rom_8145E84.s b/asm/rom_8145E84.s deleted file mode 100644 index ebc7ec266..000000000 --- a/asm/rom_8145E84.s +++ /dev/null @@ -1,60 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_8145E84 -sub_8145E84: @ 8145E84 - push {r4,lr} - ldr r4, =gUnknown_0300120B - ldrb r0, [r4] - cmp r0, 0 - beq _08145E98 - cmp r0, 0x1 - beq _08145EAC - b _08145EC0 - .pool -_08145E98: - ldr r0, =gUnknown_0300120A - ldrb r0, [r0] - bl sub_8145F6C - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _08145EC0 - .pool -_08145EAC: - bl sub_8145F20 - lsls r0, 24 - cmp r0, 0 - beq _08145EC0 - movs r0, 0 - strb r0, [r4] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 -_08145EC0: - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl UpdatePaletteFade - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145E84 - - thumb_func_start sub_8145EDC -sub_8145EDC: @ 8145EDC - push {lr} - ldr r1, =gUnknown_0300120A - strb r0, [r1] - ldr r0, =sub_8145E84 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145EDC - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_8158B30.s b/asm/rom_8158B30.s deleted file mode 100644 index 05c81dcfc..000000000 --- a/asm/rom_8158B30.s +++ /dev/null @@ -1,29569 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_8158B30 -sub_8158B30: @ 8158B30 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gTasks - lsls r6, r0, 2 - adds r6, r0 - lsls r6, 3 - adds r6, r1 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r6, 0x8] - ldrh r0, [r1, 0x2] - strh r0, [r6, 0xA] - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x3F - bl sub_80A5178 - adds r5, r0, 0 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_80A5314 - strh r4, [r6, 0xC] - strh r5, [r6, 0xE] - lsls r0, 24 - asrs r0, 24 - strh r0, [r6, 0x10] - movs r0, 0xA - strh r0, [r6, 0x1C] - ldr r0, =sub_8158B98 - str r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158B30 - - thumb_func_start sub_8158B98 -sub_8158B98: @ 8158B98 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r5, [r4, 0xC] - ldrb r6, [r4, 0x10] - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6F - bne _08158BD0 - movs r0, 0x5 - strh r0, [r4, 0x1C] - strh r1, [r4, 0x1E] - ldr r0, =sub_8158C04 - str r0, [r4] - b _08158BFE - .pool -_08158BD0: - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - bne _08158BEA - strh r1, [r4, 0x1C] - ldrh r0, [r4, 0x8] - lsls r1, r5, 24 - asrs r1, 24 - bl PlaySE12WithPanning -_08158BEA: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 16 - asrs r0, 16 - adds r0, r1 - lsls r0, 16 - asrs r0, 16 - bl sub_80A52EC - strh r0, [r4, 0xC] -_08158BFE: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8158B98 - - thumb_func_start sub_8158C04 -sub_8158C04: @ 8158C04 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _08158C4C - movs r0, 0 - strh r0, [r4, 0x1C] - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - ldrh r0, [r4, 0xA] - lsls r1, 24 - asrs r1, 24 - bl PlaySE12WithPanning - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _08158C4C - adds r0, r5, 0 - bl move_anim_related_task_del -_08158C4C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158C04 - - thumb_func_start mas_80DCF38 -mas_80DCF38: @ 8158C58 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =gBattleAnimArgs - ldrh r1, [r0] - str r1, [sp] - ldrb r5, [r0, 0x4] - ldrb r6, [r0, 0x6] - ldrb r3, [r0, 0x8] - mov r10, r3 - ldrb r7, [r0, 0xA] - ldrb r1, [r0, 0xC] - mov r9, r1 - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - bl sub_80A5178 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - asrs r5, 24 - adds r0, r5, 0 - bl sub_80A5178 - adds r5, r0, 0 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_80A5314 - ldr r2, =gTasks - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - mov r6, sp - ldrh r6, [r6] - strh r6, [r1, 0x8] - strh r4, [r1, 0xA] - strh r5, [r1, 0xC] - lsls r0, 24 - asrs r0, 24 - strh r0, [r1, 0xE] - mov r0, r10 - strh r0, [r1, 0x10] - strh r7, [r1, 0x12] - mov r3, r9 - strh r3, [r1, 0x14] - strh r2, [r1, 0x1C] - strh r4, [r1, 0x1E] - strh r3, [r1, 0x20] - ldr r2, =sub_8158D08 - str r2, [r1] - mov r0, r8 - bl _call_via_r2 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end mas_80DCF38 - - thumb_func_start sub_8158D08 -sub_8158D08: @ 8158D08 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x20] - adds r1, r0, 0x1 - strh r1, [r4, 0x20] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x14 - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08158D50 - movs r0, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x8] - movs r1, 0x1E - ldrsb r1, [r4, r1] - bl PlaySE12WithPanning - ldrh r0, [r4, 0x10] - subs r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - cmp r0, 0 - bne _08158D50 - adds r0, r5, 0 - bl move_anim_related_task_del - b _08158D82 - .pool -_08158D50: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x1C] - adds r1, r0, 0x1 - strh r1, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x12 - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08158D82 - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r0, [r4, 0xE] - ldrh r1, [r4, 0x1E] - adds r0, r1 - strh r0, [r4, 0x1E] - movs r2, 0x1E - ldrsh r0, [r4, r2] - bl sub_80A52EC - strh r0, [r4, 0x1E] -_08158D82: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158D08 - - thumb_func_start sub_8158D8C -sub_8158D8C: @ 8158D8C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08158DD0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08158DC8 - ldr r0, =gUnknown_02039F34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r4, [r0] - b _08158E76 - .pool -_08158DC8: - adds r0, r5, 0 - bl move_anim_task_del - b _08158E76 -_08158DD0: - ldr r0, =gBattleAnimArgs - movs r2, 0 - ldrsh r1, [r0, r2] - adds r2, r0, 0 - cmp r1, 0 - bne _08158DEC - ldr r0, =gAnimationBankAttacker - ldrb r4, [r0] - b _08158E12 - .pool -_08158DEC: - cmp r1, 0x1 - bne _08158DFC - ldr r0, =gAnimationBankTarget - ldrb r4, [r0] - b _08158E12 - .pool -_08158DFC: - cmp r1, 0x2 - bne _08158E08 - ldr r0, =gAnimationBankAttacker - b _08158E0A - .pool -_08158E08: - ldr r0, =gAnimationBankTarget -_08158E0A: - ldrb r1, [r0] - movs r0, 0x2 - adds r4, r0, 0 - eors r4, r1 -_08158E12: - movs r1, 0 - ldrsh r0, [r2, r1] - cmp r0, 0x1 - beq _08158E1E - cmp r0, 0x3 - bne _08158E38 -_08158E1E: - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - bne _08158E38 - adds r0, r5, 0 - bl move_anim_task_del - b _08158E8C - .pool -_08158E38: - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _08158E5C - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - b _08158E6A - .pool -_08158E5C: - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty -_08158E6A: - adds r0, r1 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 -_08158E76: - cmp r4, 0 - beq _08158E86 - lsls r1, r6, 24 - asrs r1, 24 - adds r0, r4, 0 - movs r2, 0x3 - bl PlayCry3 -_08158E86: - adds r0, r5, 0 - bl move_anim_task_del -_08158E8C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158D8C - - thumb_func_start sub_8158E9C -sub_8158E9C: @ 8158E9C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08158EE0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08158ED8 - ldr r0, =gUnknown_02039F34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r4, [r0] - b _08158F86 - .pool -_08158ED8: - adds r0, r6, 0 - bl move_anim_task_del - b _08158F86 -_08158EE0: - ldr r0, =gBattleAnimArgs - movs r2, 0 - ldrsh r1, [r0, r2] - adds r2, r0, 0 - cmp r1, 0 - bne _08158EFC - ldr r0, =gAnimationBankAttacker - ldrb r4, [r0] - b _08158F22 - .pool -_08158EFC: - cmp r1, 0x1 - bne _08158F0C - ldr r0, =gAnimationBankTarget - ldrb r4, [r0] - b _08158F22 - .pool -_08158F0C: - cmp r1, 0x2 - bne _08158F18 - ldr r0, =gAnimationBankAttacker - b _08158F1A - .pool -_08158F18: - ldr r0, =gAnimationBankTarget -_08158F1A: - ldrb r1, [r0] - movs r0, 0x2 - adds r4, r0, 0 - eors r4, r1 -_08158F22: - movs r1, 0 - ldrsh r0, [r2, r1] - cmp r0, 0x1 - beq _08158F2E - cmp r0, 0x3 - bne _08158F48 -_08158F2E: - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - bne _08158F48 - adds r0, r6, 0 - bl move_anim_task_del - b _08158FEE - .pool -_08158F48: - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _08158F6C - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - b _08158F7A - .pool -_08158F6C: - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty -_08158F7A: - adds r0, r1 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 -_08158F86: - ldr r1, =gTasks - lsls r2, r6, 2 - adds r0, r2, r6 - lsls r0, 3 - adds r0, r1 - ldr r3, =gBattleAnimArgs - ldrh r1, [r3, 0x2] - strh r1, [r0, 0x8] - strh r4, [r0, 0xA] - lsls r1, r5, 24 - asrs r1, 24 - strh r1, [r0, 0xC] - adds r5, r2, 0 - cmp r4, 0 - beq _08158FE8 - movs r2, 0x2 - ldrsh r0, [r3, r2] - cmp r0, 0xFF - bne _08158FC8 - adds r0, r4, 0 - movs r2, 0x9 - bl PlayCry3 - b _08158FD0 - .pool -_08158FC8: - adds r0, r4, 0 - movs r2, 0x7 - bl PlayCry3 -_08158FD0: - ldr r0, =gTasks - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8158FF4 - str r0, [r1] - b _08158FEE - .pool -_08158FE8: - adds r0, r6, 0 - bl move_anim_task_del -_08158FEE: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8158E9C - - thumb_func_start sub_8158FF4 -sub_8158FF4: @ 8158FF4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - mov r9, r4 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - ldrh r6, [r1, 0xA] - mov r8, r6 - ldrb r5, [r1, 0xC] - adds r7, r5, 0 - ldrh r2, [r1, 0x1A] - movs r3, 0x1A - ldrsh r0, [r1, r3] - cmp r0, 0x1 - bgt _08159028 - adds r0, r2, 0x1 - strh r0, [r1, 0x1A] - b _0815906A - .pool -_08159028: - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0xFF - bne _0815904E - bl IsCryPlaying - lsls r0, 24 - cmp r0, 0 - bne _0815906A - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0xA - bl PlayCry3 - adds r0, r4, 0 - bl move_anim_task_del - b _0815906A -_0815904E: - bl IsCryPlaying - lsls r0, 24 - cmp r0, 0 - bne _0815906A - lsls r1, r7, 24 - asrs r1, 24 - mov r0, r8 - movs r2, 0x8 - bl PlayCry3 - mov r0, r9 - bl move_anim_task_del -_0815906A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8158FF4 - - thumb_func_start sub_8159078 -sub_8159078: @ 8159078 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0x1A] - movs r3, 0x1A - ldrsh r0, [r1, r3] - cmp r0, 0x1 - bgt _081590A0 - adds r0, r2, 0x1 - strh r0, [r1, 0x1A] - b _081590B0 - .pool -_081590A0: - bl IsCryPlaying - lsls r0, 24 - cmp r0, 0 - bne _081590B0 - adds r0, r4, 0 - bl move_anim_task_del -_081590B0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8159078 - - thumb_func_start sub_81590B8 -sub_81590B8: @ 81590B8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =gBattleAnimArgs - ldrh r1, [r1] - strh r1, [r0, 0x1C] - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _081590F8 - ldr r0, =gUnknown_02039F34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - b _08159102 - .pool -_081590F8: - ldr r1, =gUnknown_02038438 - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 -_08159102: - ldrh r2, [r0] - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - strh r2, [r1, 0xA] - lsls r0, r5, 24 - asrs r0, 24 - strh r0, [r1, 0xC] - cmp r2, 0 - beq _08159130 - ldr r0, =sub_815913C - str r0, [r1] - b _08159136 - .pool -_08159130: - adds r0, r4, 0 - bl move_anim_task_del -_08159136: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81590B8 - - thumb_func_start sub_815913C -sub_815913C: @ 815913C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r6, [r0, 0xA] - mov r8, r6 - ldrb r3, [r0, 0xC] - adds r5, r3, 0 - movs r7, 0x1A - ldrsh r2, [r0, r7] - mov r12, r1 - cmp r2, 0x5 - bhi _081591DC - lsls r0, r2, 2 - ldr r1, =_08159174 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08159174: - .4byte _081591C2 - .4byte _081591A8 - .4byte _0815918C - .4byte _081591A8 - .4byte _081591A8 - .4byte _081591B8 -_0815918C: - lsls r1, r5, 24 - asrs r1, 24 - mov r0, r8 - movs r2, 0x4 - bl PlayCry6 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - b _081591B0 - .pool -_081591A8: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - add r0, r12 -_081591B0: - ldrh r1, [r0, 0x1A] - adds r1, 0x1 - strh r1, [r0, 0x1A] - b _08159204 -_081591B8: - bl IsCryPlaying - lsls r0, 24 - cmp r0, 0 - bne _08159204 -_081591C2: - bl StopCryAndClearCrySongs - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x1A] - adds r0, 0x1 - strh r0, [r1, 0x1A] - b _08159204 - .pool -_081591DC: - movs r1, 0x1C - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _081591F2 - lsls r1, r3, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0x6 - bl PlayCry6 - b _081591FE -_081591F2: - lsls r1, r5, 24 - asrs r1, 24 - mov r0, r8 - movs r2, 0x6 - bl PlayCry3 -_081591FE: - adds r0, r4, 0 - bl move_anim_task_del -_08159204: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815913C - - thumb_func_start sub_8159210 -sub_8159210: @ 8159210 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gBattleAnimArgs - ldrh r5, [r0] - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - adds r0, r5, 0 - bl PlaySE1WithPanning - adds r0, r4, 0 - bl move_anim_task_del - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159210 - - thumb_func_start sub_8159244 -sub_8159244: @ 8159244 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gBattleAnimArgs - ldrh r5, [r0] - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - adds r0, r5, 0 - bl PlaySE2WithPanning - adds r0, r4, 0 - bl move_anim_task_del - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159244 - - thumb_func_start sub_8159278 -sub_8159278: @ 8159278 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - mov r8, r0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =gBattleAnimArgs - ldrb r5, [r0, 0x2] - ldrb r6, [r0, 0x4] - ldrh r1, [r0, 0x6] - mov r9, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - bl sub_80A5178 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - asrs r5, 24 - adds r0, r5, 0 - bl sub_80A5178 - adds r5, r0, 0 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_80A5314 - ldr r2, =gTasks - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - strh r4, [r1, 0xA] - strh r5, [r1, 0xC] - lsls r0, 24 - asrs r0, 24 - strh r0, [r1, 0xE] - mov r0, r9 - strh r0, [r1, 0x12] - strh r2, [r1, 0x1C] - strh r4, [r1, 0x1E] - ldr r2, =sub_8159308 - str r2, [r1] - mov r0, r8 - bl _call_via_r2 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159278 - - thumb_func_start sub_8159308 -sub_8159308: @ 8159308 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r2, [r4, 0xE] - ldrh r0, [r4, 0x1C] - adds r1, r0, 0x1 - strh r1, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x12 - ldrsh r1, [r4, r3] - cmp r0, r1 - bne _08159342 - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - adds r0, r2, r1 - strh r0, [r4, 0x1E] - movs r2, 0x1E - ldrsh r0, [r4, r2] - bl sub_80A52EC - strh r0, [r4, 0x1E] -_08159342: - ldr r1, =gUnknown_02038440 - ldrh r0, [r4, 0x1E] - strb r0, [r1] - movs r3, 0x1E - ldrsh r1, [r4, r3] - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _0815935A - adds r0, r5, 0 - bl move_anim_task_del -_0815935A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159308 - - thumb_func_start nullsub_114 -nullsub_114: @ 8159368 - bx lr - thumb_func_end nullsub_114 - - thumb_func_start sub_815936C -sub_815936C: @ 815936C - ldr r1, =gBattleBankFunc - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl6 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_815936C - - thumb_func_start bx_exec_buffer_A_ch0_tbl6 -bx_exec_buffer_A_ch0_tbl6: @ 8159388 - push {lr} - ldr r2, =gBattleExecBuffer - ldr r1, =gBitTable - ldr r0, =gActiveBank - ldrb r3, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _081593D4 - ldr r0, =gBattleBufferA - lsls r1, r3, 9 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x38 - bhi _081593D0 - ldr r0, =gUnknown_085CDF20 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - b _081593D4 - .pool -_081593D0: - bl dp01_tbl6_exec_completed -_081593D4: - pop {r0} - bx r0 - thumb_func_end bx_exec_buffer_A_ch0_tbl6 - - thumb_func_start bx_battle_menu_t6_2 -bx_battle_menu_t6_2: @ 81593D8 - push {r4,r5,lr} - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08159446 - movs r0, 0x5 - bl PlaySE - ldr r1, =gUnknown_020244AC - ldr r0, =gActiveBank - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08159424 - cmp r0, 0x1 - bgt _08159414 - cmp r0, 0 - beq _0815941E - b _08159440 - .pool -_08159414: - cmp r0, 0x2 - beq _0815942A - cmp r0, 0x3 - beq _08159436 - b _08159440 -_0815941E: - movs r0, 0x1 - movs r1, 0x5 - b _0815942E -_08159424: - movs r0, 0x1 - movs r1, 0x6 - b _0815942E -_0815942A: - movs r0, 0x1 - movs r1, 0x7 -_0815942E: - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - b _08159440 -_08159436: - movs r0, 0x1 - movs r1, 0x8 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb -_08159440: - bl dp01_tbl6_exec_completed - b _0815954E -_08159446: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08159484 - ldr r5, =gUnknown_020244AC - ldr r4, =gActiveBank - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _0815954E - movs r0, 0x5 - bl PlaySE - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x1 - b _081594F2 - .pool -_08159484: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081594C0 - ldr r5, =gUnknown_020244AC - ldr r4, =gActiveBank - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _0815954E - movs r0, 0x5 - bl PlaySE - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x1 - b _081594F2 - .pool -_081594C0: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0815950C - ldr r5, =gUnknown_020244AC - ldr r4, =gActiveBank - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0815954E - movs r0, 0x5 - bl PlaySE - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x2 -_081594F2: - eors r0, r2 - strb r0, [r1] - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl sub_8059CB4 - b _0815954E - .pool -_0815950C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0815954E - ldr r5, =gUnknown_020244AC - ldr r4, =gActiveBank - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0815954E - movs r0, 0x5 - bl PlaySE - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x2 - eors r0, r2 - strb r0, [r1] - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl sub_8059CB4 -_0815954E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end bx_battle_menu_t6_2 - - thumb_func_start sub_815955C -sub_815955C: @ 815955C - push {lr} - ldr r2, =gSprites - ldr r1, =gBankSpriteIds - ldr r0, =gActiveBank - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _08159580 - bl dp01_tbl6_exec_completed -_08159580: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815955C - - thumb_func_start bx_t6_button_a -bx_t6_button_a: @ 8159594 - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _081595A6 - bl dp01_tbl6_exec_completed -_081595A6: - pop {r0} - bx r0 - thumb_func_end bx_t6_button_a - - thumb_func_start sub_81595AC -sub_81595AC: @ 81595AC - push {lr} - ldr r2, =gSprites - ldr r1, =gUnknown_03005D70 - ldr r0, =gActiveBank - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _081595D0 - bl dp01_tbl6_exec_completed -_081595D0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81595AC - - thumb_func_start sub_81595E4 -sub_81595E4: @ 81595E4 - push {lr} - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0815960E - ldr r2, =gMain - ldr r0, =0x00000439 - adds r3, r2, r0 - ldrb r1, [r3] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldr r0, =gUnknown_03005D00 - ldr r0, [r0] - str r0, [r2] - ldr r0, [r2, 0x8] - bl SetMainCallback2 -_0815960E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81595E4 - - thumb_func_start bx_wait_t6 -bx_wait_t6: @ 8159624 - push {lr} - ldr r0, =gDoingBattleAnim - ldrb r0, [r0] - cmp r0, 0 - beq _0815964A - ldr r0, =gUnknown_020244D0 - ldr r2, [r0] - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0815964E -_0815964A: - bl dp01_tbl6_exec_completed -_0815964E: - pop {r0} - bx r0 - .pool - thumb_func_end bx_wait_t6 - - thumb_func_start sub_8159660 -sub_8159660: @ 8159660 - push {lr} - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08159684 - ldr r1, =gBattleBankFunc - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8159698 - str r1, [r0] - bl FreeAllWindowBuffers - bl sub_81358F4 -_08159684: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159660 - - thumb_func_start sub_8159698 -sub_8159698: @ 8159698 - push {lr} - ldr r0, =gMain - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _081596BE - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081596BE - ldr r0, =gUnknown_0203CE7C - ldrh r1, [r0] - movs r0, 0x1 - bl dp01_build_cmdbuf_x23_aa_0 - bl dp01_tbl6_exec_completed -_081596BE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159698 - - thumb_func_start sub_81596D4 -sub_81596D4: @ 81596D4 - push {lr} - ldr r0, =gUnknown_020244D0 - ldr r2, [r0] - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081596F6 - bl dp01_tbl6_exec_completed -_081596F6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81596D4 - - thumb_func_start dp01_tbl6_exec_completed -dp01_tbl6_exec_completed: @ 8159704 - push {r4,lr} - sub sp, 0x4 - ldr r1, =gBattleBankFunc - ldr r4, =gActiveBank - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl6 - str r1, [r0] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08159758 - bl link_get_multiplayer_id - mov r1, sp - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - mov r2, sp - bl PrepareBufferDataTransferLink - ldr r1, =gBattleBufferA - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _0815976A - .pool -_08159758: - ldr r2, =gBattleExecBuffer - ldr r1, =gBitTable - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] -_0815976A: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_tbl6_exec_completed - - thumb_func_start bx_80364D0 -bx_80364D0: @ 815977C - push {lr} - ldr r0, =gUnknown_020244D0 - ldr r2, [r0] - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0815979E - bl dp01_tbl6_exec_completed -_0815979E: - pop {r0} - bx r0 - .pool - thumb_func_end bx_80364D0 - - thumb_func_start sub_81597AC -sub_81597AC: @ 81597AC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597AC - - thumb_func_start sub_81597B8 -sub_81597B8: @ 81597B8 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597B8 - - thumb_func_start sub_81597C4 -sub_81597C4: @ 81597C4 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597C4 - - thumb_func_start sub_81597D0 -sub_81597D0: @ 81597D0 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597D0 - - thumb_func_start sub_81597DC -sub_81597DC: @ 81597DC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597DC - - thumb_func_start sub_81597E8 -sub_81597E8: @ 81597E8 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597E8 - - thumb_func_start sub_81597F4 -sub_81597F4: @ 81597F4 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597F4 - - thumb_func_start sub_8159800 -sub_8159800: @ 8159800 - push {r4-r6,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldrb r0, [r0, 0x8] - ldr r5, =gActiveBank - ldrb r1, [r5] - bl sub_805DF84 - ldr r0, [r4] - ldrb r6, [r0, 0x8] - ldrb r0, [r5] - bl GetBankIdentity - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl template_build_for_pokemon_or_trainer - ldr r0, =gUnknown_0202499C - ldr r2, =gUnknown_08305D2C - ldr r1, [r4] - ldrb r1, [r1, 0x8] - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1] - movs r2, 0x8 - subs r2, r1 - lsls r2, 18 - movs r1, 0xA0 - lsls r1, 15 - adds r2, r1 - asrs r2, 16 - movs r1, 0x50 - movs r3, 0x1E - bl CreateSprite - ldr r6, =gBankSpriteIds - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =gSprites - ldrb r3, [r5] - adds r0, r3, r6 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xF0 - strh r1, [r0, 0x24] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000fffe - strh r1, [r0, 0x2E] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =sub_805D7AC - str r1, [r0] - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_815955C - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159800 - - thumb_func_start sub_81598E0 -sub_81598E0: @ 81598E0 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81598E0 - - thumb_func_start sub_81598EC -sub_81598EC: @ 81598EC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81598EC - - thumb_func_start sub_81598F8 -sub_81598F8: @ 81598F8 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81598F8 - - thumb_func_start sub_8159904 -sub_8159904: @ 8159904 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159904 - - thumb_func_start sub_8159910 -sub_8159910: @ 8159910 - push {r4,r5,lr} - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r1, [r0, 0x8] - movs r0, 0x4 - strb r0, [r1, 0x8] - ldr r1, =gDoingBattleAnim - movs r0, 0x1 - strb r0, [r1] - ldr r5, =gActiveBank - ldrb r4, [r5] - movs r0, 0x1 - bl GetBankByPlayerAI - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r4, 0 - movs r3, 0x4 - bl move_anim_start_t4 - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_wait_t6 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159910 - - thumb_func_start sub_8159964 -sub_8159964: @ 8159964 - push {r4,r5,lr} - ldr r1, =gBattleBufferA - ldr r5, =gActiveBank - ldrb r0, [r5] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r1, [r0] - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - strb r1, [r0, 0x8] - ldr r1, =gDoingBattleAnim - movs r0, 0x1 - strb r0, [r1] - ldrb r4, [r5] - movs r0, 0x1 - bl GetBankByPlayerAI - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r4, 0 - movs r3, 0x4 - bl move_anim_start_t4 - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_wait_t6 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159964 - - thumb_func_start sub_81599C4 -sub_81599C4: @ 81599C4 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81599C4 - - thumb_func_start sub_81599D0 -sub_81599D0: @ 81599D0 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81599D0 - - thumb_func_start dp01t_10_6_message -dp01t_10_6_message: @ 81599DC - push {r4,lr} - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r4, =gActiveBank - ldrb r0, [r4] - lsls r0, 9 - ldr r1, =gUnknown_02023066 - adds r0, r1 - ldrh r0, [r0] - bl battle_pick_message - ldr r0, =gUnknown_02022E2C - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_t6_button_a - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_10_6_message - - thumb_func_start dp01t_11_6_message_for_player_only -dp01t_11_6_message_for_player_only: @ 8159A30 - push {lr} - ldr r0, =gActiveBank - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _08159A4C - bl dp01t_10_6_message - b _08159A50 - .pool -_08159A4C: - bl dp01_tbl6_exec_completed -_08159A50: - pop {r0} - bx r0 - thumb_func_end dp01t_11_6_message_for_player_only - - thumb_func_start sub_8159A54 -sub_8159A54: @ 8159A54 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08159A7A - ldr r0, =gUnknown_02022E14 - strh r1, [r0] - ldr r1, =gUnknown_02022E16 - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gBattleBankFunc - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_battle_menu_t6_2 - str r1, [r0] -_08159A7A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159A54 - - thumb_func_start sub_8159A94 -sub_8159A94: @ 8159A94 - push {r4,lr} - ldr r1, =gBattleBankFunc - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8159A54 - str r1, [r0] - ldr r0, =gUnknown_085CCA54 - movs r1, 0x2 - bl battle_show_message_maybe - movs r4, 0 -_08159AAE: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_8059CF8 - adds r4, 0x1 - cmp r4, 0x3 - ble _08159AAE - ldr r1, =gUnknown_020244AC - ldr r0, =gActiveBank - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl sub_8059CB4 - ldr r0, =gUnknown_085CCA04 - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C - movs r1, 0x1 - bl battle_show_message_maybe - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159A94 - - thumb_func_start sub_8159AFC -sub_8159AFC: @ 8159AFC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159AFC - - thumb_func_start sub_8159B08 -sub_8159B08: @ 8159B08 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159B08 - - thumb_func_start sub_8159B14 -sub_8159B14: @ 8159B14 - push {lr} - sub sp, 0x4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gBattleBankFunc - ldr r2, =gActiveBank - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8159660 - str r1, [r0] - ldr r1, =gUnknown_020244B8 - ldrb r0, [r2] - strb r0, [r1] - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159B14 - - thumb_func_start sub_8159B54 -sub_8159B54: @ 8159B54 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159B54 - - thumb_func_start sub_8159B60 -sub_8159B60: @ 8159B60 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159B60 - - thumb_func_start sub_8159B6C -sub_8159B6C: @ 8159B6C - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159B6C - - thumb_func_start sub_8159B78 -sub_8159B78: @ 8159B78 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159B78 - - thumb_func_start sub_8159B84 -sub_8159B84: @ 8159B84 - push {lr} - ldr r0, =gUnknown_03005D70 - ldr r1, =gActiveBank - ldrb r1, [r1] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =gBattlePartyID - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =gPlayerParty - adds r1, r2 - movs r2, 0xB - bl healthbar_draw_field_maybe - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159B84 - - thumb_func_start sub_8159BC0 -sub_8159BC0: @ 8159BC0 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159BC0 - - thumb_func_start sub_8159BCC -sub_8159BCC: @ 8159BCC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159BCC - - thumb_func_start sub_8159BD8 -sub_8159BD8: @ 8159BD8 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159BD8 - - thumb_func_start sub_8159BE4 -sub_8159BE4: @ 8159BE4 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159BE4 - - thumb_func_start sub_8159BF0 -sub_8159BF0: @ 8159BF0 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159BF0 - - thumb_func_start sub_8159BFC -sub_8159BFC: @ 8159BFC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159BFC - - thumb_func_start sub_8159C08 -sub_8159C08: @ 8159C08 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C08 - - thumb_func_start sub_8159C14 -sub_8159C14: @ 8159C14 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C14 - - thumb_func_start sub_8159C20 -sub_8159C20: @ 8159C20 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C20 - - thumb_func_start sub_8159C2C -sub_8159C2C: @ 8159C2C - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C2C - - thumb_func_start sub_8159C38 -sub_8159C38: @ 8159C38 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C38 - - thumb_func_start sub_8159C44 -sub_8159C44: @ 8159C44 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C44 - - thumb_func_start sub_8159C50 -sub_8159C50: @ 8159C50 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C50 - - thumb_func_start sub_8159C5C -sub_8159C5C: @ 8159C5C - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C5C - - thumb_func_start sub_8159C68 -sub_8159C68: @ 8159C68 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C68 - - thumb_func_start sub_8159C74 -sub_8159C74: @ 8159C74 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C74 - - thumb_func_start sub_8159C80 -sub_8159C80: @ 8159C80 - push {r4,lr} - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _08159C94 - movs r3, 0xC0 -_08159C94: - ldr r2, =gBattleBufferA - ldrb r1, [r4] - lsls r1, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - lsls r1, r3, 24 - asrs r1, 24 - bl PlaySE12WithPanning - bl dp01_tbl6_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159C80 - - thumb_func_start dp01t_34_6_move_anim_start_t3 -dp01t_34_6_move_anim_start_t3: @ 8159CC4 - push {r4,r5,lr} - ldr r4, =gBattleBufferA - ldr r5, =gActiveBank - ldrb r0, [r5] - lsls r3, r0, 9 - adds r0, r4, 0x3 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _08159D00 - bl sub_805EA60 - ldrb r1, [r5] - lsls r1, 9 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, r4, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl PlayBGM - b _08159D14 - .pool -_08159D00: - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl PlayFanfare -_08159D14: - bl dp01_tbl6_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end dp01t_34_6_move_anim_start_t3 - - thumb_func_start sub_8159D20 -sub_8159D20: @ 8159D20 - push {lr} - ldr r1, =gBattlePartyID - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - bl PlayCry1 - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159D20 - - thumb_func_start dp01t_2E_6_battle_intro -dp01t_2E_6_battle_intro: @ 8159D5C - push {lr} - ldr r1, =gBattleBufferA - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =gUnknown_020243FC - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_2E_6_battle_intro - - thumb_func_start sub_8159D90 -sub_8159D90: @ 8159D90 - push {r4,r5,lr} - ldr r5, =gUnknown_03005D70 - ldr r4, =gActiveBank - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =gBattlePartyID - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =gPlayerParty - adds r1, r2 - movs r2, 0xA - bl healthbar_draw_field_maybe - ldrb r0, [r4] - bl sub_8076918 - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_80729D0 - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81595AC - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159D90 - - thumb_func_start sub_8159DEC -sub_8159DEC: @ 8159DEC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159DEC - - thumb_func_start sub_8159DF8 -sub_8159DF8: @ 8159DF8 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159DF8 - - thumb_func_start sub_8159E04 -sub_8159E04: @ 8159E04 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159E04 - - thumb_func_start sub_8159E10 -sub_8159E10: @ 8159E10 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159E10 - - thumb_func_start sub_8159E1C -sub_8159E1C: @ 8159E1C - push {r4-r6,lr} - sub sp, 0x4 - ldr r5, =gBattleBufferA - ldr r6, =gActiveBank - ldrb r2, [r6] - lsls r1, r2, 9 - adds r0, r5, 0x1 - adds r0, r1, r0 - ldrb r3, [r0] - adds r0, r5, 0x2 - adds r0, r1, r0 - ldrb r4, [r0] - adds r5, 0x3 - adds r1, r5 - ldrb r0, [r1] - lsls r0, 8 - orrs r4, r0 - str r4, [sp] - adds r0, r2, 0 - adds r1, r2, 0 - bl move_anim_start_t3 - lsls r0, 24 - cmp r0, 0 - beq _08159E5C - bl dp01_tbl6_exec_completed - b _08159E68 - .pool -_08159E5C: - ldr r0, =gBattleBankFunc - ldrb r1, [r6] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_81596D4 - str r0, [r1] -_08159E68: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159E1C - - thumb_func_start sub_8159E78 -sub_8159E78: @ 8159E78 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159E78 - - thumb_func_start sub_8159E84 -sub_8159E84: @ 8159E84 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159E84 - - thumb_func_start sub_8159E90 -sub_8159E90: @ 8159E90 - push {r4,lr} - ldr r2, =gBattleOutcome - ldr r1, =gBattleBufferA - ldr r4, =gActiveBank - ldrb r0, [r4] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - movs r0, 0x5 - bl FadeOutMapMusic - movs r0, 0x3 - bl BeginFastPaletteFade - bl dp01_tbl6_exec_completed - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x6 - ands r0, r1 - cmp r0, 0x2 - bne _08159ECC - ldr r0, =gBattleBankFunc - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_81595E4 - str r0, [r1] -_08159ECC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159E90 - - thumb_func_start nullsub_115 -nullsub_115: @ 8159EEC - bx lr - thumb_func_end nullsub_115 - - thumb_func_start sub_8159EF0 -sub_8159EF0: @ 8159EF0 - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =hm2_sweet_scent - str r0, [r1] - movs r0, 0x1 - bx lr - .pool - thumb_func_end sub_8159EF0 - - thumb_func_start hm2_sweet_scent -hm2_sweet_scent: @ 8159F10 - push {lr} - movs r0, 0x33 - bl FieldEffectStart - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end hm2_sweet_scent - - thumb_func_start sub_8159F2C -sub_8159F2C: @ 8159F2C - push {lr} - bl sub_80AC3D0 - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_8159F5C - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8159F2C - - thumb_func_start sub_8159F5C -sub_8159F5C: @ 8159F5C - push {r4,r5,lr} - sub sp, 0x4 - movs r0, 0xEC - bl PlaySE - ldr r5, =gPlttBufferUnfaded - ldr r1, =sPaletteDecompressionBuffer - movs r4, 0x80 - lsls r4, 1 - adds r0, r5, 0 - adds r2, r4, 0 - bl CpuFastSet - ldr r0, =gPlttBufferFaded - adds r1, r5, 0 - adds r2, r4, 0 - bl CpuFastSet - bl GetPlayerAvatarObjectId - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - mvns r0, r0 - movs r1, 0x1F - str r1, [sp] - movs r1, 0x4 - movs r2, 0 - movs r3, 0x8 - bl BeginNormalPaletteFade - ldr r0, =sub_8159FEC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x8] - movs r0, 0x33 - bl FieldEffectActiveListRemove - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159F5C - - thumb_func_start sub_8159FEC -sub_8159FEC: @ 8159FEC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _0815A088 - bl sub_81BE72C - movs r0, 0x40 - movs r1, 0x8 - movs r2, 0x1F - bl BlendPalettes - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r4, r1, r0 - ldrh r1, [r4, 0x8] - movs r2, 0x8 - ldrsh r0, [r4, r2] - cmp r0, 0x40 - bne _0815A084 - strh r6, [r4, 0x8] - bl sub_80B5578 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815A044 - adds r0, r5, 0 - bl DestroyTask - b _0815A088 - .pool -_0815A044: - ldr r0, =sub_815A090 - str r0, [r4] - bl GetPlayerAvatarObjectId - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - mvns r0, r0 - movs r1, 0x1F - str r1, [sp] - movs r1, 0x4 - movs r2, 0x8 - movs r3, 0 - bl BeginNormalPaletteFade - bl sub_81BE6B8 - b _0815A088 - .pool -_0815A084: - adds r0, r1, 0x1 - strh r0, [r4, 0x8] -_0815A088: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8159FEC - - thumb_func_start sub_815A090 -sub_815A090: @ 815A090 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0815A0BE - ldr r0, =sPaletteDecompressionBuffer - ldr r1, =gPlttBufferUnfaded - movs r2, 0x80 - lsls r2, 1 - bl CpuFastSet - bl sub_80AC3E4 - ldr r0, =gUnknown_08290CAE - bl script_env_1_execute_new_script - adds r0, r4, 0 - bl DestroyTask -_0815A0BE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A090 - - thumb_func_start sub_815A0D4 -sub_815A0D4: @ 815A0D4 - push {lr} - adds r2, r0, 0 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - ldrh r3, [r2, 0x20] - adds r0, r3 - strh r0, [r2, 0x20] - ldrh r0, [r1, 0x2] - ldrh r3, [r2, 0x22] - adds r0, r3 - strh r0, [r2, 0x22] - movs r3, 0x6 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _0815A0FC - ldrh r0, [r1, 0x4] - b _0815A100 - .pool -_0815A0FC: - ldrh r0, [r1, 0x4] - negs r0, r0 -_0815A100: - strh r0, [r2, 0x2E] - ldrh r0, [r1, 0x8] - strh r0, [r2, 0x30] - ldr r0, =sub_815A114 - str r0, [r2, 0x1C] - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A0D4 - - thumb_func_start sub_815A114 -sub_815A114: @ 815A114 - push {lr} - adds r3, r0, 0 - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0 - ble _0815A154 - ldrh r1, [r3, 0x32] - lsls r0, r1, 16 - asrs r0, 24 - strh r0, [r3, 0x24] - ldrh r0, [r3, 0x2E] - adds r1, r0 - strh r1, [r3, 0x32] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - b _0815A15A -_0815A154: - adds r0, r3, 0 - bl move_anim_8072740 -_0815A15A: - pop {r0} - bx r0 - thumb_func_end sub_815A114 - - thumb_func_start sub_815A160 -sub_815A160: @ 815A160 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =gAnimationBankTarget - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 8 - movs r0, 0x80 - lsls r0, 12 - adds r4, r0 - asrs r4, 16 - ldrb r0, [r6] - movs r1, 0x3 - bl sub_80A5C6C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 8 - movs r0, 0x80 - lsls r0, 12 - adds r1, r0 - asrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - bl sub_807521C - adds r0, r5, 0 - bl move_anim_task_del - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A160 - - thumb_func_start sub_815A1B0 -sub_815A1B0: @ 815A1B0 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5A - strh r0, [r4, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] - movs r0, 0x7 - strh r0, [r4, 0x30] - ldr r1, =sub_815A1F4 - adds r0, r4, 0 - bl oamt_set_x3A_32 - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r0, [r4, 0x30] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A1B0 - - thumb_func_start sub_815A1F4 -sub_815A1F4: @ 815A1F4 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0x30] - subs r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bge _0815A228 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815A234 - str r0, [r4, 0x1C] -_0815A228: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A1F4 - - thumb_func_start sub_815A234 -sub_815A234: @ 815A234 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_8072740 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815A234 - - thumb_func_start sub_815A254 -sub_815A254: @ 815A254 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldr r4, =gAnimationBankTarget - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A6980 - ldrh r0, [r5, 0x20] - subs r0, r7 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r5, 0x22] - subs r1, r6 - lsls r1, 16 - asrs r1, 16 - bl sub_80A74F4 - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 23 - adds r0, r1 - lsrs r4, r0, 16 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815A2B2 - movs r1, 0x80 - lsls r1, 7 - adds r0, r4, r1 - lsls r0, 16 - lsrs r4, r0, 16 -_0815A2B2: - movs r3, 0x80 - lsls r3, 1 - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - adds r2, r3, 0 - bl sub_80A73E0 - ldr r0, =gBattleAnimArgs - ldrh r0, [r0, 0x4] - strh r0, [r5, 0x2E] - strh r7, [r5, 0x32] - strh r6, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A254 - - thumb_func_start sub_815A2F0 -sub_815A2F0: @ 815A2F0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x4 - strh r0, [r4, 0x2E] - ldr r0, =sub_815A31C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A2F0 - - thumb_func_start sub_815A31C -sub_815A31C: @ 815A31C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815A342 - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - b _0815A346 -_0815A342: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 -_0815A346: - strh r0, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0xF - beq _0815A354 - cmp r0, 0x4 - bne _0815A35C -_0815A354: - ldrh r0, [r4, 0x30] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0x30] -_0815A35C: - ldrh r0, [r4, 0x32] - adds r1, r0, 0x1 - strh r1, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x46 - ble _0815A3A0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - movs r0, 0 - strh r0, [r4, 0x32] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - subs r2, 0x12 - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815A3AC - str r0, [r4, 0x1C] -_0815A3A0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A31C - - thumb_func_start sub_815A3AC -sub_815A3AC: @ 815A3AC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x32] - adds r1, r0, 0x1 - strh r1, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - ble _0815A3E8 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - subs r2, 0x12 - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - adds r0, r3, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815A3E8 - ldr r0, =sub_815A3F0 - str r0, [r3, 0x1C] -_0815A3E8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A3AC - - thumb_func_start sub_815A3F0 -sub_815A3F0: @ 815A3F0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x6 - bhi _0815A448 - lsls r0, 2 - ldr r1, =_0815A40C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815A40C: - .4byte _0815A428 - .4byte _0815A428 - .4byte _0815A432 - .4byte _0815A432 - .4byte _0815A440 - .4byte _0815A440 - .4byte _0815A448 -_0815A428: - movs r1, 0 - movs r0, 0x1 - strh r0, [r4, 0x24] - strh r1, [r4, 0x26] - b _0815A450 -_0815A432: - ldr r0, =0x0000ffff - strh r0, [r4, 0x24] - movs r0, 0 - b _0815A44E - .pool -_0815A440: - movs r0, 0 - strh r0, [r4, 0x24] - movs r0, 0x1 - b _0815A44E -_0815A448: - movs r0, 0 - strh r0, [r4, 0x24] - ldr r0, =0x0000ffff -_0815A44E: - strh r0, [r4, 0x26] -_0815A450: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - movs r2, 0 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0815A462 - strh r2, [r4, 0x34] -_0815A462: - ldrh r0, [r4, 0x36] - adds r1, r0, 0x1 - strh r1, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _0815A48C - movs r0, 0x10 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x30] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r4, 0x2E] - movs r0, 0x52 - bl SetGpuReg - ldr r0, =sub_815A49C - str r0, [r4, 0x1C] -_0815A48C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A3F0 - - thumb_func_start sub_815A49C -sub_815A49C: @ 815A49C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0x30] - adds r1, r0, 0x1 - strh r1, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815A4CC - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] -_0815A4CC: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815A4E0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0815A4E0: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _0815A4FE - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_8072740 -_0815A4FE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815A49C - - thumb_func_start sub_815A504 -sub_815A504: @ 815A504 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_815A52C - str r0, [r1] - ldr r1, =gAnimVisualTaskCount - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_815A504 - - thumb_func_start sub_815A52C -sub_815A52C: @ 815A52C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A6D94 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gTasks - lsls r5, r4, 2 - adds r1, r5, r4 - lsls r1, 3 - adds r1, r7 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815A59C - ldr r0, =gPlttBufferFaded - lsls r2, r6, 4 - adds r1, r2, 0 - adds r1, 0xB - lsls r1, 1 - adds r1, r0 - ldrh r3, [r1] - mov r8, r3 - movs r3, 0xA - mov r9, r7 - adds r7, r5, 0 - mov r12, r0 - adds r5, r2, 0 - lsls r0, r6, 5 - add r0, r12 - adds r2, r0, 0 - adds r2, 0x14 -_0815A57A: - ldrh r0, [r2] - strh r0, [r1] - subs r2, 0x2 - subs r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bgt _0815A57A - adds r0, r5, 0x1 - lsls r0, 1 - add r0, r12 - movs r1, 0 - mov r2, r8 - strh r2, [r0] - adds r0, r7, r4 - lsls r0, 3 - add r0, r9 - strh r1, [r0, 0x12] -_0815A59C: - ldr r0, =gBattleAnimArgs - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0815A5AC - adds r0, r4, 0 - bl DestroyTask -_0815A5AC: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A52C - - thumb_func_start c3_80DE6F0 -c3_80DE6F0: @ 815A5C8 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_815A5F0 - str r0, [r1] - ldr r1, =gAnimVisualTaskCount - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end c3_80DE6F0 - - thumb_func_start sub_815A5F0 -sub_815A5F0: @ 815A5F0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl sub_80A6D94 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =gTasks - mov r0, r8 - lsls r3, r0, 2 - adds r1, r3, r0 - lsls r1, 3 - adds r1, r5 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815A692 - ldr r0, =gPlttBufferFaded - lsls r2, r7, 4 - adds r1, r2, 0 - adds r1, 0xB - lsls r1, 1 - adds r1, r0 - ldrh r6, [r1] - movs r4, 0xA - mov r10, r3 - mov r9, r0 - adds r5, r2, 0 - ldr r2, =gPlttBufferUnfaded - mov r12, r2 - lsls r0, r7, 5 - add r0, r9 - adds r3, r0, 0 - adds r3, 0x14 -_0815A644: - ldrh r0, [r3] - strh r0, [r1] - subs r3, 0x2 - subs r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bgt _0815A644 - adds r0, r5, 0x1 - lsls r0, 1 - add r0, r9 - strh r6, [r0] - adds r1, r5, 0 - adds r1, 0xB - lsls r1, 1 - add r1, r12 - ldrh r6, [r1] - movs r4, 0xA - lsls r0, r7, 5 - add r0, r12 - adds r2, r0, 0 - adds r2, 0x14 -_0815A66E: - ldrh r0, [r2] - strh r0, [r1] - subs r2, 0x2 - subs r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bgt _0815A66E - adds r0, r5, 0x1 - lsls r0, 1 - add r0, r12 - movs r1, 0 - strh r6, [r0] - mov r0, r10 - add r0, r8 - lsls r0, 3 - ldr r2, =gTasks - adds r0, r2 - strh r1, [r0, 0x12] -_0815A692: - ldr r0, =gBattleAnimArgs - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0815A6A2 - mov r0, r8 - bl DestroyTask -_0815A6A2: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A5F0 - - thumb_func_start sub_815A6C4 -sub_815A6C4: @ 815A6C4 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - mov r5, sp - adds r5, 0x2 - movs r1, 0 - mov r2, sp - adds r3, r5, 0 - bl sub_80A8924 - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0815A6F8 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_0815A6F8: - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x2E] - mov r2, sp - ldrh r0, [r1, 0x4] - ldrh r2, [r2] - adds r0, r2 - strh r0, [r4, 0x32] - ldrh r0, [r1, 0x6] - ldrh r5, [r5] - adds r0, r5 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffce - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - ldr r0, =sub_815A73C - str r0, [r4, 0x1C] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A6C4 - - thumb_func_start sub_815A73C -sub_815A73C: @ 815A73C - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _0815A75E - movs r1, 0 - movs r0, 0x1E - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] - ldr r1, =sub_815A76C - adds r0, r4, 0 - bl oamt_set_x3A_32 -_0815A75E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A73C - - thumb_func_start sub_815A76C -sub_815A76C: @ 815A76C - push {lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x30] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815A798 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] -_0815A798: - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - bne _0815A7AC - adds r0, r3, 0 - bl move_anim_8072740 -_0815A7AC: - pop {r0} - bx r0 - thumb_func_end sub_815A76C - - thumb_func_start sub_815A7B0 -sub_815A7B0: @ 815A7B0 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_80A6838 - ldr r5, =gBattleAnimArgs - movs r0, 0 - ldrsh r1, [r5, r0] - adds r0, r4, 0 - bl sub_80A6864 - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A7B0 - - thumb_func_start sub_815A7EC -sub_815A7EC: @ 815A7EC - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815A84C - adds r0, r4, 0 - bl sub_80A6838 - ldr r5, =gBattleAnimArgs - movs r2, 0 - ldrsh r1, [r5, r2] - adds r0, r4, 0 - bl sub_80A6864 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815A840 - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0815A830 - ldrh r0, [r5, 0x4] - b _0815A846 - .pool -_0815A830: - movs r1, 0x4 - ldrsh r0, [r5, r1] - negs r0, r0 - strh r0, [r4, 0x30] - movs r2, 0x6 - ldrsh r0, [r5, r2] - negs r0, r0 - b _0815A84A -_0815A840: - movs r1, 0x4 - ldrsh r0, [r5, r1] - negs r0, r0 -_0815A846: - strh r0, [r4, 0x30] - ldrh r0, [r5, 0x6] -_0815A84A: - strh r0, [r4, 0x32] -_0815A84C: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r2, 0x2E - ldrsh r1, [r4, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - movs r3, 0xFF - ldrh r1, [r4, 0x30] - ldrh r2, [r4, 0x34] - adds r1, r2 - strh r1, [r4, 0x34] - ldrh r1, [r4, 0x32] - ldrh r2, [r4, 0x36] - adds r1, r2 - strh r1, [r4, 0x36] - movs r2, 0x34 - ldrsh r1, [r4, r2] - lsrs r2, r1, 31 - adds r1, r2 - asrs r1, 1 - strh r1, [r4, 0x24] - ands r0, r3 - movs r1, 0x5 - bl Sin - movs r2, 0x36 - ldrsh r1, [r4, r2] - lsrs r2, r1, 31 - adds r1, r2 - asrs r1, 1 - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xF0 - bls _0815A8A4 - adds r0, r4, 0 - bl move_anim_8072740 -_0815A8A4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815A7EC - - thumb_func_start sub_815A8AC -sub_815A8AC: @ 815A8AC - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0815A8C2 - adds r0, r2, 0 - bl move_anim_8072740 -_0815A8C2: - pop {r0} - bx r0 - thumb_func_end sub_815A8AC - - thumb_func_start sub_815A8C8 -sub_815A8C8: @ 815A8C8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815A8EC - ldr r1, =gBattleAnimArgs - movs r0, 0 - b _0815A8F0 - .pool -_0815A8EC: - ldr r1, =gBattleAnimArgs - movs r0, 0x1 -_0815A8F0: - strh r0, [r1, 0xE] - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A8C8 - - thumb_func_start sub_815A904 -sub_815A904: @ 815A904 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gMoveDmgMoveAnim - ldr r0, [r0] - cmp r0, 0 - ble _0815A920 - ldr r1, =gBattleAnimArgs - movs r0, 0 - b _0815A924 - .pool -_0815A920: - ldr r1, =gBattleAnimArgs - movs r0, 0x1 -_0815A924: - strh r0, [r1, 0xE] - adds r0, r2, 0 - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A904 - - thumb_func_start sub_815A934 -sub_815A934: @ 815A934 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =0x00001f3f - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r0, =gUnknown_02022E24 - movs r1, 0 - strh r1, [r0] - ldr r4, =gUnknown_02022E26 - strh r1, [r4] - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x44 - bl SetGpuReg - adds r0, r5, 0 - movs r1, 0 - bl sub_80A6980 - ldrb r1, [r5, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r5, 0x1] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815A9A0 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A934 - - thumb_func_start sub_815A9A0 -sub_815A9A0: @ 815A9A0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bhi _0815AA60 - lsls r0, 2 - ldr r1, =_0815A9BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815A9BC: - .4byte _0815A9D4 - .4byte _0815A9F2 - .4byte _0815AA12 - .4byte _0815A9F2 - .4byte _0815AA32 - .4byte _0815AA42 -_0815A9D4: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815AA60 - b _0815AA3A -_0815A9F2: - ldrh r0, [r4, 0x30] - adds r0, 0x75 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _0815AA60 - movs r0, 0 - strh r0, [r4, 0x32] - b _0815AA3A -_0815AA12: - ldrh r0, [r4, 0x30] - subs r0, 0x75 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x29 - bne _0815AA60 - movs r0, 0 - strh r0, [r4, 0x32] - b _0815AA3A -_0815AA32: - adds r0, r4, 0 - movs r1, 0x1 - bl ChangeSpriteAffineAnim -_0815AA3A: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815AA60 -_0815AA42: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815AA60 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815AA6C - str r0, [r4, 0x1C] -_0815AA60: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A9A0 - - thumb_func_start sub_815AA6C -sub_815AA6C: @ 815AA6C - push {r4,lr} - adds r4, r0, 0 - ldr r1, =0x00003f3f - movs r0, 0x4A - bl SetGpuReg - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_8072740 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AA6C - - thumb_func_start sub_815AAA4 -sub_815AAA4: @ 815AAA4 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gBattleAnimArgs - movs r1, 0x6 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815AAD0 - ldr r4, =gAnimationBankAttacker - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] -_0815AAD0: - ldrh r0, [r6] - ldrh r2, [r5, 0x20] - adds r0, r2 - movs r3, 0 - strh r0, [r5, 0x20] - ldrh r0, [r6, 0x2] - ldrh r4, [r5, 0x22] - adds r0, r4 - strh r0, [r5, 0x22] - ldrh r2, [r5, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - movs r1, 0x4 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815AB2C - ldrb r1, [r5, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r5, 0x3] - ldr r0, =0x0000fff4 - strh r0, [r5, 0x24] - movs r0, 0x2 - b _0815AB32 - .pool -_0815AB2C: - movs r0, 0xC - strh r0, [r5, 0x24] - ldr r0, =0x0000fffe -_0815AB32: - strh r0, [r5, 0x30] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x8] - strh r0, [r5, 0x2E] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmp r0, 0xFF - beq _0815AB46 - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x34] -_0815AB46: - ldr r0, =sub_815AB5C - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AAA4 - - thumb_func_start sub_815AB5C -sub_815AB5C: @ 815AB5C - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x32] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815AB9A - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _0815ABBA - adds r0, r2, 0x1 - strh r0, [r4, 0x32] - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815ABBA - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xDE - bl PlaySE1WithPanning - b _0815ABBA -_0815AB9A: - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x30] - subs r0, r1 - strh r0, [r4, 0x24] - movs r1, 0x24 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _0815ABAC - negs r0, r0 -_0815ABAC: - cmp r0, 0xC - bne _0815ABBA - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - subs r0, r2, 0x1 - strh r0, [r4, 0x32] -_0815ABBA: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815ABC8 - adds r0, r4, 0 - bl move_anim_8072740 -_0815ABC8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815AB5C - - thumb_func_start sub_815ABD0 -sub_815ABD0: @ 815ABD0 - push {lr} - ldrb r2, [r0, 0x1] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x1] - movs r1, 0xFF - strh r1, [r0, 0x34] - bl sub_815AAA4 - pop {r0} - bx r0 - thumb_func_end sub_815ABD0 - - thumb_func_start sub_815ABEC -sub_815ABEC: @ 815ABEC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815AC40 - ldr r1, =0x00001f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =gUnknown_02022E28 - ldr r2, =0x000098f0 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E2A - movs r0, 0xA0 - strh r0, [r1] - ldr r0, =gUnknown_02022E24 - ldrh r1, [r0] - movs r0, 0x42 - bl SetGpuReg - ldr r0, =gUnknown_02022E26 - ldrh r1, [r0] - movs r0, 0x46 - bl SetGpuReg - b _0815AC70 - .pool -_0815AC40: - ldr r1, =0x00001f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =gUnknown_02022E28 - movs r0, 0xF0 - strh r0, [r1] - ldr r4, =gUnknown_02022E2A - ldr r1, =0x000078a0 - adds r0, r1, 0 - strh r0, [r4] - movs r0, 0x42 - movs r1, 0xF0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x46 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 7 - movs r0, 0 - bl SetGpuRegBits -_0815AC70: - adds r0, r5, 0 - bl move_anim_task_del - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ABEC - - thumb_func_start sub_815AC8C -sub_815AC8C: @ 815AC8C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r0, =gUnknown_02022E28 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E2A - strh r1, [r0] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815ACB8 - movs r1, 0x80 - lsls r1, 7 - movs r0, 0 - bl ClearGpuRegBits -_0815ACB8: - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AC8C - - thumb_func_start sub_815ACD0 -sub_815ACD0: @ 815ACD0 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815ACEC - ldr r4, =gAnimationBankAttacker - b _0815ACEE - .pool -_0815ACEC: - ldr r4, =gAnimationBankTarget -_0815ACEE: - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x2] - adds r0, r6 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r2, =gBattleAnimArgs - ldrh r0, [r2, 0x4] - strh r0, [r5, 0x26] - movs r3, 0 - lsls r0, 16 - asrs r0, 16 - ldrh r4, [r2, 0x6] - movs r6, 0x6 - ldrsh r1, [r2, r6] - cmp r0, r1 - ble _0815AD26 - movs r3, 0x1 -_0815AD26: - strh r3, [r5, 0x2E] - movs r0, 0 - strh r0, [r5, 0x30] - ldrh r0, [r2, 0x8] - strh r0, [r5, 0x32] - ldrh r0, [r2, 0xA] - strh r0, [r5, 0x34] - strh r4, [r5, 0x36] - ldr r0, =sub_815AD4C - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ACD0 - - thumb_func_start sub_815AD4C -sub_815AD4C: @ 815AD4C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x32] - ldrh r1, [r2, 0x30] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r2, 0x30] - ldr r1, =gSineTable - movs r3, 0x30 - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 20 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x34] - ldrh r3, [r2, 0x26] - adds r1, r0, r3 - strh r1, [r2, 0x26] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _0815AD98 - lsls r0, r1, 16 - asrs r0, 16 - movs r3, 0x36 - ldrsh r1, [r2, r3] - cmp r0, r1 - bge _0815ADAA - adds r0, r2, 0 - bl move_anim_8072740 - b _0815ADAA - .pool -_0815AD98: - lsls r0, r1, 16 - asrs r0, 16 - movs r3, 0x36 - ldrsh r1, [r2, r3] - cmp r0, r1 - ble _0815ADAA - adds r0, r2, 0 - bl move_anim_8072740 -_0815ADAA: - pop {r0} - bx r0 - thumb_func_end sub_815AD4C - - thumb_func_start sub_815ADB0 -sub_815ADB0: @ 815ADB0 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r5, r1, r0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815ADDC - ldr r4, =gAnimationBankAttacker - b _0815ADDE - .pool -_0815ADDC: - ldr r4, =gAnimationBankTarget -_0815ADDE: - ldrb r0, [r4] - bl sub_80A6190 - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r4] - bl GetBankIdentity_permutated - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r6, 0 - adds r1, r0, 0 - adds r1, 0x24 - movs r2, 0 - strh r1, [r5, 0x8] - strh r1, [r5, 0xA] - subs r0, 0x21 - strh r0, [r5, 0xC] - cmp r0, 0 - bge _0815AE08 - strh r2, [r5, 0xC] -_0815AE08: - ldrh r0, [r5, 0x8] - strh r0, [r5, 0xE] - movs r0, 0x8 - strh r0, [r5, 0x10] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x12] - strh r2, [r5, 0x14] - strh r2, [r5, 0x16] - cmp r7, 0x1 - bne _0815AE30 - ldr r0, =gUnknown_02022E18 - b _0815AE32 - .pool -_0815AE30: - ldr r0, =gUnknown_02022E1C -_0815AE32: - ldrh r2, [r0] - strh r2, [r5, 0x18] - adds r3, r2, 0 - adds r3, 0xF0 - strh r3, [r5, 0x1A] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x1C] - movs r4, 0x4 - ldrsh r0, [r1, r4] - cmp r0, 0 - bne _0815AE54 - strh r3, [r5, 0x1E] - ldrh r3, [r5, 0x18] - b _0815AE58 - .pool -_0815AE54: - strh r2, [r5, 0x1E] - ldrh r3, [r5, 0x1A] -_0815AE58: - movs r0, 0 - strh r0, [r5, 0x26] - ldrh r1, [r5, 0xC] - lsls r2, r1, 16 - asrs r1, r2, 16 - movs r6, 0xE - ldrsh r0, [r5, r6] - cmp r1, r0 - bgt _0815AE8E - ldr r4, =gUnknown_02038C28 - movs r0, 0xF0 - lsls r0, 3 - adds r0, r4 - mov r12, r0 -_0815AE74: - asrs r2, 16 - lsls r1, r2, 1 - adds r0, r1, r4 - strh r3, [r0] - add r1, r12 - strh r3, [r1] - adds r2, 0x1 - lsls r2, 16 - asrs r1, r2, 16 - movs r6, 0xE - ldrsh r0, [r5, r6] - cmp r1, r0 - ble _0815AE74 -_0815AE8E: - cmp r7, 0x1 - bne _0815AEA0 - ldr r0, =0x04000014 - b _0815AEA2 - .pool -_0815AEA0: - ldr r0, =0x04000018 -_0815AEA2: - str r0, [sp] - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r2, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - ldr r0, =sub_815AED8 - str r0, [r5] - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ADB0 - - thumb_func_start sub_815AED8 -sub_815AED8: @ 815AED8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - ldrh r0, [r4, 0x8] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r4, 0xC] - movs r3, 0xC - ldrsh r1, [r4, r3] - cmp r0, r1 - bge _0815AF00 - strh r2, [r4, 0x8] -_0815AF00: - ldrh r1, [r4, 0x10] - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0815AF2C - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r4, 0xC] - movs r3, 0xC - ldrsh r1, [r4, r3] - cmp r0, r1 - bge _0815AF30 - strh r2, [r4, 0xA] - movs r0, 0x1 - strh r0, [r4, 0x26] - b _0815AF30 - .pool -_0815AF2C: - subs r0, r1, 0x1 - strh r0, [r4, 0x10] -_0815AF30: - ldrh r0, [r4, 0x14] - adds r0, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815AF5C - movs r0, 0 - strh r0, [r4, 0x14] - movs r1, 0 - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0815AF4E - movs r1, 0x1 -_0815AF4E: - strh r1, [r4, 0x16] - cmp r1, 0 - beq _0815AF58 - ldrh r0, [r4, 0x18] - b _0815AF5A -_0815AF58: - ldrh r0, [r4, 0x1A] -_0815AF5A: - strh r0, [r4, 0x20] -_0815AF5C: - ldrh r1, [r4, 0x8] - lsls r3, r1, 16 - asrs r1, r3, 16 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r1, r0 - bge _0815AF90 - ldr r5, =gUnknown_02038C28 - movs r0, 0xF0 - lsls r0, 3 - adds r6, r5, r0 -_0815AF72: - asrs r3, 16 - lsls r1, r3, 1 - adds r2, r1, r5 - ldrh r0, [r4, 0x20] - strh r0, [r2] - adds r1, r6 - ldrh r0, [r4, 0x20] - strh r0, [r1] - adds r3, 0x1 - lsls r3, 16 - asrs r1, r3, 16 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r1, r0 - blt _0815AF72 -_0815AF90: - ldrh r1, [r4, 0xA] - lsls r3, r1, 16 - asrs r1, r3, 16 - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r1, r0 - bgt _0815AFC4 - ldr r5, =gUnknown_02038C28 - movs r0, 0xF0 - lsls r0, 3 - adds r6, r5, r0 -_0815AFA6: - asrs r3, 16 - lsls r1, r3, 1 - adds r2, r1, r5 - ldrh r0, [r4, 0x1E] - strh r0, [r2] - adds r1, r6 - ldrh r0, [r4, 0x1E] - strh r0, [r1] - adds r3, 0x1 - lsls r3, 16 - asrs r1, r3, 16 - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r1, r0 - ble _0815AFA6 -_0815AFC4: - movs r3, 0x26 - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _0815AFE0 - movs r1, 0x1C - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815AFDA - ldr r1, =gUnknown_02039B28 - movs r0, 0x3 - strb r0, [r1, 0x15] -_0815AFDA: - adds r0, r7, 0 - bl move_anim_task_del -_0815AFE0: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AED8 - - thumb_func_start sub_815AFF0 -sub_815AFF0: @ 815AFF0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r5, 0 - strh r5, [r4, 0x8] - strh r5, [r4, 0xA] - ldr r6, =gAnimationBankAttacker - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xC] - ldrb r0, [r6] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xE] - movs r0, 0x20 - strh r0, [r4, 0x10] - ldr r0, =0x0000ffec - strh r0, [r4, 0x12] - strh r5, [r4, 0x14] - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_815B054 - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AFF0 - - thumb_func_start sub_815B054 -sub_815B054: @ 815B054 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r6, r0, r1 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x5 - bls _0815B074 - b _0815B22E -_0815B074: - lsls r0, 2 - ldr r1, =_0815B088 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815B088: - .4byte _0815B0A0 - .4byte _0815B160 - .4byte _0815B18E - .4byte _0815B1A2 - .4byte _0815B1B8 - .4byte _0815B220 -_0815B0A0: - movs r0, 0xC - ldrsh r2, [r6, r0] - ldrh r1, [r6, 0xA] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815B0B6 - movs r1, 0x10 - ldrsh r0, [r6, r1] - subs r0, r2, r0 - b _0815B0BC -_0815B0B6: - movs r1, 0x10 - ldrsh r0, [r6, r1] - adds r0, r2, r0 -_0815B0BC: - lsls r0, 16 - lsrs r1, r0, 16 - ldrh r2, [r6, 0x12] - ldrh r0, [r6, 0xE] - adds r2, r0 - ldr r0, =gUnknown_08593114 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - ldrb r4, [r6, 0xA] - movs r3, 0x6 - subs r3, r4 - lsls r3, 24 - lsrs r3, 24 - bl CreateSprite - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xBA - bl PlaySE12WithPanning - cmp r4, 0x40 - beq _0815B120 - ldr r5, =gSprites - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r3, r1, r5 - ldrh r0, [r6, 0xA] - movs r2, 0x1 - ands r2, r0 - adds r3, 0x3F - ldrb r4, [r3] - movs r0, 0x2 - negs r0, r0 - ands r0, r4 - orrs r0, r2 - strb r0, [r3] - adds r5, 0x1C - adds r1, r5 - ldr r0, =SpriteCallbackDummy - str r0, [r1] -_0815B120: - ldrh r1, [r6, 0xA] - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0815B138 - ldrh r0, [r6, 0x10] - subs r0, 0x6 - strh r0, [r6, 0x10] - ldrh r0, [r6, 0x12] - subs r0, 0x6 - strh r0, [r6, 0x12] -_0815B138: - ldrh r1, [r6, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE2A0 - adds r0, r6, 0 - bl sub_80A7CFC - ldrh r0, [r6, 0xA] - adds r0, 0x1 - strh r0, [r6, 0xA] - strh r4, [r6, 0x8] - b _0815B22E - .pool -_0815B160: - adds r0, r6, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0815B22E - movs r2, 0xA - ldrsh r1, [r6, r2] - cmp r1, 0x6 - bne _0815B180 - movs r0, 0x8 - strh r0, [r6, 0x14] - movs r0, 0x3 - strh r0, [r6, 0x8] - b _0815B22E -_0815B180: - cmp r1, 0x2 - bgt _0815B186 - movs r0, 0xA -_0815B186: - strh r0, [r6, 0x14] - movs r0, 0x2 - strh r0, [r6, 0x8] - b _0815B22E -_0815B18E: - ldrh r0, [r6, 0x14] - movs r2, 0x14 - ldrsh r1, [r6, r2] - cmp r1, 0 - beq _0815B19E - subs r0, 0x1 - strh r0, [r6, 0x14] - b _0815B22E -_0815B19E: - strh r1, [r6, 0x8] - b _0815B22E -_0815B1A2: - ldrh r1, [r6, 0x14] - movs r2, 0x14 - ldrsh r0, [r6, r2] - cmp r0, 0 - beq _0815B1B2 - subs r0, r1, 0x1 - strh r0, [r6, 0x14] - b _0815B22E -_0815B1B2: - movs r0, 0x4 - strh r0, [r6, 0x8] - b _0815B22E -_0815B1B8: - movs r5, 0 - movs r7, 0 - ldr r3, =gSprites - movs r0, 0x1C - adds r0, r3 - mov r8, r0 -_0815B1C4: - lsls r0, r5, 4 - adds r0, r5 - lsls r4, r0, 2 - adds r0, r3, 0 - adds r0, 0x14 - adds r0, r4, r0 - ldr r1, [r0] - ldr r0, =gUnknown_08593114 - cmp r1, r0 - bne _0815B200 - adds r0, r4, r3 - strh r2, [r0, 0x2E] - movs r1, 0x6 - strh r1, [r0, 0x30] - movs r1, 0x2 - str r2, [sp] - str r3, [sp, 0x4] - bl StartSpriteAnim - mov r0, r8 - adds r1, r4, r0 - ldr r0, =sub_815B23C - str r0, [r1] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r2, [sp] - ldr r3, [sp, 0x4] - cmp r7, 0x6 - beq _0815B20A -_0815B200: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3F - bls _0815B1C4 -_0815B20A: - strh r7, [r6, 0x14] - movs r0, 0x5 - strh r0, [r6, 0x8] - b _0815B22E - .pool -_0815B220: - movs r1, 0x14 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815B22E - adds r0, r2, 0 - bl move_anim_task_del -_0815B22E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815B054 - - thumb_func_start sub_815B23C -sub_815B23C: @ 815B23C - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0815B270 - ldr r3, =gTasks - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x2E - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl DestroySprite -_0815B270: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B23C - - thumb_func_start sub_815B27C -sub_815B27C: @ 815B27C - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815B290 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A69CC -_0815B290: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x27 - bgt _0815B2C2 - ldrh r0, [r5, 0x2E] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815B2B4 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - b _0815B2C0 -_0815B2B4: - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 -_0815B2C0: - strb r0, [r2] -_0815B2C2: - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0x1E - ble _0815B2D8 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0815B2D8: - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x3D - bne _0815B324 - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldrh r0, [r5, 0x24] - ldrh r2, [r5, 0x20] - adds r0, r2 - movs r1, 0 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x26] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - strh r1, [r5, 0x24] - strh r1, [r5, 0x26] - movs r0, 0x14 - strh r0, [r5, 0x2E] - ldr r4, =gAnimationBankTarget - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] -_0815B324: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B27C - - thumb_func_start sub_815B338 -sub_815B338: @ 815B338 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815B35C - cmp r0, 0x1 - beq _0815B37C - b _0815B38E - .pool -_0815B35C: - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE350 - adds r0, r4, 0 - bl sub_80A7CFC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B38E - .pool -_0815B37C: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _0815B38E - adds r0, r5, 0 - bl move_anim_task_del -_0815B38E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B338 - - thumb_func_start sub_815B394 -sub_815B394: @ 815B394 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r6, r0, 24 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0815B3F4 - cmp r0, 0x1 - bgt _0815B3B4 - cmp r0, 0 - beq _0815B3BE - b _0815B496 -_0815B3B4: - cmp r0, 0x2 - beq _0815B424 - cmp r0, 0x3 - beq _0815B478 - b _0815B496 -_0815B3BE: - ldr r4, =gAnimationBankAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - adds r0, r6, 0 - movs r1, 0 - bl sub_80A7270 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r5, 0x30] - strh r0, [r5, 0x32] - b _0815B46C - .pool -_0815B3F4: - ldrh r0, [r5, 0x30] - adds r0, 0x60 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - subs r0, 0x1A - strh r0, [r5, 0x32] - movs r2, 0x30 - ldrsh r1, [r5, r2] - movs r0, 0x32 - ldrsh r2, [r5, r0] - adds r0, r6, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815B424 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] -_0815B424: - ldrh r0, [r5, 0x30] - adds r0, 0x60 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x30 - strh r0, [r5, 0x32] - movs r2, 0x30 - ldrsh r1, [r5, r2] - movs r0, 0x32 - ldrsh r2, [r5, r0] - adds r0, r6, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815B496 - movs r0, 0 - strh r0, [r5, 0x34] - ldr r1, =gSprites - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - adds r0, r6, 0 - bl sub_80A7344 -_0815B46C: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0815B496 - .pool -_0815B478: - ldrh r0, [r5, 0x26] - subs r0, 0x6 - strh r0, [r5, 0x26] - movs r1, 0x22 - ldrsh r0, [r5, r1] - movs r2, 0x26 - ldrsh r1, [r5, r2] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bge _0815B496 - adds r0, r5, 0 - bl move_anim_8072740 -_0815B496: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815B394 - - thumb_func_start sub_815B49C -sub_815B49C: @ 815B49C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0815B4BC - ldr r0, =0x0000fff0 - b _0815B4C0 - .pool -_0815B4BC: - movs r0, 0x80 - lsls r0, 1 -_0815B4C0: - strh r0, [r4, 0x20] - movs r0, 0 - strh r0, [r4, 0x22] - ldr r0, =sub_815B4D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B49C - - thumb_func_start sub_815B4D4 -sub_815B4D4: @ 815B4D4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x48 - strh r0, [r4, 0x2E] - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0815B4F8 - ldrh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 20 - b _0815B500 - .pool -_0815B4F8: - ldrh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 20 - negs r0, r0 -_0815B500: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x30] - adds r0, 0x10 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r5, r0, r1 - strh r5, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _0815B54C - ldr r0, =gUnknown_085CE3A0 - ldrh r1, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r4, 0x22] - adds r2, r5 - lsls r2, 16 - asrs r2, 16 - adds r3, r4, 0 - adds r3, 0x43 - ldrb r3, [r3] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - bl CreateSpriteAndAnimate -_0815B54C: - movs r1, 0x20 - ldrsh r0, [r4, r1] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - adds r0, 0x20 - movs r1, 0x98 - lsls r1, 1 - cmp r0, r1 - bls _0815B566 - adds r0, r4, 0 - bl move_anim_8072740 -_0815B566: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B4D4 - - thumb_func_start sub_815B570 -sub_815B570: @ 815B570 - push {r4,lr} - adds r4, r0, 0 - bl Random2 - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0815B58A - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x4 - b _0815B592 -_0815B58A: - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x5 -_0815B592: - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - bl Random2 - movs r1, 0x7 - ands r0, r1 - adds r1, r0, 0 - cmp r1, 0x3 - ble _0815B5B4 - negs r0, r1 - lsls r0, 24 - lsrs r0, 24 -_0815B5B4: - lsls r0, 24 - asrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_815B5D0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B570 - - thumb_func_start sub_815B5D0 -sub_815B5D0: @ 815B5D0 - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1D - bgt _0815B612 - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _0815B646 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - movs r0, 0 - b _0815B644 -_0815B612: - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0x2 - bne _0815B628 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0815B628: - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0x3 - bne _0815B640 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x0000ffff - strh r0, [r3, 0x30] -_0815B640: - ldrh r0, [r3, 0x30] - adds r0, 0x1 -_0815B644: - strh r0, [r3, 0x30] -_0815B646: - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0x3C - ble _0815B654 - adds r0, r3, 0 - bl DestroySprite -_0815B654: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B5D0 - - thumb_func_start sub_815B65C -sub_815B65C: @ 815B65C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815B69C - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE3B8 - adds r0, r4, 0 - bl sub_80A7CFC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B6AE - .pool -_0815B69C: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _0815B6AE - adds r0, r5, 0 - bl move_anim_task_del -_0815B6AE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B65C - - thumb_func_start sub_815B6B4 -sub_815B6B4: @ 815B6B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815B6F4 - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE3E0 - adds r0, r4, 0 - bl sub_80A7CFC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B706 - .pool -_0815B6F4: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _0815B706 - adds r0, r5, 0 - bl move_anim_task_del -_0815B706: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B6B4 - - thumb_func_start sub_815B70C -sub_815B70C: @ 815B70C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815B71E - cmp r0, 0x1 - beq _0815B748 - b _0815B770 -_0815B71E: - adds r0, r4, 0 - movs r1, 0 - bl sub_80A69CC - movs r0, 0x90 - lsls r0, 4 - strh r0, [r4, 0x30] - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815B770 - .pool -_0815B748: - ldrh r2, [r4, 0x30] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x26] - subs r0, r1 - strh r0, [r4, 0x26] - subs r2, 0x60 - strh r2, [r4, 0x30] - movs r2, 0x22 - ldrsh r0, [r4, r2] - movs r2, 0x26 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r2, 0x32 - ldrsh r1, [r4, r2] - cmp r0, r1 - ble _0815B770 - adds r0, r4, 0 - bl move_anim_8072740 -_0815B770: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815B70C - - thumb_func_start sub_815B778 -sub_815B778: @ 815B778 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815B7B8 - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE430 - adds r0, r4, 0 - bl sub_80A7CFC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B7CA - .pool -_0815B7B8: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _0815B7CA - adds r0, r5, 0 - bl move_anim_task_del -_0815B7CA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B778 - - thumb_func_start sub_815B7D0 -sub_815B7D0: @ 815B7D0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r3, r1, 0 - cmp r0, 0x4 - bls _0815B7F6 - b _0815BAFC -_0815B7F6: - lsls r0, 2 - ldr r1, =_0815B808 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815B808: - .4byte _0815B81C - .4byte _0815B86C - .4byte _0815B8A8 - .4byte _0815BA44 - .4byte _0815BA82 -_0815B81C: - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankIdentity_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815B844 - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0x1 - bl lcd_bg_operations - b _0815B84E - .pool -_0815B844: - movs r0, 0x2 - movs r1, 0x2 - movs r2, 0x1 - bl lcd_bg_operations -_0815B84E: - ldr r0, =gTasks - mov r6, r8 - lsls r1, r6, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldr r0, =gBattleAnimArgs - ldrh r0, [r0] - strh r0, [r1, 0x1C] - b _0815BA26 - .pool -_0815B86C: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - adds r4, r0, r3 - ldrh r0, [r4, 0xC] - adds r1, r0, 0x1 - strh r1, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bgt _0815B886 - b _0815BAFC -_0815B886: - movs r0, 0 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - ldrh r5, [r4, 0xA] - lsls r1, r5, 4 - orrs r1, r5 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg - cmp r5, 0xF - beq _0815B8A6 - b _0815BAFC -_0815B8A6: - b _0815BA7A -_0815B8A8: - ldr r5, =gAnimationBankAttacker - ldrb r0, [r5] - ldr r1, =gAnimationBankTarget - ldrb r1, [r1] - mov r2, r8 - lsls r4, r2, 2 - adds r2, r4, r2 - lsls r2, 3 - adds r2, r3 - ldrb r2, [r2, 0x1C] - bl sub_805E448 - ldrb r1, [r5] - mov r0, sp - bl sub_80A6BFC - bl sub_80A4DF0 - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - beq _0815B8E0 - movs r1, 0 - b _0815B8EA - .pool -_0815B8E0: - ldrb r0, [r5] - bl GetBankIdentity - lsls r0, 24 - lsrs r1, r0, 24 -_0815B8EA: - ldr r0, =gUnknown_020244D4 - ldr r2, [r0] - lsls r0, r1, 2 - adds r2, 0x4 - adds r2, r0 - ldr r1, =gUnknown_020244E4 - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r1, 11 - ldr r0, [r2] - adds r0, r1 - ldr r1, [sp] - ldr r2, =0x04000200 - bl CpuSet - ldr r1, [sp] - movs r2, 0x80 - lsls r2, 4 - mov r0, sp - ldrh r3, [r0, 0xA] - movs r0, 0x1 - bl LoadBgTiles - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815BA1C - ldr r5, =gUnknown_02039F34 - ldr r0, [r5] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - bl sub_80DB2A8 - adds r4, r0, 0 - ldr r0, [r5] - ldr r0, [r0, 0x18] - ldrh r0, [r0, 0x2] - bl sub_80DB2A8 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0815B99C - ldr r6, [sp, 0x4] - movs r5, 0 - movs r0, 0x7 - mov r12, r0 - movs r7, 0 -_0815B950: - movs r4, 0 - adds r3, r7, r6 - mov r1, r12 - lsls r0, r1, 1 - adds r2, r0, r6 -_0815B95A: - ldrh r1, [r3] - ldrh r0, [r2] - strh r0, [r3] - strh r1, [r2] - adds r3, 0x2 - subs r2, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _0815B95A - movs r2, 0x20 - add r12, r2 - adds r7, 0x40 - adds r5, 0x1 - cmp r5, 0x7 - ble _0815B950 - movs r5, 0 - movs r0, 0x80 - lsls r0, 3 - adds r3, r0, 0 -_0815B980: - adds r2, r5, 0x1 - lsls r0, r5, 6 - adds r1, r0, r6 - movs r4, 0x7 -_0815B988: - ldrh r0, [r1] - eors r0, r3 - strh r0, [r1] - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _0815B988 - adds r5, r2, 0 - cmp r5, 0x7 - ble _0815B980 -_0815B99C: - ldr r0, =gUnknown_02039F34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r0, [r0, 0x2] - bl sub_80DB2A8 - lsls r0, 24 - cmp r0, 0 - beq _0815B9EC - ldr r3, =gSprites - ldr r4, =gBankSpriteIds - ldr r2, =gAnimationBankAttacker - ldrb r0, [r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_082FF6C0 - b _0815BA06 - .pool -_0815B9EC: - ldr r3, =gSprites - ldr r4, =gBankSpriteIds - ldr r2, =gAnimationBankAttacker - ldrb r0, [r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_082FF694 -_0815BA06: - str r1, [r0] - ldrb r0, [r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - bl StartSpriteAffineAnim -_0815BA1C: - ldr r0, =gTasks - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 -_0815BA26: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815BAFC - .pool -_0815BA44: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - adds r4, r0, r3 - ldrh r0, [r4, 0xC] - adds r1, r0, 0x1 - strh r1, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815BAFC - movs r0, 0 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - ldrh r5, [r4, 0xA] - lsls r1, r5, 4 - orrs r1, r5 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg - cmp r5, 0 - bne _0815BAFC -_0815BA7A: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815BAFC -_0815BA82: - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankIdentity_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815BAAC - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl lcd_bg_operations - b _0815BAB6 - .pool -_0815BAAC: - movs r0, 0x2 - movs r1, 0x2 - movs r2, 0 - bl lcd_bg_operations -_0815BAB6: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815BAF6 - ldr r4, =gAnimationBankAttacker - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815BAF6 - ldr r0, =gTasks - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r6, 0x1C - ldrsh r0, [r1, r6] - cmp r0, 0 - bne _0815BAF6 - ldrb r0, [r4] - ldr r1, =gUnknown_020244D0 - ldr r1, [r1] - ldr r2, [r1] - lsls r1, r0, 2 - adds r1, r2 - ldrh r1, [r1, 0x2] - bl sub_805EE54 -_0815BAF6: - mov r0, r8 - bl move_anim_task_del -_0815BAFC: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B7D0 - - thumb_func_start c3_80DFBE4 -c3_80DFBE4: @ 815BB18 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gBattleAnimArgs - ldr r3, =gSprites - ldr r2, =gBankSpriteIds - ldr r1, =gAnimationBankAttacker - ldrb r1, [r1] - adds r1, r2 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - adds r1, 0x3E - ldrb r1, [r1] - lsls r1, 29 - lsrs r1, 31 - strh r1, [r4, 0xE] - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c3_80DFBE4 - - thumb_func_start sub_815BB58 -sub_815BB58: @ 815BB58 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - ldr r1, =gAnimationBankTarget - ldrb r1, [r1] - movs r2, 0x1 - bl sub_805E448 - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BB58 - - thumb_func_start sub_815BB84 -sub_815BB84: @ 815BB84 - push {r4,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bls _0815BBA2 - b _0815BDF2 -_0815BBA2: - lsls r0, 2 - ldr r1, =_0815BBB4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815BBB4: - .4byte _0815BBC8 - .4byte _0815BCB8 - .4byte _0815BD08 - .4byte _0815BD72 - .4byte _0815BDA6 -_0815BBC8: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815BC02 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations -_0815BC02: - mov r0, sp - bl sub_80A6B30 - ldr r1, =gUnknown_08C2A6EC - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815BC34 - ldr r1, =gUnknown_02022E18 - ldr r3, =0x0000ffc8 - b _0815BC5C - .pool -_0815BC34: - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0815BC58 - ldr r1, =gUnknown_02022E18 - ldr r2, =0x0000ff79 - adds r0, r2, 0 - b _0815BC5E - .pool -_0815BC58: - ldr r1, =gUnknown_02022E18 - ldr r3, =0x0000fff6 -_0815BC5C: - adds r0, r3, 0 -_0815BC5E: - strh r0, [r1] - ldr r1, =gUnknown_02022E1A - movs r0, 0 - strh r0, [r1] - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C2A634 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08C2A6D4 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =gUnknown_02022E18 - ldrh r0, [r0] - strh r0, [r1, 0x1C] - ldr r0, =gUnknown_02022E1A - ldrh r0, [r0] - strh r0, [r1, 0x1E] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - b _0815BD8E - .pool -_0815BCB8: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x10] - adds r1, r0, 0x1 - strh r1, [r4, 0x10] - lsls r0, 16 - cmp r0, 0 - bgt _0815BCCE - b _0815BDF2 -_0815BCCE: - movs r0, 0 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - ble _0815BCE4 - movs r0, 0xC - strh r0, [r4, 0xA] -_0815BCE4: - ldrh r0, [r4, 0xA] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xC - bne _0815BDF2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815BDF2 -_0815BD08: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bge _0815BD20 - movs r0, 0 - strh r0, [r4, 0xA] -_0815BD20: - ldrh r0, [r4, 0xA] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0815BDF2 - ldr r2, =gUnknown_02022E18 - ldr r1, =gUnknown_085CE460 - movs r3, 0xC - ldrsh r0, [r4, r3] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r4, 0x1C] - adds r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815BD6C - strh r0, [r4, 0x8] - b _0815BDF2 - .pool -_0815BD6C: - movs r0, 0x3 - strh r0, [r4, 0x8] - b _0815BDF2 -_0815BD72: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0xE] - adds r0, 0x1 - strh r0, [r1, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815BDF2 - movs r0, 0 - strh r0, [r1, 0xE] - movs r0, 0x1 -_0815BD8E: - strh r0, [r1, 0x8] - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xE4 - bl PlaySE12WithPanning - b _0815BDF2 -_0815BDA6: - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815BDC8 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_0815BDC8: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - ldr r0, =gUnknown_02022E18 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_task_del -_0815BDF2: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BB84 - - thumb_func_start sub_815BE04 -sub_815BE04: @ 815BE04 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r0, 0 - bl Random2 - lsls r0, 16 - movs r1, 0xFC - lsls r1, 14 - ands r1, r0 - lsrs r5, r1, 16 - adds r1, r5, 0 - cmp r1, 0x1F - ble _0815BE2E - movs r0, 0x20 - subs r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 -_0815BE2E: - ldr r4, =gAnimationBankAttacker - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, r5 - strh r0, [r7, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x20 - strh r0, [r7, 0x22] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r7, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r7, 0x32] - ldr r4, =gUnknown_085CE48C - movs r0, 0x20 - ldrsh r1, [r7, r0] - movs r0, 0x22 - ldrsh r2, [r7, r0] - adds r5, r7, 0 - adds r5, 0x43 - ldrb r3, [r5] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - bl CreateSprite - mov r9, r0 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r0, 0x20 - ldrsh r1, [r7, r0] - movs r0, 0x22 - ldrsh r2, [r7, r0] - ldrb r3, [r5] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - bl CreateSprite - mov r8, r0 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r0, r9 - lsls r2, r0, 4 - add r2, r9 - lsls r2, 2 - ldr r1, =gSprites - mov r10, r1 - adds r5, r2, r1 - adds r0, r5, 0 - movs r1, 0x1 - str r2, [sp] - bl StartSpriteAnim - mov r0, r8 - lsls r6, r0, 4 - add r6, r8 - lsls r6, 2 - mov r1, r10 - adds r4, r6, r1 - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAnim - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r5, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x32] - ldrh r0, [r1] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x32] - ldr r0, =0x0000ffff - strh r0, [r5, 0x3C] - movs r0, 0x1 - negs r0, r0 - strh r0, [r4, 0x3C] - adds r5, 0x3E - ldrb r0, [r5] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5] - adds r4, 0x3E - ldrb r0, [r4] - orrs r0, r1 - strb r0, [r4] - movs r0, 0x1C - add r10, r0 - ldr r2, [sp] - add r2, r10 - ldr r0, =sub_815C050 - str r0, [r2] - add r6, r10 - str r0, [r6] - mov r1, r9 - strh r1, [r7, 0x3A] - mov r0, r8 - strh r0, [r7, 0x3C] - ldr r0, =sub_815BF44 - str r0, [r7, 0x1C] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BE04 - - thumb_func_start sub_815BF44 -sub_815BF44: @ 815BF44 - push {lr} - adds r3, r0, 0 - ldrh r2, [r3, 0x32] - ldrh r0, [r3, 0x34] - adds r2, r0 - lsls r0, r2, 16 - asrs r0, 24 - ldrh r1, [r3, 0x26] - subs r1, r0 - strh r1, [r3, 0x26] - movs r0, 0xFF - ands r2, r0 - strh r2, [r3, 0x34] - movs r2, 0x36 - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815BF92 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x8 - negs r1, r1 - cmp r0, r1 - bge _0815BF92 - ldr r2, =gSprites - movs r0, 0x3A - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrh r0, [r3, 0x36] - adds r0, 0x1 - strh r0, [r3, 0x36] -_0815BF92: - movs r1, 0x36 - ldrsh r0, [r3, r1] - cmp r0, 0x1 - bne _0815BFC6 - movs r2, 0x26 - ldrsh r1, [r3, r2] - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _0815BFC6 - ldr r2, =gSprites - movs r0, 0x3C - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrh r0, [r3, 0x36] - adds r0, 0x1 - strh r0, [r3, 0x36] -_0815BFC6: - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815BFE8 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815BFF4 - str r0, [r3, 0x1C] -_0815BFE8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BF44 - - thumb_func_start sub_815BFF4 -sub_815BFF4: @ 815BFF4 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r5, =gSprites - movs r0, 0x3A - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r3, r0, 2 - adds r6, r5, 0 - adds r6, 0x1C - adds r0, r3, r6 - ldr r2, [r0] - ldr r0, =SpriteCallbackDummy - cmp r2, r0 - bne _0815C040 - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldr r0, [r1] - cmp r0, r2 - bne _0815C040 - adds r0, r3, r5 - bl DestroySprite - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - adds r0, r4, 0 - bl move_anim_8072740 -_0815C040: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BFF4 - - thumb_func_start sub_815C050 -sub_815C050: @ 815C050 - push {lr} - adds r3, r0, 0 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _0815C09C - ldrh r2, [r3, 0x32] - ldrh r1, [r3, 0x34] - adds r2, r1 - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r3, 0x26] - subs r0, r1 - strh r0, [r3, 0x26] - movs r0, 0xFF - ands r2, r0 - strh r2, [r3, 0x34] - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815C09C - mov r1, r12 - ldrb r0, [r1] - movs r1, 0x4 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldr r0, =SpriteCallbackDummy - str r0, [r3, 0x1C] -_0815C09C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C050 - - thumb_func_start sub_815C0A4 -sub_815C0A4: @ 815C0A4 - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r4, r1, 0 - cmp r0, 0x5 - bls _0815C0C2 - b _0815C396 -_0815C0C2: - lsls r0, 2 - ldr r1, =_0815C0D4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815C0D4: - .4byte _0815C0EC - .4byte _0815C224 - .4byte _0815C2AC - .4byte _0815C2E2 - .4byte _0815C310 - .4byte _0815C34A -_0815C0EC: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000d03 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815C124 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations -_0815C124: - mov r0, sp - bl sub_80A6B30 - ldr r1, =gUnknown_08C2A6EC - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815C15C - ldr r1, =gUnknown_02022E18 - ldr r3, =0x0000ffc8 - adds r0, r3, 0 - b _0815C1CA - .pool -_0815C15C: - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - bl GetBankIdentity - lsls r0, 24 - lsrs r4, r0, 24 - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815C1B4 - cmp r4, 0x1 - bne _0815C180 - ldr r1, =gUnknown_02022E18 - ldr r2, =0x0000ff65 - adds r0, r2, 0 - strh r0, [r1] -_0815C180: - cmp r4, 0x3 - bne _0815C18C - ldr r1, =gUnknown_02022E18 - ldr r3, =0x0000ff8d - adds r0, r3, 0 - strh r0, [r1] -_0815C18C: - cmp r4, 0 - bne _0815C196 - ldr r1, =gUnknown_02022E18 - movs r0, 0xE - strh r0, [r1] -_0815C196: - cmp r4, 0x2 - bne _0815C1CC - ldr r1, =gUnknown_02022E18 - ldr r2, =0x0000ffec - b _0815C1C8 - .pool -_0815C1B4: - cmp r4, 0x1 - bne _0815C1C0 - ldr r1, =gUnknown_02022E18 - ldr r3, =0x0000ff79 - adds r0, r3, 0 - strh r0, [r1] -_0815C1C0: - cmp r4, 0 - bne _0815C1CC - ldr r1, =gUnknown_02022E18 - ldr r2, =0x0000fff6 -_0815C1C8: - adds r0, r2, 0 -_0815C1CA: - strh r0, [r1] -_0815C1CC: - ldr r1, =gUnknown_02022E1A - movs r0, 0 - strh r0, [r1] - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C2A634 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08C2A6D4 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =gUnknown_02022E18 - ldrh r0, [r0] - strh r0, [r1, 0x1C] - ldr r0, =gUnknown_02022E1A - ldrh r0, [r0] - strh r0, [r1, 0x1E] - b _0815C2A4 - .pool -_0815C224: - ldr r1, =gTasks - lsls r4, r6, 2 - adds r0, r4, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r0, 0 - strh r0, [r5, 0xE] - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815C268 - ldr r2, =gUnknown_02022E18 - ldr r1, =gUnknown_085CE4A4 - movs r3, 0xC - ldrsh r0, [r5, r3] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r5, [r5, 0x1C] - adds r0, r5 - b _0815C27A - .pool -_0815C268: - ldr r2, =gUnknown_02022E18 - ldr r1, =gUnknown_085CE4A4 - movs r3, 0xC - ldrsh r0, [r5, r3] - adds r0, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - ldrh r0, [r5, 0x1C] - subs r0, r1 -_0815C27A: - strh r0, [r2] - ldr r0, =gTasks - adds r1, r4, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xC] - adds r0, 0x1 - strh r0, [r1, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815C2A4 - strh r0, [r1, 0x8] - b _0815C396 - .pool -_0815C2A4: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815C396 -_0815C2AC: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r4 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bgt _0815C2C6 - movs r0, 0x5 - strh r0, [r4, 0xA] -_0815C2C6: - ldrh r1, [r4, 0xA] - lsls r1, 8 - movs r0, 0x3 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bne _0815C396 - b _0815C302 -_0815C2E2: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r4 - ldrh r1, [r4, 0xE] - adds r1, 0x1 - strh r1, [r4, 0xE] - lsls r1, 16 - asrs r1, 16 - ldr r2, =gUnknown_085CE4A8 - movs r3, 0xC - ldrsh r0, [r4, r3] - adds r0, r2 - ldrb r0, [r0] - cmp r1, r0 - ble _0815C396 -_0815C302: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815C396 - .pool -_0815C310: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r4 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - ble _0815C32A - movs r0, 0xD - strh r0, [r4, 0xA] -_0815C32A: - ldrh r1, [r4, 0xA] - lsls r1, 8 - movs r0, 0x3 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xD - bne _0815C396 - movs r0, 0x1 - strh r0, [r4, 0x8] - b _0815C396 -_0815C34A: - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815C36C - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_0815C36C: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - ldr r0, =gUnknown_02022E18 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r6, 0 - bl move_anim_task_del -_0815C396: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C0A4 - - thumb_func_start sub_815C3A8 -sub_815C3A8: @ 815C3A8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815C3E8 - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE4B0 - adds r0, r4, 0 - bl sub_80A7CFC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815C3FA - .pool -_0815C3E8: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _0815C3FA - adds r0, r5, 0 - bl move_anim_task_del -_0815C3FA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815C3A8 - - thumb_func_start sub_815C400 -sub_815C400: @ 815C400 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - movs r2, 0x2E - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _0815C41E - adds r0, r4, 0 - movs r1, 0 - bl sub_80A69CC - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815C472 -_0815C41E: - adds r0, 0x1 - strh r0, [r4, 0x2E] - cmp r1, 0x14 - ble _0815C472 - ldrh r0, [r4, 0x30] - adds r0, 0xA0 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x32] - adds r0, 0x80 - strh r0, [r4, 0x32] - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0815C450 - ldrh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - negs r0, r0 - b _0815C456 - .pool -_0815C450: - ldrh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 -_0815C456: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - ble _0815C472 - adds r0, r4, 0 - bl move_anim_8072740 -_0815C472: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815C400 - - thumb_func_start sub_815C478 -sub_815C478: @ 815C478 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - ldr r5, =gBattleAnimArgs - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815C4A4 - adds r0, r2, 0 - bl move_anim_task_del - b _0815C538 - .pool -_0815C4A4: - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0 - bge _0815C4B0 - movs r0, 0 - strh r0, [r5, 0x4] -_0815C4B0: - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0x2 - ble _0815C4BC - movs r0, 0x2 - strh r0, [r5, 0x4] -_0815C4BC: - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - movs r0, 0x4 - ldrsh r1, [r5, r0] - lsls r1, 1 - movs r0, 0x8 - subs r0, r1 - strh r0, [r4, 0xE] - movs r1, 0x4 - ldrsh r0, [r5, r1] - lsls r0, 7 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r4, 0x10] - ldrh r0, [r5, 0x4] - adds r0, 0x2 - strh r0, [r4, 0x12] - ldrh r0, [r5, 0x2] - subs r0, 0x1 - strh r0, [r4, 0x14] - ldrb r0, [r5] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815C508 - ldr r0, =gAnimationBankAttacker - b _0815C50A - .pool -_0815C508: - ldr r0, =gAnimationBankTarget -_0815C50A: - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815C528 - movs r1, 0x10 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x10] - movs r1, 0x12 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x12] -_0815C528: - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_80A7270 - ldr r0, =sub_815C548 - str r0, [r4] -_0815C538: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C478 - - thumb_func_start sub_815C548 -sub_815C548: @ 815C548 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r6, [r4, r0] - cmp r6, 0x1 - beq _0815C5D0 - cmp r6, 0x1 - bgt _0815C570 - cmp r6, 0 - beq _0815C57C - b _0815C6A8 - .pool -_0815C570: - cmp r6, 0x2 - beq _0815C628 - cmp r6, 0x3 - bne _0815C57A - b _0815C698 -_0815C57A: - b _0815C6A8 -_0815C57C: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x12] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - ldrh r0, [r4, 0xC] - ldrh r1, [r4, 0x10] - subs r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xC] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A73A0 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xE - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _0815C6A8 - strh r6, [r4, 0xA] - b _0815C690 - .pool -_0815C5D0: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - ldrh r2, [r4, 0x12] - subs r1, r2 - strh r1, [r0, 0x24] - ldrh r0, [r4, 0x10] - ldrh r1, [r4, 0xC] - adds r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xC] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A73A0 - ldrh r1, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0xA] - lsls r1, 16 - asrs r1, 16 - movs r2, 0xE - ldrsh r0, [r4, r2] - lsls r0, 1 - cmp r1, r0 - blt _0815C6A8 - movs r0, 0 - strh r0, [r4, 0xA] - b _0815C690 - .pool -_0815C628: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x12] - ldrh r2, [r0, 0x24] - adds r1, r2 - movs r5, 0 - strh r1, [r0, 0x24] - ldrh r0, [r4, 0xC] - ldrh r1, [r4, 0x10] - subs r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xC] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A73A0 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xE - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _0815C6A8 - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0815C690 - subs r0, r1, 0x1 - strh r0, [r4, 0x14] - strh r5, [r4, 0xA] - strh r5, [r4, 0x8] - b _0815C6A8 - .pool -_0815C690: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815C6A8 -_0815C698: - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7344 - adds r0, r5, 0 - bl move_anim_task_del -_0815C6A8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815C548 - - thumb_func_start sub_815C6B0 -sub_815C6B0: @ 815C6B0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0815C6D4 - strh r0, [r4, 0x20] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - b _0815C6DE - .pool -_0815C6D4: - movs r0, 0xF0 - strh r0, [r4, 0x20] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - subs r0, 0x1E -_0815C6DE: - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x32] - ldrb r1, [r1, 0x2] - adds r0, r4, 0 - bl StartSpriteAnim - ldr r0, =sub_815C700 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C6B0 - - thumb_func_start sub_815C700 -sub_815C700: @ 815C700 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x3 - strh r0, [r4, 0x2E] - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0815C744 - ldrh r1, [r4, 0x20] - adds r1, 0x5 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x22] - subs r0, 0x1 - strh r0, [r4, 0x22] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0xF0 - ble _0815C732 - adds r0, r4, 0 - bl move_anim_8072740 -_0815C732: - ldrh r1, [r4, 0x2E] - movs r0, 0xFF - ands r0, r1 - movs r1, 0x10 - bl Sin - b _0815C768 - .pool -_0815C744: - ldrh r1, [r4, 0x20] - subs r1, 0x5 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] - lsls r1, 16 - cmp r1, 0 - bge _0815C75C - adds r0, r4, 0 - bl move_anim_8072740 -_0815C75C: - ldrh r1, [r4, 0x2E] - movs r0, 0xFF - ands r0, r1 - movs r1, 0x10 - bl Cos -_0815C768: - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815C700 - - thumb_func_start sub_815C770 -sub_815C770: @ 815C770 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - movs r0, 0x20 - strh r0, [r4, 0x20] - movs r0, 0x40 - strh r0, [r4, 0x22] - movs r0, 0x80 - lsls r0, 4 - strh r0, [r4, 0x24] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - movs r1, 0 - bl sub_80A7270 - ldr r0, =sub_815C7C4 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C770 - - thumb_func_start sub_815C7C4 -sub_815C7C4: @ 815C7C4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r7, r0, r1 - movs r1, 0x8 - ldrsh r0, [r7, r1] - mov r8, r0 - cmp r0, 0x1 - beq _0815C860 - cmp r0, 0x1 - bgt _0815C7F4 - cmp r0, 0 - beq _0815C7FC - b _0815C8DA - .pool -_0815C7F4: - mov r2, r8 - cmp r2, 0x2 - beq _0815C8C8 - b _0815C8DA -_0815C7FC: - movs r3, 0x80 - lsls r3, 2 - adds r0, r3, 0 - ldrh r1, [r7, 0xC] - adds r2, r0, r1 - strh r2, [r7, 0xC] - lsls r0, r2, 16 - asrs r0, 16 - ldrh r3, [r7, 0x24] - mov r8, r3 - movs r3, 0x24 - ldrsh r1, [r7, r3] - cmp r0, r1 - blt _0815C8DA - mov r0, r8 - subs r5, r0, r2 - lsls r5, 16 - asrs r5, 16 - adds r6, r1, 0 - lsls r6, 1 - adds r0, r5, 0 - adds r1, r6, 0 - bl __divsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - asrs r4, 16 - movs r1, 0x1 - ands r4, r1 - cmp r4, 0 - bne _0815C854 - lsls r0, 16 - asrs r0, 16 - mov r2, r8 - subs r0, r2, r0 - b _0815C8B2 -_0815C854: - lsls r0, 16 - asrs r0, 16 - mov r3, r8 - subs r0, r3 - strh r0, [r7, 0xC] - b _0815C8DA -_0815C860: - ldr r1, =0xfffffe00 - adds r0, r1, 0 - ldrh r2, [r7, 0xC] - adds r1, r0, r2 - strh r1, [r7, 0xC] - movs r3, 0xC - ldrsh r0, [r7, r3] - movs r2, 0x24 - ldrsh r6, [r7, r2] - cmn r0, r6 - bgt _0815C8DA - ldrh r3, [r7, 0x24] - mov r9, r3 - mov r0, r9 - subs r4, r0, r1 - lsls r4, 16 - asrs r4, 16 - lsls r6, 1 - adds r0, r4, 0 - adds r1, r6, 0 - bl __divsi3 - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 16 - lsrs r2, r0, 16 - mov r1, r8 - ands r1, r5 - lsls r0, r1, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _0815C8BC - lsls r0, r2, 16 - asrs r0, 16 - mov r2, r9 - subs r0, r2 -_0815C8B2: - strh r0, [r7, 0xC] - strh r1, [r7, 0x8] - b _0815C8DA - .pool -_0815C8BC: - lsls r0, r2, 16 - asrs r0, 16 - mov r3, r9 - subs r0, r3, r0 - strh r0, [r7, 0xC] - b _0815C8DA -_0815C8C8: - ldrh r0, [r7, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7344 - adds r0, r4, 0 - bl move_anim_task_del - b _0815C950 -_0815C8DA: - ldrh r0, [r7, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r7, 0xC] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrh r0, [r7, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A73A0 - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - movs r2, 0xC - ldrsh r0, [r7, r2] - cmp r0, 0 - bge _0815C90E - adds r0, 0x3F -_0815C90E: - asrs r0, 6 - negs r0, r0 - strh r0, [r1, 0x24] - ldrh r0, [r7, 0xA] - adds r0, 0x1 - strh r0, [r7, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0815C950 - ldrh r1, [r7, 0x20] - movs r3, 0x20 - ldrsh r0, [r7, r3] - cmp r0, 0 - beq _0815C94C - subs r0, r1, 0x1 - strh r0, [r7, 0x20] - ldrh r0, [r7, 0x24] - ldrh r1, [r7, 0x22] - subs r0, r1 - strh r0, [r7, 0x24] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bgt _0815C950 - movs r0, 0x10 - strh r0, [r7, 0x24] - b _0815C950 - .pool -_0815C94C: - movs r0, 0x2 - strh r0, [r7, 0x8] -_0815C950: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815C7C4 - - thumb_func_start sub_815C95C -sub_815C95C: @ 815C95C - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815C9BC - ldr r6, =gBattleAnimArgs - movs r2, 0x4 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _0815C990 - ldr r4, =gAnimationBankAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] -_0815C990: - ldrh r0, [r6] - ldrh r1, [r5, 0x20] - adds r0, r1 - strh r0, [r5, 0x20] - ldrh r1, [r6, 0x2] - ldrh r2, [r5, 0x22] - adds r0, r1, r2 - strh r0, [r5, 0x22] - movs r0, 0x80 - strh r0, [r5, 0x30] - movs r0, 0xC0 - lsls r0, 2 - strh r0, [r5, 0x32] - strh r1, [r5, 0x34] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0815CA1A - .pool -_0815C9BC: - ldrh r1, [r5, 0x30] - lsls r0, r1, 16 - asrs r0, 24 - strh r0, [r5, 0x24] - ldrh r0, [r5, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r2, [r5, 0x26] - adds r0, r2 - strh r0, [r5, 0x26] - movs r2, 0x36 - ldrsh r0, [r5, r2] - adds r4, r1, 0 - cmp r0, 0 - bne _0815C9FA - movs r0, 0x26 - ldrsh r1, [r5, r0] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmn r1, r0 - ble _0815C9FA - movs r0, 0x1 - strh r0, [r5, 0x36] - movs r1, 0x32 - ldrsh r0, [r5, r1] - negs r0, r0 - movs r1, 0x3 - bl __divsi3 - lsls r0, 1 - strh r0, [r5, 0x32] -_0815C9FA: - adds r0, r4, 0 - adds r0, 0xC0 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x80 - strh r0, [r5, 0x32] - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0815CA1A - adds r0, r5, 0 - bl move_anim_8072740 -_0815CA1A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815C95C - - thumb_func_start sub_815CA20 -sub_815CA20: @ 815CA20 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _0815CB2C - ldr r0, =gBattleAnimArgs - movs r3, 0 - ldrsh r1, [r0, r3] - mov r8, r0 - cmp r1, 0 - bne _0815CA5C - ldr r0, =gAnimationBankAttacker - b _0815CA5E - .pool -_0815CA5C: - ldr r0, =gAnimationBankTarget -_0815CA5E: - ldrb r0, [r0] - strh r0, [r2, 0x1E] - mov r1, r8 - ldrb r0, [r1] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r4, r7, 2 - adds r0, r4, r7 - lsls r0, 3 - adds r6, r0, r1 - strh r5, [r6, 0x1C] - adds r0, r5, 0 - movs r1, 0 - bl sub_80A7270 - mov r2, r8 - movs r3, 0x2 - ldrsh r0, [r2, r3] - cmp r0, 0x1 - beq _0815CAC0 - cmp r0, 0x1 - bgt _0815CAA0 - cmp r0, 0 - beq _0815CAA8 - lsls r2, r5, 4 - b _0815CB08 - .pool -_0815CAA0: - cmp r0, 0x2 - beq _0815CACA - lsls r2, r5, 4 - b _0815CB08 -_0815CAA8: - movs r2, 0xA0 - lsls r2, 1 - adds r0, r5, 0 - movs r1, 0xE0 - movs r3, 0 - bl obj_id_set_rotscale - adds r0, r5, 0 - bl sub_80A7E6C - lsls r2, r5, 4 - b _0815CB08 -_0815CAC0: - movs r2, 0x98 - lsls r2, 1 - movs r3, 0xF0 - lsls r3, 4 - b _0815CAD2 -_0815CACA: - movs r2, 0x98 - lsls r2, 1 - movs r3, 0xF1 - lsls r3, 8 -_0815CAD2: - adds r0, r5, 0 - movs r1, 0xD0 - bl obj_id_set_rotscale - adds r0, r5, 0 - bl sub_80A7E6C - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815CAF8 - ldrb r0, [r6, 0x1E] - bl GetBankSide - lsls r0, 24 - lsls r2, r5, 4 - cmp r0, 0 - bne _0815CB08 -_0815CAF8: - ldr r0, =gSprites - lsls r2, r5, 4 - adds r1, r2, r5 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x10 - strh r0, [r1, 0x26] -_0815CB08: - ldr r1, =gSprites - adds r0, r2, r5 - lsls r0, 2 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x24] - ldr r0, =gTasks - adds r1, r4, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815CB78 - .pool -_0815CB2C: - ldrb r5, [r2, 0x1C] - ldrh r0, [r2, 0xC] - adds r0, 0x1 - movs r4, 0 - strh r0, [r2, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _0815CB50 - strh r4, [r2, 0xC] - ldr r0, =gSprites - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x24] - negs r0, r0 - strh r0, [r1, 0x24] -_0815CB50: - ldrh r0, [r2, 0xA] - adds r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - bne _0815CB78 - adds r0, r5, 0 - bl sub_80A7344 - ldr r1, =gSprites - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - strh r4, [r0, 0x24] - strh r4, [r0, 0x26] - adds r0, r7, 0 - bl move_anim_task_del -_0815CB78: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CA20 - - thumb_func_start sub_815CB88 -sub_815CB88: @ 815CB88 - push {r4,r5,lr} - adds r4, r0, 0 - bl Random2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xC - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, r0 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - bl Random2 - ldr r5, =0x000001ff - ands r5, r0 - bl Random2 - movs r1, 0xFF - ands r1, r0 - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _0815CBE0 - movs r2, 0xBC - lsls r2, 3 - adds r0, r5, r2 - b _0815CBE8 - .pool -_0815CBE0: - movs r3, 0xBC - lsls r3, 3 - adds r0, r3, 0 - subs r0, r5 -_0815CBE8: - strh r0, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815CBFA - movs r2, 0x90 - lsls r2, 3 - adds r0, r1, r2 - b _0815CC02 -_0815CBFA: - movs r3, 0x90 - lsls r3, 3 - adds r0, r3, 0 - subs r0, r1 -_0815CC02: - strh r0, [r4, 0x30] - ldr r0, =gBattleAnimArgs - ldrh r0, [r0] - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - bne _0815CC1C - ldr r0, =0x0000fff8 - b _0815CC1E - .pool -_0815CC1C: - movs r0, 0xF8 -_0815CC1E: - strh r0, [r4, 0x20] - movs r0, 0x68 - strh r0, [r4, 0x22] - ldr r0, =sub_815CC34 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CB88 - - thumb_func_start sub_815CC34 -sub_815CC34: @ 815CC34 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815CC4C - ldrh r3, [r4, 0x2E] - lsls r0, r3, 16 - asrs r0, 24 - ldrh r1, [r4, 0x24] - adds r0, r1 - b _0815CC56 -_0815CC4C: - ldrh r3, [r4, 0x2E] - lsls r1, r3, 16 - asrs r1, 24 - ldrh r0, [r4, 0x24] - subs r0, r1 -_0815CC56: - strh r0, [r4, 0x24] - ldrh r2, [r4, 0x30] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x26] - subs r0, r1 - strh r0, [r4, 0x26] - adds r0, r3, 0 - subs r0, 0x16 - strh r0, [r4, 0x2E] - adds r1, r2, 0 - subs r1, 0x30 - strh r1, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bge _0815CC7A - movs r0, 0 - strh r0, [r4, 0x2E] -_0815CC7A: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _0815CC8E - adds r0, r4, 0 - bl move_anim_8072740 -_0815CC8E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815CC34 - - thumb_func_start sub_815CC94 -sub_815CC94: @ 815CC94 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =0x00001f3f - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r0, =gUnknown_02022E24 - movs r1, 0 - strh r1, [r0] - ldr r4, =gUnknown_02022E26 - strh r1, [r4] - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x44 - bl SetGpuReg - ldr r0, =gBattleAnimArgs - ldrh r0, [r0, 0x4] - strh r0, [r5, 0x2E] - adds r0, r5, 0 - movs r1, 0 - bl sub_80A6980 - ldrb r1, [r5, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r5, 0x1] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815CD0C - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CC94 - - thumb_func_start sub_815CD0C -sub_815CD0C: @ 815CD0C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0815CD4A - cmp r0, 0x1 - bgt _0815CD22 - cmp r0, 0 - beq _0815CD2C - b _0815CDAA -_0815CD22: - cmp r0, 0x2 - beq _0815CD60 - cmp r0, 0x3 - beq _0815CD82 - b _0815CDAA -_0815CD2C: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815CDAA - b _0815CD7A -_0815CD4A: - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _0815CDAA - adds r0, r4, 0 - movs r1, 0x1 - bl ChangeSpriteAffineAnim - b _0815CD7A -_0815CD60: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815CDAA - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0815CD7A: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - b _0815CDAA -_0815CD82: - ldr r1, =0x00003f3f - movs r0, 0x4A - bl SetGpuReg - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_8072740 -_0815CDAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CD0C - - thumb_func_start sub_815CDB4 -sub_815CDB4: @ 815CDB4 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gAnimationBankAttacker - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x30] - ldr r1, =sub_815CDFC - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CDB4 - - thumb_func_start sub_815CDFC -sub_815CDFC: @ 815CDFC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x32] - lsls r1, 16 - asrs r1, 24 - bl Sin - strh r0, [r4, 0x24] - movs r2, 0x30 - ldrsh r0, [r4, r2] - ldrh r1, [r4, 0x34] - lsls r1, 16 - asrs r1, 24 - bl Cos - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x9 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - lsls r1, r0, 16 - cmp r0, 0x3F - bls _0815CE36 - asrs r0, r1, 16 - cmp r0, 0xC3 - ble _0815CE48 -_0815CE36: - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl sub_80A82E4 - subs r0, 0x1 - b _0815CE52 - .pool -_0815CE48: - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl sub_80A82E4 - adds r0, 0x1 -_0815CE52: - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - movs r3, 0x38 - ldrsh r2, [r4, r3] - cmp r2, 0 - bne _0815CE98 - movs r1, 0x80 - lsls r1, 3 - adds r0, r1, 0 - ldrh r3, [r4, 0x32] - adds r0, r3 - strh r0, [r4, 0x32] - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - ldrh r3, [r4, 0x34] - adds r0, r3 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x2E - ldrsh r1, [r4, r3] - cmp r0, r1 - bne _0815CEC8 - strh r2, [r4, 0x36] - movs r0, 0x1 - strh r0, [r4, 0x38] - b _0815CEC8 - .pool -_0815CE98: - cmp r2, 0x1 - bne _0815CEC8 - ldr r1, =0xfffffc00 - adds r0, r1, 0 - ldrh r2, [r4, 0x32] - adds r0, r2 - strh r0, [r4, 0x32] - ldr r3, =0xffffff00 - adds r0, r3, 0 - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x2E - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _0815CEC8 - adds r0, r4, 0 - bl move_anim_8072740 -_0815CEC8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CDFC - - thumb_func_start sub_815CED8 -sub_815CED8: @ 815CED8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - movs r0, 0 - bl obj_id_for_side_relative_to_move - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815CF18 - movs r0, 0x1 - str r0, [sp, 0x1C] - ldr r0, =gUnknown_02039F34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldr r1, [r0, 0x10] - mov r9, r1 - ldr r2, [r0, 0xC] - mov r8, r2 - ldrh r6, [r0, 0x2] - movs r3, 0x14 - b _0815D058 - .pool -_0815CF18: - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0815CFC4 - movs r0, 0 - str r0, [sp, 0x1C] - ldr r6, =gBattlePartyID - ldr r4, =gAnimationBankTarget - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r7, =gPlayerParty - adds r0, r7 - movs r1, 0 - bl GetMonData - mov r9, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 - movs r1, 0x1 - bl GetMonData - mov r8, r0 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815CFBC - adds r0, r2, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0815CF9C - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 - b _0815CFAA - .pool -_0815CF9C: - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 -_0815CFAA: - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - b _0815CFBE - .pool -_0815CFBC: - ldrh r6, [r1, 0x2] -_0815CFBE: - movs r1, 0x14 - mov r10, r1 - b _0815D05A -_0815CFC4: - movs r2, 0x1 - str r2, [sp, 0x1C] - ldr r6, =gBattlePartyID - ldr r4, =gAnimationBankTarget - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r7, =gEnemyParty - adds r0, r7 - movs r1, 0 - bl GetMonData - mov r9, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 - movs r1, 0x1 - bl GetMonData - mov r8, r0 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815D054 - adds r0, r2, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0815D03C - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - b _0815D048 - .pool -_0815D03C: - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 -_0815D048: - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - b _0815D056 -_0815D054: - ldrh r6, [r1, 0x2] -_0815D056: - ldr r3, =0x0000ffec -_0815D058: - mov r10, r3 -_0815D05A: - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl sub_80A8328 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =gAnimationBankAttacker - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - mov r2, r10 - lsls r1, r2, 16 - asrs r1, 16 - adds r4, r1 - lsls r4, 16 - asrs r4, 16 - lsrs r0, 24 - str r0, [sp] - movs r0, 0x5 - str r0, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - mov r0, r8 - str r0, [sp, 0xC] - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - str r0, [sp, 0x10] - movs r0, 0x1 - str r0, [sp, 0x14] - adds r0, r6, 0 - ldr r1, [sp, 0x1C] - movs r2, 0 - adds r3, r4, 0 - bl sub_80A8394 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gSprites - lsls r5, r6, 4 - adds r5, r6 - lsls r5, 2 - adds r5, r0 - movs r0, 0x3 - ands r7, r0 - lsls r7, 2 - mov r8, r7 - ldrb r0, [r5, 0x5] - movs r4, 0xD - negs r4, r4 - adds r1, r4, 0 - ands r1, r0 - mov r2, r8 - orrs r1, r2 - strb r1, [r5, 0x5] - ldrb r2, [r5, 0x1] - adds r0, r4, 0 - ands r0, r2 - movs r2, 0x4 - orrs r0, r2 - strb r0, [r5, 0x1] - ldr r0, =0x00007fff - lsrs r1, 4 - lsls r1, 4 - movs r3, 0x80 - lsls r3, 1 - adds r2, r3, 0 - orrs r1, r2 - movs r2, 0x20 - bl FillPalette - ldrb r0, [r5, 0x5] - ands r4, r0 - mov r0, r8 - orrs r4, r0 - strb r4, [r5, 0x5] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =gTasks - ldr r1, [sp, 0x18] - lsls r4, r1, 2 - adds r4, r1 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0xA] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - strh r6, [r4, 0x8] - ldr r0, =sub_815D160 - str r0, [r4] - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CED8 - - thumb_func_start sub_815D160 -sub_815D160: @ 815D160 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x1C] - adds r1, r0, 0x1 - strh r1, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815D1AE - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0xA] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xA - bne _0815D1AE - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0x1C] - strh r0, [r4, 0x1E] - ldr r0, =sub_815D1BC - str r0, [r4] -_0815D1AE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D160 - - thumb_func_start sub_815D1BC -sub_815D1BC: @ 815D1BC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - ldrb r2, [r5, 0x8] - ldrh r0, [r5, 0x1C] - subs r0, 0x10 - movs r4, 0 - strh r0, [r5, 0x1C] - ldrh r0, [r5, 0x1E] - adds r0, 0x80 - strh r0, [r5, 0x1E] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r6, r0, r1 - ldrb r2, [r6, 0x1] - lsls r1, r2, 30 - lsrs r1, 30 - movs r0, 0x2 - orrs r1, r0 - subs r0, 0x6 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x1] - movs r0, 0x1C - ldrsh r2, [r5, r0] - movs r0, 0x1E - ldrsh r3, [r5, r0] - str r4, [sp] - adds r0, r6, 0 - movs r1, 0x1 - bl sub_80A73E0 - ldrh r0, [r5, 0x20] - adds r0, 0x1 - strh r0, [r5, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815D22A - adds r0, r6, 0 - bl sub_80A749C - adds r0, r6, 0 - bl sub_80A8610 - ldr r0, =sub_80A6814 - str r0, [r5] -_0815D22A: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D1BC - - thumb_func_start sub_815D240 -sub_815D240: @ 815D240 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r4, r1, r0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815D26C - ldr r0, =gAnimationBankAttacker - b _0815D26E - .pool -_0815D26C: - ldr r0, =gAnimationBankTarget -_0815D26E: - ldrb r5, [r0] - movs r6, 0 - strh r6, [r4, 0x8] - strh r6, [r4, 0xA] - strh r6, [r4, 0xC] - movs r0, 0x10 - strh r0, [r4, 0xE] - strh r6, [r4, 0x10] - strh r5, [r4, 0x12] - movs r0, 0x20 - strh r0, [r4, 0x14] - strh r6, [r4, 0x16] - movs r0, 0x18 - strh r0, [r4, 0x18] - adds r0, r5, 0 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815D2A0 - movs r1, 0x18 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x18] -_0815D2A0: - adds r0, r5, 0 - bl sub_80A6190 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x22 - strh r0, [r4, 0x22] - cmp r0, 0 - bge _0815D2B4 - strh r6, [r4, 0x22] -_0815D2B4: - ldrh r0, [r4, 0x22] - adds r0, 0x42 - strh r0, [r4, 0x24] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - adds r0, r5, 0 - bl GetBankIdentity_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815D304 - ldr r0, =0x04000014 - str r0, [sp] - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =gUnknown_02022E18 - ldrh r5, [r0] - ldr r0, =gUnknown_02022E1A - b _0815D316 - .pool -_0815D304: - ldr r0, =0x04000018 - str r0, [sp] - ldr r1, =0x00003f44 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =gUnknown_02022E1C - ldrh r5, [r0] - ldr r0, =gUnknown_02022E1E -_0815D316: - ldrh r3, [r0] - movs r7, 0 - movs r2, 0 - ldr r6, =gUnknown_02038C28 - movs r0, 0xF0 - lsls r0, 3 - adds r0, r6 - mov r12, r0 -_0815D326: - lsls r2, 16 - asrs r2, 16 - lsls r1, r2, 1 - adds r0, r1, r6 - strh r5, [r0] - add r1, r12 - strh r5, [r1] - adds r0, r2, 0x1 - lsls r0, 1 - adds r1, r0, r6 - strh r3, [r1] - add r0, r12 - strh r3, [r0] - lsls r0, r7, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - adds r2, 0x2 - lsls r2, 16 - lsrs r2, 16 - lsrs r7, r0, 16 - asrs r0, 16 - cmp r0, 0x9F - ble _0815D326 - ldr r0, =0xa6600001 - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r2, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - ldr r0, =sub_815D398 - str r0, [r4] - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D240 - - thumb_func_start sub_815D398 -sub_815D398: @ 815D398 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r6, r0, r1 - ldrb r0, [r6, 0x12] - bl GetBankIdentity_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815D3D8 - ldr r0, =gUnknown_02022E18 - ldrh r0, [r0] - str r0, [sp, 0x4] - ldr r0, =gUnknown_02022E1A - b _0815D3E0 - .pool -_0815D3D8: - ldr r0, =gUnknown_02022E1C - ldrh r0, [r0] - str r0, [sp, 0x4] - ldr r0, =gUnknown_02022E1E -_0815D3E0: - ldrh r0, [r0] - str r0, [sp, 0x8] - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x1 - bne _0815D3EE - b _0815D5CC -_0815D3EE: - cmp r0, 0x1 - bgt _0815D400 - cmp r0, 0 - beq _0815D40E - b _0815D63C - .pool -_0815D400: - cmp r0, 0x2 - bne _0815D406 - b _0815D5EC -_0815D406: - cmp r0, 0x3 - bne _0815D40C - b _0815D636 -_0815D40C: - b _0815D63C -_0815D40E: - movs r2, 0x24 - ldrsh r0, [r6, r2] - lsls r0, 17 - lsrs r5, r0, 16 - movs r3, 0 - str r3, [sp] - mov r9, r3 - movs r4, 0 - ldrh r0, [r6, 0xA] - adds r0, 0x2 - movs r1, 0xFF - ands r0, r1 - strh r0, [r6, 0xA] - ldrh r7, [r6, 0xA] - mov r8, r7 - movs r0, 0x14 - ldrsh r1, [r6, r0] - movs r0, 0xFC - lsls r0, 3 - bl __divsi3 - strh r0, [r6, 0x1A] - movs r1, 0x16 - ldrsh r0, [r6, r1] - lsls r0, 1 - movs r2, 0x1A - ldrsh r1, [r6, r2] - bl __divsi3 - negs r0, r0 - strh r0, [r6, 0x1C] - ldrh r0, [r6, 0x16] - strh r0, [r6, 0x1E] - lsls r0, 16 - asrs r0, 21 - lsls r0, 16 - lsrs r7, r0, 16 - strh r7, [r6, 0x20] - ldrh r2, [r6, 0x24] - lsls r3, r2, 16 - mov r12, r3 - asrs r1, r3, 16 - movs r3, 0x22 - ldrsh r0, [r6, r3] - cmp r1, r0 - ble _0815D52E - ldr r0, =gUnknown_02039B28 - mov r10, r0 - ldr r1, [sp, 0x4] - lsls r0, r1, 16 - asrs r0, 16 - str r0, [sp, 0x10] - ldr r2, [sp, 0x8] - lsls r0, r2, 16 - asrs r0, 16 - str r0, [sp, 0xC] -_0815D47E: - lsls r5, 16 - asrs r5, 16 - adds r2, r5, 0x1 - lsls r2, 1 - mov r3, r10 - ldrb r1, [r3, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - ldr r0, =gUnknown_02038C28 - adds r2, r0 - lsls r4, 16 - asrs r4, 16 - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - subs r0, r4, r0 - ldr r3, [sp, 0xC] - adds r0, r3, r0 - strh r0, [r2] - lsls r3, r5, 1 - mov r0, r10 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r3, r0 - ldr r1, =gUnknown_02038C28 - adds r3, r1 - lsls r1, r7, 16 - asrs r1, 16 - ldr r2, [sp, 0x10] - adds r1, r2, r1 - mov r7, r8 - lsls r2, r7, 16 - asrs r2, 16 - lsls r0, r2, 1 - ldr r7, =gSineTable - adds r0, r7 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 - adds r1, r0 - strh r1, [r3] - adds r2, 0xA - mov r8, r2 - movs r0, 0xFF - mov r1, r8 - ands r1, r0 - mov r8, r1 - ldrh r0, [r6, 0x1C] - ldrh r2, [r6, 0x1E] - adds r0, r2 - strh r0, [r6, 0x1E] - lsls r0, 16 - asrs r0, 21 - lsls r0, 16 - lsrs r7, r0, 16 - strh r7, [r6, 0x20] - adds r4, 0x1 - lsls r4, 16 - lsrs r4, 16 - subs r5, 0x2 - lsls r5, 16 - lsrs r5, 16 - ldr r3, [sp] - lsls r0, r3, 16 - asrs r0, 16 - ldrh r1, [r6, 0x14] - adds r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - str r2, [sp] - asrs r0, 21 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - ldr r0, =0xffff0000 - add r0, r12 - lsrs r2, r0, 16 - lsls r3, r2, 16 - mov r12, r3 - asrs r1, r3, 16 - movs r3, 0x22 - ldrsh r0, [r6, r3] - cmp r1, r0 - bgt _0815D47E -_0815D52E: - lsls r1, r2, 17 - cmp r1, 0 - blt _0815D55A - ldr r4, =gUnknown_02038C28 - ldr r7, [sp, 0x4] - lsls r0, r7, 16 - asrs r0, 16 - adds r3, r0, 0 - adds r3, 0xF0 - movs r0, 0xF0 - lsls r0, 3 - adds r5, r4, r0 -_0815D546: - asrs r2, r1, 16 - lsls r1, r2, 1 - adds r0, r1, r4 - strh r3, [r0] - adds r1, r5 - strh r3, [r1] - subs r2, 0x2 - lsls r1, r2, 16 - cmp r1, 0 - bge _0815D546 -_0815D55A: - ldrh r0, [r6, 0x14] - adds r0, 0x1 - strh r0, [r6, 0x14] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - ble _0815D5C2 - movs r0, 0x40 - strh r0, [r6, 0x14] - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815D594 - ldrh r0, [r6, 0xE] - subs r0, 0x1 - strh r0, [r6, 0xE] - b _0815D59A - .pool -_0815D594: - ldrh r0, [r6, 0x10] - adds r0, 0x1 - strh r0, [r6, 0x10] -_0815D59A: - ldrh r1, [r6, 0x10] - lsls r1, 8 - ldrh r0, [r6, 0xE] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0xE - ldrsh r1, [r6, r2] - cmp r1, 0 - bne _0815D63C - movs r3, 0x10 - ldrsh r0, [r6, r3] - cmp r0, 0x10 - bne _0815D63C - strh r1, [r6, 0xC] - strh r1, [r6, 0xE] - b _0815D62E -_0815D5C2: - ldrh r0, [r6, 0x18] - ldrh r7, [r6, 0x16] - adds r0, r7 - strh r0, [r6, 0x16] - b _0815D63C -_0815D5CC: - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - ble _0815D63C - ldr r1, =gUnknown_02039B28 - movs r0, 0x3 - strb r0, [r1, 0x15] - movs r0, 0 - strh r0, [r6, 0xC] - b _0815D62E - .pool -_0815D5EC: - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815D602 - ldrh r0, [r6, 0xE] - adds r0, 0x1 - strh r0, [r6, 0xE] - b _0815D608 -_0815D602: - ldrh r0, [r6, 0x10] - subs r0, 0x1 - strh r0, [r6, 0x10] -_0815D608: - ldrh r1, [r6, 0x10] - lsls r1, 8 - ldrh r0, [r6, 0xE] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xE - ldrsh r0, [r6, r1] - cmp r0, 0x10 - bne _0815D63C - movs r2, 0x10 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _0815D63C - strh r0, [r6, 0xC] - strh r0, [r6, 0xE] -_0815D62E: - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _0815D63C -_0815D636: - adds r0, r4, 0 - bl move_anim_task_del -_0815D63C: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815D398 - - thumb_func_start sub_815D64C -sub_815D64C: @ 815D64C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x26] - ldr r2, =gUnknown_085CE5F0 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_815D694 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D64C - - thumb_func_start sub_815D694 -sub_815D694: @ 815D694 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r2, =gTasks - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - adds r1, r0, 0x1 - movs r5, 0 - strh r1, [r3, 0x8] - subs r0, 0x14 - lsls r0, 16 - lsrs r0, 16 - adds r6, r2, 0 - cmp r0, 0x16 - bhi _0815D6F8 - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815D708 - strh r5, [r3, 0xA] - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - movs r5, 0x1 - ands r0, r5 - cmp r0, 0 - bne _0815D6F8 - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - b _0815D708 - .pool -_0815D6F8: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] -_0815D708: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r6 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _0815D720 - adds r0, r4, 0 - bl move_anim_task_del -_0815D720: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D694 - - thumb_func_start sub_815D72C -sub_815D72C: @ 815D72C - push {r4-r6,lr} - mov r6, r8 - push {r6} - mov r8, r0 - adds r5, r2, 0 - adds r0, r3, 0 - ldr r4, [sp, 0x14] - ldr r6, [sp, 0x18] - lsls r1, 16 - lsrs r1, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r6, 16 - lsrs r6, 16 - mov r2, r8 - strh r1, [r2, 0x20] - strh r5, [r2, 0x22] - lsls r1, 16 - asrs r1, 16 - lsls r2, r1, 4 - mov r3, r8 - strh r2, [r3, 0x36] - lsls r5, 16 - asrs r5, 16 - lsls r2, r5, 4 - strh r2, [r3, 0x38] - lsls r0, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 4 - adds r1, r6, 0 - bl __divsi3 - mov r1, r8 - strh r0, [r1, 0x3A] - lsls r4, 16 - asrs r4, 16 - subs r4, r5 - lsls r4, 4 - adds r0, r4, 0 - adds r1, r6, 0 - bl __divsi3 - mov r2, r8 - strh r0, [r2, 0x3C] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815D72C - - thumb_func_start sub_815D794 -sub_815D794: @ 815D794 - ldrh r1, [r0, 0x3A] - ldrh r2, [r0, 0x36] - adds r1, r2 - strh r1, [r0, 0x36] - ldrh r2, [r0, 0x3C] - ldrh r3, [r0, 0x38] - adds r2, r3 - strh r2, [r0, 0x38] - lsls r1, 16 - asrs r1, 20 - strh r1, [r0, 0x20] - lsls r2, 16 - asrs r2, 20 - strh r2, [r0, 0x22] - bx lr - thumb_func_end sub_815D794 - - thumb_func_start sub_815D7B4 -sub_815D7B4: @ 815D7B4 - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldrh r6, [r4, 0x20] - ldrh r5, [r4, 0x22] - bl sub_80A6838 - ldr r0, =gBattleAnimArgs - ldrb r1, [r0] - adds r0, r4, 0 - bl StartSpriteAffineAnim - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x22 - ldrsh r2, [r4, r0] - lsls r6, 16 - asrs r6, 16 - lsls r5, 16 - asrs r5, 16 - str r5, [sp] - movs r0, 0x40 - str r0, [sp, 0x4] - adds r0, r4, 0 - adds r3, r6, 0 - bl sub_815D72C - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r0, =sub_815D804 - str r0, [r4, 0x1C] - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D7B4 - - thumb_func_start sub_815D804 -sub_815D804: @ 815D804 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - movs r0, 0x2E - ldrsh r4, [r5, r0] - lsls r4, 3 - movs r0, 0xFF - ands r4, r0 - adds r0, r5, 0 - bl sub_815D794 - adds r0, r4, 0 - movs r1, 0x8 - bl Sin - strh r0, [r5, 0x26] - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x3A - ble _0815D86A - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815D86A - movs r0, 0 - strh r0, [r5, 0x30] - ldrh r1, [r5, 0x32] - adds r1, 0x1 - strh r1, [r5, 0x32] - movs r0, 0x1 - ands r1, r0 - adds r3, r5, 0 - adds r3, 0x3E - lsls r1, 2 - ldrb r2, [r3] - subs r0, 0x6 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0x3 - ble _0815D86A - adds r0, r5, 0 - bl move_anim_8074EE0 -_0815D86A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815D804 - - thumb_func_start sub_815D870 -sub_815D870: @ 815D870 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gBattleAnimArgs - ldrh r0, [r6, 0x6] - strh r0, [r5, 0x2E] - ldrb r1, [r6] - adds r0, r5, 0 - bl StartSpriteAffineAnim - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0815D896 - ldrh r0, [r6, 0x2] - negs r0, r0 - strh r0, [r6, 0x2] -_0815D896: - ldr r4, =gAnimationBankAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x2] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x4] - adds r0, r6 - strh r0, [r5, 0x22] - ldr r0, =sub_810E2C8 - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D870 - - thumb_func_start sub_815D8D8 -sub_815D8D8: @ 815D8D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0 - ldr r2, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - subs r0, 0x1 - strh r0, [r3, 0x8] - movs r1, 0x14 - ldrsh r0, [r3, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r8, r2 - cmp r0, 0 - beq _0815D95A - ldrh r0, [r3, 0xA] - subs r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815D95A - movs r2, 0x1A - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815D92C - ldrh r0, [r3, 0x10] - strh r0, [r3, 0x1A] - negs r0, r0 - strh r0, [r3, 0x10] - b _0815D92E - .pool -_0815D92C: - strh r7, [r3, 0x1A] -_0815D92E: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - mov r2, r8 - adds r1, r0, r2 - movs r2, 0x1C - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0815D94A - ldrh r0, [r1, 0x12] - strh r0, [r1, 0x1C] - negs r0, r0 - strh r0, [r1, 0x12] - b _0815D94E -_0815D94A: - movs r0, 0 - strh r0, [r1, 0x1C] -_0815D94E: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - add r0, r8 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0xA] -_0815D95A: - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - ldrh r6, [r4, 0x16] - ldrh r7, [r4, 0x18] - movs r1, 0xC - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r12, r2 - cmp r0, 0 - beq _0815D998 - ldr r3, =gSprites - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - lsrs r2, r6, 8 - ldrh r0, [r4, 0x1A] - subs r0, r2 - strh r0, [r1, 0x24] - adds r2, r3, 0 - b _0815D9AE - .pool -_0815D998: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - lsrs r1, r6, 8 - ldrh r4, [r4, 0x1A] - adds r1, r4 - strh r1, [r0, 0x24] -_0815D9AE: - mov r1, r12 - adds r0, r1, r5 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - movs r1, 0xE - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0815D9E0 - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r2, r7, 8 - ldrh r0, [r4, 0x1C] - subs r0, r2 - b _0815D9F2 - .pool -_0815D9E0: - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r0, r7, 8 - ldrh r4, [r4, 0x1C] - adds r0, r4 -_0815D9F2: - strh r0, [r1, 0x26] - mov r2, r12 - adds r0, r2, r5 - lsls r0, 3 - add r0, r8 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0 - bgt _0815DA12 - adds r0, r5, 0 - bl DestroyTask - ldr r1, =gAnimVisualTaskCount - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_0815DA12: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D8D8 - - thumb_func_start sub_815DA20 -sub_815DA20: @ 815DA20 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r7, 0 - ldr r2, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - subs r0, 0x1 - strh r0, [r3, 0x8] - movs r1, 0x14 - ldrsh r0, [r3, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r8, r2 - cmp r0, 0 - beq _0815DAA6 - ldrh r0, [r3, 0xA] - subs r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815DAA6 - movs r2, 0x1A - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815DA78 - ldrh r0, [r3, 0x10] - strh r0, [r3, 0x1A] - negs r0, r0 - strh r0, [r3, 0x10] - b _0815DA7A - .pool -_0815DA78: - strh r7, [r3, 0x1A] -_0815DA7A: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - mov r2, r8 - adds r1, r0, r2 - movs r2, 0x1C - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0815DA96 - ldrh r0, [r1, 0x12] - strh r0, [r1, 0x1C] - negs r0, r0 - strh r0, [r1, 0x12] - b _0815DA9A -_0815DA96: - movs r0, 0 - strh r0, [r1, 0x1C] -_0815DA9A: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - add r0, r8 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0xA] -_0815DAA6: - lsls r3, r6, 2 - adds r0, r3, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - ldrh r2, [r4, 0xC] - ldr r1, =0x00007fff - adds r0, r1, 0 - ands r0, r2 - ldrh r2, [r4, 0x16] - adds r0, r2 - lsls r5, r0, 16 - lsrs r0, r5, 16 - mov r9, r0 - ldrh r0, [r4, 0xE] - ands r1, r0 - ldrh r2, [r4, 0x18] - adds r1, r2 - lsls r1, 16 - lsrs r7, r1, 16 - movs r1, 0xC - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r12, r3 - cmp r0, 0 - beq _0815DB00 - ldr r3, =gSprites - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - lsrs r2, r5, 24 - ldrh r0, [r4, 0x1A] - subs r0, r2 - strh r0, [r1, 0x24] - adds r2, r3, 0 - b _0815DB16 - .pool -_0815DB00: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - lsrs r1, r5, 24 - ldrh r4, [r4, 0x1A] - adds r1, r4 - strh r1, [r0, 0x24] -_0815DB16: - mov r1, r12 - adds r0, r1, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - movs r1, 0xE - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0815DB48 - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r2, r7, 8 - ldrh r0, [r4, 0x1C] - subs r0, r2 - b _0815DB5A - .pool -_0815DB48: - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r0, r7, 8 - ldrh r4, [r4, 0x1C] - adds r0, r4 -_0815DB5A: - strh r0, [r1, 0x26] - mov r2, r12 - adds r0, r2, r6 - lsls r0, 3 - mov r1, r8 - adds r2, r0, r1 - mov r0, r9 - strh r0, [r2, 0x16] - strh r7, [r2, 0x18] - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - bgt _0815DB80 - movs r0, 0x1E - strh r0, [r2, 0x8] - movs r0, 0 - strh r0, [r2, 0x22] - ldr r0, =sub_815D8D8 - str r0, [r2] -_0815DB80: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DA20 - - thumb_func_start sub_815DB90 -sub_815DB90: @ 815DB90 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gTasks - mov r8, r0 - lsls r7, r6, 2 - adds r0, r7, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - ldr r1, =gBankSpriteIds - ldr r2, =gAnimationBankAttacker - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - strh r0, [r4, 0x26] - ldr r5, =gBattleAnimArgs - ldrh r0, [r5] - strh r0, [r4, 0x24] - ldrh r0, [r5] - strh r0, [r4, 0x8] - ldrh r0, [r5, 0xC] - strh r0, [r4, 0x22] - movs r3, 0x6 - ldrsh r0, [r5, r3] - cmp r0, 0 - beq _0815DBD4 - ldrh r0, [r4, 0x14] - ldr r3, =0xffff8000 - adds r1, r3, 0 - orrs r0, r1 - strh r0, [r4, 0x14] -_0815DBD4: - ldrb r0, [r2] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0815DC04 - ldrh r0, [r5, 0x2] - strh r0, [r4, 0xC] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0xE] - mov r3, r8 - adds r4, r7, 0 - b _0815DC74 - .pool -_0815DC04: - movs r7, 0x2 - ldrsh r0, [r5, r7] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0815DC20 - ldrh r1, [r5, 0x2] - ldr r0, =0x00007fff - ands r0, r1 - b _0815DC28 - .pool -_0815DC20: - ldrh r0, [r5, 0x2] - ldr r2, =0xffff8000 - adds r1, r2, 0 - orrs r0, r1 -_0815DC28: - strh r0, [r4, 0xC] - ldr r0, =gBattleAnimArgs - movs r3, 0x4 - ldrsh r1, [r0, r3] - movs r2, 0x80 - lsls r2, 8 - ands r1, r2 - adds r5, r0, 0 - cmp r1, 0 - beq _0815DC60 - ldr r3, =gTasks - lsls r4, r6, 2 - adds r1, r4, r6 - lsls r1, 3 - adds r1, r3 - ldrh r2, [r5, 0x4] - ldr r0, =0x00007fff - ands r0, r2 - b _0815DC72 - .pool -_0815DC60: - ldr r3, =gTasks - lsls r4, r6, 2 - adds r1, r4, r6 - lsls r1, 3 - adds r1, r3 - ldrh r2, [r5, 0x4] - ldr r7, =0xffff8000 - adds r0, r7, 0 - orrs r0, r2 -_0815DC72: - strh r0, [r1, 0xE] -_0815DC74: - adds r0, r4, r6 - lsls r0, 3 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x18] - strh r1, [r0, 0x16] - ldrh r1, [r5, 0x8] - strh r1, [r0, 0x10] - ldrh r1, [r5, 0xA] - strh r1, [r0, 0x12] - ldr r1, =sub_815DA20 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DB90 - - thumb_func_start sub_815DCA4 -sub_815DCA4: @ 815DCA4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - ldr r4, =gBattleAnimArgs - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815DCC4 - adds r0, r2, 0 - bl move_anim_task_del -_0815DCC4: - movs r0, 0 - strh r0, [r5, 0x8] - strh r0, [r5, 0xA] - strh r0, [r5, 0xC] - ldrh r0, [r4, 0x2] - strh r0, [r5, 0xE] - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815DCE8 - ldr r0, =gAnimationBankAttacker - b _0815DCEA - .pool -_0815DCE8: - ldr r0, =gAnimationBankTarget -_0815DCEA: - ldrb r4, [r0] - adds r0, r4, 0 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x10] - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x12] - adds r0, r4, 0 - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x14] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r5, 0x26] - ldr r2, =gUnknown_085CE74C - adds r0, r5, 0 - bl sub_80A7CFC - ldr r0, =sub_815DD48 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DCA4 - - thumb_func_start sub_815DD48 -sub_815DD48: @ 815DD48 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815DD6C - cmp r0, 0x1 - beq _0815DDCC - b _0815DDDA - .pool -_0815DD6C: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815DD82 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_815DDE0 -_0815DD82: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x12 - bne _0815DD92 - adds r0, r5, 0 - movs r1, 0 - bl sub_815DDE0 -_0815DD92: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0815DDDA - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _0815DDB4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815DDDA -_0815DDB4: - strh r1, [r4, 0xA] - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE74C - adds r0, r4, 0 - bl sub_80A7CFC - b _0815DDDA - .pool -_0815DDCC: - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815DDDA - adds r0, r5, 0 - bl move_anim_task_del -_0815DDDA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815DD48 - - thumb_func_start sub_815DDE0 -sub_815DDE0: @ 815DDE0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r2, =gTasks - adds r4, r0, r2 - cmp r1, 0 - bne _0815DE08 - movs r1, 0x12 - movs r3, 0xEC - b _0815DE0C - .pool -_0815DE08: - movs r1, 0x1E - movs r3, 0x14 -_0815DE0C: - mov r2, sp - ldrh r0, [r4, 0x10] - subs r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0x10] - subs r0, r1 - subs r0, 0x4 - strh r0, [r2, 0x2] - ldrh r0, [r4, 0x10] - adds r0, r1 - strh r0, [r2, 0x4] - ldrh r0, [r4, 0x10] - adds r0, r1 - adds r0, 0x4 - strh r0, [r2, 0x6] - add r2, sp, 0x8 - lsls r1, r3, 24 - asrs r1, 24 - ldrh r0, [r4, 0x12] - adds r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0x12] - adds r0, r1 - adds r0, 0x6 - strh r0, [r2, 0x2] - movs r5, 0 - mov r8, r2 - ldr r7, =gSprites -_0815DE44: - lsls r0, r5, 1 - add r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0x1 - ands r0, r5 - lsls r0, 1 - add r0, r8 - movs r3, 0 - ldrsh r2, [r0, r3] - ldrb r3, [r4, 0x14] - subs r3, 0x5 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_085CE76C - bl CreateSprite - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _0815DE98 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r7 - movs r0, 0 - strh r0, [r1, 0x2E] - movs r0, 0x2 - cmp r5, 0x1 - bhi _0815DE86 - movs r2, 0x2 - negs r2, r2 - adds r0, r2, 0 -_0815DE86: - strh r0, [r1, 0x30] - ldr r0, =0x0000ffff - strh r0, [r1, 0x32] - strh r6, [r1, 0x34] - movs r0, 0x2 - strh r0, [r1, 0x36] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] -_0815DE98: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _0815DE44 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DDE0 - - thumb_func_start sub_815DEBC -sub_815DEBC: @ 815DEBC - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x32] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - ble _0815DF02 - ldr r3, =gTasks - movs r0, 0x36 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x34 - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl DestroySprite -_0815DF02: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DEBC - - thumb_func_start sub_815DF0C -sub_815DF0C: @ 815DF0C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gTasks - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - strh r0, [r4, 0xA] - ldrb r0, [r1] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - adds r0, r1 - strh r0, [r4, 0xC] - ldr r0, =sub_815DF64 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DF0C - - thumb_func_start sub_815DF64 -sub_815DF64: @ 815DF64 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815DFB4 - ldrh r0, [r4, 0xC] - ldr r2, =gUnknown_085CE784 - movs r3, 0x8 - ldrsh r1, [r4, r3] - lsls r1, 1 - adds r1, r2 - ldrh r3, [r1] - movs r1, 0x10 - movs r2, 0x8 - bl BlendPalette - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x17 - ble _0815DFA4 - movs r0, 0 - strh r0, [r4, 0x8] -_0815DFA4: - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - b _0815DFC6 - .pool -_0815DFB4: - ldrh r0, [r4, 0xC] - movs r1, 0x10 - movs r2, 0 - movs r3, 0 - bl BlendPalette - adds r0, r5, 0 - bl move_anim_task_del -_0815DFC6: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815DF64 - - thumb_func_start sub_815DFCC -sub_815DFCC: @ 815DFCC - push {lr} - sub sp, 0x1C - lsls r0, 24 - lsrs r0, 24 - movs r2, 0xD0 - lsls r2, 1 - ldr r1, =gAnimationBankAttacker - ldrb r3, [r1] - ldr r1, =gBattleAnimArgs - ldrb r1, [r1] - str r1, [sp] - movs r1, 0xA - str r1, [sp, 0x4] - movs r1, 0x2 - str r1, [sp, 0x8] - movs r1, 0x1E - str r1, [sp, 0xC] - ldr r1, =gUnknown_08C2DC68 - str r1, [sp, 0x10] - ldr r1, =gUnknown_08C2DDC4 - str r1, [sp, 0x14] - ldr r1, =gUnknown_08C2DDA4 - str r1, [sp, 0x18] - movs r1, 0 - bl sub_8117854 - add sp, 0x1C - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DFCC - - thumb_func_start sub_815E01C -sub_815E01C: @ 815E01C - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gAnimationBankAttacker - ldrb r0, [r6] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815E038 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - negs r0, r0 - strh r0, [r1] -_0815E038: - ldrb r0, [r6] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - ldr r4, =gBattleAnimArgs - lsrs r0, 24 - ldrh r1, [r4] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r6] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r5, 0x22] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815E080 - movs r0, 0xA0 - lsls r0, 2 - strh r0, [r5, 0x2E] - ldr r0, =0x0000fd80 - strh r0, [r5, 0x30] - b _0815E0A8 - .pool -_0815E080: - cmp r0, 0x1 - bne _0815E09A - adds r2, r5, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - movs r0, 0xA0 - lsls r0, 2 - strh r0, [r5, 0x2E] - strh r0, [r5, 0x30] - b _0815E0A8 -_0815E09A: - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAnim - movs r0, 0xA0 - lsls r0, 2 - strh r0, [r5, 0x2E] -_0815E0A8: - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0815E0C8 - ldrh r0, [r5, 0x2E] - negs r0, r0 - strh r0, [r5, 0x2E] - adds r2, r5, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_0815E0C8: - ldr r0, =sub_815E0DC - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E01C - - thumb_func_start sub_815E0DC -sub_815E0DC: @ 815E0DC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x3A] - adds r0, r1 - strh r0, [r2, 0x3A] - ldrh r1, [r2, 0x30] - ldrh r3, [r2, 0x3C] - adds r1, r3 - strh r1, [r2, 0x3C] - lsls r0, 16 - asrs r0, 24 - strh r0, [r2, 0x24] - lsls r1, 16 - asrs r1, 24 - strh r1, [r2, 0x26] - ldrh r0, [r2, 0x38] - adds r0, 0x1 - strh r0, [r2, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xE - bne _0815E110 - adds r0, r2, 0 - bl move_anim_8072740 -_0815E110: - pop {r0} - bx r0 - thumb_func_end sub_815E0DC - - thumb_func_start sub_815E114 -sub_815E114: @ 815E114 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r6, r1, r0 - bl sub_80A4DF0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0815E144 - movs r0, 0x8 - strh r0, [r6, 0x12] - movs r0, 0x3 - strh r0, [r6, 0x14] - movs r0, 0x1 - strh r0, [r6, 0x16] - b _0815E14E - .pool -_0815E144: - movs r0, 0xC - strh r0, [r6, 0x12] - movs r0, 0x3 - strh r0, [r6, 0x14] - strh r1, [r6, 0x16] -_0815E14E: - ldr r5, =gAnimationBankAttacker - ldrb r0, [r5] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0815E188 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E17C - adds r0, 0x3 -_0815E17C: - asrs r0, 2 - adds r0, r4, r0 - b _0815E1AC - .pool -_0815E188: - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E1A8 - adds r0, 0x3 -_0815E1A8: - asrs r0, 2 - subs r0, r4, r0 -_0815E1AC: - strh r0, [r6, 0x1E] - ldr r5, =gAnimationBankAttacker - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - adds r4, r0, 0 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E1D0 - adds r0, 0x3 -_0815E1D0: - asrs r0, 2 - subs r0, r4, r0 - strh r0, [r6, 0x20] - ldr r4, =gAnimationBankTarget - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x22] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x24] - ldr r0, =sub_815E20C - str r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E114 - - thumb_func_start sub_815E20C -sub_815E20C: @ 815E20C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - movs r0, 0x8 - ldrsh r1, [r5, r0] - cmp r1, 0 - beq _0815E238 - cmp r1, 0x1 - bne _0815E230 - b _0815E330 -_0815E230: - b _0815E33E - .pool -_0815E238: - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0815E33E - strh r1, [r5, 0xA] - movs r1, 0x1E - ldrsh r0, [r5, r1] - movs r2, 0x20 - ldrsh r1, [r5, r2] - movs r3, 0x22 - ldrsh r2, [r5, r3] - movs r4, 0x24 - ldrsh r3, [r5, r4] - ldrb r4, [r5, 0x12] - str r4, [sp] - ldrb r4, [r5, 0xC] - str r4, [sp, 0x4] - add r4, sp, 0x10 - str r4, [sp, 0x8] - adds r4, 0x2 - str r4, [sp, 0xC] - bl sub_815E34C - movs r6, 0 - mov r8, r4 - ldr r4, =gSprites -_0815E272: - add r0, sp, 0x10 - movs r2, 0 - ldrsh r1, [r0, r2] - mov r3, r8 - movs r0, 0 - ldrsh r2, [r3, r0] - ldr r0, =gUnknown_085CE7EC - movs r3, 0x23 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _0815E306 - movs r1, 0x16 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815E2C6 - cmp r6, 0 - bne _0815E2B4 - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - negs r0, r0 - strh r0, [r1, 0x26] - strh r0, [r1, 0x24] - b _0815E2EE - .pool -_0815E2B4: - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - strh r0, [r1, 0x26] - ldrh r0, [r5, 0x14] - strh r0, [r1, 0x24] - b _0815E2EE -_0815E2C6: - cmp r6, 0 - bne _0815E2DC - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - negs r0, r0 - strh r0, [r1, 0x24] - ldrh r0, [r5, 0x14] - b _0815E2EC -_0815E2DC: - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - strh r0, [r1, 0x24] - ldrh r0, [r5, 0x14] - negs r0, r0 -_0815E2EC: - strh r0, [r1, 0x26] -_0815E2EE: - ldr r1, =gSprites - adds r0, r2, r3 - lsls r0, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x2E] - strh r7, [r0, 0x30] - movs r1, 0xA - strh r1, [r0, 0x32] - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] -_0815E306: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bls _0815E272 - ldrh r2, [r5, 0xC] - movs r3, 0xC - ldrsh r1, [r5, r3] - movs r4, 0x12 - ldrsh r0, [r5, r4] - cmp r1, r0 - bne _0815E324 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_0815E324: - adds r0, r2, 0x1 - strh r0, [r5, 0xC] - b _0815E33E - .pool -_0815E330: - movs r1, 0x1C - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815E33E - adds r0, r7, 0 - bl move_anim_task_del -_0815E33E: - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815E20C - - thumb_func_start sub_815E34C -sub_815E34C: @ 815E34C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r4, [sp, 0x28] - ldr r5, [sp, 0x2C] - ldr r6, [sp, 0x30] - mov r9, r6 - ldr r6, [sp, 0x34] - mov r10, r6 - lsls r0, 16 - lsrs r0, 16 - mov r12, r0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - lsls r2, 16 - lsrs r2, 16 - adds r7, r2, 0 - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0x4] - lsls r4, 24 - lsrs r6, r4, 24 - lsls r5, 24 - lsrs r5, 24 - mov r8, r5 - cmp r5, 0 - bne _0815E394 - mov r2, r9 - strh r0, [r2] - mov r6, r10 - strh r1, [r6] - b _0815E3F2 -_0815E394: - cmp r5, r6 - bcc _0815E3A2 - mov r0, r9 - strh r2, [r0] - mov r1, r10 - strh r3, [r1] - b _0815E3F2 -_0815E3A2: - subs r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - mov r2, r12 - lsls r1, r2, 16 - asrs r1, 16 - lsls r5, r1, 8 - lsls r0, r7, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 8 - adds r1, r6, 0 - bl __divsi3 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r5, r0 - ldr r2, [sp] - lsls r1, r2, 16 - asrs r1, 16 - lsls r4, r1, 8 - ldr r2, [sp, 0x4] - lsls r0, r2, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 8 - adds r1, r6, 0 - bl __divsi3 - mov r6, r8 - muls r6, r0 - adds r0, r6, 0 - adds r4, r0 - asrs r5, 8 - mov r0, r9 - strh r5, [r0] - asrs r4, 8 - mov r1, r10 - strh r4, [r1] -_0815E3F2: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815E34C - - thumb_func_start sub_815E404 -sub_815E404: @ 815E404 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x24 - ble _0815E43A - ldr r3, =gTasks - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x30 - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl DestroySprite -_0815E43A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E404 - - thumb_func_start sub_815E444 -sub_815E444: @ 815E444 - push {r4,lr} - adds r4, r0, 0 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x32] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x36] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x2E] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A70C0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E444 - - thumb_func_start sub_815E47C -sub_815E47C: @ 815E47C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - ldr r1, =gTasks - adds r7, r0, r1 - ldr r0, =gAnimationBankAttacker - mov r10, r0 - ldrb r0, [r0] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x1E] - mov r1, r10 - ldrb r0, [r1] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x20] - ldr r0, =gAnimationBankTarget - mov r8, r0 - ldrb r0, [r0] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x22] - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x3 - bl sub_80A5C6C - adds r4, r0, 0 - mov r1, r8 - ldrb r0, [r1] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E4EE - adds r0, 0x3 -_0815E4EE: - asrs r0, 2 - adds r0, r4, r0 - strh r0, [r7, 0x24] - ldr r4, =gUnknown_085CE84C - movs r0, 0x1E - ldrsh r5, [r7, r0] - movs r1, 0x20 - ldrsh r6, [r7, r1] - mov r1, r8 - ldrb r0, [r1] - bl sub_80A82E4 - adds r3, r0, 0 - subs r3, 0x5 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x26] - cmp r0, 0x40 - beq _0815E5B8 - ldr r4, =gSprites - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x10 - strh r1, [r0, 0x2E] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r7, 0x22] - strh r1, [r0, 0x32] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r7, 0x24] - strh r1, [r0, 0x36] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x38] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl sub_80A68D4 - mov r1, r10 - ldrb r0, [r1] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815E596 - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAffineAnim -_0815E596: - ldr r0, =sub_815E5CC - str r0, [r7] - b _0815E5BE - .pool -_0815E5B8: - mov r0, r9 - bl move_anim_task_del -_0815E5BE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815E47C - - thumb_func_start sub_815E5CC -sub_815E5CC: @ 815E5CC - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0815E634 - cmp r1, 0x1 - bgt _0815E5F4 - cmp r1, 0 - beq _0815E5FE - b _0815E6D2 - .pool -_0815E5F4: - cmp r1, 0x2 - beq _0815E658 - cmp r1, 0x3 - beq _0815E6CC - b _0815E6D2 -_0815E5FE: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E6D2 - strh r1, [r4, 0xA] - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl sub_80A6900 - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0815E6D2 - b _0815E6BE - .pool -_0815E634: - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _0815E6D2 - movs r0, 0 - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - b _0815E6BE - .pool -_0815E658: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E6D2 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r2, [r4, 0xC] - adds r2, 0x1 - strh r2, [r4, 0xC] - ldr r5, =gSprites - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - movs r0, 0x1 - ands r2, r0 - adds r1, 0x3E - lsls r2, 2 - ldrb r3, [r1] - subs r0, 0x6 - ands r0, r3 - orrs r0, r2 - strb r0, [r1] - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _0815E6D2 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite -_0815E6BE: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815E6D2 - .pool -_0815E6CC: - adds r0, r2, 0 - bl move_anim_task_del -_0815E6D2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815E5CC - - thumb_func_start sub_815E6D8 -sub_815E6D8: @ 815E6D8 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimArgs - movs r2, 0 - ldrsh r1, [r0, r2] - adds r6, r0, 0 - cmp r1, 0 - bne _0815E6F4 - ldr r0, =gAnimationBankAttacker - b _0815E6F6 - .pool -_0815E6F4: - ldr r0, =gAnimationBankTarget -_0815E6F6: - ldrb r5, [r0] - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - adds r1, r6, 0 - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x3A] - movs r2, 0x2 - ldrsh r0, [r1, r2] - movs r1, 0x1 - cmp r0, 0 - bne _0815E724 - movs r3, 0x1 - negs r3, r3 - adds r1, r3, 0 -_0815E724: - strh r1, [r4, 0x3C] - adds r0, r5, 0 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - movs r1, 0x2 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815E768 - ldrb r2, [r4, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - movs r0, 0x8 - orrs r1, r0 - lsls r1, 1 - subs r0, 0x47 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r5, 0 - movs r1, 0x4 - bl sub_80A861C - subs r0, 0x8 - b _0815E772 - .pool -_0815E768: - adds r0, r5, 0 - movs r1, 0x5 - bl sub_80A861C - adds r0, 0x8 -_0815E772: - strh r0, [r4, 0x20] - ldr r0, =sub_815E784 - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E6D8 - - thumb_func_start sub_815E784 -sub_815E784: @ 815E784 - push {lr} - adds r2, r0, 0 - movs r0, 0x2E - ldrsh r1, [r2, r0] - cmp r1, 0x1 - beq _0815E7CC - cmp r1, 0x1 - bgt _0815E79A - cmp r1, 0 - beq _0815E7A4 - b _0815E83C -_0815E79A: - cmp r1, 0x2 - beq _0815E7DC - cmp r1, 0x3 - beq _0815E802 - b _0815E83C -_0815E7A4: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E83C - strh r1, [r2, 0x30] - ldrh r0, [r2, 0x3C] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x32] - adds r0, 0x1 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - bne _0815E83C - b _0815E7FA -_0815E7CC: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - bne _0815E83C - b _0815E7F6 -_0815E7DC: - movs r0, 0x3C - ldrsh r1, [r2, r0] - lsls r1, 2 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815E83C -_0815E7F6: - movs r0, 0 - strh r0, [r2, 0x30] -_0815E7FA: - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - b _0815E83C -_0815E802: - movs r0, 0x3C - ldrsh r1, [r2, r0] - lsls r0, r1, 1 - adds r0, r1 - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - bne _0815E83C - ldrh r0, [r2, 0x3A] - subs r0, 0x1 - strh r0, [r2, 0x3A] - lsls r0, 16 - cmp r0, 0 - beq _0815E836 - movs r0, 0 - strh r0, [r2, 0x30] - ldrh r0, [r2, 0x2E] - subs r0, 0x1 - strh r0, [r2, 0x2E] - b _0815E83C -_0815E836: - adds r0, r2, 0 - bl move_anim_8072740 -_0815E83C: - pop {r0} - bx r0 - thumb_func_end sub_815E784 - - thumb_func_start sub_815E840 -sub_815E840: @ 815E840 - push {r4,lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r2, =gBattleAnimArgs - movs r3, 0 - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _0815E85C - adds r0, r1, 0 - bl move_anim_task_del - b _0815E884 - .pool -_0815E85C: - ldr r0, =gTasks - lsls r4, r1, 2 - adds r4, r1 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r2, 0x2] - strh r0, [r4, 0x8] - ldrb r0, [r2] - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x26] - ldr r2, =gUnknown_085CE87C - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_815E898 - str r0, [r4] -_0815E884: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E840 - - thumb_func_start sub_815E898 -sub_815E898: @ 815E898 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E8F2 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r1, [r4, 0xC] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815E8E0 - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - b _0815E8F0 - .pool -_0815E8E0: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000fffe -_0815E8F0: - strh r1, [r0, 0x24] -_0815E8F2: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0815E94E - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] - ldrh r0, [r4, 0x8] - subs r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - cmp r0, 0 - beq _0815E948 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - ldrh r1, [r0, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE87C - bl sub_80A7CFC - strh r5, [r4, 0xA] - strh r5, [r4, 0xC] - b _0815E94E - .pool -_0815E948: - adds r0, r6, 0 - bl move_anim_task_del -_0815E94E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815E898 - - thumb_func_start sub_815E954 -sub_815E954: @ 815E954 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815E970 - ldr r4, =gAnimationBankAttacker - b _0815E972 - .pool -_0815E970: - ldr r4, =gAnimationBankTarget -_0815E972: - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - strh r0, [r5, 0x22] - movs r1, 0x22 - ldrsh r0, [r5, r1] - cmp r0, 0x7 - bgt _0815E996 - movs r0, 0x8 - strh r0, [r5, 0x22] -_0815E996: - movs r2, 0 - strh r2, [r5, 0x2E] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x30] - strh r2, [r5, 0x32] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x34] - ldr r0, =sub_815E9BC - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E954 - - thumb_func_start sub_815E9BC -sub_815E9BC: @ 815E9BC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x30 - ldrsh r1, [r3, r2] - cmp r0, r1 - blt _0815EA10 - movs r0, 0 - strh r0, [r3, 0x2E] - ldrh r1, [r3, 0x32] - adds r1, 0x1 - movs r0, 0x1 - ands r1, r0 - strh r1, [r3, 0x32] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - lsls r1, 2 - ldrb r2, [r0] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - movs r2, 0x32 - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _0815EA10 - ldrh r0, [r3, 0x34] - subs r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - cmp r0, 0 - bne _0815EA10 - adds r0, r3, 0 - bl move_anim_8072740 -_0815EA10: - pop {r0} - bx r0 - thumb_func_end sub_815E9BC - - thumb_func_start sub_815EA14 -sub_815EA14: @ 815EA14 - push {lr} - adds r3, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815EA44 - ldrb r2, [r3, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - movs r0, 0x8 - orrs r1, r0 - lsls r1, 1 - subs r0, 0x47 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x3] - movs r0, 0x64 - strh r0, [r3, 0x20] - movs r0, 0x1 - b _0815EA4A - .pool -_0815EA44: - movs r0, 0x8C - strh r0, [r3, 0x20] - ldr r0, =0x0000ffff -_0815EA4A: - strh r0, [r3, 0x3C] - movs r0, 0x38 - strh r0, [r3, 0x22] - ldr r0, =sub_815EA60 - str r0, [r3, 0x1C] - pop {r0} - bx r0 - .pool - thumb_func_end sub_815EA14 - - thumb_func_start sub_815EA60 -sub_815EA60: @ 815EA60 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x8 - bls _0815EA6E - b _0815EC40 -_0815EA6E: - lsls r0, 2 - ldr r1, =_0815EA7C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815EA7C: - .4byte _0815EAA0 - .4byte _0815EAD2 - .4byte _0815EAE4 - .4byte _0815EB24 - .4byte _0815EB36 - .4byte _0815EB74 - .4byte _0815EBD8 - .4byte _0815EBF8 - .4byte _0815EC1E -_0815EAA0: - movs r3, 0x3C - ldrsh r0, [r4, r3] - lsls r0, 1 - ldrh r1, [r4, 0x22] - subs r1, r0 - strh r1, [r4, 0x22] - ldrh r2, [r4, 0x30] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _0815EAC2 - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r1, 1 - ldrh r0, [r4, 0x20] - subs r0, r1 - strh r0, [r4, 0x20] -_0815EAC2: - adds r0, r2, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - beq _0815EAD0 - b _0815EC40 -_0815EAD0: - b _0815EC12 -_0815EAD2: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - beq _0815EAE2 - b _0815EC40 -_0815EAE2: - b _0815EC12 -_0815EAE4: - ldrh r2, [r4, 0x30] - adds r2, 0x1 - strh r2, [r4, 0x30] - movs r3, 0x3C - ldrsh r1, [r4, r3] - lsls r0, r1, 1 - adds r0, r1 - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r3, =gSineTable - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x3C] - muls r0, r1 - strh r0, [r4, 0x24] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0xC - beq _0815EB1C - b _0815EC40 -_0815EB1C: - b _0815EC12 - .pool -_0815EB24: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - beq _0815EB34 - b _0815EC40 -_0815EB34: - b _0815EC12 -_0815EB36: - ldrh r2, [r4, 0x30] - adds r2, 0x1 - strh r2, [r4, 0x30] - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 1 - adds r1, r0 - ldrh r0, [r4, 0x22] - subs r0, r1 - strh r0, [r4, 0x22] - ldr r3, =gSineTable - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x3C] - muls r0, r1 - strh r0, [r4, 0x24] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0xC - bne _0815EC40 - b _0815EC16 - .pool -_0815EB74: - ldrh r2, [r4, 0x30] - adds r2, 0x1 - strh r2, [r4, 0x30] - movs r3, 0x3C - ldrsh r1, [r4, r3] - lsls r0, r1, 1 - adds r0, r1 - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r3, =gSineTable - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x3C] - muls r0, r1 - strh r0, [r4, 0x24] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0xF - bne _0815EBC0 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] -_0815EBC0: - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x12 - bne _0815EC40 - b _0815EC12 - .pool -_0815EBD8: - movs r3, 0x3C - ldrsh r0, [r4, r3] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 1 - ldrh r0, [r4, 0x20] - adds r1, r0 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815EC40 - b _0815EC12 -_0815EBF8: - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r0, 1 - ldrh r3, [r4, 0x20] - adds r0, r3 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _0815EC40 -_0815EC12: - movs r0, 0 - strh r0, [r4, 0x30] -_0815EC16: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815EC40 -_0815EC1E: - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 1 - adds r1, r0 - ldrh r0, [r4, 0x20] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815EC40 - adds r0, r4, 0 - bl move_anim_8072740 -_0815EC40: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815EA60 - - thumb_func_start sub_815EC48 -sub_815EC48: @ 815EC48 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r6, r1, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x26] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815ECD0 - bl battle_type_is_double - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x1 - bne _0815ECB4 - ldr r5, =gAnimationBankAttacker - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r1, [r5] - movs r0, 0x2 - eors r0, r1 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - ble _0815ECAC - strh r7, [r6, 0x24] - b _0815ECD4 - .pool -_0815ECAC: - ldr r0, =0x0000ffff - b _0815ECD2 - .pool -_0815ECB4: - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0815ECD0 - ldr r0, =0x0000ffff - b _0815ECD2 - .pool -_0815ECD0: - movs r0, 0x1 -_0815ECD2: - strh r0, [r6, 0x24] -_0815ECD4: - ldr r0, =sub_815ECE4 - str r0, [r6] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815EC48 - - thumb_func_start sub_815ECE4 -sub_815ECE4: @ 815ECE4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r3, r0, r1 - movs r1, 0x8 - ldrsh r0, [r3, r1] - cmp r0, 0x8 - bls _0815ECFE - b _0815EE78 -_0815ECFE: - lsls r0, 2 - ldr r1, =_0815ED10 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815ED10: - .4byte _0815ED34 - .4byte _0815ED46 - .4byte _0815ED78 - .4byte _0815EDA8 - .4byte _0815EDCE - .4byte _0815EDF8 - .4byte _0815EE08 - .4byte _0815EE28 - .4byte _0815EE60 -_0815ED34: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - beq _0815ED44 - b _0815EE78 -_0815ED44: - b _0815EE50 -_0815ED46: - ldr r2, =gSprites - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r2, 0x24 - ldrsh r0, [r3, r2] - lsls r2, r0, 1 - adds r2, r0 - ldrh r0, [r1, 0x24] - subs r0, r2 - strh r0, [r1, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - beq _0815ED72 - b _0815EE78 -_0815ED72: - b _0815EE50 - .pool -_0815ED78: - ldr r2, =gSprites - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x24 - ldrsh r2, [r3, r0] - lsls r0, r2, 1 - adds r0, r2 - ldrh r2, [r1, 0x24] - adds r0, r2 - strh r0, [r1, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815EE78 - b _0815EE50 - .pool -_0815EDA8: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _0815EE78 - movs r0, 0 - strh r0, [r3, 0xA] - ldrh r1, [r3, 0xC] - movs r2, 0xC - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815EE54 - adds r0, r1, 0x1 - strh r0, [r3, 0xC] - movs r0, 0x1 - strh r0, [r3, 0x8] - b _0815EE78 -_0815EDCE: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x24] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _0815EE78 - b _0815EE50 - .pool -_0815EDF8: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815EE78 - b _0815EE50 -_0815EE08: - ldr r2, =gSprites - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x24 - ldrsh r2, [r3, r0] - lsls r2, 2 - ldrh r0, [r1, 0x24] - subs r0, r2 - b _0815EE40 - .pool -_0815EE28: - ldr r2, =gSprites - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r2, 0x24 - ldrsh r0, [r3, r2] - lsls r0, 2 - ldrh r2, [r1, 0x24] - adds r0, r2 -_0815EE40: - strh r0, [r1, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815EE78 -_0815EE50: - movs r0, 0 - strh r0, [r3, 0xA] -_0815EE54: - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - b _0815EE78 - .pool -_0815EE60: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x24] - adds r0, r4, 0 - bl move_anim_task_del -_0815EE78: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ECE4 - - thumb_func_start sub_815EE84 -sub_815EE84: @ 815EE84 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815EEA8 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =gAnimationBankAttacker - b _0815EEAA - .pool -_0815EEA8: - ldr r0, =gAnimationBankTarget -_0815EEAA: - ldrb r0, [r0] - strh r0, [r4, 0x3C] - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815EECE - ldrb r0, [r4, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r0 - movs r0, 0x10 - orrs r1, r0 - strb r1, [r4, 0x3] -_0815EECE: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A8328 - movs r2, 0x3 - ands r2, r0 - lsls r2, 2 - ldrb r3, [r4, 0x5] - movs r1, 0xD - negs r1, r1 - adds r0, r1, 0 - ands r0, r3 - orrs r0, r2 - strb r0, [r4, 0x5] - ldrb r0, [r4, 0x1] - ands r1, r0 - movs r0, 0x4 - orrs r1, r0 - strb r1, [r4, 0x1] - ldr r0, =sub_815EF08 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815EE84 - - thumb_func_start sub_815EF08 -sub_815EF08: @ 815EF08 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _0815EF16 - b _0815F106 -_0815EF16: - lsls r0, 2 - ldr r1, =_0815EF24 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815EF24: - .4byte _0815EF38 - .4byte _0815F038 - .4byte _0815F0A0 - .4byte _0815F0B4 - .4byte _0815F100 -_0815EF38: - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0x5 - bhi _0815EF68 - lsls r0, 2 - ldr r1, =_0815EF50 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815EF50: - .4byte _0815EF6C - .4byte _0815EF88 - .4byte _0815EFAA - .4byte _0815EFC6 - .4byte _0815EF6C - .4byte _0815EFEC -_0815EF68: - movs r0, 0 - strh r0, [r4, 0x3A] -_0815EF6C: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x5 - bl sub_80A861C - subs r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - b _0815EFE0 -_0815EF88: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x5 - bl sub_80A861C - subs r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_80A861C - adds r0, 0x4 - b _0815EFE6 -_0815EFAA: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x4 - bl sub_80A861C - adds r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - b _0815EFE0 -_0815EFC6: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x4 - bl sub_80A861C - adds r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 -_0815EFE0: - bl sub_80A861C - subs r0, 0x4 -_0815EFE6: - lsls r0, 16 - lsrs r1, r0, 16 - b _0815F00C -_0815EFEC: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r1, r0, 24 -_0815F00C: - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0x4 - bne _0815F018 - movs r0, 0x18 - b _0815F022 -_0815F018: - cmp r0, 0x5 - bne _0815F020 - movs r0, 0x6 - b _0815F022 -_0815F020: - movs r0, 0xC -_0815F022: - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - strh r5, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - strh r1, [r4, 0x36] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - b _0815F0F8 -_0815F038: - adds r0, r4, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _0815F106 - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0x4 - beq _0815F070 - cmp r0, 0x5 - beq _0815F090 - ldrh r0, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r0, r2 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - strh r1, [r4, 0x2E] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - b _0815F088 -_0815F070: - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - strh r1, [r4, 0x38] -_0815F088: - ldrh r0, [r4, 0x3A] - adds r0, 0x1 - strh r0, [r4, 0x3A] - b _0815F106 -_0815F090: - movs r0, 0 - strh r0, [r4, 0x2E] - movs r1, 0x10 - strh r1, [r4, 0x30] - strh r0, [r4, 0x32] - movs r0, 0x3 - strh r0, [r4, 0x38] - b _0815F106 -_0815F0A0: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815F106 - movs r0, 0 - strh r0, [r4, 0x38] - b _0815F106 -_0815F0B4: - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815F0C6 - ldrh r0, [r4, 0x30] - subs r0, 0x1 - strh r0, [r4, 0x30] - b _0815F0CC -_0815F0C6: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_0815F0CC: - ldrh r1, [r4, 0x32] - lsls r1, 8 - ldrh r0, [r4, 0x30] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - bne _0815F106 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0815F0F8: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - b _0815F106 -_0815F100: - adds r0, r4, 0 - bl move_anim_8072740 -_0815F106: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815EF08 - - thumb_func_start sub_815F10C -sub_815F10C: @ 815F10C - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - subs r0, r1 - movs r2, 0x38 - ldrsh r1, [r4, r2] - muls r0, r1 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl __divsi3 - adds r5, r0, 0 - strh r5, [r4, 0x24] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - subs r0, r1 - movs r2, 0x38 - ldrsh r1, [r4, r2] - muls r0, r1 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl __divsi3 - adds r3, r0, 0 - strh r3, [r4, 0x26] - ldrh r1, [r4, 0x38] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815F16A - ldr r0, =gUnknown_085CE3A0 - ldrh r1, [r4, 0x20] - adds r1, r5 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r4, 0x22] - adds r2, r3 - lsls r2, 16 - asrs r2, 16 - movs r3, 0x5 - bl CreateSprite -_0815F16A: - movs r0, 0x38 - ldrsh r1, [r4, r0] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _0815F17C - adds r0, r4, 0 - bl move_anim_8072740 -_0815F17C: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F10C - - thumb_func_start sub_815F18C -sub_815F18C: @ 815F18C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gAnimationBankTarget - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0815F1B8 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815F1D0 -_0815F1B8: - ldr r2, =gBattleAnimArgs - ldrh r1, [r5, 0x20] - ldrh r0, [r2] - subs r0, r1, r0 - strh r0, [r5, 0x2E] - ldrh r0, [r2, 0x4] - subs r1, r0 - b _0815F1DE - .pool -_0815F1D0: - ldr r2, =gBattleAnimArgs - ldrh r1, [r5, 0x20] - ldrh r0, [r2] - adds r0, r1, r0 - strh r0, [r5, 0x2E] - ldrh r0, [r2, 0x4] - adds r1, r0 -_0815F1DE: - strh r1, [r5, 0x32] - adds r3, r2, 0 - ldrh r1, [r5, 0x22] - ldrh r2, [r3, 0x2] - adds r2, r1, r2 - strh r2, [r5, 0x30] - ldrh r0, [r3, 0x6] - adds r1, r0 - strh r1, [r5, 0x34] - ldrh r0, [r3, 0x8] - strh r0, [r5, 0x36] - ldrh r0, [r5, 0x2E] - strh r0, [r5, 0x20] - strh r2, [r5, 0x22] - ldr r0, =sub_815F10C - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F18C - - thumb_func_start sub_815F20C -sub_815F20C: @ 815F20C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r5, r0, 24 - adds r2, r5, 0 - ldr r0, =gTasks - mov r9, r0 - lsls r7, r6, 2 - adds r0, r7, r6 - lsls r0, 3 - mov r8, r0 - mov r4, r8 - add r4, r9 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815F254 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A7270 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - b _0815F2A0 - .pool -_0815F254: - cmp r0, 0x1 - bne _0815F2AC - ldrh r0, [r4, 0xA] - adds r0, 0x60 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - subs r0, 0xD - strh r0, [r4, 0xC] - movs r2, 0xA - ldrsh r1, [r4, r2] - movs r0, 0xC - ldrsh r2, [r4, r0] - adds r0, r5, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815F310 - movs r0, 0 - strh r0, [r4, 0xE] - adds r0, r5, 0 - bl sub_80A7344 - ldr r1, =gSprites - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0815F2A0: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815F310 - .pool -_0815F2AC: - ldr r4, =gAnimationBankAttacker - ldrb r0, [r4] - movs r1, 0 - bl refresh_graphics_maybe - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815F2EE - ldr r3, =gSprites - ldr r2, =gBankSpriteIds - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_082FF6C0 - str r1, [r0] - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - bl StartSpriteAffineAnim -_0815F2EE: - mov r4, r9 - adds r3, r7, 0 - ldr r5, =sub_815F330 - movs r1, 0xF - mov r2, r8 - adds r0, r4, r2 - adds r0, 0x26 - movs r2, 0 -_0815F2FE: - strh r2, [r0] - subs r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _0815F2FE - adds r0, r3, r6 - lsls r0, 3 - adds r0, r4 - str r5, [r0] -_0815F310: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F20C - - thumb_func_start sub_815F330 -sub_815F330: @ 815F330 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _0815F394 - cmp r5, 0x1 - bgt _0815F360 - cmp r5, 0 - beq _0815F36A - b _0815F482 - .pool -_0815F360: - cmp r5, 0x2 - beq _0815F400 - cmp r5, 0x3 - beq _0815F43C - b _0815F482 -_0815F36A: - ldr r0, =gSprites - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldr r0, =0x0000ff38 - strh r0, [r1, 0x26] - movs r0, 0xC8 - strh r0, [r1, 0x24] - adds r1, 0x3E - ldrb r2, [r1] - subs r0, 0xCD - ands r0, r2 - strb r0, [r1] - strh r5, [r4, 0x1C] - b _0815F42E - .pool -_0815F394: - ldrh r1, [r4, 0x1C] - adds r1, 0x70 - movs r5, 0 - strh r1, [r4, 0x1C] - ldr r2, =gSprites - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r2, r0, r2 - lsls r1, 16 - asrs r1, 24 - ldrh r3, [r2, 0x26] - adds r1, r3 - strh r1, [r2, 0x26] - movs r1, 0x22 - ldrsh r0, [r2, r1] - movs r3, 0x26 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - blt _0815F3C4 - strh r5, [r2, 0x24] -_0815F3C4: - movs r1, 0x26 - ldrsh r0, [r2, r1] - cmp r0, 0 - ble _0815F3CE - strh r5, [r2, 0x26] -_0815F3CE: - movs r3, 0x26 - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _0815F482 - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7D - bl PlaySE12WithPanning - ldr r1, =0xfffff800 - adds r0, r1, 0 - ldrh r2, [r4, 0x1C] - adds r0, r2 - strh r0, [r4, 0x1C] - b _0815F42E - .pool -_0815F400: - ldrh r0, [r4, 0x1C] - subs r0, 0x70 - strh r0, [r4, 0x1C] - lsls r0, 16 - cmp r0, 0 - bge _0815F410 - movs r0, 0 - strh r0, [r4, 0x1C] -_0815F410: - ldr r0, =gSprites - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r4, 0x1C] - lsls r2, 16 - asrs r2, 24 - ldrh r0, [r1, 0x26] - subs r0, r2 - strh r0, [r1, 0x26] - movs r3, 0x1C - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _0815F482 -_0815F42E: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815F482 - .pool -_0815F43C: - ldrh r0, [r4, 0x1C] - adds r0, 0x70 - strh r0, [r4, 0x1C] - ldr r2, =gSprites - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r2 - lsls r0, 16 - asrs r0, 24 - ldrh r2, [r1, 0x26] - adds r0, r2 - strh r0, [r1, 0x26] - lsls r0, 16 - cmp r0, 0 - ble _0815F460 - movs r0, 0 - strh r0, [r1, 0x26] -_0815F460: - movs r3, 0x26 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _0815F482 - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7D - bl PlaySE12WithPanning - adds r0, r6, 0 - bl move_anim_task_del -_0815F482: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F330 - - thumb_func_start sub_815F48C -sub_815F48C: @ 815F48C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gAnimationBankTarget - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0815F4B8 - ldrb r0, [r4] - bl sub_80A82E4 - subs r0, 0x2 - adds r1, r5, 0 - adds r1, 0x43 - strb r0, [r1] - ldr r4, =0x0000ff70 - b _0815F4C8 - .pool -_0815F4B8: - ldrb r0, [r4] - bl sub_80A82E4 - adds r0, 0x2 - adds r1, r5, 0 - adds r1, 0x43 - strb r0, [r1] - ldr r4, =0x0000ffa0 -_0815F4C8: - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - strh r4, [r5, 0x26] - ldr r0, =sub_815F4F0 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F48C - - thumb_func_start sub_815F4F0 -sub_815F4F0: @ 815F4F0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _0815F4FE - b _0815F61A -_0815F4FE: - lsls r0, 2 - ldr r1, =_0815F50C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815F50C: - .4byte _0815F520 - .4byte _0815F544 - .4byte _0815F584 - .4byte _0815F5B4 - .4byte _0815F5E0 -_0815F520: - ldrh r0, [r4, 0x26] - adds r0, 0xA - strh r0, [r4, 0x26] - lsls r0, 16 - cmp r0, 0 - blt _0815F61A - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xCD - bl PlaySE12WithPanning - movs r0, 0 - strh r0, [r4, 0x26] - b _0815F5D8 -_0815F544: - ldrh r1, [r4, 0x30] - adds r1, 0x4 - movs r5, 0 - strh r1, [r4, 0x30] - ldr r2, =gSineTable - movs r3, 0x30 - ldrsh r0, [r4, r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - negs r0, r0 - strh r0, [r4, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7F - ble _0815F61A - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xCD - bl PlaySE12WithPanning - strh r5, [r4, 0x30] - strh r5, [r4, 0x26] - b _0815F5D8 - .pool -_0815F584: - ldrh r1, [r4, 0x30] - adds r1, 0x6 - movs r3, 0 - strh r1, [r4, 0x30] - ldr r2, =gSineTable - movs r5, 0x30 - ldrsh r0, [r4, r5] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 20 - negs r0, r0 - strh r0, [r4, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7F - ble _0815F61A - strh r3, [r4, 0x30] - strh r3, [r4, 0x26] - b _0815F5D8 - .pool -_0815F5B4: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0815F61A - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xC0 - bl PlaySE12WithPanning - movs r0, 0 - strh r0, [r4, 0x30] -_0815F5D8: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815F61A -_0815F5E0: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0815F61A - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x32] - adds r1, 0x1 - strh r1, [r4, 0x32] - movs r0, 0x1 - ands r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - lsls r1, 2 - ldrb r2, [r3] - subs r0, 0x6 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x7 - bne _0815F61A - adds r0, r4, 0 - bl move_anim_8072740 -_0815F61A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815F4F0 - - thumb_func_start sub_815F620 -sub_815F620: @ 815F620 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl sub_80A4DF0 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - bne _0815F66E - movs r0, 0x1 - bl duplicate_obj_of_side_rel2move_in_transparent_mode - lsls r0, 16 - lsrs r1, r0, 16 - mov r10, r1 - asrs r6, r0, 16 - cmp r6, 0 - blt _0815F66E - movs r0, 0x1 - bl duplicate_obj_of_side_rel2move_in_transparent_mode - lsls r0, 16 - lsrs r1, r0, 16 - mov r9, r1 - asrs r1, r0, 16 - cmp r1, 0 - bge _0815F67C - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl obj_delete_but_dont_free_vram -_0815F66E: - mov r0, r8 - bl move_anim_task_del - b _0815F780 - .pool -_0815F67C: - ldr r4, =gSprites - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, r0, r4 - ldrh r0, [r5, 0x24] - adds r0, 0x18 - strh r0, [r5, 0x24] - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r6, r0, r4 - ldrh r0, [r6, 0x24] - subs r0, 0x18 - strh r0, [r6, 0x24] - strh r7, [r5, 0x2E] - strh r7, [r6, 0x2E] - strh r7, [r5, 0x30] - strh r7, [r6, 0x30] - strh r7, [r5, 0x32] - strh r7, [r6, 0x32] - movs r0, 0x10 - strh r0, [r5, 0x34] - ldr r0, =0x0000fff0 - strh r0, [r6, 0x34] - strh r7, [r5, 0x36] - movs r0, 0x80 - strh r0, [r6, 0x36] - movs r0, 0x18 - strh r0, [r5, 0x38] - strh r0, [r6, 0x38] - mov r0, r8 - strh r0, [r5, 0x3A] - strh r0, [r6, 0x3A] - strh r7, [r5, 0x3C] - strh r7, [r6, 0x3C] - ldr r2, =gTasks - mov r1, r8 - lsls r3, r1, 2 - adds r0, r3, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x8] - ldr r0, =gUnknown_020244D0 - ldr r1, [r0] - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - adds r7, r4, 0 - mov r12, r3 - cmp r0, 0 - bne _0815F720 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r2, r6, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - b _0815F736 - .pool -_0815F720: - adds r1, r5, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - adds r1, r6, 0 - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] -_0815F736: - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r4, r2, r7 - ldrb r1, [r4, 0x1] - movs r3, 0xD - negs r3, r3 - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4, 0x1] - mov r1, r10 - lsls r0, r1, 16 - asrs r0, 16 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r4, r1, r7 - ldrb r0, [r4, 0x1] - ands r3, r0 - strb r3, [r4, 0x1] - adds r3, r7, 0 - adds r3, 0x1C - adds r2, r3 - ldr r0, =sub_815F7C4 - str r0, [r2] - adds r1, r3 - str r0, [r1] - mov r0, r12 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - ldr r1, =sub_815F79C - str r1, [r0] -_0815F780: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F620 - - thumb_func_start sub_815F79C -sub_815F79C: @ 815F79C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815F7BA - adds r0, r2, 0 - bl move_anim_task_del -_0815F7BA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F79C - - thumb_func_start sub_815F7C4 -sub_815F7C4: @ 815F7C4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815F80E - movs r0, 0 - strh r0, [r4, 0x30] - ldr r0, =gUnknown_020244D0 - ldr r1, [r0] - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815F80E - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsls r1, r2, 29 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_0815F80E: - ldrh r0, [r4, 0x34] - ldrh r1, [r4, 0x36] - adds r0, r1 - movs r5, 0 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x36] - movs r2, 0x36 - ldrsh r0, [r4, r2] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl Cos - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815F840 - cmp r0, 0x1 - beq _0815F858 - b _0815F896 - .pool -_0815F840: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - bne _0815F896 - strh r5, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815F896 -_0815F858: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - ble _0815F896 - strh r5, [r4, 0x32] - ldrh r0, [r4, 0x38] - subs r0, 0x2 - strh r0, [r4, 0x38] - lsls r0, 16 - cmp r0, 0 - bge _0815F896 - ldr r3, =gTasks - movs r2, 0x3C - ldrsh r1, [r4, r2] - lsls r1, 1 - movs r0, 0x3A - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl obj_delete_but_dont_free_vram -_0815F896: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F7C4 - - thumb_func_start sub_815F8A0 -sub_815F8A0: @ 815F8A0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, =gBattleAnimArgs - movs r2, 0 - strh r2, [r3, 0xE] - ldr r1, =gHappinessMoveAnim - ldrb r0, [r1] - ldrb r1, [r1] - adds r0, r1, 0 - subs r0, 0x3D - lsls r0, 24 - lsrs r0, 24 - adds r2, r1, 0 - cmp r0, 0x1E - bhi _0815F8C4 - movs r0, 0x1 - strh r0, [r3, 0xE] -_0815F8C4: - adds r0, r2, 0 - subs r0, 0x5C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6C - bhi _0815F8D4 - movs r0, 0x2 - strh r0, [r3, 0xE] -_0815F8D4: - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, 0xC8 - bls _0815F8E0 - movs r0, 0x3 - strh r0, [r3, 0xE] -_0815F8E0: - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F8A0 - - thumb_func_start sub_815F8F4 -sub_815F8F4: @ 815F8F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x4 - bls _0815F91A - b _0815FE68 -_0815F91A: - lsls r0, 2 - ldr r1, =_0815F92C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815F92C: - .4byte _0815F940 - .4byte _0815F9F4 - .4byte _0815FBE8 - .4byte _0815FD08 - .4byte _0815FD8C -_0815F940: - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gTasks - mov r2, r8 - lsls r4, r2, 2 - adds r0, r4, r2 - lsls r0, 3 - adds r6, r0, r1 - movs r3, 0x80 - lsls r3, 4 - adds r0, r3, 0 - ldrh r1, [r6, 0xA] - adds r0, r1 - strh r0, [r6, 0xA] - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - bne _0815F998 - ldr r2, =gSprites - lsls r3, r7, 4 - adds r1, r3, r7 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r6, 0xA] - lsls r0, 16 - asrs r0, 24 - ldrh r4, [r1, 0x24] - adds r0, r4 - strh r0, [r1, 0x24] - b _0815F9B2 - .pool -_0815F998: - ldr r3, =gSprites - lsls r4, r7, 4 - adds r2, r4, r7 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r6, 0xA] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - adds r2, r3, 0 - adds r3, r4, 0 -_0815F9B2: - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r4, r0, r1 - ldrb r0, [r4, 0xA] - strh r0, [r4, 0xA] - adds r1, r3, r7 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x24] - ldrh r1, [r1, 0x20] - adds r0, r1 - lsls r0, 16 - movs r1, 0x80 - lsls r1, 14 - adds r0, r1 - movs r1, 0x98 - lsls r1, 17 - cmp r0, r1 - bhi _0815F9DE - b _0815FE68 -_0815F9DE: - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815FE68 - .pool -_0815F9F4: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815FA28 - ldr r0, =gUnknown_02039F34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldr r2, [r0, 0x8] - mov r10, r2 - ldr r3, [r0, 0xC] - mov r9, r3 - ldrh r6, [r0] - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl sub_80A82E4 - lsls r0, 24 - lsrs r4, r0, 24 - movs r7, 0 - b _0815FB4E - .pool -_0815FA28: - ldr r4, =gAnimationBankAttacker - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0815FAC8 - ldr r7, =gBattlePartyID - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - movs r1, 0 - bl GetMonData - mov r10, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl GetMonData - mov r9, r0 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815FA9C - lsls r0, r2, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - b _0815FA9E - .pool -_0815FA9C: - ldrh r6, [r1, 0x2] -_0815FA9E: - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - movs r7, 0 - movs r5, 0x88 - lsls r5, 1 - b _0815FB50 - .pool -_0815FAC8: - ldr r7, =gBattlePartyID - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gEnemyParty - adds r0, r5 - movs r1, 0 - bl GetMonData - mov r10, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl GetMonData - mov r9, r0 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815FB2C - lsls r0, r2, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - b _0815FB2E - .pool -_0815FB2C: - ldrh r6, [r1, 0x2] -_0815FB2E: - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - movs r7, 0x1 -_0815FB4E: - ldr r5, =0x0000ffe0 -_0815FB50: - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - lsls r3, r5, 16 - asrs r3, 16 - str r0, [sp] - str r4, [sp, 0x4] - mov r4, r10 - str r4, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - ldr r4, =gAnimationBankAttacker - ldrb r0, [r4] - str r0, [sp, 0x10] - movs r0, 0 - str r0, [sp, 0x14] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0 - bl sub_80A8394 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_020244D0 - ldr r1, [r0] - ldrb r0, [r4] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0815FBBA - ldr r1, =gSprites - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - orrs r0, r1 - ldr r3, =0x00007fff - movs r1, 0x10 - movs r2, 0x6 - bl BlendPalette -_0815FBBA: - ldr r0, =gTasks - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - strh r5, [r1, 0x26] - b _0815FD7E - .pool -_0815FBE8: - ldr r1, =gTasks - mov r0, r8 - lsls r4, r0, 2 - adds r0, r4, r0 - lsls r0, 3 - adds r6, r0, r1 - ldrh r0, [r6, 0x26] - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x80 - lsls r1, 4 - adds r0, r1, 0 - ldrh r2, [r6, 0xA] - adds r0, r2 - strh r0, [r6, 0xA] - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - bne _0815FC40 - ldr r3, =gSprites - lsls r4, r5, 4 - adds r2, r4, r5 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r6, 0xA] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - adds r2, r3, 0 - adds r3, r4, 0 - b _0815FC56 - .pool -_0815FC40: - ldr r2, =gSprites - lsls r3, r5, 4 - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r6, 0xA] - lsls r0, 16 - asrs r0, 24 - ldrh r4, [r1, 0x24] - adds r0, r4 - strh r0, [r1, 0x24] -_0815FC56: - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r6, r0, r1 - ldrb r0, [r6, 0xA] - strh r0, [r6, 0xA] - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x24] - ldrh r1, [r1, 0x20] - adds r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - movs r1, 0x24 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815FCD6 - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0815FCB4 - lsls r4, r5, 16 - asrs r4, 16 - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bge _0815FCD6 - b _0815FCCA - .pool -_0815FCB4: - lsls r4, r5, 16 - asrs r4, 16 - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - ble _0815FCD6 -_0815FCCA: - ldrh r0, [r6, 0x24] - adds r0, 0x1 - strh r0, [r6, 0x24] - ldr r1, =gBattleAnimArgs - ldr r0, =0x0000ffff - strh r0, [r1, 0xE] -_0815FCD6: - lsls r0, r5, 16 - movs r2, 0x80 - lsls r2, 14 - adds r0, r2 - movs r1, 0x98 - lsls r1, 17 - cmp r0, r1 - bhi _0815FCE8 - b _0815FE68 -_0815FCE8: - ldr r0, =gTasks - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0xA] - b _0815FD7E - .pool -_0815FD08: - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gTasks - mov r3, r8 - lsls r4, r3, 2 - adds r0, r4, r3 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x26] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - bl sub_80A8610 - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - bne _0815FD60 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r1, r5 - ldrh r0, [r1, 0x20] - negs r0, r0 - subs r0, 0x20 - strh r0, [r1, 0x24] - b _0815FD74 - .pool -_0815FD60: - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r5 - ldrh r2, [r0, 0x20] - movs r4, 0x88 - lsls r4, 1 - adds r1, r4, 0 - subs r1, r2 - strh r1, [r0, 0x24] -_0815FD74: - ldr r0, =gTasks - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 -_0815FD7E: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815FE68 - .pool -_0815FD8C: - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gTasks - mov r0, r8 - lsls r4, r0, 2 - adds r0, r4, r0 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0x80 - lsls r1, 4 - adds r0, r1, 0 - ldrh r3, [r2, 0xA] - adds r0, r3 - strh r0, [r2, 0xA] - ldr r0, =gAnimationBankAttacker - mov r10, r0 - ldrb r0, [r0] - str r2, [sp, 0x18] - bl GetBankSide - lsls r0, 24 - mov r9, r4 - ldr r2, [sp, 0x18] - cmp r0, 0 - bne _0815FE0C - ldr r1, =gSprites - lsls r5, r7, 4 - adds r0, r5, r7 - lsls r0, 2 - adds r6, r0, r1 - ldrh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r6, 0x24] - adds r0, r1 - strh r0, [r6, 0x24] - movs r2, 0x24 - ldrsh r4, [r6, r2] - movs r3, 0x20 - ldrsh r0, [r6, r3] - adds r4, r0 - mov r1, r10 - ldrb r0, [r1] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r3, r5, 0 - cmp r4, r0 - blt _0815FE44 - movs r2, 0 - strh r2, [r6, 0x24] - b _0815FE44 - .pool -_0815FE0C: - ldr r1, =gSprites - lsls r5, r7, 4 - adds r0, r5, r7 - lsls r0, 2 - adds r6, r0, r1 - ldrh r1, [r2, 0xA] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r6, 0x24] - subs r0, r1 - strh r0, [r6, 0x24] - movs r3, 0x24 - ldrsh r4, [r6, r3] - movs r1, 0x20 - ldrsh r0, [r6, r1] - adds r4, r0 - mov r2, r10 - ldrb r0, [r2] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r3, r5, 0 - cmp r4, r0 - bgt _0815FE44 - movs r4, 0 - strh r4, [r6, 0x24] -_0815FE44: - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xA] - strh r1, [r0, 0xA] - ldr r1, =gSprites - adds r0, r3, r7 - lsls r0, 2 - adds r0, r1 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815FE68 - mov r0, r8 - bl move_anim_task_del -_0815FE68: - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F8F4 - - thumb_func_start sub_815FE80 -sub_815FE80: @ 815FE80 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815FE92 - cmp r0, 0x1 - beq _0815FF3A - b _0815FFBC -_0815FE92: - ldr r0, =gBattleAnimArgs - movs r2, 0xE - ldrsh r1, [r0, r2] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _0815FF2C - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7A - bl PlaySE12WithPanning - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - strh r0, [r4, 0x22] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815FFBC - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815FFBC - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0x1 - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - b _0815FFBC - .pool -_0815FF2C: - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _0815FFBC -_0815FF3A: - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl Sin - strh r0, [r4, 0x26] - ldrh r2, [r4, 0x30] - adds r0, r2, 0x5 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7F - ble _0815FF6E - movs r1, 0x2E - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - adds r0, r2, 0 - subs r0, 0x7A - strh r0, [r4, 0x30] -_0815FF6E: - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0815FF9C - ldrh r2, [r4, 0x32] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x24] - subs r0, r1 - strh r0, [r4, 0x24] - adds r1, r2, 0 - b _0815FFA8 - .pool -_0815FF9C: - ldrh r1, [r4, 0x32] - lsls r0, r1, 16 - asrs r0, 24 - ldrh r2, [r4, 0x24] - adds r0, r2 - strh r0, [r4, 0x24] -_0815FFA8: - movs r0, 0xFF - ands r0, r1 - strh r0, [r4, 0x32] - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x2 - bne _0815FFBC - adds r0, r4, 0 - bl move_anim_8072740 -_0815FFBC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815FE80 - - thumb_func_start sub_815FFC4 -sub_815FFC4: @ 815FFC4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x26 - ldrsh r0, [r0, r2] - adds r3, r1, 0 - cmp r0, 0x4 - bls _0815FFE0 - b _08160132 -_0815FFE0: - lsls r0, 2 - ldr r1, =_0815FFF4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815FFF4: - .4byte _08160008 - .4byte _08160058 - .4byte _081600B4 - .4byte _081600CC - .4byte _08160132 -_08160008: - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - movs r0, 0x6 - strh r0, [r1, 0x8] - cmp r5, r2 - ble _0816003E - negs r0, r0 - strh r0, [r1, 0x8] -_0816003E: - strh r5, [r1, 0xA] - strh r2, [r1, 0xC] - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _08160150 - .pool -_08160058: - ldr r1, =gBankSpriteIds - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r1 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r3 - ldrh r0, [r2, 0x8] - ldrh r3, [r1, 0x24] - adds r0, r3 - strh r0, [r1, 0x24] - movs r3, 0x8 - ldrsh r0, [r2, r3] - cmp r0, 0 - ble _081600A0 - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xC - ldrsh r1, [r2, r3] - b _08160126 - .pool -_081600A0: - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xC - ldrsh r1, [r2, r3] - cmp r0, r1 - bgt _08160150 - b _0816012A -_081600B4: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r2, 0x8 - ldrsh r1, [r0, r2] - negs r1, r1 - strh r1, [r0, 0x8] - ldrh r1, [r0, 0x26] - adds r1, 0x1 - strh r1, [r0, 0x26] - b _08160150 -_081600CC: - ldr r1, =gBankSpriteIds - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r1 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r3 - ldrh r0, [r2, 0x8] - ldrh r3, [r1, 0x24] - adds r0, r3 - strh r0, [r1, 0x24] - movs r3, 0x8 - ldrsh r0, [r2, r3] - cmp r0, 0 - bge _08160118 - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xA - ldrsh r1, [r2, r3] - cmp r0, r1 - bgt _08160150 - b _0816012A - .pool -_08160118: - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xA - ldrsh r1, [r2, r3] -_08160126: - cmp r0, r1 - blt _08160150 -_0816012A: - ldrh r0, [r2, 0x26] - adds r0, 0x1 - strh r0, [r2, 0x26] - b _08160150 -_08160132: - ldr r1, =gBankSpriteIds - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x24] - adds r0, r4, 0 - bl move_anim_task_del -_08160150: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815FFC4 - - thumb_func_start sub_8160164 -sub_8160164: @ 8160164 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r4, r1, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0xE] - ldr r0, =gAnimationBankAttacker - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - movs r2, 0x1 - negs r2, r2 - adds r1, r2, 0 - cmp r0, 0 - bne _08160198 - movs r1, 0x1 -_08160198: - strh r1, [r4, 0x10] - ldr r2, =gSprites - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x22] - strh r0, [r4, 0x14] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x20] - strh r0, [r4, 0x12] - strh r5, [r4, 0x1A] - strh r5, [r4, 0x1E] - movs r0, 0x1 - strh r0, [r4, 0x1C] - strh r5, [r4, 0x20] - ldr r0, =sub_81601DC - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160164 - - thumb_func_start sub_81601DC -sub_81601DC: @ 81601DC - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08160284 - cmp r0, 0x1 - bgt _08160204 - cmp r0, 0 - beq _0816020A - b _081602DA - .pool -_08160204: - cmp r0, 0x2 - beq _081602D4 - b _081602DA -_0816020A: - ldrh r0, [r4, 0x1E] - adds r0, 0x8 - movs r2, 0xFF - ands r0, r2 - strh r0, [r4, 0x1E] - ldr r5, =gSprites - movs r6, 0xE - ldrsh r0, [r4, r6] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldr r3, =gSineTable - movs r6, 0x1E - ldrsh r0, [r4, r6] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 - strh r0, [r1, 0x24] - ldrh r0, [r4, 0x1A] - adds r0, 0x2 - ands r0, r2 - strh r0, [r4, 0x1A] - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r5 - movs r6, 0x1A - ldrsh r0, [r4, r6] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x10] - muls r0, r1 - ldrh r1, [r4, 0x12] - adds r0, r1 - strh r0, [r2, 0x20] - movs r6, 0x1A - ldrsh r0, [r4, r6] - cmp r0, 0 - bne _081602DA - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r4, 0x12] - strh r1, [r0, 0x20] - b _081602C4 - .pool -_08160284: - ldrh r0, [r4, 0x1E] - adds r0, 0x8 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x1E] - ldr r3, =gSprites - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldr r2, =gSineTable - movs r5, 0x1E - ldrsh r0, [r4, r5] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 - strh r0, [r1, 0x24] - movs r6, 0x1E - ldrsh r2, [r4, r6] - cmp r2, 0 - bne _081602DA - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - strh r2, [r1, 0x24] -_081602C4: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _081602DA - .pool -_081602D4: - adds r0, r2, 0 - bl move_anim_task_del -_081602DA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81601DC - - thumb_func_start sub_81602E0 -sub_81602E0: @ 81602E0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - ldrh r0, [r4, 0x2E] - ldrh r1, [r4, 0x30] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x14 - bl Cos - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x14 - bl Sin - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08160326 - adds r0, r4, 0 - bl move_anim_8072740 -_08160326: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81602E0 - - thumb_func_start sub_8160338 -sub_8160338: @ 8160338 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gAnimationBankTarget - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0816037C - ldr r2, =gBattleAnimArgs - ldrh r0, [r4, 0x20] - ldrh r1, [r2] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =0x0000fff5 - strh r0, [r4, 0x2E] - movs r0, 0xC0 - strh r0, [r4, 0x30] - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - b _08160396 - .pool -_0816037C: - movs r0, 0xB - strh r0, [r4, 0x2E] - movs r0, 0xC0 - strh r0, [r4, 0x30] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] -_08160396: - ldr r0, =sub_81602E0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160338 - - thumb_func_start sub_81603A8 -sub_81603A8: @ 81603A8 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gAnimationBankAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - strh r0, [r5, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bgt _081603D2 - movs r0, 0x10 - strh r0, [r5, 0x22] -_081603D2: - movs r0, 0 - strh r0, [r5, 0x3A] - movs r1, 0x10 - strh r1, [r5, 0x3C] - ldr r0, =sub_81603F4 - str r0, [r5, 0x1C] - lsls r1, 8 - movs r0, 0x52 - bl SetGpuReg - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81603A8 - - thumb_func_start sub_81603F4 -sub_81603F4: @ 81603F4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0816046C - cmp r1, 0x1 - bgt _0816040A - cmp r1, 0 - beq _08160414 - b _081604E8 -_0816040A: - cmp r1, 0x2 - beq _08160482 - cmp r1, 0x3 - beq _081604E2 - b _081604E8 -_08160414: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081604E8 - strh r1, [r4, 0x2E] - ldrh r1, [r4, 0x30] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0816043E - ldrh r2, [r4, 0x3A] - movs r3, 0x3A - ldrsh r0, [r4, r3] - cmp r0, 0xF - bgt _0816044C - adds r0, r2, 0x1 - strh r0, [r4, 0x3A] - b _0816044C -_0816043E: - ldrh r2, [r4, 0x3C] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _0816044C - subs r0, r2, 0x1 - strh r0, [r4, 0x3C] -_0816044C: - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x3C] - lsls r1, 8 - ldrh r0, [r4, 0x3A] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081604E8 - b _081604DA -_0816046C: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _081604E8 - strh r1, [r4, 0x2E] - strh r1, [r4, 0x30] - b _081604DA -_08160482: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081604E8 - movs r0, 0 - strh r0, [r4, 0x2E] - ldrh r1, [r4, 0x30] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081604AE - ldrh r2, [r4, 0x3A] - movs r3, 0x3A - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _081604BC - subs r0, r2, 0x1 - strh r0, [r4, 0x3A] - b _081604BC -_081604AE: - ldrh r2, [r4, 0x3C] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r0, 0xF - bgt _081604BC - adds r0, r2, 0x1 - strh r0, [r4, 0x3C] -_081604BC: - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x3C] - lsls r1, 8 - ldrh r0, [r4, 0x3A] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _081604E8 -_081604DA: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - b _081604E8 -_081604E2: - adds r0, r4, 0 - bl move_anim_8074EE0 -_081604E8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81603F4 - - thumb_func_start sub_81604F0 -sub_81604F0: @ 81604F0 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gBattleAnimArgs - movs r0, 0 - strh r0, [r2, 0xE] - ldr r0, =gWeatherMoveAnim - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08160514 - movs r0, 0x1 - b _08160536 - .pool -_08160514: - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08160520 - movs r0, 0x2 - b _08160536 -_08160520: - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _0816052C - movs r0, 0x3 - b _08160536 -_0816052C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160538 - movs r0, 0x4 -_08160536: - strh r0, [r2, 0xE] -_08160538: - adds r0, r3, 0 - bl move_anim_task_del - pop {r0} - bx r0 - thumb_func_end sub_81604F0 - - thumb_func_start sub_8160544 -sub_8160544: @ 8160544 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x26] - ldr r2, =gUnknown_085CE9C8 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_816058C - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160544 - - thumb_func_start sub_816058C -sub_816058C: @ 816058C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r2, =gTasks - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - adds r1, r0, 0x1 - movs r5, 0 - strh r1, [r3, 0x8] - subs r0, 0x10 - lsls r0, 16 - lsrs r0, 16 - adds r6, r2, 0 - cmp r0, 0x16 - bhi _081605F0 - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _08160600 - strh r5, [r3, 0xA] - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - movs r5, 0x1 - ands r0, r5 - cmp r0, 0 - bne _081605F0 - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - b _08160600 - .pool -_081605F0: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] -_08160600: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r6 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _08160618 - adds r0, r4, 0 - bl move_anim_task_del -_08160618: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816058C - - thumb_func_start sub_8160624 -sub_8160624: @ 8160624 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_8160624 - - thumb_func_start sub_8160638 -sub_8160638: @ 8160638 - push {lr} - sub sp, 0x4 - bl script_env_2_enable - ldr r0, =sub_8160664 - movs r1, 0xA - bl CreateTask - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160638 - - thumb_func_start sub_8160664 -sub_8160664: @ 8160664 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08160688 - ldr r0, =sub_81606A0 - bl SetMainCallback2 - ldr r1, =gUnknown_03005DAC - ldr r0, =sub_80AF168 - str r0, [r1] - adds r0, r4, 0 - bl DestroyTask -_08160688: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160664 - - thumb_func_start sub_81606A0 -sub_81606A0: @ 81606A0 - push {r4-r6,lr} - bl ResetSpriteData - bl FreeAllSpritePalettes - bl ResetTasks - bl clear_scheduled_bg_copies_to_vram - ldr r6, =gUnknown_0203BC34 - movs r0, 0x8C - lsls r0, 1 - bl AllocZeroed - str r0, [r6] - ldr r1, =gSpecialVar_0x8004 - ldrh r1, [r1] - adds r0, 0x44 - movs r5, 0 - strb r1, [r0] - ldr r0, =sub_8160624 - bl SetVBlankCallback - bl sub_81607EC - movs r0, 0 - bl sub_81D2824 - ldr r4, =gUnknown_0203BC38 - movs r0, 0 - strh r5, [r4] - strh r5, [r4, 0x2] - strb r0, [r4, 0x4] - bl sub_8161280 - ldr r0, =gUnknown_085CEBB0 - bl LoadSpriteSheet - ldr r0, =gUnknown_085CEBB8 - bl LoadSpritePalette - bl sub_81610B8 - ldr r0, =gUnknown_03006310 - ldrh r1, [r4] - ldrh r2, [r4, 0x2] - bl ListMenuInit - ldr r1, [r6] - movs r2, 0x89 - lsls r2, 1 - adds r1, r2 - strb r0, [r1] - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - bl FillPalette - ldr r0, =sub_816082C - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81606A0 - - thumb_func_start sub_8160740 -sub_8160740: @ 8160740 - push {r4,r5,lr} - bl ResetSpriteData - bl FreeAllSpritePalettes - bl ResetTasks - bl clear_scheduled_bg_copies_to_vram - ldr r5, =gUnknown_0203BC34 - movs r0, 0x8C - lsls r0, 1 - bl AllocZeroed - str r0, [r5] - movs r1, 0x1C - strb r1, [r0] - ldr r0, [r5] - ldr r1, =gSpecialVar_0x8004 - ldrh r1, [r1] - adds r0, 0x44 - strb r1, [r0] - ldr r0, [r5] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - adds r0, 0x45 - strb r1, [r0] - ldr r0, =sub_8160624 - bl SetVBlankCallback - bl sub_81607EC - ldr r4, =gUnknown_0203BC38 - ldrb r0, [r4, 0x4] - bl sub_81D2824 - bl sub_8161280 - ldr r0, =gUnknown_085CEBB0 - bl LoadSpriteSheet - ldr r0, =gUnknown_085CEBB8 - bl LoadSpritePalette - bl sub_81610B8 - ldr r0, =gUnknown_03006310 - ldrh r1, [r4] - ldrh r2, [r4, 0x2] - bl ListMenuInit - ldr r1, [r5] - movs r2, 0x89 - lsls r2, 1 - adds r1, r2 - strb r0, [r1] - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - bl FillPalette - ldr r0, =sub_816082C - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160740 - - thumb_func_start sub_81607EC -sub_81607EC: @ 81607EC - push {lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085CEC28 - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - bl sub_8121E10 - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_81607EC - - thumb_func_start sub_816082C -sub_816082C: @ 816082C - push {lr} - bl sub_8160868 - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl do_scheduled_bg_tilemap_copies_to_vram - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_816082C - - thumb_func_start sub_816084C -sub_816084C: @ 816084C - push {r4,lr} - adds r1, r0, 0 - ldr r4, =gStringVar4 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - bl sub_81D2BF4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816084C - - thumb_func_start sub_8160868 -sub_8160868: @ 8160868 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r1, =gUnknown_0203BC34 - ldr r0, [r1] - ldrb r0, [r0] - adds r7, r1, 0 - cmp r0, 0x21 - bls _0816087E - b _08160E8A -_0816087E: - lsls r0, 2 - ldr r1, =_08160890 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08160890: - .4byte _08160918 - .4byte _08160932 - .4byte _0816094C - .4byte _08160954 - .4byte _0816095C - .4byte _08160964 - .4byte _08160980 - .4byte _08160E8A - .4byte _08160988 - .4byte _081609A8 - .4byte _08160E8A - .4byte _08160E8A - .4byte _08160A44 - .4byte _08160A64 - .4byte _08160CB8 - .4byte _08160CD8 - .4byte _08160AB8 - .4byte _08160AD0 - .4byte _08160AEC - .4byte _08160C1C - .4byte _08160C48 - .4byte _08160C98 - .4byte _08160CA6 - .4byte _08160E8A - .4byte _08160B2C - .4byte _08160B60 - .4byte _08160B80 - .4byte _08160BDC - .4byte _08160CFC - .4byte _08160D48 - .4byte _08160E0C - .4byte _08160E38 - .4byte _08160E58 - .4byte _08160E70 -_08160918: - ldr r1, [r7] - ldrb r0, [r1] - adds r0, 0x1 - movs r4, 0 - strb r0, [r1] - movs r0, 0 - bl render_previous_quest_text - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - b _08160CAE -_08160932: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160940 - b _08160E8A -_08160940: - ldr r1, [r7] - movs r0, 0x4 - b _08160E88 - .pool -_0816094C: - ldr r1, [r7] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 -_08160954: - movs r0, 0 - bl render_previous_quest_text - b _0816096A -_0816095C: - movs r0, 0 - bl sub_8160F50 - b _08160E8A -_08160964: - movs r0, 0 - bl sub_8161074 -_0816096A: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_81611AC - b _08160E8A - .pool -_08160980: - movs r0, 0x1 - bl sub_8160F50 - b _08160E8A -_08160988: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160994 - b _08160E8A -_08160994: - bl sub_81D2C50 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_081609A8: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - bne _08160A0A - ldr r5, =gUnknown_0203BC34 - ldr r0, [r5] - adds r0, 0x44 - ldrb r1, [r0] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - bl sub_8161054 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl pokemon_moveset_pad_ - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - beq _08160A04 - ldr r0, =gUnknown_085EF8E4 - bl sub_816084C - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] - ldr r1, [r5] - movs r0, 0x1F - b _08160E88 - .pool -_08160A04: - ldr r1, [r5] - movs r0, 0x10 - b _08160E88 -_08160A0A: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08160A18 - cmp r1, 0x1 - beq _08160A18 - b _08160E8A -_08160A18: - ldr r0, =gUnknown_0203BC38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160A30 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x3 - b _08160E88 - .pool -_08160A30: - cmp r0, 0x1 - beq _08160A36 - b _08160E8A -_08160A36: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x5 - b _08160E88 - .pool -_08160A44: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160A50 - b _08160E8A -_08160A50: - bl sub_81D2C50 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160A64: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - bne _08160A7C - ldr r0, =gSpecialVar_0x8004 - strh r1, [r0] - b _08160E82 - .pool -_08160A7C: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08160A8A - cmp r1, 0x1 - beq _08160A8A - b _08160E8A -_08160A8A: - ldr r0, =gUnknown_0203BC38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160AA4 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x3 - b _08160E88 - .pool -_08160AA4: - cmp r0, 0x1 - beq _08160AAA - b _08160E8A -_08160AAA: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x5 - b _08160E88 - .pool -_08160AB8: - ldr r0, =gUnknown_085EF8F3 - bl sub_816084C - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160AD0: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160ADC - b _08160E8A -_08160ADC: - bl sub_81D2C50 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x12 - b _08160E88 - .pool -_08160AEC: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - bne _08160B10 - ldr r0, =gUnknown_085EFA10 - bl sub_816084C - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x13 - b _08160E88 - .pool -_08160B10: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08160B1E - cmp r1, 0x1 - beq _08160B1E - b _08160E8A -_08160B1E: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x18 - b _08160E88 - .pool -_08160B2C: - ldr r4, =gStringVar2 - bl sub_8161054 - movs r1, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - ldr r0, =gUnknown_085EF960 - bl sub_816084C - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160B60: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160B6C - b _08160E8A -_08160B6C: - bl sub_81D2C50 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160B80: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - bne _08160B98 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x1B - b _08160E88 - .pool -_08160B98: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08160BA6 - cmp r1, 0x1 - beq _08160BA6 - b _08160E8A -_08160BA6: - ldr r0, =gUnknown_0203BC38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160BC4 - ldr r2, =gUnknown_0203BC34 - ldr r1, [r2] - movs r0, 0x3 - strb r0, [r1] - adds r7, r2, 0 - b _08160BD0 - .pool -_08160BC4: - ldr r7, =gUnknown_0203BC34 - cmp r0, 0x1 - bne _08160BD0 - ldr r1, [r7] - movs r0, 0x5 - strb r0, [r1] -_08160BD0: - ldr r1, [r7] - movs r0, 0x10 - b _08160E88 - .pool -_08160BDC: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160BE8 - b _08160E8A -_08160BE8: - movs r0, 0x3 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0203BC38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160C08 - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x3 - b _08160E88 - .pool -_08160C08: - cmp r0, 0x1 - beq _08160C0E - b _08160E8A -_08160C0E: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x5 - b _08160E88 - .pool -_08160C1C: - bl sub_81D2C3C - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _08160C2A - b _08160E8A -_08160C2A: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x14 - strb r0, [r1] - subs r0, 0x15 - str r2, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _08160E8A - .pool -_08160C48: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160C56 - b _08160E8A -_08160C56: - bl sub_8161054 - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gPlayerParty - ldr r1, =gUnknown_0203BC34 - ldr r1, [r1] - adds r1, 0x44 - ldrb r1, [r1] - ldr r2, =gPlayerPartyCount - ldrb r2, [r2] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =sub_8160740 - str r0, [sp] - adds r0, r4, 0 - bl sub_81BFA38 - bl sub_8160EA0 - b _08160E8A - .pool -_08160C98: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160CA4 - b _08160E8A -_08160CA4: - b _08160E82 -_08160CA6: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] -_08160CAE: - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - b _08160E8A -_08160CB8: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160CD8: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160CE6 - b _08160E8A -_08160CE6: - bl sub_8160EA0 - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - b _08160E8A - .pool -_08160CFC: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, =gUnknown_0203BC38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160D30 - movs r0, 0x1 - bl render_previous_quest_text - b _08160D3A - .pool -_08160D30: - cmp r0, 0x1 - bne _08160D3A - movs r0, 0x1 - bl sub_8161074 -_08160D3A: - bl sub_8161234 - movs r0, 0x3 - movs r1, 0x2 - bl CopyWindowToVram - b _08160E8A -_08160D48: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160D56 - b _08160E8A -_08160D56: - ldr r1, [r7] - adds r2, r1, 0 - adds r2, 0x45 - ldrb r0, [r2] - cmp r0, 0x4 - bne _08160D6C - movs r0, 0x18 - b _08160E88 - .pool -_08160D6C: - adds r0, r1, 0 - adds r0, 0x44 - ldrb r0, [r0] - movs r4, 0x64 - muls r0, r4 - ldr r5, =gPlayerParty - adds r0, r5 - ldrb r1, [r2] - adds r1, 0xD - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gStringVar3 - movs r1, 0xD - mov r8, r1 - mov r1, r8 - muls r1, r0 - ldr r6, =gMoveNames - adds r1, r6 - adds r0, r2, 0 - bl StringCopy - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x44 - ldrb r0, [r0] - muls r0, r4 - adds r0, r5 - adds r1, 0x45 - ldrb r1, [r1] - bl sub_806B9A8 - ldr r0, [r7] - adds r0, 0x44 - ldrb r0, [r0] - muls r4, r0 - adds r4, r5 - bl sub_8161054 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [r7] - adds r0, 0x45 - ldrb r2, [r0] - adds r0, r4, 0 - bl sub_80691F4 - ldr r4, =gStringVar2 - bl sub_8161054 - mov r1, r8 - muls r1, r0 - adds r1, r6 - adds r0, r4, 0 - bl StringCopy - ldr r0, =gUnknown_085EF979 - bl sub_816084C - ldr r1, [r7] - movs r0, 0x1E - strb r0, [r1] - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] - b _08160E8A - .pool -_08160E0C: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - bne _08160E8A - ldr r0, =gUnknown_085EF9A6 - bl sub_816084C - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x1F - strb r0, [r1] - ldr r0, =0x0000016f - bl PlayFanfare - b _08160E8A - .pool -_08160E38: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - bne _08160E8A - ldr r0, =0x0000016f - bl PlayFanfare - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x20 - b _08160E88 - .pool -_08160E58: - bl IsFanfareTaskInactive - lsls r0, 24 - cmp r0, 0 - beq _08160E8A - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0x21 - b _08160E88 - .pool -_08160E70: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08160E8A - movs r0, 0x5 - bl PlaySE -_08160E82: - ldr r0, =gUnknown_0203BC34 - ldr r1, [r0] - movs r0, 0xE -_08160E88: - strb r0, [r1] -_08160E8A: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160868 - - thumb_func_start sub_8160EA0 -sub_8160EA0: @ 8160EA0 - push {r4,lr} - bl sub_8161234 - ldr r4, =gUnknown_0203BC34 - ldr r0, [r4] - movs r1, 0x89 - lsls r1, 1 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =gUnknown_0203BC38 - adds r2, r1, 0x2 - bl sub_81AE6C8 - bl FreeAllWindowBuffers - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - bl ResetSpriteData - bl FreeAllSpritePalettes - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160EA0 - - thumb_func_start render_previous_quest_text -render_previous_quest_text: @ 8160EE0 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - movs r2, 0 - ldr r6, =gSprites - ldr r4, =gUnknown_0203BC34 - movs r3, 0x4 -_08160EF0: - ldr r0, [r4] - adds r0, 0x1 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0xF - ble _08160EF0 - cmp r5, 0 - bne _08160F38 - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EF8C2 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x3 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print -_08160F38: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end render_previous_quest_text - - thumb_func_start sub_8160F50 -sub_8160F50: @ 8160F50 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r6, =gUnknown_0203BC34 - ldr r0, [r6] - movs r4, 0x89 - lsls r4, 1 - adds r0, r4 - ldrb r0, [r0] - bl ListMenuHandleInput - adds r5, r0, 0 - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - ldr r4, =gUnknown_0203BC38 - adds r2, r4, 0x2 - adds r1, r4, 0 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - beq _08160FE4 - adds r0, 0x1 - cmp r5, r0 - bne _08161010 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - bne _08160F9C - bl GetLRKeysState - lsls r0, 24 - cmp r0, 0 - beq _0816103E -_08160F9C: - movs r0, 0x5 - bl PlaySE - cmp r7, 0 - bne _08160FC4 - movs r0, 0x1 - bl PutWindowTilemap - ldr r0, [r6] - movs r1, 0x5 - strb r1, [r0] - movs r0, 0x1 - strb r0, [r4, 0x4] - b _08160FD4 - .pool -_08160FC4: - movs r0, 0 - bl PutWindowTilemap - ldr r0, [r6] - movs r2, 0 - movs r1, 0x3 - strb r1, [r0] - strb r2, [r4, 0x4] -_08160FD4: - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - bl sub_8161054 - bl sub_816137C - b _0816103E -_08160FE4: - movs r0, 0x5 - bl PlaySE - bl sub_8161234 - ldr r1, [r6] - movs r0, 0xC - strb r0, [r1] - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EF9E6 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - bl sub_81D2BF4 - b _0816103E - .pool -_08161010: - movs r0, 0x5 - bl PlaySE - bl sub_8161234 - ldr r1, [r6] - movs r0, 0x8 - strb r0, [r1] - ldr r0, =gStringVar2 - movs r1, 0xD - muls r1, r5 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EF8DA - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - bl sub_81D2BF4 -_0816103E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160F50 - - thumb_func_start sub_8161054 -sub_8161054: @ 8161054 - ldr r0, =gUnknown_0203BC34 - ldr r2, [r0] - ldr r1, =gUnknown_0203BC38 - ldrh r0, [r1, 0x2] - ldrh r1, [r1] - adds r0, r1 - lsls r0, 3 - adds r2, 0x4C - adds r2, r0 - ldr r0, [r2] - bx lr - .pool - thumb_func_end sub_8161054 - - thumb_func_start sub_8161074 -sub_8161074: @ 8161074 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081610A6 - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EF8C2 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x3 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print -_081610A6: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161074 - - thumb_func_start sub_81610B8 -sub_81610B8: @ 81610B8 - push {r4-r7,lr} - ldr r2, =gUnknown_0203BC34 - ldr r0, [r2] - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x00000113 - adds r1, r0, r2 - movs r0, 0x1 - negs r0, r0 - strb r0, [r1] - bl sub_81611AC - movs r4, 0 - ldr r5, =gUnknown_085CEC10 -_081610DC: - adds r2, r4, 0 - cmp r4, 0 - bge _081610E4 - adds r2, r4, 0x3 -_081610E4: - asrs r2, 2 - lsls r1, r2, 2 - subs r1, r4, r1 - lsls r1, 19 - movs r0, 0xD0 - lsls r0, 15 - adds r1, r0 - asrs r1, 16 - lsls r2, 19 - movs r0, 0x90 - lsls r0, 14 - adds r2, r0 - asrs r2, 16 - adds r0, r5, 0 - movs r3, 0 - bl CreateSprite - ldr r2, =gUnknown_0203BC34 - ldr r1, [r2] - adds r1, 0x1 - adds r1, r4 - strb r0, [r1] - adds r4, 0x1 - cmp r4, 0x7 - ble _081610DC - movs r4, 0 - ldr r7, =gUnknown_085CEC10 - adds r6, r2, 0 -_0816111C: - adds r2, r4, 0 - cmp r4, 0 - bge _08161124 - adds r2, r4, 0x3 -_08161124: - asrs r2, 2 - lsls r1, r2, 2 - subs r1, r4, r1 - lsls r1, 19 - movs r0, 0xD0 - lsls r0, 15 - adds r1, r0 - asrs r1, 16 - lsls r2, 19 - movs r0, 0xD0 - lsls r0, 14 - adds r2, r0 - asrs r2, 16 - adds r0, r7, 0 - movs r3, 0 - bl CreateSprite - ldr r1, [r6] - adds r2, r4, 0 - adds r2, 0x8 - adds r1, 0x1 - adds r1, r2 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x1 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - movs r1, 0x2 - bl StartSpriteAnim - adds r4, 0x1 - cmp r4, 0x7 - ble _0816111C - movs r4, 0 - ldr r3, =gUnknown_0203BC34 - movs r2, 0x4 -_08161176: - ldr r0, [r3] - adds r0, 0x1 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0xF - ble _08161176 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81610B8 - - thumb_func_start sub_81611AC -sub_81611AC: @ 81611AC - push {r4-r6,lr} - ldr r4, =gUnknown_0203BC34 - ldr r1, [r4] - movs r2, 0x8A - lsls r2, 1 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081611D4 - ldr r0, =gUnknown_085CEBC0 - movs r3, 0x8B - lsls r3, 1 - adds r1, r3 - bl AddScrollIndicatorArrowPair - ldr r1, [r4] - movs r5, 0x8A - lsls r5, 1 - adds r1, r5 - strb r0, [r1] -_081611D4: - ldr r0, [r4] - ldr r6, =0x00000113 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08161210 - ldr r0, =gUnknown_0203CE8C - adds r2, r0, 0 - ldr r1, =gUnknown_085CEBD0 - ldm r1!, {r3,r5,r6} - stm r2!, {r3,r5,r6} - ldr r1, [r1] - str r1, [r2] - ldr r2, [r4] - movs r3, 0x88 - lsls r3, 1 - adds r1, r2, r3 - ldrb r1, [r1] - ldr r5, =0x00000111 - adds r2, r5 - ldrb r2, [r2] - subs r1, r2 - strh r1, [r0, 0x8] - ldr r1, =gUnknown_0203BC38 - bl AddScrollIndicatorArrowPair - ldr r1, [r4] - ldr r6, =0x00000113 - adds r1, r6 - strb r0, [r1] -_08161210: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81611AC - - thumb_func_start sub_8161234 -sub_8161234: @ 8161234 - push {r4,lr} - ldr r4, =gUnknown_0203BC34 - ldr r0, [r4] - movs r2, 0x8A - lsls r2, 1 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08161256 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_08161256: - ldr r0, [r4] - ldr r2, =0x00000113 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08161270 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r2, =0x00000113 - adds r1, r0, r2 - movs r0, 0xFF - strb r0, [r1] -_08161270: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161234 - - thumb_func_start sub_8161280 -sub_8161280: @ 8161280 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - ldr r4, =gUnknown_0203BC34 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x44 - ldrb r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =gPlayerParty - adds r0, r2 - adds r1, 0x12 - bl sub_806E0B4 - ldr r1, [r4] - movs r6, 0x88 - lsls r6, 1 - adds r1, r6 - strb r0, [r1] - movs r5, 0 - ldr r0, [r4] - adds r0, r6 - ldrb r0, [r0] - cmp r5, r0 - bge _081612F6 - mov r8, r4 - movs r0, 0xD - mov r12, r0 - ldr r2, =gMoveNames - mov r9, r2 -_081612C2: - mov r7, r8 - ldr r4, [r7] - lsls r3, r5, 3 - adds r2, r4, 0 - adds r2, 0x48 - adds r2, r3 - lsls r0, r5, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r1, r0 - ldrh r0, [r1] - mov r7, r12 - muls r7, r0 - adds r0, r7, 0 - add r0, r9 - str r0, [r2] - adds r0, r4, 0 - adds r0, 0x4C - adds r0, r3 - ldrh r1, [r1] - str r1, [r0] - adds r5, 0x1 - adds r0, r4, r6 - ldrb r0, [r0] - cmp r5, r0 - blt _081612C2 -_081612F6: - ldr r4, =gUnknown_0203BC34 - ldr r0, [r4] - adds r0, 0x44 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData - ldr r0, =gStringVar1 - mov r1, sp - bl StringCopy10 - ldr r2, [r4] - movs r5, 0x88 - lsls r5, 1 - adds r3, r2, r5 - ldrb r0, [r3] - lsls r0, 3 - adds r1, r2, 0 - adds r1, 0x48 - adds r1, r0 - ldr r0, =gUnknown_085E8CF0 - str r0, [r1] - ldrb r0, [r3] - lsls r0, 3 - adds r2, 0x4C - adds r2, r0 - movs r0, 0x2 - negs r0, r0 - str r0, [r2] - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x48 - adds r1, r5 - ldrb r1, [r1] - bl sub_81D28C8 - ldr r1, [r4] - ldr r2, =0x00000111 - adds r1, r2 - strb r0, [r1] - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161280 - - thumb_func_start sub_816137C -sub_816137C: @ 816137C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - ldr r0, =gUnknown_0203BC38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _08161394 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - bne _081613CC -_08161394: - movs r5, 0 - ldr r4, =gSprites - ldr r3, =gUnknown_0203BC34 - movs r2, 0x4 -_0816139C: - ldr r0, [r3] - adds r0, 0x1 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0xF - bls _0816139C - b _081614FE - .pool -_081613CC: - ldr r1, =gContestEffects - ldr r0, =gContestMoves - lsls r4, 3 - adds r0, r4, r0 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x1] - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r6, r0, 24 - mov r8, r4 - cmp r6, 0xFF - bne _081613EE - movs r6, 0 -_081613EE: - movs r5, 0 - ldr r7, =gUnknown_0203BC34 - ldr r4, =gSprites -_081613F4: - cmp r5, r6 - bcs _08161420 - ldr r0, [r7] - adds r0, 0x1 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAnim - b _08161436 - .pool -_08161420: - ldr r0, [r7] - adds r0, 0x1 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - bl StartSpriteAnim -_08161436: - ldr r0, [r7] - adds r0, 0x1 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - movs r3, 0x5 - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x7 - bls _081613F4 - ldr r1, =gContestEffects - ldr r0, =gContestMoves - add r0, r8 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xFF - bne _0816147C - movs r6, 0 -_0816147C: - movs r5, 0 - ldr r0, =gUnknown_0203BC34 - mov r8, r0 - ldr r7, =gSprites -_08161484: - cmp r5, r6 - bcs _081614B8 - mov r1, r8 - ldr r0, [r1] - adds r4, r5, 0 - adds r4, 0x8 - adds r0, 0x1 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - movs r1, 0x3 - bl StartSpriteAnim - b _081614D4 - .pool -_081614B8: - mov r3, r8 - ldr r0, [r3] - adds r4, r5, 0 - adds r4, 0x8 - adds r0, 0x1 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - movs r1, 0x2 - bl StartSpriteAnim -_081614D4: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x1 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r0, 0x3E - ldrb r1, [r0] - movs r3, 0x5 - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x7 - bls _08161484 -_081614FE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_816137C - - thumb_func_start hm_prepare_dive_probably -hm_prepare_dive_probably: @ 8161508 - push {r4-r6,lr} - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - movs r6, 0x64 - muls r0, r6 - ldr r4, =gPlayerParty - adds r0, r4 - movs r1, 0x3A - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - muls r0, r6 - adds r0, r4 - movs r1, 0x39 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x5 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - bhi _08161558 - movs r0, 0 - b _0816155A - .pool -_08161558: - movs r0, 0x1 -_0816155A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end hm_prepare_dive_probably - - thumb_func_start sub_8161560 -sub_8161560: @ 8161560 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0xA - strb r1, [r0, 0xB] - ldrb r1, [r0, 0x9] - strb r1, [r0, 0xA] - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_81B0FCC - movs r0, 0x5 - bl display_pokemon_menu_message - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1370 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161560 - - thumb_func_start sub_81615A8 -sub_81615A8: @ 81615A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - str r4, [sp, 0x4] - ldr r1, =gUnknown_0203CEC8 - ldrb r7, [r1, 0x9] - mov r8, r7 - ldrb r0, [r1, 0xA] - adds r5, r0, 0 - cmp r5, 0x6 - bls _081615EC - movs r0, 0 - strb r0, [r1, 0xB] - bl display_pokemon_menu_message - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1370 - str r1, [r0] - b _08161658 - .pool -_081615EC: - movs r0, 0x64 - mov r10, r0 - mov r0, r10 - muls r0, r5 - ldr r1, =gPlayerParty - mov r9, r1 - adds r6, r0, r1 - adds r0, r6, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _0816161A - cmp r7, r5 - beq _0816161A - adds r0, r6, 0 - movs r1, 0x3A - bl GetMonData - cmp r0, r4 - bne _08161628 -_0816161A: - ldr r0, [sp, 0x4] - bl sub_81617B8 - b _08161658 - .pool -_08161628: - movs r0, 0x1 - bl PlaySE - mov r1, r10 - mov r0, r8 - muls r0, r1 - add r0, r9 - movs r1, 0x3A - bl GetMonData - movs r1, 0x5 - bl __udivsi3 - adds r3, r0, 0 - lsls r3, 16 - asrs r3, 16 - movs r2, 0x1 - negs r2, r2 - ldr r0, =sub_816166C - str r0, [sp] - ldr r0, [sp, 0x4] - mov r1, r8 - bl sub_81B1F18 -_08161658: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81615A8 - - thumb_func_start sub_816166C -sub_816166C: @ 816166C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl PlaySE - ldr r5, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r5, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x3A - bl GetMonData - movs r1, 0x5 - bl __udivsi3 - adds r3, r0, 0 - lsls r3, 16 - asrs r3, 16 - ldrb r1, [r5, 0xA] - ldr r0, =sub_81616C0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - bl sub_81B1F18 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816166C - - thumb_func_start sub_81616C0 -sub_81616C0: @ 81616C0 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0xA - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9C17 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8161724 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81616C0 - - thumb_func_start sub_8161724 -sub_8161724: @ 8161724 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08161772 - ldr r4, =gUnknown_0203CEC8 - movs r0, 0 - strb r0, [r4, 0xB] - ldrb r0, [r4, 0x9] - movs r1, 0 - bl sub_81B0FCC - ldrb r0, [r4, 0xA] - strb r0, [r4, 0x9] - ldrb r0, [r4, 0xA] - movs r1, 0x1 - bl sub_81B0FCC - movs r0, 0x6 - movs r1, 0 - bl sub_8198070 - movs r0, 0x6 - bl ClearWindowTilemap - movs r0, 0 - bl display_pokemon_menu_message - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1370 - str r1, [r0] -_08161772: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161724 - - thumb_func_start sub_8161784 -sub_8161784: @ 8161784 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081617AA - movs r0, 0x5 - bl display_pokemon_menu_message - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 - str r0, [r1] -_081617AA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161784 - - thumb_func_start sub_81617B8 -sub_81617B8: @ 81617B8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_085E9712 - movs r1, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8161784 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81617B8 - - thumb_func_start sub_81617F4 -sub_81617F4: @ 81617F4 - push {r4,lr} - ldr r0, =gUnknown_0203BC40 - mov r12, r0 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r2, =0x00002734 - adds r0, r1, r2 - mov r4, r12 - str r0, [r4] - movs r3, 0xA - strb r3, [r4, 0x4] - adds r2, 0xA - adds r0, r1, r2 - str r0, [r4, 0x8] - strb r3, [r4, 0xC] - ldr r4, =0x00002748 - adds r0, r1, r4 - mov r2, r12 - str r0, [r2, 0x10] - strb r3, [r2, 0x14] - adds r4, 0xA - adds r0, r1, r4 - str r0, [r2, 0x18] - movs r2, 0x1E - mov r0, r12 - strb r2, [r0, 0x1C] - adds r4, 0x1E - adds r0, r1, r4 - mov r4, r12 - str r0, [r4, 0x20] - mov r0, r12 - adds r0, 0x24 - strb r2, [r0] - ldr r2, =0x0000278e - adds r0, r1, r2 - str r0, [r4, 0x28] - mov r0, r12 - adds r0, 0x2C - strb r3, [r0] - ldr r4, =0x00002798 - adds r0, r1, r4 - mov r2, r12 - str r0, [r2, 0x30] - adds r2, 0x34 - movs r0, 0x28 - strb r0, [r2] - adds r4, 0x28 - adds r1, r4 - mov r0, r12 - str r1, [r0, 0x38] - adds r0, 0x3C - strb r3, [r0] - bl sub_8126968 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81617F4 - - thumb_func_start sub_8161880 -sub_8161880: @ 8161880 - push {r4,r5,lr} - lsls r0, 24 - movs r3, 0 - ldr r1, =gUnknown_0203BC40 - lsrs r2, r0, 21 - adds r0, r2, r1 - ldrb r0, [r0, 0x4] - cmp r3, r0 - bcs _081618AA - adds r5, r1, 0 - movs r4, 0 -_08161896: - adds r0, r2, r5 - ldr r1, [r0] - adds r1, r3 - strb r4, [r1] - adds r1, r3, 0x1 - lsls r1, 24 - lsrs r3, r1, 24 - ldrb r0, [r0, 0x4] - cmp r3, r0 - bcc _08161896 -_081618AA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161880 - - thumb_func_start ClearDecorationInventories -ClearDecorationInventories: @ 81618B4 - push {r4,lr} - movs r4, 0 -_081618B8: - adds r0, r4, 0 - bl sub_8161880 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081618B8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end ClearDecorationInventories - - thumb_func_start sub_81618D0 -sub_81618D0: @ 81618D0 - push {r4,lr} - lsls r0, 24 - movs r2, 0 - ldr r1, =gUnknown_0203BC40 - lsrs r0, 21 - adds r0, r1 - movs r1, 0x4 - ldrsb r1, [r0, r1] - cmp r2, r1 - bge _0816190C - adds r4, r0, 0 - adds r3, r1, 0 -_081618E8: - lsls r0, r2, 24 - asrs r1, r0, 24 - ldr r0, [r4] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08161900 - adds r0, r1, 0 - b _08161910 - .pool -_08161900: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, r3 - blt _081618E8 -_0816190C: - movs r0, 0x1 - negs r0, r0 -_08161910: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81618D0 - - thumb_func_start sub_8161918 -sub_8161918: @ 8161918 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =gUnknown_085A5C08 - lsls r0, r3, 5 - adds r0, r1 - ldrb r0, [r0, 0x13] - movs r2, 0 - ldr r1, =gUnknown_0203BC40 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x4] - cmp r2, r1 - bcs _08161956 - ldr r4, [r0] -_08161936: - adds r0, r4, r2 - ldrb r0, [r0] - cmp r0, r3 - bne _0816194C - movs r0, 0x1 - b _08161958 - .pool -_0816194C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r1 - bcc _08161936 -_08161956: - movs r0, 0 -_08161958: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8161918 - - thumb_func_start IsThereStorageSpaceForDecoration -IsThereStorageSpaceForDecoration: @ 8161960 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - cmp r4, 0 - beq _081619A0 - ldr r1, =gUnknown_085A5C08 - lsls r0, r4, 5 - adds r0, r1 - ldrb r5, [r0, 0x13] - adds r0, r5, 0 - bl sub_81618D0 - lsls r0, 24 - asrs r2, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - beq _081619A0 - ldr r0, =gUnknown_0203BC40 - lsls r1, r5, 3 - adds r1, r0 - ldr r0, [r1] - adds r0, r2 - strb r4, [r0] - movs r0, 0x1 - b _081619A2 - .pool -_081619A0: - movs r0, 0 -_081619A2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end IsThereStorageSpaceForDecoration - - thumb_func_start sub_81619A8 -sub_81619A8: @ 81619A8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081619D4 - ldr r1, =gUnknown_085A5C08 - lsls r0, 5 - adds r0, r1 - ldrb r0, [r0, 0x13] - bl sub_81618D0 - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _081619D4 - movs r0, 0x1 - b _081619D6 - .pool -_081619D4: - movs r0, 0 -_081619D6: - pop {r1} - bx r1 - thumb_func_end sub_81619A8 - - thumb_func_start sub_81619DC -sub_81619DC: @ 81619DC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - cmp r5, 0 - bne _081619F8 - b _08161A26 -_081619EA: - movs r0, 0 - strb r0, [r1] - adds r0, r6, 0 - bl sub_8161A38 - movs r0, 0x1 - b _08161A28 -_081619F8: - ldr r2, =gUnknown_0203BC40 - ldr r1, =gUnknown_085A5C08 - lsls r0, r5, 5 - adds r0, r1 - ldrb r4, [r0, 0x13] - lsls r0, r4, 3 - adds r0, r2 - ldrb r1, [r0, 0x4] - cmp r3, r1 - bcs _08161A26 - adds r6, r4, 0 - adds r4, r0, 0 - adds r2, r1, 0 -_08161A12: - ldr r0, [r4] - adds r1, r0, r3 - ldrb r0, [r1] - cmp r0, r5 - beq _081619EA - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r2 - bcc _08161A12 -_08161A26: - movs r0, 0 -_08161A28: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81619DC - - thumb_func_start sub_8161A38 -sub_8161A38: @ 8161A38 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - movs r6, 0 - ldr r2, =gUnknown_0203BC40 - lsrs r0, 21 - adds r1, r0, r2 - ldrb r3, [r1, 0x4] - cmp r6, r3 - bcs _08161ABC - adds r7, r0, 0 - mov r10, r1 - mov r0, r10 - str r0, [sp] -_08161A5C: - adds r1, r6, 0x1 - lsls r0, r1, 24 - lsrs r3, r0, 24 - adds r2, r7, 0 - mov r12, r1 - mov r1, r10 - ldrb r1, [r1, 0x4] - cmp r3, r1 - bcs _08161AAE - ldr r0, =gUnknown_0203BC40 - mov r9, r0 - adds r1, r0, 0 - mov r8, r1 -_08161A76: - mov r0, r9 - adds r5, r2, r0 - ldr r1, [r5] - adds r0, r1, r3 - ldrb r4, [r0] - adds r2, r4, 0 - cmp r2, 0 - beq _08161A9C - adds r0, r1, r6 - ldrb r1, [r0] - cmp r1, 0 - beq _08161A92 - cmp r1, r2 - bls _08161A9C -_08161A92: - ldrb r1, [r0] - strb r4, [r0] - ldr r0, [r5] - adds r0, r3 - strb r1, [r0] -_08161A9C: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r2, r7, 0 - mov r1, r8 - adds r0, r2, r1 - ldrb r0, [r0, 0x4] - cmp r3, r0 - bcc _08161A76 -_08161AAE: - mov r3, r12 - lsls r0, r3, 24 - lsrs r6, r0, 24 - ldr r0, [sp] - ldrb r0, [r0, 0x4] - cmp r6, r0 - bcc _08161A5C -_08161ABC: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161A38 - - thumb_func_start sub_8161AD0 -sub_8161AD0: @ 8161AD0 - push {r4,r5,lr} - lsls r0, 24 - movs r4, 0 - movs r3, 0 - ldr r2, =gUnknown_0203BC40 - lsrs r1, r0, 21 - adds r0, r1, r2 - ldrb r0, [r0, 0x4] - cmp r4, r0 - bcs _08161B04 - adds r5, r2, 0 -_08161AE6: - adds r2, r1, r5 - ldr r0, [r2] - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0 - beq _08161AF8 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_08161AF8: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r2, [r2, 0x4] - cmp r3, r2 - bcc _08161AE6 -_08161B04: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8161AD0 - - thumb_func_start sub_8161B10 -sub_8161B10: @ 8161B10 - push {r4,r5,lr} - movs r5, 0 - movs r4, 0 -_08161B16: - adds r0, r4, 0 - bl sub_8161AD0 - adds r0, r5, r0 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _08161B16 - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8161B10 - - thumb_func_start ClearRoamerData -ClearRoamerData: @ 8161B34 - push {r4,r5,lr} - ldr r5, =gSaveBlock1Ptr - ldr r0, [r5] - ldr r4, =0x000031dc - adds r0, r4 - movs r1, 0 - movs r2, 0x1C - bl memset - ldr r0, [r5] - adds r0, r4 - ldr r1, =0x00000197 - strh r1, [r0, 0x8] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ClearRoamerData - - thumb_func_start ClearRoamerLocationData -ClearRoamerLocationData: @ 8161B60 - push {r4-r6,lr} - movs r2, 0 - ldr r6, =gUnknown_0203BC86 - ldr r4, =gUnknown_0203BC80 - movs r3, 0 - adds r5, r4, 0x1 -_08161B6C: - lsls r1, r2, 1 - adds r0, r1, r4 - strb r3, [r0] - adds r1, r5 - strb r3, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _08161B6C - movs r0, 0 - strb r0, [r6] - strb r0, [r6, 0x1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ClearRoamerLocationData - - thumb_func_start sub_8161B94 -sub_8161B94: @ 8161B94 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - lsls r0, 16 - cmp r0, 0 - bne _08161BBC - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r2, =0x000031dc - adds r1, r2 - ldr r2, =0x00000197 - b _08161BC8 - .pool -_08161BBC: - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r2, =0x000031dc - adds r1, r2 - movs r2, 0xCC - lsls r2, 1 -_08161BC8: - strh r2, [r1, 0x8] - adds r7, r0, 0 - ldr r6, =gEnemyParty - ldr r0, [r7] - ldr r5, =0x000031dc - adds r0, r5 - ldrh r1, [r0, 0x8] - movs r4, 0 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - str r4, [sp, 0xC] - adds r0, r6, 0 - movs r2, 0x28 - movs r3, 0x20 - bl create_pokemon_set_level - ldr r0, [r7] - adds r0, r5 - movs r1, 0x28 - strb r1, [r0, 0xC] - ldr r0, [r7] - adds r0, r5 - strb r4, [r0, 0xD] - ldr r0, [r7] - adds r0, r5 - movs r1, 0x1 - strb r1, [r0, 0x13] - adds r0, r6, 0 - movs r1, 0x42 - bl GetMonData - ldr r1, [r7] - adds r1, r5 - str r0, [r1] - adds r0, r6, 0 - movs r1, 0 - bl GetMonData - ldr r1, [r7] - adds r1, r5 - str r0, [r1, 0x4] - adds r0, r6, 0 - movs r1, 0x3A - bl GetMonData - ldr r1, [r7] - adds r1, r5 - movs r2, 0 - mov r8, r2 - strh r0, [r1, 0xA] - adds r0, r6, 0 - movs r1, 0x16 - bl GetMonData - ldr r1, [r7] - adds r1, r5 - strb r0, [r1, 0xE] - adds r0, r6, 0 - movs r1, 0x17 - bl GetMonData - ldr r1, [r7] - adds r1, r5 - strb r0, [r1, 0xF] - adds r0, r6, 0 - movs r1, 0x18 - bl GetMonData - ldr r1, [r7] - adds r1, r5 - strb r0, [r1, 0x10] - adds r0, r6, 0 - movs r1, 0x21 - bl GetMonData - ldr r1, [r7] - adds r1, r5 - strb r0, [r1, 0x11] - adds r0, r6, 0 - movs r1, 0x2F - bl GetMonData - ldr r1, [r7] - adds r1, r5 - strb r0, [r1, 0x12] - ldr r4, =gUnknown_0203BC86 - mov r0, r8 - strb r0, [r4] - bl Random - ldr r5, =gUnknown_085CEC30 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 1 - adds r1, r5 - ldrb r0, [r1] - strb r0, [r4, 0x1] - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161B94 - - thumb_func_start sub_8161CBC -sub_8161CBC: @ 8161CBC - push {lr} - bl ClearRoamerData - bl ClearRoamerLocationData - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - bl sub_8161B94 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161CBC - - thumb_func_start mapnumbers_history_shift_sav1_0_2_4_out -mapnumbers_history_shift_sav1_0_2_4_out: @ 8161CD8 - ldr r0, =gUnknown_0203BC80 - ldrb r1, [r0, 0x2] - strb r1, [r0, 0x4] - ldrb r1, [r0, 0x3] - strb r1, [r0, 0x5] - ldrb r1, [r0] - strb r1, [r0, 0x2] - ldrb r1, [r0, 0x1] - strb r1, [r0, 0x3] - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldrb r1, [r2, 0x4] - strb r1, [r0] - ldrb r1, [r2, 0x5] - strb r1, [r0, 0x1] - bx lr - .pool - thumb_func_end mapnumbers_history_shift_sav1_0_2_4_out - - thumb_func_start sub_8161D00 -sub_8161D00: @ 8161D00 - push {r4,r5,lr} - movs r1, 0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x000031dc - adds r0, r2 - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _08161D3E - ldr r0, =gUnknown_0203BC86 - strb r1, [r0] - ldr r5, =gUnknown_085CEC30 - adds r4, r0, 0 -_08161D1A: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 1 - adds r1, r5 - ldrb r1, [r1] - ldrb r0, [r4, 0x1] - cmp r0, r1 - beq _08161D1A - strb r1, [r4, 0x1] -_08161D3E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161D00 - - thumb_func_start sub_8161D54 -sub_8161D54: @ 8161D54 - push {r4-r7,lr} - movs r4, 0 - bl Random - lsls r0, 16 - movs r1, 0xF0 - lsls r1, 12 - ands r1, r0 - cmp r1, 0 - bne _08161D6E - bl sub_8161D00 - b _08161DE2 -_08161D6E: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x000031dc - adds r0, r1 - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _08161DE2 - ldr r7, =gUnknown_0203BC86 - ldr r3, =gUnknown_085CEC30 -_08161D80: - lsls r0, r4, 1 - adds r0, r4 - lsls r2, r0, 1 - adds r1, r2, r3 - ldrb r0, [r7, 0x1] - ldrb r1, [r1] - cmp r0, r1 - bne _08161DD8 - ldr r6, =gUnknown_085CEC30 - adds r5, r2, 0x1 - ldr r4, =gUnknown_0203BC80 -_08161D96: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, r5 - adds r0, r6 - ldrb r1, [r0] - ldrb r0, [r4, 0x4] - cmp r0, 0 - bne _08161DBA - ldrb r0, [r4, 0x5] - cmp r0, r1 - beq _08161D96 -_08161DBA: - cmp r1, 0xFF - beq _08161D96 - strb r1, [r7, 0x1] - b _08161DE2 - .pool -_08161DD8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x13 - bls _08161D80 -_08161DE2: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8161D54 - - thumb_func_start sub_8161DE8 -sub_8161DE8: @ 8161DE8 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x000031dc - adds r0, r3 - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _08161E20 - ldr r0, =gUnknown_0203BC86 - ldrb r3, [r0] - cmp r2, r3 - bne _08161E20 - ldrb r0, [r0, 0x1] - cmp r1, r0 - bne _08161E20 - movs r0, 0x1 - b _08161E22 - .pool -_08161E20: - movs r0, 0 -_08161E22: - pop {r1} - bx r1 - thumb_func_end sub_8161DE8 - - thumb_func_start sub_8161E28 -sub_8161E28: @ 8161E28 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =gEnemyParty - bl ZeroEnemyPartyMons - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - ldr r1, =0x000031dc - adds r0, r1 - ldrh r1, [r0, 0x8] - ldrb r2, [r0, 0xC] - ldr r3, [r0] - ldr r0, [r0, 0x4] - str r0, [sp] - adds r0, r5, 0 - bl sub_8068060 - ldr r2, [r4] - ldr r0, =0x000031e9 - adds r2, r0 - adds r0, r5, 0 - movs r1, 0x37 - bl SetMonData - ldr r2, [r4] - ldr r1, =0x000031e6 - adds r2, r1 - adds r0, r5, 0 - movs r1, 0x39 - bl SetMonData - ldr r2, [r4] - ldr r0, =0x000031ea - adds r2, r0 - adds r0, r5, 0 - movs r1, 0x16 - bl SetMonData - ldr r2, [r4] - ldr r1, =0x000031eb - adds r2, r1 - adds r0, r5, 0 - movs r1, 0x17 - bl SetMonData - ldr r2, [r4] - ldr r0, =0x000031ec - adds r2, r0 - adds r0, r5, 0 - movs r1, 0x18 - bl SetMonData - ldr r2, [r4] - ldr r1, =0x000031ed - adds r2, r1 - adds r0, r5, 0 - movs r1, 0x21 - bl SetMonData - ldr r2, [r4] - ldr r0, =0x000031ee - adds r2, r0 - adds r0, r5, 0 - movs r1, 0x2F - bl SetMonData - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161E28 - - thumb_func_start sub_8161EDC -sub_8161EDC: @ 8161EDC - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldrb r0, [r1, 0x4] - ldrb r1, [r1, 0x5] - bl sub_8161DE8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08161F10 - bl Random - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - cmp r1, 0 - bne _08161F10 - bl sub_8161E28 - movs r0, 0x1 - b _08161F12 - .pool -_08161F10: - movs r0, 0 -_08161F12: - pop {r1} - bx r1 - thumb_func_end sub_8161EDC - - thumb_func_start sub_8161F18 -sub_8161F18: @ 8161F18 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x39 - bl GetMonData - ldr r5, =gSaveBlock1Ptr - ldr r1, [r5] - ldr r4, =0x000031dc - adds r1, r4 - strh r0, [r1, 0xA] - adds r0, r6, 0 - movs r1, 0x37 - bl GetMonData - ldr r1, [r5] - adds r1, r4 - strb r0, [r1, 0xD] - bl sub_8161D00 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161F18 - - thumb_func_start sub_8161F4C -sub_8161F4C: @ 8161F4C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x000031dc - adds r0, r1 - movs r1, 0 - strb r1, [r0, 0x13] - bx lr - .pool - thumb_func_end sub_8161F4C - - thumb_func_start sub_8161F64 -sub_8161F64: @ 8161F64 - ldr r3, =gUnknown_0203BC86 - ldrb r2, [r3] - strb r2, [r0] - ldrb r0, [r3, 0x1] - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8161F64 - - thumb_func_start sub_8161F74 -sub_8161F74: @ 8161F74 - push {lr} - ldr r1, =gUnknown_085DF96C - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161F74 - - thumb_func_start sub_8161F94 -sub_8161F94: @ 8161F94 - push {r4-r7,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, [r4] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r7, 0 - movs r1, 0x1 - strb r1, [r0] - ldr r1, [r4] - adds r2, 0xA - adds r0, r1, r2 - strh r7, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - bl sub_81A3ACC - ldr r4, [r4] - ldr r0, =0x00000cdc - adds r3, r4, r0 - ldr r2, =gUnknown_085DF9AC - lsls r1, r5, 2 - lsls r0, r6, 3 - adds r1, r0 - adds r1, r2 - ldr r0, [r3] - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _0816200E - lsls r0, r5, 1 - lsls r1, r6, 2 - adds r0, r1 - movs r2, 0xCE - lsls r2, 4 - adds r1, r4, r2 - adds r1, r0 - strh r7, [r1] -_0816200E: - bl sub_8164ED8 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - ldr r0, =gUnknown_02038BCA - strh r7, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161F94 - - thumb_func_start sub_8162054 -sub_8162054: @ 8162054 - push {r4-r6,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r4, =0x00000ca9 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r6, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _08162094 - cmp r0, 0x1 - ble _081620E8 - cmp r0, 0x2 - beq _081620A8 - cmp r0, 0x3 - beq _081620D8 - b _081620E8 - .pool -_08162094: - adds r0, r6, 0 - lsls r1, 24 - lsrs r1, 24 - bl sub_8164FCC - ldr r1, =gScriptResult - strh r0, [r1] - b _081620E8 - .pool -_081620A8: - ldr r4, =gScriptResult - ldr r2, [r5] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_085DF9AC - lsls r0, r6, 2 - lsls r1, 3 - adds r0, r1 - adds r0, r3 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - strh r0, [r4] - b _081620E8 - .pool -_081620D8: - ldr r1, [r5] - adds r0, r1, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - ldr r2, =0x00000d07 - adds r1, r2 - strb r0, [r1] -_081620E8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8162054 - - thumb_func_start sub_81620F4 -sub_81620F4: @ 81620F4 - push {r4-r7,lr} - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - ldr r7, =0x00000ca9 - adds r0, r7 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _08162134 - cmp r0, 0x1 - ble _081621B4 - cmp r0, 0x2 - beq _08162150 - cmp r0, 0x3 - beq _081621A4 - b _081621B4 - .pool -_08162134: - ldr r2, [r6] - lsls r0, r5, 1 - lsls r1, r4, 2 - adds r0, r1 - movs r1, 0xCE - lsls r1, 4 - adds r2, r1 - adds r2, r0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - strh r0, [r2] - b _081621B4 - .pool -_08162150: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _08162180 - ldr r2, [r6] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_085DF9AC - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - orrs r0, r1 - str r0, [r2] - b _081621B4 - .pool -_08162180: - ldr r2, [r6] - ldr r1, =0x00000cdc - adds r2, r1 - ldr r3, =gUnknown_085DF9CC - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - ands r0, r1 - str r0, [r2] - b _081621B4 - .pool -_081621A4: - ldr r1, [r6] - adds r0, r1, r7 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - ldr r2, =0x00000d07 - adds r1, r2 - strb r0, [r1] -_081621B4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81620F4 - - thumb_func_start sub_81621C0 -sub_81621C0: @ 81621C0 - push {r4,r5,lr} - ldr r0, =gUnknown_02038BCA - ldrh r1, [r0] - movs r0, 0xFA - lsls r0, 1 - cmp r1, r0 - bne _081621DA - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000bec - adds r0, r1 - bl sub_816534C -_081621DA: - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000d04 - adds r2, r0, r1 - ldrh r1, [r2] - ldr r0, =0x0000270e - cmp r1, r0 - bhi _081621EE - adds r0, r1, 0x1 - strh r0, [r2] -_081621EE: - ldr r1, [r5] - ldr r4, =0x00000cb2 - adds r1, r4 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - bl sub_8163E90 - ldr r1, =gScriptResult - ldr r0, [r5] - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81621C0 - - thumb_func_start sub_816222C -sub_816222C: @ 816222C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x3C - movs r0, 0 - str r0, [sp, 0x24] - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - mov r10, r0 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x2C] - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _08162266 - b _0816239C -_08162266: - mov r0, r10 - ldr r1, [sp, 0x2C] - bl sub_8164FCC - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x28] - movs r7, 0 - mov r2, sp - str r2, [sp, 0x34] -_0816227A: - movs r3, 0xEC - adds r0, r7, 0 - muls r0, r3 - movs r4, 0xE7 - lsls r4, 3 - adds r0, r4 - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - movs r2, 0 - mov r8, r2 - mov r9, r2 - movs r5, 0 - adds r3, r7, 0x1 - str r3, [sp, 0x30] - adds r1, r0 -_08162298: - ldm r1!, {r0} - mov r4, r8 - orrs r4, r0 - mov r8, r4 - add r9, r0 - adds r5, 0x1 - cmp r5, 0x39 - bls _08162298 - movs r6, 0 - movs r5, 0 - movs r0, 0xEC - adds r2, r7, 0 - muls r2, r0 -_081622B2: - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - movs r0, 0x2C - muls r0, r5 - adds r0, r2 - adds r1, r0 - ldr r4, =0x0000076c - adds r0, r1, r4 - ldrh r0, [r0] - cmp r0, 0 - beq _081622E4 - movs r0, 0xEF - lsls r0, 3 - adds r4, r1, r0 - mov r0, r10 - str r2, [sp, 0x38] - bl sub_8165C90 - ldrb r1, [r4] - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x38] - cmp r1, r0 - bhi _081622E4 - adds r6, 0x1 -_081622E4: - adds r5, 0x1 - cmp r5, 0x3 - ble _081622B2 - ldr r0, =gUnknown_085DF9F6 - ldr r1, [sp, 0x2C] - adds r0, r1, r0 - ldrb r0, [r0] - cmp r6, r0 - blt _0816233E - ldr r3, =gSaveBlock2Ptr - ldr r2, [r3] - movs r4, 0xEC - adds r3, r7, 0 - muls r3, r4 - adds r1, r2, r3 - ldr r5, =0x0000073a - adds r0, r1, r5 - ldrh r0, [r0] - ldr r4, [sp, 0x28] - cmp r0, r4 - bne _0816233E - subs r5, 0x2 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, r10 - bne _0816233E - mov r0, r8 - cmp r0, 0 - beq _0816233E - movs r1, 0x82 - lsls r1, 4 - adds r0, r2, r1 - adds r0, r3 - ldr r0, [r0] - cmp r0, r9 - bne _0816233E - movs r2, 0x96 - lsls r2, 1 - adds r0, r7, r2 - ldr r3, [sp, 0x34] - stm r3!, {r0} - str r3, [sp, 0x34] - ldr r4, [sp, 0x24] - adds r4, 0x1 - str r4, [sp, 0x24] -_0816233E: - ldr r7, [sp, 0x30] - cmp r7, 0x4 - ble _0816227A - ldr r5, [sp, 0x2C] - cmp r5, 0 - bne _08162396 - bl sub_8165B20 - movs r7, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r4, =gUnknown_085DF9EC - adds r2, r0, 0 - adds r2, 0xDC - ldr r1, [sp, 0x24] - lsls r0, r1, 2 - mov r5, sp - adds r3, r0, r5 -_08162362: - ldrb r0, [r2] - lsls r1, r0, 25 - lsrs r0, r1, 30 - cmp r0, 0 - beq _0816238E - ldrb r0, [r2, 0x1] - adds r0, r4 - ldrb r0, [r0] - ldr r5, [sp, 0x28] - cmp r0, r5 - bne _0816238E - lsrs r0, r1, 30 - subs r0, 0x1 - cmp r0, r10 - bne _0816238E - movs r1, 0xC8 - lsls r1, 1 - adds r0, r7, r1 - stm r3!, {r0} - ldr r5, [sp, 0x24] - adds r5, 0x1 - str r5, [sp, 0x24] -_0816238E: - adds r2, 0x44 - adds r7, 0x1 - cmp r7, 0x3 - ble _08162362 -_08162396: - ldr r0, [sp, 0x24] - cmp r0, 0 - bne _081623C0 -_0816239C: - movs r0, 0 - b _081623DA - .pool -_081623C0: - ldr r4, =gUnknown_02038BCA - bl Random - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp, 0x24] - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - strh r0, [r4] - movs r0, 0x1 -_081623DA: - add sp, 0x3C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_816222C - - thumb_func_start sub_81623F0 -sub_81623F0: @ 81623F0 - push {r4-r7,lr} - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x2 - bne _08162414 - bl sub_8165E18 - b _08162530 - .pool -_08162414: - ldr r0, =0x000040ce - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81A39C4 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - bl sub_8165C40 - subs r4, 0x2 - cmp r4, 0x1 - bhi _08162488 - ldr r1, [r6] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r3, [r0] - ldr r2, =gUnknown_02038BCA - lsls r0, r3, 2 - ldr r4, =0x00000cb4 - adds r1, r4 - adds r0, r1, r0 - ldrh r0, [r0] - strh r0, [r2] - ldr r4, =gUnknown_02038BCC - lsls r0, r3, 1 - adds r0, 0x1 - lsls r0, 1 - adds r1, r0 - ldrh r0, [r1] - strh r0, [r4] - ldrh r0, [r2] - movs r1, 0 - bl sub_8162614 - ldrh r0, [r4] - movs r1, 0x1 - bl sub_8162614 - b _08162530 - .pool -_08162488: - bl sub_816222C - lsls r0, 24 - cmp r0, 0 - beq _081624B4 - ldr r4, =gUnknown_02038BCA - ldrh r0, [r4] - movs r1, 0 - bl sub_8162614 - ldr r1, [r6] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r0, [r0] - lsls r0, 1 - adds r2, 0x2 - b _08162528 - .pool -_081624B4: - lsls r7, r5, 24 - adds r5, r6, 0 - ldr r6, =0x00000cb2 -_081624BA: - ldr r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsrs r0, r7, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - movs r4, 0 - ldr r1, [r5] - adds r0, r1, r6 - ldrh r0, [r0] - cmp r4, r0 - bge _081624FC - ldr r2, =0x00000cb4 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, r3 - beq _081624FC - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - subs r2, 0x2 - adds r0, r1, r2 - ldrh r2, [r0] - ldr r0, =0x00000cb4 - adds r1, r0 -_081624EE: - adds r1, 0x2 - adds r4, 0x1 - cmp r4, r2 - bge _081624FC - ldrh r0, [r1] - cmp r0, r3 - bne _081624EE -_081624FC: - ldr r0, [r5] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - bne _081624BA - ldr r4, =gUnknown_02038BCA - strh r3, [r4] - ldrh r0, [r4] - movs r1, 0 - bl sub_8162614 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r2, [r0] - adds r0, r2, 0x1 - cmp r0, 0x6 - bgt _08162530 - lsls r0, r2, 1 - ldr r2, =0x00000cb4 -_08162528: - adds r1, r2 - adds r1, r0 - ldrh r0, [r4] - strh r0, [r1] -_08162530: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81623F0 - - thumb_func_start sub_8162548 -sub_8162548: @ 8162548 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r3, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r0, 0x7 - bhi _08162584 - cmp r1, 0x6 - bne _08162570 - ldr r2, =gUnknown_085DFA1A - lsls r1, r0, 2 - adds r0, r2, 0x2 - adds r0, r1, r0 - adds r1, r2 - ldrh r0, [r0] - ldrh r4, [r1] - b _0816258A - .pool -_08162570: - ldr r2, =gUnknown_085DF9FA - lsls r1, r3, 2 - adds r0, r2, 0x2 - adds r0, r1, r0 - adds r1, r2 - ldrh r0, [r0] - ldrh r4, [r1] - b _0816258A - .pool -_08162584: - ldr r1, =gUnknown_085DF9FA - ldrh r0, [r1, 0x1E] - ldrh r4, [r1, 0x1C] -_0816258A: - subs r0, r4 - adds r0, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __umodsi3 - adds r4, r0 - lsls r4, 16 - lsrs r5, r4, 16 - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8162548 - - thumb_func_start sub_81625B4 -sub_81625B4: @ 81625B4 - push {r4,lr} - adds r4, r2, 0 - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r0, 0x7 - bhi _081625F4 - cmp r1, 0x6 - bne _081625D4 - ldr r1, =gUnknown_085DFA1A - lsls r2, r0, 2 - b _081625D8 - .pool -_081625D4: - ldr r1, =gUnknown_085DF9FA - lsls r2, 2 -_081625D8: - adds r0, r1, 0x2 - adds r0, r2, r0 - adds r2, r1 - ldrh r0, [r0] - ldrh r1, [r2] - subs r0, r1 - adds r0, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - ldrh r0, [r2] - b _08162604 - .pool -_081625F4: - ldr r0, =gUnknown_085DF9FA - ldrh r1, [r0, 0x1E] - ldrh r2, [r0, 0x1C] - subs r1, r2 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - ldrh r0, [r0, 0x1C] -_08162604: - strh r0, [r4] - strb r1, [r3] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81625B4 - - thumb_func_start sub_8162614 -sub_8162614: @ 8162614 - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r6, r4, 0 - lsls r1, 24 - lsrs r5, r1, 24 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r4, r0 - bne _08162640 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000bed - adds r0, r1 - b _081626BA - .pool -_08162640: - ldr r0, =0x000003fe - cmp r4, r0 - bne _08162650 - bl sub_81A4DD8 - b _08162788 - .pool -_08162650: - ldr r0, =0x0000012b - cmp r4, r0 - bhi _0816266C - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - b _081626BA - .pool -_0816266C: - ldr r0, =0x0000018f - cmp r4, r0 - bhi _08162698 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r4, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r1, =0x00000739 - adds r0, r1 - b _081626BA - .pool -_08162698: - ldr r3, =gUnknown_08610970 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r6, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x32 -_081626BA: - ldrb r2, [r0] - movs r1, 0 - ldr r3, =gUnknown_085DCEDC - ldrb r0, [r3] - cmp r0, r2 - beq _081626D4 -_081626C6: - adds r1, 0x1 - cmp r1, 0x1D - bhi _081626D4 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081626C6 -_081626D4: - cmp r1, 0x1E - beq _08162700 - ldr r0, =gUnknown_085DCF0E - adds r0, r1, r0 - ldrb r1, [r0] - cmp r5, 0x1 - beq _08162744 - cmp r5, 0x1 - ble _0816272E - cmp r5, 0xF - bne _0816272E - b _08162750 - .pool -_08162700: - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _08162718 -_0816270A: - adds r1, 0x1 - cmp r1, 0x13 - bhi _08162718 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _0816270A -_08162718: - cmp r1, 0x14 - beq _0816275C - ldr r0, =gUnknown_085DCF2C - adds r0, r1, r0 - ldrb r1, [r0] - cmp r5, 0x1 - beq _08162744 - cmp r5, 0x1 - ble _0816272E - cmp r5, 0xF - beq _08162750 -_0816272E: - ldr r0, =0x00004010 - bl VarSet - b _08162788 - .pool -_08162744: - ldr r0, =0x00004011 - bl VarSet - b _08162788 - .pool -_08162750: - ldr r0, =0x0000401e - bl VarSet - b _08162788 - .pool -_0816275C: - cmp r5, 0x1 - beq _08162770 - cmp r5, 0x1 - ble _08162768 - cmp r5, 0xF - beq _08162780 -_08162768: - ldr r0, =0x00004010 - b _08162772 - .pool -_08162770: - ldr r0, =0x00004011 -_08162772: - movs r1, 0x7 - bl VarSet - b _08162788 - .pool -_08162780: - ldr r0, =0x0000401e - movs r1, 0x7 - bl VarSet -_08162788: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8162614 - - thumb_func_start sub_8162794 -sub_8162794: @ 8162794 - push {lr} - movs r0, 0xFA - lsls r0, 1 - movs r1, 0 - bl sub_8162614 - pop {r0} - bx r0 - thumb_func_end sub_8162794 - - thumb_func_start sub_81627A4 -sub_81627A4: @ 81627A4 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r4, r0 - bne _081627CC - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000bed - adds r0, r1 - b _08162836 - .pool -_081627CC: - ldr r0, =0x0000012b - cmp r4, r0 - bhi _081627E8 - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - b _08162836 - .pool -_081627E8: - ldr r0, =0x0000018f - cmp r4, r0 - bhi _08162814 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r4, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r1, =0x00000739 - adds r0, r1 - b _08162836 - .pool -_08162814: - ldr r3, =gUnknown_08610970 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r5, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x32 -_08162836: - ldrb r2, [r0] - movs r1, 0 - ldr r3, =gUnknown_085DCEDC - ldrb r0, [r3] - cmp r0, r2 - beq _08162850 -_08162842: - adds r1, 0x1 - cmp r1, 0x1D - bhi _08162850 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _08162842 -_08162850: - cmp r1, 0x1E - beq _0816286C - ldr r0, =gUnknown_085DCF0E - b _08162892 - .pool -_0816286C: - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _08162884 -_08162876: - adds r1, 0x1 - cmp r1, 0x13 - bhi _08162884 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _08162876 -_08162884: - cmp r1, 0x14 - bne _08162890 - movs r0, 0x7 - b _08162896 - .pool -_08162890: - ldr r0, =gUnknown_085DCF2C -_08162892: - adds r0, r1, r0 - ldrb r0, [r0] -_08162896: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81627A4 - - thumb_func_start sub_81628A0 -sub_81628A0: @ 81628A0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - movs r1, 0 - mov r8, r1 - mov r10, r0 - movs r5, 0 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - mov r4, r10 - ldrb r4, [r4, 0xC] - str r4, [sp, 0x18] - mov r9, r5 - movs r7, 0x4 - str r7, [sp, 0x1C] - ldr r1, =0x00000744 - adds r1, r0 - mov r12, r1 -_081628CA: - movs r6, 0 - movs r3, 0 - mov r2, r12 - ldrb r0, [r2] - ldr r4, [sp, 0x18] - cmp r0, r4 - bne _081628FA - mov r4, r9 - mov r2, r10 - adds r2, 0xC -_081628DE: - adds r3, 0x1 - cmp r3, 0x3 - bgt _081628FA - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - adds r1, r3, r4 - ldr r7, =0x00000744 - adds r0, r7 - adds r0, r1 - adds r1, r2, r3 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _081628DE -_081628FA: - cmp r3, 0x4 - bne _08162944 - movs r6, 0 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r3, =0x0000073c - adds r0, r3 - ldr r2, [sp, 0x1C] - adds r0, r2 - ldrb r0, [r0] - mov r4, r10 - ldrb r4, [r4, 0x8] - cmp r0, r4 - bne _08162944 - adds r1, r0, 0 - mov r2, r9 - adds r2, 0x4 -_0816291C: - cmp r1, 0xFF - bne _08162930 - movs r6, 0x7 - b _08162944 - .pool -_08162930: - adds r6, 0x1 - cmp r6, 0x6 - bgt _08162944 - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - adds r0, r3 - adds r0, r2 - ldrb r0, [r0] - cmp r0, r1 - beq _0816291C -_08162944: - cmp r6, 0x7 - beq _0816295A - movs r0, 0xEC - add r9, r0 - ldr r1, [sp, 0x1C] - adds r1, 0xEC - str r1, [sp, 0x1C] - add r12, r0 - adds r5, 0x1 - cmp r5, 0x4 - ble _081628CA -_0816295A: - cmp r5, 0x4 - bgt _08162974 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - movs r1, 0xEC - muls r1, r5 - adds r0, r1 - movs r4, 0xE7 - lsls r4, 3 - adds r0, r4 - b _081629B2 - .pool -_08162974: - movs r5, 0 - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - ldr r1, =0x0000073a - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _0816299E - adds r3, r7, 0 - adds r2, r1, 0 - movs r1, 0 -_0816298A: - adds r1, 0xEC - adds r5, 0x1 - cmp r5, 0x4 - bgt _081629C4 - ldr r0, [r3] - adds r0, r1 - adds r0, r2 - ldrh r0, [r0] - cmp r0, 0 - bne _0816298A -_0816299E: - cmp r5, 0x4 - bgt _081629C4 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - movs r1, 0xEC - muls r1, r5 - adds r0, r1 - movs r2, 0xE7 - lsls r2, 3 - adds r0, r2 -_081629B2: - mov r1, r10 - movs r2, 0xEC - bl memcpy - b _08162A8A - .pool -_081629C4: - mov r2, sp - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r3, =0x0000073a - adds r0, r3 - ldrh r0, [r0] - movs r1, 0 - strh r0, [r2] - add r0, sp, 0xC - strh r1, [r0] - movs r7, 0x1 - add r8, r7 - movs r5, 0x1 - add r0, sp, 0xC - mov r9, r0 - mov r12, r3 -_081629E4: - movs r3, 0 - adds r7, r5, 0x1 - cmp r3, r8 - bge _08162A2E - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - movs r2, 0xEC - adds r1, r5, 0 - muls r1, r2 - adds r0, r1 - mov r1, r12 - adds r4, r0, r1 - mov r6, sp -_081629FE: - lsls r0, r3, 1 - add r0, sp - ldrh r2, [r4] - adds r1, r2, 0 - ldrh r0, [r0] - cmp r1, r0 - bcs _08162A24 - movs r3, 0 - movs r4, 0x1 - mov r8, r4 - strh r2, [r6] - mov r0, r9 - strh r5, [r0] - b _08162A2E - .pool -_08162A24: - cmp r1, r0 - bhi _08162A2E - adds r3, 0x1 - cmp r3, r8 - blt _081629FE -_08162A2E: - cmp r3, r8 - bne _08162A54 - mov r1, r8 - lsls r2, r1, 1 - mov r4, sp - adds r3, r4, r2 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - movs r4, 0xEC - adds r1, r5, 0 - muls r1, r4 - adds r0, r1 - add r0, r12 - ldrh r0, [r0] - strh r0, [r3] - add r2, r9 - strh r5, [r2] - movs r0, 0x1 - add r8, r0 -_08162A54: - adds r5, r7, 0 - cmp r5, 0x4 - ble _081629E4 - bl Random - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - bl __modsi3 - adds r5, r0, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r5, 1 - add r1, sp - adds r1, 0xC - ldrh r2, [r1] - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - movs r1, 0xE7 - lsls r1, 3 - adds r0, r1 - mov r1, r10 - movs r2, 0xEC - bl memcpy -_08162A8A: - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81628A0 - - thumb_func_start sub_8162AA0 -sub_8162AA0: @ 8162AA0 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r4, r0 - bne _08162AD0 - ldr r1, =gTrainerPicIndices - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000bed - adds r0, r2 - ldrb r0, [r0] - adds r0, r1 - b _08162BC8 - .pool -_08162AD0: - ldr r0, =0x000003fe - cmp r4, r0 - bne _08162AE4 - bl sub_81A4CB0 - lsls r0, 24 - lsrs r0, 24 - b _08162BCA - .pool -_08162AE4: - ldr r0, =0x0000012b - cmp r4, r0 - bhi _08162B08 - ldr r2, =gTrainerPicIndices - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - ldrb r0, [r0] - adds r0, r2 - b _08162BC8 - .pool -_08162B08: - ldr r0, =0x0000018f - cmp r4, r0 - bhi _08162B64 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162B38 - ldr r4, =gTrainerPicIndices - bl sub_818649C - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - b _08162BC8 - .pool -_08162B38: - ldr r3, =gTrainerPicIndices - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r4, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r2, =0x00000739 - adds r0, r2 - ldrb r0, [r0] - adds r0, r3 - b _08162BC8 - .pool -_08162B64: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _08162BB0 - ldr r4, =gTrainerPicIndices - ldr r3, =gUnknown_08610970 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r5, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x32 - ldrb r0, [r0] - adds r0, r4 - b _08162BC8 - .pool -_08162BB0: - ldr r5, =gTrainerPicIndices - ldr r4, =gUnknown_08610970 - bl sub_81864A8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x58 - muls r0, r1 - adds r0, r4 - adds r0, 0x32 - ldrb r0, [r0] - adds r0, r5 -_08162BC8: - ldrb r0, [r0] -_08162BCA: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8162AA0 - - thumb_func_start sub_8162BD8 -sub_8162BD8: @ 8162BD8 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r4, r0 - bne _08162C08 - ldr r1, =gTrainerClassNameIndices - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000bed - adds r0, r2 - ldrb r0, [r0] - b _08162C26 - .pool -_08162C08: - ldr r0, =0x000003fe - cmp r4, r0 - bne _08162C1C - bl sub_81A4D00 - lsls r0, 24 - lsrs r0, 24 - b _08162D1E - .pool -_08162C1C: - ldr r0, =0x00000c03 - cmp r4, r0 - bne _08162C38 - ldr r0, =gTrainers - ldr r1, =0x00007da1 -_08162C26: - adds r0, r1 - ldrb r0, [r0] - b _08162D1E - .pool -_08162C38: - ldr r0, =0x0000012b - cmp r4, r0 - bhi _08162C60 - ldr r2, =gTrainerClassNameIndices - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - ldrb r0, [r0] - adds r0, r2 - ldrb r0, [r0] - b _08162D1E - .pool -_08162C60: - ldr r0, =0x0000018f - cmp r4, r0 - bhi _08162CBC - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162C90 - ldr r4, =gTrainerClassNameIndices - bl sub_818649C - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - b _08162D1E - .pool -_08162C90: - ldr r3, =gTrainerClassNameIndices - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r4, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r2, =0x00000739 - adds r0, r2 - ldrb r0, [r0] - adds r0, r3 - ldrb r0, [r0] - b _08162D1E - .pool -_08162CBC: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162CF4 - ldr r5, =gTrainerClassNameIndices - ldr r4, =gUnknown_08610970 - bl sub_81864A8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x58 - muls r0, r1 - adds r0, r4 - adds r0, 0x32 - ldrb r0, [r0] - adds r0, r5 - ldrb r0, [r0] - b _08162D1E - .pool -_08162CF4: - ldr r4, =gTrainerClassNameIndices - ldr r3, =gUnknown_08610970 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r5, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x32 - ldrb r0, [r0] - adds r0, r4 - ldrb r0, [r0] -_08162D1E: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8162BD8 - - thumb_func_start sub_8162D34 -sub_8162D34: @ 8162D34 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r4, r0 - bne _08162D5C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000bed - adds r0, r1 - b _08162E0A - .pool -_08162D5C: - ldr r0, =0x0000012b - cmp r4, r0 - bhi _08162D78 - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - b _08162E0A - .pool -_08162D78: - ldr r0, =0x0000018f - cmp r4, r0 - bhi _08162DC0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162DA0 - bl sub_818649C - lsls r0, 24 - lsrs r0, 24 - b _08162E0C - .pool -_08162DA0: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r4, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r1, =0x00000739 - adds r0, r1 - b _08162E0A - .pool -_08162DC0: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162DE8 - ldr r4, =gUnknown_08610970 - bl sub_81864A8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x58 - muls r0, r1 - adds r0, r4 - b _08162E08 - .pool -_08162DE8: - ldr r3, =gUnknown_08610970 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r5, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r3 -_08162E08: - adds r0, 0x32 -_08162E0A: - ldrb r0, [r0] -_08162E0C: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8162D34 - - thumb_func_start sub_8162E20 -sub_8162E20: @ 8162E20 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r5, r0 - bne _08162E54 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xBF - lsls r1, 4 - adds r2, r0, r1 -_08162E40: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - ble _08162E40 - b _08162F5C - .pool -_08162E54: - ldr r0, =0x000003fe - cmp r5, r0 - bne _08162E68 - adds r0, r6, 0 - bl sub_81A4D50 - b _08162F62 - .pool -_08162E68: - ldr r0, =0x00000c03 - cmp r5, r0 - bne _08162E88 - ldr r2, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 @ Steven's name -_08162E70: - adds r0, r6, r4 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - ble _08162E70 - b _08162F5C - .pool -_08162E88: - ldr r0, =0x0000012b - cmp r5, r0 - bhi _08162EB4 - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r5 - adds r0, r1 - adds r2, r0, 0x4 -_08162E9A: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - ble _08162E9A - b _08162F5C - .pool -_08162EB4: - ldr r0, =0x0000018f - cmp r5, r0 - bhi _08162F00 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162ED8 - adds r0, r6, 0 - bl sub_8186468 - b _08162F62 - .pool -_08162ED8: - ldr r2, =gSaveBlock2Ptr - movs r0, 0xEC - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0xfffef2a8 - adds r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r1, r0, 0x4 - adds r0, 0xE4 - ldrb r2, [r0] - adds r0, r6, 0 - bl sub_81DB5E8 - b _08162F62 - .pool -_08162F00: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162F24 - bl sub_81864A8 - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81864C0 - lsls r0, 24 - lsrs r4, r0, 24 - b _08162F3E - .pool -_08162F24: - ldr r1, =gSaveBlock2Ptr - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r2, =0xffff969c - adds r0, r2 - ldr r1, [r1] - adds r1, r0 - ldrb r0, [r1] - lsls r0, 27 - lsrs r5, r0, 27 - adds r1, 0x3F - ldrb r4, [r1] -_08162F3E: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81A1650 - adds r1, r0, 0 - adds r0, r6, 0 - adds r2, r4, 0 - bl sub_81DB5E8 - b _08162F62 - .pool -_08162F5C: - adds r1, r6, r4 - movs r0, 0xFF - strb r0, [r1] -_08162F62: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8162E20 - - thumb_func_start sub_8162F68 -sub_8162F68: @ 8162F68 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r4, r0 - bne _08162F90 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000bed - adds r0, r1 - b _0816300E - .pool -_08162F90: - ldr r0, =0x000003fe - cmp r4, r0 - bne _08162FA4 - bl sub_81A4DB8 - lsls r0, 24 - lsrs r0, 24 - b _08163042 - .pool -_08162FA4: - ldr r0, =0x0000012b - cmp r4, r0 - bhi _08162FC0 - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - b _0816300E - .pool -_08162FC0: - ldr r0, =0x0000018f - cmp r4, r0 - bhi _08162FEC - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r4, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r1, =0x00000739 - adds r0, r1 - b _0816300E - .pool -_08162FEC: - ldr r3, =gUnknown_08610970 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r5, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x32 -_0816300E: - ldrb r2, [r0] - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _08163028 -_0816301A: - adds r1, 0x1 - cmp r1, 0x13 - bhi _08163028 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _0816301A -_08163028: - cmp r1, 0x14 - bne _08163040 - movs r0, 0 - b _08163042 - .pool -_08163040: - movs r0, 0x1 -_08163042: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8162F68 - - thumb_func_start sub_8163048 -sub_8163048: @ 8163048 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl ZeroEnemyPartyMons - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - movs r1, 0 - adds r2, r4, 0 - bl sub_81630C4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8163048 - - thumb_func_start sub_816306C -sub_816306C: @ 816306C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl ZeroEnemyPartyMons - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - movs r1, 0 - adds r2, r4, 0 - bl sub_81630C4 - ldr r0, =gUnknown_02038BCC - ldrh r0, [r0] - movs r1, 0x3 - adds r2, r4, 0 - bl sub_81630C4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816306C - - thumb_func_start sub_81630A0 -sub_81630A0: @ 81630A0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl ZeroEnemyPartyMons - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - movs r1, 0 - adds r2, r4, 0 - bl sub_8165EA4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81630A0 - - thumb_func_start sub_81630C4 -sub_81630C4: @ 81630C4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x18] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x1C] - add r4, sp, 0x14 - movs r0, 0xFF - strb r0, [r4] - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x20] - ldr r0, =0x0000012b - cmp r5, r0 - bhi _08163138 - adds r0, r5, 0 - bl sub_8165D08 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x24] - ldr r0, =gUnknown_02038BCA - ldrh r2, [r0] - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r2 - adds r0, r1 - ldr r0, [r0, 0x30] - str r0, [sp, 0x2C] - movs r0, 0 - str r0, [sp, 0x28] - ldr r2, [sp, 0x2C] - ldrh r1, [r2] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08163124 - b _08163278 -_08163124: - b _08163260 - .pool -_08163138: - movs r0, 0xFA - lsls r0, 1 - cmp r5, r0 - bne _08163180 - ldr r7, [sp, 0x18] - adds r0, r7, 0x3 - cmp r7, r0 - blt _0816314A - b _08163426 -_0816314A: - ldr r4, =gSaveBlock2Ptr -_0816314C: - movs r0, 0x64 - muls r0, r7 - ldr r1, =gEnemyParty - adds r0, r1 - ldr r5, [sp, 0x18] - subs r2, r7, r5 - movs r1, 0x2C - muls r2, r1 - movs r6, 0xC2 - lsls r6, 4 - adds r2, r6 - ldr r1, [r4] - adds r1, r2 - bl sub_806819C - adds r7, 0x1 - adds r0, r5, 0 - adds r0, 0x3 - cmp r7, r0 - blt _0816314C - b _08163426 - .pool -_08163180: - ldr r0, =0x000003fe - cmp r5, r0 - bne _08163190 - bl sub_81A4E04 - b _08163426 - .pool -_08163190: - ldr r0, =0x0000018f - cmp r5, r0 - bhi _08163218 - movs r6, 0 - ldr r7, [sp, 0x18] - ldr r1, [sp, 0x1C] - adds r0, r7, r1 - cmp r7, r0 - blt _081631A4 - b _08163426 -_081631A4: - ldr r2, =0xfffffed4 - adds r1, r5, r2 - movs r0, 0xEC - adds r2, r1, 0 - muls r2, r0 - mov r8, r2 - muls r0, r5 - ldr r5, =0xfffef2a8 - adds r4, r0, r5 -_081631B6: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - movs r0, 0x2C - adds r2, r6, 0 - muls r2, r0 - mov r1, r8 - adds r0, r2, r1 - adds r1, r3, r0 - ldr r5, =0x0000076c - adds r0, r1, r5 - ldrh r0, [r0] - cmp r0, 0 - beq _081631F0 - adds r5, 0xC - adds r0, r1, r5 - ldrb r0, [r0] - ldr r1, [sp, 0x20] - cmp r0, r1 - bhi _081631F0 - movs r0, 0x64 - muls r0, r7 - ldr r1, =gEnemyParty - adds r0, r1 - adds r1, r3, r4 - adds r2, 0x34 - adds r1, r2 - movs r2, 0 - bl sub_8068338 -_081631F0: - adds r6, 0x1 - adds r7, 0x1 - ldr r2, [sp, 0x18] - ldr r5, [sp, 0x1C] - adds r0, r2, r5 - cmp r7, r0 - blt _081631B6 - b _08163426 - .pool -_08163218: - ldr r7, [sp, 0x18] - adds r0, r7, 0x3 - cmp r7, r0 - blt _08163222 - b _08163426 -_08163222: - ldr r6, =gSaveBlock2Ptr - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r1, =0xffff969c - adds r5, r0, r1 - movs r4, 0 -_08163230: - movs r0, 0x64 - muls r0, r7 - ldr r1, =gEnemyParty - adds r0, r1 - ldr r1, [r6] - adds r1, r5 - lsrs r2, r4, 24 - bl sub_8068528 - movs r2, 0x80 - lsls r2, 17 - adds r4, r2 - adds r7, 0x1 - ldr r0, [sp, 0x18] - adds r0, 0x3 - cmp r7, r0 - blt _08163230 - b _08163426 - .pool -_08163260: - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] - lsls r0, 1 - ldr r5, [sp, 0x2C] - adds r0, r5 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08163260 -_08163278: - movs r7, 0 - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x30] - ldr r6, [sp, 0x1C] - cmp r7, r6 - bne _08163296 - b _08163426 -_08163296: - bl Random - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp, 0x28] - bl __modsi3 - lsls r0, 1 - ldr r1, [sp, 0x2C] - adds r0, r1 - ldrh r4, [r0] - ldr r2, [sp, 0x20] - cmp r2, 0x32 - beq _081632B6 - cmp r2, 0x14 - bne _081632BE -_081632B6: - ldr r0, =0x00000351 - cmp r4, r0 - bls _081632BE - b _0816341E -_081632BE: - movs r6, 0 - ldr r5, [sp, 0x18] - adds r5, r7 - mov r8, r5 - b _081632D2 - .pool -_081632D0: - adds r6, 0x1 -_081632D2: - cmp r6, r8 - bge _081632F6 - movs r1, 0x64 - adds r0, r6, 0 - muls r0, r1 - ldr r2, =gEnemyParty - adds r0, r2 - movs r1, 0xB - movs r2, 0 - bl GetMonData - ldr r1, =gUnknown_0203BC8C - ldr r2, [r1] - lsls r1, r4, 4 - adds r1, r2 - ldrh r1, [r1] - cmp r0, r1 - bne _081632D0 -_081632F6: - cmp r6, r8 - beq _081632FC - b _0816341E -_081632FC: - movs r6, 0 - cmp r6, r8 - bge _08163346 - ldr r5, =gBattleFrontierHeldItems - mov r9, r5 - movs r3, 0 -_08163308: - ldr r0, =gEnemyParty - adds r5, r3, r0 - adds r0, r5, 0 - movs r1, 0xC - movs r2, 0 - str r3, [sp, 0x38] - bl GetMonData - ldr r3, [sp, 0x38] - cmp r0, 0 - beq _0816333E - adds r0, r5, 0 - movs r1, 0xC - movs r2, 0 - bl GetMonData - ldr r1, =gUnknown_0203BC8C - ldr r2, [r1] - lsls r1, r4, 4 - adds r1, r2 - ldrb r1, [r1, 0xA] - lsls r1, 1 - add r1, r9 - ldr r3, [sp, 0x38] - ldrh r1, [r1] - cmp r0, r1 - beq _08163346 -_0816333E: - adds r3, 0x64 - adds r6, 0x1 - cmp r6, r8 - blt _08163308 -_08163346: - cmp r6, r8 - bne _0816341E - movs r6, 0 - cmp r6, r7 - bge _08163368 - add r0, sp, 0xC - ldrh r0, [r0] - cmp r0, r4 - beq _08163368 - add r1, sp, 0xC -_0816335A: - adds r1, 0x2 - adds r6, 0x1 - cmp r6, r7 - bge _08163368 - ldrh r0, [r1] - cmp r0, r4 - bne _0816335A -_08163368: - cmp r6, r7 - bne _0816341E - lsls r0, r7, 1 - add r0, sp - adds r0, 0xC - strh r4, [r0] - movs r1, 0x64 - mov r0, r8 - muls r0, r1 - ldr r2, =gEnemyParty - adds r0, r2 - ldr r5, =gUnknown_0203BC8C - ldr r2, [r5] - lsls r4, 4 - adds r2, r4, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - ldr r6, [sp, 0x24] - str r6, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - ldr r2, [sp, 0x30] - str r2, [sp, 0x8] - ldr r2, [sp, 0x20] - bl sub_8068634 - movs r0, 0xFF - mov r6, sp - strb r0, [r6, 0x14] - movs r6, 0 - adds r0, r7, 0x1 - str r0, [sp, 0x34] - mov r9, r4 - movs r0, 0x64 - mov r3, r8 - muls r3, r0 - mov r1, r9 - str r1, [sp, 0x3C] - ldr r2, =gEnemyParty - mov r10, r2 -_081633B8: - ldr r0, [r5] - ldr r7, [sp, 0x3C] - adds r0, r7, r0 - lsls r4, r6, 1 - adds r0, 0x2 - adds r0, r4 - ldrh r1, [r0] - lsls r2, r6, 24 - lsrs r2, 24 - mov r7, r10 - adds r0, r3, r7 - str r3, [sp, 0x38] - bl sub_80691F4 - ldr r0, [r5] - ldr r1, [sp, 0x3C] - adds r0, r1, r0 - adds r0, 0x2 - adds r0, r4 - ldrh r0, [r0] - ldr r3, [sp, 0x38] - cmp r0, 0xDA - bne _081633EC - movs r0, 0 - mov r2, sp - strb r0, [r2, 0x14] -_081633EC: - adds r6, 0x1 - cmp r6, 0x3 - ble _081633B8 - movs r5, 0x64 - mov r4, r8 - muls r4, r5 - ldr r6, =gEnemyParty - adds r4, r6 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0x14 - bl SetMonData - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - add r0, r9 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - ldr r7, [sp, 0x34] -_0816341E: - ldr r0, [sp, 0x1C] - cmp r7, r0 - beq _08163426 - b _08163296 -_08163426: - add sp, 0x40 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81630C4 - - thumb_func_start sub_8163444 -sub_8163444: @ 8163444 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x8] - movs r1, 0xFF - add r0, sp, 0x4 - strb r1, [r0] - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - movs r0, 0xDC - adds r0, r2 - mov r10, r0 - ldrb r0, [r0, 0x1] - movs r1, 0x9 - str r1, [sp, 0x10] - cmp r0, 0x4 - bhi _08163474 - movs r0, 0x6 - str r0, [sp, 0x10] -_08163474: - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - movs r1, 0x32 - str r1, [sp, 0xC] - cmp r0, 0 - beq _0816348A - movs r0, 0x64 - str r0, [sp, 0xC] -_0816348A: - movs r7, 0 - adds r2, 0xE2 - str r2, [sp, 0x14] - add r1, sp, 0x4 - mov r9, r1 -_08163494: - ldr r2, [sp, 0x8] - adds r6, r2, r7 - movs r0, 0x64 - muls r0, r6 - ldr r1, =gEnemyParty - adds r0, r1 - lsls r5, r7, 1 - adds r4, r5, r7 - lsls r4, 2 - mov r2, r10 - adds r1, r2, r4 - ldrh r1, [r1, 0x4] - movs r2, 0x8 - str r2, [sp] - ldr r2, [sp, 0xC] - ldr r3, [sp, 0x10] - bl pokemon_make_ev_something - movs r0, 0xFF - mov r1, r9 - strb r0, [r1] - adds r2, r7, 0x1 - mov r8, r2 - movs r1, 0x3 -_081634C4: - ldr r2, [sp, 0x14] - adds r0, r2, r4 - ldrh r0, [r0] - cmp r0, 0xDA - bne _081634D4 - movs r2, 0 - mov r0, r9 - strb r2, [r0] -_081634D4: - adds r4, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _081634C4 - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0x4 - bl SetMonData - adds r2, r5, r7 - lsls r2, 2 - add r2, r10 - adds r2, 0xE - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - mov r7, r8 - cmp r7, 0x3 - bne _08163494 - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8163444 - - thumb_func_start sub_8163524 -sub_8163524: @ 8163524 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_8165C40 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - ldr r5, [r0, 0x30] - movs r4, 0 - ldrh r1, [r5] - b _08163558 - .pool -_0816354C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 1 - adds r0, r5 - ldrh r1, [r0] -_08163558: - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0816354C -_0816355E: - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - cmp r6, 0x32 - beq _0816357A - cmp r6, 0x14 - bne _08163580 -_0816357A: - ldr r0, =0x00000351 - cmp r1, r0 - bhi _0816355E -_08163580: - adds r0, r1, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8163524 - - thumb_func_start sub_8163590 -sub_8163590: @ 8163590 - push {lr} - bl ZeroEnemyPartyMons - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _081635C0 - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - movs r1, 0 - bl sub_81635D4 - b _081635CA - .pool -_081635C0: - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - movs r1, 0 - bl sub_816379C -_081635CA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8163590 - - thumb_func_start sub_81635D4 -sub_81635D4: @ 81635D4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - lsls r0, 16 - lsrs r2, r0, 16 - adds r3, r2, 0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x10] - ldr r0, =0x0000012b - cmp r2, r0 - bhi _0816364A - ldr r4, =gSaveBlock2Ptr - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - ldr r4, [r4] - lsrs r0, 22 - movs r2, 0xCE - lsls r2, 4 - adds r1, r4, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r1, r0, 24 - ldr r3, =0x00000cb2 - adds r4, r3 - ldrh r0, [r4] - cmp r0, 0x5 - bhi _0816363C - adds r0, r1, 0 - movs r1, 0 - bl sub_81A6CA8 - lsls r0, 24 - lsrs r0, 24 - b _081636A6 - .pool -_0816363C: - adds r0, r1, 0 - movs r1, 0x1 - bl sub_81A6CA8 - lsls r0, 24 - lsrs r0, 24 - b _081636A6 -_0816364A: - movs r0, 0xFA - lsls r0, 1 - cmp r2, r0 - bne _08163694 - ldr r7, [sp, 0x10] - adds r0, r7, 0x3 - cmp r7, r0 - blt _0816365C - b _08163776 -_0816365C: - ldr r4, =gSaveBlock2Ptr -_0816365E: - movs r0, 0x64 - muls r0, r7 - ldr r1, =gEnemyParty - adds r0, r1 - ldr r1, [sp, 0x10] - subs r2, r7, r1 - movs r1, 0x2C - muls r2, r1 - movs r3, 0xC2 - lsls r3, 4 - adds r2, r3 - ldr r1, [r4] - adds r1, r2 - bl sub_806819C - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, [sp, 0x10] - adds r0, 0x3 - cmp r7, r0 - blt _0816365E - b _08163776 - .pool -_08163694: - ldr r0, =0x000003fe - cmp r3, r0 - bne _081636A4 - bl sub_81A6CD0 - b _08163776 - .pool -_081636A4: - movs r0, 0x1F -_081636A6: - str r0, [sp, 0x18] - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldrb r2, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r2, r0 - mov r8, r2 - movs r7, 0 -_081636CE: - ldr r1, =gUnknown_03006298 - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - mov r9, r0 - ldr r3, [sp, 0x10] - adds r5, r3, r7 - movs r0, 0x64 - adds r6, r5, 0 - muls r6, r0 - ldr r1, =gEnemyParty - adds r0, r6, r1 - ldr r3, =gUnknown_0203BC8C - ldr r2, [r3] - mov r1, r9 - lsls r4, r1, 4 - adds r2, r4, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - mov r10, r3 - ldr r3, [sp, 0x18] - str r3, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - mov r2, r8 - str r2, [sp, 0x8] - ldr r2, [sp, 0x14] - mov r3, r10 - bl sub_8068634 - movs r1, 0 - add r0, sp, 0xC - strb r1, [r0] - movs r3, 0 - adds r7, 0x1 - mov r10, r7 - adds r7, r4, 0 -_08163718: - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - mov r2, r9 - lsls r0, r2, 4 - adds r0, r1 - lsls r1, r3, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r1, [r0] - ldr r2, =gEnemyParty - adds r0, r6, r2 - adds r2, r3, 0 - str r3, [sp, 0x1C] - bl sub_81A7024 - ldr r3, [sp, 0x1C] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _08163718 - movs r3, 0x64 - adds r4, r5, 0 - muls r4, r3 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0xC - bl SetMonData - ldr r1, =gUnknown_0203BC8C - ldr r0, [r1] - adds r0, r7, r0 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - mov r2, r10 - lsls r0, r2, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _081636CE -_08163776: - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81635D4 - - thumb_func_start sub_816379C -sub_816379C: @ 816379C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x10] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldrb r0, [r1, 0xA] - mov r9, r0 - ldrb r0, [r1, 0xB] - lsls r0, 8 - mov r2, r9 - orrs r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r2, r0 - mov r9, r2 - movs r7, 0 - mov r8, r7 -_081637D0: - ldr r1, =gUnknown_03006298 - mov r2, r8 - lsls r0, r2, 1 - adds r0, r1 - ldrh r4, [r0] - ldr r5, [sp, 0x10] - add r5, r8 - movs r7, 0x64 - adds r6, r5, 0 - muls r6, r7 - ldr r1, =gEnemyParty - adds r0, r6, r1 - ldr r7, =gUnknown_0203BC8C - ldr r2, [r7] - lsls r4, 4 - adds r2, r4, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - movs r7, 0 - str r7, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - movs r2, 0x1E - bl sub_8068634 - movs r1, 0 - add r0, sp, 0xC - strb r1, [r0] - mov r10, r5 - mov r0, r8 - adds r0, 0x1 - str r0, [sp, 0x14] - mov r8, r4 - mov r5, r8 -_08163818: - ldr r1, =gUnknown_0203BC8C - ldr r0, [r1] - adds r0, r5, r0 - lsls r4, r7, 1 - adds r0, 0x2 - adds r0, r4 - ldrh r1, [r0] - ldr r2, =gEnemyParty - adds r0, r6, r2 - adds r2, r7, 0 - bl sub_81A7024 - ldr r1, =gUnknown_0203BC8C - ldr r0, [r1] - adds r0, r5, r0 - adds r0, 0x2 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0xDA - bne _08163846 - movs r1, 0 - add r0, sp, 0xC - strb r1, [r0] -_08163846: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _08163818 - movs r2, 0x64 - mov r4, r10 - muls r4, r2 - ldr r7, =gEnemyParty - adds r4, r7 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0xC - bl SetMonData - ldr r1, =gUnknown_0203BC8C - ldr r0, [r1] - add r0, r8 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - ldr r2, [sp, 0x14] - lsls r0, r2, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x2 - bls _081637D0 - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816379C - - thumb_func_start ConvertBattleFrontierTrainerSpeechToString -ConvertBattleFrontierTrainerSpeechToString: @ 81638AC - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gStringVar4 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - movs r3, 0x2 - bl ConvertEasyChatWordsToString - movs r2, 0x1 - negs r2, r2 - movs r0, 0x1 - adds r1, r4, 0 - bl GetStringWidth - cmp r0, 0xCC - bls _0816390A - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - movs r3, 0x3 - bl ConvertEasyChatWordsToString - ldrb r0, [r4] - movs r1, 0x1 - cmp r0, 0xFE - beq _081638EE - adds r2, r4, 0 -_081638E4: - adds r0, r1, r2 - ldrb r0, [r0] - adds r1, 0x1 - cmp r0, 0xFE - bne _081638E4 -_081638EE: - ldr r2, =gStringVar4 - adds r0, r1, r2 - ldrb r0, [r0] - adds r3, r2, 0 - cmp r0, 0xFE - beq _08163904 -_081638FA: - adds r1, 0x1 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFE - bne _081638FA -_08163904: - adds r1, r3 - movs r0, 0xFA - strb r0, [r1] -_0816390A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ConvertBattleFrontierTrainerSpeechToString - - thumb_func_start sub_8163914 -sub_8163914: @ 8163914 - push {lr} - bl sub_8165C40 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _08163930 - ldr r0, =gUnknown_02038BCC - b _08163932 - .pool -_08163930: - ldr r0, =gUnknown_02038BCA -_08163932: - ldrh r3, [r0] - movs r0, 0xFA - lsls r0, 1 - cmp r3, r0 - bne _08163950 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000bfc - b _08163986 - .pool -_08163950: - ldr r0, =0x0000012b - cmp r3, r0 - bhi _08163974 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - adds r1, r3, 0 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString - b _081639A8 - .pool -_08163974: - ldr r0, =0x0000018f - cmp r3, r0 - bhi _0816399C - ldr r1, =gSaveBlock2Ptr - movs r0, 0xEC - muls r0, r3 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xfffef2b8 -_08163986: - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - b _081639A8 - .pool -_0816399C: - adds r0, r3, 0 - adds r0, 0x70 - lsls r0, 24 - lsrs r0, 24 - bl sub_819F99C -_081639A8: - pop {r0} - bx r0 - thumb_func_end sub_8163914 - - thumb_func_start sub_81639AC -sub_81639AC: @ 81639AC - push {r4-r6,lr} - sub sp, 0x4 - bl sub_81864CC - ldr r0, =gBattleScripting - adds r0, 0x26 - ldrb r0, [r0] - cmp r0, 0xA - bhi _08163A78 - lsls r0, 2 - ldr r1, =_081639D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081639D0: - .4byte _081639FC - .4byte _08163A38 - .4byte _08163A74 - .4byte _081639FC - .4byte _081639FC - .4byte _081639FC - .4byte _081639FC - .4byte _081639FC - .4byte _08163A78 - .4byte _081639FC - .4byte _081639FC -_081639FC: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ebc - adds r1, r0, r2 - ldr r2, [r1] - ldr r0, =0x00fffffe - cmp r2, r0 - bhi _08163A2C - adds r0, r2, 0x1 - str r0, [r1] - movs r1, 0x14 - bl __umodsi3 - cmp r0, 0 - bne _08163A78 - bl sub_81DA57C - b _08163A78 - .pool -_08163A2C: - ldr r0, =0x00ffffff - str r0, [r1] - b _08163A78 - .pool -_08163A38: - movs r5, 0 - ldr r6, =gSaveBlock1Ptr -_08163A3C: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - movs r0, 0x8E - lsls r0, 2 - adds r1, r4, r0 - ldr r0, [r6] - adds r0, r1 - movs r1, 0xC - bl GetMonData - mov r1, sp - strh r0, [r1] - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xC - mov r2, sp - bl SetMonData - adds r5, 0x1 - cmp r5, 0x5 - ble _08163A3C - b _08163A78 - .pool -_08163A74: - bl sub_816537C -_08163A78: - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81639AC - - thumb_func_start sub_8163A8C -sub_8163A8C: @ 8163A8C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8145F20 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08163AB0 - ldr r0, =gMain - ldr r1, =sub_81639AC - str r1, [r0, 0x8] - ldr r0, =sub_8036760 - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_08163AB0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8163A8C - - thumb_func_start sub_8163AC4 -sub_8163AC4: @ 8163AC4 - push {r4-r6,lr} - sub sp, 0x4 - ldr r0, =gBattleScripting - ldr r2, =gSpecialVar_0x8004 - ldrh r1, [r2] - adds r0, 0x26 - strb r1, [r0] - ldrh r0, [r2] - cmp r0, 0xA - bls _08163ADA - b _08163E68 -_08163ADA: - lsls r0, 2 - ldr r1, =_08163AF0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08163AF0: - .4byte _08163B1C - .4byte _08163BC0 - .4byte _08163C10 - .4byte _08163C70 - .4byte _08163CC4 - .4byte _08163D28 - .4byte _08163D74 - .4byte _08163DB4 - .4byte _08163E2C - .4byte _08163DF4 - .4byte _08163DC8 -_08163B1C: - ldr r5, =gBattleTypeFlags - movs r0, 0x84 - lsls r0, 1 - str r0, [r5] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1 - beq _08163B56 - cmp r4, 0x1 - bgt _08163B44 - cmp r4, 0 - beq _08163B4E - b _08163BA6 - .pool -_08163B44: - cmp r4, 0x2 - beq _08163B64 - cmp r4, 0x3 - beq _08163B98 - b _08163BA6 -_08163B4E: - movs r0, 0x3 - bl sub_8163048 - b _08163BA6 -_08163B56: - movs r0, 0x4 - bl sub_8163048 - ldr r0, [r5] - orrs r0, r4 - str r0, [r5] - b _08163BA6 -_08163B64: - movs r0, 0x2 - bl sub_816306C - ldr r1, =gUnknown_02038BCE - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000cd6 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - ldrh r0, [r1] - bl sub_8165404 - ldr r0, [r5] - ldr r1, =0x00408041 - orrs r0, r1 - str r0, [r5] - b _08163BA6 - .pool -_08163B98: - ldr r0, [r5] - ldr r1, =0x00800043 - orrs r0, r1 - str r0, [r5] - movs r0, 0x2 - bl sub_816306C -_08163BA6: - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl PlayNewMapMusic__default_for_battle - movs r0, 0 - b _08163E10 - .pool -_08163BC0: - movs r5, 0 - ldr r6, =gSaveBlock1Ptr -_08163BC4: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r0, r4, r0 - movs r1, 0xC - bl GetMonData - mov r1, sp - strh r0, [r1] - movs r0, 0x8E - lsls r0, 2 - adds r4, r0 - ldr r0, [r6] - adds r0, r4 - movs r1, 0xC - mov r2, sp - bl SetMonData - adds r5, 0x1 - cmp r5, 0x5 - ble _08163BC4 - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl PlayNewMapMusic__default_for_battle - movs r0, 0xC - b _08163E10 - .pool -_08163C10: - bl ZeroEnemyPartyMons - movs r5, 0 - ldr r4, =gSaveBlock2Ptr -_08163C18: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x2C - adds r2, r5, 0 - muls r2, r1 - movs r1, 0xC2 - lsls r1, 4 - adds r2, r1 - ldr r1, [r4] - adds r1, r2 - bl sub_806819C - adds r5, 0x1 - cmp r5, 0x2 - ble _08163C18 - ldr r1, =gBattleTypeFlags - ldr r0, =0x00000808 - str r0, [r1] - ldr r1, =gUnknown_02038BCA - movs r0, 0 - strh r0, [r1] - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl PlayNewMapMusic__default_for_battle - movs r0, 0xD - b _08163E10 - .pool -_08163C70: - ldr r4, =gBattleTypeFlags - ldr r0, =0x00010008 - str r0, [r4] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1 - bne _08163C8A - ldr r0, [r4] - orrs r0, r1 - str r0, [r4] -_08163C8A: - ldr r0, =gUnknown_02038BCA - ldrh r1, [r0] - ldr r0, =0x000003fe - cmp r1, r0 - bne _08163C9A - movs r0, 0x2 - bl sub_8163048 -_08163C9A: - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl sub_806E694 - movs r0, 0x3 - b _08163E10 - .pool -_08163CC4: - ldr r4, =gBattleTypeFlags - ldr r0, =0x00020008 - str r0, [r4] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1 - bne _08163CDE - ldr r0, [r4] - orrs r0, r1 - str r0, [r4] -_08163CDE: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _08163D0C - movs r0, 0x3 - bl sub_8163048 - b _08163D12 - .pool -_08163D0C: - movs r0, 0x3 - bl sub_81630A0 -_08163D12: - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl PlayNewMapMusic__default_for_battle - movs r0, 0x4 - b _08163E10 - .pool -_08163D28: - ldr r1, =gBattleTypeFlags - ldr r0, =0x00040008 - str r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _08163D58 - movs r0, 0x3 - bl sub_8163048 - b _08163D5E - .pool -_08163D58: - movs r0, 0x3 - bl sub_81630A0 -_08163D5E: - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl PlayNewMapMusic__default_for_battle - movs r0, 0x5 - b _08163E10 - .pool -_08163D74: - ldr r4, =gBattleTypeFlags - ldr r0, =0x00080008 - str r0, [r4] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1 - bne _08163D8E - ldr r0, [r4] - orrs r0, r1 - str r0, [r4] -_08163D8E: - bl sub_8163590 - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl PlayNewMapMusic__default_for_battle - movs r0, 0x6 - b _08163E10 - .pool -_08163DB4: - ldr r1, =gBattleTypeFlags - movs r0, 0x84 - lsls r0, 1 - str r0, [r1] - movs r0, 0x3 - bl sub_8163048 - b _08163E00 - .pool -_08163DC8: - ldr r1, =gBattleTypeFlags - ldr r0, =0x00200008 - str r0, [r1] - movs r0, 0x3 - bl sub_8163048 - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl PlayNewMapMusic__default_for_battle - movs r0, 0xA - b _08163E10 - .pool -_08163DF4: - ldr r1, =gBattleTypeFlags - ldr r0, =0x00008109 - str r0, [r1] - movs r0, 0x1 - bl sub_816306C -_08163E00: - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl PlayNewMapMusic__default_for_battle - movs r0, 0x7 -_08163E10: - bl sub_80B100C - lsls r0, 24 - lsrs r0, 24 - bl sub_8145EF4 - b _08163E68 - .pool -_08163E2C: - ldr r1, =gBattleTypeFlags - ldr r0, =0x00408049 - str r0, [r1] - ldr r5, =0x00000c03 - adds r0, r5, 0 - bl sub_8165404 - ldr r4, =gUnknown_02038BFC - movs r0, 0 - strb r0, [r4] - ldr r0, =gUnknown_08224158 - bl TrainerBattleConfigure - movs r0, 0x1 - strb r0, [r4] - ldr r0, =gUnknown_08224167 - bl TrainerBattleConfigure - ldr r0, =gUnknown_02038BCE - strh r5, [r0] - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl PlayNewMapMusic__default_for_battle - movs r0, 0x12 - bl sub_8145EF4 -_08163E68: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8163AC4 - - thumb_func_start sub_8163E90 -sub_8163E90: @ 8163E90 - push {r4-r6,lr} - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r5, [r0] - lsls r5, 30 - lsrs r5, 30 - ldr r0, =0x000040ce - bl VarGet - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8164FCC - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, [r6] - lsls r5, 1 - lsls r4, 2 - adds r5, r4 - movs r1, 0xCE - lsls r1, 4 - adds r0, r1 - adds r1, r0, r5 - ldrh r0, [r1] - cmp r0, r2 - bcs _08163ED0 - strh r2, [r1] -_08163ED0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8163E90 - - thumb_func_start sub_8163EE4 -sub_8163EE4: @ 8163EE4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x0000064c - adds r5, r0, r1 - adds r0, r5, 0 - bl sub_8164FB8 - ldr r0, [r4] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r6, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, [r4] - ldrb r0, [r2, 0x8] - cmp r0, 0 - beq _08163F40 - ldr r4, =gUnknown_085DCEFA - ldrb r0, [r2, 0xA] - ldrb r1, [r2, 0xB] - adds r0, r1 - ldrb r1, [r2, 0xC] - adds r0, r1 - ldrb r1, [r2, 0xD] - adds r0, r1 - movs r1, 0x14 - b _08163F52 - .pool -_08163F40: - ldr r4, =gUnknown_085DCEDC - ldrb r0, [r2, 0xA] - ldrb r1, [r2, 0xB] - adds r0, r1 - ldrb r1, [r2, 0xC] - adds r0, r1 - ldrb r1, [r2, 0xD] - adds r0, r1 - movs r1, 0x1E -_08163F52: - bl __umodsi3 - adds r0, r4 - ldrb r0, [r0] - strb r6, [r5] - strb r0, [r5, 0x1] - adds r0, r5, 0 - adds r0, 0xC - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - adds r1, 0xA - bl CopyUnalignedWord - adds r0, r5, 0x4 - ldr r1, [r4] - bl StringCopy7 - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_8164FCC - strh r0, [r5, 0x2] - movs r4, 0 - movs r2, 0x10 - adds r2, r5 - mov r12, r2 - movs r7, 0x1C - adds r7, r5 - mov r9, r7 - adds r6, r5, 0 - adds r6, 0x28 - movs r0, 0xE4 - adds r0, r5 - mov r8, r0 -_08163F96: - lsls r2, r4, 1 - mov r1, r12 - adds r3, r1, r2 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r7, =0x00002bbc - adds r0, r1, r7 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r3] - mov r0, r9 - adds r3, r0, r2 - adds r7, 0xC - adds r0, r1, r7 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r3] - adds r3, r6, r2 - ldr r0, =0x00002bd4 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - strh r0, [r3] - adds r4, 0x1 - cmp r4, 0x5 - ble _08163F96 - movs r4, 0 -_08163FCC: - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - lsls r1, r4, 1 - ldr r2, =0x00000caa - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _08163FF4 - adds r1, r0, 0 - movs r0, 0x64 - muls r0, r1 - ldr r1, =gUnknown_02024488 - adds r0, r1 - movs r1, 0x2C - muls r1, r4 - adds r1, 0x34 - adds r1, r5, r1 - bl sub_80686FC -_08163FF4: - adds r4, 0x1 - cmp r4, 0x3 - ble _08163FCC - ldr r0, =gGameLanguage - ldrb r0, [r0] - mov r7, r8 - strb r0, [r7] - ldr r0, [r6] - ldr r1, =0x0000064c - adds r0, r1 - bl sub_8164F70 - bl sub_8163E90 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8163EE4 - - thumb_func_start sub_8164040 -sub_8164040: @ 8164040 - push {r4,r5,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r4, [r0] - lsls r4, 30 - lsrs r4, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r5, [r5] - lsls r4, 1 - lsrs r0, 14 - adds r4, r0 - movs r2, 0xCE - lsls r2, 4 - adds r0, r5, r2 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - bne _0816408E - cmp r1, 0x1 - bgt _0816408A - ldr r1, =0x00000cb2 - adds r0, r5, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _0816408E -_0816408A: - bl sub_8163EE4 -_0816408E: - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164040 - - thumb_func_start nullsub_61 -nullsub_61: @ 81640D8 - bx lr - thumb_func_end nullsub_61 - - thumb_func_start nullsub_116 -nullsub_116: @ 81640DC - bx lr - thumb_func_end nullsub_116 - - thumb_func_start sub_81640E0 -sub_81640E0: @ 81640E0 - push {r4-r7,lr} - sub sp, 0xC - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r7, r0, 16 - adds r4, 0x64 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - movs r6, 0 - movs r2, 0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r5, r0 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r1, 0xE0 - adds r0, r1 - mov r3, sp -_08164122: - ldrh r1, [r0] - cmp r1, r7 - beq _08164130 - cmp r1, r4 - beq _08164130 - stm r3!, {r2} - adds r6, 0x1 -_08164130: - adds r0, 0xC - adds r2, 0x1 - cmp r2, 0x2 - ble _08164122 - bl Random - ldr r4, =gUnknown_03006298 - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - strh r0, [r4] -_08164150: - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - strh r0, [r4, 0x2] - ldrh r1, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - beq _08164150 - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81640E0 - - thumb_func_start sub_8164188 -sub_8164188: @ 8164188 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - str r0, [sp, 0xC] - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x10] - adds r4, 0x64 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x14] - movs r3, 0 - mov r8, r3 - movs r7, 0 - adds r2, r6, 0 - ldr r0, =0xfffffed4 - adds r5, r0 - ldr r6, =0x0000076c - mov r10, sp - movs r0, 0xEC - adds r1, r5, 0 - muls r1, r0 - mov r9, r1 -_081641E6: - ldr r1, [r2] - movs r0, 0x2C - muls r0, r7 - mov r3, r9 - adds r5, r0, r3 - adds r1, r5 - adds r0, r1, r6 - ldrh r0, [r0] - ldr r3, [sp, 0x10] - cmp r0, r3 - beq _0816423A - ldr r3, [sp, 0x14] - cmp r0, r3 - beq _0816423A - movs r0, 0xEF - lsls r0, 3 - adds r4, r1, r0 - ldr r1, [sp, 0xC] - lsls r0, r1, 24 - lsrs r0, 24 - str r2, [sp, 0x18] - bl sub_8165C90 - ldrb r1, [r4] - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x18] - cmp r1, r0 - bhi _0816423A - ldr r0, [r2] - adds r0, r5 - adds r0, r6 - ldrh r0, [r0] - cmp r0, 0 - beq _0816423A - mov r3, r10 - adds r3, 0x4 - mov r10, r3 - subs r3, 0x4 - stm r3!, {r7} - movs r0, 0x1 - add r8, r0 -_0816423A: - adds r7, 0x1 - cmp r7, 0x3 - ble _081641E6 - bl Random - ldr r4, =gUnknown_03006298 - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - strh r0, [r4, 0x4] -_08164258: - bl Random - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - strh r0, [r4, 0x6] - ldrh r1, [r4, 0x4] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - beq _08164258 - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164188 - - thumb_func_start sub_81642A0 -sub_81642A0: @ 81642A0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r1, r0, r1 - str r1, [sp, 0x24] - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - str r0, [sp, 0x14] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r1, [r5] - ldr r3, [sp, 0x14] - lsls r2, r3, 1 - lsrs r0, 14 - adds r2, r0 - movs r4, 0xCE - lsls r4, 4 - adds r1, r4 - adds r1, r2 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - str r0, [sp, 0x1C] - adds r4, 0x64 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - str r0, [sp, 0x20] - bl sub_8165C40 - movs r7, 0 - ldr r0, [sp, 0x18] - lsls r0, 24 - mov r10, r0 -_08164318: - lsls r6, r7, 1 -_0816431A: - mov r1, r10 - lsrs r0, r1, 24 - movs r1, 0 - bl sub_8162548 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - movs r2, 0 - mov r9, r2 - cmp r9, r7 - bge _08164368 - ldr r0, [r5] - ldr r3, =0x00000cb4 - adds r1, r0, r3 - ldrh r0, [r1] - cmp r0, r8 - beq _08164368 - ldr r0, =gUnknown_0203BC88 - ldr r2, [r0] - movs r4, 0x34 - mov r0, r8 - muls r0, r4 - adds r0, r2 - ldrb r3, [r0] -_0816434C: - ldrh r0, [r1] - muls r0, r4 - adds r0, r2 - ldrb r0, [r0] - cmp r0, r3 - beq _08164368 - adds r1, 0x2 - movs r0, 0x1 - add r9, r0 - cmp r9, r7 - bge _08164368 - ldrh r0, [r1] - cmp r0, r8 - bne _0816434C -_08164368: - cmp r9, r7 - bne _0816431A - ldr r0, [r5] - ldr r1, =0x00000cb4 - adds r0, r1 - adds r0, r6 - mov r2, r8 - strh r2, [r0] - mov r7, r9 - adds r7, 0x1 - cmp r7, 0x5 - ble _08164318 - movs r3, 0x8 - mov r10, r3 - movs r4, 0 - mov r9, r4 - ldr r0, [sp, 0x24] - str r0, [sp, 0x40] -_0816438C: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - mov r2, r9 - lsls r1, r2, 1 - ldr r3, =0x00000cb4 - adds r0, r3 - adds r0, r1 - ldrh r0, [r0] - mov r8, r0 - bl sub_81627A4 - ldr r4, [sp, 0x40] - strb r0, [r4, 0x19] - movs r7, 0 -_081643A8: - adds r0, r7, 0x1 - str r0, [sp, 0x30] - mov r1, r10 - lsls r1, 1 - str r1, [sp, 0x38] - mov r2, r10 - adds r2, 0x1 - str r2, [sp, 0x34] - mov r0, r10 - subs r0, 0x1 - lsls r0, 1 - str r0, [sp, 0x28] -_081643C0: - mov r0, r8 - bl sub_8163524 - lsls r0, 16 - lsrs r6, r0, 16 - movs r0, 0x1 - ands r0, r7 - cmp r0, 0 - beq _081643F4 - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r4, =0x00000cb4 - adds r0, r4 - ldr r1, [sp, 0x28] - adds r0, r1 - ldrh r2, [r0] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r2, 4 - adds r2, r0 - lsls r1, r6, 4 - adds r1, r0 - ldrb r0, [r2, 0xA] - ldrb r1, [r1, 0xA] - cmp r0, r1 - beq _081643C0 -_081643F4: - movs r5, 0x8 - cmp r5, r10 - bge _08164430 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r1, =gUnknown_0203BC8C - ldr r3, [r1] - lsls r1, r6, 4 - adds r1, r3 - ldr r4, =0x00000cc4 - adds r2, r0, r4 - ldrh r0, [r1] - mov r12, r0 -_0816440E: - ldrh r0, [r2] - lsls r0, 4 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r12 - beq _08164430 - ldrh r0, [r1] - ldr r4, [sp, 0x1C] - cmp r4, r0 - beq _08164430 - ldr r4, [sp, 0x20] - cmp r4, r0 - beq _08164430 - adds r2, 0x2 - adds r5, 0x1 - cmp r5, r10 - blt _0816440E -_08164430: - cmp r5, r10 - bne _081643C0 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000cb4 - adds r0, r2 - ldr r3, [sp, 0x38] - adds r0, r3 - strh r6, [r0] - ldr r4, [sp, 0x34] - mov r10, r4 - ldr r7, [sp, 0x30] - cmp r7, 0x1 - ble _081643A8 - ldr r0, [sp, 0x40] - adds r0, 0x18 - str r0, [sp, 0x40] - movs r1, 0x1 - add r9, r1 - mov r2, r9 - cmp r2, 0x5 - ble _0816438C - movs r3, 0 - mov r10, r3 - bl sub_8165B20 - movs r4, 0 - mov r9, r4 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r2, 0 - adds r6, r0, 0 - adds r6, 0xDC - mov r8, sp -_08164474: - ldrb r0, [r6] - lsls r4, r0, 25 - lsrs r0, r4, 30 - cmp r0, 0 - beq _081644E0 - ldr r1, =gUnknown_085DF9EC - ldrb r0, [r6, 0x1] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x7 - str r2, [sp, 0x44] - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x44] - ldr r1, [sp, 0x18] - cmp r0, r1 - bgt _081644E0 - lsrs r0, r4, 30 - subs r0, 0x1 - ldr r3, [sp, 0x14] - cmp r0, r3 - bne _081644E0 - movs r5, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xE0 - adds r1, r2, r0 - movs r7, 0x2 -_081644B0: - ldrh r0, [r1] - ldr r4, [sp, 0x1C] - cmp r4, r0 - beq _081644C0 - ldr r3, [sp, 0x20] - cmp r3, r0 - beq _081644C0 - adds r5, 0x1 -_081644C0: - adds r1, 0xC - subs r7, 0x1 - cmp r7, 0 - bge _081644B0 - cmp r5, 0x2 - ble _081644E0 - movs r0, 0xC8 - lsls r0, 1 - add r0, r9 - mov r4, r8 - adds r4, 0x4 - mov r8, r4 - subs r4, 0x4 - stm r4!, {r0} - movs r0, 0x1 - add r10, r0 -_081644E0: - adds r2, 0x44 - adds r6, 0x44 - movs r1, 0x1 - add r9, r1 - mov r3, r9 - cmp r3, 0x3 - ble _08164474 - mov r4, r10 - cmp r4, 0 - beq _08164532 - bl Random - ldr r6, =gSaveBlock2Ptr - ldr r4, [r6] - lsls r0, 16 - lsrs r0, 16 - mov r1, r10 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - movs r5, 0xCC - lsls r5, 4 - adds r4, r5 - strh r0, [r4] - ldrh r0, [r4] - bl sub_81627A4 - ldr r1, [sp, 0x24] - adds r1, 0xA8 - strb r0, [r1, 0x1] - movs r0, 0xD8 - lsls r0, 2 - bl FlagReset - ldr r0, [r6] - adds r0, r5 - ldrh r0, [r0] - bl sub_81640E0 -_08164532: - movs r0, 0 - mov r10, r0 - mov r9, r0 - mov r1, sp - str r1, [sp, 0x3C] -_0816453C: - ldr r0, =gSaveBlock2Ptr - movs r2, 0xEC - mov r1, r9 - muls r1, r2 - movs r3, 0xE7 - lsls r3, 3 - adds r1, r3 - ldr r0, [r0] - movs r2, 0 - movs r3, 0 - movs r7, 0 - mov r4, r9 - adds r4, 0x1 - str r4, [sp, 0x2C] - adds r1, r0, r1 -_0816455A: - ldm r1!, {r0} - orrs r2, r0 - adds r3, r0 - adds r7, 0x1 - cmp r7, 0x39 - bls _0816455A - ldr r0, =gSaveBlock2Ptr - ldr r5, [r0] - movs r1, 0xEC - mov r6, r9 - muls r6, r1 - adds r4, r5, r6 - ldr r1, =0x0000073a - adds r0, r4, r1 - ldrh r0, [r0] - movs r1, 0x7 - str r2, [sp, 0x44] - str r3, [sp, 0x48] - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - ldr r2, [sp, 0x44] - ldr r3, [sp, 0x48] - ldr r1, [sp, 0x18] - cmp r0, r1 - bgt _08164656 - movs r1, 0xE7 - lsls r1, 3 - adds r0, r4, r1 - ldrb r0, [r0] - ldr r4, [sp, 0x14] - cmp r0, r4 - bne _08164656 - cmp r2, 0 - beq _08164656 - adds r1, 0xE8 - adds r0, r5, r1 - adds r0, r6 - ldr r0, [r0] - cmp r0, r3 - bne _08164656 - movs r5, 0 - movs r7, 0 - ldr r2, =gSaveBlock2Ptr - mov r8, r2 - ldr r3, =0x0000076c -_081645B8: - mov r4, r8 - ldr r2, [r4] - movs r0, 0x2C - adds r1, r7, 0 - muls r1, r0 - movs r4, 0xEC - mov r0, r9 - muls r0, r4 - adds r6, r1, r0 - adds r2, r6 - adds r0, r2, r3 - ldrh r0, [r0] - ldr r1, [sp, 0x1C] - cmp r1, r0 - beq _0816463C - ldr r4, [sp, 0x20] - cmp r4, r0 - beq _0816463C - movs r0, 0xEF - lsls r0, 3 - adds r4, r2, r0 - ldr r1, [sp, 0x14] - lsls r0, r1, 24 - lsrs r0, 24 - str r3, [sp, 0x48] - bl sub_8165C90 - ldrb r1, [r4] - lsls r0, 24 - lsrs r0, 24 - ldr r3, [sp, 0x48] - cmp r1, r0 - bhi _0816463C - mov r2, r8 - ldr r0, [r2] - adds r0, r6 - adds r0, r3 - ldrh r0, [r0] - cmp r0, 0 - b _08164638 - .pool -_08164638: - beq _0816463C - adds r5, 0x1 -_0816463C: - adds r7, 0x1 - cmp r7, 0x3 - ble _081645B8 - cmp r5, 0x1 - ble _08164656 - movs r0, 0x96 - lsls r0, 1 - add r0, r9 - ldr r3, [sp, 0x3C] - stm r3!, {r0} - str r3, [sp, 0x3C] - movs r4, 0x1 - add r10, r4 -_08164656: - ldr r0, [sp, 0x2C] - mov r9, r0 - cmp r0, 0x4 - bgt _08164660 - b _0816453C -_08164660: - mov r1, r10 - cmp r1, 0 - beq _081646A0 - bl Random - ldr r6, =gSaveBlock2Ptr - ldr r4, [r6] - lsls r0, 16 - lsrs r0, 16 - mov r1, r10 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - ldr r5, =0x00000cc2 - adds r4, r5 - strh r0, [r4] - ldrh r0, [r4] - bl sub_81627A4 - ldr r1, [sp, 0x24] - adds r1, 0xC0 - strb r0, [r1, 0x1] - ldr r0, =0x00000361 - bl FlagReset - ldr r0, [r6] - adds r0, r5 - ldrh r0, [r0] - bl sub_8164188 -_081646A0: - add sp, 0x4C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81642A0 - - thumb_func_start sub_81646BC -sub_81646BC: @ 81646BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - movs r0, 0 - mov r9, r0 - mov r10, r0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r5, r0 - beq _081647CE - subs r0, 0xC9 - cmp r5, r0 - bhi _081646FC - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - lsls r0, r4, 4 - adds r0, r1 - ldrh r1, [r0, 0x2] - mov r9, r1 - ldrh r0, [r0] - mov r10, r0 - b _081647CE - .pool -_081646FC: - ldr r0, =0x0000018f - cmp r5, r0 - bhi _08164750 - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r1, =gUnknown_03006298 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - adds r0, 0x1 - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x2C - muls r1, r0 - ldr r0, =0xfffffed4 - adds r2, r5, r0 - movs r0, 0xEC - muls r0, r2 - adds r1, r0 - adds r3, r1 - movs r1, 0xEE - lsls r1, 3 - adds r0, r3, r1 - ldrh r0, [r0] - mov r9, r0 - ldr r2, =0x0000076c - adds r3, r2 - ldrh r3, [r3] - mov r10, r3 - b _081647CE - .pool -_08164750: - ldr r4, =gSaveBlock2Ptr - ldr r3, [r4] - ldr r1, =gUnknown_03006298 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - subs r0, 0x1 - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r2, =0xfffffe70 - adds r1, r5, r2 - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r0, r2 - adds r3, r0 - adds r0, r3, 0 - adds r0, 0xE2 - ldrh r0, [r0] - mov r9, r0 - adds r3, 0xE0 - ldrh r3, [r3] - mov r10, r3 - movs r3, 0 - ldr r7, =gStringVar3 - mov r8, r7 - adds r0, r4, 0 - mov r12, r0 - adds r4, r2, 0 - movs r6, 0x8A - lsls r6, 1 -_08164794: - mov r1, r8 - adds r2, r3, r1 - mov r1, r12 - ldr r0, [r1] - adds r1, r3, r4 - adds r0, r6 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - adds r3, 0x1 - cmp r3, 0x6 - ble _08164794 - adds r1, r3, r7 - movs r0, 0xFF - strb r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =0xfffffe70 - adds r1, r5, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - ldr r1, =0x0000011b - adds r0, r2, r1 - ldrb r1, [r0] - adds r0, r7, 0 - bl ConvertInternationalString -_081647CE: - ldr r0, =gStringVar1 - movs r1, 0xD - mov r2, r9 - muls r2, r1 - adds r1, r2, 0 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar2 - movs r1, 0xB - mov r2, r10 - muls r2, r1 - adds r1, r2, 0 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81646BC - - thumb_func_start sub_8164828 -sub_8164828: @ 8164828 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - bl sub_8165C40 - bl sub_81A39C4 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =gScriptLastTalked - ldrh r0, [r0] - subs r5, r0, 0x2 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r5, 1 - ldr r2, =0x00000cb4 - adds r0, r2 - adds r0, r1 - ldrh r7, [r0] - movs r3, 0 - str r3, [sp] - ldr r4, =gUnknown_085DD500 - lsls r6, r7, 16 - b _08164884 - .pool -_0816487C: - adds r4, 0x8 - ldr r0, [sp] - adds r0, 0x1 - str r0, [sp] -_08164884: - ldr r1, [sp] - cmp r1, 0x31 - bhi _0816489A - lsrs r0, r6, 16 - bl sub_8162D34 - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - cmp r1, r0 - bne _0816487C -_0816489A: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x4 - bls _081648A4 - b _08164AC2 -_081648A4: - lsls r0, 2 - ldr r1, =_081648B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081648B8: - .4byte _081648CC - .4byte _08164984 - .4byte _0816499C - .4byte _081649BC - .4byte _08164AC2 -_081648CC: - movs r0, 0xFA - lsls r0, 1 - cmp r7, r0 - bne _081648D6 - b _08164B54 -_081648D6: - subs r0, 0xC9 - cmp r7, r0 - ble _081648E2 - ldr r0, =0x0000018f - cmp r7, r0 - bgt _081648F4 -_081648E2: - ldr r0, =gStringVar1 - adds r1, r7, 0 - bl sub_8162E20 - b _08164AC2 - .pool -_081648F4: - movs r3, 0 - lsls r2, r7, 16 - mov r10, r2 - ldr r6, =gStringVar1 - mov r9, r6 - ldr r4, =gSaveBlock2Ptr - mov r8, r4 - ldr r5, =0xfffffe70 - adds r1, r7, r5 - lsls r0, r1, 4 - adds r0, r1 - lsls r4, r0, 2 - movs r5, 0x8A - lsls r5, 1 -_08164910: - mov r0, r9 - adds r2, r3, r0 - mov r1, r8 - ldr r0, [r1] - adds r1, r3, r4 - adds r0, r5 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - adds r3, 0x1 - cmp r3, 0x6 - ble _08164910 - adds r1, r3, r6 - movs r0, 0xFF - strb r0, [r1] - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - ldr r3, =0xfffffe70 - adds r0, r7, r3 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r1, r4 - ldr r5, =0x0000011b - adds r0, r1, r5 - ldrb r1, [r0] - adds r0, r6, 0 - bl ConvertInternationalString - ldr r0, =gStringVar2 - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - adds r1, r4 - adds r1, 0xDE - ldrb r1, [r1] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r0, =gStringVar3 - mov r3, r10 - lsrs r1, r3, 16 - bl sub_8162E20 - b _08164AC2 - .pool -_08164984: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r5, 2 - adds r1, r0 - ldr r4, =0x00000cc4 - adds r1, r4 - b _081649A8 - .pool -_0816499C: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r5, 2 - adds r1, r0 - ldr r5, =0x00000cc6 - adds r1, r5 -_081649A8: - adds r0, r7, 0 - ldrh r1, [r1] - bl sub_81646BC - b _08164AC2 - .pool -_081649BC: - ldr r0, =gUnknown_02038BCE - strh r7, [r0] - ldr r0, =0x0000012b - cmp r7, r0 - bgt _08164A08 - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - lsls r1, r5, 1 - adds r0, r1, 0 - adds r0, 0x8 - lsls r0, 1 - ldr r3, =0x00000cb4 - adds r2, r4, r3 - adds r0, r2, r0 - ldrh r3, [r0] - ldr r5, =0x00000cd8 - adds r0, r4, r5 - strh r3, [r0] - adds r1, 0x9 - lsls r1, 1 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x00000cda - adds r4, r1 - strh r0, [r4] - b _08164A46 - .pool -_08164A08: - ldr r0, =0x0000018f - cmp r7, r0 - bgt _08164A30 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r3, =gUnknown_03006298 - ldrh r2, [r3, 0x4] - ldr r4, =0x00000cd8 - adds r0, r1, r4 - strh r2, [r0] - ldrh r0, [r3, 0x6] - b _08164A40 - .pool -_08164A30: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r3, =gUnknown_03006298 - ldrh r2, [r3] - ldr r4, =0x00000cd8 - adds r0, r1, r4 - strh r2, [r0] - ldrh r0, [r3, 0x2] -_08164A40: - ldr r5, =0x00000cda - adds r1, r5 - strh r0, [r1] -_08164A46: - movs r5, 0 - mov r0, r8 - lsls r0, 24 - str r0, [sp, 0x4] -_08164A4E: - lsls r1, r5, 1 - mov r10, r1 - adds r2, r5, 0x1 - mov r9, r2 - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r0, 1 - lsls r0, 24 - mov r8, r0 -_08164A60: - ldr r3, [sp, 0x4] - lsrs r0, r3, 24 - mov r4, r8 - lsrs r1, r4, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =gUnknown_02038BCE - ldrh r0, [r0] - cmp r0, r3 - beq _08164A60 - movs r2, 0 - cmp r2, r5 - bge _08164AA2 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r4, =0x00000cb4 - adds r0, r4 - ldrh r0, [r0] - cmp r0, r3 - beq _08164AA2 - adds r6, r1, 0 -_08164A8E: - adds r2, 0x1 - cmp r2, r5 - bge _08164AA2 - ldr r0, [r6] - lsls r1, r2, 1 - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r3 - bne _08164A8E -_08164AA2: - cmp r2, r5 - bne _08164A60 - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000cb4 - adds r0, r1 - add r0, r10 - strh r3, [r0] - mov r5, r9 - cmp r5, 0xD - ble _08164A4E - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r3, =0x00000cd6 - adds r0, r3 - strh r7, [r0] -_08164AC2: - movs r0, 0xFA - lsls r0, 1 - cmp r7, r0 - beq _08164B54 - subs r0, 0xC9 - cmp r7, r0 - bgt _08164AF8 - ldr r0, =gUnknown_085DD500 - ldr r4, [sp] - lsls r1, r4, 3 - b _08164B04 - .pool -_08164AF8: - ldr r0, =0x0000018f - cmp r7, r0 - bgt _08164B28 - ldr r0, =gUnknown_085DD500 - ldr r5, [sp] - lsls r1, r5, 3 -_08164B04: - adds r0, 0x4 - adds r1, r0 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 - b _08164B54 - .pool -_08164B28: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r7, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - ldr r1, =gUnknown_085DD690 - lsrs r0, 25 - adds r0, r1 - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r0, [r0] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 -_08164B54: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164828 - - thumb_func_start sub_8164B74 -sub_8164B74: @ 8164B74 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r7, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, [r4] - ldr r2, =0x00000cb2 - adds r0, r2 - ldrh r6, [r0] - bl link_get_multiplayer_id - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0x6 - bls _08164BAC - b _08164DB6 -_08164BAC: - lsls r0, 2 - ldr r1, =_08164BD0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08164BD0: - .4byte _08164BEC - .4byte _08164C3C - .4byte _08164CE0 - .4byte _08164D14 - .4byte _08164D98 - .4byte _08164DA8 - .4byte _08164DB6 -_08164BEC: - cmp r5, 0x3 - beq _08164BF2 - b _08164DB0 -_08164BF2: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r7, 1 - adds r0, r1 - ldr r3, =0x00000cec - adds r0, r3 - ldrh r0, [r0] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08164C18 - b _08164DB6 -_08164C18: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - movs r2, 0x4 - bl link_0800A448 - ldr r1, =gScriptResult - movs r0, 0x1 - b _08164DB4 - .pool -_08164C3C: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08164C4A - b _08164DB6 -_08164C4A: - bl sub_800A5B4 - ldr r1, =gUnknown_020223C4 - movs r0, 0x80 - lsls r0, 1 - adds r2, r1, r0 - ldrh r0, [r1] - ldrh r3, [r2] - cmp r0, r3 - bhi _08164C60 - ldrh r0, [r2] -_08164C60: - str r0, [sp] - movs r4, 0 - ldr r0, =gSaveBlock2Ptr - mov r9, r0 -_08164C68: - adds r1, r4, 0x1 - mov r8, r1 - lsrs r0, r4, 31 - adds r0, r4, r0 - asrs r0, 1 - lsls r7, r0, 24 -_08164C74: - ldr r0, [sp] - lsls r0, 24 - lsrs r0, 24 - lsrs r1, r7, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - cmp r2, r4 - bge _08164CB0 - mov r1, r9 - ldr r0, [r1] - ldr r1, =0x00000cb4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r3 - beq _08164CB0 - ldr r6, =gSaveBlock2Ptr - adds r5, r1, 0 -_08164C9C: - adds r2, 0x1 - cmp r2, r4 - bge _08164CB0 - ldr r0, [r6] - lsls r1, r2, 1 - adds r0, r5 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r3 - bne _08164C9C -_08164CB0: - cmp r4, r2 - bne _08164C74 - mov r2, r9 - ldr r0, [r2] - lsls r1, r4, 1 - ldr r2, =0x00000cb4 - adds r0, r2 - adds r0, r1 - strh r3, [r0] - mov r4, r8 - cmp r4, 0xD - ble _08164C68 - ldr r1, =gScriptResult - movs r0, 0x2 - b _08164DB4 - .pool -_08164CE0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08164DB6 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r3, =0x00000cb4 - adds r1, r3 - movs r2, 0x28 - bl link_0800A448 - ldr r1, =gScriptResult - movs r0, 0x3 - b _08164DB4 - .pool -_08164D14: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - bne _08164DB6 - bl sub_800A5B4 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r5, =0x00000cb4 - adds r0, r5 - ldr r1, =gUnknown_020223C4 - movs r2, 0x28 - bl memcpy - ldr r2, =gUnknown_02038BCA - ldr r1, [r4] - lsls r0, r6, 2 - adds r1, r5 - adds r0, r1, r0 - ldrh r0, [r0] - strh r0, [r2] - ldr r4, =gUnknown_02038BCC - lsls r0, r6, 1 - adds r0, 0x1 - lsls r0, 1 - adds r1, r0 - ldrh r0, [r1] - strh r0, [r4] - ldrh r0, [r2] - movs r1, 0 - bl sub_8162614 - ldrh r0, [r4] - movs r1, 0x1 - bl sub_8162614 - ldr r0, =gUnknown_03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08164DB0 - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - bne _08164DB0 - ldr r1, =gScriptResult - movs r0, 0x4 - b _08164DB4 - .pool -_08164D98: - bl sub_800AC34 - ldr r1, =gScriptResult - movs r0, 0x5 - b _08164DB4 - .pool -_08164DA8: - ldr r0, =gUnknown_03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08164DB6 -_08164DB0: - ldr r1, =gScriptResult - movs r0, 0x6 -_08164DB4: - strh r0, [r1] -_08164DB6: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164B74 - - thumb_func_start sub_8164DCC -sub_8164DCC: @ 8164DCC - push {lr} - ldr r0, =gLinkVSyncDisabled - ldrb r0, [r0] - cmp r0, 0 - beq _08164DDA - bl sub_800AC34 -_08164DDA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164DCC - - thumb_func_start sub_8164DE4 -sub_8164DE4: @ 8164DE4 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cd6 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0xF - bl sub_8162614 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164DE4 - - thumb_func_start sub_8164E04 -sub_8164E04: @ 8164E04 - push {r4-r6,lr} - sub sp, 0x20 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - cmp r0, 0 - bne _08164E9A - ldr r5, =gUnknown_02038BCA - ldrh r1, [r5] - mov r0, sp - bl sub_8162E20 - mov r0, sp - bl StripExtCtrlCodes - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000bd8 - adds r0, r1 - mov r1, sp - bl StringCopy - ldr r0, [r4] - ldr r2, =0x00000beb - adds r0, r2 - ldrh r1, [r5] - bl sub_8165B88 - ldr r6, =gBattlePartyID - ldrh r0, [r6, 0x2] - movs r5, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - ldr r1, [r4] - ldr r2, =0x00000bd6 - adds r1, r2 - strh r0, [r1] - ldrh r0, [r6] - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - ldr r1, [r4] - ldr r2, =0x00000bd4 - adds r1, r2 - strh r0, [r1] - movs r2, 0 - movs r5, 0xBE - lsls r5, 4 - ldr r3, =gUnknown_020240B4 - adds r6, r4, 0 -_08164E7C: - ldr r0, [r4] - adds r0, r5 - adds r0, r2 - adds r1, r2, r3 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0xA - ble _08164E7C - ldr r0, [r6] - ldr r1, =gBattleOutcome - ldrb r1, [r1] - ldr r2, =0x00000d06 - adds r0, r2 - strb r1, [r0] -_08164E9A: - add sp, 0x20 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164E04 - - thumb_func_start sub_8164ED8 -sub_8164ED8: @ 8164ED8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r3, 0 - movs r2, 0 - ldr r4, =0x0000064c - adds r1, r0, r4 -_08164EEA: - ldm r1!, {r0} - adds r3, r0 - adds r2, 0x1 - cmp r2, 0x39 - bls _08164EEA - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r2, =0x00000734 - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, r3 - beq _08164F0A - ldr r3, =0x0000064c - adds r0, r1, r3 - bl sub_8164FB8 -_08164F0A: - movs r4, 0 - adds r7, r5, 0 - movs r6, 0xEC - mov r8, r7 -_08164F12: - adds r0, r4, 0 - muls r0, r6 - movs r1, 0xE7 - lsls r1, 3 - adds r0, r1 - ldr r1, [r7] - movs r3, 0 - movs r2, 0 - adds r5, r4, 0x1 - adds r1, r0 -_08164F26: - ldm r1!, {r0} - adds r3, r0 - adds r2, 0x1 - cmp r2, 0x39 - bls _08164F26 - mov r0, r8 - ldr r2, [r0] - adds r1, r4, 0 - muls r1, r6 - movs r4, 0x82 - lsls r4, 4 - adds r0, r2, r4 - adds r0, r1 - ldr r0, [r0] - cmp r0, r3 - beq _08164F52 - movs r3, 0xE7 - lsls r3, 3 - adds r0, r1, r3 - adds r0, r2, r0 - bl sub_8164FB8 -_08164F52: - adds r4, r5, 0 - cmp r4, 0x4 - ble _08164F12 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164ED8 - - thumb_func_start sub_8164F70 -sub_8164F70: @ 8164F70 - push {r4,lr} - adds r2, r0, 0 - adds r2, 0xE8 - movs r1, 0 - str r1, [r2] - movs r3, 0 - adds r4, r0, 0 -_08164F7E: - ldr r0, [r2] - ldm r4!, {r1} - adds r0, r1 - str r0, [r2] - adds r3, 0x1 - cmp r3, 0x39 - bls _08164F7E - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8164F70 - - thumb_func_start sub_8164F94 -sub_8164F94: @ 8164F94 - push {r4,lr} - adds r2, r0, 0 - adds r2, 0xA0 - movs r1, 0 - str r1, [r2] - movs r3, 0 - adds r4, r0, 0 -_08164FA2: - ldr r0, [r2] - ldm r4!, {r1} - adds r0, r1 - str r0, [r2] - adds r3, 0x1 - cmp r3, 0x27 - bls _08164FA2 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8164F94 - - thumb_func_start sub_8164FB8 -sub_8164FB8: @ 8164FB8 - push {lr} - movs r1, 0 - movs r2, 0 -_08164FBE: - stm r0!, {r2} - adds r1, 0x1 - cmp r1, 0x3A - bls _08164FBE - pop {r0} - bx r0 - thumb_func_end sub_8164FB8 - - thumb_func_start sub_8164FCC -sub_8164FCC: @ 8164FCC - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r0, 23 - lsrs r1, 22 - adds r0, r1 - movs r1, 0xCE - lsls r1, 4 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _08164FEE - adds r0, r1, 0 -_08164FEE: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8164FCC - - thumb_func_start sub_8164FFC -sub_8164FFC: @ 8164FFC - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_085DFA42 - mov r0, sp - movs r2, 0x4 - bl memcpy - cmp r4, 0x3 - bls _0816501C - movs r0, 0x3 - b _08165022 - .pool -_0816501C: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] -_08165022: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8164FFC - - thumb_func_start sub_816502C -sub_816502C: @ 816502C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - adds r5, r0, 0 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - bl sub_8164FFC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r2, 0x44 - mov r10, r2 - cmp r5, 0 - beq _0816506A - movs r0, 0x45 - mov r10, r0 -_0816506A: - ldr r1, =gScriptResult - mov r9, r1 - movs r0, 0 - strh r0, [r1] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8164FCC - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x37 - bls _081650DC - movs r6, 0 - cmp r6, r8 - bge _081650DC - ldr r7, =gSaveBlock1Ptr - mov r5, sp -_0816508C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r6, 1 - ldr r2, =0x00000caa - adds r0, r2 - adds r0, r1 - ldrh r1, [r0] - subs r1, 0x1 - movs r0, 0 - strb r1, [r5] - strb r0, [r5, 0x1] - movs r0, 0x64 - muls r0, r1 - movs r1, 0x8E - lsls r1, 2 - adds r4, r0, r1 - ldr r0, [r7] - adds r0, r4 - mov r1, r10 - bl GetMonData - cmp r0, 0 - bne _081650D4 - movs r0, 0x1 - mov r2, r9 - strh r0, [r2] - ldr r0, [r7] - adds r0, r4 - mov r1, r10 - bl SetMonData - ldr r0, [r7] - adds r0, r4 - bl sub_80EE5A4 - strb r0, [r5, 0x1] -_081650D4: - adds r5, 0x4 - adds r6, 0x1 - cmp r6, r8 - blt _0816508C -_081650DC: - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0 - beq _08165132 - movs r0, 0x2A - bl IncrementGameStat - mov r0, r8 - cmp r0, 0x1 - ble _08165110 - mov r3, sp - add r2, sp, 0x4 - mov r6, r8 - subs r6, 0x1 -_081650F8: - ldrb r1, [r3, 0x1] - ldrb r0, [r2, 0x1] - cmp r0, r1 - bls _08165108 - ldr r1, [sp] - ldr r0, [r2] - str r0, [sp] - str r1, [r2] -_08165108: - adds r2, 0x4 - subs r6, 0x1 - cmp r6, 0 - bne _081650F8 -_08165110: - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0x4 - bls _08165132 - ldr r2, =gSaveBlock1Ptr - mov r0, sp - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - movs r0, 0x8E - lsls r0, 2 - adds r1, r0 - ldr r0, [r2] - adds r0, r1 - mov r1, r10 - bl sub_80EE4DC -_08165132: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816502C - - thumb_func_start sub_816515C -sub_816515C: @ 816515C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - ldr r0, =0x00000bec - adds r7, r2, r0 - ldrb r0, [r2, 0x8] - adds r5, r1, 0 - cmp r0, 0 - beq _08165194 - ldr r4, =gUnknown_085DCEFA - ldrb r0, [r2, 0xA] - ldrb r1, [r2, 0xB] - adds r0, r1 - ldrb r1, [r2, 0xC] - adds r0, r1 - ldrb r1, [r2, 0xD] - adds r0, r1 - movs r1, 0x14 - b _081651A6 - .pool -_08165194: - ldr r4, =gUnknown_085DCEDC - ldrb r0, [r2, 0xA] - ldrb r1, [r2, 0xB] - adds r0, r1 - ldrb r1, [r2, 0xC] - adds r0, r1 - ldrb r1, [r2, 0xD] - adds r0, r1 - movs r1, 0x1E -_081651A6: - bl __umodsi3 - adds r0, r4 - ldrb r0, [r0] - strb r0, [r7, 0x1] - adds r0, r7, 0 - adds r0, 0xC - ldr r1, [r5] - adds r1, 0xA - bl CopyUnalignedWord - adds r0, r7, 0x4 - ldr r1, [r5] - bl StringCopy7 - movs r0, 0x1 - strh r0, [r7, 0x2] - movs r6, 0x7 - movs r4, 0 - ldr r0, =gSaveBlock1Ptr - mov r8, r0 - adds r5, r7, 0 - adds r5, 0x10 - ldr r1, =0x00002bbc - mov r12, r1 - adds r3, r7, 0 - adds r3, 0x28 - adds r2, r7, 0 - adds r2, 0x1C -_081651E0: - lsls r0, r4, 1 - mov r9, r0 - mov r1, r8 - ldr r0, [r1] - add r0, r12 - add r0, r9 - ldrh r0, [r0] - strh r0, [r5] - strh r6, [r2] - adds r0, r6, 0x6 - strh r0, [r3] - adds r6, 0x1 - adds r5, 0x2 - adds r3, 0x2 - adds r2, 0x2 - adds r4, 0x1 - cmp r4, 0x5 - ble _081651E0 - movs r4, 0 -_08165206: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2C - muls r1, r4 - adds r1, 0x34 - adds r1, r7, r1 - bl sub_80686FC - adds r4, 0x1 - cmp r4, 0x2 - ble _08165206 - adds r0, r7, 0 - bl sub_8165328 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816515C - - thumb_func_start sub_8165244 -sub_8165244: @ 8165244 - ldr r1, =gTrainerPicIndices - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000bed - adds r0, r2 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8165244 - - thumb_func_start sub_8165264 -sub_8165264: @ 8165264 - ldr r1, =gTrainerClassNameIndices - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000bed - adds r0, r2 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8165264 - - thumb_func_start sub_8165284 -sub_8165284: @ 8165284 - push {r4,lr} - adds r3, r0, 0 - movs r2, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xBF - lsls r1, 4 - adds r4, r0, r1 -_08165294: - adds r0, r3, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x4 - ble _08165294 - adds r1, r3, r2 - movs r0, 0xFF - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8165284 - - thumb_func_start sub_81652B4 -sub_81652B4: @ 81652B4 - push {r4-r6,lr} - ldr r2, =gScriptResult - movs r0, 0 - strh r0, [r2] - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r3, =0x00000bec - adds r5, r0, r3 - movs r4, 0 - movs r3, 0 - adds r6, r1, 0 - adds r1, r5, 0 -_081652CC: - ldm r1!, {r0} - orrs r4, r0 - adds r3, 0x1 - cmp r3, 0x2D - bls _081652CC - cmp r4, 0 - bne _081652EC - movs r0, 0x1 - strh r0, [r2] - b _08165316 - .pool -_081652EC: - movs r4, 0 - movs r3, 0 - adds r2, r5, 0 -_081652F2: - ldm r2!, {r0} - adds r4, r0 - adds r3, 0x1 - cmp r3, 0x2D - bls _081652F2 - ldr r1, [r6] - ldr r2, =0x00000ca4 - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, r4 - beq _08165316 - ldr r3, =0x00000bec - adds r0, r1, r3 - bl sub_816534C - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] -_08165316: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81652B4 - - thumb_func_start sub_8165328 -sub_8165328: @ 8165328 - push {r4,lr} - adds r2, r0, 0 - adds r2, 0xB8 - movs r1, 0 - str r1, [r2] - movs r3, 0 - adds r4, r0, 0 -_08165336: - ldr r0, [r2] - ldm r4!, {r1} - adds r0, r1 - str r0, [r2] - adds r3, 0x1 - cmp r3, 0x2D - bls _08165336 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8165328 - - thumb_func_start sub_816534C -sub_816534C: @ 816534C - push {lr} - movs r1, 0 - movs r2, 0 -_08165352: - stm r0!, {r2} - adds r1, 0x1 - cmp r1, 0x2E - bls _08165352 - pop {r0} - bx r0 - thumb_func_end sub_816534C - - thumb_func_start sub_8165360 -sub_8165360: @ 8165360 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000bfc - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_8165360 - - thumb_func_start sub_816537C -sub_816537C: @ 816537C - push {lr} - ldr r0, =gBattleOutcome - ldrb r0, [r0] - cmp r0, 0x3 - bne _08165398 - ldr r1, =gStringVar4 - movs r0, 0xFF - strb r0, [r1] - b _081653C0 - .pool -_08165398: - cmp r0, 0x1 - bne _081653B4 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000c14 - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - b _081653C0 - .pool -_081653B4: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000c08 - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString -_081653C0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_816537C - - thumb_func_start sub_81653CC -sub_81653CC: @ 81653CC - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca8 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081653E0 - bl sub_80F01B8 -_081653E0: - movs r0, 0x77 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081653F8 - bl sub_80F01B8 - movs r0, 0x77 - bl FlagReset -_081653F8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81653CC - - thumb_func_start sub_8165404 -sub_8165404: @ 8165404 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x70 - lsls r0, 16 - lsrs r7, r0, 16 - bl sub_8165C40 - ldr r0, =0x00000c03 - cmp r7, r0 - beq _08165420 - b _0816554C -_08165420: - movs r0, 0 - mov r10, r0 - mov r1, sp - adds r1, 0x44 - str r1, [sp, 0x64] -_0816542A: - mov r2, r10 - lsls r2, 2 - mov r9, r2 - mov r3, r10 - adds r3, 0x1 - str r3, [sp, 0x60] - mov r0, r9 - add r0, r10 - lsls r0, 2 - ldr r6, =gUnknown_085DD6D0 - adds r5, r0, r6 -_08165440: - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x44] - ldr r0, =0x0000ef2a - adds r1, r4, 0 - bl sub_806EBD0 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - bne _08165440 - ldr r0, [sp, 0x44] - bl GetNatureFromPersonality - ldrb r1, [r5, 0x4] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _08165440 - movs r0, 0x64 - mov r6, r10 - muls r6, r0 - ldr r1, =gUnknown_02024618 - mov r8, r1 - adds r0, r6, r1 - mov r5, r9 - add r5, r10 - lsls r5, 2 - ldr r2, =gUnknown_085DD6D0 - adds r3, r5, r2 - ldrh r1, [r3] - ldrb r2, [r3, 0x3] - ldrb r3, [r3, 0x2] - mov r12, r3 - movs r4, 0x1 - str r4, [sp] - mov r3, r10 - str r3, [sp, 0x4] - str r4, [sp, 0x8] - ldr r4, =0x0000ef2a - str r4, [sp, 0xC] - mov r3, r12 - bl create_pokemon_set_level - str r7, [sp, 0x44] - movs r3, 0 - mov r4, r8 - ldr r0, =gUnknown_085DD6D5 - adds r5, r0 -_081654B0: - adds r1, r3, 0 - adds r1, 0x1A - adds r2, r5, r3 - adds r0, r6, r4 - bl SetMonData - ldr r0, [sp, 0x44] - adds r0, 0x1 - str r0, [sp, 0x44] - adds r3, r0, 0 - cmp r3, 0x5 - ble _081654B0 - movs r0, 0 - str r0, [sp, 0x44] - movs r1, 0 - movs r6, 0x64 - mov r4, r10 - muls r4, r6 - ldr r7, =gUnknown_085DD6DC - ldr r6, =gUnknown_02024618 - mov r0, r9 - add r0, r10 - lsls r5, r0, 2 -_081654DE: - lsls r0, r1, 1 - adds r0, r5 - adds r0, r7 - ldrh r1, [r0] - ldr r0, [sp, 0x64] - ldrb r2, [r0] - adds r0, r4, r6 - bl sub_80691F4 - ldr r0, [sp, 0x44] - adds r0, 0x1 - str r0, [sp, 0x44] - adds r1, r0, 0 - cmp r1, 0x3 - ble _081654DE - movs r1, 0x64 - mov r4, r10 - muls r4, r1 - ldr r0, =gUnknown_02024618 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 @ Steven's name - bl SetMonData - movs r0, 0 - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x31 - ldr r2, [sp, 0x64] - bl SetMonData - adds r0, r4, 0 - bl pokemon_calc_effective_stats - ldr r2, [sp, 0x60] - mov r10, r2 - cmp r2, 0x2 - bgt _0816552E - b _0816542A -_0816552E: - b _0816585A - .pool -_0816554C: - movs r0, 0xFA - lsls r0, 1 - cmp r7, r0 - bne _08165564 - add r0, sp, 0x10 - ldr r1, =gGameLanguage - ldrb r1, [r1] - strb r1, [r0] - b _0816585A - .pool -_08165564: - ldr r0, =0x0000012b - cmp r7, r0 - bls _0816556C - b _081656E8 -_0816556C: - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x50] - adds r0, r7, 0 - bl sub_8165D08 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4C] - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x58] - movs r3, 0 - mov r10, r3 - mov r6, sp - adds r6, 0x44 - str r6, [sp, 0x64] - mov r0, sp - adds r0, 0x48 - str r0, [sp, 0x5C] -_081655A6: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r0, r10 - adds r0, 0x12 - lsls r0, 1 - ldr r2, =0x00000cb4 - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - str r1, [sp, 0x54] - movs r6, 0x64 - mov r3, r10 - muls r3, r6 - mov r8, r3 - ldr r0, =gUnknown_02024618 - mov r9, r0 - mov r0, r8 - add r0, r9 - ldr r6, =gUnknown_0203BC8C - ldr r4, [r6] - lsls r5, r1, 4 - adds r4, r5, r4 - ldrh r1, [r4] - ldr r3, [sp, 0x50] - lsls r2, r3, 24 - ldrb r3, [r4, 0xC] - mov r12, r3 - ldr r3, [sp, 0x4C] - str r3, [sp] - ldrb r4, [r4, 0xB] - str r4, [sp, 0x4] - ldr r3, [sp, 0x58] - str r3, [sp, 0x8] - lsrs r2, 24 - mov r3, r12 - bl sub_8068634 - movs r0, 0xFF - str r0, [sp, 0x48] - movs r0, 0 - str r0, [sp, 0x44] - movs r2, 0 - mov r0, r10 - adds r0, 0x1 - str r0, [sp, 0x60] - mov r4, r8 - mov r3, r9 -_08165604: - ldr r0, [r6] - adds r0, r5, r0 - lsls r1, r2, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r1, [r0] - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, r3 - str r3, [sp, 0x68] - bl sub_80691F4 - ldr r0, [r6] - adds r0, r5, r0 - ldr r2, [sp, 0x44] - lsls r1, r2, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r0, [r0] - ldr r3, [sp, 0x68] - cmp r0, 0xDA - bne _08165634 - movs r0, 0 - str r0, [sp, 0x48] -_08165634: - adds r0, r2, 0x1 - str r0, [sp, 0x44] - adds r2, r0, 0 - cmp r2, 0x3 - ble _08165604 - movs r1, 0x64 - mov r4, r10 - muls r4, r1 - ldr r0, =gUnknown_02024618 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x5C] - bl SetMonData - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - ldr r2, [sp, 0x54] - lsls r0, r2, 4 - adds r0, r1 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - movs r0, 0 - str r0, [sp, 0x44] - movs r2, 0 - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r7 - adds r0, r1 - adds r3, r0, 0x4 -_0816567E: - mov r1, sp - adds r1, r2 - adds r1, 0x10 - adds r0, r3, r2 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, [sp, 0x44] - adds r0, 0x1 - str r0, [sp, 0x44] - adds r2, r0, 0 - cmp r2, 0x7 - ble _0816567E - movs r3, 0x64 - mov r4, r10 - muls r4, r3 - ldr r0, =gUnknown_02024618 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x7 - add r2, sp, 0x10 - bl SetMonData - adds r0, r7, 0 - bl sub_8162F68 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x31 - ldr r2, [sp, 0x64] - bl SetMonData - ldr r6, [sp, 0x60] - mov r10, r6 - cmp r6, 0x1 - bgt _081656CA - b _081655A6 -_081656CA: - b _0816585A - .pool -_081656E8: - ldr r0, =0x0000018f - cmp r7, r0 - bls _081656F0 - b _081657F0 -_081656F0: - ldr r1, =0xfffffed4 - adds r0, r7, r1 - lsls r0, 16 - lsrs r7, r0, 16 - movs r2, 0 - mov r10, r2 - mov r3, sp - adds r3, 0x44 - str r3, [sp, 0x64] - add r5, sp, 0x18 - ldr r6, =0x000015fc - mov r9, r6 - ldr r0, =0x0000ffff - mov r8, r0 - movs r1, 0x24 - str r1, [sp, 0x6C] -_08165710: - ldr r1, =gSaveBlock2Ptr - movs r0, 0xEC - adds r4, r7, 0 - muls r4, r0 - movs r2, 0xE7 - lsls r2, 3 - adds r4, r2 - ldr r0, [r1] - adds r4, r0, r4 - ldr r3, =0x00000cb4 - adds r0, r3 - ldr r6, [sp, 0x6C] - adds r0, r6 - ldrh r1, [r0] - movs r0, 0x2C - muls r1, r0 - adds r1, r4, r1 - adds r0, r5, 0 - adds r1, 0x34 - ldm r1!, {r2,r3,r6} - stm r0!, {r2,r3,r6} - ldm r1!, {r2,r3,r6} - stm r0!, {r2,r3,r6} - ldm r1!, {r2,r3,r6} - stm r0!, {r2,r3,r6} - ldm r1!, {r2,r3} - stm r0!, {r2,r3} - adds r1, r4, 0x4 - add r0, sp, 0x10 - bl StringCopy - adds r4, 0xE4 - ldrb r0, [r4] - cmp r0, 0x1 - bne _0816578C - ldrh r0, [r5, 0x20] - mov r6, r8 - ands r0, r6 - cmp r0, r9 - beq _0816579C - mov r1, sp - adds r1, 0x3D - movs r0, 0xFF - strb r0, [r1] - add r0, sp, 0x38 - movs r1, 0x1 - bl ConvertInternationalString - b _0816579C - .pool -_0816578C: - ldrh r0, [r5, 0x20] - mov r1, r8 - ands r0, r1 - cmp r0, r9 - bne _0816579C - add r1, sp, 0x10 - movs r0, 0xFF - strb r0, [r1, 0x5] -_0816579C: - movs r0, 0x64 - mov r4, r10 - muls r4, r0 - ldr r0, =gUnknown_02024618 - adds r4, r0 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8068338 - adds r0, r4, 0 - movs r1, 0x7 - add r2, sp, 0x10 - bl SetMonData - movs r2, 0x96 - lsls r2, 1 - adds r0, r7, r2 - lsls r0, 16 - lsrs r0, 16 - bl sub_8162F68 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x31 - ldr r2, [sp, 0x64] - bl SetMonData - ldr r3, [sp, 0x6C] - adds r3, 0x2 - str r3, [sp, 0x6C] - movs r6, 0x1 - add r10, r6 - mov r0, r10 - cmp r0, 0x1 - ble _08165710 - b _0816585A - .pool -_081657F0: - ldr r1, =0xfffffe70 - adds r0, r7, r1 - lsls r0, 16 - lsrs r7, r0, 16 - movs r2, 0 - mov r10, r2 - mov r3, sp - adds r3, 0x44 - str r3, [sp, 0x64] - ldr r6, =gSaveBlock2Ptr - mov r8, r6 - movs r5, 0x24 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r6, r0, 0 - adds r6, 0xDC -_08165812: - movs r0, 0x64 - mov r4, r10 - muls r4, r0 - ldr r0, =gUnknown_02024618 - adds r4, r0 - mov r1, r8 - ldr r0, [r1] - adds r1, r0, r6 - ldr r2, =0x00000cb4 - adds r0, r2 - adds r0, r5 - ldrb r2, [r0] - adds r0, r4, 0 - bl sub_8068528 - movs r3, 0xC8 - lsls r3, 1 - adds r0, r7, r3 - lsls r0, 16 - lsrs r0, 16 - bl sub_8162F68 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x31 - ldr r2, [sp, 0x64] - bl SetMonData - adds r5, 0x2 - movs r0, 0x1 - add r10, r0 - mov r1, r10 - cmp r1, 0x1 - ble _08165812 -_0816585A: - add sp, 0x70 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8165404 - - thumb_func_start sub_816587C -sub_816587C: @ 816587C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - adds r6, r0, 0 - adds r5, r1, 0 - movs r2, 0 - adds r1, r6, 0 - adds r3, r6, 0 - adds r3, 0x58 -_08165894: - ldrh r0, [r1, 0x1C] - cmp r0, 0 - beq _0816589C - adds r2, 0x1 -_0816589C: - adds r1, 0x2C - cmp r1, r3 - ble _08165894 - cmp r2, 0x3 - beq _081658B4 - adds r0, r5, 0 - movs r1, 0 - movs r2, 0xEC - bl memset - movs r0, 0 - b _081659BE -_081658B4: - ldrb r0, [r6] - strb r0, [r5] - ldrh r0, [r6, 0x2] - strh r0, [r5, 0x2] - movs r2, 0 - ldr r0, =gUnknown_085DCF40 - ldrb r1, [r0] - ldrb r3, [r6, 0x1] - mov r12, r0 - adds r4, r5, 0x4 - adds r7, r6, 0x4 - movs r0, 0xC - adds r0, r5 - mov r9, r0 - movs r0, 0xC - adds r0, r6 - mov r8, r0 - adds r0, r5, 0 - adds r0, 0x10 - str r0, [sp, 0x4] - movs r0, 0x10 - adds r0, r6 - mov r10, r0 - adds r0, r5, 0 - adds r0, 0x1C - str r0, [sp, 0x8] - adds r0, 0xC - str r0, [sp, 0xC] - adds r0, 0x90 - str r0, [sp, 0x10] - cmp r1, r3 - beq _08165904 - mov r1, r12 -_081658F6: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x51 - bgt _08165904 - ldrb r0, [r1] - cmp r0, r3 - bne _081658F6 -_08165904: - cmp r2, 0x52 - beq _08165918 - lsls r0, r2, 1 - mov r1, r12 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - b _0816591A - .pool -_08165918: - movs r0, 0x2B -_0816591A: - strb r0, [r5, 0x1] - movs r2, 0 - adds r3, r7, 0 -_08165920: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x7 - ble _08165920 - movs r2, 0 - mov r4, r9 - mov r3, r8 -_08165934: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _08165934 - mov r3, r10 - ldr r1, [sp, 0x4] - movs r2, 0x5 -_08165948: - ldrh r0, [r3] - strh r0, [r1] - adds r3, 0x2 - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08165948 - ldr r3, =gUnknown_085DFA46 - ldr r1, [sp, 0x8] - movs r2, 0x5 -_0816595C: - ldrh r0, [r3] - strh r0, [r1] - adds r3, 0x2 - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _0816595C - ldr r3, =gUnknown_085DFA52 - ldr r1, [sp, 0xC] - movs r2, 0x5 -_08165970: - ldrh r0, [r3] - strh r0, [r1] - adds r3, 0x2 - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08165970 - adds r2, r6, 0 - adds r3, r5, 0 - movs r4, 0x58 - adds r4, r2 - mov r8, r4 -_08165988: - adds r1, r3, 0 - adds r1, 0x34 - adds r0, r2, 0 - adds r0, 0x1C - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldm r0!, {r6,r7} - stm r1!, {r6,r7} - adds r2, 0x2C - adds r3, 0x2C - cmp r2, r8 - ble _08165988 - movs r0, 0 - str r0, [sp] - ldr r2, =0x0500000b - mov r0, sp - ldr r1, [sp, 0x10] - bl CpuSet - adds r0, r5, 0 - bl sub_8164F70 - movs r0, 0x1 -_081659BE: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_816587C - - thumb_func_start sub_81659DC -sub_81659DC: @ 81659DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r6, r1, 0 - movs r2, 0 - adds r1, r4, 0 - adds r3, r4, 0 - adds r3, 0x58 -_081659F4: - ldrh r0, [r1, 0x34] - cmp r0, 0 - beq _081659FC - adds r2, 0x1 -_081659FC: - adds r1, 0x2C - cmp r1, r3 - ble _081659F4 - cmp r2, 0x3 - beq _08165A14 - adds r0, r6, 0 - movs r1, 0 - movs r2, 0xA4 - bl memset - movs r0, 0 - b _08165AD8 -_08165A14: - ldrb r0, [r4] - strb r0, [r6] - ldrh r0, [r4, 0x2] - strh r0, [r6, 0x2] - movs r2, 0 - ldr r0, =gUnknown_085DCF40 - ldrb r1, [r0, 0x1] - ldrb r3, [r4, 0x1] - mov r12, r0 - adds r5, r6, 0x4 - adds r7, r4, 0x4 - movs r0, 0xC - adds r0, r6 - mov r9, r0 - movs r0, 0xC - adds r0, r4 - mov r8, r0 - adds r0, r6, 0 - adds r0, 0x10 - str r0, [sp] - movs r0, 0x10 - adds r0, r4 - mov r10, r0 - cmp r1, r3 - beq _08165A58 - mov r1, r12 - adds r1, 0x1 -_08165A4A: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x51 - bgt _08165A58 - ldrb r0, [r1] - cmp r0, r3 - bne _08165A4A -_08165A58: - cmp r2, 0x52 - beq _08165A68 - lsls r0, r2, 1 - add r0, r12 - ldrb r0, [r0] - b _08165A6A - .pool -_08165A68: - movs r0, 0x24 -_08165A6A: - strb r0, [r6, 0x1] - movs r2, 0 - adds r3, r7, 0 -_08165A70: - adds r0, r5, r2 - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x7 - ble _08165A70 - movs r2, 0 - mov r5, r9 - mov r3, r8 -_08165A84: - adds r0, r5, r2 - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _08165A84 - mov r3, r10 - ldr r1, [sp] - movs r2, 0x5 -_08165A98: - ldrh r0, [r3] - strh r0, [r1] - adds r3, 0x2 - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08165A98 - adds r2, r4, 0 - adds r3, r6, 0 - movs r4, 0x58 - adds r4, r2 - mov r8, r4 -_08165AB0: - adds r1, r3, 0 - adds r1, 0x1C - adds r0, r2, 0 - adds r0, 0x34 - ldm r0!, {r4,r5,r7} - stm r1!, {r4,r5,r7} - ldm r0!, {r4,r5,r7} - stm r1!, {r4,r5,r7} - ldm r0!, {r4,r5,r7} - stm r1!, {r4,r5,r7} - ldm r0!, {r5,r7} - stm r1!, {r5,r7} - adds r2, 0x2C - adds r3, 0x2C - cmp r2, r8 - ble _08165AB0 - adds r0, r6, 0 - bl sub_8164F94 - movs r0, 0x1 -_08165AD8: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81659DC - - thumb_func_start sub_8165AE8 -sub_8165AE8: @ 8165AE8 - push {r4,lr} - adds r2, r0, 0 - movs r0, 0 - str r0, [r2, 0x40] - movs r3, 0 - adds r4, r2, 0 -_08165AF4: - ldr r0, [r2, 0x40] - ldm r4!, {r1} - adds r0, r1 - str r0, [r2, 0x40] - adds r3, 0x1 - cmp r3, 0xF - bls _08165AF4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8165AE8 - - thumb_func_start sub_8165B08 -sub_8165B08: @ 8165B08 - push {lr} - movs r1, 0 - movs r3, 0 - adds r2, r0, 0 -_08165B10: - stm r2!, {r3} - adds r1, 0x1 - cmp r1, 0x10 - bls _08165B10 - bl sub_819FA5C - pop {r0} - bx r0 - thumb_func_end sub_8165B08 - - thumb_func_start sub_8165B20 -sub_8165B20: @ 8165B20 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r5, 0 - ldr r0, =gSaveBlock2Ptr - mov r8, r0 - mov r9, r8 -_08165B30: - lsls r0, r5, 4 - adds r1, r0, r5 - lsls r1, 2 - adds r1, 0xDC - mov r3, r9 - ldr r2, [r3] - movs r4, 0 - movs r3, 0 - adds r6, r0, 0 - adds r7, r5, 0x1 - adds r2, r1 -_08165B46: - ldm r2!, {r0} - adds r4, r0 - adds r3, 0x1 - cmp r3, 0xF - bls _08165B46 - mov r0, r8 - ldr r2, [r0] - adds r0, r6, r5 - lsls r1, r0, 2 - movs r3, 0x8E - lsls r3, 1 - adds r0, r2, r3 - adds r0, r1 - ldr r0, [r0] - cmp r0, r4 - beq _08165B70 - adds r0, r1, 0 - adds r0, 0xDC - adds r0, r2, r0 - bl sub_8165B08 -_08165B70: - adds r5, r7, 0 - cmp r5, 0x3 - ble _08165B30 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8165B20 - - thumb_func_start sub_8165B88 -sub_8165B88: @ 8165B88 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r2, r1, 16 - adds r3, r2, 0 - movs r0, 0xFA - lsls r0, 1 - cmp r2, r0 - bne _08165BA4 - ldr r0, =gGameLanguage - b _08165C28 - .pool -_08165BA4: - ldr r0, =0x0000012b - cmp r2, r0 - bhi _08165BB8 - ldr r0, =gGameLanguage - b _08165C28 - .pool -_08165BB8: - ldr r0, =0x0000018f - cmp r2, r0 - bhi _08165BFC - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08165BDC - bl sub_81864B4 - b _08165C2A - .pool -_08165BDC: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r1, =0x0000081c - adds r0, r1 - b _08165C28 - .pool -_08165BFC: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08165C14 - bl sub_81864C0 - b _08165C2A - .pool -_08165C14: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =0xfffffe70 - adds r1, r3, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - ldr r1, =0x0000011b - adds r0, r2, r1 -_08165C28: - ldrb r0, [r0] -_08165C2A: - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8165B88 - - thumb_func_start sub_8165C40 -sub_8165C40: @ 8165C40 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r2, r0, r1 - ldrb r1, [r2] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _08165C84 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - ldrb r0, [r2] - lsls r0, 30 - lsrs r0, 30 - bl sub_8165C90 - b _08165C88 - .pool -_08165C84: - bl sub_8165D78 -_08165C88: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8165C40 - - thumb_func_start sub_8165C90 -sub_8165C90: @ 8165C90 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08165C9E - cmp r0, 0x1 - beq _08165CA2 -_08165C9E: - movs r0, 0x32 - b _08165CB0 -_08165CA2: - bl sub_8165CB4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3B - bhi _08165CB0 - movs r0, 0x3C -_08165CB0: - pop {r1} - bx r1 - thumb_func_end sub_8165C90 - - thumb_func_start sub_8165CB4 -sub_8165CB4: @ 8165CB4 - push {r4-r6,lr} - movs r6, 0 - movs r5, 0 -_08165CBA: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - cmp r0, 0 - beq _08165CF4 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl GetMonData - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08165CF4 - adds r0, r4, 0 - movs r1, 0x38 - movs r2, 0 - bl GetMonData - cmp r0, r6 - ble _08165CF4 - adds r6, r0, 0 -_08165CF4: - adds r5, 0x1 - cmp r5, 0x5 - ble _08165CBA - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8165CB4 - - thumb_func_start sub_8165D08 -sub_8165D08: @ 8165D08 - push {lr} - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - cmp r0, 0x63 - bls _08165D3A - movs r1, 0x6 - cmp r0, 0x77 - bls _08165D3A - movs r1, 0x9 - cmp r0, 0x8B - bls _08165D3A - movs r1, 0xC - cmp r0, 0x9F - bls _08165D3A - movs r1, 0xF - cmp r0, 0xB3 - bls _08165D3A - movs r1, 0x12 - cmp r0, 0xC7 - bls _08165D3A - movs r1, 0x1F - cmp r0, 0xDB - bhi _08165D3A - movs r1, 0x15 -_08165D3A: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_8165D08 - - thumb_func_start sub_8165D40 -sub_8165D40: @ 8165D40 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - beq _08165D58 - cmp r0, 0x3 - beq _08165D58 - cmp r0, 0x4 - bne _08165D70 -_08165D58: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1E - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - b _08165D72 - .pool -_08165D70: - movs r0, 0 -_08165D72: - pop {r1} - bx r1 - thumb_func_end sub_8165D40 - - thumb_func_start sub_8165D78 -sub_8165D78: @ 8165D78 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4 - bne _08165DA8 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gSlateportBattleTentTrainers - str r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons - b _08165DF2 - .pool -_08165DA8: - cmp r0, 0x2 - bne _08165DC8 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gVerdanturfBattleTentTrainers - str r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r0, =gVerdanturfBattleTentMons - b _08165DF2 - .pool -_08165DC8: - cmp r0, 0x3 - bne _08165DE8 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gFallarborBattleTentTrainers - str r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r0, =gFallarborBattleTentMons - b _08165DF2 - .pool -_08165DE8: - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons -_08165DF2: - str r0, [r1] - bl sub_8165CB4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1D - bhi _08165E02 - movs r0, 0x1E -_08165E02: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8165D78 - - thumb_func_start sub_8165E18 -sub_8165E18: @ 8165E18 - push {r4,r5,lr} - ldr r5, =gSaveBlock2Ptr -_08165E1C: - bl sub_8165D40 - lsls r0, 16 - lsrs r4, r0, 16 - movs r3, 0 - ldr r1, [r5] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r3, r0 - bge _08165E58 - adds r2, 0x2 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, r4 - beq _08165E58 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - subs r2, 0x2 - adds r0, r1, r2 - ldrh r2, [r0] - ldr r0, =0x00000cb4 - adds r1, r0 -_08165E4A: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, r2 - bge _08165E58 - ldrh r0, [r1] - cmp r0, r4 - bne _08165E4A -_08165E58: - ldr r0, [r5] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r3, r0 - bne _08165E1C - ldr r5, =gUnknown_02038BCA - strh r4, [r5] - ldrh r0, [r5] - movs r1, 0 - bl sub_8162614 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r2, [r0] - adds r0, r2, 0x1 - cmp r0, 0x2 - bgt _08165E8C - lsls r0, r2, 1 - ldr r2, =0x00000cb4 - adds r1, r2 - adds r1, r0 - ldrh r0, [r5] - strh r0, [r1] -_08165E8C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8165E18 - - thumb_func_start sub_8165EA4 -sub_8165EA4: @ 8165EA4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x38 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x18] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x1C] - bl sub_8165D78 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x20] - ldr r0, =gUnknown_02038BCA - ldrh r2, [r0] - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r2 - adds r0, r1 - ldr r0, [r0, 0x30] - str r0, [sp, 0x28] - movs r0, 0 - str r0, [sp, 0x24] - ldr r2, [sp, 0x28] - ldrh r1, [r2] - b _08165EFE - .pool -_08165EEC: - ldr r0, [sp, 0x24] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x24] - lsls r0, 1 - ldr r6, [sp, 0x28] - adds r0, r6 - ldrh r1, [r0] -_08165EFE: - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08165EEC - movs r0, 0 - mov r8, r0 - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x2C] - b _08166092 - .pool -_08165F24: - bl Random - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp, 0x24] - bl __modsi3 - lsls r0, 1 - ldr r2, [sp, 0x28] - adds r0, r2 - ldrh r4, [r0] - movs r6, 0 - ldr r7, [sp, 0x18] - add r7, r8 - b _08165F44 -_08165F42: - adds r6, 0x1 -_08165F44: - cmp r6, r7 - bge _08165F68 - movs r1, 0x64 - adds r0, r6, 0 - muls r0, r1 - ldr r2, =gEnemyParty - adds r0, r2 - movs r1, 0xB - movs r2, 0 - bl GetMonData - ldr r1, =gUnknown_0203BC8C - ldr r2, [r1] - lsls r1, r4, 4 - adds r1, r2 - ldrh r1, [r1] - cmp r0, r1 - bne _08165F42 -_08165F68: - cmp r6, r7 - beq _08165F6E - b _08166092 -_08165F6E: - movs r6, 0 - cmp r6, r7 - bge _08165FB8 - ldr r0, =gBattleFrontierHeldItems - mov r9, r0 - movs r3, 0 -_08165F7A: - ldr r1, =gEnemyParty - adds r5, r3, r1 - adds r0, r5, 0 - movs r1, 0xC - movs r2, 0 - str r3, [sp, 0x34] - bl GetMonData - ldr r3, [sp, 0x34] - cmp r0, 0 - beq _08165FB0 - adds r0, r5, 0 - movs r1, 0xC - movs r2, 0 - bl GetMonData - ldr r1, =gUnknown_0203BC8C - ldr r2, [r1] - lsls r1, r4, 4 - adds r1, r2 - ldrb r1, [r1, 0xA] - lsls r1, 1 - add r1, r9 - ldr r3, [sp, 0x34] - ldrh r1, [r1] - cmp r0, r1 - beq _08165FB8 -_08165FB0: - adds r3, 0x64 - adds r6, 0x1 - cmp r6, r7 - blt _08165F7A -_08165FB8: - cmp r6, r7 - bne _08166092 - movs r6, 0 - cmp r6, r8 - bge _08165FDA - add r0, sp, 0xC - ldrh r0, [r0] - cmp r0, r4 - beq _08165FDA - add r1, sp, 0xC -_08165FCC: - adds r1, 0x2 - adds r6, 0x1 - cmp r6, r8 - bge _08165FDA - ldrh r0, [r1] - cmp r0, r4 - bne _08165FCC -_08165FDA: - cmp r6, r8 - bne _08166092 - mov r2, r8 - lsls r0, r2, 1 - add r0, sp - adds r0, 0xC - strh r4, [r0] - movs r6, 0x64 - adds r0, r7, 0 - muls r0, r6 - ldr r1, =gEnemyParty - adds r0, r1 - ldr r5, =gUnknown_0203BC8C - ldr r2, [r5] - lsls r4, 4 - adds r2, r4, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - movs r6, 0 - str r6, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - ldr r2, [sp, 0x2C] - str r2, [sp, 0x8] - ldr r2, [sp, 0x20] - bl sub_8068634 - add r1, sp, 0x14 - movs r0, 0xFF - strb r0, [r1] - mov r9, r4 - mov r0, r8 - adds r0, 0x1 - str r0, [sp, 0x30] - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - mov r8, r1 - adds r3, r5, 0 - mov r5, r9 - ldr r2, =gEnemyParty - mov r10, r2 -_0816602E: - ldr r0, [r3] - adds r0, r5, r0 - lsls r4, r6, 1 - adds r0, 0x2 - adds r0, r4 - ldrh r1, [r0] - lsls r2, r6, 24 - lsrs r2, 24 - mov r0, r8 - add r0, r10 - str r3, [sp, 0x34] - bl sub_80691F4 - ldr r3, [sp, 0x34] - ldr r0, [r3] - adds r0, r5, r0 - adds r0, 0x2 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0xDA - bne _0816605E - movs r0, 0 - mov r1, sp - strb r0, [r1, 0x14] -_0816605E: - adds r6, 0x1 - cmp r6, 0x3 - ble _0816602E - movs r2, 0x64 - adds r4, r7, 0 - muls r4, r2 - ldr r6, =gEnemyParty - adds r4, r6 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0x14 - bl SetMonData - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - add r0, r9 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - ldr r0, [sp, 0x30] - mov r8, r0 -_08166092: - ldr r1, [sp, 0x1C] - cmp r8, r1 - beq _0816609A - b _08165F24 -_0816609A: - add sp, 0x38 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8165EA4 - - thumb_func_start sub_81660B8 -sub_81660B8: @ 81660B8 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =gUnknown_085DCEDC - ldrb r0, [r3] - cmp r0, r2 - beq _081660DA -_081660C8: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1D - bhi _081660DA - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081660C8 -_081660DA: - cmp r1, 0x1E - beq _081660EC - ldr r0, =gUnknown_085DCF0E - b _08166116 - .pool -_081660EC: - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _08166108 -_081660F6: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x13 - bhi _08166108 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081660F6 -_08166108: - cmp r1, 0x14 - bne _08166114 - movs r0, 0x7 - b _0816611A - .pool -_08166114: - ldr r0, =gUnknown_085DCF2C -_08166116: - adds r0, r1, r0 - ldrb r0, [r0] -_0816611A: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81660B8 - - thumb_func_start sub_8166124 -sub_8166124: @ 8166124 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =gSaveBlock2Ptr - movs r0, 0xEC - muls r0, r6 - movs r1, 0xE7 - lsls r1, 3 - adds r0, r1 - ldr r1, [r2] - movs r5, 0 - movs r4, 0 - movs r3, 0 - adds r1, r0 -_08166140: - ldm r1!, {r0} - adds r5, r0 - orrs r4, r0 - adds r3, 0x1 - cmp r3, 0x39 - bls _08166140 - cmp r5, 0 - bne _08166154 - cmp r4, 0 - beq _08166180 -_08166154: - ldr r2, [r2] - movs r0, 0xEC - adds r1, r6, 0 - muls r1, r0 - movs r3, 0x82 - lsls r3, 4 - adds r0, r2, r3 - adds r0, r1 - ldr r0, [r0] - cmp r0, r5 - bne _08166174 - movs r0, 0x1 - b _08166182 - .pool -_08166174: - movs r3, 0xE7 - lsls r3, 3 - adds r0, r1, r3 - adds r0, r2, r0 - bl sub_8164FB8 -_08166180: - movs r0, 0 -_08166182: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8166124 - - thumb_func_start sub_8166188 -sub_8166188: @ 8166188 - push {r4-r7,lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _081661E8 - bl sub_8165C40 - lsls r0, 24 - movs r5, 0 - ldr r7, =gBaseStats - lsrs r0, 22 - ldr r1, =gExperienceTables - adds r6, r0, r1 -_081661A6: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gEnemyParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - cmp r1, 0 - beq _081661E2 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r7 - ldrb r1, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - adds r2, r1, 0 - muls r2, r0 - adds r2, r6 - adds r0, r4, 0 - movs r1, 0x19 - bl SetMonData - adds r0, r4, 0 - bl pokemon_calc_effective_stats -_081661E2: - adds r5, 0x1 - cmp r5, 0x5 - ble _081661A6 -_081661E8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166188 - - thumb_func_start sub_8166204 -sub_8166204: @ 8166204 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - ldr r4, =gUnknown_0203BCAC - ldr r0, =0x0000806c - bl AllocZeroed - str r0, [r4] - ldr r1, =gUnknown_0203BC90 - ldr r2, =0x00007fd0 - adds r0, r2 - str r0, [r1] - str r5, [r0, 0x8] - str r6, [r0, 0x4] - ldr r0, =sub_8166380 - bl launch_c3_walk_stairs_and_run_once - ldr r0, =sub_816631C - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166204 - - thumb_func_start sub_816624C -sub_816624C: @ 816624C - push {r4,r5,lr} - ldr r4, =gUnknown_0203BCAC - ldr r0, =0x0000806c - bl AllocZeroed - str r0, [r4] - ldr r5, =gUnknown_0203BC90 - ldr r1, =0x00007fd0 - adds r0, r1 - str r0, [r5] - ldr r1, =gUnknown_0203BC98 - ldr r1, [r1] - str r1, [r0, 0x8] - ldr r1, =gUnknown_0203BC94 - ldr r1, [r1] - str r1, [r0, 0x4] - ldr r4, =gUnknown_0203BC9C - ldrb r0, [r4] - bl sub_81672E4 - strb r0, [r4] - ldr r5, [r5] - movs r1, 0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _08166284 - movs r1, 0x1 -_08166284: - adds r0, r5, 0 - adds r0, 0x56 - strb r1, [r0] - ldr r0, =sub_8166380 - bl launch_c3_walk_stairs_and_run_once - ldr r0, =sub_81662C0 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816624C - - thumb_func_start sub_81662C0 -sub_81662C0: @ 81662C0 - push {r4,lr} - ldr r4, =gUnknown_0203BC90 - ldr r0, [r4] - ldr r0, [r0] - bl _call_via_r0 - bl AnimateSprites - bl BuildOamBuffer - bl UpdatePaletteFade - ldr r4, [r4] - ldr r1, [r4] - ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive - cmp r1, r0 - bne _081662F0 - adds r0, r4, 0 - adds r0, 0x50 - movs r1, 0 - strb r1, [r0] - ldr r0, =sub_8166304 - bl SetMainCallback2 -_081662F0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81662C0 - - thumb_func_start sub_8166304 -sub_8166304: @ 8166304 - push {lr} - bl sub_81668F8 - bl AnimateSprites - bl BuildOamBuffer - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_8166304 - - thumb_func_start sub_816631C -sub_816631C: @ 816631C - push {lr} - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - ldr r0, [r0] - bl _call_via_r0 - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - pop {r0} - bx r0 - .pool - thumb_func_end sub_816631C - - thumb_func_start sub_8166340 -sub_8166340: @ 8166340 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007c58 - adds r0, r1 - bl sub_81D2108 - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166340 - - thumb_func_start launch_c3_walk_stairs_and_run_once -launch_c3_walk_stairs_and_run_once: @ 816636C - ldr r1, =gUnknown_0203BC90 - ldr r1, [r1] - str r0, [r1] - adds r1, 0x50 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end launch_c3_walk_stairs_and_run_once - - thumb_func_start sub_8166380 -sub_8166380: @ 8166380 - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =gUnknown_0203BC90 - ldr r0, [r1] - adds r0, 0x50 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xF - bls _08166394 - b _08166556 -_08166394: - lsls r0, 2 - ldr r1, =_081663A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081663A8: - .4byte _081663E8 - .4byte _0816640C - .4byte _08166416 - .4byte _08166434 - .4byte _08166464 - .4byte _08166468 - .4byte _08166474 - .4byte _08166484 - .4byte _08166490 - .4byte _0816649C - .4byte _081664B8 - .4byte _081664BC - .4byte _081664E4 - .4byte _08166510 - .4byte _08166528 - .4byte _08166550 -_081663E8: - ldr r2, =gUnknown_0203BCAC - ldr r0, [r2] - ldr r1, =0x00007b10 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x00007c58 - adds r0, r2 - bl sub_81D1ED4 - b _0816653C - .pool -_0816640C: - bl ResetSpriteData - bl FreeAllSpritePalettes - b _0816653C -_08166416: - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - str r0, [sp] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - mov r0, sp - bl CpuSet - b _0816653C - .pool -_08166434: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085DFCCC - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_085DFCDC - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0x97 - movs r2, 0xE0 - bl sub_809882C - b _0816653C - .pool -_08166464: - ldr r1, [r2] - b _08166540 -_08166468: - bl sub_8168328 - lsls r0, 24 - cmp r0, 0 - bne _08166556 - b _0816653C -_08166474: - ldr r1, =gKeyRepeatStartDelay - movs r0, 0x14 - strh r0, [r1] - bl sub_8167420 - b _0816653C - .pool -_08166484: - bl sub_8167930 - lsls r0, 24 - cmp r0, 0 - bne _08166556 - b _0816653C -_08166490: - movs r0, 0 - bl sub_8167608 - bl sub_8167760 - b _0816653C -_0816649C: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b0e - adds r0, r1 - bl sub_81D312C - lsls r0, 24 - cmp r0, 0 - bne _08166556 - b _0816653C - .pool -_081664B8: - ldr r1, [r2] - b _08166540 -_081664BC: - ldr r5, =gUnknown_0203BCAC - ldr r1, [r5] - ldr r4, =0x00007c58 - adds r0, r1, r4 - ldr r2, =0x00007c6c - adds r1, r2 - bl sub_81D2754 - ldr r0, [r5] - adds r0, r4 - bl sub_81D20AC - b _0816653C - .pool -_081664E4: - ldr r4, =gUnknown_0203BCAC - ldr r0, [r4] - ldr r1, =0x00007c58 - adds r0, r1 - bl sub_81D20BC - lsls r0, 24 - cmp r0, 0 - bne _08166556 - ldr r2, [r4] - ldr r1, =0x00007c58 - adds r0, r2, r1 - adds r1, 0x14 - adds r2, r1 - adds r1, r2, 0 - bl sub_81D1F84 - b _0816653C - .pool -_08166510: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00007c58 - adds r0, r2 - bl sub_81D2230 - b _0816653C - .pool -_08166528: - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x1 - bl sub_8167BA0 -_0816653C: - ldr r0, =gUnknown_0203BC90 - ldr r1, [r0] -_08166540: - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166556 - .pool -_08166550: - ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive - bl launch_c3_walk_stairs_and_run_once -_08166556: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166380 - - thumb_func_start map_warp_consider_1_to_outside_or_stair_or_dive -map_warp_consider_1_to_outside_or_stair_or_dive: @ 8166564 - push {r4,lr} - sub sp, 0x4 - ldr r4, =gUnknown_0203BC90 - ldr r0, [r4] - adds r0, 0x50 - ldrb r1, [r0] - cmp r1, 0 - beq _08166580 - cmp r1, 0x1 - beq _081665C0 - b _08166610 - .pool -_08166580: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r0, =sub_8166340 - bl SetVBlankCallback - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r1, [r4] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166610 - .pool -_081665C0: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08166610 - ldr r4, =gUnknown_0203BCAC - ldr r0, [r4] - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D3464 - ldr r4, [r4] - ldr r2, =0x00008041 - adds r0, r4, r2 - ldrb r1, [r0] - ldr r3, =0x00008040 - adds r0, r4, r3 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _0816660A - ldr r1, =0x00007fb3 - adds r0, r4, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r2, 0x91 - adds r0, r4, r2 - adds r0, r1 - ldrb r2, [r0] - ldr r3, =0x00007b1c - adds r0, r4, r3 - subs r3, 0xC - adds r1, r4, r3 - ldrb r1, [r1] - bl sub_81D3480 -_0816660A: - ldr r0, =sub_8166634 - bl launch_c3_walk_stairs_and_run_once -_08166610: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end map_warp_consider_1_to_outside_or_stair_or_dive - - thumb_func_start sub_8166634 -sub_8166634: @ 8166634 - push {lr} - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - ldrb r0, [r0] - cmp r0, 0x7 - bls _08166644 - b _0816680E -_08166644: - lsls r0, 2 - ldr r1, =_08166658 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08166658: - .4byte _08166678 - .4byte _0816675C - .4byte _0816680E - .4byte _08166788 - .4byte _0816680E - .4byte _08166794 - .4byte _081667AC - .4byte _081667F4 -_08166678: - ldr r2, =gMain - ldrh r1, [r2, 0x2C] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081666B8 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl sub_8167CA0 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D3520 - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x1 - b _0816680C - .pool -_081666B8: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081666F0 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - bl sub_8167CA0 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00007b1c - adds r0, r2 - bl sub_81D3520 - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x1 - b _0816680C - .pool -_081666F0: - ldrh r1, [r2, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08166710 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x3 - b _0816680C - .pool -_08166710: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0816671A - b _0816680E -_0816671A: - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00008041 - adds r1, r0, r2 - ldrb r1, [r1] - subs r2, 0x1 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _0816674C - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x3 - b _0816680C - .pool -_0816674C: - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x5 - b _0816680C - .pool -_0816675C: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00008044 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0816680E - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - b _0816680C - .pool -_08166788: - ldr r0, =sub_8166BEC - bl launch_c3_walk_stairs_and_run_once - b _0816680E - .pool -_08166794: - bl sub_8166D44 - ldr r0, =gUnknown_0203BC90 - ldr r1, [r0] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0816680E - .pool -_081667AC: - bl sub_8166DE4 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081667CC - cmp r1, 0 - bgt _081667C6 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08166804 - b _0816680E -_081667C6: - cmp r1, 0x1 - bne _0816680E - b _08166804 -_081667CC: - bl sub_8167268 - lsls r0, 24 - cmp r0, 0 - beq _081667E8 - bl sub_8166F50 - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x7 - b _0816680C - .pool -_081667E8: - ldr r0, =sub_816681C - bl launch_c3_walk_stairs_and_run_once - b _0816680E - .pool -_081667F4: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _0816680E - bl sub_8166F94 -_08166804: - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0 -_0816680C: - strb r1, [r0] -_0816680E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166634 - - thumb_func_start sub_816681C -sub_816681C: @ 816681C - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =gUnknown_0203BC90 - ldr r0, [r5] - adds r0, 0x50 - ldrb r4, [r0] - cmp r4, 0 - beq _08166838 - cmp r4, 0x1 - beq _08166888 - b _081668D4 - .pool -_08166838: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00008041 - adds r0, r1 - ldrb r0, [r0] - bl sub_81672A4 - ldr r1, =gUnknown_0203BC9C - strb r0, [r1] - ldr r1, =gUnknown_0203BC94 - ldr r2, [r5] - ldr r0, [r2, 0x4] - str r0, [r1] - ldr r1, =gUnknown_0203BC98 - ldr r0, [r2, 0x8] - str r0, [r1] - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, [r5] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081668D4 - .pool -_08166888: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081668D4 - movs r0, 0 - bl SetVBlankCallback - ldr r4, =gUnknown_0203BCA0 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203BCA4 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203BCA8 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203BCAC - ldr r0, [r4] - bl Free - str r5, [r4] - bl FreeAllWindowBuffers - ldr r1, =gMain - ldr r0, =sub_816624C - str r0, [r1, 0x8] - bl sub_8179D70 -_081668D4: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816681C - - thumb_func_start sub_81668F8 -sub_81668F8: @ 81668F8 - push {r4,lr} - sub sp, 0x4 - ldr r1, =gUnknown_0203BC90 - ldr r0, [r1] - adds r0, 0x50 - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0x6 - bls _0816690C - b _08166A18 -_0816690C: - lsls r0, 2 - ldr r1, =_08166920 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08166920: - .4byte _0816693C - .4byte _08166972 - .4byte _08166A18 - .4byte _081669A0 - .4byte _081669AE - .4byte _081669C8 - .4byte _081669F4 -_0816693C: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00008041 - adds r0, r1 - ldr r1, =gUnknown_0203BC9C - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _08166968 - ldr r0, [r4] - adds r0, 0x56 - ldrb r0, [r0] - bl sub_8167CA0 - ldr r1, [r4] - b _081669E2 - .pool -_08166968: - ldr r0, [r4] - adds r0, 0x50 - movs r1, 0x3 - strb r1, [r0] - b _08166A18 -_08166972: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00008044 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08166A18 - ldr r0, =gUnknown_0203BC90 - ldr r0, [r0] - adds r0, 0x50 - strb r1, [r0] - b _08166A18 - .pool -_081669A0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - b _081669DE -_081669AE: - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x2 - bl ShowBg - b _081669DE -_081669C8: - ldr r0, =sub_8166340 - bl SetVBlankCallback - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade -_081669DE: - ldr r0, =gUnknown_0203BC90 - ldr r1, [r0] -_081669E2: - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166A18 - .pool -_081669F4: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08166A18 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D3464 - ldr r0, =sub_8166A34 - bl launch_c3_walk_stairs_and_run_once - ldr r0, =sub_816631C - bl SetMainCallback2 -_08166A18: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81668F8 - - thumb_func_start sub_8166A34 -sub_8166A34: @ 8166A34 - push {r4-r6,lr} - ldr r1, =gUnknown_0203BC90 - ldr r0, [r1] - adds r0, 0x50 - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0x5 - bls _08166A46 - b _08166BDA -_08166A46: - lsls r0, 2 - ldr r1, =_08166A58 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08166A58: - .4byte _08166A70 - .4byte _08166AAC - .4byte _08166AC0 - .4byte _08166B14 - .4byte _08166B94 - .4byte _08166BB6 -_08166A70: - ldr r4, [r5] - ldr r3, =gPlayerParty - str r3, [r4, 0xC] - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00008041 - adds r1, r0, r2 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0, r1 - subs r2, 0x88 - adds r1, r2 - ldrb r2, [r1] - movs r1, 0x64 - muls r1, r2 - adds r1, r3 - str r1, [r4, 0xC] - ldr r3, =0x00007b1c - adds r0, r3 - bl sub_81D3520 - b _08166BAA - .pool -_08166AAC: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08166ABA - b _08166BDA -_08166ABA: - b _08166BAA - .pool -_08166AC0: - bl sub_8167104 - ldr r6, =gUnknown_0203BC90 - ldr r0, [r6] - adds r0, 0x5C - ldr r4, =gUnknown_0203BCAC - ldr r1, [r4] - ldr r5, =0x00007ca8 - adds r1, r5 - bl sub_81D2754 - ldr r2, [r4] - ldr r4, =0x00007c58 - adds r0, r2, r4 - ldr r3, =0x00007fb3 - adds r1, r2, r3 - movs r3, 0 - ldrsb r3, [r1, r3] - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 - adds r4, 0x14 - adds r1, r4 - adds r1, r2, r1 - adds r2, r5 - bl sub_81D1F84 - bl sub_8167338 - ldr r1, [r6] - b _08166BAC - .pool -_08166B14: - ldr r5, =gUnknown_0203BCAC - ldr r0, [r5] - ldr r1, =0x00007c58 - adds r0, r1 - bl sub_81D2074 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08166BDA - ldr r0, [r5] - ldr r4, =0x00008041 - adds r0, r4 - ldrb r0, [r0] - bl sub_81672A4 - lsls r0, 24 - lsrs r0, 24 - bl sub_81681F4 - ldr r3, [r5] - adds r4, r3, r4 - ldrb r1, [r4] - ldr r2, =0x00008040 - adds r0, r3, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _08166B6C - ldr r4, =0x00007fb3 - adds r0, r3, r4 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r2, 0x90 - adds r0, r3, r2 - adds r0, r1 - ldrb r2, [r0] - ldr r4, =0x00007b1c - adds r0, r3, r4 - subs r4, 0xC - adds r1, r3, r4 - ldrb r1, [r1] - bl sub_81D3480 -_08166B6C: - ldr r1, =gUnknown_0203BC90 - ldr r0, [r1] - adds r0, 0x52 - strb r6, [r0] - ldr r1, [r1] - b _08166BAC - .pool -_08166B94: - ldr r1, [r5] - adds r1, 0x52 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - bls _08166BDA - bl sub_8166E24 -_08166BAA: - ldr r1, [r5] -_08166BAC: - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166BDA -_08166BB6: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08166BDA - bl sub_8166EDC - lsls r0, 24 - cmp r0, 0 - bne _08166BDA - ldr r0, =gUnknown_0203CE7C - ldrb r0, [r0] - bl sub_8136F68 - ldr r0, =sub_8166BEC - bl launch_c3_walk_stairs_and_run_once -_08166BDA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166A34 - - thumb_func_start sub_8166BEC -sub_8166BEC: @ 8166BEC - push {r4-r6,lr} - sub sp, 0x4 - ldr r4, =gUnknown_0203BC90 - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0x50 - ldrb r1, [r2] - cmp r1, 0x1 - beq _08166C28 - cmp r1, 0x1 - bgt _08166C0C - cmp r1, 0 - beq _08166C16 - b _08166D18 - .pool -_08166C0C: - cmp r1, 0x2 - beq _08166C40 - cmp r1, 0x3 - beq _08166C5C - b _08166D18 -_08166C16: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _08166C4A -_08166C28: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08166D18 - movs r0, 0x2 - strb r0, [r2] - b _08166D18 - .pool -_08166C40: - ldr r1, =gUnknown_02039B28 - movs r0, 0x3 - strb r0, [r1, 0x15] - bl sub_80BA0A8 -_08166C4A: - ldr r1, [r4] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166D18 - .pool -_08166C5C: - ldr r0, [r0, 0x4] - bl SetMainCallback2 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D354C - movs r4, 0 -_08166C70: - ldr r5, =gUnknown_0203BCAC - ldr r0, [r5] - ldr r2, =0x00007b06 - adds r0, r2 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _08166C70 - movs r0, 0 - bl FreeSpriteTilesByTag - movs r0, 0x1 - bl FreeSpriteTilesByTag - movs r0, 0 - bl FreeSpritePaletteByTag - movs r0, 0x1 - bl FreeSpritePaletteByTag - movs r4, 0 -_08166CAE: - ldr r0, [r5] - lsls r1, r4, 2 - ldr r2, =0x00007b44 - adds r0, r2 - adds r0, r1 - ldr r0, [r0] - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _08166CAE - ldr r6, =gUnknown_0203BCAC - ldr r0, [r6] - ldr r2, =0x00007b10 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08166CE6 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite -_08166CE6: - movs r0, 0 - bl SetVBlankCallback - ldr r4, =gUnknown_0203BCA0 - ldr r0, [r4] - bl Free - movs r5, 0 - str r5, [r4] - ldr r4, =gUnknown_0203BCA4 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203BCA8 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r0, [r6] - bl Free - str r5, [r6] - bl FreeAllWindowBuffers -_08166D18: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166BEC - - thumb_func_start sub_8166D44 -sub_8166D44: @ 8166D44 - push {r4,lr} - sub sp, 0x4C - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00008041 - adds r0, r1 - ldrb r0, [r0] - bl sub_81672A4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - add r2, sp, 0xC - bl GetMonData - add r0, sp, 0xC - bl StringGetEnd10 - ldr r1, =gUnknown_085EC7A0 - add r0, sp, 0xC - bl StringAppend - ldr r4, =gStringVar4 - adds r0, r4, 0 - add r1, sp, 0xC - bl StringCopy - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x2 - movs r1, 0x97 - movs r2, 0xE - bl sub_8098858 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =gUnknown_085DFCFC - movs r1, 0x97 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - add sp, 0x4C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166D44 - - thumb_func_start sub_8166DE4 -sub_8166DE4: @ 8166DE4 - push {r4,lr} - bl sub_8198C58 - lsls r0, 24 - lsrs r4, r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _08166E18 - cmp r1, 0 - bgt _08166E02 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08166E06 - b _08166E18 -_08166E02: - cmp r1, 0x1 - bne _08166E18 -_08166E06: - movs r0, 0x5 - bl PlaySE - movs r0, 0x2 - bl rbox_fill_rectangle - movs r0, 0x2 - bl ClearWindowTilemap -_08166E18: - lsls r0, r4, 24 - asrs r0, 24 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8166DE4 - - thumb_func_start sub_8166E24 -sub_8166E24: @ 8166E24 - push {r4,lr} - movs r0, 0x2 - movs r1, 0x97 - movs r2, 0xE - bl sub_8098858 - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r3, =gUnknown_0203BC90 - ldr r0, [r3] - adds r0, 0x53 - movs r1, 0 - strb r1, [r0] - ldr r2, [r3] - adds r1, r2, 0 - adds r1, 0x53 - ldrb r0, [r1] - cmp r0, 0x4 - bhi _08166EA8 - adds r0, r2, 0 - adds r0, 0x61 - ldrb r1, [r1] - adds r0, r1 - ldrb r0, [r0] - adds r4, r3, 0 - cmp r0, 0 - bne _08166E84 - adds r2, r4, 0 -_08166E60: - ldr r0, [r2] - adds r0, 0x53 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r3, [r2] - adds r1, r3, 0 - adds r1, 0x53 - ldrb r0, [r1] - cmp r0, 0x4 - bhi _08166EA8 - adds r0, r3, 0 - adds r0, 0x61 - ldrb r1, [r1] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08166E60 -_08166E84: - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0x53 - ldrb r0, [r1] - cmp r0, 0x4 - bhi _08166EA8 - ldr r0, =gStringVar4 - ldrb r1, [r1] - adds r2, 0x61 - adds r2, r1 - ldrb r2, [r2] - bl sub_8166FD4 - b _08166EB8 - .pool -_08166EA8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_0203BC90 - ldr r1, [r1] - adds r1, 0x53 - ldrb r1, [r1] - movs r2, 0 - bl sub_8166FD4 -_08166EB8: - ldr r0, =gStringVar4 - bl sub_8166FB0 - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166E24 - - thumb_func_start sub_8166EDC -sub_8166EDC: @ 8166EDC - push {r4,r5,lr} - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_0203BC90 - adds r3, r5, 0 - movs r4, 0x5 -_08166EEC: - ldr r0, [r3] - adds r0, 0x53 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r2, [r3] - adds r1, r2, 0 - adds r1, 0x53 - ldrb r0, [r1] - cmp r0, 0x4 - bhi _08166F18 - adds r0, r2, 0 - adds r0, 0x61 - ldrb r1, [r1] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08166F1E - b _08166EEC - .pool -_08166F18: - strb r4, [r1] - movs r0, 0 - b _08166F44 -_08166F1E: - ldr r4, =gStringVar4 - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0x53 - ldrb r1, [r1] - adds r0, 0x61 - adds r0, r1 - ldrb r2, [r0] - adds r0, r4, 0 - bl sub_8166FD4 - adds r0, r4, 0 - bl sub_8166FB0 - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x1 -_08166F44: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8166EDC - - thumb_func_start sub_8166F50 -sub_8166F50: @ 8166F50 - push {lr} - sub sp, 0xC - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x2 - movs r1, 0x97 - movs r2, 0xE - bl sub_8098858 - ldr r2, =gUnknown_085EC800 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166F50 - - thumb_func_start sub_8166F94 -sub_8166F94: @ 8166F94 - push {lr} - movs r0, 0x2 - bl rbox_fill_rectangle - movs r0, 0x2 - bl ClearWindowTilemap - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_8166F94 - - thumb_func_start sub_8166FB0 -sub_8166FB0: @ 8166FB0 - push {lr} - sub sp, 0xC - ldr r2, =gStringVar4 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0 - bl Print - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166FB0 - - thumb_func_start sub_8166FD4 -sub_8166FD4: @ 8166FD4 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, 16 - lsrs r0, r2, 16 - asrs r2, 16 - cmp r2, 0 - beq _08167010 - cmp r2, 0 - ble _08166FEC - movs r0, 0 -_08166FEC: - lsls r0, 16 - ldr r1, =gUnknown_085DFD04 - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl StringCopy - ldr r1, =gUnknown_085EC7E1 - adds r0, r4, 0 - bl StringAppend - b _08167018 - .pool -_08167010: - ldr r1, =gUnknown_085EC7EF - adds r0, r4, 0 - bl StringCopy -_08167018: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166FD4 - - thumb_func_start sub_8167024 -sub_8167024: @ 8167024 - push {r4-r7,lr} - adds r6, r0, 0 - adds r5, r1, 0 - movs r4, 0 - ldr r7, =gUnknown_085DFCB0 -_0816702E: - lsls r0, r4, 2 - adds r0, r7 - ldr r1, [r0] - adds r0, r6, 0 - bl GetMonData - adds r1, r5, r4 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _0816702E - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167024 - - thumb_func_start sub_8167054 -sub_8167054: @ 8167054 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - mov r8, r0 - adds r5, r1, 0 - adds r0, r5, 0 - movs r1, 0x30 - bl GetMonData - cmp r0, 0xFF - beq _081670F0 - mov r0, r8 - adds r1, r5, 0 - bl sub_8167184 - movs r4, 0 - mov r7, sp -_08167078: - ldr r1, =gUnknown_085DFCB0 - lsls r0, r4, 2 - adds r0, r1 - ldr r6, [r0] - adds r0, r5, 0 - adds r1, r6, 0 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - strb r0, [r7] - ldr r1, =gUnknown_0203BC90 - ldr r1, [r1] - lsls r2, r4, 1 - adds r1, 0x66 - adds r1, r2 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r0, 0 - bge _081670A6 - movs r1, 0 -_081670A6: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _081670B0 - movs r1, 0xFF -_081670B0: - strb r1, [r7] - adds r0, r5, 0 - adds r1, r6, 0 - mov r2, sp - bl SetMonData - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _08167078 - adds r0, r5, 0 - movs r1, 0x30 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - mov r2, r8 - ldrb r2, [r2, 0x6] - adds r1, r0, r2 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _081670E2 - movs r1, 0xFF -_081670E2: - mov r0, sp - strb r1, [r0] - adds r0, r5, 0 - movs r1, 0x30 - mov r2, sp - bl SetMonData -_081670F0: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167054 - - thumb_func_start sub_8167104 -sub_8167104: @ 8167104 - push {r4,r5,lr} - ldr r5, =gPlayerParty - ldr r0, =gUnknown_0203BCAC - ldr r1, [r0] - ldr r2, =0x00008041 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - ldr r0, =0x00007fb9 - adds r1, r0 - ldrb r1, [r1] - movs r0, 0x64 - muls r0, r1 - adds r5, r0, r5 - ldr r4, =gUnknown_0203BC90 - ldr r1, [r4] - adds r1, 0x57 - adds r0, r5, 0 - bl sub_8167024 - ldr r0, [r4] - ldr r0, [r0, 0x8] - adds r1, r5, 0 - bl sub_8167054 - ldr r1, [r4] - adds r1, 0x5C - adds r0, r5, 0 - bl sub_8167024 - movs r3, 0 -_08167144: - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0x61 - adds r2, r3 - adds r1, r0, 0 - adds r1, 0x5C - adds r1, r3 - adds r0, 0x57 - adds r0, r3 - ldrb r1, [r1] - ldrb r0, [r0] - subs r1, r0 - strb r1, [r2] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x4 - bls _08167144 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167104 - - thumb_func_start sub_8167184 -sub_8167184: @ 8167184 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r1 - ldr r1, =gUnknown_0203BC90 - ldr r3, [r1] - ldrb r1, [r0, 0x1] - adds r2, r3, 0 - adds r2, 0x66 - strh r1, [r2] - ldrb r2, [r0, 0x5] - adds r1, r3, 0 - adds r1, 0x68 - strh r2, [r1] - ldrb r1, [r0, 0x4] - adds r2, r3, 0 - adds r2, 0x6A - strh r1, [r2] - ldrb r2, [r0, 0x3] - adds r1, r3, 0 - adds r1, 0x6C - strh r2, [r1] - ldrb r1, [r0, 0x2] - adds r0, r3, 0 - adds r0, 0x6E - strh r1, [r0] - ldr r0, =gUnknown_0203BC9E - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - ble _081671D4 - movs r0, 0x1 - b _081671DA - .pool -_081671D4: - cmp r0, 0 - bge _08167250 - movs r0, 0xFF -_081671DA: - movs r2, 0 - lsls r0, 24 - mov r9, r0 - ldr r0, =gUnknown_0203BC90 - mov r8, r0 -_081671E4: - mov r0, r8 - ldr r1, [r0] - lsls r0, r2, 24 - asrs r6, r0, 24 - lsls r7, r6, 1 - adds r1, 0x66 - adds r1, r7 - movs r2, 0 - ldrsh r4, [r1, r2] - adds r0, r4, 0 - movs r1, 0xA - bl __divsi3 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - movs r1, 0xA - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0816721C - lsls r0, r5, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r5, r0, 24 -_0816721C: - ldr r0, =gUnknown_085DFCC4 - adds r0, r6, r0 - ldrb r1, [r0] - mov r0, r10 - bl sub_806E858 - lsls r0, 24 - asrs r2, r0, 24 - cmp r0, r9 - bne _08167244 - mov r1, r8 - ldr r0, [r1] - adds r0, 0x66 - adds r0, r7 - lsls r1, r5, 24 - asrs r1, 24 - muls r1, r2 - ldrh r2, [r0] - adds r1, r2 - strh r1, [r0] -_08167244: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x4 - ble _081671E4 -_08167250: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167184 - - thumb_func_start sub_8167268 -sub_8167268: @ 8167268 - push {lr} - ldr r0, =gUnknown_0203BCAC - ldr r1, [r0] - ldr r2, =0x00008041 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - subs r2, 0x89 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - movs r2, 0x30 - movs r3, 0 - bl sub_81D2C68 - cmp r0, 0xFF - beq _0816729C - movs r0, 0 - b _0816729E - .pool -_0816729C: - movs r0, 0x1 -_0816729E: - pop {r1} - bx r1 - thumb_func_end sub_8167268 - - thumb_func_start sub_81672A4 -sub_81672A4: @ 81672A4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 -_081672AC: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081672D2 - cmp r5, 0 - bne _081672CC - adds r0, r4, 0 - b _081672DE - .pool -_081672CC: - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_081672D2: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081672AC - movs r0, 0 -_081672DE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81672A4 - - thumb_func_start sub_81672E4 -sub_81672E4: @ 81672E4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - movs r6, 0 - cmp r6, r5 - bcs _08167314 -_081672F2: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _0816730A - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0816730A: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _081672F2 -_08167314: - subs r0, r5, r6 - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81672E4 - - thumb_func_start sub_8167324 -sub_8167324: @ 8167324 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_81672A4 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8167324 - - thumb_func_start sub_8167338 -sub_8167338: @ 8167338 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gUnknown_085DFD18 - bl LoadSpriteSheet - ldr r0, =gUnknown_085DFD20 - bl LoadSpritePalette - ldr r2, =gUnknown_0203BC90 - ldr r0, [r2] - adds r0, 0x54 - movs r1, 0 - strb r1, [r0] - movs r4, 0 - adds r5, r2, 0 - ldr r6, =gUnknown_085DFD28 - adds r0, r6, 0x2 - mov r8, r0 - ldr r7, =gSprites + 0x1C -_08167360: - ldr r0, [r5] - adds r0, 0x61 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _081673AC - lsls r2, r4, 2 - adds r0, r2, r6 - movs r3, 0 - ldrsh r1, [r0, r3] - add r2, r8 - movs r0, 0 - ldrsh r2, [r2, r0] - ldr r0, =gUnknown_085DFD5C - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _081673AC - ldr r0, [r5] - adds r0, 0x61 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _081673A2 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81673DC - str r1, [r0] -_081673A2: - ldr r1, [r5] - adds r1, 0x54 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081673AC: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _08167360 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167338 - - thumb_func_start sub_81673DC -sub_81673DC: @ 81673DC - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x5 - bgt _081673EE - ldrh r0, [r1, 0x26] - subs r0, 0x2 - b _081673F6 -_081673EE: - cmp r0, 0xB - bgt _081673F8 - ldrh r0, [r1, 0x26] - adds r0, 0x2 -_081673F6: - strh r0, [r1, 0x26] -_081673F8: - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - ble _08167418 - adds r0, r1, 0 - bl DestroySprite - ldr r0, =gUnknown_0203BC90 - ldr r1, [r0] - adds r1, 0x54 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_08167418: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81673DC - - thumb_func_start sub_8167420 -sub_8167420: @ 8167420 - push {r4-r6,lr} - movs r4, 0 - movs r5, 0 - ldr r6, =gUnknown_0203BCAC - b _08167472 - .pool -_08167430: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2D - bl GetMonData - adds r3, r0, 0 - cmp r3, 0 - bne _0816746C - ldr r1, [r6] - lsls r2, r5, 2 - adds r1, r2 - ldr r0, =0x00007fb8 - adds r1, r0 - movs r0, 0xE - strb r0, [r1] - ldr r0, [r6] - adds r0, r2 - ldr r1, =0x00007fb9 - adds r0, r1 - strb r4, [r0] - ldr r0, [r6] - adds r0, r2 - ldr r2, =0x00007fba - adds r0, r2 - strh r3, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_0816746C: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_08167472: - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _08167430 - ldr r2, =gUnknown_0203BCAC - ldr r0, [r2] - ldr r1, =0x00008041 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r1, r5, 0x1 - ldr r2, =0x00008040 - adds r0, r2 - strb r1, [r0] - bl sub_81674BC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167420 - - thumb_func_start sub_81674BC -sub_81674BC: @ 81674BC - push {r4,r5,lr} - ldr r4, =gUnknown_0203BCAC - ldr r0, [r4] - ldr r5, =0x00008041 - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl sub_816753C - ldr r0, [r4] - ldr r1, =0x00007fb3 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - ldr r2, =0x00007fb4 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r4] - ldr r1, =0x00007fb5 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r4] - adds r5, r0, r5 - ldrb r3, [r5] - adds r1, r3, 0x1 - adds r2, 0x8C - adds r0, r2 - ldrb r2, [r0] - cmp r1, r2 - blt _08167500 - movs r1, 0 -_08167500: - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r0, 0 - bge _08167510 - subs r0, r2, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_08167510: - adds r0, r1, 0 - movs r1, 0x1 - bl sub_816753C - lsls r0, r4, 16 - asrs r0, 16 - movs r1, 0x2 - bl sub_816753C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81674BC - - thumb_func_start sub_816753C -sub_816753C: @ 816753C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r1, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203BCAC - mov r9, r0 - ldr r1, [r0] - lsls r5, 16 - asrs r0, r5, 14 - adds r0, r1, r0 - ldr r3, =0x00007fb8 - adds r2, r0, r3 - ldrb r7, [r2] - ldr r2, =0x00007fb9 - adds r0, r2 - ldrb r0, [r0] - mov r10, r0 - adds r3, 0x88 - adds r0, r1, r3 - ldrb r6, [r0] - movs r0, 0 - mov r8, r0 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - ldr r2, =0x00007b4d - adds r0, r2 - adds r0, r1, r0 - lsls r2, r4, 6 - ldr r3, =0x00007b95 - adds r2, r3 - adds r1, r2 - lsrs r5, 16 - str r5, [sp] - str r6, [sp, 0x4] - mov r2, r8 - str r2, [sp, 0x8] - adds r2, r7, 0 - mov r3, r10 - bl sub_81D2ED4 - mov r3, r9 - ldr r1, [r3] - ldr r2, =0x00007c58 - adds r0, r1, r2 - ldr r3, =0x00007fb0 - adds r1, r3 - str r5, [sp] - str r4, [sp, 0x4] - str r6, [sp, 0x8] - mov r2, r8 - str r2, [sp, 0xC] - adds r2, r7, 0 - mov r3, r10 - bl sub_81D2F78 - lsls r0, r4, 13 - movs r1, 0xC1 - lsls r1, 2 - adds r0, r1 - mov r3, r9 - ldr r1, [r3] - adds r0, r1, r0 - lsls r4, 7 - adds r4, 0x4 - adds r1, r4 - str r5, [sp] - str r6, [sp, 0x4] - mov r2, r8 - str r2, [sp, 0x8] - adds r2, r7, 0 - mov r3, r10 - bl sub_81D3094 - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816753C - - thumb_func_start sub_8167608 -sub_8167608: @ 8167608 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gUnknown_0203BCAC - ldr r3, [r1] - ldr r0, =0x00007b10 - mov r8, r0 - adds r0, r3, r0 - ldrb r0, [r0] - adds r7, r1, 0 - cmp r0, 0xFF - bne _08167714 - add r5, sp, 0x18 - add r4, sp, 0x20 - adds r0, r5, 0 - mov r1, sp - adds r2, r4, 0 - bl sub_81D31D0 - lsls r0, r6, 13 - movs r1, 0xC1 - lsls r1, 2 - adds r0, r1 - ldr r1, [r7] - adds r0, r1, r0 - str r0, [sp, 0x18] - lsls r0, r6, 7 - adds r0, 0x4 - adds r1, r0 - str r1, [sp, 0x20] - adds r0, r4, 0 - bl LoadSpritePalette - ldr r1, [r7] - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x00007b12 - adds r1, r2 - strh r0, [r1] - adds r0, r5, 0 - bl LoadSpriteSheet - ldr r1, [r7] - ldr r3, =0x00007b14 - adds r1, r3 - strh r0, [r1] - mov r0, sp - movs r1, 0x26 - movs r2, 0x68 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, [r7] - ldr r2, =0x00007b10 - adds r0, r2 - strb r1, [r0] - cmp r1, 0x40 - bne _081676AC - movs r0, 0x64 - bl FreeSpriteTilesByTag - movs r0, 0x64 - bl FreeSpritePaletteByTag - ldr r0, [r7] - add r0, r8 - movs r1, 0xFF - strb r1, [r0] - b _08167742 - .pool -_081676AC: - ldr r0, [r7] - add r0, r8 - strb r1, [r0] - ldr r4, =gSprites - ldr r2, [r7] - mov r0, r8 - adds r3, r2, r0 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_8168168 - str r1, [r0] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - subs r1, 0x22 - strh r1, [r0, 0x26] - ldr r3, =0x00007b18 - adds r1, r2, r3 - subs r3, 0x4 - adds r0, r2, r3 - ldrh r0, [r0] - lsls r0, 5 - ldr r3, =0x06010000 - adds r0, r3 - str r0, [r1] - ldr r0, =0x00007b12 - adds r2, r0 - ldrh r0, [r2] - lsls r0, 4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r2] - b _08167742 - .pool -_08167714: - lsls r1, r6, 13 - movs r0, 0xC1 - lsls r0, 2 - adds r1, r0 - adds r1, r3, r1 - ldr r2, =0x00007b18 - adds r0, r3, r2 - ldr r2, [r0] - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000400 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - lsls r0, r6, 7 - adds r0, 0x4 - adds r0, r3, r0 - ldr r2, =0x00007b12 - adds r1, r3, r2 - ldrh r1, [r1] - movs r2, 0x20 - bl LoadPalette -_08167742: - add sp, 0x28 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167608 - - thumb_func_start sub_8167760 -sub_8167760: @ 8167760 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x60 - add r5, sp, 0x20 - add r4, sp, 0x38 - mov r0, sp - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_81D321C - mov r0, sp - bl LoadSpriteSheets - adds r0, r4, 0 - bl LoadSpritePalettes - movs r4, 0 - ldr r1, =gUnknown_0203BCAC - ldr r0, [r1] - ldr r2, =0x00008040 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - adds r6, r5, 0 - add r2, sp, 0x50 - mov r9, r2 - add r2, sp, 0x58 - mov r10, r2 - cmp r4, r0 - bge _0816781C - adds r5, r1, 0 - ldr r7, =gSprites - movs r0, 0x1C - adds r0, r7 - mov r8, r0 -_081677AC: - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r1, 0x80 - lsls r1, 12 - adds r2, r1 - asrs r2, 16 - adds r0, r6, 0 - movs r1, 0xE2 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _081677FC - ldr r0, [r5] - ldr r2, =0x00007b06 - adds r0, r2 - adds r0, r4 - strb r3, [r0] - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r1, r0, r7 - strh r4, [r1, 0x2E] - add r0, r8 - ldr r1, =sub_8168180 - str r1, [r0] - b _08167808 - .pool -_081677FC: - ldr r0, [r5] - ldr r1, =0x00007b06 - adds r0, r1 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_08167808: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, [r5] - ldr r2, =0x00008040 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r4, r0 - blt _081677AC -_0816781C: - movs r0, 0x67 - strh r0, [r6] - cmp r4, 0x5 - bhi _0816788A - ldr r5, =gUnknown_0203BCAC - ldr r7, =gSprites -_08167828: - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r0, 0x80 - lsls r0, 12 - adds r2, r0 - asrs r2, 16 - adds r0, r6, 0 - movs r1, 0xE6 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _08167874 - ldr r0, [r5] - ldr r1, =0x00007b06 - adds r0, r1 - adds r0, r4 - strb r3, [r0] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x3] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1, 0x3] - b _08167880 - .pool -_08167874: - ldr r0, [r5] - ldr r2, =0x00007b06 - adds r0, r2 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_08167880: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x5 - bls _08167828 -_0816788A: - movs r0, 0x66 - strh r0, [r6] - ldr r0, =sub_81681B4 - str r0, [r6, 0x14] - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r0, 0x80 - lsls r0, 12 - adds r2, r0 - asrs r2, 16 - adds r0, r6, 0 - movs r1, 0xDE - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _081678F4 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b06 - adds r0, r1 - adds r0, r4 - strb r3, [r0] - ldr r0, =gSprites - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r0 - ldrb r3, [r2, 0x1] - movs r1, 0x3F - adds r0, r1, 0 - ands r0, r3 - movs r3, 0x40 - orrs r0, r3 - strb r0, [r2, 0x1] - ldrb r0, [r2, 0x3] - ands r1, r0 - movs r0, 0x80 - orrs r1, r0 - strb r1, [r2, 0x3] - b _08167902 - .pool -_081678F4: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00007b06 - adds r0, r2 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_08167902: - mov r0, r9 - mov r1, r10 - bl sub_81D32B0 - mov r0, r9 - bl LoadSpriteSheet - mov r0, r10 - bl LoadSpritePalette - add sp, 0x60 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167760 - - thumb_func_start sub_8167930 -sub_8167930: @ 8167930 - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00008048 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xB - bls _08167944 - b _08167B78 -_08167944: - lsls r0, 2 - ldr r1, =_0816795C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816795C: - .4byte _0816798C - .4byte _08167A04 - .4byte _08167A38 - .4byte _08167A48 - .4byte _08167A5C - .4byte _08167A74 - .4byte _08167A9C - .4byte _08167AB0 - .4byte _08167AD4 - .4byte _08167AEC - .4byte _08167B1C - .4byte _08167B38 -_0816798C: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r1, 0x88 - lsls r1, 6 - movs r0, 0x3 - movs r2, 0 - bl ChangeBgY - ldr r1, =0x00007040 - movs r0, 0 - bl SetGpuReg - movs r1, 0x91 - lsls r1, 2 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _08167B7E - .pool -_08167A04: - ldr r4, =gUnknown_0203BCA4 - movs r0, 0xD0 - lsls r0, 5 - bl Alloc - str r0, [r4] - ldr r5, =gUnknown_0203BCA0 - movs r4, 0xA0 - lsls r4, 3 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203BCA8 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - b _08167B7E - .pool -_08167A38: - ldr r0, =gUnknown_085DFB60 - ldr r1, =gUnknown_0203BCA8 - b _08167AA0 - .pool -_08167A48: - ldr r1, =gUnknown_085DFA80 - movs r0, 0x3 - movs r2, 0xE0 - movs r3, 0 - bl LoadBgTiles - b _08167B7E - .pool -_08167A5C: - ldr r0, =gUnknown_0203BCA8 - ldr r1, [r0] - movs r2, 0xA0 - lsls r2, 3 - movs r0, 0x3 - movs r3, 0 - bl LoadBgTilemap - b _08167B7E - .pool -_08167A74: - ldr r0, =gUnknown_085DFA60 - movs r1, 0xD0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b0e - adds r0, r1 - ldr r1, =0x0000ffb0 - strh r1, [r0] - b _08167B7E - .pool -_08167A9C: - ldr r0, =gUnknown_08DCCF7C - ldr r1, =gUnknown_0203BCA4 -_08167AA0: - ldr r1, [r1] - bl LZ77UnCompVram - b _08167B7E - .pool -_08167AB0: - ldr r0, =gUnknown_08DCD81C - ldr r1, =gUnknown_0203BCA0 - ldr r1, [r1] - bl LZ77UnCompVram - ldr r0, =gUnknown_08DCCF5C - movs r1, 0x20 - movs r2, 0x20 - bl LoadPalette - b _08167B7E - .pool -_08167AD4: - ldr r0, =gUnknown_0203BCA4 - ldr r1, [r0] - movs r2, 0xD0 - lsls r2, 5 - movs r3, 0xA0 - lsls r3, 2 - movs r0, 0x1 - bl LoadBgTiles - b _08167B7E - .pool -_08167AEC: - ldr r0, =gUnknown_0203BCA0 - ldr r1, [r0] - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_08DCDA30 - movs r0, 0xC - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r2, 0 - movs r3, 0xD - bl CopyToBgTilemapBufferRect - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - b _08167B7E - .pool -_08167B1C: - ldr r0, =gUnknown_085DFC0C - ldr r1, =gUnknown_0203BCAC - ldr r1, [r1] - ldr r2, =0x00007304 - adds r1, r2 - bl LZ77UnCompVram - b _08167B7E - .pool -_08167B38: - ldr r0, =gUnknown_0203BCAC - ldr r1, [r0] - ldr r0, =0x00007304 - adds r1, r0 - movs r2, 0xA0 - lsls r2, 3 - movs r0, 0x2 - movs r3, 0 - bl LoadBgTilemap - ldr r0, =gUnknown_086231E8 - movs r1, 0x30 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_08623208 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - movs r0, 0x2 - bl sub_81D21DC - b _08167B7E - .pool -_08167B78: - movs r0, 0 - strb r0, [r1] - b _08167B8E -_08167B7E: - ldr r0, =gUnknown_0203BCAC - ldr r1, [r0] - ldr r2, =0x00008048 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x1 -_08167B8E: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8167930 - - thumb_func_start sub_8167BA0 -sub_8167BA0: @ 8167BA0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r7, =gUnknown_0203BCAC - ldr r3, [r7] - ldr r1, =0x00008041 - adds r0, r3, r1 - ldrb r1, [r0] - ldr r2, =0x00008040 - adds r0, r3, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _08167C46 - lsls r2, r4, 6 - ldr r0, =0x00007b95 - adds r2, r0 - adds r2, r3, r2 - movs r0, 0x1 - str r0, [sp] - movs r5, 0 - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r7] - ldr r1, =0x00008041 - adds r0, r1 - ldrb r0, [r0] - bl sub_81672A4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - bl GetNature - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, [r7] - ldr r6, =0x0000804a - adds r0, r6 - ldr r1, =gUnknown_085EBF8D - bl StringCopy - ldr r1, =gNatureNamePointers - lsls r4, 2 - adds r4, r1 - ldr r1, [r4] - bl StringCopy - ldr r0, =gUnknown_085DFCC9 - str r0, [sp] - str r5, [sp, 0x4] - ldr r0, [r7] - adds r0, r6 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0x1 - bl box_print -_08167C46: - mov r2, r8 - cmp r2, 0 - beq _08167C84 - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - b _08167C94 - .pool -_08167C84: - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram -_08167C94: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8167BA0 - - thumb_func_start sub_8167CA0 -sub_8167CA0: @ 8167CA0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - beq _08167CC0 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007fb5 - adds r0, r1 - b _08167CC8 - .pool -_08167CC0: - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00007fb4 - adds r0, r2 -_08167CC8: - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r5, =gUnknown_0203BCAC - ldr r2, [r5] - ldr r3, =0x00007c58 - adds r0, r2, r3 - ldr r4, =0x00007fb3 - adds r1, r2, r4 - movs r3, 0 - ldrsb r3, [r1, r3] - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 - ldr r4, =0x00007c6c - adds r1, r4 - adds r1, r2, r1 - lsls r3, r6, 2 - adds r3, r6 - lsls r3, 2 - adds r3, r4 - adds r2, r3 - bl sub_81D1F84 - ldr r4, [r5] - ldr r1, =0x00008041 - adds r0, r4, r1 - ldrb r1, [r0] - ldr r2, =0x00008040 - mov r12, r2 - adds r0, r4, r2 - ldrb r0, [r0] - subs r0, 0x1 - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - mov r8, r0 - cmp r7, 0 - beq _08167D98 - ldr r3, =0x00007fb4 - adds r0, r4, r3 - ldrb r1, [r0] - subs r2, 0x8B - adds r0, r4, r2 - strb r1, [r0] - ldr r0, [r5] - ldr r4, =0x00007fb3 - adds r1, r0, r4 - ldrb r1, [r1] - adds r0, r3 - strb r1, [r0] - ldr r0, [r5] - adds r0, r4 - strb r6, [r0] - ldr r0, [r5] - adds r2, r0, r2 - ldrb r1, [r2] - ldr r2, =0x00007fb6 - adds r0, r2 - strb r1, [r0] - ldr r1, [r5] - adds r3, 0x8D - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _08167D58 - mov r4, r12 - adds r0, r1, r4 - ldrb r0, [r0] -_08167D58: - subs r2, r0, 0x1 - ldr r0, =0x00008041 - adds r1, r0 - strb r2, [r1] - ldr r1, =gUnknown_0203BCAC - ldr r3, [r1] - adds r0, r3, r0 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0 - bne _08167D74 - ldr r1, =0x00008040 - adds r0, r3, r1 - ldrb r0, [r0] -_08167D74: - subs r1, r0, 0x1 - b _08167E1E - .pool -_08167D98: - ldr r3, =0x00007fb5 - adds r0, r4, r3 - ldrb r1, [r0] - ldr r2, =0x00007fb4 - adds r0, r4, r2 - strb r1, [r0] - ldr r0, [r5] - ldr r4, =0x00007fb3 - adds r1, r0, r4 - ldrb r1, [r1] - adds r0, r3 - strb r1, [r0] - ldr r0, [r5] - adds r0, r4 - strb r6, [r0] - ldr r0, [r5] - adds r2, r0, r2 - ldrb r1, [r2] - ldr r2, =0x00007fb6 - adds r0, r2 - strb r1, [r0] - ldr r2, [r5] - adds r3, 0x8C - adds r0, r2, r3 - ldrb r1, [r0] - adds r4, 0x8D - adds r0, r2, r4 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bge _08167DEC - adds r3, r1, 0x1 - b _08167DEE - .pool -_08167DEC: - movs r3, 0 -_08167DEE: - ldr r1, =0x00008041 - adds r0, r2, r1 - strb r3, [r0] - ldr r2, =gUnknown_0203BCAC - ldr r3, [r2] - adds r1, r3, r1 - ldrb r1, [r1] - ldr r4, =0x00008040 - adds r0, r3, r4 - ldrb r0, [r0] - subs r0, 0x1 - adds r6, r2, 0 - cmp r1, r0 - bge _08167E1C - adds r1, 0x1 - b _08167E1E - .pool -_08167E1C: - movs r1, 0 -_08167E1E: - ldr r2, =0x00007b4c - adds r0, r3, r2 - strb r1, [r0] - adds r5, r6, 0 - ldr r0, [r5] - ldr r3, =0x00008041 - adds r1, r0, r3 - ldrb r2, [r1] - ldr r4, =0x00008040 - adds r1, r0, r4 - ldrb r1, [r1] - subs r1, 0x1 - eors r2, r1 - negs r1, r2 - orrs r1, r2 - lsrs r4, r1, 31 - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D3520 - mov r2, r8 - cmp r2, 0 - bne _08167E70 - ldr r0, [r5] - ldr r3, =0x00008044 - adds r0, r3 - ldr r1, =sub_8167EA4 - b _08167E90 - .pool -_08167E70: - cmp r4, 0 - bne _08167E88 - ldr r0, [r5] - ldr r4, =0x00008044 - adds r0, r4 - ldr r1, =sub_8167FA4 - b _08167E90 - .pool -_08167E88: - ldr r0, [r6] - ldr r1, =0x00008044 - adds r0, r1 - ldr r1, =sub_8168048 -_08167E90: - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167CA0 - - thumb_func_start sub_8167EA4 -sub_8167EA4: @ 8167EA4 - push {r4-r6,lr} - ldr r4, =gUnknown_0203BCAC - ldr r1, [r4] - ldr r5, =0x00008048 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08167EE4 - cmp r0, 0x1 - bgt _08167EC8 - cmp r0, 0 - beq _08167ED2 - b _08167F9C - .pool -_08167EC8: - cmp r0, 0x2 - beq _08167F08 - cmp r0, 0x3 - beq _08167F48 - b _08167F9C -_08167ED2: - ldr r2, =0x00007fb3 - adds r0, r1, r2 - ldrb r0, [r0] - bl sub_8167608 - b _08167F2C - .pool -_08167EE4: - ldr r6, =0x00007fb3 - adds r0, r1, r6 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl sub_8167BA0 - ldr r1, [r4] - ldr r0, =0x00008048 - adds r1, r0 - b _08167F30 - .pool -_08167F08: - ldr r2, =0x00007c58 - adds r0, r1, r2 - ldr r6, =0x00007b0e - adds r1, r6 - bl sub_81D3178 - lsls r0, 24 - cmp r0, 0 - bne _08167F9C - ldr r1, [r4] - ldr r2, =0x00007b4c - adds r0, r1, r2 - ldrb r0, [r0] - ldr r6, =0x00007fb6 - adds r1, r6 - ldrb r1, [r1] - bl sub_816753C -_08167F2C: - ldr r1, [r4] - adds r1, r5 -_08167F30: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08167F9C - .pool -_08167F48: - ldr r2, =0x00007b1c - adds r0, r1, r2 - bl sub_81D3464 - ldr r3, [r4] - ldr r6, =0x00008041 - adds r0, r3, r6 - ldrb r1, [r0] - ldr r2, =0x00008040 - adds r0, r3, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _08167F82 - subs r6, 0x8E - adds r0, r3, r6 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r2, 0x90 - adds r0, r3, r2 - adds r0, r1 - ldrb r2, [r0] - ldr r6, =0x00007b1c - adds r0, r3, r6 - subs r6, 0xC - adds r1, r3, r6 - ldrb r1, [r1] - bl sub_81D3480 -_08167F82: - ldr r0, [r4] - adds r0, r5 - movs r1, 0 - strb r1, [r0] - movs r0, 0 - b _08167F9E - .pool -_08167F9C: - movs r0, 0x1 -_08167F9E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8167EA4 - - thumb_func_start sub_8167FA4 -sub_8167FA4: @ 8167FA4 - push {r4,r5,lr} - ldr r4, =gUnknown_0203BCAC - ldr r1, [r4] - ldr r5, =0x00008048 - adds r2, r1, r5 - ldrb r0, [r2] - cmp r0, 0x1 - beq _08167FF0 - cmp r0, 0x1 - bgt _08167FC8 - cmp r0, 0 - beq _08167FD2 - b _0816803E - .pool -_08167FC8: - cmp r0, 0x2 - beq _08168014 - cmp r0, 0x3 - beq _08168038 - b _0816803E -_08167FD2: - ldr r2, =0x00007c58 - adds r0, r1, r2 - ldr r2, =0x00007b0e - adds r1, r2 - bl sub_81D31A4 - lsls r0, 24 - cmp r0, 0 - bne _0816803E - b _08168024 - .pool -_08167FF0: - ldr r2, =0x00007fb3 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl sub_8167BA0 - ldr r1, [r4] - ldr r0, =0x00008048 - adds r1, r0 - b _08168028 - .pool -_08168014: - ldr r2, =0x00007b4c - adds r0, r1, r2 - ldrb r0, [r0] - ldr r2, =0x00007fb6 - adds r1, r2 - ldrb r1, [r1] - bl sub_816753C -_08168024: - ldr r1, [r4] - adds r1, r5 -_08168028: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0816803E - .pool -_08168038: - movs r0, 0 - strb r0, [r2] - b _08168040 -_0816803E: - movs r0, 0x1 -_08168040: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8167FA4 - - thumb_func_start sub_8168048 -sub_8168048: @ 8168048 - push {r4-r6,lr} - ldr r4, =gUnknown_0203BCAC - ldr r1, [r4] - ldr r5, =0x00008048 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081680A8 - cmp r0, 0x1 - bgt _0816806C - cmp r0, 0 - beq _08168076 - b _08168160 - .pool -_0816806C: - cmp r0, 0x2 - beq _081680CC - cmp r0, 0x3 - beq _0816810C - b _08168160 -_08168076: - ldr r2, =0x00007c58 - adds r0, r1, r2 - bl sub_81D2074 - ldr r0, [r4] - ldr r6, =0x00007b0e - adds r0, r6 - bl sub_81D3150 - lsls r0, 24 - cmp r0, 0 - bne _08168160 - ldr r0, [r4] - ldr r1, =0x00007fb3 - adds r0, r1 - ldrb r0, [r0] - bl sub_8167608 - b _081680F0 - .pool -_081680A8: - ldr r2, =0x00007fb3 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl sub_8167BA0 - ldr r1, [r4] - ldr r6, =0x00008048 - adds r1, r6 - b _081680F4 - .pool -_081680CC: - ldr r2, =0x00007c58 - adds r0, r1, r2 - ldr r6, =0x00007b0e - adds r1, r6 - bl sub_81D3178 - lsls r0, 24 - cmp r0, 0 - bne _08168160 - ldr r1, [r4] - ldr r2, =0x00007b4c - adds r0, r1, r2 - ldrb r0, [r0] - ldr r6, =0x00007fb6 - adds r1, r6 - ldrb r1, [r1] - bl sub_816753C -_081680F0: - ldr r1, [r4] - adds r1, r5 -_081680F4: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08168160 - .pool -_0816810C: - ldr r2, =0x00007b1c - adds r0, r1, r2 - bl sub_81D3464 - ldr r3, [r4] - ldr r6, =0x00008041 - adds r0, r3, r6 - ldrb r1, [r0] - ldr r2, =0x00008040 - adds r0, r3, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _08168146 - subs r6, 0x8E - adds r0, r3, r6 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r2, 0x90 - adds r0, r3, r2 - adds r0, r1 - ldrb r2, [r0] - ldr r6, =0x00007b1c - adds r0, r3, r6 - subs r6, 0xC - adds r1, r3, r6 - ldrb r1, [r1] - bl sub_81D3480 -_08168146: - ldr r0, [r4] - adds r0, r5 - movs r1, 0 - strb r1, [r0] - movs r0, 0 - b _08168162 - .pool -_08168160: - movs r0, 0x1 -_08168162: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8168048 - - thumb_func_start sub_8168168 -sub_8168168: @ 8168168 - ldr r1, =gUnknown_0203BCAC - ldr r1, [r1] - ldr r2, =0x00007b0e - adds r1, r2 - ldrh r1, [r1] - adds r1, 0x26 - strh r1, [r0, 0x20] - bx lr - .pool - thumb_func_end sub_8168168 - - thumb_func_start sub_8168180 -sub_8168180: @ 8168180 - push {lr} - adds r2, r0, 0 - movs r0, 0x2E - ldrsh r1, [r2, r0] - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r3, =0x00008041 - adds r0, r3 - ldrb r0, [r0] - cmp r1, r0 - bne _081681A8 - adds r0, r2, 0 - movs r1, 0 - bl StartSpriteAnim - b _081681B0 - .pool -_081681A8: - adds r0, r2, 0 - movs r1, 0x1 - bl StartSpriteAnim -_081681B0: - pop {r0} - bx r0 - thumb_func_end sub_8168180 - - thumb_func_start sub_81681B4 -sub_81681B4: @ 81681B4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r2, =0x00008041 - adds r1, r0, r2 - ldrb r1, [r1] - subs r2, 0x1 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _081681DC - movs r0, 0x65 - b _081681DE - .pool -_081681DC: - movs r0, 0x66 -_081681DE: - bl IndexOfSpritePaletteTag - lsls r0, 4 - ldrb r2, [r4, 0x5] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x5] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81681B4 - - thumb_func_start sub_81681F4 -sub_81681F4: @ 81681F4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x30 - bl GetMonData - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r3, =0x00007fb3 - adds r1, r0, r3 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - subs r3, 0x3 - adds r0, r3 - adds r4, r0, r1 - cmp r2, 0xFF - beq _0816823C - adds r0, r2, 0 - movs r1, 0x1D - bl __udivsi3 - b _0816823E - .pool -_0816823C: - movs r0, 0x9 -_0816823E: - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81681F4 - - thumb_func_start sub_8168248 -sub_8168248: @ 8168248 - push {lr} - sub sp, 0x10 - ldr r0, =gUnknown_085DFDB8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x8] - str r1, [sp, 0xC] - ldr r0, =gUnknown_08DCCBB8 - str r0, [sp] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - movs r1, 0x80 - lsls r1, 4 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - adds r1, 0x1 - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadCompressedObjectPic - add r0, sp, 0x8 - bl LoadSpritePalette - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168248 - - thumb_func_start sub_8168294 -sub_8168294: @ 8168294 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gUnknown_0203BCAC - ldr r0, [r0] - ldr r1, =0x00007b44 - adds r7, r0, r1 - ldr r0, =gUnknown_085DFDA0 - mov r10, r0 - movs r6, 0 - movs r1, 0x40 - mov r9, r1 - movs r0, 0x60 - negs r0, r0 - mov r8, r0 -_081682B6: - mov r5, r9 - muls r5, r6 - mov r0, r8 - adds r1, r0, r5 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x11 - lsls r2, r0, 16 - mov r0, r10 - asrs r2, 16 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _081682FE - ldr r0, =gSprites - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - adds r4, r0 - movs r1, 0x8 - strh r1, [r4, 0x2E] - movs r0, 0x20 - orrs r5, r0 - strh r5, [r4, 0x30] - strh r6, [r4, 0x32] - lsls r1, r6, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartSpriteAnim - lsls r0, r6, 2 - adds r0, r7 - str r4, [r0] -_081682FE: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x1 - bls _081682B6 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168294 - - thumb_func_start sub_8168328 -sub_8168328: @ 8168328 - push {r4,r5,lr} - ldr r4, =gUnknown_0203BCAC - ldr r0, [r4] - ldr r5, =0x00008048 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0 - beq _08168348 - cmp r0, 0x1 - beq _08168360 - b _0816836C - .pool -_08168348: - bl sub_8168248 - ldr r1, [r4] - ldr r0, =0x00008048 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x1 - b _0816836E - .pool -_08168360: - bl sub_8168294 - ldr r0, [r4] - adds r0, r5 - movs r1, 0 - strb r1, [r0] -_0816836C: - movs r0, 0 -_0816836E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8168328 - - thumb_func_start sub_8168374 -sub_8168374: @ 8168374 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x20] - ldrh r1, [r2, 0x2E] - adds r3, r0, r1 - strh r3, [r2, 0x20] - lsls r0, 16 - asrs r4, r0, 16 - movs r0, 0x30 - ldrsh r1, [r2, r0] - cmp r4, r1 - bgt _08168398 - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, r1 - bge _081683A0 - cmp r4, r1 - blt _081683A8 -_08168398: - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, r1 - bgt _081683A8 -_081683A0: - ldrh r0, [r2, 0x30] - strh r0, [r2, 0x20] - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] -_081683A8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168374 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_815A0D4.s b/asm/rom_815A0D4.s new file mode 100644 index 000000000..bd09771b0 --- /dev/null +++ b/asm/rom_815A0D4.s @@ -0,0 +1,14458 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_815A0D4 +sub_815A0D4: @ 815A0D4 + push {lr} + adds r2, r0, 0 + ldr r1, =gBattleAnimArgs + ldrh r0, [r1] + ldrh r3, [r2, 0x20] + adds r0, r3 + strh r0, [r2, 0x20] + ldrh r0, [r1, 0x2] + ldrh r3, [r2, 0x22] + adds r0, r3 + strh r0, [r2, 0x22] + movs r3, 0x6 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _0815A0FC + ldrh r0, [r1, 0x4] + b _0815A100 + .pool +_0815A0FC: + ldrh r0, [r1, 0x4] + negs r0, r0 +_0815A100: + strh r0, [r2, 0x2E] + ldrh r0, [r1, 0x8] + strh r0, [r2, 0x30] + ldr r0, =sub_815A114 + str r0, [r2, 0x1C] + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A0D4 + + thumb_func_start sub_815A114 +sub_815A114: @ 815A114 + push {lr} + adds r3, r0, 0 + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0 + ble _0815A154 + ldrh r1, [r3, 0x32] + lsls r0, r1, 16 + asrs r0, 24 + strh r0, [r3, 0x24] + ldrh r0, [r3, 0x2E] + adds r1, r0 + strh r1, [r3, 0x32] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x30] + subs r0, 0x1 + strh r0, [r3, 0x30] + b _0815A15A +_0815A154: + adds r0, r3, 0 + bl move_anim_8072740 +_0815A15A: + pop {r0} + bx r0 + thumb_func_end sub_815A114 + + thumb_func_start sub_815A160 +sub_815A160: @ 815A160 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =gAnimationBankTarget + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 8 + movs r0, 0x80 + lsls r0, 12 + adds r4, r0 + asrs r4, 16 + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 8 + movs r0, 0x80 + lsls r0, 12 + adds r1, r0 + asrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + bl sub_807521C + adds r0, r5, 0 + bl move_anim_task_del + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A160 + + thumb_func_start sub_815A1B0 +sub_815A1B0: @ 815A1B0 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5A + strh r0, [r4, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] + movs r0, 0x7 + strh r0, [r4, 0x30] + ldr r1, =sub_815A1F4 + adds r0, r4, 0 + bl StoreSpriteCallbackInData6 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldrh r0, [r4, 0x30] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A1B0 + + thumb_func_start sub_815A1F4 +sub_815A1F4: @ 815A1F4 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldrh r0, [r4, 0x30] + subs r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bge _0815A228 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_815A234 + str r0, [r4, 0x1C] +_0815A228: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A1F4 + + thumb_func_start sub_815A234 +sub_815A234: @ 815A234 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815A234 + + thumb_func_start sub_815A254 +sub_815A254: @ 815A254 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r4, =gAnimationBankTarget + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A6980 + ldrh r0, [r5, 0x20] + subs r0, r7 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r5, 0x22] + subs r1, r6 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74F4 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 23 + adds r0, r1 + lsrs r4, r0, 16 + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _0815A2B2 + movs r1, 0x80 + lsls r1, 7 + adds r0, r4, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_0815A2B2: + movs r3, 0x80 + lsls r3, 1 + str r4, [sp] + adds r0, r5, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A73E0 + ldr r0, =gBattleAnimArgs + ldrh r0, [r0, 0x4] + strh r0, [r5, 0x2E] + strh r7, [r5, 0x32] + strh r6, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl StoreSpriteCallbackInData6 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A254 + + thumb_func_start sub_815A2F0 +sub_815A2F0: @ 815A2F0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x4 + strh r0, [r4, 0x2E] + ldr r0, =sub_815A31C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A2F0 + + thumb_func_start sub_815A31C +sub_815A31C: @ 815A31C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815A342 + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + b _0815A346 +_0815A342: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 +_0815A346: + strh r0, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0xF + beq _0815A354 + cmp r0, 0x4 + bne _0815A35C +_0815A354: + ldrh r0, [r4, 0x30] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x30] +_0815A35C: + ldrh r0, [r4, 0x32] + adds r1, r0, 0x1 + strh r1, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x46 + ble _0815A3A0 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAffineAnim + movs r0, 0 + strh r0, [r4, 0x32] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + subs r2, 0x12 + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_815A3AC + str r0, [r4, 0x1C] +_0815A3A0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A31C + + thumb_func_start sub_815A3AC +sub_815A3AC: @ 815A3AC + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x32] + adds r1, r0, 0x1 + strh r1, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _0815A3E8 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + subs r2, 0x12 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + adds r0, r3, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815A3E8 + ldr r0, =sub_815A3F0 + str r0, [r3, 0x1C] +_0815A3E8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A3AC + + thumb_func_start sub_815A3F0 +sub_815A3F0: @ 815A3F0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x6 + bhi _0815A448 + lsls r0, 2 + ldr r1, =_0815A40C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815A40C: + .4byte _0815A428 + .4byte _0815A428 + .4byte _0815A432 + .4byte _0815A432 + .4byte _0815A440 + .4byte _0815A440 + .4byte _0815A448 +_0815A428: + movs r1, 0 + movs r0, 0x1 + strh r0, [r4, 0x24] + strh r1, [r4, 0x26] + b _0815A450 +_0815A432: + ldr r0, =0x0000ffff + strh r0, [r4, 0x24] + movs r0, 0 + b _0815A44E + .pool +_0815A440: + movs r0, 0 + strh r0, [r4, 0x24] + movs r0, 0x1 + b _0815A44E +_0815A448: + movs r0, 0 + strh r0, [r4, 0x24] + ldr r0, =0x0000ffff +_0815A44E: + strh r0, [r4, 0x26] +_0815A450: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0815A462 + strh r2, [r4, 0x34] +_0815A462: + ldrh r0, [r4, 0x36] + adds r1, r0, 0x1 + strh r1, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _0815A48C + movs r0, 0x10 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x30] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldrh r1, [r4, 0x2E] + movs r0, 0x52 + bl SetGpuReg + ldr r0, =sub_815A49C + str r0, [r4, 0x1C] +_0815A48C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A3F0 + + thumb_func_start sub_815A49C +sub_815A49C: @ 815A49C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldrh r0, [r4, 0x30] + adds r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815A4CC + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] +_0815A4CC: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815A4E0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_0815A4E0: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _0815A4FE + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_8072740 +_0815A4FE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815A49C + + thumb_func_start sub_815A504 +sub_815A504: @ 815A504 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_815A52C + str r0, [r1] + ldr r1, =gAnimVisualTaskCount + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_815A504 + + thumb_func_start sub_815A52C +sub_815A52C: @ 815A52C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A6D94 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gTasks + lsls r5, r4, 2 + adds r1, r5, r4 + lsls r1, 3 + adds r1, r7 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815A59C + ldr r0, =gPlttBufferFaded + lsls r2, r6, 4 + adds r1, r2, 0 + adds r1, 0xB + lsls r1, 1 + adds r1, r0 + ldrh r3, [r1] + mov r8, r3 + movs r3, 0xA + mov r9, r7 + adds r7, r5, 0 + mov r12, r0 + adds r5, r2, 0 + lsls r0, r6, 5 + add r0, r12 + adds r2, r0, 0 + adds r2, 0x14 +_0815A57A: + ldrh r0, [r2] + strh r0, [r1] + subs r2, 0x2 + subs r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bgt _0815A57A + adds r0, r5, 0x1 + lsls r0, 1 + add r0, r12 + movs r1, 0 + mov r2, r8 + strh r2, [r0] + adds r0, r7, r4 + lsls r0, 3 + add r0, r9 + strh r1, [r0, 0x12] +_0815A59C: + ldr r0, =gBattleAnimArgs + ldrh r1, [r0, 0xE] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _0815A5AC + adds r0, r4, 0 + bl DestroyTask +_0815A5AC: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A52C + + thumb_func_start c3_80DE6F0 +c3_80DE6F0: @ 815A5C8 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_815A5F0 + str r0, [r1] + ldr r1, =gAnimVisualTaskCount + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end c3_80DE6F0 + + thumb_func_start sub_815A5F0 +sub_815A5F0: @ 815A5F0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl sub_80A6D94 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, =gTasks + mov r0, r8 + lsls r3, r0, 2 + adds r1, r3, r0 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815A692 + ldr r0, =gPlttBufferFaded + lsls r2, r7, 4 + adds r1, r2, 0 + adds r1, 0xB + lsls r1, 1 + adds r1, r0 + ldrh r6, [r1] + movs r4, 0xA + mov r10, r3 + mov r9, r0 + adds r5, r2, 0 + ldr r2, =gPlttBufferUnfaded + mov r12, r2 + lsls r0, r7, 5 + add r0, r9 + adds r3, r0, 0 + adds r3, 0x14 +_0815A644: + ldrh r0, [r3] + strh r0, [r1] + subs r3, 0x2 + subs r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bgt _0815A644 + adds r0, r5, 0x1 + lsls r0, 1 + add r0, r9 + strh r6, [r0] + adds r1, r5, 0 + adds r1, 0xB + lsls r1, 1 + add r1, r12 + ldrh r6, [r1] + movs r4, 0xA + lsls r0, r7, 5 + add r0, r12 + adds r2, r0, 0 + adds r2, 0x14 +_0815A66E: + ldrh r0, [r2] + strh r0, [r1] + subs r2, 0x2 + subs r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bgt _0815A66E + adds r0, r5, 0x1 + lsls r0, 1 + add r0, r12 + movs r1, 0 + strh r6, [r0] + mov r0, r10 + add r0, r8 + lsls r0, 3 + ldr r2, =gTasks + adds r0, r2 + strh r1, [r0, 0x12] +_0815A692: + ldr r0, =gBattleAnimArgs + ldrh r1, [r0, 0xE] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _0815A6A2 + mov r0, r8 + bl DestroyTask +_0815A6A2: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A5F0 + + thumb_func_start sub_815A6C4 +sub_815A6C4: @ 815A6C4 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + mov r5, sp + adds r5, 0x2 + movs r1, 0 + mov r2, sp + adds r3, r5, 0 + bl sub_80A8924 + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _0815A6F8 + ldr r1, =gBattleAnimArgs + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_0815A6F8: + ldr r1, =gBattleAnimArgs + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x2E] + mov r2, sp + ldrh r0, [r1, 0x4] + ldrh r2, [r2] + adds r0, r2 + strh r0, [r4, 0x32] + ldrh r0, [r1, 0x6] + ldrh r5, [r5] + adds r0, r5 + strh r0, [r4, 0x36] + ldr r0, =0x0000ffce + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, =sub_815A73C + str r0, [r4, 0x1C] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A6C4 + + thumb_func_start sub_815A73C +sub_815A73C: @ 815A73C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0815A75E + movs r1, 0 + movs r0, 0x1E + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] + ldr r1, =sub_815A76C + adds r0, r4, 0 + bl StoreSpriteCallbackInData6 +_0815A75E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A73C + + thumb_func_start sub_815A76C +sub_815A76C: @ 815A76C + push {lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815A798 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] +_0815A798: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + bne _0815A7AC + adds r0, r3, 0 + bl move_anim_8072740 +_0815A7AC: + pop {r0} + bx r0 + thumb_func_end sub_815A76C + + thumb_func_start sub_815A7B0 +sub_815A7B0: @ 815A7B0 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r5, =gBattleAnimArgs + movs r0, 0 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_80A6864 + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, =sub_80A67D8 + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl StoreSpriteCallbackInData6 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A7B0 + + thumb_func_start sub_815A7EC +sub_815A7EC: @ 815A7EC + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815A84C + adds r0, r4, 0 + bl sub_80A6838 + ldr r5, =gBattleAnimArgs + movs r2, 0 + ldrsh r1, [r5, r2] + adds r0, r4, 0 + bl sub_80A6864 + bl IsContest + lsls r0, 24 + cmp r0, 0 + bne _0815A840 + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0815A830 + ldrh r0, [r5, 0x4] + b _0815A846 + .pool +_0815A830: + movs r1, 0x4 + ldrsh r0, [r5, r1] + negs r0, r0 + strh r0, [r4, 0x30] + movs r2, 0x6 + ldrsh r0, [r5, r2] + negs r0, r0 + b _0815A84A +_0815A840: + movs r1, 0x4 + ldrsh r0, [r5, r1] + negs r0, r0 +_0815A846: + strh r0, [r4, 0x30] + ldrh r0, [r5, 0x6] +_0815A84A: + strh r0, [r4, 0x32] +_0815A84C: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r2, 0x2E + ldrsh r1, [r4, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + movs r3, 0xFF + ldrh r1, [r4, 0x30] + ldrh r2, [r4, 0x34] + adds r1, r2 + strh r1, [r4, 0x34] + ldrh r1, [r4, 0x32] + ldrh r2, [r4, 0x36] + adds r1, r2 + strh r1, [r4, 0x36] + movs r2, 0x34 + ldrsh r1, [r4, r2] + lsrs r2, r1, 31 + adds r1, r2 + asrs r1, 1 + strh r1, [r4, 0x24] + ands r0, r3 + movs r1, 0x5 + bl Sin + movs r2, 0x36 + ldrsh r1, [r4, r2] + lsrs r2, r1, 31 + adds r1, r2 + asrs r1, 1 + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF0 + bls _0815A8A4 + adds r0, r4, 0 + bl move_anim_8072740 +_0815A8A4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815A7EC + + thumb_func_start sub_815A8AC +sub_815A8AC: @ 815A8AC + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0815A8C2 + adds r0, r2, 0 + bl move_anim_8072740 +_0815A8C2: + pop {r0} + bx r0 + thumb_func_end sub_815A8AC + + thumb_func_start sub_815A8C8 +sub_815A8C8: @ 815A8C8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815A8EC + ldr r1, =gBattleAnimArgs + movs r0, 0 + b _0815A8F0 + .pool +_0815A8EC: + ldr r1, =gBattleAnimArgs + movs r0, 0x1 +_0815A8F0: + strh r0, [r1, 0xE] + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A8C8 + + thumb_func_start sub_815A904 +sub_815A904: @ 815A904 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gMoveDmgMoveAnim + ldr r0, [r0] + cmp r0, 0 + ble _0815A920 + ldr r1, =gBattleAnimArgs + movs r0, 0 + b _0815A924 + .pool +_0815A920: + ldr r1, =gBattleAnimArgs + movs r0, 0x1 +_0815A924: + strh r0, [r1, 0xE] + adds r0, r2, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A904 + + thumb_func_start sub_815A934 +sub_815A934: @ 815A934 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, =0x00001f3f + movs r0, 0x4A + bl SetGpuReg + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl SetGpuRegBits + ldr r0, =gUnknown_02022E24 + movs r1, 0 + strh r1, [r0] + ldr r4, =gUnknown_02022E26 + strh r1, [r4] + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x44 + bl SetGpuReg + adds r0, r5, 0 + movs r1, 0 + bl sub_80A6980 + ldrb r1, [r5, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r5, 0x1] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_815A9A0 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A934 + + thumb_func_start sub_815A9A0 +sub_815A9A0: @ 815A9A0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bhi _0815AA60 + lsls r0, 2 + ldr r1, =_0815A9BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815A9BC: + .4byte _0815A9D4 + .4byte _0815A9F2 + .4byte _0815AA12 + .4byte _0815A9F2 + .4byte _0815AA32 + .4byte _0815AA42 +_0815A9D4: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815AA60 + b _0815AA3A +_0815A9F2: + ldrh r0, [r4, 0x30] + adds r0, 0x75 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _0815AA60 + movs r0, 0 + strh r0, [r4, 0x32] + b _0815AA3A +_0815AA12: + ldrh r0, [r4, 0x30] + subs r0, 0x75 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x29 + bne _0815AA60 + movs r0, 0 + strh r0, [r4, 0x32] + b _0815AA3A +_0815AA32: + adds r0, r4, 0 + movs r1, 0x1 + bl ChangeSpriteAffineAnim +_0815AA3A: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815AA60 +_0815AA42: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815AA60 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_815AA6C + str r0, [r4, 0x1C] +_0815AA60: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A9A0 + + thumb_func_start sub_815AA6C +sub_815AA6C: @ 815AA6C + push {r4,lr} + adds r4, r0, 0 + ldr r1, =0x00003f3f + movs r0, 0x4A + bl SetGpuReg + movs r0, 0 + bl GetGpuReg + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815AA6C + + thumb_func_start sub_815AAA4 +sub_815AAA4: @ 815AAA4 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =gBattleAnimArgs + movs r1, 0x6 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815AAD0 + ldr r4, =gAnimationBankAttacker + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] +_0815AAD0: + ldrh r0, [r6] + ldrh r2, [r5, 0x20] + adds r0, r2 + movs r3, 0 + strh r0, [r5, 0x20] + ldrh r0, [r6, 0x2] + ldrh r4, [r5, 0x22] + adds r0, r4 + strh r0, [r5, 0x22] + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x10 + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815AB2C + ldrb r1, [r5, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r5, 0x3] + ldr r0, =0x0000fff4 + strh r0, [r5, 0x24] + movs r0, 0x2 + b _0815AB32 + .pool +_0815AB2C: + movs r0, 0xC + strh r0, [r5, 0x24] + ldr r0, =0x0000fffe +_0815AB32: + strh r0, [r5, 0x30] + ldr r1, =gBattleAnimArgs + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x2E] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmp r0, 0xFF + beq _0815AB46 + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x34] +_0815AB46: + ldr r0, =sub_815AB5C + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815AAA4 + + thumb_func_start sub_815AB5C +sub_815AB5C: @ 815AB5C + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x32] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815AB9A + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _0815ABBA + adds r0, r2, 0x1 + strh r0, [r4, 0x32] + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815ABBA + movs r0, 0x40 + negs r0, r0 + bl BattleAnimGetPanControl + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xDE + bl PlaySE1WithPanning + b _0815ABBA +_0815AB9A: + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x30] + subs r0, r1 + strh r0, [r4, 0x24] + movs r1, 0x24 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _0815ABAC + negs r0, r0 +_0815ABAC: + cmp r0, 0xC + bne _0815ABBA + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + subs r0, r2, 0x1 + strh r0, [r4, 0x32] +_0815ABBA: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815ABC8 + adds r0, r4, 0 + bl move_anim_8072740 +_0815ABC8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815AB5C + + thumb_func_start sub_815ABD0 +sub_815ABD0: @ 815ABD0 + push {lr} + ldrb r2, [r0, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x1] + movs r1, 0xFF + strh r1, [r0, 0x34] + bl sub_815AAA4 + pop {r0} + bx r0 + thumb_func_end sub_815ABD0 + + thumb_func_start sub_815ABEC +sub_815ABEC: @ 815ABEC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _0815AC40 + ldr r1, =0x00001f3f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =gUnknown_02022E28 + ldr r2, =0x000098f0 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E2A + movs r0, 0xA0 + strh r0, [r1] + ldr r0, =gUnknown_02022E24 + ldrh r1, [r0] + movs r0, 0x42 + bl SetGpuReg + ldr r0, =gUnknown_02022E26 + ldrh r1, [r0] + movs r0, 0x46 + bl SetGpuReg + b _0815AC70 + .pool +_0815AC40: + ldr r1, =0x00001f3f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =gUnknown_02022E28 + movs r0, 0xF0 + strh r0, [r1] + ldr r4, =gUnknown_02022E2A + ldr r1, =0x000078a0 + adds r0, r1, 0 + strh r0, [r4] + movs r0, 0x42 + movs r1, 0xF0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x46 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 7 + movs r0, 0 + bl SetGpuRegBits +_0815AC70: + adds r0, r5, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815ABEC + + thumb_func_start sub_815AC8C +sub_815AC8C: @ 815AC8C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r0, =gUnknown_02022E28 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E2A + strh r1, [r0] + bl IsContest + lsls r0, 24 + cmp r0, 0 + bne _0815ACB8 + movs r1, 0x80 + lsls r1, 7 + movs r0, 0 + bl ClearGpuRegBits +_0815ACB8: + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815AC8C + + thumb_func_start sub_815ACD0 +sub_815ACD0: @ 815ACD0 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =gBattleAnimArgs + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815ACEC + ldr r4, =gAnimationBankAttacker + b _0815ACEE + .pool +_0815ACEC: + ldr r4, =gAnimationBankTarget +_0815ACEE: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x2] + adds r0, r6 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r2, =gBattleAnimArgs + ldrh r0, [r2, 0x4] + strh r0, [r5, 0x26] + movs r3, 0 + lsls r0, 16 + asrs r0, 16 + ldrh r4, [r2, 0x6] + movs r6, 0x6 + ldrsh r1, [r2, r6] + cmp r0, r1 + ble _0815AD26 + movs r3, 0x1 +_0815AD26: + strh r3, [r5, 0x2E] + movs r0, 0 + strh r0, [r5, 0x30] + ldrh r0, [r2, 0x8] + strh r0, [r5, 0x32] + ldrh r0, [r2, 0xA] + strh r0, [r5, 0x34] + strh r4, [r5, 0x36] + ldr r0, =sub_815AD4C + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815ACD0 + + thumb_func_start sub_815AD4C +sub_815AD4C: @ 815AD4C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x30] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r2, 0x30] + ldr r1, =gSineTable + movs r3, 0x30 + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x34] + ldrh r3, [r2, 0x26] + adds r1, r0, r3 + strh r1, [r2, 0x26] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _0815AD98 + lsls r0, r1, 16 + asrs r0, 16 + movs r3, 0x36 + ldrsh r1, [r2, r3] + cmp r0, r1 + bge _0815ADAA + adds r0, r2, 0 + bl move_anim_8072740 + b _0815ADAA + .pool +_0815AD98: + lsls r0, r1, 16 + asrs r0, 16 + movs r3, 0x36 + ldrsh r1, [r2, r3] + cmp r0, r1 + ble _0815ADAA + adds r0, r2, 0 + bl move_anim_8072740 +_0815ADAA: + pop {r0} + bx r0 + thumb_func_end sub_815AD4C + + thumb_func_start sub_815ADB0 +sub_815ADB0: @ 815ADB0 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + adds r5, r1, r0 + ldr r0, =gBattleAnimArgs + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815ADDC + ldr r4, =gAnimationBankAttacker + b _0815ADDE + .pool +_0815ADDC: + ldr r4, =gAnimationBankTarget +_0815ADDE: + ldrb r0, [r4] + bl sub_80A6190 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + bl GetBankIdentity_permutated + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + adds r1, r0, 0 + adds r1, 0x24 + movs r2, 0 + strh r1, [r5, 0x8] + strh r1, [r5, 0xA] + subs r0, 0x21 + strh r0, [r5, 0xC] + cmp r0, 0 + bge _0815AE08 + strh r2, [r5, 0xC] +_0815AE08: + ldrh r0, [r5, 0x8] + strh r0, [r5, 0xE] + movs r0, 0x8 + strh r0, [r5, 0x10] + ldr r1, =gBattleAnimArgs + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x12] + strh r2, [r5, 0x14] + strh r2, [r5, 0x16] + cmp r7, 0x1 + bne _0815AE30 + ldr r0, =gUnknown_02022E18 + b _0815AE32 + .pool +_0815AE30: + ldr r0, =gUnknown_02022E1C +_0815AE32: + ldrh r2, [r0] + strh r2, [r5, 0x18] + adds r3, r2, 0 + adds r3, 0xF0 + strh r3, [r5, 0x1A] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x1C] + movs r4, 0x4 + ldrsh r0, [r1, r4] + cmp r0, 0 + bne _0815AE54 + strh r3, [r5, 0x1E] + ldrh r3, [r5, 0x18] + b _0815AE58 + .pool +_0815AE54: + strh r2, [r5, 0x1E] + ldrh r3, [r5, 0x1A] +_0815AE58: + movs r0, 0 + strh r0, [r5, 0x26] + ldrh r1, [r5, 0xC] + lsls r2, r1, 16 + asrs r1, r2, 16 + movs r6, 0xE + ldrsh r0, [r5, r6] + cmp r1, r0 + bgt _0815AE8E + ldr r4, =gUnknown_02038C28 + movs r0, 0xF0 + lsls r0, 3 + adds r0, r4 + mov r12, r0 +_0815AE74: + asrs r2, 16 + lsls r1, r2, 1 + adds r0, r1, r4 + strh r3, [r0] + add r1, r12 + strh r3, [r1] + adds r2, 0x1 + lsls r2, 16 + asrs r1, r2, 16 + movs r6, 0xE + ldrsh r0, [r5, r6] + cmp r1, r0 + ble _0815AE74 +_0815AE8E: + cmp r7, 0x1 + bne _0815AEA0 + ldr r0, =0x04000014 + b _0815AEA2 + .pool +_0815AEA0: + ldr r0, =0x04000018 +_0815AEA2: + str r0, [sp] + ldr r0, =0xa2600001 + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, =sub_815AED8 + str r0, [r5] + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815ADB0 + + thumb_func_start sub_815AED8 +sub_815AED8: @ 815AED8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + ldrh r0, [r4, 0x8] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r4, 0xC] + movs r3, 0xC + ldrsh r1, [r4, r3] + cmp r0, r1 + bge _0815AF00 + strh r2, [r4, 0x8] +_0815AF00: + ldrh r1, [r4, 0x10] + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0815AF2C + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r4, 0xC] + movs r3, 0xC + ldrsh r1, [r4, r3] + cmp r0, r1 + bge _0815AF30 + strh r2, [r4, 0xA] + movs r0, 0x1 + strh r0, [r4, 0x26] + b _0815AF30 + .pool +_0815AF2C: + subs r0, r1, 0x1 + strh r0, [r4, 0x10] +_0815AF30: + ldrh r0, [r4, 0x14] + adds r0, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815AF5C + movs r0, 0 + strh r0, [r4, 0x14] + movs r1, 0 + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0815AF4E + movs r1, 0x1 +_0815AF4E: + strh r1, [r4, 0x16] + cmp r1, 0 + beq _0815AF58 + ldrh r0, [r4, 0x18] + b _0815AF5A +_0815AF58: + ldrh r0, [r4, 0x1A] +_0815AF5A: + strh r0, [r4, 0x20] +_0815AF5C: + ldrh r1, [r4, 0x8] + lsls r3, r1, 16 + asrs r1, r3, 16 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + bge _0815AF90 + ldr r5, =gUnknown_02038C28 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 +_0815AF72: + asrs r3, 16 + lsls r1, r3, 1 + adds r2, r1, r5 + ldrh r0, [r4, 0x20] + strh r0, [r2] + adds r1, r6 + ldrh r0, [r4, 0x20] + strh r0, [r1] + adds r3, 0x1 + lsls r3, 16 + asrs r1, r3, 16 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + blt _0815AF72 +_0815AF90: + ldrh r1, [r4, 0xA] + lsls r3, r1, 16 + asrs r1, r3, 16 + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r1, r0 + bgt _0815AFC4 + ldr r5, =gUnknown_02038C28 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 +_0815AFA6: + asrs r3, 16 + lsls r1, r3, 1 + adds r2, r1, r5 + ldrh r0, [r4, 0x1E] + strh r0, [r2] + adds r1, r6 + ldrh r0, [r4, 0x1E] + strh r0, [r1] + adds r3, 0x1 + lsls r3, 16 + asrs r1, r3, 16 + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _0815AFA6 +_0815AFC4: + movs r3, 0x26 + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0815AFE0 + movs r1, 0x1C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815AFDA + ldr r1, =gUnknown_02039B28 + movs r0, 0x3 + strb r0, [r1, 0x15] +_0815AFDA: + adds r0, r7, 0 + bl move_anim_task_del +_0815AFE0: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815AED8 + + thumb_func_start sub_815AFF0 +sub_815AFF0: @ 815AFF0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + adds r4, r0 + movs r5, 0 + strh r5, [r4, 0x8] + strh r5, [r4, 0xA] + ldr r6, =gAnimationBankAttacker + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xC] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xE] + movs r0, 0x20 + strh r0, [r4, 0x10] + ldr r0, =0x0000ffec + strh r0, [r4, 0x12] + strh r5, [r4, 0x14] + movs r0, 0 + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, =sub_815B054 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815AFF0 + + thumb_func_start sub_815B054 +sub_815B054: @ 815B054 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + adds r6, r0, r1 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x5 + bls _0815B074 + b _0815B22E +_0815B074: + lsls r0, 2 + ldr r1, =_0815B088 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815B088: + .4byte _0815B0A0 + .4byte _0815B160 + .4byte _0815B18E + .4byte _0815B1A2 + .4byte _0815B1B8 + .4byte _0815B220 +_0815B0A0: + movs r0, 0xC + ldrsh r2, [r6, r0] + ldrh r1, [r6, 0xA] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815B0B6 + movs r1, 0x10 + ldrsh r0, [r6, r1] + subs r0, r2, r0 + b _0815B0BC +_0815B0B6: + movs r1, 0x10 + ldrsh r0, [r6, r1] + adds r0, r2, r0 +_0815B0BC: + lsls r0, 16 + lsrs r1, r0, 16 + ldrh r2, [r6, 0x12] + ldrh r0, [r6, 0xE] + adds r2, r0 + ldr r0, =gUnknown_08593114 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + ldrb r4, [r6, 0xA] + movs r3, 0x6 + subs r3, r4 + lsls r3, 24 + lsrs r3, 24 + bl CreateSprite + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x40 + negs r0, r0 + bl BattleAnimGetPanControl + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xBA + bl PlaySE12WithPanning + cmp r4, 0x40 + beq _0815B120 + ldr r5, =gSprites + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r3, r1, r5 + ldrh r0, [r6, 0xA] + movs r2, 0x1 + ands r2, r0 + adds r3, 0x3F + ldrb r4, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r4 + orrs r0, r2 + strb r0, [r3] + adds r5, 0x1C + adds r1, r5 + ldr r0, =SpriteCallbackDummy + str r0, [r1] +_0815B120: + ldrh r1, [r6, 0xA] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0815B138 + ldrh r0, [r6, 0x10] + subs r0, 0x6 + strh r0, [r6, 0x10] + ldrh r0, [r6, 0x12] + subs r0, 0x6 + strh r0, [r6, 0x12] +_0815B138: + ldrh r1, [r6, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE2A0 + adds r0, r6, 0 + bl sub_80A7CFC + ldrh r0, [r6, 0xA] + adds r0, 0x1 + strh r0, [r6, 0xA] + strh r4, [r6, 0x8] + b _0815B22E + .pool +_0815B160: + adds r0, r6, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0815B22E + movs r2, 0xA + ldrsh r1, [r6, r2] + cmp r1, 0x6 + bne _0815B180 + movs r0, 0x8 + strh r0, [r6, 0x14] + movs r0, 0x3 + strh r0, [r6, 0x8] + b _0815B22E +_0815B180: + cmp r1, 0x2 + bgt _0815B186 + movs r0, 0xA +_0815B186: + strh r0, [r6, 0x14] + movs r0, 0x2 + strh r0, [r6, 0x8] + b _0815B22E +_0815B18E: + ldrh r0, [r6, 0x14] + movs r2, 0x14 + ldrsh r1, [r6, r2] + cmp r1, 0 + beq _0815B19E + subs r0, 0x1 + strh r0, [r6, 0x14] + b _0815B22E +_0815B19E: + strh r1, [r6, 0x8] + b _0815B22E +_0815B1A2: + ldrh r1, [r6, 0x14] + movs r2, 0x14 + ldrsh r0, [r6, r2] + cmp r0, 0 + beq _0815B1B2 + subs r0, r1, 0x1 + strh r0, [r6, 0x14] + b _0815B22E +_0815B1B2: + movs r0, 0x4 + strh r0, [r6, 0x8] + b _0815B22E +_0815B1B8: + movs r5, 0 + movs r7, 0 + ldr r3, =gSprites + movs r0, 0x1C + adds r0, r3 + mov r8, r0 +_0815B1C4: + lsls r0, r5, 4 + adds r0, r5 + lsls r4, r0, 2 + adds r0, r3, 0 + adds r0, 0x14 + adds r0, r4, r0 + ldr r1, [r0] + ldr r0, =gUnknown_08593114 + cmp r1, r0 + bne _0815B200 + adds r0, r4, r3 + strh r2, [r0, 0x2E] + movs r1, 0x6 + strh r1, [r0, 0x30] + movs r1, 0x2 + str r2, [sp] + str r3, [sp, 0x4] + bl StartSpriteAnim + mov r0, r8 + adds r1, r4, r0 + ldr r0, =sub_815B23C + str r0, [r1] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r2, [sp] + ldr r3, [sp, 0x4] + cmp r7, 0x6 + beq _0815B20A +_0815B200: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3F + bls _0815B1C4 +_0815B20A: + strh r7, [r6, 0x14] + movs r0, 0x5 + strh r0, [r6, 0x8] + b _0815B22E + .pool +_0815B220: + movs r1, 0x14 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815B22E + adds r0, r2, 0 + bl move_anim_task_del +_0815B22E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815B054 + + thumb_func_start sub_815B23C +sub_815B23C: @ 815B23C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0815B270 + ldr r3, =gTasks + movs r0, 0x30 + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x2E + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl DestroySprite +_0815B270: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B23C + + thumb_func_start sub_815B27C +sub_815B27C: @ 815B27C + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815B290 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A69CC +_0815B290: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x27 + bgt _0815B2C2 + ldrh r0, [r5, 0x2E] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815B2B4 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + b _0815B2C0 +_0815B2B4: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 +_0815B2C0: + strb r0, [r2] +_0815B2C2: + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x1E + ble _0815B2D8 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0815B2D8: + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x3D + bne _0815B324 + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl StoreSpriteCallbackInData6 + ldrh r0, [r5, 0x24] + ldrh r2, [r5, 0x20] + adds r0, r2 + movs r1, 0 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x26] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + strh r1, [r5, 0x24] + strh r1, [r5, 0x26] + movs r0, 0x14 + strh r0, [r5, 0x2E] + ldr r4, =gAnimationBankTarget + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] +_0815B324: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B27C + + thumb_func_start sub_815B338 +sub_815B338: @ 815B338 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815B35C + cmp r0, 0x1 + beq _0815B37C + b _0815B38E + .pool +_0815B35C: + movs r0, 0 + bl GetAnimBankSpriteId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE350 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815B38E + .pool +_0815B37C: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815B38E + adds r0, r5, 0 + bl move_anim_task_del +_0815B38E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815B338 + + thumb_func_start sub_815B394 +sub_815B394: @ 815B394 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0 + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0815B3F4 + cmp r0, 0x1 + bgt _0815B3B4 + cmp r0, 0 + beq _0815B3BE + b _0815B496 +_0815B3B4: + cmp r0, 0x2 + beq _0815B424 + cmp r0, 0x3 + beq _0815B478 + b _0815B496 +_0815B3BE: + ldr r4, =gAnimationBankAttacker + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + adds r0, r6, 0 + movs r1, 0 + bl sub_80A7270 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r5, 0x30] + strh r0, [r5, 0x32] + b _0815B46C + .pool +_0815B3F4: + ldrh r0, [r5, 0x30] + adds r0, 0x60 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + subs r0, 0x1A + strh r0, [r5, 0x32] + movs r2, 0x30 + ldrsh r1, [r5, r2] + movs r0, 0x32 + ldrsh r2, [r5, r0] + adds r0, r6, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0815B424 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] +_0815B424: + ldrh r0, [r5, 0x30] + adds r0, 0x60 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x30 + strh r0, [r5, 0x32] + movs r2, 0x30 + ldrsh r1, [r5, r2] + movs r0, 0x32 + ldrsh r2, [r5, r0] + adds r0, r6, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _0815B496 + movs r0, 0 + strh r0, [r5, 0x34] + ldr r1, =gSprites + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0 + bl sub_80A7344 +_0815B46C: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _0815B496 + .pool +_0815B478: + ldrh r0, [r5, 0x26] + subs r0, 0x6 + strh r0, [r5, 0x26] + movs r1, 0x22 + ldrsh r0, [r5, r1] + movs r2, 0x26 + ldrsh r1, [r5, r2] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _0815B496 + adds r0, r5, 0 + bl move_anim_8072740 +_0815B496: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815B394 + + thumb_func_start sub_815B49C +sub_815B49C: @ 815B49C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _0815B4BC + ldr r0, =0x0000fff0 + b _0815B4C0 + .pool +_0815B4BC: + movs r0, 0x80 + lsls r0, 1 +_0815B4C0: + strh r0, [r4, 0x20] + movs r0, 0 + strh r0, [r4, 0x22] + ldr r0, =sub_815B4D4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B49C + + thumb_func_start sub_815B4D4 +sub_815B4D4: @ 815B4D4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x48 + strh r0, [r4, 0x2E] + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _0815B4F8 + ldrh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 20 + b _0815B500 + .pool +_0815B4F8: + ldrh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 20 + negs r0, r0 +_0815B500: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r0, 0x10 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r5, r0, r1 + strh r5, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _0815B54C + ldr r0, =gUnknown_085CE3A0 + ldrh r1, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r4, 0x22] + adds r2, r5 + lsls r2, 16 + asrs r2, 16 + adds r3, r4, 0 + adds r3, 0x43 + ldrb r3, [r3] + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + bl CreateSpriteAndAnimate +_0815B54C: + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + adds r0, 0x20 + movs r1, 0x98 + lsls r1, 1 + cmp r0, r1 + bls _0815B566 + adds r0, r4, 0 + bl move_anim_8072740 +_0815B566: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B4D4 + + thumb_func_start sub_815B570 +sub_815B570: @ 815B570 + push {r4,lr} + adds r4, r0, 0 + bl Random2 + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0815B58A + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x4 + b _0815B592 +_0815B58A: + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x5 +_0815B592: + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + bl Random2 + movs r1, 0x7 + ands r0, r1 + adds r1, r0, 0 + cmp r1, 0x3 + ble _0815B5B4 + negs r0, r1 + lsls r0, 24 + lsrs r0, 24 +_0815B5B4: + lsls r0, 24 + asrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, =sub_815B5D0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B570 + + thumb_func_start sub_815B5D0 +sub_815B5D0: @ 815B5D0 + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1D + bgt _0815B612 + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _0815B646 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + movs r0, 0 + b _0815B644 +_0815B612: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0x2 + bne _0815B628 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0815B628: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0x3 + bne _0815B640 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x0000ffff + strh r0, [r3, 0x30] +_0815B640: + ldrh r0, [r3, 0x30] + adds r0, 0x1 +_0815B644: + strh r0, [r3, 0x30] +_0815B646: + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0x3C + ble _0815B654 + adds r0, r3, 0 + bl DestroySprite +_0815B654: + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B5D0 + + thumb_func_start sub_815B65C +sub_815B65C: @ 815B65C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815B69C + movs r0, 0 + bl GetAnimBankSpriteId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE3B8 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815B6AE + .pool +_0815B69C: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815B6AE + adds r0, r5, 0 + bl move_anim_task_del +_0815B6AE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815B65C + + thumb_func_start sub_815B6B4 +sub_815B6B4: @ 815B6B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815B6F4 + movs r0, 0 + bl GetAnimBankSpriteId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE3E0 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815B706 + .pool +_0815B6F4: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815B706 + adds r0, r5, 0 + bl move_anim_task_del +_0815B706: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815B6B4 + + thumb_func_start sub_815B70C +sub_815B70C: @ 815B70C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815B71E + cmp r0, 0x1 + beq _0815B748 + b _0815B770 +_0815B71E: + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + movs r0, 0x90 + lsls r0, 4 + strh r0, [r4, 0x30] + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815B770 + .pool +_0815B748: + ldrh r2, [r4, 0x30] + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x26] + subs r0, r1 + strh r0, [r4, 0x26] + subs r2, 0x60 + strh r2, [r4, 0x30] + movs r2, 0x22 + ldrsh r0, [r4, r2] + movs r2, 0x26 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r2, 0x32 + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _0815B770 + adds r0, r4, 0 + bl move_anim_8072740 +_0815B770: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815B70C + + thumb_func_start sub_815B778 +sub_815B778: @ 815B778 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815B7B8 + movs r0, 0 + bl GetAnimBankSpriteId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE430 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815B7CA + .pool +_0815B7B8: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815B7CA + adds r0, r5, 0 + bl move_anim_task_del +_0815B7CA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815B778 + + thumb_func_start sub_815B7D0 +sub_815B7D0: @ 815B7D0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r3, r1, 0 + cmp r0, 0x4 + bls _0815B7F6 + b _0815BAFC +_0815B7F6: + lsls r0, 2 + ldr r1, =_0815B808 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815B808: + .4byte _0815B81C + .4byte _0815B86C + .4byte _0815B8A8 + .4byte _0815BA44 + .4byte _0815BA82 +_0815B81C: + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankIdentity_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815B844 + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0x1 + bl lcd_bg_operations + b _0815B84E + .pool +_0815B844: + movs r0, 0x2 + movs r1, 0x2 + movs r2, 0x1 + bl lcd_bg_operations +_0815B84E: + ldr r0, =gTasks + mov r6, r8 + lsls r1, r6, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldr r0, =gBattleAnimArgs + ldrh r0, [r0] + strh r0, [r1, 0x1C] + b _0815BA26 + .pool +_0815B86C: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r3 + ldrh r0, [r4, 0xC] + adds r1, r0, 0x1 + strh r1, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bgt _0815B886 + b _0815BAFC +_0815B886: + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + ldrh r5, [r4, 0xA] + lsls r1, r5, 4 + orrs r1, r5 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl SetGpuReg + cmp r5, 0xF + beq _0815B8A6 + b _0815BAFC +_0815B8A6: + b _0815BA7A +_0815B8A8: + ldr r5, =gAnimationBankAttacker + ldrb r0, [r5] + ldr r1, =gAnimationBankTarget + ldrb r1, [r1] + mov r2, r8 + lsls r4, r2, 2 + adds r2, r4, r2 + lsls r2, 3 + adds r2, r3 + ldrb r2, [r2, 0x1C] + bl sub_805E448 + ldrb r1, [r5] + mov r0, sp + bl sub_80A6BFC + bl IsContest + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + beq _0815B8E0 + movs r1, 0 + b _0815B8EA + .pool +_0815B8E0: + ldrb r0, [r5] + bl GetBankIdentity + lsls r0, 24 + lsrs r1, r0, 24 +_0815B8EA: + ldr r0, =gUnknown_020244D4 + ldr r2, [r0] + lsls r0, r1, 2 + adds r2, 0x4 + adds r2, r0 + ldr r1, =gUnknown_020244E4 + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r1, 11 + ldr r0, [r2] + adds r0, r1 + ldr r1, [sp] + ldr r2, =0x04000200 + bl CpuSet + ldr r1, [sp] + movs r2, 0x80 + lsls r2, 4 + mov r0, sp + ldrh r3, [r0, 0xA] + movs r0, 0x1 + bl LoadBgTiles + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _0815BA1C + ldr r5, =gUnknown_02039F34 + ldr r0, [r5] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + bl sub_80DB2A8 + adds r4, r0, 0 + ldr r0, [r5] + ldr r0, [r0, 0x18] + ldrh r0, [r0, 0x2] + bl sub_80DB2A8 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0815B99C + ldr r6, [sp, 0x4] + movs r5, 0 + movs r0, 0x7 + mov r12, r0 + movs r7, 0 +_0815B950: + movs r4, 0 + adds r3, r7, r6 + mov r1, r12 + lsls r0, r1, 1 + adds r2, r0, r6 +_0815B95A: + ldrh r1, [r3] + ldrh r0, [r2] + strh r0, [r3] + strh r1, [r2] + adds r3, 0x2 + subs r2, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _0815B95A + movs r2, 0x20 + add r12, r2 + adds r7, 0x40 + adds r5, 0x1 + cmp r5, 0x7 + ble _0815B950 + movs r5, 0 + movs r0, 0x80 + lsls r0, 3 + adds r3, r0, 0 +_0815B980: + adds r2, r5, 0x1 + lsls r0, r5, 6 + adds r1, r0, r6 + movs r4, 0x7 +_0815B988: + ldrh r0, [r1] + eors r0, r3 + strh r0, [r1] + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0815B988 + adds r5, r2, 0 + cmp r5, 0x7 + ble _0815B980 +_0815B99C: + ldr r0, =gUnknown_02039F34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r0, [r0, 0x2] + bl sub_80DB2A8 + lsls r0, 24 + cmp r0, 0 + beq _0815B9EC + ldr r3, =gSprites + ldr r4, =gBankSpriteIds + ldr r2, =gAnimationBankAttacker + ldrb r0, [r2] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x10 + adds r0, r1 + ldr r1, =gUnknown_082FF6C0 + b _0815BA06 + .pool +_0815B9EC: + ldr r3, =gSprites + ldr r4, =gBankSpriteIds + ldr r2, =gAnimationBankAttacker + ldrb r0, [r2] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x10 + adds r0, r1 + ldr r1, =gUnknown_082FF694 +_0815BA06: + str r1, [r0] + ldrb r0, [r2] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + bl StartSpriteAffineAnim +_0815BA1C: + ldr r0, =gTasks + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 +_0815BA26: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815BAFC + .pool +_0815BA44: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r3 + ldrh r0, [r4, 0xC] + adds r1, r0, 0x1 + strh r1, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815BAFC + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + ldrh r5, [r4, 0xA] + lsls r1, r5, 4 + orrs r1, r5 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl SetGpuReg + cmp r5, 0 + bne _0815BAFC +_0815BA7A: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815BAFC +_0815BA82: + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankIdentity_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815BAAC + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl lcd_bg_operations + b _0815BAB6 + .pool +_0815BAAC: + movs r0, 0x2 + movs r1, 0x2 + movs r2, 0 + bl lcd_bg_operations +_0815BAB6: + bl IsContest + lsls r0, 24 + cmp r0, 0 + bne _0815BAF6 + ldr r4, =gAnimationBankAttacker + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815BAF6 + ldr r0, =gTasks + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r6, 0x1C + ldrsh r0, [r1, r6] + cmp r0, 0 + bne _0815BAF6 + ldrb r0, [r4] + ldr r1, =gUnknown_020244D0 + ldr r1, [r1] + ldr r2, [r1] + lsls r1, r0, 2 + adds r1, r2 + ldrh r1, [r1, 0x2] + bl sub_805EE54 +_0815BAF6: + mov r0, r8 + bl move_anim_task_del +_0815BAFC: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B7D0 + + thumb_func_start c3_80DFBE4 +c3_80DFBE4: @ 815BB18 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =gBattleAnimArgs + ldr r3, =gSprites + ldr r2, =gBankSpriteIds + ldr r1, =gAnimationBankAttacker + ldrb r1, [r1] + adds r1, r2 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + adds r1, 0x3E + ldrb r1, [r1] + lsls r1, 29 + lsrs r1, 31 + strh r1, [r4, 0xE] + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c3_80DFBE4 + + thumb_func_start sub_815BB58 +sub_815BB58: @ 815BB58 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + ldr r1, =gAnimationBankTarget + ldrb r1, [r1] + movs r2, 0x1 + bl sub_805E448 + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815BB58 + + thumb_func_start sub_815BB84 +sub_815BB84: @ 815BB84 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bls _0815BBA2 + b _0815BDF2 +_0815BBA2: + lsls r0, 2 + ldr r1, =_0815BBB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815BBB4: + .4byte _0815BBC8 + .4byte _0815BCB8 + .4byte _0815BD08 + .4byte _0815BD72 + .4byte _0815BDA6 +_0815BBC8: + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + bl IsContest + lsls r0, 24 + cmp r0, 0 + bne _0815BC02 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0815BC02: + mov r0, sp + bl sub_80A6B30 + ldr r1, =gUnknown_08C2A6EC + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _0815BC34 + ldr r1, =gUnknown_02022E18 + ldr r3, =0x0000ffc8 + b _0815BC5C + .pool +_0815BC34: + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _0815BC58 + ldr r1, =gUnknown_02022E18 + ldr r2, =0x0000ff79 + adds r0, r2, 0 + b _0815BC5E + .pool +_0815BC58: + ldr r1, =gUnknown_02022E18 + ldr r3, =0x0000fff6 +_0815BC5C: + adds r0, r3, 0 +_0815BC5E: + strh r0, [r1] + ldr r1, =gUnknown_02022E1A + movs r0, 0 + strh r0, [r1] + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C2A634 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, =gUnknown_08C2A6D4 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl LoadCompressedPalette + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =gUnknown_02022E18 + ldrh r0, [r0] + strh r0, [r1, 0x1C] + ldr r0, =gUnknown_02022E1A + ldrh r0, [r0] + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + b _0815BD8E + .pool +_0815BCB8: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x10] + adds r1, r0, 0x1 + strh r1, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bgt _0815BCCE + b _0815BDF2 +_0815BCCE: + movs r0, 0 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + ble _0815BCE4 + movs r0, 0xC + strh r0, [r4, 0xA] +_0815BCE4: + ldrh r0, [r4, 0xA] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xC + bne _0815BDF2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815BDF2 +_0815BD08: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bge _0815BD20 + movs r0, 0 + strh r0, [r4, 0xA] +_0815BD20: + ldrh r0, [r4, 0xA] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0815BDF2 + ldr r2, =gUnknown_02022E18 + ldr r1, =gUnknown_085CE460 + movs r3, 0xC + ldrsh r0, [r4, r3] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r4, 0x1C] + adds r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815BD6C + strh r0, [r4, 0x8] + b _0815BDF2 + .pool +_0815BD6C: + movs r0, 0x3 + strh r0, [r4, 0x8] + b _0815BDF2 +_0815BD72: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0xE] + adds r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815BDF2 + movs r0, 0 + strh r0, [r1, 0xE] + movs r0, 0x1 +_0815BD8E: + strh r0, [r1, 0x8] + movs r0, 0x40 + negs r0, r0 + bl BattleAnimGetPanControl + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xE4 + bl PlaySE12WithPanning + b _0815BDF2 +_0815BDA6: + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + bl IsContest + lsls r0, 24 + cmp r0, 0 + bne _0815BDC8 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_0815BDC8: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + ldr r0, =gUnknown_02022E18 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_task_del +_0815BDF2: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815BB84 + + thumb_func_start sub_815BE04 +sub_815BE04: @ 815BE04 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r7, r0, 0 + bl Random2 + lsls r0, 16 + movs r1, 0xFC + lsls r1, 14 + ands r1, r0 + lsrs r5, r1, 16 + adds r1, r5, 0 + cmp r1, 0x1F + ble _0815BE2E + movs r0, 0x20 + subs r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 +_0815BE2E: + ldr r4, =gAnimationBankAttacker + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r5 + strh r0, [r7, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x20 + strh r0, [r7, 0x22] + ldr r1, =gBattleAnimArgs + ldrh r0, [r1] + strh r0, [r7, 0x30] + ldrh r0, [r1, 0x2] + strh r0, [r7, 0x32] + ldr r4, =gUnknown_085CE48C + movs r0, 0x20 + ldrsh r1, [r7, r0] + movs r0, 0x22 + ldrsh r2, [r7, r0] + adds r5, r7, 0 + adds r5, 0x43 + ldrb r3, [r5] + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + bl CreateSprite + mov r9, r0 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + movs r0, 0x20 + ldrsh r1, [r7, r0] + movs r0, 0x22 + ldrsh r2, [r7, r0] + ldrb r3, [r5] + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + bl CreateSprite + mov r8, r0 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r0, r9 + lsls r2, r0, 4 + add r2, r9 + lsls r2, 2 + ldr r1, =gSprites + mov r10, r1 + adds r5, r2, r1 + adds r0, r5, 0 + movs r1, 0x1 + str r2, [sp] + bl StartSpriteAnim + mov r0, r8 + lsls r6, r0, 4 + add r6, r8 + lsls r6, 2 + mov r1, r10 + adds r4, r6, r1 + adds r0, r4, 0 + movs r1, 0x2 + bl StartSpriteAnim + ldr r1, =gBattleAnimArgs + ldrh r0, [r1] + strh r0, [r5, 0x30] + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x32] + ldrh r0, [r1] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x32] + ldr r0, =0x0000ffff + strh r0, [r5, 0x3C] + movs r0, 0x1 + negs r0, r0 + strh r0, [r4, 0x3C] + adds r5, 0x3E + ldrb r0, [r5] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5] + adds r4, 0x3E + ldrb r0, [r4] + orrs r0, r1 + strb r0, [r4] + movs r0, 0x1C + add r10, r0 + ldr r2, [sp] + add r2, r10 + ldr r0, =sub_815C050 + str r0, [r2] + add r6, r10 + str r0, [r6] + mov r1, r9 + strh r1, [r7, 0x3A] + mov r0, r8 + strh r0, [r7, 0x3C] + ldr r0, =sub_815BF44 + str r0, [r7, 0x1C] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815BE04 + + thumb_func_start sub_815BF44 +sub_815BF44: @ 815BF44 + push {lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x32] + ldrh r0, [r3, 0x34] + adds r2, r0 + lsls r0, r2, 16 + asrs r0, 24 + ldrh r1, [r3, 0x26] + subs r1, r0 + strh r1, [r3, 0x26] + movs r0, 0xFF + ands r2, r0 + strh r2, [r3, 0x34] + movs r2, 0x36 + ldrsh r0, [r3, r2] + cmp r0, 0 + bne _0815BF92 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x8 + negs r1, r1 + cmp r0, r1 + bge _0815BF92 + ldr r2, =gSprites + movs r0, 0x3A + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldrh r0, [r3, 0x36] + adds r0, 0x1 + strh r0, [r3, 0x36] +_0815BF92: + movs r1, 0x36 + ldrsh r0, [r3, r1] + cmp r0, 0x1 + bne _0815BFC6 + movs r2, 0x26 + ldrsh r1, [r3, r2] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _0815BFC6 + ldr r2, =gSprites + movs r0, 0x3C + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldrh r0, [r3, 0x36] + adds r0, 0x1 + strh r0, [r3, 0x36] +_0815BFC6: + ldrh r0, [r3, 0x30] + subs r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0815BFE8 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_815BFF4 + str r0, [r3, 0x1C] +_0815BFE8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_815BF44 + + thumb_func_start sub_815BFF4 +sub_815BFF4: @ 815BFF4 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, =gSprites + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r3, r0, 2 + adds r6, r5, 0 + adds r6, 0x1C + adds r0, r3, r6 + ldr r2, [r0] + ldr r0, =SpriteCallbackDummy + cmp r2, r0 + bne _0815C040 + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldr r0, [r1] + cmp r0, r2 + bne _0815C040 + adds r0, r3, r5 + bl DestroySprite + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + adds r0, r4, 0 + bl move_anim_8072740 +_0815C040: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815BFF4 + + thumb_func_start sub_815C050 +sub_815C050: @ 815C050 + push {lr} + adds r3, r0, 0 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0815C09C + ldrh r2, [r3, 0x32] + ldrh r1, [r3, 0x34] + adds r2, r1 + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r3, 0x26] + subs r0, r1 + strh r0, [r3, 0x26] + movs r0, 0xFF + ands r2, r0 + strh r2, [r3, 0x34] + ldrh r0, [r3, 0x30] + subs r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0815C09C + mov r1, r12 + ldrb r0, [r1] + movs r1, 0x4 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldr r0, =SpriteCallbackDummy + str r0, [r3, 0x1C] +_0815C09C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_815C050 + + thumb_func_start sub_815C0A4 +sub_815C0A4: @ 815C0A4 + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r4, r1, 0 + cmp r0, 0x5 + bls _0815C0C2 + b _0815C396 +_0815C0C2: + lsls r0, 2 + ldr r1, =_0815C0D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815C0D4: + .4byte _0815C0EC + .4byte _0815C224 + .4byte _0815C2AC + .4byte _0815C2E2 + .4byte _0815C310 + .4byte _0815C34A +_0815C0EC: + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000d03 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + bl IsContest + lsls r0, 24 + cmp r0, 0 + bne _0815C124 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0815C124: + mov r0, sp + bl sub_80A6B30 + ldr r1, =gUnknown_08C2A6EC + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _0815C15C + ldr r1, =gUnknown_02022E18 + ldr r3, =0x0000ffc8 + adds r0, r3, 0 + b _0815C1CA + .pool +_0815C15C: + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + bl GetBankIdentity + lsls r0, 24 + lsrs r4, r0, 24 + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815C1B4 + cmp r4, 0x1 + bne _0815C180 + ldr r1, =gUnknown_02022E18 + ldr r2, =0x0000ff65 + adds r0, r2, 0 + strh r0, [r1] +_0815C180: + cmp r4, 0x3 + bne _0815C18C + ldr r1, =gUnknown_02022E18 + ldr r3, =0x0000ff8d + adds r0, r3, 0 + strh r0, [r1] +_0815C18C: + cmp r4, 0 + bne _0815C196 + ldr r1, =gUnknown_02022E18 + movs r0, 0xE + strh r0, [r1] +_0815C196: + cmp r4, 0x2 + bne _0815C1CC + ldr r1, =gUnknown_02022E18 + ldr r2, =0x0000ffec + b _0815C1C8 + .pool +_0815C1B4: + cmp r4, 0x1 + bne _0815C1C0 + ldr r1, =gUnknown_02022E18 + ldr r3, =0x0000ff79 + adds r0, r3, 0 + strh r0, [r1] +_0815C1C0: + cmp r4, 0 + bne _0815C1CC + ldr r1, =gUnknown_02022E18 + ldr r2, =0x0000fff6 +_0815C1C8: + adds r0, r2, 0 +_0815C1CA: + strh r0, [r1] +_0815C1CC: + ldr r1, =gUnknown_02022E1A + movs r0, 0 + strh r0, [r1] + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C2A634 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, =gUnknown_08C2A6D4 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl LoadCompressedPalette + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =gUnknown_02022E18 + ldrh r0, [r0] + strh r0, [r1, 0x1C] + ldr r0, =gUnknown_02022E1A + ldrh r0, [r0] + strh r0, [r1, 0x1E] + b _0815C2A4 + .pool +_0815C224: + ldr r1, =gTasks + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r0, 0 + strh r0, [r5, 0xE] + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815C268 + ldr r2, =gUnknown_02022E18 + ldr r1, =gUnknown_085CE4A4 + movs r3, 0xC + ldrsh r0, [r5, r3] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r5, [r5, 0x1C] + adds r0, r5 + b _0815C27A + .pool +_0815C268: + ldr r2, =gUnknown_02022E18 + ldr r1, =gUnknown_085CE4A4 + movs r3, 0xC + ldrsh r0, [r5, r3] + adds r0, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + ldrh r0, [r5, 0x1C] + subs r0, r1 +_0815C27A: + strh r0, [r2] + ldr r0, =gTasks + adds r1, r4, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + adds r0, 0x1 + strh r0, [r1, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0815C2A4 + strh r0, [r1, 0x8] + b _0815C396 + .pool +_0815C2A4: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815C396 +_0815C2AC: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r4 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bgt _0815C2C6 + movs r0, 0x5 + strh r0, [r4, 0xA] +_0815C2C6: + ldrh r1, [r4, 0xA] + lsls r1, 8 + movs r0, 0x3 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bne _0815C396 + b _0815C302 +_0815C2E2: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r4 + ldrh r1, [r4, 0xE] + adds r1, 0x1 + strh r1, [r4, 0xE] + lsls r1, 16 + asrs r1, 16 + ldr r2, =gUnknown_085CE4A8 + movs r3, 0xC + ldrsh r0, [r4, r3] + adds r0, r2 + ldrb r0, [r0] + cmp r1, r0 + ble _0815C396 +_0815C302: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815C396 + .pool +_0815C310: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r4 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + ble _0815C32A + movs r0, 0xD + strh r0, [r4, 0xA] +_0815C32A: + ldrh r1, [r4, 0xA] + lsls r1, 8 + movs r0, 0x3 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xD + bne _0815C396 + movs r0, 0x1 + strh r0, [r4, 0x8] + b _0815C396 +_0815C34A: + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + bl IsContest + lsls r0, 24 + cmp r0, 0 + bne _0815C36C + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_0815C36C: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + ldr r0, =gUnknown_02022E18 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r6, 0 + bl move_anim_task_del +_0815C396: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815C0A4 + + thumb_func_start sub_815C3A8 +sub_815C3A8: @ 815C3A8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815C3E8 + movs r0, 0 + bl GetAnimBankSpriteId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE4B0 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815C3FA + .pool +_0815C3E8: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815C3FA + adds r0, r5, 0 + bl move_anim_task_del +_0815C3FA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815C3A8 + + thumb_func_start sub_815C400 +sub_815C400: @ 815C400 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + movs r2, 0x2E + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _0815C41E + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815C472 +_0815C41E: + adds r0, 0x1 + strh r0, [r4, 0x2E] + cmp r1, 0x14 + ble _0815C472 + ldrh r0, [r4, 0x30] + adds r0, 0xA0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + adds r0, 0x80 + strh r0, [r4, 0x32] + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _0815C450 + ldrh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + b _0815C456 + .pool +_0815C450: + ldrh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 +_0815C456: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + ble _0815C472 + adds r0, r4, 0 + bl move_anim_8072740 +_0815C472: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815C400 + + thumb_func_start sub_815C478 +sub_815C478: @ 815C478 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + ldr r5, =gBattleAnimArgs + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815C4A4 + adds r0, r2, 0 + bl move_anim_task_del + b _0815C538 + .pool +_0815C4A4: + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0 + bge _0815C4B0 + movs r0, 0 + strh r0, [r5, 0x4] +_0815C4B0: + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0x2 + ble _0815C4BC + movs r0, 0x2 + strh r0, [r5, 0x4] +_0815C4BC: + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + movs r0, 0x4 + ldrsh r1, [r5, r0] + lsls r1, 1 + movs r0, 0x8 + subs r0, r1 + strh r0, [r4, 0xE] + movs r1, 0x4 + ldrsh r0, [r5, r1] + lsls r0, 7 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r4, 0x10] + ldrh r0, [r5, 0x4] + adds r0, 0x2 + strh r0, [r4, 0x12] + ldrh r0, [r5, 0x2] + subs r0, 0x1 + strh r0, [r4, 0x14] + ldrb r0, [r5] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815C508 + ldr r0, =gAnimationBankAttacker + b _0815C50A + .pool +_0815C508: + ldr r0, =gAnimationBankTarget +_0815C50A: + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815C528 + movs r1, 0x10 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x10] + movs r1, 0x12 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x12] +_0815C528: + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80A7270 + ldr r0, =sub_815C548 + str r0, [r4] +_0815C538: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815C478 + + thumb_func_start sub_815C548 +sub_815C548: @ 815C548 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r6, [r4, r0] + cmp r6, 0x1 + beq _0815C5D0 + cmp r6, 0x1 + bgt _0815C570 + cmp r6, 0 + beq _0815C57C + b _0815C6A8 + .pool +_0815C570: + cmp r6, 0x2 + beq _0815C628 + cmp r6, 0x3 + bne _0815C57A + b _0815C698 +_0815C57A: + b _0815C6A8 +_0815C57C: + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x12] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + ldrh r0, [r4, 0xC] + ldrh r1, [r4, 0x10] + subs r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0xC] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xE + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _0815C6A8 + strh r6, [r4, 0xA] + b _0815C690 + .pool +_0815C5D0: + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + ldrh r2, [r4, 0x12] + subs r1, r2 + strh r1, [r0, 0x24] + ldrh r0, [r4, 0x10] + ldrh r1, [r4, 0xC] + adds r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0xC] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + lsls r1, 16 + asrs r1, 16 + movs r2, 0xE + ldrsh r0, [r4, r2] + lsls r0, 1 + cmp r1, r0 + blt _0815C6A8 + movs r0, 0 + strh r0, [r4, 0xA] + b _0815C690 + .pool +_0815C628: + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x12] + ldrh r2, [r0, 0x24] + adds r1, r2 + movs r5, 0 + strh r1, [r0, 0x24] + ldrh r0, [r4, 0xC] + ldrh r1, [r4, 0x10] + subs r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0xC] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xE + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _0815C6A8 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0815C690 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + strh r5, [r4, 0xA] + strh r5, [r4, 0x8] + b _0815C6A8 + .pool +_0815C690: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815C6A8 +_0815C698: + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del +_0815C6A8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815C548 + + thumb_func_start sub_815C6B0 +sub_815C6B0: @ 815C6B0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0815C6D4 + strh r0, [r4, 0x20] + ldr r1, =gBattleAnimArgs + ldrh r0, [r1] + b _0815C6DE + .pool +_0815C6D4: + movs r0, 0xF0 + strh r0, [r4, 0x20] + ldr r1, =gBattleAnimArgs + ldrh r0, [r1] + subs r0, 0x1E +_0815C6DE: + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x32] + ldrb r1, [r1, 0x2] + adds r0, r4, 0 + bl StartSpriteAnim + ldr r0, =sub_815C700 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815C6B0 + + thumb_func_start sub_815C700 +sub_815C700: @ 815C700 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x3 + strh r0, [r4, 0x2E] + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0815C744 + ldrh r1, [r4, 0x20] + adds r1, 0x5 + strh r1, [r4, 0x20] + ldrh r0, [r4, 0x22] + subs r0, 0x1 + strh r0, [r4, 0x22] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0xF0 + ble _0815C732 + adds r0, r4, 0 + bl move_anim_8072740 +_0815C732: + ldrh r1, [r4, 0x2E] + movs r0, 0xFF + ands r0, r1 + movs r1, 0x10 + bl Sin + b _0815C768 + .pool +_0815C744: + ldrh r1, [r4, 0x20] + subs r1, 0x5 + strh r1, [r4, 0x20] + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] + lsls r1, 16 + cmp r1, 0 + bge _0815C75C + adds r0, r4, 0 + bl move_anim_8072740 +_0815C75C: + ldrh r1, [r4, 0x2E] + movs r0, 0xFF + ands r0, r1 + movs r1, 0x10 + bl Cos +_0815C768: + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815C700 + + thumb_func_start sub_815C770 +sub_815C770: @ 815C770 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + movs r0, 0x20 + strh r0, [r4, 0x20] + movs r0, 0x40 + strh r0, [r4, 0x22] + movs r0, 0x80 + lsls r0, 4 + strh r0, [r4, 0x24] + ldr r0, =gBattleAnimArgs + ldrb r0, [r0] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + movs r1, 0 + bl sub_80A7270 + ldr r0, =sub_815C7C4 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815C770 + + thumb_func_start sub_815C7C4 +sub_815C7C4: @ 815C7C4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + adds r7, r0, r1 + movs r1, 0x8 + ldrsh r0, [r7, r1] + mov r8, r0 + cmp r0, 0x1 + beq _0815C860 + cmp r0, 0x1 + bgt _0815C7F4 + cmp r0, 0 + beq _0815C7FC + b _0815C8DA + .pool +_0815C7F4: + mov r2, r8 + cmp r2, 0x2 + beq _0815C8C8 + b _0815C8DA +_0815C7FC: + movs r3, 0x80 + lsls r3, 2 + adds r0, r3, 0 + ldrh r1, [r7, 0xC] + adds r2, r0, r1 + strh r2, [r7, 0xC] + lsls r0, r2, 16 + asrs r0, 16 + ldrh r3, [r7, 0x24] + mov r8, r3 + movs r3, 0x24 + ldrsh r1, [r7, r3] + cmp r0, r1 + blt _0815C8DA + mov r0, r8 + subs r5, r0, r2 + lsls r5, 16 + asrs r5, 16 + adds r6, r1, 0 + lsls r6, 1 + adds r0, r5, 0 + adds r1, r6, 0 + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + asrs r4, 16 + movs r1, 0x1 + ands r4, r1 + cmp r4, 0 + bne _0815C854 + lsls r0, 16 + asrs r0, 16 + mov r2, r8 + subs r0, r2, r0 + b _0815C8B2 +_0815C854: + lsls r0, 16 + asrs r0, 16 + mov r3, r8 + subs r0, r3 + strh r0, [r7, 0xC] + b _0815C8DA +_0815C860: + ldr r1, =0xfffffe00 + adds r0, r1, 0 + ldrh r2, [r7, 0xC] + adds r1, r0, r2 + strh r1, [r7, 0xC] + movs r3, 0xC + ldrsh r0, [r7, r3] + movs r2, 0x24 + ldrsh r6, [r7, r2] + cmn r0, r6 + bgt _0815C8DA + ldrh r3, [r7, 0x24] + mov r9, r3 + mov r0, r9 + subs r4, r0, r1 + lsls r4, 16 + asrs r4, 16 + lsls r6, 1 + adds r0, r4, 0 + adds r1, r6, 0 + bl __divsi3 + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 16 + lsrs r2, r0, 16 + mov r1, r8 + ands r1, r5 + lsls r0, r1, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _0815C8BC + lsls r0, r2, 16 + asrs r0, 16 + mov r2, r9 + subs r0, r2 +_0815C8B2: + strh r0, [r7, 0xC] + strh r1, [r7, 0x8] + b _0815C8DA + .pool +_0815C8BC: + lsls r0, r2, 16 + asrs r0, 16 + mov r3, r9 + subs r0, r3, r0 + strh r0, [r7, 0xC] + b _0815C8DA +_0815C8C8: + ldrh r0, [r7, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + adds r0, r4, 0 + bl move_anim_task_del + b _0815C950 +_0815C8DA: + ldrh r0, [r7, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r7, 0xC] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r7, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r2, 0xC + ldrsh r0, [r7, r2] + cmp r0, 0 + bge _0815C90E + adds r0, 0x3F +_0815C90E: + asrs r0, 6 + negs r0, r0 + strh r0, [r1, 0x24] + ldrh r0, [r7, 0xA] + adds r0, 0x1 + strh r0, [r7, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0815C950 + ldrh r1, [r7, 0x20] + movs r3, 0x20 + ldrsh r0, [r7, r3] + cmp r0, 0 + beq _0815C94C + subs r0, r1, 0x1 + strh r0, [r7, 0x20] + ldrh r0, [r7, 0x24] + ldrh r1, [r7, 0x22] + subs r0, r1 + strh r0, [r7, 0x24] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bgt _0815C950 + movs r0, 0x10 + strh r0, [r7, 0x24] + b _0815C950 + .pool +_0815C94C: + movs r0, 0x2 + strh r0, [r7, 0x8] +_0815C950: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815C7C4 + + thumb_func_start sub_815C95C +sub_815C95C: @ 815C95C + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815C9BC + ldr r6, =gBattleAnimArgs + movs r2, 0x4 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _0815C990 + ldr r4, =gAnimationBankAttacker + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] +_0815C990: + ldrh r0, [r6] + ldrh r1, [r5, 0x20] + adds r0, r1 + strh r0, [r5, 0x20] + ldrh r1, [r6, 0x2] + ldrh r2, [r5, 0x22] + adds r0, r1, r2 + strh r0, [r5, 0x22] + movs r0, 0x80 + strh r0, [r5, 0x30] + movs r0, 0xC0 + lsls r0, 2 + strh r0, [r5, 0x32] + strh r1, [r5, 0x34] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _0815CA1A + .pool +_0815C9BC: + ldrh r1, [r5, 0x30] + lsls r0, r1, 16 + asrs r0, 24 + strh r0, [r5, 0x24] + ldrh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r2, [r5, 0x26] + adds r0, r2 + strh r0, [r5, 0x26] + movs r2, 0x36 + ldrsh r0, [r5, r2] + adds r4, r1, 0 + cmp r0, 0 + bne _0815C9FA + movs r0, 0x26 + ldrsh r1, [r5, r0] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmn r1, r0 + ble _0815C9FA + movs r0, 0x1 + strh r0, [r5, 0x36] + movs r1, 0x32 + ldrsh r0, [r5, r1] + negs r0, r0 + movs r1, 0x3 + bl __divsi3 + lsls r0, 1 + strh r0, [r5, 0x32] +_0815C9FA: + adds r0, r4, 0 + adds r0, 0xC0 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x80 + strh r0, [r5, 0x32] + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0815CA1A + adds r0, r5, 0 + bl move_anim_8072740 +_0815CA1A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815C95C + + thumb_func_start sub_815CA20 +sub_815CA20: @ 815CA20 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _0815CB2C + ldr r0, =gBattleAnimArgs + movs r3, 0 + ldrsh r1, [r0, r3] + mov r8, r0 + cmp r1, 0 + bne _0815CA5C + ldr r0, =gAnimationBankAttacker + b _0815CA5E + .pool +_0815CA5C: + ldr r0, =gAnimationBankTarget +_0815CA5E: + ldrb r0, [r0] + strh r0, [r2, 0x1E] + mov r1, r8 + ldrb r0, [r1] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r4, r7, 2 + adds r0, r4, r7 + lsls r0, 3 + adds r6, r0, r1 + strh r5, [r6, 0x1C] + adds r0, r5, 0 + movs r1, 0 + bl sub_80A7270 + mov r2, r8 + movs r3, 0x2 + ldrsh r0, [r2, r3] + cmp r0, 0x1 + beq _0815CAC0 + cmp r0, 0x1 + bgt _0815CAA0 + cmp r0, 0 + beq _0815CAA8 + lsls r2, r5, 4 + b _0815CB08 + .pool +_0815CAA0: + cmp r0, 0x2 + beq _0815CACA + lsls r2, r5, 4 + b _0815CB08 +_0815CAA8: + movs r2, 0xA0 + lsls r2, 1 + adds r0, r5, 0 + movs r1, 0xE0 + movs r3, 0 + bl obj_id_set_rotscale + adds r0, r5, 0 + bl sub_80A7E6C + lsls r2, r5, 4 + b _0815CB08 +_0815CAC0: + movs r2, 0x98 + lsls r2, 1 + movs r3, 0xF0 + lsls r3, 4 + b _0815CAD2 +_0815CACA: + movs r2, 0x98 + lsls r2, 1 + movs r3, 0xF1 + lsls r3, 8 +_0815CAD2: + adds r0, r5, 0 + movs r1, 0xD0 + bl obj_id_set_rotscale + adds r0, r5, 0 + bl sub_80A7E6C + bl IsContest + lsls r0, 24 + cmp r0, 0 + bne _0815CAF8 + ldrb r0, [r6, 0x1E] + bl GetBankSide + lsls r0, 24 + lsls r2, r5, 4 + cmp r0, 0 + bne _0815CB08 +_0815CAF8: + ldr r0, =gSprites + lsls r2, r5, 4 + adds r1, r2, r5 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x10 + strh r0, [r1, 0x26] +_0815CB08: + ldr r1, =gSprites + adds r0, r2, r5 + lsls r0, 2 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x24] + ldr r0, =gTasks + adds r1, r4, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815CB78 + .pool +_0815CB2C: + ldrb r5, [r2, 0x1C] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + movs r4, 0 + strh r0, [r2, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0815CB50 + strh r4, [r2, 0xC] + ldr r0, =gSprites + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x24] + negs r0, r0 + strh r0, [r1, 0x24] +_0815CB50: + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + bne _0815CB78 + adds r0, r5, 0 + bl sub_80A7344 + ldr r1, =gSprites + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + strh r4, [r0, 0x24] + strh r4, [r0, 0x26] + adds r0, r7, 0 + bl move_anim_task_del +_0815CB78: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815CA20 + + thumb_func_start sub_815CB88 +sub_815CB88: @ 815CB88 + push {r4,r5,lr} + adds r4, r0, 0 + bl Random2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xC + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, r0 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + bl Random2 + ldr r5, =0x000001ff + ands r5, r0 + bl Random2 + movs r1, 0xFF + ands r1, r0 + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _0815CBE0 + movs r2, 0xBC + lsls r2, 3 + adds r0, r5, r2 + b _0815CBE8 + .pool +_0815CBE0: + movs r3, 0xBC + lsls r3, 3 + adds r0, r3, 0 + subs r0, r5 +_0815CBE8: + strh r0, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815CBFA + movs r2, 0x90 + lsls r2, 3 + adds r0, r1, r2 + b _0815CC02 +_0815CBFA: + movs r3, 0x90 + lsls r3, 3 + adds r0, r3, 0 + subs r0, r1 +_0815CC02: + strh r0, [r4, 0x30] + ldr r0, =gBattleAnimArgs + ldrh r0, [r0] + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + bne _0815CC1C + ldr r0, =0x0000fff8 + b _0815CC1E + .pool +_0815CC1C: + movs r0, 0xF8 +_0815CC1E: + strh r0, [r4, 0x20] + movs r0, 0x68 + strh r0, [r4, 0x22] + ldr r0, =sub_815CC34 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815CB88 + + thumb_func_start sub_815CC34 +sub_815CC34: @ 815CC34 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815CC4C + ldrh r3, [r4, 0x2E] + lsls r0, r3, 16 + asrs r0, 24 + ldrh r1, [r4, 0x24] + adds r0, r1 + b _0815CC56 +_0815CC4C: + ldrh r3, [r4, 0x2E] + lsls r1, r3, 16 + asrs r1, 24 + ldrh r0, [r4, 0x24] + subs r0, r1 +_0815CC56: + strh r0, [r4, 0x24] + ldrh r2, [r4, 0x30] + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x26] + subs r0, r1 + strh r0, [r4, 0x26] + adds r0, r3, 0 + subs r0, 0x16 + strh r0, [r4, 0x2E] + adds r1, r2, 0 + subs r1, 0x30 + strh r1, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bge _0815CC7A + movs r0, 0 + strh r0, [r4, 0x2E] +_0815CC7A: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _0815CC8E + adds r0, r4, 0 + bl move_anim_8072740 +_0815CC8E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815CC34 + + thumb_func_start sub_815CC94 +sub_815CC94: @ 815CC94 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, =0x00001f3f + movs r0, 0x4A + bl SetGpuReg + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl SetGpuRegBits + ldr r0, =gUnknown_02022E24 + movs r1, 0 + strh r1, [r0] + ldr r4, =gUnknown_02022E26 + strh r1, [r4] + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x44 + bl SetGpuReg + ldr r0, =gBattleAnimArgs + ldrh r0, [r0, 0x4] + strh r0, [r5, 0x2E] + adds r0, r5, 0 + movs r1, 0 + bl sub_80A6980 + ldrb r1, [r5, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r5, 0x1] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_815CD0C + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815CC94 + + thumb_func_start sub_815CD0C +sub_815CD0C: @ 815CD0C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0815CD4A + cmp r0, 0x1 + bgt _0815CD22 + cmp r0, 0 + beq _0815CD2C + b _0815CDAA +_0815CD22: + cmp r0, 0x2 + beq _0815CD60 + cmp r0, 0x3 + beq _0815CD82 + b _0815CDAA +_0815CD2C: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815CDAA + b _0815CD7A +_0815CD4A: + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _0815CDAA + adds r0, r4, 0 + movs r1, 0x1 + bl ChangeSpriteAffineAnim + b _0815CD7A +_0815CD60: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815CDAA + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_0815CD7A: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + b _0815CDAA +_0815CD82: + ldr r1, =0x00003f3f + movs r0, 0x4A + bl SetGpuReg + movs r0, 0 + bl GetGpuReg + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_8072740 +_0815CDAA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815CD0C + + thumb_func_start sub_815CDB4 +sub_815CDB4: @ 815CDB4 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =gAnimationBankAttacker + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r1, =gBattleAnimArgs + ldrh r0, [r1] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x30] + ldr r1, =sub_815CDFC + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815CDB4 + + thumb_func_start sub_815CDFC +sub_815CDFC: @ 815CDFC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + bl Sin + strh r0, [r4, 0x24] + movs r2, 0x30 + ldrsh r0, [r4, r2] + ldrh r1, [r4, 0x34] + lsls r1, 16 + asrs r1, 24 + bl Cos + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x9 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + lsls r1, r0, 16 + cmp r0, 0x3F + bls _0815CE36 + asrs r0, r1, 16 + cmp r0, 0xC3 + ble _0815CE48 +_0815CE36: + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl sub_80A82E4 + subs r0, 0x1 + b _0815CE52 + .pool +_0815CE48: + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl sub_80A82E4 + adds r0, 0x1 +_0815CE52: + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + movs r3, 0x38 + ldrsh r2, [r4, r3] + cmp r2, 0 + bne _0815CE98 + movs r1, 0x80 + lsls r1, 3 + adds r0, r1, 0 + ldrh r3, [r4, 0x32] + adds r0, r3 + strh r0, [r4, 0x32] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r3, [r4, 0x34] + adds r0, r3 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x2E + ldrsh r1, [r4, r3] + cmp r0, r1 + bne _0815CEC8 + strh r2, [r4, 0x36] + movs r0, 0x1 + strh r0, [r4, 0x38] + b _0815CEC8 + .pool +_0815CE98: + cmp r2, 0x1 + bne _0815CEC8 + ldr r1, =0xfffffc00 + adds r0, r1, 0 + ldrh r2, [r4, 0x32] + adds r0, r2 + strh r0, [r4, 0x32] + ldr r3, =0xffffff00 + adds r0, r3, 0 + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x2E + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _0815CEC8 + adds r0, r4, 0 + bl move_anim_8072740 +_0815CEC8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815CDFC + + thumb_func_start sub_815CED8 +sub_815CED8: @ 815CED8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + movs r0, 0 + bl GetAnimBankSpriteId + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _0815CF18 + movs r0, 0x1 + str r0, [sp, 0x1C] + ldr r0, =gUnknown_02039F34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldr r1, [r0, 0x10] + mov r9, r1 + ldr r2, [r0, 0xC] + mov r8, r2 + ldrh r6, [r0, 0x2] + movs r3, 0x14 + b _0815D058 + .pool +_0815CF18: + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _0815CFC4 + movs r0, 0 + str r0, [sp, 0x1C] + ldr r6, =gBattlePartyID + ldr r4, =gAnimationBankTarget + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r7, =gPlayerParty + adds r0, r7 + movs r1, 0 + bl GetMonData + mov r9, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r7 + movs r1, 0x1 + bl GetMonData + mov r8, r0 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815CFBC + adds r0, r2, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0815CF9C + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r7 + b _0815CFAA + .pool +_0815CF9C: + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 +_0815CFAA: + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + b _0815CFBE + .pool +_0815CFBC: + ldrh r6, [r1, 0x2] +_0815CFBE: + movs r1, 0x14 + mov r10, r1 + b _0815D05A +_0815CFC4: + movs r2, 0x1 + str r2, [sp, 0x1C] + ldr r6, =gBattlePartyID + ldr r4, =gAnimationBankTarget + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r7, =gEnemyParty + adds r0, r7 + movs r1, 0 + bl GetMonData + mov r9, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r7 + movs r1, 0x1 + bl GetMonData + mov r8, r0 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815D054 + adds r0, r2, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0815D03C + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + b _0815D048 + .pool +_0815D03C: + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r7 +_0815D048: + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + b _0815D056 +_0815D054: + ldrh r6, [r1, 0x2] +_0815D056: + ldr r3, =0x0000ffec +_0815D058: + mov r10, r3 +_0815D05A: + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl sub_80A8328 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, =gAnimationBankAttacker + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + mov r2, r10 + lsls r1, r2, 16 + asrs r1, 16 + adds r4, r1 + lsls r4, 16 + asrs r4, 16 + lsrs r0, 24 + str r0, [sp] + movs r0, 0x5 + str r0, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + mov r0, r8 + str r0, [sp, 0xC] + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + str r0, [sp, 0x10] + movs r0, 0x1 + str r0, [sp, 0x14] + adds r0, r6, 0 + ldr r1, [sp, 0x1C] + movs r2, 0 + adds r3, r4, 0 + bl sub_80A8394 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =gSprites + lsls r5, r6, 4 + adds r5, r6 + lsls r5, 2 + adds r5, r0 + movs r0, 0x3 + ands r7, r0 + lsls r7, 2 + mov r8, r7 + ldrb r0, [r5, 0x5] + movs r4, 0xD + negs r4, r4 + adds r1, r4, 0 + ands r1, r0 + mov r2, r8 + orrs r1, r2 + strb r1, [r5, 0x5] + ldrb r2, [r5, 0x1] + adds r0, r4, 0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + strb r0, [r5, 0x1] + ldr r0, =0x00007fff + lsrs r1, 4 + lsls r1, 4 + movs r3, 0x80 + lsls r3, 1 + adds r2, r3, 0 + orrs r1, r2 + movs r2, 0x20 + bl FillPalette + ldrb r0, [r5, 0x5] + ands r4, r0 + mov r0, r8 + orrs r4, r0 + strb r4, [r5, 0x5] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldr r0, =gTasks + ldr r1, [sp, 0x18] + lsls r4, r1, 2 + adds r4, r1 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0xA] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + strh r6, [r4, 0x8] + ldr r0, =sub_815D160 + str r0, [r4] + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815CED8 + + thumb_func_start sub_815D160 +sub_815D160: @ 815D160 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815D1AE + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xA + bne _0815D1AE + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x1C] + strh r0, [r4, 0x1E] + ldr r0, =sub_815D1BC + str r0, [r4] +_0815D1AE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D160 + + thumb_func_start sub_815D1BC +sub_815D1BC: @ 815D1BC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + ldrb r2, [r5, 0x8] + ldrh r0, [r5, 0x1C] + subs r0, 0x10 + movs r4, 0 + strh r0, [r5, 0x1C] + ldrh r0, [r5, 0x1E] + adds r0, 0x80 + strh r0, [r5, 0x1E] + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r6, r0, r1 + ldrb r2, [r6, 0x1] + lsls r1, r2, 30 + lsrs r1, 30 + movs r0, 0x2 + orrs r1, r0 + subs r0, 0x6 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x1] + movs r0, 0x1C + ldrsh r2, [r5, r0] + movs r0, 0x1E + ldrsh r3, [r5, r0] + str r4, [sp] + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80A73E0 + ldrh r0, [r5, 0x20] + adds r0, 0x1 + strh r0, [r5, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _0815D22A + adds r0, r6, 0 + bl sub_80A749C + adds r0, r6, 0 + bl sub_80A8610 + ldr r0, =sub_80A6814 + str r0, [r5] +_0815D22A: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D1BC + + thumb_func_start sub_815D240 +sub_815D240: @ 815D240 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + adds r4, r1, r0 + ldr r0, =gBattleAnimArgs + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815D26C + ldr r0, =gAnimationBankAttacker + b _0815D26E + .pool +_0815D26C: + ldr r0, =gAnimationBankTarget +_0815D26E: + ldrb r5, [r0] + movs r6, 0 + strh r6, [r4, 0x8] + strh r6, [r4, 0xA] + strh r6, [r4, 0xC] + movs r0, 0x10 + strh r0, [r4, 0xE] + strh r6, [r4, 0x10] + strh r5, [r4, 0x12] + movs r0, 0x20 + strh r0, [r4, 0x14] + strh r6, [r4, 0x16] + movs r0, 0x18 + strh r0, [r4, 0x18] + adds r0, r5, 0 + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815D2A0 + movs r1, 0x18 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x18] +_0815D2A0: + adds r0, r5, 0 + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x22 + strh r0, [r4, 0x22] + cmp r0, 0 + bge _0815D2B4 + strh r6, [r4, 0x22] +_0815D2B4: + ldrh r0, [r4, 0x22] + adds r0, 0x42 + strh r0, [r4, 0x24] + ldr r0, =gBattleAnimArgs + ldrb r0, [r0] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + adds r0, r5, 0 + bl GetBankIdentity_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815D304 + ldr r0, =0x04000014 + str r0, [sp] + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + ldr r0, =gUnknown_02022E18 + ldrh r5, [r0] + ldr r0, =gUnknown_02022E1A + b _0815D316 + .pool +_0815D304: + ldr r0, =0x04000018 + str r0, [sp] + ldr r1, =0x00003f44 + movs r0, 0x50 + bl SetGpuReg + ldr r0, =gUnknown_02022E1C + ldrh r5, [r0] + ldr r0, =gUnknown_02022E1E +_0815D316: + ldrh r3, [r0] + movs r7, 0 + movs r2, 0 + ldr r6, =gUnknown_02038C28 + movs r0, 0xF0 + lsls r0, 3 + adds r0, r6 + mov r12, r0 +_0815D326: + lsls r2, 16 + asrs r2, 16 + lsls r1, r2, 1 + adds r0, r1, r6 + strh r5, [r0] + add r1, r12 + strh r5, [r1] + adds r0, r2, 0x1 + lsls r0, 1 + adds r1, r0, r6 + strh r3, [r1] + add r0, r12 + strh r3, [r0] + lsls r0, r7, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + adds r2, 0x2 + lsls r2, 16 + lsrs r2, 16 + lsrs r7, r0, 16 + asrs r0, 16 + cmp r0, 0x9F + ble _0815D326 + ldr r0, =0xa6600001 + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, =sub_815D398 + str r0, [r4] + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D240 + + thumb_func_start sub_815D398 +sub_815D398: @ 815D398 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + adds r6, r0, r1 + ldrb r0, [r6, 0x12] + bl GetBankIdentity_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815D3D8 + ldr r0, =gUnknown_02022E18 + ldrh r0, [r0] + str r0, [sp, 0x4] + ldr r0, =gUnknown_02022E1A + b _0815D3E0 + .pool +_0815D3D8: + ldr r0, =gUnknown_02022E1C + ldrh r0, [r0] + str r0, [sp, 0x4] + ldr r0, =gUnknown_02022E1E +_0815D3E0: + ldrh r0, [r0] + str r0, [sp, 0x8] + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + bne _0815D3EE + b _0815D5CC +_0815D3EE: + cmp r0, 0x1 + bgt _0815D400 + cmp r0, 0 + beq _0815D40E + b _0815D63C + .pool +_0815D400: + cmp r0, 0x2 + bne _0815D406 + b _0815D5EC +_0815D406: + cmp r0, 0x3 + bne _0815D40C + b _0815D636 +_0815D40C: + b _0815D63C +_0815D40E: + movs r2, 0x24 + ldrsh r0, [r6, r2] + lsls r0, 17 + lsrs r5, r0, 16 + movs r3, 0 + str r3, [sp] + mov r9, r3 + movs r4, 0 + ldrh r0, [r6, 0xA] + adds r0, 0x2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r6, 0xA] + ldrh r7, [r6, 0xA] + mov r8, r7 + movs r0, 0x14 + ldrsh r1, [r6, r0] + movs r0, 0xFC + lsls r0, 3 + bl __divsi3 + strh r0, [r6, 0x1A] + movs r1, 0x16 + ldrsh r0, [r6, r1] + lsls r0, 1 + movs r2, 0x1A + ldrsh r1, [r6, r2] + bl __divsi3 + negs r0, r0 + strh r0, [r6, 0x1C] + ldrh r0, [r6, 0x16] + strh r0, [r6, 0x1E] + lsls r0, 16 + asrs r0, 21 + lsls r0, 16 + lsrs r7, r0, 16 + strh r7, [r6, 0x20] + ldrh r2, [r6, 0x24] + lsls r3, r2, 16 + mov r12, r3 + asrs r1, r3, 16 + movs r3, 0x22 + ldrsh r0, [r6, r3] + cmp r1, r0 + ble _0815D52E + ldr r0, =gUnknown_02039B28 + mov r10, r0 + ldr r1, [sp, 0x4] + lsls r0, r1, 16 + asrs r0, 16 + str r0, [sp, 0x10] + ldr r2, [sp, 0x8] + lsls r0, r2, 16 + asrs r0, 16 + str r0, [sp, 0xC] +_0815D47E: + lsls r5, 16 + asrs r5, 16 + adds r2, r5, 0x1 + lsls r2, 1 + mov r3, r10 + ldrb r1, [r3, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + ldr r0, =gUnknown_02038C28 + adds r2, r0 + lsls r4, 16 + asrs r4, 16 + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + subs r0, r4, r0 + ldr r3, [sp, 0xC] + adds r0, r3, r0 + strh r0, [r2] + lsls r3, r5, 1 + mov r0, r10 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r3, r0 + ldr r1, =gUnknown_02038C28 + adds r3, r1 + lsls r1, r7, 16 + asrs r1, 16 + ldr r2, [sp, 0x10] + adds r1, r2, r1 + mov r7, r8 + lsls r2, r7, 16 + asrs r2, 16 + lsls r0, r2, 1 + ldr r7, =gSineTable + adds r0, r7 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 + adds r1, r0 + strh r1, [r3] + adds r2, 0xA + mov r8, r2 + movs r0, 0xFF + mov r1, r8 + ands r1, r0 + mov r8, r1 + ldrh r0, [r6, 0x1C] + ldrh r2, [r6, 0x1E] + adds r0, r2 + strh r0, [r6, 0x1E] + lsls r0, 16 + asrs r0, 21 + lsls r0, 16 + lsrs r7, r0, 16 + strh r7, [r6, 0x20] + adds r4, 0x1 + lsls r4, 16 + lsrs r4, 16 + subs r5, 0x2 + lsls r5, 16 + lsrs r5, 16 + ldr r3, [sp] + lsls r0, r3, 16 + asrs r0, 16 + ldrh r1, [r6, 0x14] + adds r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + str r2, [sp] + asrs r0, 21 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r0, =0xffff0000 + add r0, r12 + lsrs r2, r0, 16 + lsls r3, r2, 16 + mov r12, r3 + asrs r1, r3, 16 + movs r3, 0x22 + ldrsh r0, [r6, r3] + cmp r1, r0 + bgt _0815D47E +_0815D52E: + lsls r1, r2, 17 + cmp r1, 0 + blt _0815D55A + ldr r4, =gUnknown_02038C28 + ldr r7, [sp, 0x4] + lsls r0, r7, 16 + asrs r0, 16 + adds r3, r0, 0 + adds r3, 0xF0 + movs r0, 0xF0 + lsls r0, 3 + adds r5, r4, r0 +_0815D546: + asrs r2, r1, 16 + lsls r1, r2, 1 + adds r0, r1, r4 + strh r3, [r0] + adds r1, r5 + strh r3, [r1] + subs r2, 0x2 + lsls r1, r2, 16 + cmp r1, 0 + bge _0815D546 +_0815D55A: + ldrh r0, [r6, 0x14] + adds r0, 0x1 + strh r0, [r6, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _0815D5C2 + movs r0, 0x40 + strh r0, [r6, 0x14] + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815D594 + ldrh r0, [r6, 0xE] + subs r0, 0x1 + strh r0, [r6, 0xE] + b _0815D59A + .pool +_0815D594: + ldrh r0, [r6, 0x10] + adds r0, 0x1 + strh r0, [r6, 0x10] +_0815D59A: + ldrh r1, [r6, 0x10] + lsls r1, 8 + ldrh r0, [r6, 0xE] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0xE + ldrsh r1, [r6, r2] + cmp r1, 0 + bne _0815D63C + movs r3, 0x10 + ldrsh r0, [r6, r3] + cmp r0, 0x10 + bne _0815D63C + strh r1, [r6, 0xC] + strh r1, [r6, 0xE] + b _0815D62E +_0815D5C2: + ldrh r0, [r6, 0x18] + ldrh r7, [r6, 0x16] + adds r0, r7 + strh r0, [r6, 0x16] + b _0815D63C +_0815D5CC: + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + ble _0815D63C + ldr r1, =gUnknown_02039B28 + movs r0, 0x3 + strb r0, [r1, 0x15] + movs r0, 0 + strh r0, [r6, 0xC] + b _0815D62E + .pool +_0815D5EC: + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815D602 + ldrh r0, [r6, 0xE] + adds r0, 0x1 + strh r0, [r6, 0xE] + b _0815D608 +_0815D602: + ldrh r0, [r6, 0x10] + subs r0, 0x1 + strh r0, [r6, 0x10] +_0815D608: + ldrh r1, [r6, 0x10] + lsls r1, 8 + ldrh r0, [r6, 0xE] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xE + ldrsh r0, [r6, r1] + cmp r0, 0x10 + bne _0815D63C + movs r2, 0x10 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _0815D63C + strh r0, [r6, 0xC] + strh r0, [r6, 0xE] +_0815D62E: + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _0815D63C +_0815D636: + adds r0, r4, 0 + bl move_anim_task_del +_0815D63C: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815D398 + + thumb_func_start sub_815D64C +sub_815D64C: @ 815D64C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, =gBattleAnimArgs + ldrb r0, [r0] + bl GetAnimBankSpriteId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x26] + ldr r2, =gUnknown_085CE5F0 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, =sub_815D694 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D64C + + thumb_func_start sub_815D694 +sub_815D694: @ 815D694 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r2, =gTasks + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + adds r1, r0, 0x1 + movs r5, 0 + strh r1, [r3, 0x8] + subs r0, 0x14 + lsls r0, 16 + lsrs r0, 16 + adds r6, r2, 0 + cmp r0, 0x16 + bhi _0815D6F8 + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815D708 + strh r5, [r3, 0xA] + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + movs r5, 0x1 + ands r0, r5 + cmp r0, 0 + bne _0815D6F8 + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + b _0815D708 + .pool +_0815D6F8: + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] +_0815D708: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r6 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815D720 + adds r0, r4, 0 + bl move_anim_task_del +_0815D720: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D694 + + thumb_func_start sub_815D72C +sub_815D72C: @ 815D72C + push {r4-r6,lr} + mov r6, r8 + push {r6} + mov r8, r0 + adds r5, r2, 0 + adds r0, r3, 0 + ldr r4, [sp, 0x14] + ldr r6, [sp, 0x18] + lsls r1, 16 + lsrs r1, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r6, 16 + lsrs r6, 16 + mov r2, r8 + strh r1, [r2, 0x20] + strh r5, [r2, 0x22] + lsls r1, 16 + asrs r1, 16 + lsls r2, r1, 4 + mov r3, r8 + strh r2, [r3, 0x36] + lsls r5, 16 + asrs r5, 16 + lsls r2, r5, 4 + strh r2, [r3, 0x38] + lsls r0, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 4 + adds r1, r6, 0 + bl __divsi3 + mov r1, r8 + strh r0, [r1, 0x3A] + lsls r4, 16 + asrs r4, 16 + subs r4, r5 + lsls r4, 4 + adds r0, r4, 0 + adds r1, r6, 0 + bl __divsi3 + mov r2, r8 + strh r0, [r2, 0x3C] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815D72C + + thumb_func_start sub_815D794 +sub_815D794: @ 815D794 + ldrh r1, [r0, 0x3A] + ldrh r2, [r0, 0x36] + adds r1, r2 + strh r1, [r0, 0x36] + ldrh r2, [r0, 0x3C] + ldrh r3, [r0, 0x38] + adds r2, r3 + strh r2, [r0, 0x38] + lsls r1, 16 + asrs r1, 20 + strh r1, [r0, 0x20] + lsls r2, 16 + asrs r2, 20 + strh r2, [r0, 0x22] + bx lr + thumb_func_end sub_815D794 + + thumb_func_start sub_815D7B4 +sub_815D7B4: @ 815D7B4 + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldrh r6, [r4, 0x20] + ldrh r5, [r4, 0x22] + bl sub_80A6838 + ldr r0, =gBattleAnimArgs + ldrb r1, [r0] + adds r0, r4, 0 + bl StartSpriteAffineAnim + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x22 + ldrsh r2, [r4, r0] + lsls r6, 16 + asrs r6, 16 + lsls r5, 16 + asrs r5, 16 + str r5, [sp] + movs r0, 0x40 + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r3, r6, 0 + bl sub_815D72C + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, =sub_815D804 + str r0, [r4, 0x1C] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D7B4 + + thumb_func_start sub_815D804 +sub_815D804: @ 815D804 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + movs r0, 0x2E + ldrsh r4, [r5, r0] + lsls r4, 3 + movs r0, 0xFF + ands r4, r0 + adds r0, r5, 0 + bl sub_815D794 + adds r0, r4, 0 + movs r1, 0x8 + bl Sin + strh r0, [r5, 0x26] + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x3A + ble _0815D86A + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815D86A + movs r0, 0 + strh r0, [r5, 0x30] + ldrh r1, [r5, 0x32] + adds r1, 0x1 + strh r1, [r5, 0x32] + movs r0, 0x1 + ands r1, r0 + adds r3, r5, 0 + adds r3, 0x3E + lsls r1, 2 + ldrb r2, [r3] + subs r0, 0x6 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0x3 + ble _0815D86A + adds r0, r5, 0 + bl move_anim_8074EE0 +_0815D86A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815D804 + + thumb_func_start sub_815D870 +sub_815D870: @ 815D870 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =gBattleAnimArgs + ldrh r0, [r6, 0x6] + strh r0, [r5, 0x2E] + ldrb r1, [r6] + adds r0, r5, 0 + bl StartSpriteAffineAnim + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _0815D896 + ldrh r0, [r6, 0x2] + negs r0, r0 + strh r0, [r6, 0x2] +_0815D896: + ldr r4, =gAnimationBankAttacker + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x2] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x4] + adds r0, r6 + strh r0, [r5, 0x22] + ldr r0, =sub_810E2C8 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D870 + + thumb_func_start sub_815D8D8 +sub_815D8D8: @ 815D8D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0 + ldr r2, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + subs r0, 0x1 + strh r0, [r3, 0x8] + movs r1, 0x14 + ldrsh r0, [r3, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + mov r8, r2 + cmp r0, 0 + beq _0815D95A + ldrh r0, [r3, 0xA] + subs r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0815D95A + movs r2, 0x1A + ldrsh r0, [r3, r2] + cmp r0, 0 + bne _0815D92C + ldrh r0, [r3, 0x10] + strh r0, [r3, 0x1A] + negs r0, r0 + strh r0, [r3, 0x10] + b _0815D92E + .pool +_0815D92C: + strh r7, [r3, 0x1A] +_0815D92E: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r2, r8 + adds r1, r0, r2 + movs r2, 0x1C + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0815D94A + ldrh r0, [r1, 0x12] + strh r0, [r1, 0x1C] + negs r0, r0 + strh r0, [r1, 0x12] + b _0815D94E +_0815D94A: + movs r0, 0 + strh r0, [r1, 0x1C] +_0815D94E: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + add r0, r8 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0xA] +_0815D95A: + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + ldrh r6, [r4, 0x16] + ldrh r7, [r4, 0x18] + movs r1, 0xC + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + mov r12, r2 + cmp r0, 0 + beq _0815D998 + ldr r3, =gSprites + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + lsrs r2, r6, 8 + ldrh r0, [r4, 0x1A] + subs r0, r2 + strh r0, [r1, 0x24] + adds r2, r3, 0 + b _0815D9AE + .pool +_0815D998: + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + lsrs r1, r6, 8 + ldrh r4, [r4, 0x1A] + adds r1, r4 + strh r1, [r0, 0x24] +_0815D9AE: + mov r1, r12 + adds r0, r1, r5 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + movs r1, 0xE + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0815D9E0 + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsrs r2, r7, 8 + ldrh r0, [r4, 0x1C] + subs r0, r2 + b _0815D9F2 + .pool +_0815D9E0: + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsrs r0, r7, 8 + ldrh r4, [r4, 0x1C] + adds r0, r4 +_0815D9F2: + strh r0, [r1, 0x26] + mov r2, r12 + adds r0, r2, r5 + lsls r0, 3 + add r0, r8 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0 + bgt _0815DA12 + adds r0, r5, 0 + bl DestroyTask + ldr r1, =gAnimVisualTaskCount + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_0815DA12: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D8D8 + + thumb_func_start sub_815DA20 +sub_815DA20: @ 815DA20 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r7, 0 + ldr r2, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + subs r0, 0x1 + strh r0, [r3, 0x8] + movs r1, 0x14 + ldrsh r0, [r3, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + mov r8, r2 + cmp r0, 0 + beq _0815DAA6 + ldrh r0, [r3, 0xA] + subs r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0815DAA6 + movs r2, 0x1A + ldrsh r0, [r3, r2] + cmp r0, 0 + bne _0815DA78 + ldrh r0, [r3, 0x10] + strh r0, [r3, 0x1A] + negs r0, r0 + strh r0, [r3, 0x10] + b _0815DA7A + .pool +_0815DA78: + strh r7, [r3, 0x1A] +_0815DA7A: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + mov r2, r8 + adds r1, r0, r2 + movs r2, 0x1C + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0815DA96 + ldrh r0, [r1, 0x12] + strh r0, [r1, 0x1C] + negs r0, r0 + strh r0, [r1, 0x12] + b _0815DA9A +_0815DA96: + movs r0, 0 + strh r0, [r1, 0x1C] +_0815DA9A: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + add r0, r8 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0xA] +_0815DAA6: + lsls r3, r6, 2 + adds r0, r3, r6 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + ldrh r2, [r4, 0xC] + ldr r1, =0x00007fff + adds r0, r1, 0 + ands r0, r2 + ldrh r2, [r4, 0x16] + adds r0, r2 + lsls r5, r0, 16 + lsrs r0, r5, 16 + mov r9, r0 + ldrh r0, [r4, 0xE] + ands r1, r0 + ldrh r2, [r4, 0x18] + adds r1, r2 + lsls r1, 16 + lsrs r7, r1, 16 + movs r1, 0xC + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + mov r12, r3 + cmp r0, 0 + beq _0815DB00 + ldr r3, =gSprites + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + lsrs r2, r5, 24 + ldrh r0, [r4, 0x1A] + subs r0, r2 + strh r0, [r1, 0x24] + adds r2, r3, 0 + b _0815DB16 + .pool +_0815DB00: + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + lsrs r1, r5, 24 + ldrh r4, [r4, 0x1A] + adds r1, r4 + strh r1, [r0, 0x24] +_0815DB16: + mov r1, r12 + adds r0, r1, r6 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + movs r1, 0xE + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0815DB48 + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsrs r2, r7, 8 + ldrh r0, [r4, 0x1C] + subs r0, r2 + b _0815DB5A + .pool +_0815DB48: + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsrs r0, r7, 8 + ldrh r4, [r4, 0x1C] + adds r0, r4 +_0815DB5A: + strh r0, [r1, 0x26] + mov r2, r12 + adds r0, r2, r6 + lsls r0, 3 + mov r1, r8 + adds r2, r0, r1 + mov r0, r9 + strh r0, [r2, 0x16] + strh r7, [r2, 0x18] + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + bgt _0815DB80 + movs r0, 0x1E + strh r0, [r2, 0x8] + movs r0, 0 + strh r0, [r2, 0x22] + ldr r0, =sub_815D8D8 + str r0, [r2] +_0815DB80: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DA20 + + thumb_func_start sub_815DB90 +sub_815DB90: @ 815DB90 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gTasks + mov r8, r0 + lsls r7, r6, 2 + adds r0, r7, r6 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + ldr r1, =gBankSpriteIds + ldr r2, =gAnimationBankAttacker + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r4, 0x26] + ldr r5, =gBattleAnimArgs + ldrh r0, [r5] + strh r0, [r4, 0x24] + ldrh r0, [r5] + strh r0, [r4, 0x8] + ldrh r0, [r5, 0xC] + strh r0, [r4, 0x22] + movs r3, 0x6 + ldrsh r0, [r5, r3] + cmp r0, 0 + beq _0815DBD4 + ldrh r0, [r4, 0x14] + ldr r3, =0xffff8000 + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r4, 0x14] +_0815DBD4: + ldrb r0, [r2] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _0815DC04 + ldrh r0, [r5, 0x2] + strh r0, [r4, 0xC] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0xE] + mov r3, r8 + adds r4, r7, 0 + b _0815DC74 + .pool +_0815DC04: + movs r7, 0x2 + ldrsh r0, [r5, r7] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0815DC20 + ldrh r1, [r5, 0x2] + ldr r0, =0x00007fff + ands r0, r1 + b _0815DC28 + .pool +_0815DC20: + ldrh r0, [r5, 0x2] + ldr r2, =0xffff8000 + adds r1, r2, 0 + orrs r0, r1 +_0815DC28: + strh r0, [r4, 0xC] + ldr r0, =gBattleAnimArgs + movs r3, 0x4 + ldrsh r1, [r0, r3] + movs r2, 0x80 + lsls r2, 8 + ands r1, r2 + adds r5, r0, 0 + cmp r1, 0 + beq _0815DC60 + ldr r3, =gTasks + lsls r4, r6, 2 + adds r1, r4, r6 + lsls r1, 3 + adds r1, r3 + ldrh r2, [r5, 0x4] + ldr r0, =0x00007fff + ands r0, r2 + b _0815DC72 + .pool +_0815DC60: + ldr r3, =gTasks + lsls r4, r6, 2 + adds r1, r4, r6 + lsls r1, 3 + adds r1, r3 + ldrh r2, [r5, 0x4] + ldr r7, =0xffff8000 + adds r0, r7, 0 + orrs r0, r2 +_0815DC72: + strh r0, [r1, 0xE] +_0815DC74: + adds r0, r4, r6 + lsls r0, 3 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x18] + strh r1, [r0, 0x16] + ldrh r1, [r5, 0x8] + strh r1, [r0, 0x10] + ldrh r1, [r5, 0xA] + strh r1, [r0, 0x12] + ldr r1, =sub_815DA20 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DB90 + + thumb_func_start sub_815DCA4 +sub_815DCA4: @ 815DCA4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + ldr r4, =gBattleAnimArgs + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815DCC4 + adds r0, r2, 0 + bl move_anim_task_del +_0815DCC4: + movs r0, 0 + strh r0, [r5, 0x8] + strh r0, [r5, 0xA] + strh r0, [r5, 0xC] + ldrh r0, [r4, 0x2] + strh r0, [r5, 0xE] + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815DCE8 + ldr r0, =gAnimationBankAttacker + b _0815DCEA + .pool +_0815DCE8: + ldr r0, =gAnimationBankTarget +_0815DCEA: + ldrb r4, [r0] + adds r0, r4, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x10] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + adds r0, r4, 0 + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] + ldr r0, =gBattleAnimArgs + ldrb r0, [r0] + bl GetAnimBankSpriteId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r5, 0x26] + ldr r2, =gUnknown_085CE74C + adds r0, r5, 0 + bl sub_80A7CFC + ldr r0, =sub_815DD48 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DCA4 + + thumb_func_start sub_815DD48 +sub_815DD48: @ 815DD48 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815DD6C + cmp r0, 0x1 + beq _0815DDCC + b _0815DDDA + .pool +_0815DD6C: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0815DD82 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_815DDE0 +_0815DD82: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x12 + bne _0815DD92 + adds r0, r5, 0 + movs r1, 0 + bl sub_815DDE0 +_0815DD92: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0815DDDA + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _0815DDB4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815DDDA +_0815DDB4: + strh r1, [r4, 0xA] + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE74C + adds r0, r4, 0 + bl sub_80A7CFC + b _0815DDDA + .pool +_0815DDCC: + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815DDDA + adds r0, r5, 0 + bl move_anim_task_del +_0815DDDA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815DD48 + + thumb_func_start sub_815DDE0 +sub_815DDE0: @ 815DDE0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r2, =gTasks + adds r4, r0, r2 + cmp r1, 0 + bne _0815DE08 + movs r1, 0x12 + movs r3, 0xEC + b _0815DE0C + .pool +_0815DE08: + movs r1, 0x1E + movs r3, 0x14 +_0815DE0C: + mov r2, sp + ldrh r0, [r4, 0x10] + subs r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0x10] + subs r0, r1 + subs r0, 0x4 + strh r0, [r2, 0x2] + ldrh r0, [r4, 0x10] + adds r0, r1 + strh r0, [r2, 0x4] + ldrh r0, [r4, 0x10] + adds r0, r1 + adds r0, 0x4 + strh r0, [r2, 0x6] + add r2, sp, 0x8 + lsls r1, r3, 24 + asrs r1, 24 + ldrh r0, [r4, 0x12] + adds r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0x12] + adds r0, r1 + adds r0, 0x6 + strh r0, [r2, 0x2] + movs r5, 0 + mov r8, r2 + ldr r7, =gSprites +_0815DE44: + lsls r0, r5, 1 + add r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x1 + ands r0, r5 + lsls r0, 1 + add r0, r8 + movs r3, 0 + ldrsh r2, [r0, r3] + ldrb r3, [r4, 0x14] + subs r3, 0x5 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_085CE76C + bl CreateSprite + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0815DE98 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r7 + movs r0, 0 + strh r0, [r1, 0x2E] + movs r0, 0x2 + cmp r5, 0x1 + bhi _0815DE86 + movs r2, 0x2 + negs r2, r2 + adds r0, r2, 0 +_0815DE86: + strh r0, [r1, 0x30] + ldr r0, =0x0000ffff + strh r0, [r1, 0x32] + strh r6, [r1, 0x34] + movs r0, 0x2 + strh r0, [r1, 0x36] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] +_0815DE98: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _0815DE44 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DDE0 + + thumb_func_start sub_815DEBC +sub_815DEBC: @ 815DEBC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x32] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + ble _0815DF02 + ldr r3, =gTasks + movs r0, 0x36 + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x34 + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl DestroySprite +_0815DF02: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DEBC + + thumb_func_start sub_815DF0C +sub_815DF0C: @ 815DF0C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gTasks + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r1, =gBattleAnimArgs + ldrh r0, [r1, 0x2] + strh r0, [r4, 0xA] + ldrb r0, [r1] + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gSprites + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0xC] + ldr r0, =sub_815DF64 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DF0C + + thumb_func_start sub_815DF64 +sub_815DF64: @ 815DF64 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815DFB4 + ldrh r0, [r4, 0xC] + ldr r2, =gUnknown_085CE784 + movs r3, 0x8 + ldrsh r1, [r4, r3] + lsls r1, 1 + adds r1, r2 + ldrh r3, [r1] + movs r1, 0x10 + movs r2, 0x8 + bl BlendPalette + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x17 + ble _0815DFA4 + movs r0, 0 + strh r0, [r4, 0x8] +_0815DFA4: + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + b _0815DFC6 + .pool +_0815DFB4: + ldrh r0, [r4, 0xC] + movs r1, 0x10 + movs r2, 0 + movs r3, 0 + bl BlendPalette + adds r0, r5, 0 + bl move_anim_task_del +_0815DFC6: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815DF64 + + thumb_func_start sub_815DFCC +sub_815DFCC: @ 815DFCC + push {lr} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + movs r2, 0xD0 + lsls r2, 1 + ldr r1, =gAnimationBankAttacker + ldrb r3, [r1] + ldr r1, =gBattleAnimArgs + ldrb r1, [r1] + str r1, [sp] + movs r1, 0xA + str r1, [sp, 0x4] + movs r1, 0x2 + str r1, [sp, 0x8] + movs r1, 0x1E + str r1, [sp, 0xC] + ldr r1, =gUnknown_08C2DC68 + str r1, [sp, 0x10] + ldr r1, =gUnknown_08C2DDC4 + str r1, [sp, 0x14] + ldr r1, =gUnknown_08C2DDA4 + str r1, [sp, 0x18] + movs r1, 0 + bl sub_8117854 + add sp, 0x1C + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DFCC + + thumb_func_start sub_815E01C +sub_815E01C: @ 815E01C + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =gAnimationBankAttacker + ldrb r0, [r6] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815E038 + ldr r1, =gBattleAnimArgs + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] +_0815E038: + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, =gBattleAnimArgs + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r5, 0x22] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815E080 + movs r0, 0xA0 + lsls r0, 2 + strh r0, [r5, 0x2E] + ldr r0, =0x0000fd80 + strh r0, [r5, 0x30] + b _0815E0A8 + .pool +_0815E080: + cmp r0, 0x1 + bne _0815E09A + adds r2, r5, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + movs r0, 0xA0 + lsls r0, 2 + strh r0, [r5, 0x2E] + strh r0, [r5, 0x30] + b _0815E0A8 +_0815E09A: + adds r0, r5, 0 + movs r1, 0x1 + bl StartSpriteAnim + movs r0, 0xA0 + lsls r0, 2 + strh r0, [r5, 0x2E] +_0815E0A8: + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _0815E0C8 + ldrh r0, [r5, 0x2E] + negs r0, r0 + strh r0, [r5, 0x2E] + adds r2, r5, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_0815E0C8: + ldr r0, =sub_815E0DC + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E01C + + thumb_func_start sub_815E0DC +sub_815E0DC: @ 815E0DC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x3A] + adds r0, r1 + strh r0, [r2, 0x3A] + ldrh r1, [r2, 0x30] + ldrh r3, [r2, 0x3C] + adds r1, r3 + strh r1, [r2, 0x3C] + lsls r0, 16 + asrs r0, 24 + strh r0, [r2, 0x24] + lsls r1, 16 + asrs r1, 24 + strh r1, [r2, 0x26] + ldrh r0, [r2, 0x38] + adds r0, 0x1 + strh r0, [r2, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xE + bne _0815E110 + adds r0, r2, 0 + bl move_anim_8072740 +_0815E110: + pop {r0} + bx r0 + thumb_func_end sub_815E0DC + + thumb_func_start sub_815E114 +sub_815E114: @ 815E114 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + adds r6, r1, r0 + bl IsContest + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0815E144 + movs r0, 0x8 + strh r0, [r6, 0x12] + movs r0, 0x3 + strh r0, [r6, 0x14] + movs r0, 0x1 + strh r0, [r6, 0x16] + b _0815E14E + .pool +_0815E144: + movs r0, 0xC + strh r0, [r6, 0x12] + movs r0, 0x3 + strh r0, [r6, 0x14] + strh r1, [r6, 0x16] +_0815E14E: + ldr r5, =gAnimationBankAttacker + ldrb r0, [r5] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0815E188 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0815E17C + adds r0, 0x3 +_0815E17C: + asrs r0, 2 + adds r0, r4, r0 + b _0815E1AC + .pool +_0815E188: + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0815E1A8 + adds r0, 0x3 +_0815E1A8: + asrs r0, 2 + subs r0, r4, r0 +_0815E1AC: + strh r0, [r6, 0x1E] + ldr r5, =gAnimationBankAttacker + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + adds r4, r0, 0 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0815E1D0 + adds r0, 0x3 +_0815E1D0: + asrs r0, 2 + subs r0, r4, r0 + strh r0, [r6, 0x20] + ldr r4, =gAnimationBankTarget + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x22] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x24] + ldr r0, =sub_815E20C + str r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E114 + + thumb_func_start sub_815E20C +sub_815E20C: @ 815E20C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + movs r0, 0x8 + ldrsh r1, [r5, r0] + cmp r1, 0 + beq _0815E238 + cmp r1, 0x1 + bne _0815E230 + b _0815E330 +_0815E230: + b _0815E33E + .pool +_0815E238: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0815E33E + strh r1, [r5, 0xA] + movs r1, 0x1E + ldrsh r0, [r5, r1] + movs r2, 0x20 + ldrsh r1, [r5, r2] + movs r3, 0x22 + ldrsh r2, [r5, r3] + movs r4, 0x24 + ldrsh r3, [r5, r4] + ldrb r4, [r5, 0x12] + str r4, [sp] + ldrb r4, [r5, 0xC] + str r4, [sp, 0x4] + add r4, sp, 0x10 + str r4, [sp, 0x8] + adds r4, 0x2 + str r4, [sp, 0xC] + bl sub_815E34C + movs r6, 0 + mov r8, r4 + ldr r4, =gSprites +_0815E272: + add r0, sp, 0x10 + movs r2, 0 + ldrsh r1, [r0, r2] + mov r3, r8 + movs r0, 0 + ldrsh r2, [r3, r0] + ldr r0, =gUnknown_085CE7EC + movs r3, 0x23 + bl CreateSprite + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _0815E306 + movs r1, 0x16 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815E2C6 + cmp r6, 0 + bne _0815E2B4 + lsls r2, r3, 4 + adds r1, r2, r3 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r5, 0x14] + negs r0, r0 + strh r0, [r1, 0x26] + strh r0, [r1, 0x24] + b _0815E2EE + .pool +_0815E2B4: + lsls r2, r3, 4 + adds r1, r2, r3 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r5, 0x14] + strh r0, [r1, 0x26] + ldrh r0, [r5, 0x14] + strh r0, [r1, 0x24] + b _0815E2EE +_0815E2C6: + cmp r6, 0 + bne _0815E2DC + lsls r2, r3, 4 + adds r1, r2, r3 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r5, 0x14] + negs r0, r0 + strh r0, [r1, 0x24] + ldrh r0, [r5, 0x14] + b _0815E2EC +_0815E2DC: + lsls r2, r3, 4 + adds r1, r2, r3 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r5, 0x14] + strh r0, [r1, 0x24] + ldrh r0, [r5, 0x14] + negs r0, r0 +_0815E2EC: + strh r0, [r1, 0x26] +_0815E2EE: + ldr r1, =gSprites + adds r0, r2, r3 + lsls r0, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x2E] + strh r7, [r0, 0x30] + movs r1, 0xA + strh r1, [r0, 0x32] + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] +_0815E306: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bls _0815E272 + ldrh r2, [r5, 0xC] + movs r3, 0xC + ldrsh r1, [r5, r3] + movs r4, 0x12 + ldrsh r0, [r5, r4] + cmp r1, r0 + bne _0815E324 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_0815E324: + adds r0, r2, 0x1 + strh r0, [r5, 0xC] + b _0815E33E + .pool +_0815E330: + movs r1, 0x1C + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815E33E + adds r0, r7, 0 + bl move_anim_task_del +_0815E33E: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815E20C + + thumb_func_start sub_815E34C +sub_815E34C: @ 815E34C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r4, [sp, 0x28] + ldr r5, [sp, 0x2C] + ldr r6, [sp, 0x30] + mov r9, r6 + ldr r6, [sp, 0x34] + mov r10, r6 + lsls r0, 16 + lsrs r0, 16 + mov r12, r0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + lsls r2, 16 + lsrs r2, 16 + adds r7, r2, 0 + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0x4] + lsls r4, 24 + lsrs r6, r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r8, r5 + cmp r5, 0 + bne _0815E394 + mov r2, r9 + strh r0, [r2] + mov r6, r10 + strh r1, [r6] + b _0815E3F2 +_0815E394: + cmp r5, r6 + bcc _0815E3A2 + mov r0, r9 + strh r2, [r0] + mov r1, r10 + strh r3, [r1] + b _0815E3F2 +_0815E3A2: + subs r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + mov r2, r12 + lsls r1, r2, 16 + asrs r1, 16 + lsls r5, r1, 8 + lsls r0, r7, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 8 + adds r1, r6, 0 + bl __divsi3 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r5, r0 + ldr r2, [sp] + lsls r1, r2, 16 + asrs r1, 16 + lsls r4, r1, 8 + ldr r2, [sp, 0x4] + lsls r0, r2, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 8 + adds r1, r6, 0 + bl __divsi3 + mov r6, r8 + muls r6, r0 + adds r0, r6, 0 + adds r4, r0 + asrs r5, 8 + mov r0, r9 + strh r5, [r0] + asrs r4, 8 + mov r1, r10 + strh r4, [r1] +_0815E3F2: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815E34C + + thumb_func_start sub_815E404 +sub_815E404: @ 815E404 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x24 + ble _0815E43A + ldr r3, =gTasks + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x30 + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl DestroySprite +_0815E43A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E404 + + thumb_func_start sub_815E444 +sub_815E444: @ 815E444 + push {r4,lr} + adds r4, r0, 0 + ldr r1, =gBattleAnimArgs + ldrh r0, [r1] + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x32] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x36] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x2E] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl StoreSpriteCallbackInData6 + ldr r0, =sub_80A70C0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E444 + + thumb_func_start sub_815E47C +sub_815E47C: @ 815E47C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + ldr r1, =gTasks + adds r7, r0, r1 + ldr r0, =gAnimationBankAttacker + mov r10, r0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x1E] + mov r1, r10 + ldrb r0, [r1] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x20] + ldr r0, =gAnimationBankTarget + mov r8, r0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x22] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x3 + bl sub_80A5C6C + adds r4, r0, 0 + mov r1, r8 + ldrb r0, [r1] + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0815E4EE + adds r0, 0x3 +_0815E4EE: + asrs r0, 2 + adds r0, r4, r0 + strh r0, [r7, 0x24] + ldr r4, =gUnknown_085CE84C + movs r0, 0x1E + ldrsh r5, [r7, r0] + movs r1, 0x20 + ldrsh r6, [r7, r1] + mov r1, r8 + ldrb r0, [r1] + bl sub_80A82E4 + adds r3, r0, 0 + subs r3, 0x5 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x26] + cmp r0, 0x40 + beq _0815E5B8 + ldr r4, =gSprites + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x10 + strh r1, [r0, 0x2E] + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r7, 0x22] + strh r1, [r0, 0x32] + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r7, 0x24] + strh r1, [r0, 0x36] + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ffe0 + strh r1, [r0, 0x38] + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl sub_80A68D4 + mov r1, r10 + ldrb r0, [r1] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815E596 + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAffineAnim +_0815E596: + ldr r0, =sub_815E5CC + str r0, [r7] + b _0815E5BE + .pool +_0815E5B8: + mov r0, r9 + bl move_anim_task_del +_0815E5BE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815E47C + + thumb_func_start sub_815E5CC +sub_815E5CC: @ 815E5CC + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0815E634 + cmp r1, 0x1 + bgt _0815E5F4 + cmp r1, 0 + beq _0815E5FE + b _0815E6D2 + .pool +_0815E5F4: + cmp r1, 0x2 + beq _0815E658 + cmp r1, 0x3 + beq _0815E6CC + b _0815E6D2 +_0815E5FE: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815E6D2 + strh r1, [r4, 0xA] + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl sub_80A6900 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0815E6D2 + b _0815E6BE + .pool +_0815E634: + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0815E6D2 + movs r0, 0 + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + b _0815E6BE + .pool +_0815E658: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815E6D2 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r2, [r4, 0xC] + adds r2, 0x1 + strh r2, [r4, 0xC] + ldr r5, =gSprites + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + movs r0, 0x1 + ands r2, r0 + adds r1, 0x3E + lsls r2, 2 + ldrb r3, [r1] + subs r0, 0x6 + ands r0, r3 + orrs r0, r2 + strb r0, [r1] + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _0815E6D2 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl DestroySprite +_0815E6BE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815E6D2 + .pool +_0815E6CC: + adds r0, r2, 0 + bl move_anim_task_del +_0815E6D2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815E5CC + + thumb_func_start sub_815E6D8 +sub_815E6D8: @ 815E6D8 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r0, =gBattleAnimArgs + movs r2, 0 + ldrsh r1, [r0, r2] + adds r6, r0, 0 + cmp r1, 0 + bne _0815E6F4 + ldr r0, =gAnimationBankAttacker + b _0815E6F6 + .pool +_0815E6F4: + ldr r0, =gAnimationBankTarget +_0815E6F6: + ldrb r5, [r0] + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x10 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + adds r1, r6, 0 + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x3A] + movs r2, 0x2 + ldrsh r0, [r1, r2] + movs r1, 0x1 + cmp r0, 0 + bne _0815E724 + movs r3, 0x1 + negs r3, r3 + adds r1, r3, 0 +_0815E724: + strh r1, [r4, 0x3C] + adds r0, r5, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + movs r1, 0x2 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815E768 + ldrb r2, [r4, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x8 + orrs r1, r0 + lsls r1, 1 + subs r0, 0x47 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80A861C + subs r0, 0x8 + b _0815E772 + .pool +_0815E768: + adds r0, r5, 0 + movs r1, 0x5 + bl sub_80A861C + adds r0, 0x8 +_0815E772: + strh r0, [r4, 0x20] + ldr r0, =sub_815E784 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E6D8 + + thumb_func_start sub_815E784 +sub_815E784: @ 815E784 + push {lr} + adds r2, r0, 0 + movs r0, 0x2E + ldrsh r1, [r2, r0] + cmp r1, 0x1 + beq _0815E7CC + cmp r1, 0x1 + bgt _0815E79A + cmp r1, 0 + beq _0815E7A4 + b _0815E83C +_0815E79A: + cmp r1, 0x2 + beq _0815E7DC + cmp r1, 0x3 + beq _0815E802 + b _0815E83C +_0815E7A4: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815E83C + strh r1, [r2, 0x30] + ldrh r0, [r2, 0x3C] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x32] + adds r0, 0x1 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bne _0815E83C + b _0815E7FA +_0815E7CC: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + bne _0815E83C + b _0815E7F6 +_0815E7DC: + movs r0, 0x3C + ldrsh r1, [r2, r0] + lsls r1, 2 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0815E83C +_0815E7F6: + movs r0, 0 + strh r0, [r2, 0x30] +_0815E7FA: + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + b _0815E83C +_0815E802: + movs r0, 0x3C + ldrsh r1, [r2, r0] + lsls r0, r1, 1 + adds r0, r1 + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + bne _0815E83C + ldrh r0, [r2, 0x3A] + subs r0, 0x1 + strh r0, [r2, 0x3A] + lsls r0, 16 + cmp r0, 0 + beq _0815E836 + movs r0, 0 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x2E] + subs r0, 0x1 + strh r0, [r2, 0x2E] + b _0815E83C +_0815E836: + adds r0, r2, 0 + bl move_anim_8072740 +_0815E83C: + pop {r0} + bx r0 + thumb_func_end sub_815E784 + + thumb_func_start sub_815E840 +sub_815E840: @ 815E840 + push {r4,lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r2, =gBattleAnimArgs + movs r3, 0 + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _0815E85C + adds r0, r1, 0 + bl move_anim_task_del + b _0815E884 + .pool +_0815E85C: + ldr r0, =gTasks + lsls r4, r1, 2 + adds r4, r1 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r2, 0x2] + strh r0, [r4, 0x8] + ldrb r0, [r2] + bl GetAnimBankSpriteId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x26] + ldr r2, =gUnknown_085CE87C + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, =sub_815E898 + str r0, [r4] +_0815E884: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E840 + + thumb_func_start sub_815E898 +sub_815E898: @ 815E898 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815E8F2 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815E8E0 + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + b _0815E8F0 + .pool +_0815E8E0: + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000fffe +_0815E8F0: + strh r1, [r0, 0x24] +_0815E8F2: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0815E94E + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + cmp r0, 0 + beq _0815E948 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + adds r0, r1 + ldrh r1, [r0, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE87C + bl sub_80A7CFC + strh r5, [r4, 0xA] + strh r5, [r4, 0xC] + b _0815E94E + .pool +_0815E948: + adds r0, r6, 0 + bl move_anim_task_del +_0815E94E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815E898 + + thumb_func_start sub_815E954 +sub_815E954: @ 815E954 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =gBattleAnimArgs + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815E970 + ldr r4, =gAnimationBankAttacker + b _0815E972 + .pool +_0815E970: + ldr r4, =gAnimationBankTarget +_0815E972: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + strh r0, [r5, 0x22] + movs r1, 0x22 + ldrsh r0, [r5, r1] + cmp r0, 0x7 + bgt _0815E996 + movs r0, 0x8 + strh r0, [r5, 0x22] +_0815E996: + movs r2, 0 + strh r2, [r5, 0x2E] + ldr r1, =gBattleAnimArgs + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x30] + strh r2, [r5, 0x32] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x34] + ldr r0, =sub_815E9BC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E954 + + thumb_func_start sub_815E9BC +sub_815E9BC: @ 815E9BC + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x30 + ldrsh r1, [r3, r2] + cmp r0, r1 + blt _0815EA10 + movs r0, 0 + strh r0, [r3, 0x2E] + ldrh r1, [r3, 0x32] + adds r1, 0x1 + movs r0, 0x1 + ands r1, r0 + strh r1, [r3, 0x32] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + lsls r1, 2 + ldrb r2, [r0] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + movs r2, 0x32 + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _0815EA10 + ldrh r0, [r3, 0x34] + subs r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + cmp r0, 0 + bne _0815EA10 + adds r0, r3, 0 + bl move_anim_8072740 +_0815EA10: + pop {r0} + bx r0 + thumb_func_end sub_815E9BC + + thumb_func_start sub_815EA14 +sub_815EA14: @ 815EA14 + push {lr} + adds r3, r0, 0 + ldr r0, =gBattleAnimArgs + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815EA44 + ldrb r2, [r3, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x8 + orrs r1, r0 + lsls r1, 1 + subs r0, 0x47 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x3] + movs r0, 0x64 + strh r0, [r3, 0x20] + movs r0, 0x1 + b _0815EA4A + .pool +_0815EA44: + movs r0, 0x8C + strh r0, [r3, 0x20] + ldr r0, =0x0000ffff +_0815EA4A: + strh r0, [r3, 0x3C] + movs r0, 0x38 + strh r0, [r3, 0x22] + ldr r0, =sub_815EA60 + str r0, [r3, 0x1C] + pop {r0} + bx r0 + .pool + thumb_func_end sub_815EA14 + + thumb_func_start sub_815EA60 +sub_815EA60: @ 815EA60 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x8 + bls _0815EA6E + b _0815EC40 +_0815EA6E: + lsls r0, 2 + ldr r1, =_0815EA7C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815EA7C: + .4byte _0815EAA0 + .4byte _0815EAD2 + .4byte _0815EAE4 + .4byte _0815EB24 + .4byte _0815EB36 + .4byte _0815EB74 + .4byte _0815EBD8 + .4byte _0815EBF8 + .4byte _0815EC1E +_0815EAA0: + movs r3, 0x3C + ldrsh r0, [r4, r3] + lsls r0, 1 + ldrh r1, [r4, 0x22] + subs r1, r0 + strh r1, [r4, 0x22] + ldrh r2, [r4, 0x30] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _0815EAC2 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + ldrh r0, [r4, 0x20] + subs r0, r1 + strh r0, [r4, 0x20] +_0815EAC2: + adds r0, r2, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + beq _0815EAD0 + b _0815EC40 +_0815EAD0: + b _0815EC12 +_0815EAD2: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + beq _0815EAE2 + b _0815EC40 +_0815EAE2: + b _0815EC12 +_0815EAE4: + ldrh r2, [r4, 0x30] + adds r2, 0x1 + strh r2, [r4, 0x30] + movs r3, 0x3C + ldrsh r1, [r4, r3] + lsls r0, r1, 1 + adds r0, r1 + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r3, =gSineTable + movs r0, 0x30 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x3C] + muls r0, r1 + strh r0, [r4, 0x24] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0xC + beq _0815EB1C + b _0815EC40 +_0815EB1C: + b _0815EC12 + .pool +_0815EB24: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + beq _0815EB34 + b _0815EC40 +_0815EB34: + b _0815EC12 +_0815EB36: + ldrh r2, [r4, 0x30] + adds r2, 0x1 + strh r2, [r4, 0x30] + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + ldrh r0, [r4, 0x22] + subs r0, r1 + strh r0, [r4, 0x22] + ldr r3, =gSineTable + movs r0, 0x30 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x3C] + muls r0, r1 + strh r0, [r4, 0x24] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0xC + bne _0815EC40 + b _0815EC16 + .pool +_0815EB74: + ldrh r2, [r4, 0x30] + adds r2, 0x1 + strh r2, [r4, 0x30] + movs r3, 0x3C + ldrsh r1, [r4, r3] + lsls r0, r1, 1 + adds r0, r1 + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r3, =gSineTable + movs r0, 0x30 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x3C] + muls r0, r1 + strh r0, [r4, 0x24] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0xF + bne _0815EBC0 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x10 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] +_0815EBC0: + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x12 + bne _0815EC40 + b _0815EC12 + .pool +_0815EBD8: + movs r3, 0x3C + ldrsh r0, [r4, r3] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + ldrh r0, [r4, 0x20] + adds r1, r0 + strh r1, [r4, 0x20] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _0815EC40 + b _0815EC12 +_0815EBF8: + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r0, 1 + ldrh r3, [r4, 0x20] + adds r0, r3 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _0815EC40 +_0815EC12: + movs r0, 0 + strh r0, [r4, 0x30] +_0815EC16: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815EC40 +_0815EC1E: + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + ldrh r0, [r4, 0x20] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0815EC40 + adds r0, r4, 0 + bl move_anim_8072740 +_0815EC40: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815EA60 + + thumb_func_start sub_815EC48 +sub_815EC48: @ 815EC48 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + adds r6, r1, r0 + movs r0, 0 + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x26] + bl IsContest + lsls r0, 24 + cmp r0, 0 + bne _0815ECD0 + bl battle_type_is_double + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x1 + bne _0815ECB4 + ldr r5, =gAnimationBankAttacker + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r1, [r5] + movs r0, 0x2 + eors r0, r1 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + ble _0815ECAC + strh r7, [r6, 0x24] + b _0815ECD4 + .pool +_0815ECAC: + ldr r0, =0x0000ffff + b _0815ECD2 + .pool +_0815ECB4: + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0815ECD0 + ldr r0, =0x0000ffff + b _0815ECD2 + .pool +_0815ECD0: + movs r0, 0x1 +_0815ECD2: + strh r0, [r6, 0x24] +_0815ECD4: + ldr r0, =sub_815ECE4 + str r0, [r6] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815EC48 + + thumb_func_start sub_815ECE4 +sub_815ECE4: @ 815ECE4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + adds r3, r0, r1 + movs r1, 0x8 + ldrsh r0, [r3, r1] + cmp r0, 0x8 + bls _0815ECFE + b _0815EE78 +_0815ECFE: + lsls r0, 2 + ldr r1, =_0815ED10 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815ED10: + .4byte _0815ED34 + .4byte _0815ED46 + .4byte _0815ED78 + .4byte _0815EDA8 + .4byte _0815EDCE + .4byte _0815EDF8 + .4byte _0815EE08 + .4byte _0815EE28 + .4byte _0815EE60 +_0815ED34: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + beq _0815ED44 + b _0815EE78 +_0815ED44: + b _0815EE50 +_0815ED46: + ldr r2, =gSprites + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0x24 + ldrsh r0, [r3, r2] + lsls r2, r0, 1 + adds r2, r0 + ldrh r0, [r1, 0x24] + subs r0, r2 + strh r0, [r1, 0x24] + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + beq _0815ED72 + b _0815EE78 +_0815ED72: + b _0815EE50 + .pool +_0815ED78: + ldr r2, =gSprites + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x24 + ldrsh r2, [r3, r0] + lsls r0, r2, 1 + adds r0, r2 + ldrh r2, [r1, 0x24] + adds r0, r2 + strh r0, [r1, 0x24] + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0815EE78 + b _0815EE50 + .pool +_0815EDA8: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _0815EE78 + movs r0, 0 + strh r0, [r3, 0xA] + ldrh r1, [r3, 0xC] + movs r2, 0xC + ldrsh r0, [r3, r2] + cmp r0, 0 + bne _0815EE54 + adds r0, r1, 0x1 + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0x8] + b _0815EE78 +_0815EDCE: + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x24] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0815EE78 + b _0815EE50 + .pool +_0815EDF8: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0815EE78 + b _0815EE50 +_0815EE08: + ldr r2, =gSprites + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x24 + ldrsh r2, [r3, r0] + lsls r2, 2 + ldrh r0, [r1, 0x24] + subs r0, r2 + b _0815EE40 + .pool +_0815EE28: + ldr r2, =gSprites + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0x24 + ldrsh r0, [r3, r2] + lsls r0, 2 + ldrh r2, [r1, 0x24] + adds r0, r2 +_0815EE40: + strh r0, [r1, 0x24] + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0815EE78 +_0815EE50: + movs r0, 0 + strh r0, [r3, 0xA] +_0815EE54: + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + b _0815EE78 + .pool +_0815EE60: + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x24] + adds r0, r4, 0 + bl move_anim_task_del +_0815EE78: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815ECE4 + + thumb_func_start sub_815EE84 +sub_815EE84: @ 815EE84 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gBattleAnimArgs + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815EEA8 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =gAnimationBankAttacker + b _0815EEAA + .pool +_0815EEA8: + ldr r0, =gAnimationBankTarget +_0815EEAA: + ldrb r0, [r0] + strh r0, [r4, 0x3C] + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815EECE + ldrb r0, [r4, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + strb r1, [r4, 0x3] +_0815EECE: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A8328 + movs r2, 0x3 + ands r2, r0 + lsls r2, 2 + ldrb r3, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + adds r0, r1, 0 + ands r0, r3 + orrs r0, r2 + strb r0, [r4, 0x5] + ldrb r0, [r4, 0x1] + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r4, 0x1] + ldr r0, =sub_815EF08 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815EE84 + + thumb_func_start sub_815EF08 +sub_815EF08: @ 815EF08 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _0815EF16 + b _0815F106 +_0815EF16: + lsls r0, 2 + ldr r1, =_0815EF24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815EF24: + .4byte _0815EF38 + .4byte _0815F038 + .4byte _0815F0A0 + .4byte _0815F0B4 + .4byte _0815F100 +_0815EF38: + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0x5 + bhi _0815EF68 + lsls r0, 2 + ldr r1, =_0815EF50 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815EF50: + .4byte _0815EF6C + .4byte _0815EF88 + .4byte _0815EFAA + .4byte _0815EFC6 + .4byte _0815EF6C + .4byte _0815EFEC +_0815EF68: + movs r0, 0 + strh r0, [r4, 0x3A] +_0815EF6C: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + b _0815EFE0 +_0815EF88: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x4 + b _0815EFE6 +_0815EFAA: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + b _0815EFE0 +_0815EFC6: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 +_0815EFE0: + bl sub_80A861C + subs r0, 0x4 +_0815EFE6: + lsls r0, 16 + lsrs r1, r0, 16 + b _0815F00C +_0815EFEC: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r1, r0, 24 +_0815F00C: + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0x4 + bne _0815F018 + movs r0, 0x18 + b _0815F022 +_0815F018: + cmp r0, 0x5 + bne _0815F020 + movs r0, 0x6 + b _0815F022 +_0815F020: + movs r0, 0xC +_0815F022: + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + strh r5, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + strh r1, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + b _0815F0F8 +_0815F038: + adds r0, r4, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _0815F106 + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x4 + beq _0815F070 + cmp r0, 0x5 + beq _0815F090 + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + strh r1, [r4, 0x2E] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + b _0815F088 +_0815F070: + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + strh r1, [r4, 0x38] +_0815F088: + ldrh r0, [r4, 0x3A] + adds r0, 0x1 + strh r0, [r4, 0x3A] + b _0815F106 +_0815F090: + movs r0, 0 + strh r0, [r4, 0x2E] + movs r1, 0x10 + strh r1, [r4, 0x30] + strh r0, [r4, 0x32] + movs r0, 0x3 + strh r0, [r4, 0x38] + b _0815F106 +_0815F0A0: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815F106 + movs r0, 0 + strh r0, [r4, 0x38] + b _0815F106 +_0815F0B4: + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815F0C6 + ldrh r0, [r4, 0x30] + subs r0, 0x1 + strh r0, [r4, 0x30] + b _0815F0CC +_0815F0C6: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_0815F0CC: + ldrh r1, [r4, 0x32] + lsls r1, 8 + ldrh r0, [r4, 0x30] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + bne _0815F106 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_0815F0F8: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + b _0815F106 +_0815F100: + adds r0, r4, 0 + bl move_anim_8072740 +_0815F106: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815EF08 + + thumb_func_start sub_815F10C +sub_815F10C: @ 815F10C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + subs r0, r1 + movs r2, 0x38 + ldrsh r1, [r4, r2] + muls r0, r1 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __divsi3 + adds r5, r0, 0 + strh r5, [r4, 0x24] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + subs r0, r1 + movs r2, 0x38 + ldrsh r1, [r4, r2] + muls r0, r1 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __divsi3 + adds r3, r0, 0 + strh r3, [r4, 0x26] + ldrh r1, [r4, 0x38] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815F16A + ldr r0, =gUnknown_085CE3A0 + ldrh r1, [r4, 0x20] + adds r1, r5 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r4, 0x22] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x5 + bl CreateSprite +_0815F16A: + movs r0, 0x38 + ldrsh r1, [r4, r0] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0815F17C + adds r0, r4, 0 + bl move_anim_8072740 +_0815F17C: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F10C + + thumb_func_start sub_815F18C +sub_815F18C: @ 815F18C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =gAnimationBankTarget + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + beq _0815F1B8 + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _0815F1D0 +_0815F1B8: + ldr r2, =gBattleAnimArgs + ldrh r1, [r5, 0x20] + ldrh r0, [r2] + subs r0, r1, r0 + strh r0, [r5, 0x2E] + ldrh r0, [r2, 0x4] + subs r1, r0 + b _0815F1DE + .pool +_0815F1D0: + ldr r2, =gBattleAnimArgs + ldrh r1, [r5, 0x20] + ldrh r0, [r2] + adds r0, r1, r0 + strh r0, [r5, 0x2E] + ldrh r0, [r2, 0x4] + adds r1, r0 +_0815F1DE: + strh r1, [r5, 0x32] + adds r3, r2, 0 + ldrh r1, [r5, 0x22] + ldrh r2, [r3, 0x2] + adds r2, r1, r2 + strh r2, [r5, 0x30] + ldrh r0, [r3, 0x6] + adds r1, r0 + strh r1, [r5, 0x34] + ldrh r0, [r3, 0x8] + strh r0, [r5, 0x36] + ldrh r0, [r5, 0x2E] + strh r0, [r5, 0x20] + strh r2, [r5, 0x22] + ldr r0, =sub_815F10C + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F18C + + thumb_func_start sub_815F20C +sub_815F20C: @ 815F20C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, r5, 0 + ldr r0, =gTasks + mov r9, r0 + lsls r7, r6, 2 + adds r0, r7, r6 + lsls r0, 3 + mov r8, r0 + mov r4, r8 + add r4, r9 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815F254 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A7270 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + b _0815F2A0 + .pool +_0815F254: + cmp r0, 0x1 + bne _0815F2AC + ldrh r0, [r4, 0xA] + adds r0, 0x60 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + subs r0, 0xD + strh r0, [r4, 0xC] + movs r2, 0xA + ldrsh r1, [r4, r2] + movs r0, 0xC + ldrsh r2, [r4, r0] + adds r0, r5, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _0815F310 + movs r0, 0 + strh r0, [r4, 0xE] + adds r0, r5, 0 + bl sub_80A7344 + ldr r1, =gSprites + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0815F2A0: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815F310 + .pool +_0815F2AC: + ldr r4, =gAnimationBankAttacker + ldrb r0, [r4] + movs r1, 0 + bl refresh_graphics_maybe + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _0815F2EE + ldr r3, =gSprites + ldr r2, =gBankSpriteIds + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x10 + adds r0, r1 + ldr r1, =gUnknown_082FF6C0 + str r1, [r0] + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + bl StartSpriteAffineAnim +_0815F2EE: + mov r4, r9 + adds r3, r7, 0 + ldr r5, =sub_815F330 + movs r1, 0xF + mov r2, r8 + adds r0, r4, r2 + adds r0, 0x26 + movs r2, 0 +_0815F2FE: + strh r2, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _0815F2FE + adds r0, r3, r6 + lsls r0, 3 + adds r0, r4 + str r5, [r0] +_0815F310: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F20C + + thumb_func_start sub_815F330 +sub_815F330: @ 815F330 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _0815F394 + cmp r5, 0x1 + bgt _0815F360 + cmp r5, 0 + beq _0815F36A + b _0815F482 + .pool +_0815F360: + cmp r5, 0x2 + beq _0815F400 + cmp r5, 0x3 + beq _0815F43C + b _0815F482 +_0815F36A: + ldr r0, =gSprites + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldr r0, =0x0000ff38 + strh r0, [r1, 0x26] + movs r0, 0xC8 + strh r0, [r1, 0x24] + adds r1, 0x3E + ldrb r2, [r1] + subs r0, 0xCD + ands r0, r2 + strb r0, [r1] + strh r5, [r4, 0x1C] + b _0815F42E + .pool +_0815F394: + ldrh r1, [r4, 0x1C] + adds r1, 0x70 + movs r5, 0 + strh r1, [r4, 0x1C] + ldr r2, =gSprites + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r2, r0, r2 + lsls r1, 16 + asrs r1, 24 + ldrh r3, [r2, 0x26] + adds r1, r3 + strh r1, [r2, 0x26] + movs r1, 0x22 + ldrsh r0, [r2, r1] + movs r3, 0x26 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + blt _0815F3C4 + strh r5, [r2, 0x24] +_0815F3C4: + movs r1, 0x26 + ldrsh r0, [r2, r1] + cmp r0, 0 + ble _0815F3CE + strh r5, [r2, 0x26] +_0815F3CE: + movs r3, 0x26 + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _0815F482 + movs r0, 0x40 + negs r0, r0 + bl BattleAnimGetPanControl + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7D + bl PlaySE12WithPanning + ldr r1, =0xfffff800 + adds r0, r1, 0 + ldrh r2, [r4, 0x1C] + adds r0, r2 + strh r0, [r4, 0x1C] + b _0815F42E + .pool +_0815F400: + ldrh r0, [r4, 0x1C] + subs r0, 0x70 + strh r0, [r4, 0x1C] + lsls r0, 16 + cmp r0, 0 + bge _0815F410 + movs r0, 0 + strh r0, [r4, 0x1C] +_0815F410: + ldr r0, =gSprites + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r4, 0x1C] + lsls r2, 16 + asrs r2, 24 + ldrh r0, [r1, 0x26] + subs r0, r2 + strh r0, [r1, 0x26] + movs r3, 0x1C + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _0815F482 +_0815F42E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815F482 + .pool +_0815F43C: + ldrh r0, [r4, 0x1C] + adds r0, 0x70 + strh r0, [r4, 0x1C] + ldr r2, =gSprites + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + lsls r0, 16 + asrs r0, 24 + ldrh r2, [r1, 0x26] + adds r0, r2 + strh r0, [r1, 0x26] + lsls r0, 16 + cmp r0, 0 + ble _0815F460 + movs r0, 0 + strh r0, [r1, 0x26] +_0815F460: + movs r3, 0x26 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _0815F482 + movs r0, 0x40 + negs r0, r0 + bl BattleAnimGetPanControl + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7D + bl PlaySE12WithPanning + adds r0, r6, 0 + bl move_anim_task_del +_0815F482: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F330 + + thumb_func_start sub_815F48C +sub_815F48C: @ 815F48C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =gAnimationBankTarget + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0815F4B8 + ldrb r0, [r4] + bl sub_80A82E4 + subs r0, 0x2 + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] + ldr r4, =0x0000ff70 + b _0815F4C8 + .pool +_0815F4B8: + ldrb r0, [r4] + bl sub_80A82E4 + adds r0, 0x2 + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] + ldr r4, =0x0000ffa0 +_0815F4C8: + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + strh r4, [r5, 0x26] + ldr r0, =sub_815F4F0 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F48C + + thumb_func_start sub_815F4F0 +sub_815F4F0: @ 815F4F0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _0815F4FE + b _0815F61A +_0815F4FE: + lsls r0, 2 + ldr r1, =_0815F50C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815F50C: + .4byte _0815F520 + .4byte _0815F544 + .4byte _0815F584 + .4byte _0815F5B4 + .4byte _0815F5E0 +_0815F520: + ldrh r0, [r4, 0x26] + adds r0, 0xA + strh r0, [r4, 0x26] + lsls r0, 16 + cmp r0, 0 + blt _0815F61A + movs r0, 0x3F + bl BattleAnimGetPanControl + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xCD + bl PlaySE12WithPanning + movs r0, 0 + strh r0, [r4, 0x26] + b _0815F5D8 +_0815F544: + ldrh r1, [r4, 0x30] + adds r1, 0x4 + movs r5, 0 + strh r1, [r4, 0x30] + ldr r2, =gSineTable + movs r3, 0x30 + ldrsh r0, [r4, r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + negs r0, r0 + strh r0, [r4, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + ble _0815F61A + movs r0, 0x3F + bl BattleAnimGetPanControl + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xCD + bl PlaySE12WithPanning + strh r5, [r4, 0x30] + strh r5, [r4, 0x26] + b _0815F5D8 + .pool +_0815F584: + ldrh r1, [r4, 0x30] + adds r1, 0x6 + movs r3, 0 + strh r1, [r4, 0x30] + ldr r2, =gSineTable + movs r5, 0x30 + ldrsh r0, [r4, r5] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 20 + negs r0, r0 + strh r0, [r4, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + ble _0815F61A + strh r3, [r4, 0x30] + strh r3, [r4, 0x26] + b _0815F5D8 + .pool +_0815F5B4: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0815F61A + movs r0, 0x3F + bl BattleAnimGetPanControl + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xC0 + bl PlaySE12WithPanning + movs r0, 0 + strh r0, [r4, 0x30] +_0815F5D8: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815F61A +_0815F5E0: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0815F61A + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x32] + adds r1, 0x1 + strh r1, [r4, 0x32] + movs r0, 0x1 + ands r1, r0 + adds r3, r4, 0 + adds r3, 0x3E + lsls r1, 2 + ldrb r2, [r3] + subs r0, 0x6 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bne _0815F61A + adds r0, r4, 0 + bl move_anim_8072740 +_0815F61A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815F4F0 + + thumb_func_start sub_815F620 +sub_815F620: @ 815F620 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl IsContest + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _0815F66E + movs r0, 0x1 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + lsls r0, 16 + lsrs r1, r0, 16 + mov r10, r1 + asrs r6, r0, 16 + cmp r6, 0 + blt _0815F66E + movs r0, 0x1 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + lsls r0, 16 + lsrs r1, r0, 16 + mov r9, r1 + asrs r1, r0, 16 + cmp r1, 0 + bge _0815F67C + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl obj_delete_but_dont_free_vram +_0815F66E: + mov r0, r8 + bl move_anim_task_del + b _0815F780 + .pool +_0815F67C: + ldr r4, =gSprites + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, r0, r4 + ldrh r0, [r5, 0x24] + adds r0, 0x18 + strh r0, [r5, 0x24] + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r6, r0, r4 + ldrh r0, [r6, 0x24] + subs r0, 0x18 + strh r0, [r6, 0x24] + strh r7, [r5, 0x2E] + strh r7, [r6, 0x2E] + strh r7, [r5, 0x30] + strh r7, [r6, 0x30] + strh r7, [r5, 0x32] + strh r7, [r6, 0x32] + movs r0, 0x10 + strh r0, [r5, 0x34] + ldr r0, =0x0000fff0 + strh r0, [r6, 0x34] + strh r7, [r5, 0x36] + movs r0, 0x80 + strh r0, [r6, 0x36] + movs r0, 0x18 + strh r0, [r5, 0x38] + strh r0, [r6, 0x38] + mov r0, r8 + strh r0, [r5, 0x3A] + strh r0, [r6, 0x3A] + strh r7, [r5, 0x3C] + strh r7, [r6, 0x3C] + ldr r2, =gTasks + mov r1, r8 + lsls r3, r1, 2 + adds r0, r3, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x8] + ldr r0, =gUnknown_020244D0 + ldr r1, [r0] + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + adds r7, r4, 0 + mov r12, r3 + cmp r0, 0 + bne _0815F720 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + b _0815F736 + .pool +_0815F720: + adds r1, r5, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + adds r1, r6, 0 + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] +_0815F736: + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r4, r2, r7 + ldrb r1, [r4, 0x1] + movs r3, 0xD + negs r3, r3 + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4, 0x1] + mov r1, r10 + lsls r0, r1, 16 + asrs r0, 16 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r4, r1, r7 + ldrb r0, [r4, 0x1] + ands r3, r0 + strb r3, [r4, 0x1] + adds r3, r7, 0 + adds r3, 0x1C + adds r2, r3 + ldr r0, =sub_815F7C4 + str r0, [r2] + adds r1, r3 + str r0, [r1] + mov r0, r12 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r0, r1 + ldr r1, =sub_815F79C + str r1, [r0] +_0815F780: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F620 + + thumb_func_start sub_815F79C +sub_815F79C: @ 815F79C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815F7BA + adds r0, r2, 0 + bl move_anim_task_del +_0815F7BA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F79C + + thumb_func_start sub_815F7C4 +sub_815F7C4: @ 815F7C4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815F80E + movs r0, 0 + strh r0, [r4, 0x30] + ldr r0, =gUnknown_020244D0 + ldr r1, [r0] + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815F80E + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsls r1, r2, 29 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_0815F80E: + ldrh r0, [r4, 0x34] + ldrh r1, [r4, 0x36] + adds r0, r1 + movs r5, 0 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x36] + movs r2, 0x36 + ldrsh r0, [r4, r2] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl Cos + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815F840 + cmp r0, 0x1 + beq _0815F858 + b _0815F896 + .pool +_0815F840: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + bne _0815F896 + strh r5, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815F896 +_0815F858: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + ble _0815F896 + strh r5, [r4, 0x32] + ldrh r0, [r4, 0x38] + subs r0, 0x2 + strh r0, [r4, 0x38] + lsls r0, 16 + cmp r0, 0 + bge _0815F896 + ldr r3, =gTasks + movs r2, 0x3C + ldrsh r1, [r4, r2] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl obj_delete_but_dont_free_vram +_0815F896: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F7C4 + + thumb_func_start sub_815F8A0 +sub_815F8A0: @ 815F8A0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, =gBattleAnimArgs + movs r2, 0 + strh r2, [r3, 0xE] + ldr r1, =gHappinessMoveAnim + ldrb r0, [r1] + ldrb r1, [r1] + adds r0, r1, 0 + subs r0, 0x3D + lsls r0, 24 + lsrs r0, 24 + adds r2, r1, 0 + cmp r0, 0x1E + bhi _0815F8C4 + movs r0, 0x1 + strh r0, [r3, 0xE] +_0815F8C4: + adds r0, r2, 0 + subs r0, 0x5C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6C + bhi _0815F8D4 + movs r0, 0x2 + strh r0, [r3, 0xE] +_0815F8D4: + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0xC8 + bls _0815F8E0 + movs r0, 0x3 + strh r0, [r3, 0xE] +_0815F8E0: + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F8A0 + + thumb_func_start sub_815F8F4 +sub_815F8F4: @ 815F8F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bls _0815F91A + b _0815FE68 +_0815F91A: + lsls r0, 2 + ldr r1, =_0815F92C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815F92C: + .4byte _0815F940 + .4byte _0815F9F4 + .4byte _0815FBE8 + .4byte _0815FD08 + .4byte _0815FD8C +_0815F940: + movs r0, 0 + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =gTasks + mov r2, r8 + lsls r4, r2, 2 + adds r0, r4, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r3, 0x80 + lsls r3, 4 + adds r0, r3, 0 + ldrh r1, [r6, 0xA] + adds r0, r1 + strh r0, [r6, 0xA] + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815F998 + ldr r2, =gSprites + lsls r3, r7, 4 + adds r1, r3, r7 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r4, [r1, 0x24] + adds r0, r4 + strh r0, [r1, 0x24] + b _0815F9B2 + .pool +_0815F998: + ldr r3, =gSprites + lsls r4, r7, 4 + adds r2, r4, r7 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r6, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 + adds r3, r4, 0 +_0815F9B2: + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r4, r0, r1 + ldrb r0, [r4, 0xA] + strh r0, [r4, 0xA] + adds r1, r3, r7 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x24] + ldrh r1, [r1, 0x20] + adds r0, r1 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 14 + adds r0, r1 + movs r1, 0x98 + lsls r1, 17 + cmp r0, r1 + bhi _0815F9DE + b _0815FE68 +_0815F9DE: + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815FE68 + .pool +_0815F9F4: + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _0815FA28 + ldr r0, =gUnknown_02039F34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldr r2, [r0, 0x8] + mov r10, r2 + ldr r3, [r0, 0xC] + mov r9, r3 + ldrh r6, [r0] + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0 + b _0815FB4E + .pool +_0815FA28: + ldr r4, =gAnimationBankAttacker + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0815FAC8 + ldr r7, =gBattlePartyID + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =gPlayerParty + adds r0, r5 + movs r1, 0 + bl GetMonData + mov r10, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl GetMonData + mov r9, r0 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815FA9C + lsls r0, r2, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + b _0815FA9E + .pool +_0815FA9C: + ldrh r6, [r1, 0x2] +_0815FA9E: + movs r0, 0x1 + bl GetAnimBankSpriteId + ldr r2, =gSprites + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0 + movs r5, 0x88 + lsls r5, 1 + b _0815FB50 + .pool +_0815FAC8: + ldr r7, =gBattlePartyID + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =gEnemyParty + adds r0, r5 + movs r1, 0 + bl GetMonData + mov r10, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl GetMonData + mov r9, r0 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815FB2C + lsls r0, r2, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + b _0815FB2E + .pool +_0815FB2C: + ldrh r6, [r1, 0x2] +_0815FB2E: + movs r0, 0x1 + bl GetAnimBankSpriteId + ldr r2, =gSprites + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0x1 +_0815FB4E: + ldr r5, =0x0000ffe0 +_0815FB50: + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + lsls r3, r5, 16 + asrs r3, 16 + str r0, [sp] + str r4, [sp, 0x4] + mov r4, r10 + str r4, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + ldr r4, =gAnimationBankAttacker + ldrb r0, [r4] + str r0, [sp, 0x10] + movs r0, 0 + str r0, [sp, 0x14] + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_80A8394 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_020244D0 + ldr r1, [r0] + ldrb r0, [r4] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0815FBBA + ldr r1, =gSprites + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + orrs r0, r1 + ldr r3, =0x00007fff + movs r1, 0x10 + movs r2, 0x6 + bl BlendPalette +_0815FBBA: + ldr r0, =gTasks + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + strh r5, [r1, 0x26] + b _0815FD7E + .pool +_0815FBE8: + ldr r1, =gTasks + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r0, 3 + adds r6, r0, r1 + ldrh r0, [r6, 0x26] + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1, 0 + ldrh r2, [r6, 0xA] + adds r0, r2 + strh r0, [r6, 0xA] + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815FC40 + ldr r3, =gSprites + lsls r4, r5, 4 + adds r2, r4, r5 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r6, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 + adds r3, r4, 0 + b _0815FC56 + .pool +_0815FC40: + ldr r2, =gSprites + lsls r3, r5, 4 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r4, [r1, 0x24] + adds r0, r4 + strh r0, [r1, 0x24] +_0815FC56: + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r6, r0, r1 + ldrb r0, [r6, 0xA] + strh r0, [r6, 0xA] + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x24] + ldrh r1, [r1, 0x20] + adds r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + movs r1, 0x24 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815FCD6 + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0815FCB4 + lsls r4, r5, 16 + asrs r4, 16 + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bge _0815FCD6 + b _0815FCCA + .pool +_0815FCB4: + lsls r4, r5, 16 + asrs r4, 16 + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + ble _0815FCD6 +_0815FCCA: + ldrh r0, [r6, 0x24] + adds r0, 0x1 + strh r0, [r6, 0x24] + ldr r1, =gBattleAnimArgs + ldr r0, =0x0000ffff + strh r0, [r1, 0xE] +_0815FCD6: + lsls r0, r5, 16 + movs r2, 0x80 + lsls r2, 14 + adds r0, r2 + movs r1, 0x98 + lsls r1, 17 + cmp r0, r1 + bhi _0815FCE8 + b _0815FE68 +_0815FCE8: + ldr r0, =gTasks + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0xA] + b _0815FD7E + .pool +_0815FD08: + movs r0, 0 + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =gTasks + mov r3, r8 + lsls r4, r3, 2 + adds r0, r4, r3 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x26] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r5, =gSprites + adds r0, r5 + bl sub_80A8610 + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815FD60 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r1, r5 + ldrh r0, [r1, 0x20] + negs r0, r0 + subs r0, 0x20 + strh r0, [r1, 0x24] + b _0815FD74 + .pool +_0815FD60: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r5 + ldrh r2, [r0, 0x20] + movs r4, 0x88 + lsls r4, 1 + adds r1, r4, 0 + subs r1, r2 + strh r1, [r0, 0x24] +_0815FD74: + ldr r0, =gTasks + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 +_0815FD7E: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815FE68 + .pool +_0815FD8C: + movs r0, 0 + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =gTasks + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1, 0 + ldrh r3, [r2, 0xA] + adds r0, r3 + strh r0, [r2, 0xA] + ldr r0, =gAnimationBankAttacker + mov r10, r0 + ldrb r0, [r0] + str r2, [sp, 0x18] + bl GetBankSide + lsls r0, 24 + mov r9, r4 + ldr r2, [sp, 0x18] + cmp r0, 0 + bne _0815FE0C + ldr r1, =gSprites + lsls r5, r7, 4 + adds r0, r5, r7 + lsls r0, 2 + adds r6, r0, r1 + ldrh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r6, 0x24] + adds r0, r1 + strh r0, [r6, 0x24] + movs r2, 0x24 + ldrsh r4, [r6, r2] + movs r3, 0x20 + ldrsh r0, [r6, r3] + adds r4, r0 + mov r1, r10 + ldrb r0, [r1] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r3, r5, 0 + cmp r4, r0 + blt _0815FE44 + movs r2, 0 + strh r2, [r6, 0x24] + b _0815FE44 + .pool +_0815FE0C: + ldr r1, =gSprites + lsls r5, r7, 4 + adds r0, r5, r7 + lsls r0, 2 + adds r6, r0, r1 + ldrh r1, [r2, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r6, 0x24] + subs r0, r1 + strh r0, [r6, 0x24] + movs r3, 0x24 + ldrsh r4, [r6, r3] + movs r1, 0x20 + ldrsh r0, [r6, r1] + adds r4, r0 + mov r2, r10 + ldrb r0, [r2] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r3, r5, 0 + cmp r4, r0 + bgt _0815FE44 + movs r4, 0 + strh r4, [r6, 0x24] +_0815FE44: + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xA] + strh r1, [r0, 0xA] + ldr r1, =gSprites + adds r0, r3, r7 + lsls r0, 2 + adds r0, r1 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815FE68 + mov r0, r8 + bl move_anim_task_del +_0815FE68: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F8F4 + + thumb_func_start sub_815FE80 +sub_815FE80: @ 815FE80 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815FE92 + cmp r0, 0x1 + beq _0815FF3A + b _0815FFBC +_0815FE92: + ldr r0, =gBattleAnimArgs + movs r2, 0xE + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0815FF2C + movs r0, 0x3F + bl BattleAnimGetPanControl + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7A + bl PlaySE12WithPanning + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + strh r0, [r4, 0x22] + ldr r0, =0x0000ffe0 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815FFBC + bl IsContest + lsls r0, 24 + cmp r0, 0 + bne _0815FFBC + movs r0, 0x1 + bl GetAnimBankSpriteId + ldr r2, =gSprites + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + b _0815FFBC + .pool +_0815FF2C: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _0815FFBC +_0815FF3A: + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl Sin + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x30] + adds r0, r2, 0x5 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7F + ble _0815FF6E + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + adds r0, r2, 0 + subs r0, 0x7A + strh r0, [r4, 0x30] +_0815FF6E: + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0815FF9C + ldrh r2, [r4, 0x32] + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x24] + subs r0, r1 + strh r0, [r4, 0x24] + adds r1, r2, 0 + b _0815FFA8 + .pool +_0815FF9C: + ldrh r1, [r4, 0x32] + lsls r0, r1, 16 + asrs r0, 24 + ldrh r2, [r4, 0x24] + adds r0, r2 + strh r0, [r4, 0x24] +_0815FFA8: + movs r0, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x2 + bne _0815FFBC + adds r0, r4, 0 + bl move_anim_8072740 +_0815FFBC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815FE80 + + thumb_func_start sub_815FFC4 +sub_815FFC4: @ 815FFC4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x26 + ldrsh r0, [r0, r2] + adds r3, r1, 0 + cmp r0, 0x4 + bls _0815FFE0 + b _08160132 +_0815FFE0: + lsls r0, 2 + ldr r1, =_0815FFF4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815FFF4: + .4byte _08160008 + .4byte _08160058 + .4byte _081600B4 + .4byte _081600CC + .4byte _08160132 +_08160008: + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0x6 + strh r0, [r1, 0x8] + cmp r5, r2 + ble _0816003E + negs r0, r0 + strh r0, [r1, 0x8] +_0816003E: + strh r5, [r1, 0xA] + strh r2, [r1, 0xC] + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _08160150 + .pool +_08160058: + ldr r1, =gBankSpriteIds + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0x8] + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r0, 0 + ble _081600A0 + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xC + ldrsh r1, [r2, r3] + b _08160126 + .pool +_081600A0: + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xC + ldrsh r1, [r2, r3] + cmp r0, r1 + bgt _08160150 + b _0816012A +_081600B4: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r2, 0x8 + ldrsh r1, [r0, r2] + negs r1, r1 + strh r1, [r0, 0x8] + ldrh r1, [r0, 0x26] + adds r1, 0x1 + strh r1, [r0, 0x26] + b _08160150 +_081600CC: + ldr r1, =gBankSpriteIds + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0x8] + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r0, 0 + bge _08160118 + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xA + ldrsh r1, [r2, r3] + cmp r0, r1 + bgt _08160150 + b _0816012A + .pool +_08160118: + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xA + ldrsh r1, [r2, r3] +_08160126: + cmp r0, r1 + blt _08160150 +_0816012A: + ldrh r0, [r2, 0x26] + adds r0, 0x1 + strh r0, [r2, 0x26] + b _08160150 +_08160132: + ldr r1, =gBankSpriteIds + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x24] + adds r0, r4, 0 + bl move_anim_task_del +_08160150: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815FFC4 + + thumb_func_start sub_8160164 +sub_8160164: @ 8160164 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + adds r4, r1, r0 + movs r0, 0 + bl GetAnimBankSpriteId + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0xE] + ldr r0, =gAnimationBankAttacker + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _08160198 + movs r1, 0x1 +_08160198: + strh r1, [r4, 0x10] + ldr r2, =gSprites + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x14] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x20] + strh r0, [r4, 0x12] + strh r5, [r4, 0x1A] + strh r5, [r4, 0x1E] + movs r0, 0x1 + strh r0, [r4, 0x1C] + strh r5, [r4, 0x20] + ldr r0, =sub_81601DC + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160164 + + thumb_func_start sub_81601DC +sub_81601DC: @ 81601DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08160284 + cmp r0, 0x1 + bgt _08160204 + cmp r0, 0 + beq _0816020A + b _081602DA + .pool +_08160204: + cmp r0, 0x2 + beq _081602D4 + b _081602DA +_0816020A: + ldrh r0, [r4, 0x1E] + adds r0, 0x8 + movs r2, 0xFF + ands r0, r2 + strh r0, [r4, 0x1E] + ldr r5, =gSprites + movs r6, 0xE + ldrsh r0, [r4, r6] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldr r3, =gSineTable + movs r6, 0x1E + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 + strh r0, [r1, 0x24] + ldrh r0, [r4, 0x1A] + adds r0, 0x2 + ands r0, r2 + strh r0, [r4, 0x1A] + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + movs r6, 0x1A + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x10] + muls r0, r1 + ldrh r1, [r4, 0x12] + adds r0, r1 + strh r0, [r2, 0x20] + movs r6, 0x1A + ldrsh r0, [r4, r6] + cmp r0, 0 + bne _081602DA + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r4, 0x12] + strh r1, [r0, 0x20] + b _081602C4 + .pool +_08160284: + ldrh r0, [r4, 0x1E] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x1E] + ldr r3, =gSprites + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldr r2, =gSineTable + movs r5, 0x1E + ldrsh r0, [r4, r5] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 + strh r0, [r1, 0x24] + movs r6, 0x1E + ldrsh r2, [r4, r6] + cmp r2, 0 + bne _081602DA + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + strh r2, [r1, 0x24] +_081602C4: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081602DA + .pool +_081602D4: + adds r0, r2, 0 + bl move_anim_task_del +_081602DA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81601DC + + thumb_func_start sub_81602E0 +sub_81602E0: @ 81602E0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl Cos + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl Sin + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08160326 + adds r0, r4, 0 + bl move_anim_8072740 +_08160326: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81602E0 + + thumb_func_start sub_8160338 +sub_8160338: @ 8160338 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gAnimationBankTarget + ldrb r0, [r0] + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0816037C + ldr r2, =gBattleAnimArgs + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, =0x0000fff5 + strh r0, [r4, 0x2E] + movs r0, 0xC0 + strh r0, [r4, 0x30] + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAffineAnim + b _08160396 + .pool +_0816037C: + movs r0, 0xB + strh r0, [r4, 0x2E] + movs r0, 0xC0 + strh r0, [r4, 0x30] + ldr r1, =gBattleAnimArgs + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_08160396: + ldr r0, =sub_81602E0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160338 + + thumb_func_start sub_81603A8 +sub_81603A8: @ 81603A8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =gAnimationBankAttacker + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + strh r0, [r5, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bgt _081603D2 + movs r0, 0x10 + strh r0, [r5, 0x22] +_081603D2: + movs r0, 0 + strh r0, [r5, 0x3A] + movs r1, 0x10 + strh r1, [r5, 0x3C] + ldr r0, =sub_81603F4 + str r0, [r5, 0x1C] + lsls r1, 8 + movs r0, 0x52 + bl SetGpuReg + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81603A8 + + thumb_func_start sub_81603F4 +sub_81603F4: @ 81603F4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0816046C + cmp r1, 0x1 + bgt _0816040A + cmp r1, 0 + beq _08160414 + b _081604E8 +_0816040A: + cmp r1, 0x2 + beq _08160482 + cmp r1, 0x3 + beq _081604E2 + b _081604E8 +_08160414: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081604E8 + strh r1, [r4, 0x2E] + ldrh r1, [r4, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0816043E + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r0, 0xF + bgt _0816044C + adds r0, r2, 0x1 + strh r0, [r4, 0x3A] + b _0816044C +_0816043E: + ldrh r2, [r4, 0x3C] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0816044C + subs r0, r2, 0x1 + strh r0, [r4, 0x3C] +_0816044C: + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081604E8 + b _081604DA +_0816046C: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _081604E8 + strh r1, [r4, 0x2E] + strh r1, [r4, 0x30] + b _081604DA +_08160482: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081604E8 + movs r0, 0 + strh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081604AE + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _081604BC + subs r0, r2, 0x1 + strh r0, [r4, 0x3A] + b _081604BC +_081604AE: + ldrh r2, [r4, 0x3C] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0xF + bgt _081604BC + adds r0, r2, 0x1 + strh r0, [r4, 0x3C] +_081604BC: + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _081604E8 +_081604DA: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + b _081604E8 +_081604E2: + adds r0, r4, 0 + bl move_anim_8074EE0 +_081604E8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81603F4 + + thumb_func_start sub_81604F0 +sub_81604F0: @ 81604F0 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =gBattleAnimArgs + movs r0, 0 + strh r0, [r2, 0xE] + ldr r0, =gWeatherMoveAnim + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08160514 + movs r0, 0x1 + b _08160536 + .pool +_08160514: + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08160520 + movs r0, 0x2 + b _08160536 +_08160520: + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _0816052C + movs r0, 0x3 + b _08160536 +_0816052C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160538 + movs r0, 0x4 +_08160536: + strh r0, [r2, 0xE] +_08160538: + adds r0, r3, 0 + bl move_anim_task_del + pop {r0} + bx r0 + thumb_func_end sub_81604F0 + + thumb_func_start sub_8160544 +sub_8160544: @ 8160544 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, =gBattleAnimArgs + ldrb r0, [r0] + bl GetAnimBankSpriteId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x26] + ldr r2, =gUnknown_085CE9C8 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, =sub_816058C + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160544 + + thumb_func_start sub_816058C +sub_816058C: @ 816058C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r2, =gTasks + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + adds r1, r0, 0x1 + movs r5, 0 + strh r1, [r3, 0x8] + subs r0, 0x10 + lsls r0, 16 + lsrs r0, 16 + adds r6, r2, 0 + cmp r0, 0x16 + bhi _081605F0 + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08160600 + strh r5, [r3, 0xA] + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + movs r5, 0x1 + ands r0, r5 + cmp r0, 0 + bne _081605F0 + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + b _08160600 + .pool +_081605F0: + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] +_08160600: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r6 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _08160618 + adds r0, r4, 0 + bl move_anim_task_del +_08160618: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816058C + + thumb_func_start sub_8160624 +sub_8160624: @ 8160624 + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_8160624 + + thumb_func_start sub_8160638 +sub_8160638: @ 8160638 + push {lr} + sub sp, 0x4 + bl ScriptContext2_Enable + ldr r0, =sub_8160664 + movs r1, 0xA + bl CreateTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160638 + + thumb_func_start sub_8160664 +sub_8160664: @ 8160664 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08160688 + ldr r0, =sub_81606A0 + bl SetMainCallback2 + ldr r1, =gUnknown_03005DAC + ldr r0, =sub_80AF168 + str r0, [r1] + adds r0, r4, 0 + bl DestroyTask +_08160688: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160664 + + thumb_func_start sub_81606A0 +sub_81606A0: @ 81606A0 + push {r4-r6,lr} + bl ResetSpriteData + bl FreeAllSpritePalettes + bl ResetTasks + bl clear_scheduled_bg_copies_to_vram + ldr r6, =gUnknown_0203BC34 + movs r0, 0x8C + lsls r0, 1 + bl AllocZeroed + str r0, [r6] + ldr r1, =gSpecialVar_0x8004 + ldrh r1, [r1] + adds r0, 0x44 + movs r5, 0 + strb r1, [r0] + ldr r0, =sub_8160624 + bl SetVBlankCallback + bl sub_81607EC + movs r0, 0 + bl sub_81D2824 + ldr r4, =gUnknown_0203BC38 + movs r0, 0 + strh r5, [r4] + strh r5, [r4, 0x2] + strb r0, [r4, 0x4] + bl sub_8161280 + ldr r0, =gUnknown_085CEBB0 + bl LoadSpriteSheet + ldr r0, =gUnknown_085CEBB8 + bl LoadSpritePalette + bl sub_81610B8 + ldr r0, =gUnknown_03006310 + ldrh r1, [r4] + ldrh r2, [r4, 0x2] + bl ListMenuInit + ldr r1, [r6] + movs r2, 0x89 + lsls r2, 1 + adds r1, r2 + strb r0, [r1] + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + bl FillPalette + ldr r0, =sub_816082C + bl SetMainCallback2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81606A0 + + thumb_func_start sub_8160740 +sub_8160740: @ 8160740 + push {r4,r5,lr} + bl ResetSpriteData + bl FreeAllSpritePalettes + bl ResetTasks + bl clear_scheduled_bg_copies_to_vram + ldr r5, =gUnknown_0203BC34 + movs r0, 0x8C + lsls r0, 1 + bl AllocZeroed + str r0, [r5] + movs r1, 0x1C + strb r1, [r0] + ldr r0, [r5] + ldr r1, =gSpecialVar_0x8004 + ldrh r1, [r1] + adds r0, 0x44 + strb r1, [r0] + ldr r0, [r5] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + adds r0, 0x45 + strb r1, [r0] + ldr r0, =sub_8160624 + bl SetVBlankCallback + bl sub_81607EC + ldr r4, =gUnknown_0203BC38 + ldrb r0, [r4, 0x4] + bl sub_81D2824 + bl sub_8161280 + ldr r0, =gUnknown_085CEBB0 + bl LoadSpriteSheet + ldr r0, =gUnknown_085CEBB8 + bl LoadSpritePalette + bl sub_81610B8 + ldr r0, =gUnknown_03006310 + ldrh r1, [r4] + ldrh r2, [r4, 0x2] + bl ListMenuInit + ldr r1, [r5] + movs r2, 0x89 + lsls r2, 1 + adds r1, r2 + strb r0, [r1] + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + bl FillPalette + ldr r0, =sub_816082C + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160740 + + thumb_func_start sub_81607EC +sub_81607EC: @ 81607EC + push {lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085CEC28 + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + bl sub_8121E10 + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_81607EC + + thumb_func_start sub_816082C +sub_816082C: @ 816082C + push {lr} + bl sub_8160868 + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl do_scheduled_bg_tilemap_copies_to_vram + bl UpdatePaletteFade + pop {r0} + bx r0 + thumb_func_end sub_816082C + + thumb_func_start sub_816084C +sub_816084C: @ 816084C + push {r4,lr} + adds r1, r0, 0 + ldr r4, =gStringVar4 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + bl sub_81D2BF4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816084C + + thumb_func_start sub_8160868 +sub_8160868: @ 8160868 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r1, =gUnknown_0203BC34 + ldr r0, [r1] + ldrb r0, [r0] + adds r7, r1, 0 + cmp r0, 0x21 + bls _0816087E + b _08160E8A +_0816087E: + lsls r0, 2 + ldr r1, =_08160890 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08160890: + .4byte _08160918 + .4byte _08160932 + .4byte _0816094C + .4byte _08160954 + .4byte _0816095C + .4byte _08160964 + .4byte _08160980 + .4byte _08160E8A + .4byte _08160988 + .4byte _081609A8 + .4byte _08160E8A + .4byte _08160E8A + .4byte _08160A44 + .4byte _08160A64 + .4byte _08160CB8 + .4byte _08160CD8 + .4byte _08160AB8 + .4byte _08160AD0 + .4byte _08160AEC + .4byte _08160C1C + .4byte _08160C48 + .4byte _08160C98 + .4byte _08160CA6 + .4byte _08160E8A + .4byte _08160B2C + .4byte _08160B60 + .4byte _08160B80 + .4byte _08160BDC + .4byte _08160CFC + .4byte _08160D48 + .4byte _08160E0C + .4byte _08160E38 + .4byte _08160E58 + .4byte _08160E70 +_08160918: + ldr r1, [r7] + ldrb r0, [r1] + adds r0, 0x1 + movs r4, 0 + strb r0, [r1] + movs r0, 0 + bl render_previous_quest_text + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + b _08160CAE +_08160932: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160940 + b _08160E8A +_08160940: + ldr r1, [r7] + movs r0, 0x4 + b _08160E88 + .pool +_0816094C: + ldr r1, [r7] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 +_08160954: + movs r0, 0 + bl render_previous_quest_text + b _0816096A +_0816095C: + movs r0, 0 + bl sub_8160F50 + b _08160E8A +_08160964: + movs r0, 0 + bl sub_8161074 +_0816096A: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_81611AC + b _08160E8A + .pool +_08160980: + movs r0, 0x1 + bl sub_8160F50 + b _08160E8A +_08160988: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160994 + b _08160E8A +_08160994: + bl sub_81D2C50 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_081609A8: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160A0A + ldr r5, =gUnknown_0203BC34 + ldr r0, [r5] + adds r0, 0x44 + ldrb r1, [r0] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + bl sub_8161054 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl GiveMoveToMon + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + beq _08160A04 + ldr r0, =gUnknown_085EF8E4 + bl sub_816084C + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x1 + strh r0, [r1] + ldr r1, [r5] + movs r0, 0x1F + b _08160E88 + .pool +_08160A04: + ldr r1, [r5] + movs r0, 0x10 + b _08160E88 +_08160A0A: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160A18 + cmp r1, 0x1 + beq _08160A18 + b _08160E8A +_08160A18: + ldr r0, =gUnknown_0203BC38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160A30 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x3 + b _08160E88 + .pool +_08160A30: + cmp r0, 0x1 + beq _08160A36 + b _08160E8A +_08160A36: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x5 + b _08160E88 + .pool +_08160A44: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160A50 + b _08160E8A +_08160A50: + bl sub_81D2C50 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160A64: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160A7C + ldr r0, =gSpecialVar_0x8004 + strh r1, [r0] + b _08160E82 + .pool +_08160A7C: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160A8A + cmp r1, 0x1 + beq _08160A8A + b _08160E8A +_08160A8A: + ldr r0, =gUnknown_0203BC38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160AA4 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x3 + b _08160E88 + .pool +_08160AA4: + cmp r0, 0x1 + beq _08160AAA + b _08160E8A +_08160AAA: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x5 + b _08160E88 + .pool +_08160AB8: + ldr r0, =gUnknown_085EF8F3 + bl sub_816084C + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160AD0: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160ADC + b _08160E8A +_08160ADC: + bl sub_81D2C50 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x12 + b _08160E88 + .pool +_08160AEC: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160B10 + ldr r0, =gUnknown_085EFA10 + bl sub_816084C + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x13 + b _08160E88 + .pool +_08160B10: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160B1E + cmp r1, 0x1 + beq _08160B1E + b _08160E8A +_08160B1E: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x18 + b _08160E88 + .pool +_08160B2C: + ldr r4, =gStringVar2 + bl sub_8161054 + movs r1, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + ldr r0, =gUnknown_085EF960 + bl sub_816084C + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160B60: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160B6C + b _08160E8A +_08160B6C: + bl sub_81D2C50 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160B80: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160B98 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x1B + b _08160E88 + .pool +_08160B98: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160BA6 + cmp r1, 0x1 + beq _08160BA6 + b _08160E8A +_08160BA6: + ldr r0, =gUnknown_0203BC38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160BC4 + ldr r2, =gUnknown_0203BC34 + ldr r1, [r2] + movs r0, 0x3 + strb r0, [r1] + adds r7, r2, 0 + b _08160BD0 + .pool +_08160BC4: + ldr r7, =gUnknown_0203BC34 + cmp r0, 0x1 + bne _08160BD0 + ldr r1, [r7] + movs r0, 0x5 + strb r0, [r1] +_08160BD0: + ldr r1, [r7] + movs r0, 0x10 + b _08160E88 + .pool +_08160BDC: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160BE8 + b _08160E8A +_08160BE8: + movs r0, 0x3 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0203BC38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160C08 + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x3 + b _08160E88 + .pool +_08160C08: + cmp r0, 0x1 + beq _08160C0E + b _08160E8A +_08160C0E: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x5 + b _08160E88 + .pool +_08160C1C: + bl sub_81D2C3C + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _08160C2A + b _08160E8A +_08160C2A: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x14 + strb r0, [r1] + subs r0, 0x15 + str r2, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + b _08160E8A + .pool +_08160C48: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160C56 + b _08160E8A +_08160C56: + bl sub_8161054 + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gPlayerParty + ldr r1, =gUnknown_0203BC34 + ldr r1, [r1] + adds r1, 0x44 + ldrb r1, [r1] + ldr r2, =gPlayerPartyCount + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =sub_8160740 + str r0, [sp] + adds r0, r4, 0 + bl sub_81BFA38 + bl sub_8160EA0 + b _08160E8A + .pool +_08160C98: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160CA4 + b _08160E8A +_08160CA4: + b _08160E82 +_08160CA6: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] +_08160CAE: + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + b _08160E8A +_08160CB8: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160CD8: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160CE6 + b _08160E8A +_08160CE6: + bl sub_8160EA0 + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + b _08160E8A + .pool +_08160CFC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, =gUnknown_0203BC38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160D30 + movs r0, 0x1 + bl render_previous_quest_text + b _08160D3A + .pool +_08160D30: + cmp r0, 0x1 + bne _08160D3A + movs r0, 0x1 + bl sub_8161074 +_08160D3A: + bl sub_8161234 + movs r0, 0x3 + movs r1, 0x2 + bl CopyWindowToVram + b _08160E8A +_08160D48: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160D56 + b _08160E8A +_08160D56: + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0x45 + ldrb r0, [r2] + cmp r0, 0x4 + bne _08160D6C + movs r0, 0x18 + b _08160E88 + .pool +_08160D6C: + adds r0, r1, 0 + adds r0, 0x44 + ldrb r0, [r0] + movs r4, 0x64 + muls r0, r4 + ldr r5, =gPlayerParty + adds r0, r5 + ldrb r1, [r2] + adds r1, 0xD + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gStringVar3 + movs r1, 0xD + mov r8, r1 + mov r1, r8 + muls r1, r0 + ldr r6, =gMoveNames + adds r1, r6 + adds r0, r2, 0 + bl StringCopy + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x44 + ldrb r0, [r0] + muls r0, r4 + adds r0, r5 + adds r1, 0x45 + ldrb r1, [r1] + bl RemoveMonPPBonus + ldr r0, [r7] + adds r0, 0x44 + ldrb r0, [r0] + muls r4, r0 + adds r4, r5 + bl sub_8161054 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [r7] + adds r0, 0x45 + ldrb r2, [r0] + adds r0, r4, 0 + bl SetMonMoveSlot + ldr r4, =gStringVar2 + bl sub_8161054 + mov r1, r8 + muls r1, r0 + adds r1, r6 + adds r0, r4, 0 + bl StringCopy + ldr r0, =gUnknown_085EF979 + bl sub_816084C + ldr r1, [r7] + movs r0, 0x1E + strb r0, [r1] + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x1 + strh r0, [r1] + b _08160E8A + .pool +_08160E0C: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + bne _08160E8A + ldr r0, =gUnknown_085EF9A6 + bl sub_816084C + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x1F + strb r0, [r1] + ldr r0, =0x0000016f + bl PlayFanfare + b _08160E8A + .pool +_08160E38: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + bne _08160E8A + ldr r0, =0x0000016f + bl PlayFanfare + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x20 + b _08160E88 + .pool +_08160E58: + bl IsFanfareTaskInactive + lsls r0, 24 + cmp r0, 0 + beq _08160E8A + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0x21 + b _08160E88 + .pool +_08160E70: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08160E8A + movs r0, 0x5 + bl PlaySE +_08160E82: + ldr r0, =gUnknown_0203BC34 + ldr r1, [r0] + movs r0, 0xE +_08160E88: + strb r0, [r1] +_08160E8A: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160868 + + thumb_func_start sub_8160EA0 +sub_8160EA0: @ 8160EA0 + push {r4,lr} + bl sub_8161234 + ldr r4, =gUnknown_0203BC34 + ldr r0, [r4] + movs r1, 0x89 + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =gUnknown_0203BC38 + adds r2, r1, 0x2 + bl sub_81AE6C8 + bl FreeAllWindowBuffers + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + bl ResetSpriteData + bl FreeAllSpritePalettes + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160EA0 + + thumb_func_start render_previous_quest_text +render_previous_quest_text: @ 8160EE0 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0 + ldr r6, =gSprites + ldr r4, =gUnknown_0203BC34 + movs r3, 0x4 +_08160EF0: + ldr r0, [r4] + adds r0, 0x1 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0xF + ble _08160EF0 + cmp r5, 0 + bne _08160F38 + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EF8C2 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x3 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl PrintTextOnWindow +_08160F38: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end render_previous_quest_text + + thumb_func_start sub_8160F50 +sub_8160F50: @ 8160F50 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r6, =gUnknown_0203BC34 + ldr r0, [r6] + movs r4, 0x89 + lsls r4, 1 + adds r0, r4 + ldrb r0, [r0] + bl ListMenuHandleInput + adds r5, r0, 0 + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + ldr r4, =gUnknown_0203BC38 + adds r2, r4, 0x2 + adds r1, r4, 0 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _08160FE4 + adds r0, 0x1 + cmp r5, r0 + bne _08161010 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + bne _08160F9C + bl GetLRKeysState + lsls r0, 24 + cmp r0, 0 + beq _0816103E +_08160F9C: + movs r0, 0x5 + bl PlaySE + cmp r7, 0 + bne _08160FC4 + movs r0, 0x1 + bl PutWindowTilemap + ldr r0, [r6] + movs r1, 0x5 + strb r1, [r0] + movs r0, 0x1 + strb r0, [r4, 0x4] + b _08160FD4 + .pool +_08160FC4: + movs r0, 0 + bl PutWindowTilemap + ldr r0, [r6] + movs r2, 0 + movs r1, 0x3 + strb r1, [r0] + strb r2, [r4, 0x4] +_08160FD4: + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + bl sub_8161054 + bl sub_816137C + b _0816103E +_08160FE4: + movs r0, 0x5 + bl PlaySE + bl sub_8161234 + ldr r1, [r6] + movs r0, 0xC + strb r0, [r1] + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EF9E6 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + bl sub_81D2BF4 + b _0816103E + .pool +_08161010: + movs r0, 0x5 + bl PlaySE + bl sub_8161234 + ldr r1, [r6] + movs r0, 0x8 + strb r0, [r1] + ldr r0, =gStringVar2 + movs r1, 0xD + muls r1, r5 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EF8DA + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + bl sub_81D2BF4 +_0816103E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160F50 + + thumb_func_start sub_8161054 +sub_8161054: @ 8161054 + ldr r0, =gUnknown_0203BC34 + ldr r2, [r0] + ldr r1, =gUnknown_0203BC38 + ldrh r0, [r1, 0x2] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 3 + adds r2, 0x4C + adds r2, r0 + ldr r0, [r2] + bx lr + .pool + thumb_func_end sub_8161054 + + thumb_func_start sub_8161074 +sub_8161074: @ 8161074 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081610A6 + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EF8C2 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x3 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl PrintTextOnWindow +_081610A6: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161074 + + thumb_func_start sub_81610B8 +sub_81610B8: @ 81610B8 + push {r4-r7,lr} + ldr r2, =gUnknown_0203BC34 + ldr r0, [r2] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r2] + ldr r2, =0x00000113 + adds r1, r0, r2 + movs r0, 0x1 + negs r0, r0 + strb r0, [r1] + bl sub_81611AC + movs r4, 0 + ldr r5, =gUnknown_085CEC10 +_081610DC: + adds r2, r4, 0 + cmp r4, 0 + bge _081610E4 + adds r2, r4, 0x3 +_081610E4: + asrs r2, 2 + lsls r1, r2, 2 + subs r1, r4, r1 + lsls r1, 19 + movs r0, 0xD0 + lsls r0, 15 + adds r1, r0 + asrs r1, 16 + lsls r2, 19 + movs r0, 0x90 + lsls r0, 14 + adds r2, r0 + asrs r2, 16 + adds r0, r5, 0 + movs r3, 0 + bl CreateSprite + ldr r2, =gUnknown_0203BC34 + ldr r1, [r2] + adds r1, 0x1 + adds r1, r4 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x7 + ble _081610DC + movs r4, 0 + ldr r7, =gUnknown_085CEC10 + adds r6, r2, 0 +_0816111C: + adds r2, r4, 0 + cmp r4, 0 + bge _08161124 + adds r2, r4, 0x3 +_08161124: + asrs r2, 2 + lsls r1, r2, 2 + subs r1, r4, r1 + lsls r1, 19 + movs r0, 0xD0 + lsls r0, 15 + adds r1, r0 + asrs r1, 16 + lsls r2, 19 + movs r0, 0xD0 + lsls r0, 14 + adds r2, r0 + asrs r2, 16 + adds r0, r7, 0 + movs r3, 0 + bl CreateSprite + ldr r1, [r6] + adds r2, r4, 0 + adds r2, 0x8 + adds r1, 0x1 + adds r1, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x1 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =gSprites + adds r0, r5 + movs r1, 0x2 + bl StartSpriteAnim + adds r4, 0x1 + cmp r4, 0x7 + ble _0816111C + movs r4, 0 + ldr r3, =gUnknown_0203BC34 + movs r2, 0x4 +_08161176: + ldr r0, [r3] + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0xF + ble _08161176 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81610B8 + + thumb_func_start sub_81611AC +sub_81611AC: @ 81611AC + push {r4-r6,lr} + ldr r4, =gUnknown_0203BC34 + ldr r1, [r4] + movs r2, 0x8A + lsls r2, 1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081611D4 + ldr r0, =gUnknown_085CEBC0 + movs r3, 0x8B + lsls r3, 1 + adds r1, r3 + bl AddScrollIndicatorArrowPair + ldr r1, [r4] + movs r5, 0x8A + lsls r5, 1 + adds r1, r5 + strb r0, [r1] +_081611D4: + ldr r0, [r4] + ldr r6, =0x00000113 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08161210 + ldr r0, =gUnknown_0203CE8C + adds r2, r0, 0 + ldr r1, =gUnknown_085CEBD0 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldr r1, [r1] + str r1, [r2] + ldr r2, [r4] + movs r3, 0x88 + lsls r3, 1 + adds r1, r2, r3 + ldrb r1, [r1] + ldr r5, =0x00000111 + adds r2, r5 + ldrb r2, [r2] + subs r1, r2 + strh r1, [r0, 0x8] + ldr r1, =gUnknown_0203BC38 + bl AddScrollIndicatorArrowPair + ldr r1, [r4] + ldr r6, =0x00000113 + adds r1, r6 + strb r0, [r1] +_08161210: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81611AC + + thumb_func_start sub_8161234 +sub_8161234: @ 8161234 + push {r4,lr} + ldr r4, =gUnknown_0203BC34 + ldr r0, [r4] + movs r2, 0x8A + lsls r2, 1 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08161256 + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_08161256: + ldr r0, [r4] + ldr r2, =0x00000113 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08161270 + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r2, =0x00000113 + adds r1, r0, r2 + movs r0, 0xFF + strb r0, [r1] +_08161270: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161234 + + thumb_func_start sub_8161280 +sub_8161280: @ 8161280 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + ldr r4, =gUnknown_0203BC34 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x44 + ldrb r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =gPlayerParty + adds r0, r2 + adds r1, 0x12 + bl GetMoveRelearnerMoves + ldr r1, [r4] + movs r6, 0x88 + lsls r6, 1 + adds r1, r6 + strb r0, [r1] + movs r5, 0 + ldr r0, [r4] + adds r0, r6 + ldrb r0, [r0] + cmp r5, r0 + bge _081612F6 + mov r8, r4 + movs r0, 0xD + mov r12, r0 + ldr r2, =gMoveNames + mov r9, r2 +_081612C2: + mov r7, r8 + ldr r4, [r7] + lsls r3, r5, 3 + adds r2, r4, 0 + adds r2, 0x48 + adds r2, r3 + lsls r0, r5, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r0 + ldrh r0, [r1] + mov r7, r12 + muls r7, r0 + adds r0, r7, 0 + add r0, r9 + str r0, [r2] + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r3 + ldrh r1, [r1] + str r1, [r0] + adds r5, 0x1 + adds r0, r4, r6 + ldrb r0, [r0] + cmp r5, r0 + blt _081612C2 +_081612F6: + ldr r4, =gUnknown_0203BC34 + ldr r0, [r4] + adds r0, 0x44 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl GetMonData + ldr r0, =gStringVar1 + mov r1, sp + bl StringCopy10 + ldr r2, [r4] + movs r5, 0x88 + lsls r5, 1 + adds r3, r2, r5 + ldrb r0, [r3] + lsls r0, 3 + adds r1, r2, 0 + adds r1, 0x48 + adds r1, r0 + ldr r0, =gUnknown_085E8CF0 + str r0, [r1] + ldrb r0, [r3] + lsls r0, 3 + adds r2, 0x4C + adds r2, r0 + movs r0, 0x2 + negs r0, r0 + str r0, [r2] + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x48 + adds r1, r5 + ldrb r1, [r1] + bl sub_81D28C8 + ldr r1, [r4] + ldr r2, =0x00000111 + adds r1, r2 + strb r0, [r1] + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161280 + + thumb_func_start sub_816137C +sub_816137C: @ 816137C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + ldr r0, =gUnknown_0203BC38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08161394 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + bne _081613CC +_08161394: + movs r5, 0 + ldr r4, =gSprites + ldr r3, =gUnknown_0203BC34 + movs r2, 0x4 +_0816139C: + ldr r0, [r3] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xF + bls _0816139C + b _081614FE + .pool +_081613CC: + ldr r1, =gContestEffects + ldr r0, =gContestMoves + lsls r4, 3 + adds r0, r4, r0 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x1] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r6, r0, 24 + mov r8, r4 + cmp r6, 0xFF + bne _081613EE + movs r6, 0 +_081613EE: + movs r5, 0 + ldr r7, =gUnknown_0203BC34 + ldr r4, =gSprites +_081613F4: + cmp r5, r6 + bcs _08161420 + ldr r0, [r7] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAnim + b _08161436 + .pool +_08161420: + ldr r0, [r7] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + bl StartSpriteAnim +_08161436: + ldr r0, [r7] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x5 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x7 + bls _081613F4 + ldr r1, =gContestEffects + ldr r0, =gContestMoves + add r0, r8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xFF + bne _0816147C + movs r6, 0 +_0816147C: + movs r5, 0 + ldr r0, =gUnknown_0203BC34 + mov r8, r0 + ldr r7, =gSprites +_08161484: + cmp r5, r6 + bcs _081614B8 + mov r1, r8 + ldr r0, [r1] + adds r4, r5, 0 + adds r4, 0x8 + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0x3 + bl StartSpriteAnim + b _081614D4 + .pool +_081614B8: + mov r3, r8 + ldr r0, [r3] + adds r4, r5, 0 + adds r4, 0x8 + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0x2 + bl StartSpriteAnim +_081614D4: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x5 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x7 + bls _08161484 +_081614FE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_816137C + + thumb_func_start hm_prepare_dive_probably +hm_prepare_dive_probably: @ 8161508 + push {r4-r6,lr} + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + movs r6, 0x64 + muls r0, r6 + ldr r4, =gPlayerParty + adds r0, r4 + movs r1, 0x3A + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + muls r0, r6 + adds r0, r4 + movs r1, 0x39 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x5 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r4, r0 + bhi _08161558 + movs r0, 0 + b _0816155A + .pool +_08161558: + movs r0, 0x1 +_0816155A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end hm_prepare_dive_probably + + thumb_func_start sub_8161560 +sub_8161560: @ 8161560 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0xA + strb r1, [r0, 0xB] + ldrb r1, [r0, 0x9] + strb r1, [r0, 0xA] + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81B0FCC + movs r0, 0x5 + bl display_pokemon_menu_message + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1370 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161560 + + thumb_func_start sub_81615A8 +sub_81615A8: @ 81615A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + str r4, [sp, 0x4] + ldr r1, =gUnknown_0203CEC8 + ldrb r7, [r1, 0x9] + mov r8, r7 + ldrb r0, [r1, 0xA] + adds r5, r0, 0 + cmp r5, 0x6 + bls _081615EC + movs r0, 0 + strb r0, [r1, 0xB] + bl display_pokemon_menu_message + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1370 + str r1, [r0] + b _08161658 + .pool +_081615EC: + movs r0, 0x64 + mov r10, r0 + mov r0, r10 + muls r0, r5 + ldr r1, =gPlayerParty + mov r9, r1 + adds r6, r0, r1 + adds r0, r6, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0816161A + cmp r7, r5 + beq _0816161A + adds r0, r6, 0 + movs r1, 0x3A + bl GetMonData + cmp r0, r4 + bne _08161628 +_0816161A: + ldr r0, [sp, 0x4] + bl sub_81617B8 + b _08161658 + .pool +_08161628: + movs r0, 0x1 + bl PlaySE + mov r1, r10 + mov r0, r8 + muls r0, r1 + add r0, r9 + movs r1, 0x3A + bl GetMonData + movs r1, 0x5 + bl __udivsi3 + adds r3, r0, 0 + lsls r3, 16 + asrs r3, 16 + movs r2, 0x1 + negs r2, r2 + ldr r0, =sub_816166C + str r0, [sp] + ldr r0, [sp, 0x4] + mov r1, r8 + bl sub_81B1F18 +_08161658: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81615A8 + + thumb_func_start sub_816166C +sub_816166C: @ 816166C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl PlaySE + ldr r5, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r5, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x3A + bl GetMonData + movs r1, 0x5 + bl __udivsi3 + adds r3, r0, 0 + lsls r3, 16 + asrs r3, 16 + ldrb r1, [r5, 0xA] + ldr r0, =sub_81616C0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + bl sub_81B1F18 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816166C + + thumb_func_start sub_81616C0 +sub_81616C0: @ 81616C0 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0xA + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9C17 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8161724 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81616C0 + + thumb_func_start sub_8161724 +sub_8161724: @ 8161724 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08161772 + ldr r4, =gUnknown_0203CEC8 + movs r0, 0 + strb r0, [r4, 0xB] + ldrb r0, [r4, 0x9] + movs r1, 0 + bl sub_81B0FCC + ldrb r0, [r4, 0xA] + strb r0, [r4, 0x9] + ldrb r0, [r4, 0xA] + movs r1, 0x1 + bl sub_81B0FCC + movs r0, 0x6 + movs r1, 0 + bl sub_8198070 + movs r0, 0x6 + bl ClearWindowTilemap + movs r0, 0 + bl display_pokemon_menu_message + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1370 + str r1, [r0] +_08161772: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161724 + + thumb_func_start sub_8161784 +sub_8161784: @ 8161784 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081617AA + movs r0, 0x5 + bl display_pokemon_menu_message + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 + str r0, [r1] +_081617AA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161784 + + thumb_func_start sub_81617B8 +sub_81617B8: @ 81617B8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_085E9712 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8161784 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81617B8 + + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_8161F74.s b/asm/rom_8161F74.s new file mode 100644 index 000000000..339476c45 --- /dev/null +++ b/asm/rom_8161F74.s @@ -0,0 +1,11568 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8161F74 +sub_8161F74: @ 8161F74 + push {lr} + ldr r1, =gUnknown_085DF96C + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161F74 + + thumb_func_start sub_8161F94 +sub_8161F94: @ 8161F94 + push {r4-r7,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r4] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r7, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r1, [r4] + adds r2, 0xA + adds r0, r1, r2 + strh r7, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bl sub_81A3ACC + ldr r4, [r4] + ldr r0, =0x00000cdc + adds r3, r4, r0 + ldr r2, =gUnknown_085DF9AC + lsls r1, r5, 2 + lsls r0, r6, 3 + adds r1, r0 + adds r1, r2 + ldr r0, [r3] + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _0816200E + lsls r0, r5, 1 + lsls r1, r6, 2 + adds r0, r1 + movs r2, 0xCE + lsls r2, 4 + adds r1, r4, r2 + adds r1, r0 + strh r7, [r1] +_0816200E: + bl sub_8164ED8 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r0, =gTrainerBattleOpponent_A + strh r7, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161F94 + + thumb_func_start sub_8162054 +sub_8162054: @ 8162054 + push {r4-r6,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r4, =0x00000ca9 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08162094 + cmp r0, 0x1 + ble _081620E8 + cmp r0, 0x2 + beq _081620A8 + cmp r0, 0x3 + beq _081620D8 + b _081620E8 + .pool +_08162094: + adds r0, r6, 0 + lsls r1, 24 + lsrs r1, 24 + bl sub_8164FCC + ldr r1, =gScriptResult + strh r0, [r1] + b _081620E8 + .pool +_081620A8: + ldr r4, =gScriptResult + ldr r2, [r5] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_085DF9AC + lsls r0, r6, 2 + lsls r1, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] + b _081620E8 + .pool +_081620D8: + ldr r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + ldr r2, =0x00000d07 + adds r1, r2 + strb r0, [r1] +_081620E8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8162054 + + thumb_func_start sub_81620F4 +sub_81620F4: @ 81620F4 + push {r4-r7,lr} + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + ldr r7, =0x00000ca9 + adds r0, r7 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08162134 + cmp r0, 0x1 + ble _081621B4 + cmp r0, 0x2 + beq _08162150 + cmp r0, 0x3 + beq _081621A4 + b _081621B4 + .pool +_08162134: + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + movs r1, 0xCE + lsls r1, 4 + adds r2, r1 + adds r2, r0 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + strh r0, [r2] + b _081621B4 + .pool +_08162150: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _08162180 + ldr r2, [r6] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_085DF9AC + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + str r0, [r2] + b _081621B4 + .pool +_08162180: + ldr r2, [r6] + ldr r1, =0x00000cdc + adds r2, r1 + ldr r3, =gUnknown_085DF9CC + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 + str r0, [r2] + b _081621B4 + .pool +_081621A4: + ldr r1, [r6] + adds r0, r1, r7 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + ldr r2, =0x00000d07 + adds r1, r2 + strb r0, [r1] +_081621B4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81620F4 + + thumb_func_start sub_81621C0 +sub_81621C0: @ 81621C0 + push {r4,r5,lr} + ldr r0, =gTrainerBattleOpponent_A + ldrh r1, [r0] + movs r0, 0xFA + lsls r0, 1 + cmp r1, r0 + bne _081621DA + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000bec + adds r0, r1 + bl sub_816534C +_081621DA: + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000d04 + adds r2, r0, r1 + ldrh r1, [r2] + ldr r0, =0x0000270e + cmp r1, r0 + bhi _081621EE + adds r0, r1, 0x1 + strh r0, [r2] +_081621EE: + ldr r1, [r5] + ldr r4, =0x00000cb2 + adds r1, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + bl sub_8163E90 + ldr r1, =gScriptResult + ldr r0, [r5] + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81621C0 + + thumb_func_start sub_816222C +sub_816222C: @ 816222C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + movs r0, 0 + str r0, [sp, 0x24] + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + mov r10, r0 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x2C] + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _08162266 + b _0816239C +_08162266: + mov r0, r10 + ldr r1, [sp, 0x2C] + bl sub_8164FCC + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x28] + movs r7, 0 + mov r2, sp + str r2, [sp, 0x34] +_0816227A: + movs r3, 0xEC + adds r0, r7, 0 + muls r0, r3 + movs r4, 0xE7 + lsls r4, 3 + adds r0, r4 + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + movs r2, 0 + mov r8, r2 + mov r9, r2 + movs r5, 0 + adds r3, r7, 0x1 + str r3, [sp, 0x30] + adds r1, r0 +_08162298: + ldm r1!, {r0} + mov r4, r8 + orrs r4, r0 + mov r8, r4 + add r9, r0 + adds r5, 0x1 + cmp r5, 0x39 + bls _08162298 + movs r6, 0 + movs r5, 0 + movs r0, 0xEC + adds r2, r7, 0 + muls r2, r0 +_081622B2: + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + movs r0, 0x2C + muls r0, r5 + adds r0, r2 + adds r1, r0 + ldr r4, =0x0000076c + adds r0, r1, r4 + ldrh r0, [r0] + cmp r0, 0 + beq _081622E4 + movs r0, 0xEF + lsls r0, 3 + adds r4, r1, r0 + mov r0, r10 + str r2, [sp, 0x38] + bl sub_8165C90 + ldrb r1, [r4] + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x38] + cmp r1, r0 + bhi _081622E4 + adds r6, 0x1 +_081622E4: + adds r5, 0x1 + cmp r5, 0x3 + ble _081622B2 + ldr r0, =gUnknown_085DF9F6 + ldr r1, [sp, 0x2C] + adds r0, r1, r0 + ldrb r0, [r0] + cmp r6, r0 + blt _0816233E + ldr r3, =gSaveBlock2Ptr + ldr r2, [r3] + movs r4, 0xEC + adds r3, r7, 0 + muls r3, r4 + adds r1, r2, r3 + ldr r5, =0x0000073a + adds r0, r1, r5 + ldrh r0, [r0] + ldr r4, [sp, 0x28] + cmp r0, r4 + bne _0816233E + subs r5, 0x2 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, r10 + bne _0816233E + mov r0, r8 + cmp r0, 0 + beq _0816233E + movs r1, 0x82 + lsls r1, 4 + adds r0, r2, r1 + adds r0, r3 + ldr r0, [r0] + cmp r0, r9 + bne _0816233E + movs r2, 0x96 + lsls r2, 1 + adds r0, r7, r2 + ldr r3, [sp, 0x34] + stm r3!, {r0} + str r3, [sp, 0x34] + ldr r4, [sp, 0x24] + adds r4, 0x1 + str r4, [sp, 0x24] +_0816233E: + ldr r7, [sp, 0x30] + cmp r7, 0x4 + ble _0816227A + ldr r5, [sp, 0x2C] + cmp r5, 0 + bne _08162396 + bl sub_8165B20 + movs r7, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r4, =gUnknown_085DF9EC + adds r2, r0, 0 + adds r2, 0xDC + ldr r1, [sp, 0x24] + lsls r0, r1, 2 + mov r5, sp + adds r3, r0, r5 +_08162362: + ldrb r0, [r2] + lsls r1, r0, 25 + lsrs r0, r1, 30 + cmp r0, 0 + beq _0816238E + ldrb r0, [r2, 0x1] + adds r0, r4 + ldrb r0, [r0] + ldr r5, [sp, 0x28] + cmp r0, r5 + bne _0816238E + lsrs r0, r1, 30 + subs r0, 0x1 + cmp r0, r10 + bne _0816238E + movs r1, 0xC8 + lsls r1, 1 + adds r0, r7, r1 + stm r3!, {r0} + ldr r5, [sp, 0x24] + adds r5, 0x1 + str r5, [sp, 0x24] +_0816238E: + adds r2, 0x44 + adds r7, 0x1 + cmp r7, 0x3 + ble _08162362 +_08162396: + ldr r0, [sp, 0x24] + cmp r0, 0 + bne _081623C0 +_0816239C: + movs r0, 0 + b _081623DA + .pool +_081623C0: + ldr r4, =gTrainerBattleOpponent_A + bl Random + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x24] + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4] + movs r0, 0x1 +_081623DA: + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_816222C + + thumb_func_start sub_81623F0 +sub_81623F0: @ 81623F0 + push {r4-r7,lr} + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x2 + bne _08162414 + bl sub_8165E18 + b _08162530 + .pool +_08162414: + ldr r0, =0x000040ce + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81A39C4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + bl sub_8165C40 + subs r4, 0x2 + cmp r4, 0x1 + bhi _08162488 + ldr r1, [r6] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r3, [r0] + ldr r2, =gTrainerBattleOpponent_A + lsls r0, r3, 2 + ldr r4, =0x00000cb4 + adds r1, r4 + adds r0, r1, r0 + ldrh r0, [r0] + strh r0, [r2] + ldr r4, =gTrainerBattleOpponent_B + lsls r0, r3, 1 + adds r0, 0x1 + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r4] + ldrh r0, [r2] + movs r1, 0 + bl sub_8162614 + ldrh r0, [r4] + movs r1, 0x1 + bl sub_8162614 + b _08162530 + .pool +_08162488: + bl sub_816222C + lsls r0, 24 + cmp r0, 0 + beq _081624B4 + ldr r4, =gTrainerBattleOpponent_A + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + ldr r1, [r6] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 1 + adds r2, 0x2 + b _08162528 + .pool +_081624B4: + lsls r7, r5, 24 + adds r5, r6, 0 + ldr r6, =0x00000cb2 +_081624BA: + ldr r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsrs r0, r7, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r4, 0 + ldr r1, [r5] + adds r0, r1, r6 + ldrh r0, [r0] + cmp r4, r0 + bge _081624FC + ldr r2, =0x00000cb4 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r3 + beq _081624FC + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + subs r2, 0x2 + adds r0, r1, r2 + ldrh r2, [r0] + ldr r0, =0x00000cb4 + adds r1, r0 +_081624EE: + adds r1, 0x2 + adds r4, 0x1 + cmp r4, r2 + bge _081624FC + ldrh r0, [r1] + cmp r0, r3 + bne _081624EE +_081624FC: + ldr r0, [r5] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bne _081624BA + ldr r4, =gTrainerBattleOpponent_A + strh r3, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r2, [r0] + adds r0, r2, 0x1 + cmp r0, 0x6 + bgt _08162530 + lsls r0, r2, 1 + ldr r2, =0x00000cb4 +_08162528: + adds r1, r2 + adds r1, r0 + ldrh r0, [r4] + strh r0, [r1] +_08162530: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81623F0 + + thumb_func_start sub_8162548 +sub_8162548: @ 8162548 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r0, 0x7 + bhi _08162584 + cmp r1, 0x6 + bne _08162570 + ldr r2, =gUnknown_085DFA1A + lsls r1, r0, 2 + adds r0, r2, 0x2 + adds r0, r1, r0 + adds r1, r2 + ldrh r0, [r0] + ldrh r4, [r1] + b _0816258A + .pool +_08162570: + ldr r2, =gUnknown_085DF9FA + lsls r1, r3, 2 + adds r0, r2, 0x2 + adds r0, r1, r0 + adds r1, r2 + ldrh r0, [r0] + ldrh r4, [r1] + b _0816258A + .pool +_08162584: + ldr r1, =gUnknown_085DF9FA + ldrh r0, [r1, 0x1E] + ldrh r4, [r1, 0x1C] +_0816258A: + subs r0, r4 + adds r0, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __umodsi3 + adds r4, r0 + lsls r4, 16 + lsrs r5, r4, 16 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8162548 + + thumb_func_start sub_81625B4 +sub_81625B4: @ 81625B4 + push {r4,lr} + adds r4, r2, 0 + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r0, 0x7 + bhi _081625F4 + cmp r1, 0x6 + bne _081625D4 + ldr r1, =gUnknown_085DFA1A + lsls r2, r0, 2 + b _081625D8 + .pool +_081625D4: + ldr r1, =gUnknown_085DF9FA + lsls r2, 2 +_081625D8: + adds r0, r1, 0x2 + adds r0, r2, r0 + adds r2, r1 + ldrh r0, [r0] + ldrh r1, [r2] + subs r0, r1 + adds r0, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + ldrh r0, [r2] + b _08162604 + .pool +_081625F4: + ldr r0, =gUnknown_085DF9FA + ldrh r1, [r0, 0x1E] + ldrh r2, [r0, 0x1C] + subs r1, r2 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + ldrh r0, [r0, 0x1C] +_08162604: + strh r0, [r4] + strb r1, [r3] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81625B4 + + thumb_func_start sub_8162614 +sub_8162614: @ 8162614 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162640 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000bed + adds r0, r1 + b _081626BA + .pool +_08162640: + ldr r0, =0x000003fe + cmp r4, r0 + bne _08162650 + bl sub_81A4DD8 + b _08162788 + .pool +_08162650: + ldr r0, =0x0000012b + cmp r4, r0 + bhi _0816266C + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + b _081626BA + .pool +_0816266C: + ldr r0, =0x0000018f + cmp r4, r0 + bhi _08162698 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, =0x00000739 + adds r0, r1 + b _081626BA + .pool +_08162698: + ldr r3, =gUnknown_08610970 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r6, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 +_081626BA: + ldrb r2, [r0] + movs r1, 0 + ldr r3, =gUnknown_085DCEDC + ldrb r0, [r3] + cmp r0, r2 + beq _081626D4 +_081626C6: + adds r1, 0x1 + cmp r1, 0x1D + bhi _081626D4 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081626C6 +_081626D4: + cmp r1, 0x1E + beq _08162700 + ldr r0, =gUnknown_085DCF0E + adds r0, r1, r0 + ldrb r1, [r0] + cmp r5, 0x1 + beq _08162744 + cmp r5, 0x1 + ble _0816272E + cmp r5, 0xF + bne _0816272E + b _08162750 + .pool +_08162700: + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _08162718 +_0816270A: + adds r1, 0x1 + cmp r1, 0x13 + bhi _08162718 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _0816270A +_08162718: + cmp r1, 0x14 + beq _0816275C + ldr r0, =gUnknown_085DCF2C + adds r0, r1, r0 + ldrb r1, [r0] + cmp r5, 0x1 + beq _08162744 + cmp r5, 0x1 + ble _0816272E + cmp r5, 0xF + beq _08162750 +_0816272E: + ldr r0, =0x00004010 + bl VarSet + b _08162788 + .pool +_08162744: + ldr r0, =0x00004011 + bl VarSet + b _08162788 + .pool +_08162750: + ldr r0, =0x0000401e + bl VarSet + b _08162788 + .pool +_0816275C: + cmp r5, 0x1 + beq _08162770 + cmp r5, 0x1 + ble _08162768 + cmp r5, 0xF + beq _08162780 +_08162768: + ldr r0, =0x00004010 + b _08162772 + .pool +_08162770: + ldr r0, =0x00004011 +_08162772: + movs r1, 0x7 + bl VarSet + b _08162788 + .pool +_08162780: + ldr r0, =0x0000401e + movs r1, 0x7 + bl VarSet +_08162788: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8162614 + + thumb_func_start sub_8162794 +sub_8162794: @ 8162794 + push {lr} + movs r0, 0xFA + lsls r0, 1 + movs r1, 0 + bl sub_8162614 + pop {r0} + bx r0 + thumb_func_end sub_8162794 + + thumb_func_start sub_81627A4 +sub_81627A4: @ 81627A4 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _081627CC + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000bed + adds r0, r1 + b _08162836 + .pool +_081627CC: + ldr r0, =0x0000012b + cmp r4, r0 + bhi _081627E8 + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + b _08162836 + .pool +_081627E8: + ldr r0, =0x0000018f + cmp r4, r0 + bhi _08162814 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, =0x00000739 + adds r0, r1 + b _08162836 + .pool +_08162814: + ldr r3, =gUnknown_08610970 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 +_08162836: + ldrb r2, [r0] + movs r1, 0 + ldr r3, =gUnknown_085DCEDC + ldrb r0, [r3] + cmp r0, r2 + beq _08162850 +_08162842: + adds r1, 0x1 + cmp r1, 0x1D + bhi _08162850 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08162842 +_08162850: + cmp r1, 0x1E + beq _0816286C + ldr r0, =gUnknown_085DCF0E + b _08162892 + .pool +_0816286C: + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _08162884 +_08162876: + adds r1, 0x1 + cmp r1, 0x13 + bhi _08162884 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08162876 +_08162884: + cmp r1, 0x14 + bne _08162890 + movs r0, 0x7 + b _08162896 + .pool +_08162890: + ldr r0, =gUnknown_085DCF2C +_08162892: + adds r0, r1, r0 + ldrb r0, [r0] +_08162896: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81627A4 + + thumb_func_start sub_81628A0 +sub_81628A0: @ 81628A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + movs r1, 0 + mov r8, r1 + mov r10, r0 + movs r5, 0 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + mov r4, r10 + ldrb r4, [r4, 0xC] + str r4, [sp, 0x18] + mov r9, r5 + movs r7, 0x4 + str r7, [sp, 0x1C] + ldr r1, =0x00000744 + adds r1, r0 + mov r12, r1 +_081628CA: + movs r6, 0 + movs r3, 0 + mov r2, r12 + ldrb r0, [r2] + ldr r4, [sp, 0x18] + cmp r0, r4 + bne _081628FA + mov r4, r9 + mov r2, r10 + adds r2, 0xC +_081628DE: + adds r3, 0x1 + cmp r3, 0x3 + bgt _081628FA + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + adds r1, r3, r4 + ldr r7, =0x00000744 + adds r0, r7 + adds r0, r1 + adds r1, r2, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _081628DE +_081628FA: + cmp r3, 0x4 + bne _08162944 + movs r6, 0 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r3, =0x0000073c + adds r0, r3 + ldr r2, [sp, 0x1C] + adds r0, r2 + ldrb r0, [r0] + mov r4, r10 + ldrb r4, [r4, 0x8] + cmp r0, r4 + bne _08162944 + adds r1, r0, 0 + mov r2, r9 + adds r2, 0x4 +_0816291C: + cmp r1, 0xFF + bne _08162930 + movs r6, 0x7 + b _08162944 + .pool +_08162930: + adds r6, 0x1 + cmp r6, 0x6 + bgt _08162944 + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + adds r0, r3 + adds r0, r2 + ldrb r0, [r0] + cmp r0, r1 + beq _0816291C +_08162944: + cmp r6, 0x7 + beq _0816295A + movs r0, 0xEC + add r9, r0 + ldr r1, [sp, 0x1C] + adds r1, 0xEC + str r1, [sp, 0x1C] + add r12, r0 + adds r5, 0x1 + cmp r5, 0x4 + ble _081628CA +_0816295A: + cmp r5, 0x4 + bgt _08162974 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + movs r1, 0xEC + muls r1, r5 + adds r0, r1 + movs r4, 0xE7 + lsls r4, 3 + adds r0, r4 + b _081629B2 + .pool +_08162974: + movs r5, 0 + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + ldr r1, =0x0000073a + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _0816299E + adds r3, r7, 0 + adds r2, r1, 0 + movs r1, 0 +_0816298A: + adds r1, 0xEC + adds r5, 0x1 + cmp r5, 0x4 + bgt _081629C4 + ldr r0, [r3] + adds r0, r1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, 0 + bne _0816298A +_0816299E: + cmp r5, 0x4 + bgt _081629C4 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + movs r1, 0xEC + muls r1, r5 + adds r0, r1 + movs r2, 0xE7 + lsls r2, 3 + adds r0, r2 +_081629B2: + mov r1, r10 + movs r2, 0xEC + bl memcpy + b _08162A8A + .pool +_081629C4: + mov r2, sp + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r3, =0x0000073a + adds r0, r3 + ldrh r0, [r0] + movs r1, 0 + strh r0, [r2] + add r0, sp, 0xC + strh r1, [r0] + movs r7, 0x1 + add r8, r7 + movs r5, 0x1 + add r0, sp, 0xC + mov r9, r0 + mov r12, r3 +_081629E4: + movs r3, 0 + adds r7, r5, 0x1 + cmp r3, r8 + bge _08162A2E + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + movs r2, 0xEC + adds r1, r5, 0 + muls r1, r2 + adds r0, r1 + mov r1, r12 + adds r4, r0, r1 + mov r6, sp +_081629FE: + lsls r0, r3, 1 + add r0, sp + ldrh r2, [r4] + adds r1, r2, 0 + ldrh r0, [r0] + cmp r1, r0 + bcs _08162A24 + movs r3, 0 + movs r4, 0x1 + mov r8, r4 + strh r2, [r6] + mov r0, r9 + strh r5, [r0] + b _08162A2E + .pool +_08162A24: + cmp r1, r0 + bhi _08162A2E + adds r3, 0x1 + cmp r3, r8 + blt _081629FE +_08162A2E: + cmp r3, r8 + bne _08162A54 + mov r1, r8 + lsls r2, r1, 1 + mov r4, sp + adds r3, r4, r2 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + movs r4, 0xEC + adds r1, r5, 0 + muls r1, r4 + adds r0, r1 + add r0, r12 + ldrh r0, [r0] + strh r0, [r3] + add r2, r9 + strh r5, [r2] + movs r0, 0x1 + add r8, r0 +_08162A54: + adds r5, r7, 0 + cmp r5, 0x4 + ble _081629E4 + bl Random + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + bl __modsi3 + adds r5, r0, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r5, 1 + add r1, sp + adds r1, 0xC + ldrh r2, [r1] + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + movs r1, 0xE7 + lsls r1, 3 + adds r0, r1 + mov r1, r10 + movs r2, 0xEC + bl memcpy +_08162A8A: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81628A0 + + thumb_func_start sub_8162AA0 +sub_8162AA0: @ 8162AA0 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162AD0 + ldr r1, =gTrainerPicIndices + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000bed + adds r0, r2 + ldrb r0, [r0] + adds r0, r1 + b _08162BC8 + .pool +_08162AD0: + ldr r0, =0x000003fe + cmp r4, r0 + bne _08162AE4 + bl sub_81A4CB0 + lsls r0, 24 + lsrs r0, 24 + b _08162BCA + .pool +_08162AE4: + ldr r0, =0x0000012b + cmp r4, r0 + bhi _08162B08 + ldr r2, =gTrainerPicIndices + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + ldrb r0, [r0] + adds r0, r2 + b _08162BC8 + .pool +_08162B08: + ldr r0, =0x0000018f + cmp r4, r0 + bhi _08162B64 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162B38 + ldr r4, =gTrainerPicIndices + bl sub_818649C + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + b _08162BC8 + .pool +_08162B38: + ldr r3, =gTrainerPicIndices + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r2, =0x00000739 + adds r0, r2 + ldrb r0, [r0] + adds r0, r3 + b _08162BC8 + .pool +_08162B64: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _08162BB0 + ldr r4, =gTrainerPicIndices + ldr r3, =gUnknown_08610970 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 + ldrb r0, [r0] + adds r0, r4 + b _08162BC8 + .pool +_08162BB0: + ldr r5, =gTrainerPicIndices + ldr r4, =gUnknown_08610970 + bl sub_81864A8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x58 + muls r0, r1 + adds r0, r4 + adds r0, 0x32 + ldrb r0, [r0] + adds r0, r5 +_08162BC8: + ldrb r0, [r0] +_08162BCA: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8162AA0 + + thumb_func_start sub_8162BD8 +sub_8162BD8: @ 8162BD8 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162C08 + ldr r1, =gTrainerClassNameIndices + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000bed + adds r0, r2 + ldrb r0, [r0] + b _08162C26 + .pool +_08162C08: + ldr r0, =0x000003fe + cmp r4, r0 + bne _08162C1C + bl sub_81A4D00 + lsls r0, 24 + lsrs r0, 24 + b _08162D1E + .pool +_08162C1C: + ldr r0, =0x00000c03 + cmp r4, r0 + bne _08162C38 + ldr r0, =gTrainers + ldr r1, =0x00007da1 +_08162C26: + adds r0, r1 + ldrb r0, [r0] + b _08162D1E + .pool +_08162C38: + ldr r0, =0x0000012b + cmp r4, r0 + bhi _08162C60 + ldr r2, =gTrainerClassNameIndices + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + ldrb r0, [r0] + adds r0, r2 + ldrb r0, [r0] + b _08162D1E + .pool +_08162C60: + ldr r0, =0x0000018f + cmp r4, r0 + bhi _08162CBC + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162C90 + ldr r4, =gTrainerClassNameIndices + bl sub_818649C + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + b _08162D1E + .pool +_08162C90: + ldr r3, =gTrainerClassNameIndices + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r2, =0x00000739 + adds r0, r2 + ldrb r0, [r0] + adds r0, r3 + ldrb r0, [r0] + b _08162D1E + .pool +_08162CBC: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162CF4 + ldr r5, =gTrainerClassNameIndices + ldr r4, =gUnknown_08610970 + bl sub_81864A8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x58 + muls r0, r1 + adds r0, r4 + adds r0, 0x32 + ldrb r0, [r0] + adds r0, r5 + ldrb r0, [r0] + b _08162D1E + .pool +_08162CF4: + ldr r4, =gTrainerClassNameIndices + ldr r3, =gUnknown_08610970 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 + ldrb r0, [r0] + adds r0, r4 + ldrb r0, [r0] +_08162D1E: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8162BD8 + + thumb_func_start sub_8162D34 +sub_8162D34: @ 8162D34 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162D5C + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000bed + adds r0, r1 + b _08162E0A + .pool +_08162D5C: + ldr r0, =0x0000012b + cmp r4, r0 + bhi _08162D78 + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + b _08162E0A + .pool +_08162D78: + ldr r0, =0x0000018f + cmp r4, r0 + bhi _08162DC0 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162DA0 + bl sub_818649C + lsls r0, 24 + lsrs r0, 24 + b _08162E0C + .pool +_08162DA0: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, =0x00000739 + adds r0, r1 + b _08162E0A + .pool +_08162DC0: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162DE8 + ldr r4, =gUnknown_08610970 + bl sub_81864A8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x58 + muls r0, r1 + adds r0, r4 + b _08162E08 + .pool +_08162DE8: + ldr r3, =gUnknown_08610970 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 +_08162E08: + adds r0, 0x32 +_08162E0A: + ldrb r0, [r0] +_08162E0C: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8162D34 + + thumb_func_start sub_8162E20 +sub_8162E20: @ 8162E20 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r5, r0 + bne _08162E54 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xBF + lsls r1, 4 + adds r2, r0, r1 +_08162E40: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _08162E40 + b _08162F5C + .pool +_08162E54: + ldr r0, =0x000003fe + cmp r5, r0 + bne _08162E68 + adds r0, r6, 0 + bl sub_81A4D50 + b _08162F62 + .pool +_08162E68: + ldr r0, =0x00000c03 + cmp r5, r0 + bne _08162E88 + ldr r2, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 @ Steven's name +_08162E70: + adds r0, r6, r4 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _08162E70 + b _08162F5C + .pool +_08162E88: + ldr r0, =0x0000012b + cmp r5, r0 + bhi _08162EB4 + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + adds r2, r0, 0x4 +_08162E9A: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _08162E9A + b _08162F5C + .pool +_08162EB4: + ldr r0, =0x0000018f + cmp r5, r0 + bhi _08162F00 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162ED8 + adds r0, r6, 0 + bl sub_8186468 + b _08162F62 + .pool +_08162ED8: + ldr r2, =gSaveBlock2Ptr + movs r0, 0xEC + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0xfffef2a8 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r1, r0, 0x4 + adds r0, 0xE4 + ldrb r2, [r0] + adds r0, r6, 0 + bl sub_81DB5E8 + b _08162F62 + .pool +_08162F00: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162F24 + bl sub_81864A8 + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81864C0 + lsls r0, 24 + lsrs r4, r0, 24 + b _08162F3E + .pool +_08162F24: + ldr r1, =gSaveBlock2Ptr + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r2, =0xffff969c + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + ldrb r0, [r1] + lsls r0, 27 + lsrs r5, r0, 27 + adds r1, 0x3F + ldrb r4, [r1] +_08162F3E: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81A1650 + adds r1, r0, 0 + adds r0, r6, 0 + adds r2, r4, 0 + bl sub_81DB5E8 + b _08162F62 + .pool +_08162F5C: + adds r1, r6, r4 + movs r0, 0xFF + strb r0, [r1] +_08162F62: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8162E20 + + thumb_func_start sub_8162F68 +sub_8162F68: @ 8162F68 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162F90 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000bed + adds r0, r1 + b _0816300E + .pool +_08162F90: + ldr r0, =0x000003fe + cmp r4, r0 + bne _08162FA4 + bl sub_81A4DB8 + lsls r0, 24 + lsrs r0, 24 + b _08163042 + .pool +_08162FA4: + ldr r0, =0x0000012b + cmp r4, r0 + bhi _08162FC0 + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + b _0816300E + .pool +_08162FC0: + ldr r0, =0x0000018f + cmp r4, r0 + bhi _08162FEC + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, =0x00000739 + adds r0, r1 + b _0816300E + .pool +_08162FEC: + ldr r3, =gUnknown_08610970 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 +_0816300E: + ldrb r2, [r0] + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _08163028 +_0816301A: + adds r1, 0x1 + cmp r1, 0x13 + bhi _08163028 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _0816301A +_08163028: + cmp r1, 0x14 + bne _08163040 + movs r0, 0 + b _08163042 + .pool +_08163040: + movs r0, 0x1 +_08163042: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8162F68 + + thumb_func_start sub_8163048 +sub_8163048: @ 8163048 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl ZeroEnemyPartyMons + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + movs r1, 0 + adds r2, r4, 0 + bl sub_81630C4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8163048 + + thumb_func_start sub_816306C +sub_816306C: @ 816306C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl ZeroEnemyPartyMons + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + movs r1, 0 + adds r2, r4, 0 + bl sub_81630C4 + ldr r0, =gTrainerBattleOpponent_B + ldrh r0, [r0] + movs r1, 0x3 + adds r2, r4, 0 + bl sub_81630C4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816306C + + thumb_func_start sub_81630A0 +sub_81630A0: @ 81630A0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl ZeroEnemyPartyMons + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + movs r1, 0 + adds r2, r4, 0 + bl sub_8165EA4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81630A0 + + thumb_func_start sub_81630C4 +sub_81630C4: @ 81630C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x1C] + add r4, sp, 0x14 + movs r0, 0xFF + strb r0, [r4] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] + ldr r0, =0x0000012b + cmp r5, r0 + bhi _08163138 + adds r0, r5, 0 + bl sub_8165D08 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + ldr r0, =gTrainerBattleOpponent_A + ldrh r2, [r0] + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r2 + adds r0, r1 + ldr r0, [r0, 0x30] + str r0, [sp, 0x2C] + movs r0, 0 + str r0, [sp, 0x28] + ldr r2, [sp, 0x2C] + ldrh r1, [r2] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08163124 + b _08163278 +_08163124: + b _08163260 + .pool +_08163138: + movs r0, 0xFA + lsls r0, 1 + cmp r5, r0 + bne _08163180 + ldr r7, [sp, 0x18] + adds r0, r7, 0x3 + cmp r7, r0 + blt _0816314A + b _08163426 +_0816314A: + ldr r4, =gSaveBlock2Ptr +_0816314C: + movs r0, 0x64 + muls r0, r7 + ldr r1, =gEnemyParty + adds r0, r1 + ldr r5, [sp, 0x18] + subs r2, r7, r5 + movs r1, 0x2C + muls r2, r1 + movs r6, 0xC2 + lsls r6, 4 + adds r2, r6 + ldr r1, [r4] + adds r1, r2 + bl sub_806819C + adds r7, 0x1 + adds r0, r5, 0 + adds r0, 0x3 + cmp r7, r0 + blt _0816314C + b _08163426 + .pool +_08163180: + ldr r0, =0x000003fe + cmp r5, r0 + bne _08163190 + bl sub_81A4E04 + b _08163426 + .pool +_08163190: + ldr r0, =0x0000018f + cmp r5, r0 + bhi _08163218 + movs r6, 0 + ldr r7, [sp, 0x18] + ldr r1, [sp, 0x1C] + adds r0, r7, r1 + cmp r7, r0 + blt _081631A4 + b _08163426 +_081631A4: + ldr r2, =0xfffffed4 + adds r1, r5, r2 + movs r0, 0xEC + adds r2, r1, 0 + muls r2, r0 + mov r8, r2 + muls r0, r5 + ldr r5, =0xfffef2a8 + adds r4, r0, r5 +_081631B6: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + movs r0, 0x2C + adds r2, r6, 0 + muls r2, r0 + mov r1, r8 + adds r0, r2, r1 + adds r1, r3, r0 + ldr r5, =0x0000076c + adds r0, r1, r5 + ldrh r0, [r0] + cmp r0, 0 + beq _081631F0 + adds r5, 0xC + adds r0, r1, r5 + ldrb r0, [r0] + ldr r1, [sp, 0x20] + cmp r0, r1 + bhi _081631F0 + movs r0, 0x64 + muls r0, r7 + ldr r1, =gEnemyParty + adds r0, r1 + adds r1, r3, r4 + adds r2, 0x34 + adds r1, r2 + movs r2, 0 + bl sub_8068338 +_081631F0: + adds r6, 0x1 + adds r7, 0x1 + ldr r2, [sp, 0x18] + ldr r5, [sp, 0x1C] + adds r0, r2, r5 + cmp r7, r0 + blt _081631B6 + b _08163426 + .pool +_08163218: + ldr r7, [sp, 0x18] + adds r0, r7, 0x3 + cmp r7, r0 + blt _08163222 + b _08163426 +_08163222: + ldr r6, =gSaveBlock2Ptr + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r1, =0xffff969c + adds r5, r0, r1 + movs r4, 0 +_08163230: + movs r0, 0x64 + muls r0, r7 + ldr r1, =gEnemyParty + adds r0, r1 + ldr r1, [r6] + adds r1, r5 + lsrs r2, r4, 24 + bl sub_8068528 + movs r2, 0x80 + lsls r2, 17 + adds r4, r2 + adds r7, 0x1 + ldr r0, [sp, 0x18] + adds r0, 0x3 + cmp r7, r0 + blt _08163230 + b _08163426 + .pool +_08163260: + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + lsls r0, 1 + ldr r5, [sp, 0x2C] + adds r0, r5 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08163260 +_08163278: + movs r7, 0 + bl Random + adds r4, r0, 0 + bl Random + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x30] + ldr r6, [sp, 0x1C] + cmp r7, r6 + bne _08163296 + b _08163426 +_08163296: + bl Random + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x28] + bl __modsi3 + lsls r0, 1 + ldr r1, [sp, 0x2C] + adds r0, r1 + ldrh r4, [r0] + ldr r2, [sp, 0x20] + cmp r2, 0x32 + beq _081632B6 + cmp r2, 0x14 + bne _081632BE +_081632B6: + ldr r0, =0x00000351 + cmp r4, r0 + bls _081632BE + b _0816341E +_081632BE: + movs r6, 0 + ldr r5, [sp, 0x18] + adds r5, r7 + mov r8, r5 + b _081632D2 + .pool +_081632D0: + adds r6, 0x1 +_081632D2: + cmp r6, r8 + bge _081632F6 + movs r1, 0x64 + adds r0, r6, 0 + muls r0, r1 + ldr r2, =gEnemyParty + adds r0, r2 + movs r1, 0xB + movs r2, 0 + bl GetMonData + ldr r1, =gUnknown_0203BC8C + ldr r2, [r1] + lsls r1, r4, 4 + adds r1, r2 + ldrh r1, [r1] + cmp r0, r1 + bne _081632D0 +_081632F6: + cmp r6, r8 + beq _081632FC + b _0816341E +_081632FC: + movs r6, 0 + cmp r6, r8 + bge _08163346 + ldr r5, =gBattleFrontierHeldItems + mov r9, r5 + movs r3, 0 +_08163308: + ldr r0, =gEnemyParty + adds r5, r3, r0 + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + str r3, [sp, 0x38] + bl GetMonData + ldr r3, [sp, 0x38] + cmp r0, 0 + beq _0816333E + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + bl GetMonData + ldr r1, =gUnknown_0203BC8C + ldr r2, [r1] + lsls r1, r4, 4 + adds r1, r2 + ldrb r1, [r1, 0xA] + lsls r1, 1 + add r1, r9 + ldr r3, [sp, 0x38] + ldrh r1, [r1] + cmp r0, r1 + beq _08163346 +_0816333E: + adds r3, 0x64 + adds r6, 0x1 + cmp r6, r8 + blt _08163308 +_08163346: + cmp r6, r8 + bne _0816341E + movs r6, 0 + cmp r6, r7 + bge _08163368 + add r0, sp, 0xC + ldrh r0, [r0] + cmp r0, r4 + beq _08163368 + add r1, sp, 0xC +_0816335A: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, r7 + bge _08163368 + ldrh r0, [r1] + cmp r0, r4 + bne _0816335A +_08163368: + cmp r6, r7 + bne _0816341E + lsls r0, r7, 1 + add r0, sp + adds r0, 0xC + strh r4, [r0] + movs r1, 0x64 + mov r0, r8 + muls r0, r1 + ldr r2, =gEnemyParty + adds r0, r2 + ldr r5, =gUnknown_0203BC8C + ldr r2, [r5] + lsls r4, 4 + adds r2, r4, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + ldr r6, [sp, 0x24] + str r6, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + ldr r2, [sp, 0x30] + str r2, [sp, 0x8] + ldr r2, [sp, 0x20] + bl sub_8068634 + movs r0, 0xFF + mov r6, sp + strb r0, [r6, 0x14] + movs r6, 0 + adds r0, r7, 0x1 + str r0, [sp, 0x34] + mov r9, r4 + movs r0, 0x64 + mov r3, r8 + muls r3, r0 + mov r1, r9 + str r1, [sp, 0x3C] + ldr r2, =gEnemyParty + mov r10, r2 +_081633B8: + ldr r0, [r5] + ldr r7, [sp, 0x3C] + adds r0, r7, r0 + lsls r4, r6, 1 + adds r0, 0x2 + adds r0, r4 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + mov r7, r10 + adds r0, r3, r7 + str r3, [sp, 0x38] + bl SetMonMoveSlot + ldr r0, [r5] + ldr r1, [sp, 0x3C] + adds r0, r1, r0 + adds r0, 0x2 + adds r0, r4 + ldrh r0, [r0] + ldr r3, [sp, 0x38] + cmp r0, 0xDA + bne _081633EC + movs r0, 0 + mov r2, sp + strb r0, [r2, 0x14] +_081633EC: + adds r6, 0x1 + cmp r6, 0x3 + ble _081633B8 + movs r5, 0x64 + mov r4, r8 + muls r4, r5 + ldr r6, =gEnemyParty + adds r4, r6 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x14 + bl SetMonData + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + add r0, r9 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + ldr r7, [sp, 0x34] +_0816341E: + ldr r0, [sp, 0x1C] + cmp r7, r0 + beq _08163426 + b _08163296 +_08163426: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81630C4 + + thumb_func_start sub_8163444 +sub_8163444: @ 8163444 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x8] + movs r1, 0xFF + add r0, sp, 0x4 + strb r1, [r0] + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + movs r0, 0xDC + adds r0, r2 + mov r10, r0 + ldrb r0, [r0, 0x1] + movs r1, 0x9 + str r1, [sp, 0x10] + cmp r0, 0x4 + bhi _08163474 + movs r0, 0x6 + str r0, [sp, 0x10] +_08163474: + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + movs r1, 0x32 + str r1, [sp, 0xC] + cmp r0, 0 + beq _0816348A + movs r0, 0x64 + str r0, [sp, 0xC] +_0816348A: + movs r7, 0 + adds r2, 0xE2 + str r2, [sp, 0x14] + add r1, sp, 0x4 + mov r9, r1 +_08163494: + ldr r2, [sp, 0x8] + adds r6, r2, r7 + movs r0, 0x64 + muls r0, r6 + ldr r1, =gEnemyParty + adds r0, r1 + lsls r5, r7, 1 + adds r4, r5, r7 + lsls r4, 2 + mov r2, r10 + adds r1, r2, r4 + ldrh r1, [r1, 0x4] + movs r2, 0x8 + str r2, [sp] + ldr r2, [sp, 0xC] + ldr r3, [sp, 0x10] + bl CreateMonWithEVSpread + movs r0, 0xFF + mov r1, r9 + strb r0, [r1] + adds r2, r7, 0x1 + mov r8, r2 + movs r1, 0x3 +_081634C4: + ldr r2, [sp, 0x14] + adds r0, r2, r4 + ldrh r0, [r0] + cmp r0, 0xDA + bne _081634D4 + movs r2, 0 + mov r0, r9 + strb r2, [r0] +_081634D4: + adds r4, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _081634C4 + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x4 + bl SetMonData + adds r2, r5, r7 + lsls r2, 2 + add r2, r10 + adds r2, 0xE + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + mov r7, r8 + cmp r7, 0x3 + bne _08163494 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8163444 + + thumb_func_start sub_8163524 +sub_8163524: @ 8163524 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_8165C40 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + ldr r5, [r0, 0x30] + movs r4, 0 + ldrh r1, [r5] + b _08163558 + .pool +_0816354C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 1 + adds r0, r5 + ldrh r1, [r0] +_08163558: + ldr r0, =0x0000ffff + cmp r1, r0 + bne _0816354C +_0816355E: + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + cmp r6, 0x32 + beq _0816357A + cmp r6, 0x14 + bne _08163580 +_0816357A: + ldr r0, =0x00000351 + cmp r1, r0 + bhi _0816355E +_08163580: + adds r0, r1, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8163524 + + thumb_func_start sub_8163590 +sub_8163590: @ 8163590 + push {lr} + bl ZeroEnemyPartyMons + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _081635C0 + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + movs r1, 0 + bl sub_81635D4 + b _081635CA + .pool +_081635C0: + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + movs r1, 0 + bl sub_816379C +_081635CA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8163590 + + thumb_func_start sub_81635D4 +sub_81635D4: @ 81635D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 16 + lsrs r2, r0, 16 + adds r3, r2, 0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r0, =0x0000012b + cmp r2, r0 + bhi _0816364A + ldr r4, =gSaveBlock2Ptr + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + ldr r4, [r4] + lsrs r0, 22 + movs r2, 0xCE + lsls r2, 4 + adds r1, r4, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, =0x00000cb2 + adds r4, r3 + ldrh r0, [r4] + cmp r0, 0x5 + bhi _0816363C + adds r0, r1, 0 + movs r1, 0 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r0, 24 + b _081636A6 + .pool +_0816363C: + adds r0, r1, 0 + movs r1, 0x1 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r0, 24 + b _081636A6 +_0816364A: + movs r0, 0xFA + lsls r0, 1 + cmp r2, r0 + bne _08163694 + ldr r7, [sp, 0x10] + adds r0, r7, 0x3 + cmp r7, r0 + blt _0816365C + b _08163776 +_0816365C: + ldr r4, =gSaveBlock2Ptr +_0816365E: + movs r0, 0x64 + muls r0, r7 + ldr r1, =gEnemyParty + adds r0, r1 + ldr r1, [sp, 0x10] + subs r2, r7, r1 + movs r1, 0x2C + muls r2, r1 + movs r3, 0xC2 + lsls r3, 4 + adds r2, r3 + ldr r1, [r4] + adds r1, r2 + bl sub_806819C + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, [sp, 0x10] + adds r0, 0x3 + cmp r7, r0 + blt _0816365E + b _08163776 + .pool +_08163694: + ldr r0, =0x000003fe + cmp r3, r0 + bne _081636A4 + bl sub_81A6CD0 + b _08163776 + .pool +_081636A4: + movs r0, 0x1F +_081636A6: + str r0, [sp, 0x18] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldrb r2, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r2, r0 + mov r8, r2 + movs r7, 0 +_081636CE: + ldr r1, =gUnknown_03006298 + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + mov r9, r0 + ldr r3, [sp, 0x10] + adds r5, r3, r7 + movs r0, 0x64 + adds r6, r5, 0 + muls r6, r0 + ldr r1, =gEnemyParty + adds r0, r6, r1 + ldr r3, =gUnknown_0203BC8C + ldr r2, [r3] + mov r1, r9 + lsls r4, r1, 4 + adds r2, r4, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + mov r10, r3 + ldr r3, [sp, 0x18] + str r3, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + ldr r2, [sp, 0x14] + mov r3, r10 + bl sub_8068634 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] + movs r3, 0 + adds r7, 0x1 + mov r10, r7 + adds r7, r4, 0 +_08163718: + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + mov r2, r9 + lsls r0, r2, 4 + adds r0, r1 + lsls r1, r3, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + ldr r2, =gEnemyParty + adds r0, r6, r2 + adds r2, r3, 0 + str r3, [sp, 0x1C] + bl sub_81A7024 + ldr r3, [sp, 0x1C] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _08163718 + movs r3, 0x64 + adds r4, r5, 0 + muls r4, r3 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0xC + bl SetMonData + ldr r1, =gUnknown_0203BC8C + ldr r0, [r1] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + mov r2, r10 + lsls r0, r2, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _081636CE +_08163776: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81635D4 + + thumb_func_start sub_816379C +sub_816379C: @ 816379C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldrb r0, [r1, 0xA] + mov r9, r0 + ldrb r0, [r1, 0xB] + lsls r0, 8 + mov r2, r9 + orrs r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r2, r0 + mov r9, r2 + movs r7, 0 + mov r8, r7 +_081637D0: + ldr r1, =gUnknown_03006298 + mov r2, r8 + lsls r0, r2, 1 + adds r0, r1 + ldrh r4, [r0] + ldr r5, [sp, 0x10] + add r5, r8 + movs r7, 0x64 + adds r6, r5, 0 + muls r6, r7 + ldr r1, =gEnemyParty + adds r0, r6, r1 + ldr r7, =gUnknown_0203BC8C + ldr r2, [r7] + lsls r4, 4 + adds r2, r4, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + movs r7, 0 + str r7, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + movs r2, 0x1E + bl sub_8068634 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] + mov r10, r5 + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x14] + mov r8, r4 + mov r5, r8 +_08163818: + ldr r1, =gUnknown_0203BC8C + ldr r0, [r1] + adds r0, r5, r0 + lsls r4, r7, 1 + adds r0, 0x2 + adds r0, r4 + ldrh r1, [r0] + ldr r2, =gEnemyParty + adds r0, r6, r2 + adds r2, r7, 0 + bl sub_81A7024 + ldr r1, =gUnknown_0203BC8C + ldr r0, [r1] + adds r0, r5, r0 + adds r0, 0x2 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0xDA + bne _08163846 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] +_08163846: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _08163818 + movs r2, 0x64 + mov r4, r10 + muls r4, r2 + ldr r7, =gEnemyParty + adds r4, r7 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0xC + bl SetMonData + ldr r1, =gUnknown_0203BC8C + ldr r0, [r1] + add r0, r8 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + ldr r2, [sp, 0x14] + lsls r0, r2, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x2 + bls _081637D0 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816379C + + thumb_func_start ConvertBattleFrontierTrainerSpeechToString +ConvertBattleFrontierTrainerSpeechToString: @ 81638AC + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =gStringVar4 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + movs r3, 0x2 + bl ConvertEasyChatWordsToString + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + adds r1, r4, 0 + bl GetStringWidth + cmp r0, 0xCC + bls _0816390A + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x3 + bl ConvertEasyChatWordsToString + ldrb r0, [r4] + movs r1, 0x1 + cmp r0, 0xFE + beq _081638EE + adds r2, r4, 0 +_081638E4: + adds r0, r1, r2 + ldrb r0, [r0] + adds r1, 0x1 + cmp r0, 0xFE + bne _081638E4 +_081638EE: + ldr r2, =gStringVar4 + adds r0, r1, r2 + ldrb r0, [r0] + adds r3, r2, 0 + cmp r0, 0xFE + beq _08163904 +_081638FA: + adds r1, 0x1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFE + bne _081638FA +_08163904: + adds r1, r3 + movs r0, 0xFA + strb r0, [r1] +_0816390A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ConvertBattleFrontierTrainerSpeechToString + + thumb_func_start sub_8163914 +sub_8163914: @ 8163914 + push {lr} + bl sub_8165C40 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _08163930 + ldr r0, =gTrainerBattleOpponent_B + b _08163932 + .pool +_08163930: + ldr r0, =gTrainerBattleOpponent_A +_08163932: + ldrh r3, [r0] + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _08163950 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000bfc + b _08163986 + .pool +_08163950: + ldr r0, =0x0000012b + cmp r3, r0 + bhi _08163974 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString + b _081639A8 + .pool +_08163974: + ldr r0, =0x0000018f + cmp r3, r0 + bhi _0816399C + ldr r1, =gSaveBlock2Ptr + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xfffef2b8 +_08163986: + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + b _081639A8 + .pool +_0816399C: + adds r0, r3, 0 + adds r0, 0x70 + lsls r0, 24 + lsrs r0, 24 + bl sub_819F99C +_081639A8: + pop {r0} + bx r0 + thumb_func_end sub_8163914 + + thumb_func_start sub_81639AC +sub_81639AC: @ 81639AC + push {r4-r6,lr} + sub sp, 0x4 + bl sub_81864CC + ldr r0, =gBattleScripting + adds r0, 0x26 + ldrb r0, [r0] + cmp r0, 0xA + bhi _08163A78 + lsls r0, 2 + ldr r1, =_081639D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081639D0: + .4byte _081639FC + .4byte _08163A38 + .4byte _08163A74 + .4byte _081639FC + .4byte _081639FC + .4byte _081639FC + .4byte _081639FC + .4byte _081639FC + .4byte _08163A78 + .4byte _081639FC + .4byte _081639FC +_081639FC: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ebc + adds r1, r0, r2 + ldr r2, [r1] + ldr r0, =0x00fffffe + cmp r2, r0 + bhi _08163A2C + adds r0, r2, 0x1 + str r0, [r1] + movs r1, 0x14 + bl __umodsi3 + cmp r0, 0 + bne _08163A78 + bl sub_81DA57C + b _08163A78 + .pool +_08163A2C: + ldr r0, =0x00ffffff + str r0, [r1] + b _08163A78 + .pool +_08163A38: + movs r5, 0 + ldr r6, =gSaveBlock1Ptr +_08163A3C: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + movs r0, 0x8E + lsls r0, 2 + adds r1, r4, r0 + ldr r0, [r6] + adds r0, r1 + movs r1, 0xC + bl GetMonData + mov r1, sp + strh r0, [r1] + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xC + mov r2, sp + bl SetMonData + adds r5, 0x1 + cmp r5, 0x5 + ble _08163A3C + b _08163A78 + .pool +_08163A74: + bl sub_816537C +_08163A78: + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81639AC + + thumb_func_start sub_8163A8C +sub_8163A8C: @ 8163A8C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl IsBattleTransitionDone + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08163AB0 + ldr r0, =gMain + ldr r1, =sub_81639AC + str r1, [r0, 0x8] + ldr r0, =sub_8036760 + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_08163AB0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8163A8C + + thumb_func_start sub_8163AC4 +sub_8163AC4: @ 8163AC4 + push {r4-r6,lr} + sub sp, 0x4 + ldr r0, =gBattleScripting + ldr r2, =gSpecialVar_0x8004 + ldrh r1, [r2] + adds r0, 0x26 + strb r1, [r0] + ldrh r0, [r2] + cmp r0, 0xA + bls _08163ADA + b _08163E68 +_08163ADA: + lsls r0, 2 + ldr r1, =_08163AF0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08163AF0: + .4byte _08163B1C + .4byte _08163BC0 + .4byte _08163C10 + .4byte _08163C70 + .4byte _08163CC4 + .4byte _08163D28 + .4byte _08163D74 + .4byte _08163DB4 + .4byte _08163E2C + .4byte _08163DF4 + .4byte _08163DC8 +_08163B1C: + ldr r5, =gBattleTypeFlags + movs r0, 0x84 + lsls r0, 1 + str r0, [r5] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + beq _08163B56 + cmp r4, 0x1 + bgt _08163B44 + cmp r4, 0 + beq _08163B4E + b _08163BA6 + .pool +_08163B44: + cmp r4, 0x2 + beq _08163B64 + cmp r4, 0x3 + beq _08163B98 + b _08163BA6 +_08163B4E: + movs r0, 0x3 + bl sub_8163048 + b _08163BA6 +_08163B56: + movs r0, 0x4 + bl sub_8163048 + ldr r0, [r5] + orrs r0, r4 + str r0, [r5] + b _08163BA6 +_08163B64: + movs r0, 0x2 + bl sub_816306C + ldr r1, =gUnknown_02038BCE + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000cd6 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + ldrh r0, [r1] + bl sub_8165404 + ldr r0, [r5] + ldr r1, =0x00408041 + orrs r0, r1 + str r0, [r5] + b _08163BA6 + .pool +_08163B98: + ldr r0, [r5] + ldr r1, =0x00800043 + orrs r0, r1 + str r0, [r5] + movs r0, 0x2 + bl sub_816306C +_08163BA6: + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl PlayNewMapMusic__default_for_battle + movs r0, 0 + b _08163E10 + .pool +_08163BC0: + movs r5, 0 + ldr r6, =gSaveBlock1Ptr +_08163BC4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r0, r4, r0 + movs r1, 0xC + bl GetMonData + mov r1, sp + strh r0, [r1] + movs r0, 0x8E + lsls r0, 2 + adds r4, r0 + ldr r0, [r6] + adds r0, r4 + movs r1, 0xC + mov r2, sp + bl SetMonData + adds r5, 0x1 + cmp r5, 0x5 + ble _08163BC4 + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl PlayNewMapMusic__default_for_battle + movs r0, 0xC + b _08163E10 + .pool +_08163C10: + bl ZeroEnemyPartyMons + movs r5, 0 + ldr r4, =gSaveBlock2Ptr +_08163C18: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x2C + adds r2, r5, 0 + muls r2, r1 + movs r1, 0xC2 + lsls r1, 4 + adds r2, r1 + ldr r1, [r4] + adds r1, r2 + bl sub_806819C + adds r5, 0x1 + cmp r5, 0x2 + ble _08163C18 + ldr r1, =gBattleTypeFlags + ldr r0, =0x00000808 + str r0, [r1] + ldr r1, =gTrainerBattleOpponent_A + movs r0, 0 + strh r0, [r1] + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl PlayNewMapMusic__default_for_battle + movs r0, 0xD + b _08163E10 + .pool +_08163C70: + ldr r4, =gBattleTypeFlags + ldr r0, =0x00010008 + str r0, [r4] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _08163C8A + ldr r0, [r4] + orrs r0, r1 + str r0, [r4] +_08163C8A: + ldr r0, =gTrainerBattleOpponent_A + ldrh r1, [r0] + ldr r0, =0x000003fe + cmp r1, r0 + bne _08163C9A + movs r0, 0x2 + bl sub_8163048 +_08163C9A: + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl sub_806E694 + movs r0, 0x3 + b _08163E10 + .pool +_08163CC4: + ldr r4, =gBattleTypeFlags + ldr r0, =0x00020008 + str r0, [r4] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _08163CDE + ldr r0, [r4] + orrs r0, r1 + str r0, [r4] +_08163CDE: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _08163D0C + movs r0, 0x3 + bl sub_8163048 + b _08163D12 + .pool +_08163D0C: + movs r0, 0x3 + bl sub_81630A0 +_08163D12: + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl PlayNewMapMusic__default_for_battle + movs r0, 0x4 + b _08163E10 + .pool +_08163D28: + ldr r1, =gBattleTypeFlags + ldr r0, =0x00040008 + str r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _08163D58 + movs r0, 0x3 + bl sub_8163048 + b _08163D5E + .pool +_08163D58: + movs r0, 0x3 + bl sub_81630A0 +_08163D5E: + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl PlayNewMapMusic__default_for_battle + movs r0, 0x5 + b _08163E10 + .pool +_08163D74: + ldr r4, =gBattleTypeFlags + ldr r0, =0x00080008 + str r0, [r4] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _08163D8E + ldr r0, [r4] + orrs r0, r1 + str r0, [r4] +_08163D8E: + bl sub_8163590 + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl PlayNewMapMusic__default_for_battle + movs r0, 0x6 + b _08163E10 + .pool +_08163DB4: + ldr r1, =gBattleTypeFlags + movs r0, 0x84 + lsls r0, 1 + str r0, [r1] + movs r0, 0x3 + bl sub_8163048 + b _08163E00 + .pool +_08163DC8: + ldr r1, =gBattleTypeFlags + ldr r0, =0x00200008 + str r0, [r1] + movs r0, 0x3 + bl sub_8163048 + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl PlayNewMapMusic__default_for_battle + movs r0, 0xA + b _08163E10 + .pool +_08163DF4: + ldr r1, =gBattleTypeFlags + ldr r0, =0x00008109 + str r0, [r1] + movs r0, 0x1 + bl sub_816306C +_08163E00: + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl PlayNewMapMusic__default_for_battle + movs r0, 0x7 +_08163E10: + bl sub_80B100C + lsls r0, 24 + lsrs r0, 24 + bl sub_8145EF4 + b _08163E68 + .pool +_08163E2C: + ldr r1, =gBattleTypeFlags + ldr r0, =0x00408049 + str r0, [r1] + ldr r5, =0x00000c03 + adds r0, r5, 0 + bl sub_8165404 + ldr r4, =gUnknown_02038BFC + movs r0, 0 + strb r0, [r4] + ldr r0, =gUnknown_08224158 + bl TrainerBattleConfigure + movs r0, 0x1 + strb r0, [r4] + ldr r0, =gUnknown_08224167 + bl TrainerBattleConfigure + ldr r0, =gUnknown_02038BCE + strh r5, [r0] + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl PlayNewMapMusic__default_for_battle + movs r0, 0x12 + bl sub_8145EF4 +_08163E68: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8163AC4 + + thumb_func_start sub_8163E90 +sub_8163E90: @ 8163E90 + push {r4-r6,lr} + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r5, [r0] + lsls r5, 30 + lsrs r5, 30 + ldr r0, =0x000040ce + bl VarGet + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8164FCC + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, [r6] + lsls r5, 1 + lsls r4, 2 + adds r5, r4 + movs r1, 0xCE + lsls r1, 4 + adds r0, r1 + adds r1, r0, r5 + ldrh r0, [r1] + cmp r0, r2 + bcs _08163ED0 + strh r2, [r1] +_08163ED0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8163E90 + + thumb_func_start sub_8163EE4 +sub_8163EE4: @ 8163EE4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x0000064c + adds r5, r0, r1 + adds r0, r5, 0 + bl sub_8164FB8 + ldr r0, [r4] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, [r4] + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _08163F40 + ldr r4, =gUnknown_085DCEFA + ldrb r0, [r2, 0xA] + ldrb r1, [r2, 0xB] + adds r0, r1 + ldrb r1, [r2, 0xC] + adds r0, r1 + ldrb r1, [r2, 0xD] + adds r0, r1 + movs r1, 0x14 + b _08163F52 + .pool +_08163F40: + ldr r4, =gUnknown_085DCEDC + ldrb r0, [r2, 0xA] + ldrb r1, [r2, 0xB] + adds r0, r1 + ldrb r1, [r2, 0xC] + adds r0, r1 + ldrb r1, [r2, 0xD] + adds r0, r1 + movs r1, 0x1E +_08163F52: + bl __umodsi3 + adds r0, r4 + ldrb r0, [r0] + strb r6, [r5] + strb r0, [r5, 0x1] + adds r0, r5, 0 + adds r0, 0xC + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + adds r1, 0xA + bl CopyUnalignedWord + adds r0, r5, 0x4 + ldr r1, [r4] + bl StringCopy7 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8164FCC + strh r0, [r5, 0x2] + movs r4, 0 + movs r2, 0x10 + adds r2, r5 + mov r12, r2 + movs r7, 0x1C + adds r7, r5 + mov r9, r7 + adds r6, r5, 0 + adds r6, 0x28 + movs r0, 0xE4 + adds r0, r5 + mov r8, r0 +_08163F96: + lsls r2, r4, 1 + mov r1, r12 + adds r3, r1, r2 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r7, =0x00002bbc + adds r0, r1, r7 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + mov r0, r9 + adds r3, r0, r2 + adds r7, 0xC + adds r0, r1, r7 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + adds r3, r6, r2 + ldr r0, =0x00002bd4 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + strh r0, [r3] + adds r4, 0x1 + cmp r4, 0x5 + ble _08163F96 + movs r4, 0 +_08163FCC: + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + lsls r1, r4, 1 + ldr r2, =0x00000caa + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _08163FF4 + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, =gBattleScripting + 0x14 + adds r0, r1 + movs r1, 0x2C + muls r1, r4 + adds r1, 0x34 + adds r1, r5, r1 + bl sub_80686FC +_08163FF4: + adds r4, 0x1 + cmp r4, 0x3 + ble _08163FCC + ldr r0, =gGameLanguage + ldrb r0, [r0] + mov r7, r8 + strb r0, [r7] + ldr r0, [r6] + ldr r1, =0x0000064c + adds r0, r1 + bl sub_8164F70 + bl sub_8163E90 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8163EE4 + + thumb_func_start sub_8164040 +sub_8164040: @ 8164040 + push {r4,r5,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r4, [r0] + lsls r4, 30 + lsrs r4, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r5, [r5] + lsls r4, 1 + lsrs r0, 14 + adds r4, r0 + movs r2, 0xCE + lsls r2, 4 + adds r0, r5, r2 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + bne _0816408E + cmp r1, 0x1 + bgt _0816408A + ldr r1, =0x00000cb2 + adds r0, r5, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _0816408E +_0816408A: + bl sub_8163EE4 +_0816408E: + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164040 + + thumb_func_start nullsub_61 +nullsub_61: @ 81640D8 + bx lr + thumb_func_end nullsub_61 + + thumb_func_start nullsub_116 +nullsub_116: @ 81640DC + bx lr + thumb_func_end nullsub_116 + + thumb_func_start sub_81640E0 +sub_81640E0: @ 81640E0 + push {r4-r7,lr} + sub sp, 0xC + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r4, =gPlayerParty + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r7, r0, 16 + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + movs r6, 0 + movs r2, 0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r5, r0 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, 0xE0 + adds r0, r1 + mov r3, sp +_08164122: + ldrh r1, [r0] + cmp r1, r7 + beq _08164130 + cmp r1, r4 + beq _08164130 + stm r3!, {r2} + adds r6, 0x1 +_08164130: + adds r0, 0xC + adds r2, 0x1 + cmp r2, 0x2 + ble _08164122 + bl Random + ldr r4, =gUnknown_03006298 + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4] +_08164150: + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4, 0x2] + ldrh r1, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + beq _08164150 + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81640E0 + + thumb_func_start sub_8164188 +sub_8164188: @ 8164188 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0xC] + ldr r4, =gPlayerParty + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x10] + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x14] + movs r3, 0 + mov r8, r3 + movs r7, 0 + adds r2, r6, 0 + ldr r0, =0xfffffed4 + adds r5, r0 + ldr r6, =0x0000076c + mov r10, sp + movs r0, 0xEC + adds r1, r5, 0 + muls r1, r0 + mov r9, r1 +_081641E6: + ldr r1, [r2] + movs r0, 0x2C + muls r0, r7 + mov r3, r9 + adds r5, r0, r3 + adds r1, r5 + adds r0, r1, r6 + ldrh r0, [r0] + ldr r3, [sp, 0x10] + cmp r0, r3 + beq _0816423A + ldr r3, [sp, 0x14] + cmp r0, r3 + beq _0816423A + movs r0, 0xEF + lsls r0, 3 + adds r4, r1, r0 + ldr r1, [sp, 0xC] + lsls r0, r1, 24 + lsrs r0, 24 + str r2, [sp, 0x18] + bl sub_8165C90 + ldrb r1, [r4] + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x18] + cmp r1, r0 + bhi _0816423A + ldr r0, [r2] + adds r0, r5 + adds r0, r6 + ldrh r0, [r0] + cmp r0, 0 + beq _0816423A + mov r3, r10 + adds r3, 0x4 + mov r10, r3 + subs r3, 0x4 + stm r3!, {r7} + movs r0, 0x1 + add r8, r0 +_0816423A: + adds r7, 0x1 + cmp r7, 0x3 + ble _081641E6 + bl Random + ldr r4, =gUnknown_03006298 + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4, 0x4] +_08164258: + bl Random + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4, 0x6] + ldrh r1, [r4, 0x4] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + beq _08164258 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164188 + + thumb_func_start sub_81642A0 +sub_81642A0: @ 81642A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0, r1 + str r1, [sp, 0x24] + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0x14] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r1, [r5] + ldr r3, [sp, 0x14] + lsls r2, r3, 1 + lsrs r0, 14 + adds r2, r0 + movs r4, 0xCE + lsls r4, 4 + adds r1, r4 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] + ldr r4, =gPlayerParty + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + str r0, [sp, 0x1C] + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + str r0, [sp, 0x20] + bl sub_8165C40 + movs r7, 0 + ldr r0, [sp, 0x18] + lsls r0, 24 + mov r10, r0 +_08164318: + lsls r6, r7, 1 +_0816431A: + mov r1, r10 + lsrs r0, r1, 24 + movs r1, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r2, 0 + mov r9, r2 + cmp r9, r7 + bge _08164368 + ldr r0, [r5] + ldr r3, =0x00000cb4 + adds r1, r0, r3 + ldrh r0, [r1] + cmp r0, r8 + beq _08164368 + ldr r0, =gUnknown_0203BC88 + ldr r2, [r0] + movs r4, 0x34 + mov r0, r8 + muls r0, r4 + adds r0, r2 + ldrb r3, [r0] +_0816434C: + ldrh r0, [r1] + muls r0, r4 + adds r0, r2 + ldrb r0, [r0] + cmp r0, r3 + beq _08164368 + adds r1, 0x2 + movs r0, 0x1 + add r9, r0 + cmp r9, r7 + bge _08164368 + ldrh r0, [r1] + cmp r0, r8 + bne _0816434C +_08164368: + cmp r9, r7 + bne _0816431A + ldr r0, [r5] + ldr r1, =0x00000cb4 + adds r0, r1 + adds r0, r6 + mov r2, r8 + strh r2, [r0] + mov r7, r9 + adds r7, 0x1 + cmp r7, 0x5 + ble _08164318 + movs r3, 0x8 + mov r10, r3 + movs r4, 0 + mov r9, r4 + ldr r0, [sp, 0x24] + str r0, [sp, 0x40] +_0816438C: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + mov r2, r9 + lsls r1, r2, 1 + ldr r3, =0x00000cb4 + adds r0, r3 + adds r0, r1 + ldrh r0, [r0] + mov r8, r0 + bl sub_81627A4 + ldr r4, [sp, 0x40] + strb r0, [r4, 0x19] + movs r7, 0 +_081643A8: + adds r0, r7, 0x1 + str r0, [sp, 0x30] + mov r1, r10 + lsls r1, 1 + str r1, [sp, 0x38] + mov r2, r10 + adds r2, 0x1 + str r2, [sp, 0x34] + mov r0, r10 + subs r0, 0x1 + lsls r0, 1 + str r0, [sp, 0x28] +_081643C0: + mov r0, r8 + bl sub_8163524 + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0x1 + ands r0, r7 + cmp r0, 0 + beq _081643F4 + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r4, =0x00000cb4 + adds r0, r4 + ldr r1, [sp, 0x28] + adds r0, r1 + ldrh r2, [r0] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r2, 4 + adds r2, r0 + lsls r1, r6, 4 + adds r1, r0 + ldrb r0, [r2, 0xA] + ldrb r1, [r1, 0xA] + cmp r0, r1 + beq _081643C0 +_081643F4: + movs r5, 0x8 + cmp r5, r10 + bge _08164430 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r1, =gUnknown_0203BC8C + ldr r3, [r1] + lsls r1, r6, 4 + adds r1, r3 + ldr r4, =0x00000cc4 + adds r2, r0, r4 + ldrh r0, [r1] + mov r12, r0 +_0816440E: + ldrh r0, [r2] + lsls r0, 4 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r12 + beq _08164430 + ldrh r0, [r1] + ldr r4, [sp, 0x1C] + cmp r4, r0 + beq _08164430 + ldr r4, [sp, 0x20] + cmp r4, r0 + beq _08164430 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r10 + blt _0816440E +_08164430: + cmp r5, r10 + bne _081643C0 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000cb4 + adds r0, r2 + ldr r3, [sp, 0x38] + adds r0, r3 + strh r6, [r0] + ldr r4, [sp, 0x34] + mov r10, r4 + ldr r7, [sp, 0x30] + cmp r7, 0x1 + ble _081643A8 + ldr r0, [sp, 0x40] + adds r0, 0x18 + str r0, [sp, 0x40] + movs r1, 0x1 + add r9, r1 + mov r2, r9 + cmp r2, 0x5 + ble _0816438C + movs r3, 0 + mov r10, r3 + bl sub_8165B20 + movs r4, 0 + mov r9, r4 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r2, 0 + adds r6, r0, 0 + adds r6, 0xDC + mov r8, sp +_08164474: + ldrb r0, [r6] + lsls r4, r0, 25 + lsrs r0, r4, 30 + cmp r0, 0 + beq _081644E0 + ldr r1, =gUnknown_085DF9EC + ldrb r0, [r6, 0x1] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x7 + str r2, [sp, 0x44] + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x44] + ldr r1, [sp, 0x18] + cmp r0, r1 + bgt _081644E0 + lsrs r0, r4, 30 + subs r0, 0x1 + ldr r3, [sp, 0x14] + cmp r0, r3 + bne _081644E0 + movs r5, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xE0 + adds r1, r2, r0 + movs r7, 0x2 +_081644B0: + ldrh r0, [r1] + ldr r4, [sp, 0x1C] + cmp r4, r0 + beq _081644C0 + ldr r3, [sp, 0x20] + cmp r3, r0 + beq _081644C0 + adds r5, 0x1 +_081644C0: + adds r1, 0xC + subs r7, 0x1 + cmp r7, 0 + bge _081644B0 + cmp r5, 0x2 + ble _081644E0 + movs r0, 0xC8 + lsls r0, 1 + add r0, r9 + mov r4, r8 + adds r4, 0x4 + mov r8, r4 + subs r4, 0x4 + stm r4!, {r0} + movs r0, 0x1 + add r10, r0 +_081644E0: + adds r2, 0x44 + adds r6, 0x44 + movs r1, 0x1 + add r9, r1 + mov r3, r9 + cmp r3, 0x3 + ble _08164474 + mov r4, r10 + cmp r4, 0 + beq _08164532 + bl Random + ldr r6, =gSaveBlock2Ptr + ldr r4, [r6] + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + movs r5, 0xCC + lsls r5, 4 + adds r4, r5 + strh r0, [r4] + ldrh r0, [r4] + bl sub_81627A4 + ldr r1, [sp, 0x24] + adds r1, 0xA8 + strb r0, [r1, 0x1] + movs r0, 0xD8 + lsls r0, 2 + bl FlagReset + ldr r0, [r6] + adds r0, r5 + ldrh r0, [r0] + bl sub_81640E0 +_08164532: + movs r0, 0 + mov r10, r0 + mov r9, r0 + mov r1, sp + str r1, [sp, 0x3C] +_0816453C: + ldr r0, =gSaveBlock2Ptr + movs r2, 0xEC + mov r1, r9 + muls r1, r2 + movs r3, 0xE7 + lsls r3, 3 + adds r1, r3 + ldr r0, [r0] + movs r2, 0 + movs r3, 0 + movs r7, 0 + mov r4, r9 + adds r4, 0x1 + str r4, [sp, 0x2C] + adds r1, r0, r1 +_0816455A: + ldm r1!, {r0} + orrs r2, r0 + adds r3, r0 + adds r7, 0x1 + cmp r7, 0x39 + bls _0816455A + ldr r0, =gSaveBlock2Ptr + ldr r5, [r0] + movs r1, 0xEC + mov r6, r9 + muls r6, r1 + adds r4, r5, r6 + ldr r1, =0x0000073a + adds r0, r4, r1 + ldrh r0, [r0] + movs r1, 0x7 + str r2, [sp, 0x44] + str r3, [sp, 0x48] + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r2, [sp, 0x44] + ldr r3, [sp, 0x48] + ldr r1, [sp, 0x18] + cmp r0, r1 + bgt _08164656 + movs r1, 0xE7 + lsls r1, 3 + adds r0, r4, r1 + ldrb r0, [r0] + ldr r4, [sp, 0x14] + cmp r0, r4 + bne _08164656 + cmp r2, 0 + beq _08164656 + adds r1, 0xE8 + adds r0, r5, r1 + adds r0, r6 + ldr r0, [r0] + cmp r0, r3 + bne _08164656 + movs r5, 0 + movs r7, 0 + ldr r2, =gSaveBlock2Ptr + mov r8, r2 + ldr r3, =0x0000076c +_081645B8: + mov r4, r8 + ldr r2, [r4] + movs r0, 0x2C + adds r1, r7, 0 + muls r1, r0 + movs r4, 0xEC + mov r0, r9 + muls r0, r4 + adds r6, r1, r0 + adds r2, r6 + adds r0, r2, r3 + ldrh r0, [r0] + ldr r1, [sp, 0x1C] + cmp r1, r0 + beq _0816463C + ldr r4, [sp, 0x20] + cmp r4, r0 + beq _0816463C + movs r0, 0xEF + lsls r0, 3 + adds r4, r2, r0 + ldr r1, [sp, 0x14] + lsls r0, r1, 24 + lsrs r0, 24 + str r3, [sp, 0x48] + bl sub_8165C90 + ldrb r1, [r4] + lsls r0, 24 + lsrs r0, 24 + ldr r3, [sp, 0x48] + cmp r1, r0 + bhi _0816463C + mov r2, r8 + ldr r0, [r2] + adds r0, r6 + adds r0, r3 + ldrh r0, [r0] + cmp r0, 0 + b _08164638 + .pool +_08164638: + beq _0816463C + adds r5, 0x1 +_0816463C: + adds r7, 0x1 + cmp r7, 0x3 + ble _081645B8 + cmp r5, 0x1 + ble _08164656 + movs r0, 0x96 + lsls r0, 1 + add r0, r9 + ldr r3, [sp, 0x3C] + stm r3!, {r0} + str r3, [sp, 0x3C] + movs r4, 0x1 + add r10, r4 +_08164656: + ldr r0, [sp, 0x2C] + mov r9, r0 + cmp r0, 0x4 + bgt _08164660 + b _0816453C +_08164660: + mov r1, r10 + cmp r1, 0 + beq _081646A0 + bl Random + ldr r6, =gSaveBlock2Ptr + ldr r4, [r6] + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + ldr r5, =0x00000cc2 + adds r4, r5 + strh r0, [r4] + ldrh r0, [r4] + bl sub_81627A4 + ldr r1, [sp, 0x24] + adds r1, 0xC0 + strb r0, [r1, 0x1] + ldr r0, =0x00000361 + bl FlagReset + ldr r0, [r6] + adds r0, r5 + ldrh r0, [r0] + bl sub_8164188 +_081646A0: + add sp, 0x4C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81642A0 + + thumb_func_start sub_81646BC +sub_81646BC: @ 81646BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + movs r0, 0 + mov r9, r0 + mov r10, r0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r5, r0 + beq _081647CE + subs r0, 0xC9 + cmp r5, r0 + bhi _081646FC + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + lsls r0, r4, 4 + adds r0, r1 + ldrh r1, [r0, 0x2] + mov r9, r1 + ldrh r0, [r0] + mov r10, r0 + b _081647CE + .pool +_081646FC: + ldr r0, =0x0000018f + cmp r5, r0 + bhi _08164750 + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r1, =gUnknown_03006298 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + adds r0, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x2C + muls r1, r0 + ldr r0, =0xfffffed4 + adds r2, r5, r0 + movs r0, 0xEC + muls r0, r2 + adds r1, r0 + adds r3, r1 + movs r1, 0xEE + lsls r1, 3 + adds r0, r3, r1 + ldrh r0, [r0] + mov r9, r0 + ldr r2, =0x0000076c + adds r3, r2 + ldrh r3, [r3] + mov r10, r3 + b _081647CE + .pool +_08164750: + ldr r4, =gSaveBlock2Ptr + ldr r3, [r4] + ldr r1, =gUnknown_03006298 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r2, =0xfffffe70 + adds r1, r5, r2 + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r0, r2 + adds r3, r0 + adds r0, r3, 0 + adds r0, 0xE2 + ldrh r0, [r0] + mov r9, r0 + adds r3, 0xE0 + ldrh r3, [r3] + mov r10, r3 + movs r3, 0 + ldr r7, =gStringVar3 + mov r8, r7 + adds r0, r4, 0 + mov r12, r0 + adds r4, r2, 0 + movs r6, 0x8A + lsls r6, 1 +_08164794: + mov r1, r8 + adds r2, r3, r1 + mov r1, r12 + ldr r0, [r1] + adds r1, r3, r4 + adds r0, r6 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + adds r3, 0x1 + cmp r3, 0x6 + ble _08164794 + adds r1, r3, r7 + movs r0, 0xFF + strb r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =0xfffffe70 + adds r1, r5, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r1, =0x0000011b + adds r0, r2, r1 + ldrb r1, [r0] + adds r0, r7, 0 + bl ConvertInternationalString +_081647CE: + ldr r0, =gStringVar1 + movs r1, 0xD + mov r2, r9 + muls r2, r1 + adds r1, r2, 0 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r0, =gStringVar2 + movs r1, 0xB + mov r2, r10 + muls r2, r1 + adds r1, r2, 0 + ldr r2, =gSpeciesNames + adds r1, r2 + bl StringCopy + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81646BC + + thumb_func_start sub_8164828 +sub_8164828: @ 8164828 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + bl sub_8165C40 + bl sub_81A39C4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =gScriptLastTalked + ldrh r0, [r0] + subs r5, r0, 0x2 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r5, 1 + ldr r2, =0x00000cb4 + adds r0, r2 + adds r0, r1 + ldrh r7, [r0] + movs r3, 0 + str r3, [sp] + ldr r4, =gUnknown_085DD500 + lsls r6, r7, 16 + b _08164884 + .pool +_0816487C: + adds r4, 0x8 + ldr r0, [sp] + adds r0, 0x1 + str r0, [sp] +_08164884: + ldr r1, [sp] + cmp r1, 0x31 + bhi _0816489A + lsrs r0, r6, 16 + bl sub_8162D34 + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + cmp r1, r0 + bne _0816487C +_0816489A: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x4 + bls _081648A4 + b _08164AC2 +_081648A4: + lsls r0, 2 + ldr r1, =_081648B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081648B8: + .4byte _081648CC + .4byte _08164984 + .4byte _0816499C + .4byte _081649BC + .4byte _08164AC2 +_081648CC: + movs r0, 0xFA + lsls r0, 1 + cmp r7, r0 + bne _081648D6 + b _08164B54 +_081648D6: + subs r0, 0xC9 + cmp r7, r0 + ble _081648E2 + ldr r0, =0x0000018f + cmp r7, r0 + bgt _081648F4 +_081648E2: + ldr r0, =gStringVar1 + adds r1, r7, 0 + bl sub_8162E20 + b _08164AC2 + .pool +_081648F4: + movs r3, 0 + lsls r2, r7, 16 + mov r10, r2 + ldr r6, =gStringVar1 + mov r9, r6 + ldr r4, =gSaveBlock2Ptr + mov r8, r4 + ldr r5, =0xfffffe70 + adds r1, r7, r5 + lsls r0, r1, 4 + adds r0, r1 + lsls r4, r0, 2 + movs r5, 0x8A + lsls r5, 1 +_08164910: + mov r0, r9 + adds r2, r3, r0 + mov r1, r8 + ldr r0, [r1] + adds r1, r3, r4 + adds r0, r5 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + adds r3, 0x1 + cmp r3, 0x6 + ble _08164910 + adds r1, r3, r6 + movs r0, 0xFF + strb r0, [r1] + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + ldr r3, =0xfffffe70 + adds r0, r7, r3 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r1, r4 + ldr r5, =0x0000011b + adds r0, r1, r5 + ldrb r1, [r0] + adds r0, r6, 0 + bl ConvertInternationalString + ldr r0, =gStringVar2 + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + adds r1, r4 + adds r1, 0xDE + ldrb r1, [r1] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar3 + mov r3, r10 + lsrs r1, r3, 16 + bl sub_8162E20 + b _08164AC2 + .pool +_08164984: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r5, 2 + adds r1, r0 + ldr r4, =0x00000cc4 + adds r1, r4 + b _081649A8 + .pool +_0816499C: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r5, 2 + adds r1, r0 + ldr r5, =0x00000cc6 + adds r1, r5 +_081649A8: + adds r0, r7, 0 + ldrh r1, [r1] + bl sub_81646BC + b _08164AC2 + .pool +_081649BC: + ldr r0, =gUnknown_02038BCE + strh r7, [r0] + ldr r0, =0x0000012b + cmp r7, r0 + bgt _08164A08 + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + lsls r1, r5, 1 + adds r0, r1, 0 + adds r0, 0x8 + lsls r0, 1 + ldr r3, =0x00000cb4 + adds r2, r4, r3 + adds r0, r2, r0 + ldrh r3, [r0] + ldr r5, =0x00000cd8 + adds r0, r4, r5 + strh r3, [r0] + adds r1, 0x9 + lsls r1, 1 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x00000cda + adds r4, r1 + strh r0, [r4] + b _08164A46 + .pool +_08164A08: + ldr r0, =0x0000018f + cmp r7, r0 + bgt _08164A30 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r3, =gUnknown_03006298 + ldrh r2, [r3, 0x4] + ldr r4, =0x00000cd8 + adds r0, r1, r4 + strh r2, [r0] + ldrh r0, [r3, 0x6] + b _08164A40 + .pool +_08164A30: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r3, =gUnknown_03006298 + ldrh r2, [r3] + ldr r4, =0x00000cd8 + adds r0, r1, r4 + strh r2, [r0] + ldrh r0, [r3, 0x2] +_08164A40: + ldr r5, =0x00000cda + adds r1, r5 + strh r0, [r1] +_08164A46: + movs r5, 0 + mov r0, r8 + lsls r0, 24 + str r0, [sp, 0x4] +_08164A4E: + lsls r1, r5, 1 + mov r10, r1 + adds r2, r5, 0x1 + mov r9, r2 + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r0, 1 + lsls r0, 24 + mov r8, r0 +_08164A60: + ldr r3, [sp, 0x4] + lsrs r0, r3, 24 + mov r4, r8 + lsrs r1, r4, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =gUnknown_02038BCE + ldrh r0, [r0] + cmp r0, r3 + beq _08164A60 + movs r2, 0 + cmp r2, r5 + bge _08164AA2 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r4, =0x00000cb4 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r3 + beq _08164AA2 + adds r6, r1, 0 +_08164A8E: + adds r2, 0x1 + cmp r2, r5 + bge _08164AA2 + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _08164A8E +_08164AA2: + cmp r2, r5 + bne _08164A60 + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000cb4 + adds r0, r1 + add r0, r10 + strh r3, [r0] + mov r5, r9 + cmp r5, 0xD + ble _08164A4E + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r3, =0x00000cd6 + adds r0, r3 + strh r7, [r0] +_08164AC2: + movs r0, 0xFA + lsls r0, 1 + cmp r7, r0 + beq _08164B54 + subs r0, 0xC9 + cmp r7, r0 + bgt _08164AF8 + ldr r0, =gUnknown_085DD500 + ldr r4, [sp] + lsls r1, r4, 3 + b _08164B04 + .pool +_08164AF8: + ldr r0, =0x0000018f + cmp r7, r0 + bgt _08164B28 + ldr r0, =gUnknown_085DD500 + ldr r5, [sp] + lsls r1, r5, 3 +_08164B04: + adds r0, 0x4 + adds r1, r0 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + b _08164B54 + .pool +_08164B28: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r7, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + ldr r1, =gUnknown_085DD690 + lsrs r0, 25 + adds r0, r1 + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 +_08164B54: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164828 + + thumb_func_start sub_8164B74 +sub_8164B74: @ 8164B74 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, [r4] + ldr r2, =0x00000cb2 + adds r0, r2 + ldrh r6, [r0] + bl GetMultiplayerId + ldr r0, =gScriptResult + ldrh r0, [r0] + cmp r0, 0x6 + bls _08164BAC + b _08164DB6 +_08164BAC: + lsls r0, 2 + ldr r1, =_08164BD0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08164BD0: + .4byte _08164BEC + .4byte _08164C3C + .4byte _08164CE0 + .4byte _08164D14 + .4byte _08164D98 + .4byte _08164DA8 + .4byte _08164DB6 +_08164BEC: + cmp r5, 0x3 + beq _08164BF2 + b _08164DB0 +_08164BF2: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r7, 1 + adds r0, r1 + ldr r3, =0x00000cec + adds r0, r3 + ldrh r0, [r0] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08164C18 + b _08164DB6 +_08164C18: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0x4 + bl link_0800A448 + ldr r1, =gScriptResult + movs r0, 0x1 + b _08164DB4 + .pool +_08164C3C: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08164C4A + b _08164DB6 +_08164C4A: + bl sub_800A5B4 + ldr r1, =gUnknown_020223C4 + movs r0, 0x80 + lsls r0, 1 + adds r2, r1, r0 + ldrh r0, [r1] + ldrh r3, [r2] + cmp r0, r3 + bhi _08164C60 + ldrh r0, [r2] +_08164C60: + str r0, [sp] + movs r4, 0 + ldr r0, =gSaveBlock2Ptr + mov r9, r0 +_08164C68: + adds r1, r4, 0x1 + mov r8, r1 + lsrs r0, r4, 31 + adds r0, r4, r0 + asrs r0, 1 + lsls r7, r0, 24 +_08164C74: + ldr r0, [sp] + lsls r0, 24 + lsrs r0, 24 + lsrs r1, r7, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r4 + bge _08164CB0 + mov r1, r9 + ldr r0, [r1] + ldr r1, =0x00000cb4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + beq _08164CB0 + ldr r6, =gSaveBlock2Ptr + adds r5, r1, 0 +_08164C9C: + adds r2, 0x1 + cmp r2, r4 + bge _08164CB0 + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _08164C9C +_08164CB0: + cmp r4, r2 + bne _08164C74 + mov r2, r9 + ldr r0, [r2] + lsls r1, r4, 1 + ldr r2, =0x00000cb4 + adds r0, r2 + adds r0, r1 + strh r3, [r0] + mov r4, r8 + cmp r4, 0xD + ble _08164C68 + ldr r1, =gScriptResult + movs r0, 0x2 + b _08164DB4 + .pool +_08164CE0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08164DB6 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r3, =0x00000cb4 + adds r1, r3 + movs r2, 0x28 + bl link_0800A448 + ldr r1, =gScriptResult + movs r0, 0x3 + b _08164DB4 + .pool +_08164D14: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + bne _08164DB6 + bl sub_800A5B4 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r5, =0x00000cb4 + adds r0, r5 + ldr r1, =gUnknown_020223C4 + movs r2, 0x28 + bl memcpy + ldr r2, =gTrainerBattleOpponent_A + ldr r1, [r4] + lsls r0, r6, 2 + adds r1, r5 + adds r0, r1, r0 + ldrh r0, [r0] + strh r0, [r2] + ldr r4, =gTrainerBattleOpponent_B + lsls r0, r6, 1 + adds r0, 0x1 + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r4] + ldrh r0, [r2] + movs r1, 0 + bl sub_8162614 + ldrh r0, [r4] + movs r1, 0x1 + bl sub_8162614 + ldr r0, =gUnknown_03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08164DB0 + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + bne _08164DB0 + ldr r1, =gScriptResult + movs r0, 0x4 + b _08164DB4 + .pool +_08164D98: + bl sub_800AC34 + ldr r1, =gScriptResult + movs r0, 0x5 + b _08164DB4 + .pool +_08164DA8: + ldr r0, =gUnknown_03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08164DB6 +_08164DB0: + ldr r1, =gScriptResult + movs r0, 0x6 +_08164DB4: + strh r0, [r1] +_08164DB6: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164B74 + + thumb_func_start sub_8164DCC +sub_8164DCC: @ 8164DCC + push {lr} + ldr r0, =gLinkVSyncDisabled + ldrb r0, [r0] + cmp r0, 0 + beq _08164DDA + bl sub_800AC34 +_08164DDA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164DCC + + thumb_func_start sub_8164DE4 +sub_8164DE4: @ 8164DE4 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cd6 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0xF + bl sub_8162614 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164DE4 + + thumb_func_start sub_8164E04 +sub_8164E04: @ 8164E04 + push {r4-r6,lr} + sub sp, 0x20 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + cmp r0, 0 + bne _08164E9A + ldr r5, =gTrainerBattleOpponent_A + ldrh r1, [r5] + mov r0, sp + bl sub_8162E20 + mov r0, sp + bl StripExtCtrlCodes + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000bd8 + adds r0, r1 + mov r1, sp + bl StringCopy + ldr r0, [r4] + ldr r2, =0x00000beb + adds r0, r2 + ldrh r1, [r5] + bl sub_8165B88 + ldr r6, =gBattlePartyID + ldrh r0, [r6, 0x2] + movs r5, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + ldr r1, [r4] + ldr r2, =0x00000bd6 + adds r1, r2 + strh r0, [r1] + ldrh r0, [r6] + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + ldr r1, [r4] + ldr r2, =0x00000bd4 + adds r1, r2 + strh r0, [r1] + movs r2, 0 + movs r5, 0xBE + lsls r5, 4 + ldr r3, =gBattleMons + 0x30 + adds r6, r4, 0 +_08164E7C: + ldr r0, [r4] + adds r0, r5 + adds r0, r2 + adds r1, r2, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0xA + ble _08164E7C + ldr r0, [r6] + ldr r1, =gBattleOutcome + ldrb r1, [r1] + ldr r2, =0x00000d06 + adds r0, r2 + strb r1, [r0] +_08164E9A: + add sp, 0x20 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164E04 + + thumb_func_start sub_8164ED8 +sub_8164ED8: @ 8164ED8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r3, 0 + movs r2, 0 + ldr r4, =0x0000064c + adds r1, r0, r4 +_08164EEA: + ldm r1!, {r0} + adds r3, r0 + adds r2, 0x1 + cmp r2, 0x39 + bls _08164EEA + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r2, =0x00000734 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, r3 + beq _08164F0A + ldr r3, =0x0000064c + adds r0, r1, r3 + bl sub_8164FB8 +_08164F0A: + movs r4, 0 + adds r7, r5, 0 + movs r6, 0xEC + mov r8, r7 +_08164F12: + adds r0, r4, 0 + muls r0, r6 + movs r1, 0xE7 + lsls r1, 3 + adds r0, r1 + ldr r1, [r7] + movs r3, 0 + movs r2, 0 + adds r5, r4, 0x1 + adds r1, r0 +_08164F26: + ldm r1!, {r0} + adds r3, r0 + adds r2, 0x1 + cmp r2, 0x39 + bls _08164F26 + mov r0, r8 + ldr r2, [r0] + adds r1, r4, 0 + muls r1, r6 + movs r4, 0x82 + lsls r4, 4 + adds r0, r2, r4 + adds r0, r1 + ldr r0, [r0] + cmp r0, r3 + beq _08164F52 + movs r3, 0xE7 + lsls r3, 3 + adds r0, r1, r3 + adds r0, r2, r0 + bl sub_8164FB8 +_08164F52: + adds r4, r5, 0 + cmp r4, 0x4 + ble _08164F12 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164ED8 + + thumb_func_start sub_8164F70 +sub_8164F70: @ 8164F70 + push {r4,lr} + adds r2, r0, 0 + adds r2, 0xE8 + movs r1, 0 + str r1, [r2] + movs r3, 0 + adds r4, r0, 0 +_08164F7E: + ldr r0, [r2] + ldm r4!, {r1} + adds r0, r1 + str r0, [r2] + adds r3, 0x1 + cmp r3, 0x39 + bls _08164F7E + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8164F70 + + thumb_func_start sub_8164F94 +sub_8164F94: @ 8164F94 + push {r4,lr} + adds r2, r0, 0 + adds r2, 0xA0 + movs r1, 0 + str r1, [r2] + movs r3, 0 + adds r4, r0, 0 +_08164FA2: + ldr r0, [r2] + ldm r4!, {r1} + adds r0, r1 + str r0, [r2] + adds r3, 0x1 + cmp r3, 0x27 + bls _08164FA2 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8164F94 + + thumb_func_start sub_8164FB8 +sub_8164FB8: @ 8164FB8 + push {lr} + movs r1, 0 + movs r2, 0 +_08164FBE: + stm r0!, {r2} + adds r1, 0x1 + cmp r1, 0x3A + bls _08164FBE + pop {r0} + bx r0 + thumb_func_end sub_8164FB8 + + thumb_func_start sub_8164FCC +sub_8164FCC: @ 8164FCC + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r0, 23 + lsrs r1, 22 + adds r0, r1 + movs r1, 0xCE + lsls r1, 4 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _08164FEE + adds r0, r1, 0 +_08164FEE: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8164FCC + + thumb_func_start sub_8164FFC +sub_8164FFC: @ 8164FFC + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_085DFA42 + mov r0, sp + movs r2, 0x4 + bl memcpy + cmp r4, 0x3 + bls _0816501C + movs r0, 0x3 + b _08165022 + .pool +_0816501C: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] +_08165022: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8164FFC + + thumb_func_start sub_816502C +sub_816502C: @ 816502C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + adds r5, r0, 0 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl sub_8164FFC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r2, 0x44 + mov r10, r2 + cmp r5, 0 + beq _0816506A + movs r0, 0x45 + mov r10, r0 +_0816506A: + ldr r1, =gScriptResult + mov r9, r1 + movs r0, 0 + strh r0, [r1] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8164FCC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x37 + bls _081650DC + movs r6, 0 + cmp r6, r8 + bge _081650DC + ldr r7, =gSaveBlock1Ptr + mov r5, sp +_0816508C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r6, 1 + ldr r2, =0x00000caa + adds r0, r2 + adds r0, r1 + ldrh r1, [r0] + subs r1, 0x1 + movs r0, 0 + strb r1, [r5] + strb r0, [r5, 0x1] + movs r0, 0x64 + muls r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r4, r0, r1 + ldr r0, [r7] + adds r0, r4 + mov r1, r10 + bl GetMonData + cmp r0, 0 + bne _081650D4 + movs r0, 0x1 + mov r2, r9 + strh r0, [r2] + ldr r0, [r7] + adds r0, r4 + mov r1, r10 + bl SetMonData + ldr r0, [r7] + adds r0, r4 + bl sub_80EE5A4 + strb r0, [r5, 0x1] +_081650D4: + adds r5, 0x4 + adds r6, 0x1 + cmp r6, r8 + blt _0816508C +_081650DC: + ldr r0, =gScriptResult + ldrh r0, [r0] + cmp r0, 0 + beq _08165132 + movs r0, 0x2A + bl IncrementGameStat + mov r0, r8 + cmp r0, 0x1 + ble _08165110 + mov r3, sp + add r2, sp, 0x4 + mov r6, r8 + subs r6, 0x1 +_081650F8: + ldrb r1, [r3, 0x1] + ldrb r0, [r2, 0x1] + cmp r0, r1 + bls _08165108 + ldr r1, [sp] + ldr r0, [r2] + str r0, [sp] + str r1, [r2] +_08165108: + adds r2, 0x4 + subs r6, 0x1 + cmp r6, 0 + bne _081650F8 +_08165110: + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0x4 + bls _08165132 + ldr r2, =gSaveBlock1Ptr + mov r0, sp + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + movs r0, 0x8E + lsls r0, 2 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + mov r1, r10 + bl sub_80EE4DC +_08165132: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816502C + + thumb_func_start sub_816515C +sub_816515C: @ 816515C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + ldr r0, =0x00000bec + adds r7, r2, r0 + ldrb r0, [r2, 0x8] + adds r5, r1, 0 + cmp r0, 0 + beq _08165194 + ldr r4, =gUnknown_085DCEFA + ldrb r0, [r2, 0xA] + ldrb r1, [r2, 0xB] + adds r0, r1 + ldrb r1, [r2, 0xC] + adds r0, r1 + ldrb r1, [r2, 0xD] + adds r0, r1 + movs r1, 0x14 + b _081651A6 + .pool +_08165194: + ldr r4, =gUnknown_085DCEDC + ldrb r0, [r2, 0xA] + ldrb r1, [r2, 0xB] + adds r0, r1 + ldrb r1, [r2, 0xC] + adds r0, r1 + ldrb r1, [r2, 0xD] + adds r0, r1 + movs r1, 0x1E +_081651A6: + bl __umodsi3 + adds r0, r4 + ldrb r0, [r0] + strb r0, [r7, 0x1] + adds r0, r7, 0 + adds r0, 0xC + ldr r1, [r5] + adds r1, 0xA + bl CopyUnalignedWord + adds r0, r7, 0x4 + ldr r1, [r5] + bl StringCopy7 + movs r0, 0x1 + strh r0, [r7, 0x2] + movs r6, 0x7 + movs r4, 0 + ldr r0, =gSaveBlock1Ptr + mov r8, r0 + adds r5, r7, 0 + adds r5, 0x10 + ldr r1, =0x00002bbc + mov r12, r1 + adds r3, r7, 0 + adds r3, 0x28 + adds r2, r7, 0 + adds r2, 0x1C +_081651E0: + lsls r0, r4, 1 + mov r9, r0 + mov r1, r8 + ldr r0, [r1] + add r0, r12 + add r0, r9 + ldrh r0, [r0] + strh r0, [r5] + strh r6, [r2] + adds r0, r6, 0x6 + strh r0, [r3] + adds r6, 0x1 + adds r5, 0x2 + adds r3, 0x2 + adds r2, 0x2 + adds r4, 0x1 + cmp r4, 0x5 + ble _081651E0 + movs r4, 0 +_08165206: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2C + muls r1, r4 + adds r1, 0x34 + adds r1, r7, r1 + bl sub_80686FC + adds r4, 0x1 + cmp r4, 0x2 + ble _08165206 + adds r0, r7, 0 + bl sub_8165328 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816515C + + thumb_func_start sub_8165244 +sub_8165244: @ 8165244 + ldr r1, =gTrainerPicIndices + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000bed + adds r0, r2 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8165244 + + thumb_func_start sub_8165264 +sub_8165264: @ 8165264 + ldr r1, =gTrainerClassNameIndices + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000bed + adds r0, r2 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8165264 + + thumb_func_start sub_8165284 +sub_8165284: @ 8165284 + push {r4,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xBF + lsls r1, 4 + adds r4, r0, r1 +_08165294: + adds r0, r3, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x4 + ble _08165294 + adds r1, r3, r2 + movs r0, 0xFF + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8165284 + + thumb_func_start sub_81652B4 +sub_81652B4: @ 81652B4 + push {r4-r6,lr} + ldr r2, =gScriptResult + movs r0, 0 + strh r0, [r2] + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r3, =0x00000bec + adds r5, r0, r3 + movs r4, 0 + movs r3, 0 + adds r6, r1, 0 + adds r1, r5, 0 +_081652CC: + ldm r1!, {r0} + orrs r4, r0 + adds r3, 0x1 + cmp r3, 0x2D + bls _081652CC + cmp r4, 0 + bne _081652EC + movs r0, 0x1 + strh r0, [r2] + b _08165316 + .pool +_081652EC: + movs r4, 0 + movs r3, 0 + adds r2, r5, 0 +_081652F2: + ldm r2!, {r0} + adds r4, r0 + adds r3, 0x1 + cmp r3, 0x2D + bls _081652F2 + ldr r1, [r6] + ldr r2, =0x00000ca4 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, r4 + beq _08165316 + ldr r3, =0x00000bec + adds r0, r1, r3 + bl sub_816534C + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] +_08165316: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81652B4 + + thumb_func_start sub_8165328 +sub_8165328: @ 8165328 + push {r4,lr} + adds r2, r0, 0 + adds r2, 0xB8 + movs r1, 0 + str r1, [r2] + movs r3, 0 + adds r4, r0, 0 +_08165336: + ldr r0, [r2] + ldm r4!, {r1} + adds r0, r1 + str r0, [r2] + adds r3, 0x1 + cmp r3, 0x2D + bls _08165336 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8165328 + + thumb_func_start sub_816534C +sub_816534C: @ 816534C + push {lr} + movs r1, 0 + movs r2, 0 +_08165352: + stm r0!, {r2} + adds r1, 0x1 + cmp r1, 0x2E + bls _08165352 + pop {r0} + bx r0 + thumb_func_end sub_816534C + + thumb_func_start sub_8165360 +sub_8165360: @ 8165360 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000bfc + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_8165360 + + thumb_func_start sub_816537C +sub_816537C: @ 816537C + push {lr} + ldr r0, =gBattleOutcome + ldrb r0, [r0] + cmp r0, 0x3 + bne _08165398 + ldr r1, =gStringVar4 + movs r0, 0xFF + strb r0, [r1] + b _081653C0 + .pool +_08165398: + cmp r0, 0x1 + bne _081653B4 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000c14 + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + b _081653C0 + .pool +_081653B4: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000c08 + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString +_081653C0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_816537C + + thumb_func_start sub_81653CC +sub_81653CC: @ 81653CC + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081653E0 + bl sub_80F01B8 +_081653E0: + movs r0, 0x77 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081653F8 + bl sub_80F01B8 + movs r0, 0x77 + bl FlagReset +_081653F8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81653CC + + thumb_func_start sub_8165404 +sub_8165404: @ 8165404 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x70 + lsls r0, 16 + lsrs r7, r0, 16 + bl sub_8165C40 + ldr r0, =0x00000c03 + cmp r7, r0 + beq _08165420 + b _0816554C +_08165420: + movs r0, 0 + mov r10, r0 + mov r1, sp + adds r1, 0x44 + str r1, [sp, 0x64] +_0816542A: + mov r2, r10 + lsls r2, 2 + mov r9, r2 + mov r3, r10 + adds r3, 0x1 + str r3, [sp, 0x60] + mov r0, r9 + add r0, r10 + lsls r0, 2 + ldr r6, =gUnknown_085DD6D0 + adds r5, r0, r6 +_08165440: + bl Random + adds r4, r0, 0 + bl Random + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x44] + ldr r0, =0x0000ef2a + adds r1, r4, 0 + bl IsShinyOtIdPersonality + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _08165440 + ldr r0, [sp, 0x44] + bl GetNatureFromPersonality + ldrb r1, [r5, 0x4] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _08165440 + movs r0, 0x64 + mov r6, r10 + muls r6, r0 + ldr r1, =gPlayerParty + 300 + mov r8, r1 + adds r0, r6, r1 + mov r5, r9 + add r5, r10 + lsls r5, 2 + ldr r2, =gUnknown_085DD6D0 + adds r3, r5, r2 + ldrh r1, [r3] + ldrb r2, [r3, 0x3] + ldrb r3, [r3, 0x2] + mov r12, r3 + movs r4, 0x1 + str r4, [sp] + mov r3, r10 + str r3, [sp, 0x4] + str r4, [sp, 0x8] + ldr r4, =0x0000ef2a + str r4, [sp, 0xC] + mov r3, r12 + bl CreateMon + str r7, [sp, 0x44] + movs r3, 0 + mov r4, r8 + ldr r0, =gUnknown_085DD6D5 + adds r5, r0 +_081654B0: + adds r1, r3, 0 + adds r1, 0x1A + adds r2, r5, r3 + adds r0, r6, r4 + bl SetMonData + ldr r0, [sp, 0x44] + adds r0, 0x1 + str r0, [sp, 0x44] + adds r3, r0, 0 + cmp r3, 0x5 + ble _081654B0 + movs r0, 0 + str r0, [sp, 0x44] + movs r1, 0 + movs r6, 0x64 + mov r4, r10 + muls r4, r6 + ldr r7, =gUnknown_085DD6DC + ldr r6, =gPlayerParty + 300 + mov r0, r9 + add r0, r10 + lsls r5, r0, 2 +_081654DE: + lsls r0, r1, 1 + adds r0, r5 + adds r0, r7 + ldrh r1, [r0] + ldr r0, [sp, 0x64] + ldrb r2, [r0] + adds r0, r4, r6 + bl SetMonMoveSlot + ldr r0, [sp, 0x44] + adds r0, 0x1 + str r0, [sp, 0x44] + adds r1, r0, 0 + cmp r1, 0x3 + ble _081654DE + movs r1, 0x64 + mov r4, r10 + muls r4, r1 + ldr r0, =gPlayerParty + 300 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 @ Steven's name + bl SetMonData + movs r0, 0 + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x31 + ldr r2, [sp, 0x64] + bl SetMonData + adds r0, r4, 0 + bl CalculateMonStats + ldr r2, [sp, 0x60] + mov r10, r2 + cmp r2, 0x2 + bgt _0816552E + b _0816542A +_0816552E: + b _0816585A + .pool +_0816554C: + movs r0, 0xFA + lsls r0, 1 + cmp r7, r0 + bne _08165564 + add r0, sp, 0x10 + ldr r1, =gGameLanguage + ldrb r1, [r1] + strb r1, [r0] + b _0816585A + .pool +_08165564: + ldr r0, =0x0000012b + cmp r7, r0 + bls _0816556C + b _081656E8 +_0816556C: + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x50] + adds r0, r7, 0 + bl sub_8165D08 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4C] + bl Random + adds r4, r0, 0 + bl Random + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x58] + movs r3, 0 + mov r10, r3 + mov r6, sp + adds r6, 0x44 + str r6, [sp, 0x64] + mov r0, sp + adds r0, 0x48 + str r0, [sp, 0x5C] +_081655A6: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r0, r10 + adds r0, 0x12 + lsls r0, 1 + ldr r2, =0x00000cb4 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + str r1, [sp, 0x54] + movs r6, 0x64 + mov r3, r10 + muls r3, r6 + mov r8, r3 + ldr r0, =gPlayerParty + 300 + mov r9, r0 + mov r0, r8 + add r0, r9 + ldr r6, =gUnknown_0203BC8C + ldr r4, [r6] + lsls r5, r1, 4 + adds r4, r5, r4 + ldrh r1, [r4] + ldr r3, [sp, 0x50] + lsls r2, r3, 24 + ldrb r3, [r4, 0xC] + mov r12, r3 + ldr r3, [sp, 0x4C] + str r3, [sp] + ldrb r4, [r4, 0xB] + str r4, [sp, 0x4] + ldr r3, [sp, 0x58] + str r3, [sp, 0x8] + lsrs r2, 24 + mov r3, r12 + bl sub_8068634 + movs r0, 0xFF + str r0, [sp, 0x48] + movs r0, 0 + str r0, [sp, 0x44] + movs r2, 0 + mov r0, r10 + adds r0, 0x1 + str r0, [sp, 0x60] + mov r4, r8 + mov r3, r9 +_08165604: + ldr r0, [r6] + adds r0, r5, r0 + lsls r1, r2, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, r3 + str r3, [sp, 0x68] + bl SetMonMoveSlot + ldr r0, [r6] + adds r0, r5, r0 + ldr r2, [sp, 0x44] + lsls r1, r2, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r0, [r0] + ldr r3, [sp, 0x68] + cmp r0, 0xDA + bne _08165634 + movs r0, 0 + str r0, [sp, 0x48] +_08165634: + adds r0, r2, 0x1 + str r0, [sp, 0x44] + adds r2, r0, 0 + cmp r2, 0x3 + ble _08165604 + movs r1, 0x64 + mov r4, r10 + muls r4, r1 + ldr r0, =gPlayerParty + 300 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x5C] + bl SetMonData + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + ldr r2, [sp, 0x54] + lsls r0, r2, 4 + adds r0, r1 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + movs r0, 0 + str r0, [sp, 0x44] + movs r2, 0 + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r7 + adds r0, r1 + adds r3, r0, 0x4 +_0816567E: + mov r1, sp + adds r1, r2 + adds r1, 0x10 + adds r0, r3, r2 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, [sp, 0x44] + adds r0, 0x1 + str r0, [sp, 0x44] + adds r2, r0, 0 + cmp r2, 0x7 + ble _0816567E + movs r3, 0x64 + mov r4, r10 + muls r4, r3 + ldr r0, =gPlayerParty + 300 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x7 + add r2, sp, 0x10 + bl SetMonData + adds r0, r7, 0 + bl sub_8162F68 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x31 + ldr r2, [sp, 0x64] + bl SetMonData + ldr r6, [sp, 0x60] + mov r10, r6 + cmp r6, 0x1 + bgt _081656CA + b _081655A6 +_081656CA: + b _0816585A + .pool +_081656E8: + ldr r0, =0x0000018f + cmp r7, r0 + bls _081656F0 + b _081657F0 +_081656F0: + ldr r1, =0xfffffed4 + adds r0, r7, r1 + lsls r0, 16 + lsrs r7, r0, 16 + movs r2, 0 + mov r10, r2 + mov r3, sp + adds r3, 0x44 + str r3, [sp, 0x64] + add r5, sp, 0x18 + ldr r6, =0x000015fc + mov r9, r6 + ldr r0, =0x0000ffff + mov r8, r0 + movs r1, 0x24 + str r1, [sp, 0x6C] +_08165710: + ldr r1, =gSaveBlock2Ptr + movs r0, 0xEC + adds r4, r7, 0 + muls r4, r0 + movs r2, 0xE7 + lsls r2, 3 + adds r4, r2 + ldr r0, [r1] + adds r4, r0, r4 + ldr r3, =0x00000cb4 + adds r0, r3 + ldr r6, [sp, 0x6C] + adds r0, r6 + ldrh r1, [r0] + movs r0, 0x2C + muls r1, r0 + adds r1, r4, r1 + adds r0, r5, 0 + adds r1, 0x34 + ldm r1!, {r2,r3,r6} + stm r0!, {r2,r3,r6} + ldm r1!, {r2,r3,r6} + stm r0!, {r2,r3,r6} + ldm r1!, {r2,r3,r6} + stm r0!, {r2,r3,r6} + ldm r1!, {r2,r3} + stm r0!, {r2,r3} + adds r1, r4, 0x4 + add r0, sp, 0x10 + bl StringCopy + adds r4, 0xE4 + ldrb r0, [r4] + cmp r0, 0x1 + bne _0816578C + ldrh r0, [r5, 0x20] + mov r6, r8 + ands r0, r6 + cmp r0, r9 + beq _0816579C + mov r1, sp + adds r1, 0x3D + movs r0, 0xFF + strb r0, [r1] + add r0, sp, 0x38 + movs r1, 0x1 + bl ConvertInternationalString + b _0816579C + .pool +_0816578C: + ldrh r0, [r5, 0x20] + mov r1, r8 + ands r0, r1 + cmp r0, r9 + bne _0816579C + add r1, sp, 0x10 + movs r0, 0xFF + strb r0, [r1, 0x5] +_0816579C: + movs r0, 0x64 + mov r4, r10 + muls r4, r0 + ldr r0, =gPlayerParty + 300 + adds r4, r0 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8068338 + adds r0, r4, 0 + movs r1, 0x7 + add r2, sp, 0x10 + bl SetMonData + movs r2, 0x96 + lsls r2, 1 + adds r0, r7, r2 + lsls r0, 16 + lsrs r0, 16 + bl sub_8162F68 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x31 + ldr r2, [sp, 0x64] + bl SetMonData + ldr r3, [sp, 0x6C] + adds r3, 0x2 + str r3, [sp, 0x6C] + movs r6, 0x1 + add r10, r6 + mov r0, r10 + cmp r0, 0x1 + ble _08165710 + b _0816585A + .pool +_081657F0: + ldr r1, =0xfffffe70 + adds r0, r7, r1 + lsls r0, 16 + lsrs r7, r0, 16 + movs r2, 0 + mov r10, r2 + mov r3, sp + adds r3, 0x44 + str r3, [sp, 0x64] + ldr r6, =gSaveBlock2Ptr + mov r8, r6 + movs r5, 0x24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r6, r0, 0 + adds r6, 0xDC +_08165812: + movs r0, 0x64 + mov r4, r10 + muls r4, r0 + ldr r0, =gPlayerParty + 300 + adds r4, r0 + mov r1, r8 + ldr r0, [r1] + adds r1, r0, r6 + ldr r2, =0x00000cb4 + adds r0, r2 + adds r0, r5 + ldrb r2, [r0] + adds r0, r4, 0 + bl sub_8068528 + movs r3, 0xC8 + lsls r3, 1 + adds r0, r7, r3 + lsls r0, 16 + lsrs r0, 16 + bl sub_8162F68 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x31 + ldr r2, [sp, 0x64] + bl SetMonData + adds r5, 0x2 + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0x1 + ble _08165812 +_0816585A: + add sp, 0x70 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8165404 + + thumb_func_start sub_816587C +sub_816587C: @ 816587C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r6, r0, 0 + adds r5, r1, 0 + movs r2, 0 + adds r1, r6, 0 + adds r3, r6, 0 + adds r3, 0x58 +_08165894: + ldrh r0, [r1, 0x1C] + cmp r0, 0 + beq _0816589C + adds r2, 0x1 +_0816589C: + adds r1, 0x2C + cmp r1, r3 + ble _08165894 + cmp r2, 0x3 + beq _081658B4 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0xEC + bl memset + movs r0, 0 + b _081659BE +_081658B4: + ldrb r0, [r6] + strb r0, [r5] + ldrh r0, [r6, 0x2] + strh r0, [r5, 0x2] + movs r2, 0 + ldr r0, =gUnknown_085DCF40 + ldrb r1, [r0] + ldrb r3, [r6, 0x1] + mov r12, r0 + adds r4, r5, 0x4 + adds r7, r6, 0x4 + movs r0, 0xC + adds r0, r5 + mov r9, r0 + movs r0, 0xC + adds r0, r6 + mov r8, r0 + adds r0, r5, 0 + adds r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0x10 + adds r0, r6 + mov r10, r0 + adds r0, r5, 0 + adds r0, 0x1C + str r0, [sp, 0x8] + adds r0, 0xC + str r0, [sp, 0xC] + adds r0, 0x90 + str r0, [sp, 0x10] + cmp r1, r3 + beq _08165904 + mov r1, r12 +_081658F6: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x51 + bgt _08165904 + ldrb r0, [r1] + cmp r0, r3 + bne _081658F6 +_08165904: + cmp r2, 0x52 + beq _08165918 + lsls r0, r2, 1 + mov r1, r12 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + b _0816591A + .pool +_08165918: + movs r0, 0x2B +_0816591A: + strb r0, [r5, 0x1] + movs r2, 0 + adds r3, r7, 0 +_08165920: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _08165920 + movs r2, 0 + mov r4, r9 + mov r3, r8 +_08165934: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _08165934 + mov r3, r10 + ldr r1, [sp, 0x4] + movs r2, 0x5 +_08165948: + ldrh r0, [r3] + strh r0, [r1] + adds r3, 0x2 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08165948 + ldr r3, =gUnknown_085DFA46 + ldr r1, [sp, 0x8] + movs r2, 0x5 +_0816595C: + ldrh r0, [r3] + strh r0, [r1] + adds r3, 0x2 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _0816595C + ldr r3, =gUnknown_085DFA52 + ldr r1, [sp, 0xC] + movs r2, 0x5 +_08165970: + ldrh r0, [r3] + strh r0, [r1] + adds r3, 0x2 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08165970 + adds r2, r6, 0 + adds r3, r5, 0 + movs r4, 0x58 + adds r4, r2 + mov r8, r4 +_08165988: + adds r1, r3, 0 + adds r1, 0x34 + adds r0, r2, 0 + adds r0, 0x1C + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r6,r7} + stm r1!, {r6,r7} + adds r2, 0x2C + adds r3, 0x2C + cmp r2, r8 + ble _08165988 + movs r0, 0 + str r0, [sp] + ldr r2, =0x0500000b + mov r0, sp + ldr r1, [sp, 0x10] + bl CpuSet + adds r0, r5, 0 + bl sub_8164F70 + movs r0, 0x1 +_081659BE: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_816587C + + thumb_func_start sub_81659DC +sub_81659DC: @ 81659DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r1, 0 + movs r2, 0 + adds r1, r4, 0 + adds r3, r4, 0 + adds r3, 0x58 +_081659F4: + ldrh r0, [r1, 0x34] + cmp r0, 0 + beq _081659FC + adds r2, 0x1 +_081659FC: + adds r1, 0x2C + cmp r1, r3 + ble _081659F4 + cmp r2, 0x3 + beq _08165A14 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0xA4 + bl memset + movs r0, 0 + b _08165AD8 +_08165A14: + ldrb r0, [r4] + strb r0, [r6] + ldrh r0, [r4, 0x2] + strh r0, [r6, 0x2] + movs r2, 0 + ldr r0, =gUnknown_085DCF40 + ldrb r1, [r0, 0x1] + ldrb r3, [r4, 0x1] + mov r12, r0 + adds r5, r6, 0x4 + adds r7, r4, 0x4 + movs r0, 0xC + adds r0, r6 + mov r9, r0 + movs r0, 0xC + adds r0, r4 + mov r8, r0 + adds r0, r6, 0 + adds r0, 0x10 + str r0, [sp] + movs r0, 0x10 + adds r0, r4 + mov r10, r0 + cmp r1, r3 + beq _08165A58 + mov r1, r12 + adds r1, 0x1 +_08165A4A: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x51 + bgt _08165A58 + ldrb r0, [r1] + cmp r0, r3 + bne _08165A4A +_08165A58: + cmp r2, 0x52 + beq _08165A68 + lsls r0, r2, 1 + add r0, r12 + ldrb r0, [r0] + b _08165A6A + .pool +_08165A68: + movs r0, 0x24 +_08165A6A: + strb r0, [r6, 0x1] + movs r2, 0 + adds r3, r7, 0 +_08165A70: + adds r0, r5, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _08165A70 + movs r2, 0 + mov r5, r9 + mov r3, r8 +_08165A84: + adds r0, r5, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _08165A84 + mov r3, r10 + ldr r1, [sp] + movs r2, 0x5 +_08165A98: + ldrh r0, [r3] + strh r0, [r1] + adds r3, 0x2 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08165A98 + adds r2, r4, 0 + adds r3, r6, 0 + movs r4, 0x58 + adds r4, r2 + mov r8, r4 +_08165AB0: + adds r1, r3, 0 + adds r1, 0x1C + adds r0, r2, 0 + adds r0, 0x34 + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r5,r7} + stm r1!, {r5,r7} + adds r2, 0x2C + adds r3, 0x2C + cmp r2, r8 + ble _08165AB0 + adds r0, r6, 0 + bl sub_8164F94 + movs r0, 0x1 +_08165AD8: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81659DC + + thumb_func_start sub_8165AE8 +sub_8165AE8: @ 8165AE8 + push {r4,lr} + adds r2, r0, 0 + movs r0, 0 + str r0, [r2, 0x40] + movs r3, 0 + adds r4, r2, 0 +_08165AF4: + ldr r0, [r2, 0x40] + ldm r4!, {r1} + adds r0, r1 + str r0, [r2, 0x40] + adds r3, 0x1 + cmp r3, 0xF + bls _08165AF4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8165AE8 + + thumb_func_start sub_8165B08 +sub_8165B08: @ 8165B08 + push {lr} + movs r1, 0 + movs r3, 0 + adds r2, r0, 0 +_08165B10: + stm r2!, {r3} + adds r1, 0x1 + cmp r1, 0x10 + bls _08165B10 + bl sub_819FA5C + pop {r0} + bx r0 + thumb_func_end sub_8165B08 + + thumb_func_start sub_8165B20 +sub_8165B20: @ 8165B20 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r5, 0 + ldr r0, =gSaveBlock2Ptr + mov r8, r0 + mov r9, r8 +_08165B30: + lsls r0, r5, 4 + adds r1, r0, r5 + lsls r1, 2 + adds r1, 0xDC + mov r3, r9 + ldr r2, [r3] + movs r4, 0 + movs r3, 0 + adds r6, r0, 0 + adds r7, r5, 0x1 + adds r2, r1 +_08165B46: + ldm r2!, {r0} + adds r4, r0 + adds r3, 0x1 + cmp r3, 0xF + bls _08165B46 + mov r0, r8 + ldr r2, [r0] + adds r0, r6, r5 + lsls r1, r0, 2 + movs r3, 0x8E + lsls r3, 1 + adds r0, r2, r3 + adds r0, r1 + ldr r0, [r0] + cmp r0, r4 + beq _08165B70 + adds r0, r1, 0 + adds r0, 0xDC + adds r0, r2, r0 + bl sub_8165B08 +_08165B70: + adds r5, r7, 0 + cmp r5, 0x3 + ble _08165B30 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8165B20 + + thumb_func_start sub_8165B88 +sub_8165B88: @ 8165B88 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r2, r1, 16 + adds r3, r2, 0 + movs r0, 0xFA + lsls r0, 1 + cmp r2, r0 + bne _08165BA4 + ldr r0, =gGameLanguage + b _08165C28 + .pool +_08165BA4: + ldr r0, =0x0000012b + cmp r2, r0 + bhi _08165BB8 + ldr r0, =gGameLanguage + b _08165C28 + .pool +_08165BB8: + ldr r0, =0x0000018f + cmp r2, r0 + bhi _08165BFC + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08165BDC + bl sub_81864B4 + b _08165C2A + .pool +_08165BDC: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, =0x0000081c + adds r0, r1 + b _08165C28 + .pool +_08165BFC: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08165C14 + bl sub_81864C0 + b _08165C2A + .pool +_08165C14: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =0xfffffe70 + adds r1, r3, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r1, =0x0000011b + adds r0, r2, r1 +_08165C28: + ldrb r0, [r0] +_08165C2A: + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8165B88 + + thumb_func_start sub_8165C40 +sub_8165C40: @ 8165C40 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r2, r0, r1 + ldrb r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _08165C84 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + ldrb r0, [r2] + lsls r0, 30 + lsrs r0, 30 + bl sub_8165C90 + b _08165C88 + .pool +_08165C84: + bl sub_8165D78 +_08165C88: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8165C40 + + thumb_func_start sub_8165C90 +sub_8165C90: @ 8165C90 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08165C9E + cmp r0, 0x1 + beq _08165CA2 +_08165C9E: + movs r0, 0x32 + b _08165CB0 +_08165CA2: + bl sub_8165CB4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + bhi _08165CB0 + movs r0, 0x3C +_08165CB0: + pop {r1} + bx r1 + thumb_func_end sub_8165C90 + + thumb_func_start sub_8165CB4 +sub_8165CB4: @ 8165CB4 + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 +_08165CBA: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + cmp r0, 0 + beq _08165CF4 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl GetMonData + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08165CF4 + adds r0, r4, 0 + movs r1, 0x38 + movs r2, 0 + bl GetMonData + cmp r0, r6 + ble _08165CF4 + adds r6, r0, 0 +_08165CF4: + adds r5, 0x1 + cmp r5, 0x5 + ble _08165CBA + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8165CB4 + + thumb_func_start sub_8165D08 +sub_8165D08: @ 8165D08 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + cmp r0, 0x63 + bls _08165D3A + movs r1, 0x6 + cmp r0, 0x77 + bls _08165D3A + movs r1, 0x9 + cmp r0, 0x8B + bls _08165D3A + movs r1, 0xC + cmp r0, 0x9F + bls _08165D3A + movs r1, 0xF + cmp r0, 0xB3 + bls _08165D3A + movs r1, 0x12 + cmp r0, 0xC7 + bls _08165D3A + movs r1, 0x1F + cmp r0, 0xDB + bhi _08165D3A + movs r1, 0x15 +_08165D3A: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_8165D08 + + thumb_func_start sub_8165D40 +sub_8165D40: @ 8165D40 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + beq _08165D58 + cmp r0, 0x3 + beq _08165D58 + cmp r0, 0x4 + bne _08165D70 +_08165D58: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + b _08165D72 + .pool +_08165D70: + movs r0, 0 +_08165D72: + pop {r1} + bx r1 + thumb_func_end sub_8165D40 + + thumb_func_start sub_8165D78 +sub_8165D78: @ 8165D78 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bne _08165DA8 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gSlateportBattleTentTrainers + str r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons + b _08165DF2 + .pool +_08165DA8: + cmp r0, 0x2 + bne _08165DC8 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gVerdanturfBattleTentTrainers + str r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r0, =gVerdanturfBattleTentMons + b _08165DF2 + .pool +_08165DC8: + cmp r0, 0x3 + bne _08165DE8 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gFallarborBattleTentTrainers + str r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r0, =gFallarborBattleTentMons + b _08165DF2 + .pool +_08165DE8: + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons +_08165DF2: + str r0, [r1] + bl sub_8165CB4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1D + bhi _08165E02 + movs r0, 0x1E +_08165E02: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8165D78 + + thumb_func_start sub_8165E18 +sub_8165E18: @ 8165E18 + push {r4,r5,lr} + ldr r5, =gSaveBlock2Ptr +_08165E1C: + bl sub_8165D40 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r5] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r3, r0 + bge _08165E58 + adds r2, 0x2 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r4 + beq _08165E58 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + subs r2, 0x2 + adds r0, r1, r2 + ldrh r2, [r0] + ldr r0, =0x00000cb4 + adds r1, r0 +_08165E4A: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _08165E58 + ldrh r0, [r1] + cmp r0, r4 + bne _08165E4A +_08165E58: + ldr r0, [r5] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r3, r0 + bne _08165E1C + ldr r5, =gTrainerBattleOpponent_A + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0 + bl sub_8162614 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r2, [r0] + adds r0, r2, 0x1 + cmp r0, 0x2 + bgt _08165E8C + lsls r0, r2, 1 + ldr r2, =0x00000cb4 + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_08165E8C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8165E18 + + thumb_func_start sub_8165EA4 +sub_8165EA4: @ 8165EA4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x1C] + bl sub_8165D78 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] + ldr r0, =gTrainerBattleOpponent_A + ldrh r2, [r0] + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r2 + adds r0, r1 + ldr r0, [r0, 0x30] + str r0, [sp, 0x28] + movs r0, 0 + str r0, [sp, 0x24] + ldr r2, [sp, 0x28] + ldrh r1, [r2] + b _08165EFE + .pool +_08165EEC: + ldr r0, [sp, 0x24] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + lsls r0, 1 + ldr r6, [sp, 0x28] + adds r0, r6 + ldrh r1, [r0] +_08165EFE: + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08165EEC + movs r0, 0 + mov r8, r0 + bl Random + adds r4, r0, 0 + bl Random + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x2C] + b _08166092 + .pool +_08165F24: + bl Random + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x24] + bl __modsi3 + lsls r0, 1 + ldr r2, [sp, 0x28] + adds r0, r2 + ldrh r4, [r0] + movs r6, 0 + ldr r7, [sp, 0x18] + add r7, r8 + b _08165F44 +_08165F42: + adds r6, 0x1 +_08165F44: + cmp r6, r7 + bge _08165F68 + movs r1, 0x64 + adds r0, r6, 0 + muls r0, r1 + ldr r2, =gEnemyParty + adds r0, r2 + movs r1, 0xB + movs r2, 0 + bl GetMonData + ldr r1, =gUnknown_0203BC8C + ldr r2, [r1] + lsls r1, r4, 4 + adds r1, r2 + ldrh r1, [r1] + cmp r0, r1 + bne _08165F42 +_08165F68: + cmp r6, r7 + beq _08165F6E + b _08166092 +_08165F6E: + movs r6, 0 + cmp r6, r7 + bge _08165FB8 + ldr r0, =gBattleFrontierHeldItems + mov r9, r0 + movs r3, 0 +_08165F7A: + ldr r1, =gEnemyParty + adds r5, r3, r1 + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + str r3, [sp, 0x34] + bl GetMonData + ldr r3, [sp, 0x34] + cmp r0, 0 + beq _08165FB0 + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + bl GetMonData + ldr r1, =gUnknown_0203BC8C + ldr r2, [r1] + lsls r1, r4, 4 + adds r1, r2 + ldrb r1, [r1, 0xA] + lsls r1, 1 + add r1, r9 + ldr r3, [sp, 0x34] + ldrh r1, [r1] + cmp r0, r1 + beq _08165FB8 +_08165FB0: + adds r3, 0x64 + adds r6, 0x1 + cmp r6, r7 + blt _08165F7A +_08165FB8: + cmp r6, r7 + bne _08166092 + movs r6, 0 + cmp r6, r8 + bge _08165FDA + add r0, sp, 0xC + ldrh r0, [r0] + cmp r0, r4 + beq _08165FDA + add r1, sp, 0xC +_08165FCC: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, r8 + bge _08165FDA + ldrh r0, [r1] + cmp r0, r4 + bne _08165FCC +_08165FDA: + cmp r6, r8 + bne _08166092 + mov r2, r8 + lsls r0, r2, 1 + add r0, sp + adds r0, 0xC + strh r4, [r0] + movs r6, 0x64 + adds r0, r7, 0 + muls r0, r6 + ldr r1, =gEnemyParty + adds r0, r1 + ldr r5, =gUnknown_0203BC8C + ldr r2, [r5] + lsls r4, 4 + adds r2, r4, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + movs r6, 0 + str r6, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + ldr r2, [sp, 0x2C] + str r2, [sp, 0x8] + ldr r2, [sp, 0x20] + bl sub_8068634 + add r1, sp, 0x14 + movs r0, 0xFF + strb r0, [r1] + mov r9, r4 + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x30] + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + mov r8, r1 + adds r3, r5, 0 + mov r5, r9 + ldr r2, =gEnemyParty + mov r10, r2 +_0816602E: + ldr r0, [r3] + adds r0, r5, r0 + lsls r4, r6, 1 + adds r0, 0x2 + adds r0, r4 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + mov r0, r8 + add r0, r10 + str r3, [sp, 0x34] + bl SetMonMoveSlot + ldr r3, [sp, 0x34] + ldr r0, [r3] + adds r0, r5, r0 + adds r0, 0x2 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0xDA + bne _0816605E + movs r0, 0 + mov r1, sp + strb r0, [r1, 0x14] +_0816605E: + adds r6, 0x1 + cmp r6, 0x3 + ble _0816602E + movs r2, 0x64 + adds r4, r7, 0 + muls r4, r2 + ldr r6, =gEnemyParty + adds r4, r6 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x14 + bl SetMonData + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + add r0, r9 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + ldr r0, [sp, 0x30] + mov r8, r0 +_08166092: + ldr r1, [sp, 0x1C] + cmp r8, r1 + beq _0816609A + b _08165F24 +_0816609A: + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8165EA4 + + thumb_func_start sub_81660B8 +sub_81660B8: @ 81660B8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, =gUnknown_085DCEDC + ldrb r0, [r3] + cmp r0, r2 + beq _081660DA +_081660C8: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1D + bhi _081660DA + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081660C8 +_081660DA: + cmp r1, 0x1E + beq _081660EC + ldr r0, =gUnknown_085DCF0E + b _08166116 + .pool +_081660EC: + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _08166108 +_081660F6: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bhi _08166108 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081660F6 +_08166108: + cmp r1, 0x14 + bne _08166114 + movs r0, 0x7 + b _0816611A + .pool +_08166114: + ldr r0, =gUnknown_085DCF2C +_08166116: + adds r0, r1, r0 + ldrb r0, [r0] +_0816611A: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81660B8 + + thumb_func_start sub_8166124 +sub_8166124: @ 8166124 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =gSaveBlock2Ptr + movs r0, 0xEC + muls r0, r6 + movs r1, 0xE7 + lsls r1, 3 + adds r0, r1 + ldr r1, [r2] + movs r5, 0 + movs r4, 0 + movs r3, 0 + adds r1, r0 +_08166140: + ldm r1!, {r0} + adds r5, r0 + orrs r4, r0 + adds r3, 0x1 + cmp r3, 0x39 + bls _08166140 + cmp r5, 0 + bne _08166154 + cmp r4, 0 + beq _08166180 +_08166154: + ldr r2, [r2] + movs r0, 0xEC + adds r1, r6, 0 + muls r1, r0 + movs r3, 0x82 + lsls r3, 4 + adds r0, r2, r3 + adds r0, r1 + ldr r0, [r0] + cmp r0, r5 + bne _08166174 + movs r0, 0x1 + b _08166182 + .pool +_08166174: + movs r3, 0xE7 + lsls r3, 3 + adds r0, r1, r3 + adds r0, r2, r0 + bl sub_8164FB8 +_08166180: + movs r0, 0 +_08166182: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8166124 + + thumb_func_start sub_8166188 +sub_8166188: @ 8166188 + push {r4-r7,lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _081661E8 + bl sub_8165C40 + lsls r0, 24 + movs r5, 0 + ldr r7, =gBaseStats + lsrs r0, 22 + ldr r1, =gExperienceTables + adds r6, r0, r1 +_081661A6: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gEnemyParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + cmp r1, 0 + beq _081661E2 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r1, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + adds r2, r1, 0 + muls r2, r0 + adds r2, r6 + adds r0, r4, 0 + movs r1, 0x19 + bl SetMonData + adds r0, r4, 0 + bl CalculateMonStats +_081661E2: + adds r5, 0x1 + cmp r5, 0x5 + ble _081661A6 +_081661E8: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166188 + + thumb_func_start sub_8166204 +sub_8166204: @ 8166204 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r4, =gUnknown_0203BCAC + ldr r0, =0x0000806c + bl AllocZeroed + str r0, [r4] + ldr r1, =gUnknown_0203BC90 + ldr r2, =0x00007fd0 + adds r0, r2 + str r0, [r1] + str r5, [r0, 0x8] + str r6, [r0, 0x4] + ldr r0, =sub_8166380 + bl launch_c3_walk_stairs_and_run_once + ldr r0, =sub_816631C + bl SetMainCallback2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166204 + + thumb_func_start sub_816624C +sub_816624C: @ 816624C + push {r4,r5,lr} + ldr r4, =gUnknown_0203BCAC + ldr r0, =0x0000806c + bl AllocZeroed + str r0, [r4] + ldr r5, =gUnknown_0203BC90 + ldr r1, =0x00007fd0 + adds r0, r1 + str r0, [r5] + ldr r1, =gUnknown_0203BC98 + ldr r1, [r1] + str r1, [r0, 0x8] + ldr r1, =gUnknown_0203BC94 + ldr r1, [r1] + str r1, [r0, 0x4] + ldr r4, =gUnknown_0203BC9C + ldrb r0, [r4] + bl sub_81672E4 + strb r0, [r4] + ldr r5, [r5] + movs r1, 0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08166284 + movs r1, 0x1 +_08166284: + adds r0, r5, 0 + adds r0, 0x56 + strb r1, [r0] + ldr r0, =sub_8166380 + bl launch_c3_walk_stairs_and_run_once + ldr r0, =sub_81662C0 + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816624C + + thumb_func_start sub_81662C0 +sub_81662C0: @ 81662C0 + push {r4,lr} + ldr r4, =gUnknown_0203BC90 + ldr r0, [r4] + ldr r0, [r0] + bl _call_via_r0 + bl AnimateSprites + bl BuildOamBuffer + bl UpdatePaletteFade + ldr r4, [r4] + ldr r1, [r4] + ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive + cmp r1, r0 + bne _081662F0 + adds r0, r4, 0 + adds r0, 0x50 + movs r1, 0 + strb r1, [r0] + ldr r0, =sub_8166304 + bl SetMainCallback2 +_081662F0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81662C0 + + thumb_func_start sub_8166304 +sub_8166304: @ 8166304 + push {lr} + bl sub_81668F8 + bl AnimateSprites + bl BuildOamBuffer + bl UpdatePaletteFade + pop {r0} + bx r0 + thumb_func_end sub_8166304 + + thumb_func_start sub_816631C +sub_816631C: @ 816631C + push {lr} + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + ldr r0, [r0] + bl _call_via_r0 + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + pop {r0} + bx r0 + .pool + thumb_func_end sub_816631C + + thumb_func_start sub_8166340 +sub_8166340: @ 8166340 + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007c58 + adds r0, r1 + bl sub_81D2108 + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166340 + + thumb_func_start launch_c3_walk_stairs_and_run_once +launch_c3_walk_stairs_and_run_once: @ 816636C + ldr r1, =gUnknown_0203BC90 + ldr r1, [r1] + str r0, [r1] + adds r1, 0x50 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end launch_c3_walk_stairs_and_run_once + + thumb_func_start sub_8166380 +sub_8166380: @ 8166380 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =gUnknown_0203BC90 + ldr r0, [r1] + adds r0, 0x50 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xF + bls _08166394 + b _08166556 +_08166394: + lsls r0, 2 + ldr r1, =_081663A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081663A8: + .4byte _081663E8 + .4byte _0816640C + .4byte _08166416 + .4byte _08166434 + .4byte _08166464 + .4byte _08166468 + .4byte _08166474 + .4byte _08166484 + .4byte _08166490 + .4byte _0816649C + .4byte _081664B8 + .4byte _081664BC + .4byte _081664E4 + .4byte _08166510 + .4byte _08166528 + .4byte _08166550 +_081663E8: + ldr r2, =gUnknown_0203BCAC + ldr r0, [r2] + ldr r1, =0x00007b10 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r2] + ldr r2, =0x00007c58 + adds r0, r2 + bl sub_81D1ED4 + b _0816653C + .pool +_0816640C: + bl ResetSpriteData + bl FreeAllSpritePalettes + b _0816653C +_08166416: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + mov r0, sp + bl CpuSet + b _0816653C + .pool +_08166434: + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085DFCCC + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_085DFCDC + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0x97 + movs r2, 0xE0 + bl sub_809882C + b _0816653C + .pool +_08166464: + ldr r1, [r2] + b _08166540 +_08166468: + bl sub_8168328 + lsls r0, 24 + cmp r0, 0 + bne _08166556 + b _0816653C +_08166474: + ldr r1, =gKeyRepeatStartDelay + movs r0, 0x14 + strh r0, [r1] + bl sub_8167420 + b _0816653C + .pool +_08166484: + bl sub_8167930 + lsls r0, 24 + cmp r0, 0 + bne _08166556 + b _0816653C +_08166490: + movs r0, 0 + bl sub_8167608 + bl sub_8167760 + b _0816653C +_0816649C: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b0e + adds r0, r1 + bl sub_81D312C + lsls r0, 24 + cmp r0, 0 + bne _08166556 + b _0816653C + .pool +_081664B8: + ldr r1, [r2] + b _08166540 +_081664BC: + ldr r5, =gUnknown_0203BCAC + ldr r1, [r5] + ldr r4, =0x00007c58 + adds r0, r1, r4 + ldr r2, =0x00007c6c + adds r1, r2 + bl sub_81D2754 + ldr r0, [r5] + adds r0, r4 + bl sub_81D20AC + b _0816653C + .pool +_081664E4: + ldr r4, =gUnknown_0203BCAC + ldr r0, [r4] + ldr r1, =0x00007c58 + adds r0, r1 + bl sub_81D20BC + lsls r0, 24 + cmp r0, 0 + bne _08166556 + ldr r2, [r4] + ldr r1, =0x00007c58 + adds r0, r2, r1 + adds r1, 0x14 + adds r2, r1 + adds r1, r2, 0 + bl sub_81D1F84 + b _0816653C + .pool +_08166510: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00007c58 + adds r0, r2 + bl sub_81D2230 + b _0816653C + .pool +_08166528: + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x1 + bl sub_8167BA0 +_0816653C: + ldr r0, =gUnknown_0203BC90 + ldr r1, [r0] +_08166540: + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166556 + .pool +_08166550: + ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive + bl launch_c3_walk_stairs_and_run_once +_08166556: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166380 + + thumb_func_start map_warp_consider_1_to_outside_or_stair_or_dive +map_warp_consider_1_to_outside_or_stair_or_dive: @ 8166564 + push {r4,lr} + sub sp, 0x4 + ldr r4, =gUnknown_0203BC90 + ldr r0, [r4] + adds r0, 0x50 + ldrb r1, [r0] + cmp r1, 0 + beq _08166580 + cmp r1, 0x1 + beq _081665C0 + b _08166610 + .pool +_08166580: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r0, =sub_8166340 + bl SetVBlankCallback + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r1, [r4] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166610 + .pool +_081665C0: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08166610 + ldr r4, =gUnknown_0203BCAC + ldr r0, [r4] + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D3464 + ldr r4, [r4] + ldr r2, =0x00008041 + adds r0, r4, r2 + ldrb r1, [r0] + ldr r3, =0x00008040 + adds r0, r4, r3 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _0816660A + ldr r1, =0x00007fb3 + adds r0, r4, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x91 + adds r0, r4, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r3, =0x00007b1c + adds r0, r4, r3 + subs r3, 0xC + adds r1, r4, r3 + ldrb r1, [r1] + bl sub_81D3480 +_0816660A: + ldr r0, =sub_8166634 + bl launch_c3_walk_stairs_and_run_once +_08166610: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end map_warp_consider_1_to_outside_or_stair_or_dive + + thumb_func_start sub_8166634 +sub_8166634: @ 8166634 + push {lr} + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + ldrb r0, [r0] + cmp r0, 0x7 + bls _08166644 + b _0816680E +_08166644: + lsls r0, 2 + ldr r1, =_08166658 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08166658: + .4byte _08166678 + .4byte _0816675C + .4byte _0816680E + .4byte _08166788 + .4byte _0816680E + .4byte _08166794 + .4byte _081667AC + .4byte _081667F4 +_08166678: + ldr r2, =gMain + ldrh r1, [r2, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081666B8 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + bl sub_8167CA0 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D3520 + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x1 + b _0816680C + .pool +_081666B8: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081666F0 + movs r0, 0x5 + bl PlaySE + movs r0, 0 + bl sub_8167CA0 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00007b1c + adds r0, r2 + bl sub_81D3520 + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x1 + b _0816680C + .pool +_081666F0: + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08166710 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x3 + b _0816680C + .pool +_08166710: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0816671A + b _0816680E +_0816671A: + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00008041 + adds r1, r0, r2 + ldrb r1, [r1] + subs r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _0816674C + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x3 + b _0816680C + .pool +_0816674C: + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x5 + b _0816680C + .pool +_0816675C: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00008044 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0816680E + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + b _0816680C + .pool +_08166788: + ldr r0, =sub_8166BEC + bl launch_c3_walk_stairs_and_run_once + b _0816680E + .pool +_08166794: + bl sub_8166D44 + ldr r0, =gUnknown_0203BC90 + ldr r1, [r0] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0816680E + .pool +_081667AC: + bl sub_8166DE4 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081667CC + cmp r1, 0 + bgt _081667C6 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08166804 + b _0816680E +_081667C6: + cmp r1, 0x1 + bne _0816680E + b _08166804 +_081667CC: + bl sub_8167268 + lsls r0, 24 + cmp r0, 0 + beq _081667E8 + bl sub_8166F50 + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x7 + b _0816680C + .pool +_081667E8: + ldr r0, =sub_816681C + bl launch_c3_walk_stairs_and_run_once + b _0816680E + .pool +_081667F4: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0816680E + bl sub_8166F94 +_08166804: + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0 +_0816680C: + strb r1, [r0] +_0816680E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166634 + + thumb_func_start sub_816681C +sub_816681C: @ 816681C + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =gUnknown_0203BC90 + ldr r0, [r5] + adds r0, 0x50 + ldrb r4, [r0] + cmp r4, 0 + beq _08166838 + cmp r4, 0x1 + beq _08166888 + b _081668D4 + .pool +_08166838: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00008041 + adds r0, r1 + ldrb r0, [r0] + bl sub_81672A4 + ldr r1, =gUnknown_0203BC9C + strb r0, [r1] + ldr r1, =gUnknown_0203BC94 + ldr r2, [r5] + ldr r0, [r2, 0x4] + str r0, [r1] + ldr r1, =gUnknown_0203BC98 + ldr r0, [r2, 0x8] + str r0, [r1] + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, [r5] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081668D4 + .pool +_08166888: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081668D4 + movs r0, 0 + bl SetVBlankCallback + ldr r4, =gUnknown_0203BCA0 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203BCA4 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203BCA8 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203BCAC + ldr r0, [r4] + bl Free + str r5, [r4] + bl FreeAllWindowBuffers + ldr r1, =gMain + ldr r0, =sub_816624C + str r0, [r1, 0x8] + bl sub_8179D70 +_081668D4: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816681C + + thumb_func_start sub_81668F8 +sub_81668F8: @ 81668F8 + push {r4,lr} + sub sp, 0x4 + ldr r1, =gUnknown_0203BC90 + ldr r0, [r1] + adds r0, 0x50 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x6 + bls _0816690C + b _08166A18 +_0816690C: + lsls r0, 2 + ldr r1, =_08166920 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08166920: + .4byte _0816693C + .4byte _08166972 + .4byte _08166A18 + .4byte _081669A0 + .4byte _081669AE + .4byte _081669C8 + .4byte _081669F4 +_0816693C: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00008041 + adds r0, r1 + ldr r1, =gUnknown_0203BC9C + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _08166968 + ldr r0, [r4] + adds r0, 0x56 + ldrb r0, [r0] + bl sub_8167CA0 + ldr r1, [r4] + b _081669E2 + .pool +_08166968: + ldr r0, [r4] + adds r0, 0x50 + movs r1, 0x3 + strb r1, [r0] + b _08166A18 +_08166972: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00008044 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08166A18 + ldr r0, =gUnknown_0203BC90 + ldr r0, [r0] + adds r0, 0x50 + strb r1, [r0] + b _08166A18 + .pool +_081669A0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + b _081669DE +_081669AE: + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x2 + bl ShowBg + b _081669DE +_081669C8: + ldr r0, =sub_8166340 + bl SetVBlankCallback + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade +_081669DE: + ldr r0, =gUnknown_0203BC90 + ldr r1, [r0] +_081669E2: + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166A18 + .pool +_081669F4: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08166A18 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D3464 + ldr r0, =sub_8166A34 + bl launch_c3_walk_stairs_and_run_once + ldr r0, =sub_816631C + bl SetMainCallback2 +_08166A18: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81668F8 + + thumb_func_start sub_8166A34 +sub_8166A34: @ 8166A34 + push {r4-r6,lr} + ldr r1, =gUnknown_0203BC90 + ldr r0, [r1] + adds r0, 0x50 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0x5 + bls _08166A46 + b _08166BDA +_08166A46: + lsls r0, 2 + ldr r1, =_08166A58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08166A58: + .4byte _08166A70 + .4byte _08166AAC + .4byte _08166AC0 + .4byte _08166B14 + .4byte _08166B94 + .4byte _08166BB6 +_08166A70: + ldr r4, [r5] + ldr r3, =gPlayerParty + str r3, [r4, 0xC] + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00008041 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0, r1 + subs r2, 0x88 + adds r1, r2 + ldrb r2, [r1] + movs r1, 0x64 + muls r1, r2 + adds r1, r3 + str r1, [r4, 0xC] + ldr r3, =0x00007b1c + adds r0, r3 + bl sub_81D3520 + b _08166BAA + .pool +_08166AAC: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08166ABA + b _08166BDA +_08166ABA: + b _08166BAA + .pool +_08166AC0: + bl sub_8167104 + ldr r6, =gUnknown_0203BC90 + ldr r0, [r6] + adds r0, 0x5C + ldr r4, =gUnknown_0203BCAC + ldr r1, [r4] + ldr r5, =0x00007ca8 + adds r1, r5 + bl sub_81D2754 + ldr r2, [r4] + ldr r4, =0x00007c58 + adds r0, r2, r4 + ldr r3, =0x00007fb3 + adds r1, r2, r3 + movs r3, 0 + ldrsb r3, [r1, r3] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + adds r4, 0x14 + adds r1, r4 + adds r1, r2, r1 + adds r2, r5 + bl sub_81D1F84 + bl sub_8167338 + ldr r1, [r6] + b _08166BAC + .pool +_08166B14: + ldr r5, =gUnknown_0203BCAC + ldr r0, [r5] + ldr r1, =0x00007c58 + adds r0, r1 + bl sub_81D2074 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08166BDA + ldr r0, [r5] + ldr r4, =0x00008041 + adds r0, r4 + ldrb r0, [r0] + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + bl sub_81681F4 + ldr r3, [r5] + adds r4, r3, r4 + ldrb r1, [r4] + ldr r2, =0x00008040 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08166B6C + ldr r4, =0x00007fb3 + adds r0, r3, r4 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x90 + adds r0, r3, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r4, =0x00007b1c + adds r0, r3, r4 + subs r4, 0xC + adds r1, r3, r4 + ldrb r1, [r1] + bl sub_81D3480 +_08166B6C: + ldr r1, =gUnknown_0203BC90 + ldr r0, [r1] + adds r0, 0x52 + strb r6, [r0] + ldr r1, [r1] + b _08166BAC + .pool +_08166B94: + ldr r1, [r5] + adds r1, 0x52 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + bls _08166BDA + bl sub_8166E24 +_08166BAA: + ldr r1, [r5] +_08166BAC: + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166BDA +_08166BB6: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08166BDA + bl sub_8166EDC + lsls r0, 24 + cmp r0, 0 + bne _08166BDA + ldr r0, =gUnknown_0203CE7C + ldrb r0, [r0] + bl sub_8136F68 + ldr r0, =sub_8166BEC + bl launch_c3_walk_stairs_and_run_once +_08166BDA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166A34 + + thumb_func_start sub_8166BEC +sub_8166BEC: @ 8166BEC + push {r4-r6,lr} + sub sp, 0x4 + ldr r4, =gUnknown_0203BC90 + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0x50 + ldrb r1, [r2] + cmp r1, 0x1 + beq _08166C28 + cmp r1, 0x1 + bgt _08166C0C + cmp r1, 0 + beq _08166C16 + b _08166D18 + .pool +_08166C0C: + cmp r1, 0x2 + beq _08166C40 + cmp r1, 0x3 + beq _08166C5C + b _08166D18 +_08166C16: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + b _08166C4A +_08166C28: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08166D18 + movs r0, 0x2 + strb r0, [r2] + b _08166D18 + .pool +_08166C40: + ldr r1, =gUnknown_02039B28 + movs r0, 0x3 + strb r0, [r1, 0x15] + bl sub_80BA0A8 +_08166C4A: + ldr r1, [r4] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166D18 + .pool +_08166C5C: + ldr r0, [r0, 0x4] + bl SetMainCallback2 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D354C + movs r4, 0 +_08166C70: + ldr r5, =gUnknown_0203BCAC + ldr r0, [r5] + ldr r2, =0x00007b06 + adds r0, r2 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _08166C70 + movs r0, 0 + bl FreeSpriteTilesByTag + movs r0, 0x1 + bl FreeSpriteTilesByTag + movs r0, 0 + bl FreeSpritePaletteByTag + movs r0, 0x1 + bl FreeSpritePaletteByTag + movs r4, 0 +_08166CAE: + ldr r0, [r5] + lsls r1, r4, 2 + ldr r2, =0x00007b44 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _08166CAE + ldr r6, =gUnknown_0203BCAC + ldr r0, [r6] + ldr r2, =0x00007b10 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08166CE6 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite +_08166CE6: + movs r0, 0 + bl SetVBlankCallback + ldr r4, =gUnknown_0203BCA0 + ldr r0, [r4] + bl Free + movs r5, 0 + str r5, [r4] + ldr r4, =gUnknown_0203BCA4 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203BCA8 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r0, [r6] + bl Free + str r5, [r6] + bl FreeAllWindowBuffers +_08166D18: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166BEC + + thumb_func_start sub_8166D44 +sub_8166D44: @ 8166D44 + push {r4,lr} + sub sp, 0x4C + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00008041 + adds r0, r1 + ldrb r0, [r0] + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2 + add r2, sp, 0xC + bl GetMonData + add r0, sp, 0xC + bl StringGetEnd10 + ldr r1, =gUnknown_085EC7A0 + add r0, sp, 0xC + bl StringAppend + ldr r4, =gStringVar4 + adds r0, r4, 0 + add r1, sp, 0xC + bl StringCopy + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x2 + movs r1, 0x97 + movs r2, 0xE + bl sub_8098858 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl PrintTextOnWindow + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =gUnknown_085DFCFC + movs r1, 0x97 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + add sp, 0x4C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166D44 + + thumb_func_start sub_8166DE4 +sub_8166DE4: @ 8166DE4 + push {r4,lr} + bl sub_8198C58 + lsls r0, 24 + lsrs r4, r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08166E18 + cmp r1, 0 + bgt _08166E02 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08166E06 + b _08166E18 +_08166E02: + cmp r1, 0x1 + bne _08166E18 +_08166E06: + movs r0, 0x5 + bl PlaySE + movs r0, 0x2 + bl rbox_fill_rectangle + movs r0, 0x2 + bl ClearWindowTilemap +_08166E18: + lsls r0, r4, 24 + asrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8166DE4 + + thumb_func_start sub_8166E24 +sub_8166E24: @ 8166E24 + push {r4,lr} + movs r0, 0x2 + movs r1, 0x97 + movs r2, 0xE + bl sub_8098858 + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r3, =gUnknown_0203BC90 + ldr r0, [r3] + adds r0, 0x53 + movs r1, 0 + strb r1, [r0] + ldr r2, [r3] + adds r1, r2, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166EA8 + adds r0, r2, 0 + adds r0, 0x61 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + adds r4, r3, 0 + cmp r0, 0 + bne _08166E84 + adds r2, r4, 0 +_08166E60: + ldr r0, [r2] + adds r0, 0x53 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r3, [r2] + adds r1, r3, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166EA8 + adds r0, r3, 0 + adds r0, 0x61 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08166E60 +_08166E84: + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166EA8 + ldr r0, =gStringVar4 + ldrb r1, [r1] + adds r2, 0x61 + adds r2, r1 + ldrb r2, [r2] + bl sub_8166FD4 + b _08166EB8 + .pool +_08166EA8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_0203BC90 + ldr r1, [r1] + adds r1, 0x53 + ldrb r1, [r1] + movs r2, 0 + bl sub_8166FD4 +_08166EB8: + ldr r0, =gStringVar4 + bl sub_8166FB0 + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166E24 + + thumb_func_start sub_8166EDC +sub_8166EDC: @ 8166EDC + push {r4,r5,lr} + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_0203BC90 + adds r3, r5, 0 + movs r4, 0x5 +_08166EEC: + ldr r0, [r3] + adds r0, 0x53 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r2, [r3] + adds r1, r2, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166F18 + adds r0, r2, 0 + adds r0, 0x61 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08166F1E + b _08166EEC + .pool +_08166F18: + strb r4, [r1] + movs r0, 0 + b _08166F44 +_08166F1E: + ldr r4, =gStringVar4 + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x53 + ldrb r1, [r1] + adds r0, 0x61 + adds r0, r1 + ldrb r2, [r0] + adds r0, r4, 0 + bl sub_8166FD4 + adds r0, r4, 0 + bl sub_8166FB0 + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x1 +_08166F44: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8166EDC + + thumb_func_start sub_8166F50 +sub_8166F50: @ 8166F50 + push {lr} + sub sp, 0xC + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x2 + movs r1, 0x97 + movs r2, 0xE + bl sub_8098858 + ldr r2, =gUnknown_085EC800 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl PrintTextOnWindow + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166F50 + + thumb_func_start sub_8166F94 +sub_8166F94: @ 8166F94 + push {lr} + movs r0, 0x2 + bl rbox_fill_rectangle + movs r0, 0x2 + bl ClearWindowTilemap + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_8166F94 + + thumb_func_start sub_8166FB0 +sub_8166FB0: @ 8166FB0 + push {lr} + sub sp, 0xC + ldr r2, =gStringVar4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl PrintTextOnWindow + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166FB0 + + thumb_func_start sub_8166FD4 +sub_8166FD4: @ 8166FD4 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 16 + lsrs r0, r2, 16 + asrs r2, 16 + cmp r2, 0 + beq _08167010 + cmp r2, 0 + ble _08166FEC + movs r0, 0 +_08166FEC: + lsls r0, 16 + ldr r1, =gUnknown_085DFD04 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl StringCopy + ldr r1, =gUnknown_085EC7E1 + adds r0, r4, 0 + bl StringAppend + b _08167018 + .pool +_08167010: + ldr r1, =gUnknown_085EC7EF + adds r0, r4, 0 + bl StringCopy +_08167018: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166FD4 + + thumb_func_start sub_8167024 +sub_8167024: @ 8167024 + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r4, 0 + ldr r7, =gUnknown_085DFCB0 +_0816702E: + lsls r0, r4, 2 + adds r0, r7 + ldr r1, [r0] + adds r0, r6, 0 + bl GetMonData + adds r1, r5, r4 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _0816702E + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167024 + + thumb_func_start sub_8167054 +sub_8167054: @ 8167054 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r8, r0 + adds r5, r1, 0 + adds r0, r5, 0 + movs r1, 0x30 + bl GetMonData + cmp r0, 0xFF + beq _081670F0 + mov r0, r8 + adds r1, r5, 0 + bl sub_8167184 + movs r4, 0 + mov r7, sp +_08167078: + ldr r1, =gUnknown_085DFCB0 + lsls r0, r4, 2 + adds r0, r1 + ldr r6, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + strb r0, [r7] + ldr r1, =gUnknown_0203BC90 + ldr r1, [r1] + lsls r2, r4, 1 + adds r1, 0x66 + adds r1, r2 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r0, 0 + bge _081670A6 + movs r1, 0 +_081670A6: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081670B0 + movs r1, 0xFF +_081670B0: + strb r1, [r7] + adds r0, r5, 0 + adds r1, r6, 0 + mov r2, sp + bl SetMonData + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08167078 + adds r0, r5, 0 + movs r1, 0x30 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + ldrb r2, [r2, 0x6] + adds r1, r0, r2 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081670E2 + movs r1, 0xFF +_081670E2: + mov r0, sp + strb r1, [r0] + adds r0, r5, 0 + movs r1, 0x30 + mov r2, sp + bl SetMonData +_081670F0: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167054 + + thumb_func_start sub_8167104 +sub_8167104: @ 8167104 + push {r4,r5,lr} + ldr r5, =gPlayerParty + ldr r0, =gUnknown_0203BCAC + ldr r1, [r0] + ldr r2, =0x00008041 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + ldr r0, =0x00007fb9 + adds r1, r0 + ldrb r1, [r1] + movs r0, 0x64 + muls r0, r1 + adds r5, r0, r5 + ldr r4, =gUnknown_0203BC90 + ldr r1, [r4] + adds r1, 0x57 + adds r0, r5, 0 + bl sub_8167024 + ldr r0, [r4] + ldr r0, [r0, 0x8] + adds r1, r5, 0 + bl sub_8167054 + ldr r1, [r4] + adds r1, 0x5C + adds r0, r5, 0 + bl sub_8167024 + movs r3, 0 +_08167144: + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0x61 + adds r2, r3 + adds r1, r0, 0 + adds r1, 0x5C + adds r1, r3 + adds r0, 0x57 + adds r0, r3 + ldrb r1, [r1] + ldrb r0, [r0] + subs r1, r0 + strb r1, [r2] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x4 + bls _08167144 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167104 + + thumb_func_start sub_8167184 +sub_8167184: @ 8167184 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r1 + ldr r1, =gUnknown_0203BC90 + ldr r3, [r1] + ldrb r1, [r0, 0x1] + adds r2, r3, 0 + adds r2, 0x66 + strh r1, [r2] + ldrb r2, [r0, 0x5] + adds r1, r3, 0 + adds r1, 0x68 + strh r2, [r1] + ldrb r1, [r0, 0x4] + adds r2, r3, 0 + adds r2, 0x6A + strh r1, [r2] + ldrb r2, [r0, 0x3] + adds r1, r3, 0 + adds r1, 0x6C + strh r2, [r1] + ldrb r1, [r0, 0x2] + adds r0, r3, 0 + adds r0, 0x6E + strh r1, [r0] + ldr r0, =gUnknown_0203BC9E + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + ble _081671D4 + movs r0, 0x1 + b _081671DA + .pool +_081671D4: + cmp r0, 0 + bge _08167250 + movs r0, 0xFF +_081671DA: + movs r2, 0 + lsls r0, 24 + mov r9, r0 + ldr r0, =gUnknown_0203BC90 + mov r8, r0 +_081671E4: + mov r0, r8 + ldr r1, [r0] + lsls r0, r2, 24 + asrs r6, r0, 24 + lsls r7, r6, 1 + adds r1, 0x66 + adds r1, r7 + movs r2, 0 + ldrsh r4, [r1, r2] + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + movs r1, 0xA + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0816721C + lsls r0, r5, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r5, r0, 24 +_0816721C: + ldr r0, =gUnknown_085DFCC4 + adds r0, r6, r0 + ldrb r1, [r0] + mov r0, r10 + bl GetMonFlavourRelation + lsls r0, 24 + asrs r2, r0, 24 + cmp r0, r9 + bne _08167244 + mov r1, r8 + ldr r0, [r1] + adds r0, 0x66 + adds r0, r7 + lsls r1, r5, 24 + asrs r1, 24 + muls r1, r2 + ldrh r2, [r0] + adds r1, r2 + strh r1, [r0] +_08167244: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, 0x4 + ble _081671E4 +_08167250: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167184 + + thumb_func_start sub_8167268 +sub_8167268: @ 8167268 + push {lr} + ldr r0, =gUnknown_0203BCAC + ldr r1, [r0] + ldr r2, =0x00008041 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + subs r2, 0x89 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0x30 + movs r3, 0 + bl sub_81D2C68 + cmp r0, 0xFF + beq _0816729C + movs r0, 0 + b _0816729E + .pool +_0816729C: + movs r0, 0x1 +_0816729E: + pop {r1} + bx r1 + thumb_func_end sub_8167268 + + thumb_func_start sub_81672A4 +sub_81672A4: @ 81672A4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 +_081672AC: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081672D2 + cmp r5, 0 + bne _081672CC + adds r0, r4, 0 + b _081672DE + .pool +_081672CC: + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_081672D2: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081672AC + movs r0, 0 +_081672DE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81672A4 + + thumb_func_start sub_81672E4 +sub_81672E4: @ 81672E4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + movs r6, 0 + cmp r6, r5 + bcs _08167314 +_081672F2: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _0816730A + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0816730A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _081672F2 +_08167314: + subs r0, r5, r6 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81672E4 + + thumb_func_start sub_8167324 +sub_8167324: @ 8167324 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8167324 + + thumb_func_start sub_8167338 +sub_8167338: @ 8167338 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gUnknown_085DFD18 + bl LoadSpriteSheet + ldr r0, =gUnknown_085DFD20 + bl LoadSpritePalette + ldr r2, =gUnknown_0203BC90 + ldr r0, [r2] + adds r0, 0x54 + movs r1, 0 + strb r1, [r0] + movs r4, 0 + adds r5, r2, 0 + ldr r6, =gUnknown_085DFD28 + adds r0, r6, 0x2 + mov r8, r0 + ldr r7, =gSprites + 0x1C +_08167360: + ldr r0, [r5] + adds r0, 0x61 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _081673AC + lsls r2, r4, 2 + adds r0, r2, r6 + movs r3, 0 + ldrsh r1, [r0, r3] + add r2, r8 + movs r0, 0 + ldrsh r2, [r2, r0] + ldr r0, =gUnknown_085DFD5C + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _081673AC + ldr r0, [r5] + adds r0, 0x61 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _081673A2 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81673DC + str r1, [r0] +_081673A2: + ldr r1, [r5] + adds r1, 0x54 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081673AC: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08167360 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167338 + + thumb_func_start sub_81673DC +sub_81673DC: @ 81673DC + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x5 + bgt _081673EE + ldrh r0, [r1, 0x26] + subs r0, 0x2 + b _081673F6 +_081673EE: + cmp r0, 0xB + bgt _081673F8 + ldrh r0, [r1, 0x26] + adds r0, 0x2 +_081673F6: + strh r0, [r1, 0x26] +_081673F8: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _08167418 + adds r0, r1, 0 + bl DestroySprite + ldr r0, =gUnknown_0203BC90 + ldr r1, [r0] + adds r1, 0x54 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_08167418: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81673DC + + thumb_func_start sub_8167420 +sub_8167420: @ 8167420 + push {r4-r6,lr} + movs r4, 0 + movs r5, 0 + ldr r6, =gUnknown_0203BCAC + b _08167472 + .pool +_08167430: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2D + bl GetMonData + adds r3, r0, 0 + cmp r3, 0 + bne _0816746C + ldr r1, [r6] + lsls r2, r5, 2 + adds r1, r2 + ldr r0, =0x00007fb8 + adds r1, r0 + movs r0, 0xE + strb r0, [r1] + ldr r0, [r6] + adds r0, r2 + ldr r1, =0x00007fb9 + adds r0, r1 + strb r4, [r0] + ldr r0, [r6] + adds r0, r2 + ldr r2, =0x00007fba + adds r0, r2 + strh r3, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_0816746C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08167472: + bl CalculatePlayerPartyCount + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _08167430 + ldr r2, =gUnknown_0203BCAC + ldr r0, [r2] + ldr r1, =0x00008041 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r1, r5, 0x1 + ldr r2, =0x00008040 + adds r0, r2 + strb r1, [r0] + bl sub_81674BC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167420 + + thumb_func_start sub_81674BC +sub_81674BC: @ 81674BC + push {r4,r5,lr} + ldr r4, =gUnknown_0203BCAC + ldr r0, [r4] + ldr r5, =0x00008041 + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_816753C + ldr r0, [r4] + ldr r1, =0x00007fb3 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, =0x00007fb4 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + ldr r1, =0x00007fb5 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r4] + adds r5, r0, r5 + ldrb r3, [r5] + adds r1, r3, 0x1 + adds r2, 0x8C + adds r0, r2 + ldrb r2, [r0] + cmp r1, r2 + blt _08167500 + movs r1, 0 +_08167500: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r0, 0 + bge _08167510 + subs r0, r2, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08167510: + adds r0, r1, 0 + movs r1, 0x1 + bl sub_816753C + lsls r0, r4, 16 + asrs r0, 16 + movs r1, 0x2 + bl sub_816753C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81674BC + + thumb_func_start sub_816753C +sub_816753C: @ 816753C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203BCAC + mov r9, r0 + ldr r1, [r0] + lsls r5, 16 + asrs r0, r5, 14 + adds r0, r1, r0 + ldr r3, =0x00007fb8 + adds r2, r0, r3 + ldrb r7, [r2] + ldr r2, =0x00007fb9 + adds r0, r2 + ldrb r0, [r0] + mov r10, r0 + adds r3, 0x88 + adds r0, r1, r3 + ldrb r6, [r0] + movs r0, 0 + mov r8, r0 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r2, =0x00007b4d + adds r0, r2 + adds r0, r1, r0 + lsls r2, r4, 6 + ldr r3, =0x00007b95 + adds r2, r3 + adds r1, r2 + lsrs r5, 16 + str r5, [sp] + str r6, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + adds r2, r7, 0 + mov r3, r10 + bl sub_81D2ED4 + mov r3, r9 + ldr r1, [r3] + ldr r2, =0x00007c58 + adds r0, r1, r2 + ldr r3, =0x00007fb0 + adds r1, r3 + str r5, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r2, r8 + str r2, [sp, 0xC] + adds r2, r7, 0 + mov r3, r10 + bl sub_81D2F78 + lsls r0, r4, 13 + movs r1, 0xC1 + lsls r1, 2 + adds r0, r1 + mov r3, r9 + ldr r1, [r3] + adds r0, r1, r0 + lsls r4, 7 + adds r4, 0x4 + adds r1, r4 + str r5, [sp] + str r6, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + adds r2, r7, 0 + mov r3, r10 + bl sub_81D3094 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816753C + + thumb_func_start sub_8167608 +sub_8167608: @ 8167608 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gUnknown_0203BCAC + ldr r3, [r1] + ldr r0, =0x00007b10 + mov r8, r0 + adds r0, r3, r0 + ldrb r0, [r0] + adds r7, r1, 0 + cmp r0, 0xFF + bne _08167714 + add r5, sp, 0x18 + add r4, sp, 0x20 + adds r0, r5, 0 + mov r1, sp + adds r2, r4, 0 + bl sub_81D31D0 + lsls r0, r6, 13 + movs r1, 0xC1 + lsls r1, 2 + adds r0, r1 + ldr r1, [r7] + adds r0, r1, r0 + str r0, [sp, 0x18] + lsls r0, r6, 7 + adds r0, 0x4 + adds r1, r0 + str r1, [sp, 0x20] + adds r0, r4, 0 + bl LoadSpritePalette + ldr r1, [r7] + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x00007b12 + adds r1, r2 + strh r0, [r1] + adds r0, r5, 0 + bl LoadSpriteSheet + ldr r1, [r7] + ldr r3, =0x00007b14 + adds r1, r3 + strh r0, [r1] + mov r0, sp + movs r1, 0x26 + movs r2, 0x68 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, [r7] + ldr r2, =0x00007b10 + adds r0, r2 + strb r1, [r0] + cmp r1, 0x40 + bne _081676AC + movs r0, 0x64 + bl FreeSpriteTilesByTag + movs r0, 0x64 + bl FreeSpritePaletteByTag + ldr r0, [r7] + add r0, r8 + movs r1, 0xFF + strb r1, [r0] + b _08167742 + .pool +_081676AC: + ldr r0, [r7] + add r0, r8 + strb r1, [r0] + ldr r4, =gSprites + ldr r2, [r7] + mov r0, r8 + adds r3, r2, r0 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_8168168 + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + subs r1, 0x22 + strh r1, [r0, 0x26] + ldr r3, =0x00007b18 + adds r1, r2, r3 + subs r3, 0x4 + adds r0, r2, r3 + ldrh r0, [r0] + lsls r0, 5 + ldr r3, =0x06010000 + adds r0, r3 + str r0, [r1] + ldr r0, =0x00007b12 + adds r2, r0 + ldrh r0, [r2] + lsls r0, 4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r2] + b _08167742 + .pool +_08167714: + lsls r1, r6, 13 + movs r0, 0xC1 + lsls r0, 2 + adds r1, r0 + adds r1, r3, r1 + ldr r2, =0x00007b18 + adds r0, r3, r2 + ldr r2, [r0] + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000400 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + lsls r0, r6, 7 + adds r0, 0x4 + adds r0, r3, r0 + ldr r2, =0x00007b12 + adds r1, r3, r2 + ldrh r1, [r1] + movs r2, 0x20 + bl LoadPalette +_08167742: + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167608 + + thumb_func_start sub_8167760 +sub_8167760: @ 8167760 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x60 + add r5, sp, 0x20 + add r4, sp, 0x38 + mov r0, sp + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_81D321C + mov r0, sp + bl LoadSpriteSheets + adds r0, r4, 0 + bl LoadSpritePalettes + movs r4, 0 + ldr r1, =gUnknown_0203BCAC + ldr r0, [r1] + ldr r2, =0x00008040 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + adds r6, r5, 0 + add r2, sp, 0x50 + mov r9, r2 + add r2, sp, 0x58 + mov r10, r2 + cmp r4, r0 + bge _0816781C + adds r5, r1, 0 + ldr r7, =gSprites + movs r0, 0x1C + adds r0, r7 + mov r8, r0 +_081677AC: + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r1, 0x80 + lsls r1, 12 + adds r2, r1 + asrs r2, 16 + adds r0, r6, 0 + movs r1, 0xE2 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _081677FC + ldr r0, [r5] + ldr r2, =0x00007b06 + adds r0, r2 + adds r0, r4 + strb r3, [r0] + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r1, r0, r7 + strh r4, [r1, 0x2E] + add r0, r8 + ldr r1, =sub_8168180 + str r1, [r0] + b _08167808 + .pool +_081677FC: + ldr r0, [r5] + ldr r1, =0x00007b06 + adds r0, r1 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_08167808: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, [r5] + ldr r2, =0x00008040 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r4, r0 + blt _081677AC +_0816781C: + movs r0, 0x67 + strh r0, [r6] + cmp r4, 0x5 + bhi _0816788A + ldr r5, =gUnknown_0203BCAC + ldr r7, =gSprites +_08167828: + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r0, 0x80 + lsls r0, 12 + adds r2, r0 + asrs r2, 16 + adds r0, r6, 0 + movs r1, 0xE6 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _08167874 + ldr r0, [r5] + ldr r1, =0x00007b06 + adds r0, r1 + adds r0, r4 + strb r3, [r0] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x3] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1, 0x3] + b _08167880 + .pool +_08167874: + ldr r0, [r5] + ldr r2, =0x00007b06 + adds r0, r2 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_08167880: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x5 + bls _08167828 +_0816788A: + movs r0, 0x66 + strh r0, [r6] + ldr r0, =sub_81681B4 + str r0, [r6, 0x14] + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r0, 0x80 + lsls r0, 12 + adds r2, r0 + asrs r2, 16 + adds r0, r6, 0 + movs r1, 0xDE + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _081678F4 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b06 + adds r0, r1 + adds r0, r4 + strb r3, [r0] + ldr r0, =gSprites + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r0 + ldrb r3, [r2, 0x1] + movs r1, 0x3F + adds r0, r1, 0 + ands r0, r3 + movs r3, 0x40 + orrs r0, r3 + strb r0, [r2, 0x1] + ldrb r0, [r2, 0x3] + ands r1, r0 + movs r0, 0x80 + orrs r1, r0 + strb r1, [r2, 0x3] + b _08167902 + .pool +_081678F4: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00007b06 + adds r0, r2 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_08167902: + mov r0, r9 + mov r1, r10 + bl sub_81D32B0 + mov r0, r9 + bl LoadSpriteSheet + mov r0, r10 + bl LoadSpritePalette + add sp, 0x60 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167760 + + thumb_func_start sub_8167930 +sub_8167930: @ 8167930 + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00008048 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xB + bls _08167944 + b _08167B78 +_08167944: + lsls r0, 2 + ldr r1, =_0816795C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0816795C: + .4byte _0816798C + .4byte _08167A04 + .4byte _08167A38 + .4byte _08167A48 + .4byte _08167A5C + .4byte _08167A74 + .4byte _08167A9C + .4byte _08167AB0 + .4byte _08167AD4 + .4byte _08167AEC + .4byte _08167B1C + .4byte _08167B38 +_0816798C: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r1, 0x88 + lsls r1, 6 + movs r0, 0x3 + movs r2, 0 + bl ChangeBgY + ldr r1, =0x00007040 + movs r0, 0 + bl SetGpuReg + movs r1, 0x91 + lsls r1, 2 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _08167B7E + .pool +_08167A04: + ldr r4, =gUnknown_0203BCA4 + movs r0, 0xD0 + lsls r0, 5 + bl Alloc + str r0, [r4] + ldr r5, =gUnknown_0203BCA0 + movs r4, 0xA0 + lsls r4, 3 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203BCA8 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + b _08167B7E + .pool +_08167A38: + ldr r0, =gUnknown_085DFB60 + ldr r1, =gUnknown_0203BCA8 + b _08167AA0 + .pool +_08167A48: + ldr r1, =gUnknown_085DFA80 + movs r0, 0x3 + movs r2, 0xE0 + movs r3, 0 + bl LoadBgTiles + b _08167B7E + .pool +_08167A5C: + ldr r0, =gUnknown_0203BCA8 + ldr r1, [r0] + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x3 + movs r3, 0 + bl LoadBgTilemap + b _08167B7E + .pool +_08167A74: + ldr r0, =gUnknown_085DFA60 + movs r1, 0xD0 + movs r2, 0x20 + bl LoadPalette + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b0e + adds r0, r1 + ldr r1, =0x0000ffb0 + strh r1, [r0] + b _08167B7E + .pool +_08167A9C: + ldr r0, =gUnknown_08DCCF7C + ldr r1, =gUnknown_0203BCA4 +_08167AA0: + ldr r1, [r1] + bl LZ77UnCompVram + b _08167B7E + .pool +_08167AB0: + ldr r0, =gUnknown_08DCD81C + ldr r1, =gUnknown_0203BCA0 + ldr r1, [r1] + bl LZ77UnCompVram + ldr r0, =gUnknown_08DCCF5C + movs r1, 0x20 + movs r2, 0x20 + bl LoadPalette + b _08167B7E + .pool +_08167AD4: + ldr r0, =gUnknown_0203BCA4 + ldr r1, [r0] + movs r2, 0xD0 + lsls r2, 5 + movs r3, 0xA0 + lsls r3, 2 + movs r0, 0x1 + bl LoadBgTiles + b _08167B7E + .pool +_08167AEC: + ldr r0, =gUnknown_0203BCA0 + ldr r1, [r0] + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_08DCDA30 + movs r0, 0xC + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r2, 0 + movs r3, 0xD + bl CopyToBgTilemapBufferRect + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + b _08167B7E + .pool +_08167B1C: + ldr r0, =gUnknown_085DFC0C + ldr r1, =gUnknown_0203BCAC + ldr r1, [r1] + ldr r2, =0x00007304 + adds r1, r2 + bl LZ77UnCompVram + b _08167B7E + .pool +_08167B38: + ldr r0, =gUnknown_0203BCAC + ldr r1, [r0] + ldr r0, =0x00007304 + adds r1, r0 + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x2 + movs r3, 0 + bl LoadBgTilemap + ldr r0, =gUnknown_086231E8 + movs r1, 0x30 + movs r2, 0x20 + bl LoadPalette + ldr r0, =gUnknown_08623208 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadPalette + movs r0, 0x2 + bl sub_81D21DC + b _08167B7E + .pool +_08167B78: + movs r0, 0 + strb r0, [r1] + b _08167B8E +_08167B7E: + ldr r0, =gUnknown_0203BCAC + ldr r1, [r0] + ldr r2, =0x00008048 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x1 +_08167B8E: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8167930 + + thumb_func_start sub_8167BA0 +sub_8167BA0: @ 8167BA0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r7, =gUnknown_0203BCAC + ldr r3, [r7] + ldr r1, =0x00008041 + adds r0, r3, r1 + ldrb r1, [r0] + ldr r2, =0x00008040 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08167C46 + lsls r2, r4, 6 + ldr r0, =0x00007b95 + adds r2, r0 + adds r2, r3, r2 + movs r0, 0x1 + str r0, [sp] + movs r5, 0 + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl PrintTextOnWindow + ldr r0, [r7] + ldr r1, =0x00008041 + adds r0, r1 + ldrb r0, [r0] + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + bl GetNature + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, [r7] + ldr r6, =0x0000804a + adds r0, r6 + ldr r1, =gUnknown_085EBF8D + bl StringCopy + ldr r1, =gNatureNamePointers + lsls r4, 2 + adds r4, r1 + ldr r1, [r4] + bl StringCopy + ldr r0, =gUnknown_085DFCC9 + str r0, [sp] + str r5, [sp, 0x4] + ldr r0, [r7] + adds r0, r6 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0x1 + bl box_print +_08167C46: + mov r2, r8 + cmp r2, 0 + beq _08167C84 + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + b _08167C94 + .pool +_08167C84: + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram +_08167C94: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8167BA0 + + thumb_func_start sub_8167CA0 +sub_8167CA0: @ 8167CA0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + beq _08167CC0 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007fb5 + adds r0, r1 + b _08167CC8 + .pool +_08167CC0: + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00007fb4 + adds r0, r2 +_08167CC8: + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r5, =gUnknown_0203BCAC + ldr r2, [r5] + ldr r3, =0x00007c58 + adds r0, r2, r3 + ldr r4, =0x00007fb3 + adds r1, r2, r4 + movs r3, 0 + ldrsb r3, [r1, r3] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + ldr r4, =0x00007c6c + adds r1, r4 + adds r1, r2, r1 + lsls r3, r6, 2 + adds r3, r6 + lsls r3, 2 + adds r3, r4 + adds r2, r3 + bl sub_81D1F84 + ldr r4, [r5] + ldr r1, =0x00008041 + adds r0, r4, r1 + ldrb r1, [r0] + ldr r2, =0x00008040 + mov r12, r2 + adds r0, r4, r2 + ldrb r0, [r0] + subs r0, 0x1 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + mov r8, r0 + cmp r7, 0 + beq _08167D98 + ldr r3, =0x00007fb4 + adds r0, r4, r3 + ldrb r1, [r0] + subs r2, 0x8B + adds r0, r4, r2 + strb r1, [r0] + ldr r0, [r5] + ldr r4, =0x00007fb3 + adds r1, r0, r4 + ldrb r1, [r1] + adds r0, r3 + strb r1, [r0] + ldr r0, [r5] + adds r0, r4 + strb r6, [r0] + ldr r0, [r5] + adds r2, r0, r2 + ldrb r1, [r2] + ldr r2, =0x00007fb6 + adds r0, r2 + strb r1, [r0] + ldr r1, [r5] + adds r3, 0x8D + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08167D58 + mov r4, r12 + adds r0, r1, r4 + ldrb r0, [r0] +_08167D58: + subs r2, r0, 0x1 + ldr r0, =0x00008041 + adds r1, r0 + strb r2, [r1] + ldr r1, =gUnknown_0203BCAC + ldr r3, [r1] + adds r0, r3, r0 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0 + bne _08167D74 + ldr r1, =0x00008040 + adds r0, r3, r1 + ldrb r0, [r0] +_08167D74: + subs r1, r0, 0x1 + b _08167E1E + .pool +_08167D98: + ldr r3, =0x00007fb5 + adds r0, r4, r3 + ldrb r1, [r0] + ldr r2, =0x00007fb4 + adds r0, r4, r2 + strb r1, [r0] + ldr r0, [r5] + ldr r4, =0x00007fb3 + adds r1, r0, r4 + ldrb r1, [r1] + adds r0, r3 + strb r1, [r0] + ldr r0, [r5] + adds r0, r4 + strb r6, [r0] + ldr r0, [r5] + adds r2, r0, r2 + ldrb r1, [r2] + ldr r2, =0x00007fb6 + adds r0, r2 + strb r1, [r0] + ldr r2, [r5] + adds r3, 0x8C + adds r0, r2, r3 + ldrb r1, [r0] + adds r4, 0x8D + adds r0, r2, r4 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bge _08167DEC + adds r3, r1, 0x1 + b _08167DEE + .pool +_08167DEC: + movs r3, 0 +_08167DEE: + ldr r1, =0x00008041 + adds r0, r2, r1 + strb r3, [r0] + ldr r2, =gUnknown_0203BCAC + ldr r3, [r2] + adds r1, r3, r1 + ldrb r1, [r1] + ldr r4, =0x00008040 + adds r0, r3, r4 + ldrb r0, [r0] + subs r0, 0x1 + adds r6, r2, 0 + cmp r1, r0 + bge _08167E1C + adds r1, 0x1 + b _08167E1E + .pool +_08167E1C: + movs r1, 0 +_08167E1E: + ldr r2, =0x00007b4c + adds r0, r3, r2 + strb r1, [r0] + adds r5, r6, 0 + ldr r0, [r5] + ldr r3, =0x00008041 + adds r1, r0, r3 + ldrb r2, [r1] + ldr r4, =0x00008040 + adds r1, r0, r4 + ldrb r1, [r1] + subs r1, 0x1 + eors r2, r1 + negs r1, r2 + orrs r1, r2 + lsrs r4, r1, 31 + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D3520 + mov r2, r8 + cmp r2, 0 + bne _08167E70 + ldr r0, [r5] + ldr r3, =0x00008044 + adds r0, r3 + ldr r1, =sub_8167EA4 + b _08167E90 + .pool +_08167E70: + cmp r4, 0 + bne _08167E88 + ldr r0, [r5] + ldr r4, =0x00008044 + adds r0, r4 + ldr r1, =sub_8167FA4 + b _08167E90 + .pool +_08167E88: + ldr r0, [r6] + ldr r1, =0x00008044 + adds r0, r1 + ldr r1, =sub_8168048 +_08167E90: + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167CA0 + + thumb_func_start sub_8167EA4 +sub_8167EA4: @ 8167EA4 + push {r4-r6,lr} + ldr r4, =gUnknown_0203BCAC + ldr r1, [r4] + ldr r5, =0x00008048 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08167EE4 + cmp r0, 0x1 + bgt _08167EC8 + cmp r0, 0 + beq _08167ED2 + b _08167F9C + .pool +_08167EC8: + cmp r0, 0x2 + beq _08167F08 + cmp r0, 0x3 + beq _08167F48 + b _08167F9C +_08167ED2: + ldr r2, =0x00007fb3 + adds r0, r1, r2 + ldrb r0, [r0] + bl sub_8167608 + b _08167F2C + .pool +_08167EE4: + ldr r6, =0x00007fb3 + adds r0, r1, r6 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_8167BA0 + ldr r1, [r4] + ldr r0, =0x00008048 + adds r1, r0 + b _08167F30 + .pool +_08167F08: + ldr r2, =0x00007c58 + adds r0, r1, r2 + ldr r6, =0x00007b0e + adds r1, r6 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _08167F9C + ldr r1, [r4] + ldr r2, =0x00007b4c + adds r0, r1, r2 + ldrb r0, [r0] + ldr r6, =0x00007fb6 + adds r1, r6 + ldrb r1, [r1] + bl sub_816753C +_08167F2C: + ldr r1, [r4] + adds r1, r5 +_08167F30: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08167F9C + .pool +_08167F48: + ldr r2, =0x00007b1c + adds r0, r1, r2 + bl sub_81D3464 + ldr r3, [r4] + ldr r6, =0x00008041 + adds r0, r3, r6 + ldrb r1, [r0] + ldr r2, =0x00008040 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08167F82 + subs r6, 0x8E + adds r0, r3, r6 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x90 + adds r0, r3, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r6, =0x00007b1c + adds r0, r3, r6 + subs r6, 0xC + adds r1, r3, r6 + ldrb r1, [r1] + bl sub_81D3480 +_08167F82: + ldr r0, [r4] + adds r0, r5 + movs r1, 0 + strb r1, [r0] + movs r0, 0 + b _08167F9E + .pool +_08167F9C: + movs r0, 0x1 +_08167F9E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8167EA4 + + thumb_func_start sub_8167FA4 +sub_8167FA4: @ 8167FA4 + push {r4,r5,lr} + ldr r4, =gUnknown_0203BCAC + ldr r1, [r4] + ldr r5, =0x00008048 + adds r2, r1, r5 + ldrb r0, [r2] + cmp r0, 0x1 + beq _08167FF0 + cmp r0, 0x1 + bgt _08167FC8 + cmp r0, 0 + beq _08167FD2 + b _0816803E + .pool +_08167FC8: + cmp r0, 0x2 + beq _08168014 + cmp r0, 0x3 + beq _08168038 + b _0816803E +_08167FD2: + ldr r2, =0x00007c58 + adds r0, r1, r2 + ldr r2, =0x00007b0e + adds r1, r2 + bl sub_81D31A4 + lsls r0, 24 + cmp r0, 0 + bne _0816803E + b _08168024 + .pool +_08167FF0: + ldr r2, =0x00007fb3 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_8167BA0 + ldr r1, [r4] + ldr r0, =0x00008048 + adds r1, r0 + b _08168028 + .pool +_08168014: + ldr r2, =0x00007b4c + adds r0, r1, r2 + ldrb r0, [r0] + ldr r2, =0x00007fb6 + adds r1, r2 + ldrb r1, [r1] + bl sub_816753C +_08168024: + ldr r1, [r4] + adds r1, r5 +_08168028: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0816803E + .pool +_08168038: + movs r0, 0 + strb r0, [r2] + b _08168040 +_0816803E: + movs r0, 0x1 +_08168040: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8167FA4 + + thumb_func_start sub_8168048 +sub_8168048: @ 8168048 + push {r4-r6,lr} + ldr r4, =gUnknown_0203BCAC + ldr r1, [r4] + ldr r5, =0x00008048 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081680A8 + cmp r0, 0x1 + bgt _0816806C + cmp r0, 0 + beq _08168076 + b _08168160 + .pool +_0816806C: + cmp r0, 0x2 + beq _081680CC + cmp r0, 0x3 + beq _0816810C + b _08168160 +_08168076: + ldr r2, =0x00007c58 + adds r0, r1, r2 + bl sub_81D2074 + ldr r0, [r4] + ldr r6, =0x00007b0e + adds r0, r6 + bl sub_81D3150 + lsls r0, 24 + cmp r0, 0 + bne _08168160 + ldr r0, [r4] + ldr r1, =0x00007fb3 + adds r0, r1 + ldrb r0, [r0] + bl sub_8167608 + b _081680F0 + .pool +_081680A8: + ldr r2, =0x00007fb3 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_8167BA0 + ldr r1, [r4] + ldr r6, =0x00008048 + adds r1, r6 + b _081680F4 + .pool +_081680CC: + ldr r2, =0x00007c58 + adds r0, r1, r2 + ldr r6, =0x00007b0e + adds r1, r6 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _08168160 + ldr r1, [r4] + ldr r2, =0x00007b4c + adds r0, r1, r2 + ldrb r0, [r0] + ldr r6, =0x00007fb6 + adds r1, r6 + ldrb r1, [r1] + bl sub_816753C +_081680F0: + ldr r1, [r4] + adds r1, r5 +_081680F4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08168160 + .pool +_0816810C: + ldr r2, =0x00007b1c + adds r0, r1, r2 + bl sub_81D3464 + ldr r3, [r4] + ldr r6, =0x00008041 + adds r0, r3, r6 + ldrb r1, [r0] + ldr r2, =0x00008040 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08168146 + subs r6, 0x8E + adds r0, r3, r6 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x90 + adds r0, r3, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r6, =0x00007b1c + adds r0, r3, r6 + subs r6, 0xC + adds r1, r3, r6 + ldrb r1, [r1] + bl sub_81D3480 +_08168146: + ldr r0, [r4] + adds r0, r5 + movs r1, 0 + strb r1, [r0] + movs r0, 0 + b _08168162 + .pool +_08168160: + movs r0, 0x1 +_08168162: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8168048 + + thumb_func_start sub_8168168 +sub_8168168: @ 8168168 + ldr r1, =gUnknown_0203BCAC + ldr r1, [r1] + ldr r2, =0x00007b0e + adds r1, r2 + ldrh r1, [r1] + adds r1, 0x26 + strh r1, [r0, 0x20] + bx lr + .pool + thumb_func_end sub_8168168 + + thumb_func_start sub_8168180 +sub_8168180: @ 8168180 + push {lr} + adds r2, r0, 0 + movs r0, 0x2E + ldrsh r1, [r2, r0] + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r3, =0x00008041 + adds r0, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _081681A8 + adds r0, r2, 0 + movs r1, 0 + bl StartSpriteAnim + b _081681B0 + .pool +_081681A8: + adds r0, r2, 0 + movs r1, 0x1 + bl StartSpriteAnim +_081681B0: + pop {r0} + bx r0 + thumb_func_end sub_8168180 + + thumb_func_start sub_81681B4 +sub_81681B4: @ 81681B4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r2, =0x00008041 + adds r1, r0, r2 + ldrb r1, [r1] + subs r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _081681DC + movs r0, 0x65 + b _081681DE + .pool +_081681DC: + movs r0, 0x66 +_081681DE: + bl IndexOfSpritePaletteTag + lsls r0, 4 + ldrb r2, [r4, 0x5] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x5] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81681B4 + + thumb_func_start sub_81681F4 +sub_81681F4: @ 81681F4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x30 + bl GetMonData + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r3, =0x00007fb3 + adds r1, r0, r3 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + subs r3, 0x3 + adds r0, r3 + adds r4, r0, r1 + cmp r2, 0xFF + beq _0816823C + adds r0, r2, 0 + movs r1, 0x1D + bl __udivsi3 + b _0816823E + .pool +_0816823C: + movs r0, 0x9 +_0816823E: + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81681F4 + + thumb_func_start sub_8168248 +sub_8168248: @ 8168248 + push {lr} + sub sp, 0x10 + ldr r0, =gUnknown_085DFDB8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + ldr r0, =gUnknown_08DCCBB8 + str r0, [sp] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + movs r1, 0x80 + lsls r1, 4 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + adds r1, 0x1 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadCompressedObjectPic + add r0, sp, 0x8 + bl LoadSpritePalette + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168248 + + thumb_func_start sub_8168294 +sub_8168294: @ 8168294 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gUnknown_0203BCAC + ldr r0, [r0] + ldr r1, =0x00007b44 + adds r7, r0, r1 + ldr r0, =gUnknown_085DFDA0 + mov r10, r0 + movs r6, 0 + movs r1, 0x40 + mov r9, r1 + movs r0, 0x60 + negs r0, r0 + mov r8, r0 +_081682B6: + mov r5, r9 + muls r5, r6 + mov r0, r8 + adds r1, r0, r5 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x11 + lsls r2, r0, 16 + mov r0, r10 + asrs r2, 16 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _081682FE + ldr r0, =gSprites + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + adds r4, r0 + movs r1, 0x8 + strh r1, [r4, 0x2E] + movs r0, 0x20 + orrs r5, r0 + strh r5, [r4, 0x30] + strh r6, [r4, 0x32] + lsls r1, r6, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartSpriteAnim + lsls r0, r6, 2 + adds r0, r7 + str r4, [r0] +_081682FE: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1 + bls _081682B6 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168294 + + thumb_func_start sub_8168328 +sub_8168328: @ 8168328 + push {r4,r5,lr} + ldr r4, =gUnknown_0203BCAC + ldr r0, [r4] + ldr r5, =0x00008048 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _08168348 + cmp r0, 0x1 + beq _08168360 + b _0816836C + .pool +_08168348: + bl sub_8168248 + ldr r1, [r4] + ldr r0, =0x00008048 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + b _0816836E + .pool +_08168360: + bl sub_8168294 + ldr r0, [r4] + adds r0, r5 + movs r1, 0 + strb r1, [r0] +_0816836C: + movs r0, 0 +_0816836E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8168328 + + thumb_func_start sub_8168374 +sub_8168374: @ 8168374 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + ldrh r1, [r2, 0x2E] + adds r3, r0, r1 + strh r3, [r2, 0x20] + lsls r0, 16 + asrs r4, r0, 16 + movs r0, 0x30 + ldrsh r1, [r2, r0] + cmp r4, r1 + bgt _08168398 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, r1 + bge _081683A0 + cmp r4, r1 + blt _081683A8 +_08168398: + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, r1 + bgt _081683A8 +_081683A0: + ldrh r0, [r2, 0x30] + strh r0, [r2, 0x20] + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] +_081683A8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168374 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_81700F8.s b/asm/rom_81700F8.s index 4c35e747c..45c505cd9 100644 --- a/asm/rom_81700F8.s +++ b/asm/rom_81700F8.s @@ -29,7 +29,7 @@ sub_81700F8: @ 81700F8 bl sub_815355C lsls r0, 16 lsrs r0, 16 - bl InitSaveBlockPointersWithRandomOffset + bl SetSaveBlocksPointers bl sub_808447C bl ResetSaveCounters movs r0, 0 diff --git a/asm/rom_817C95C.s b/asm/rom_817C95C.s index 528c7655a..68963869a 100644 --- a/asm/rom_817C95C.s +++ b/asm/rom_817C95C.s @@ -50,7 +50,7 @@ _0817C988: lsls r0, 24 lsrs r0, 24 mov r9, r0 - ldr r0, =gUnknown_0203ABA8 + ldr r0, =gStringInfo ldr r0, [r0] ldrb r0, [r0, 0x7] bl GetBankSide @@ -107,7 +107,7 @@ _0817CA4C: str r1, [sp, 0xC] ldr r0, =gBankAttacker ldrb r0, [r0] - ldr r1, =gUnknown_0203ABA8 + ldr r1, =gStringInfo ldr r1, [r1] ldrh r1, [r1] bl sub_817F33C @@ -1766,7 +1766,7 @@ _0817DACC: bne _0817DAF0 b _0817E0A6 _0817DAF0: - ldr r0, =gUnknown_0203ABA8 + ldr r0, =gStringInfo ldr r0, [r0] ldrh r0, [r0] cmp r0, 0xAD @@ -4411,7 +4411,7 @@ _0817EFC2: lsls r0, 24 cmp r0, 0 beq _0817F0B4 - ldr r4, =gUnknown_0202428E + ldr r4, =gSideAffecting mov r1, r9 ldrb r0, [r1] bl GetBankIdentity @@ -4443,7 +4443,7 @@ _0817EFC2: mov r6, r9 ldrb r4, [r6] str r4, [sp, 0xC] - bl sub_806957C + bl CalculateBaseDamage adds r3, r0, 0 ldr r4, =gBattleMoveDamage str r3, [r4] @@ -4493,7 +4493,7 @@ _0817F08C: ldrb r1, [r6] mov r3, r9 ldrb r2, [r3] - bl move_effectiveness_something + bl TypeCalc lsls r0, 24 lsrs r1, r0, 24 ldr r0, =gBattleMoveDamage @@ -4606,7 +4606,7 @@ _0817F11A: movs r0, 0x58 adds r4, r3, 0 muls r4, r0 - ldr r5, =gUnknown_02024090 + ldr r5, =gBattleMons + 0xC adds r3, r4, r5 lsls r0, r7, 1 adds r0, r4 diff --git a/asm/rom_818CFC8.s b/asm/rom_818CFC8.s index b78cbccdd..7a703aca4 100644 --- a/asm/rom_818CFC8.s +++ b/asm/rom_818CFC8.s @@ -1277,85604 +1277,4 @@ _0818D9A2: bx r1 .pool thumb_func_end sub_818D97C - - thumb_func_start sub_818D9AC -sub_818D9AC: @ 818D9AC - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_818D9AC - - thumb_func_start sub_818D9C0 -sub_818D9C0: @ 818D9C0 - push {r4,r5,lr} - ldr r5, =0x00004010 - ldr r4, =gUnknown_0860B07E - bl sub_818D9AC - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrh r1, [r0] - adds r0, r5, 0 - bl VarSet - bl sub_818D9AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0818DA20 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =0x00003b58 - adds r1, r0 - ldr r0, =0x00004011 - ldr r2, =gUnknown_0860B074 - ldrb r1, [r1, 0xD] - lsls r1, 1 - adds r1, r2 - ldrh r1, [r1] - bl VarSet - ldr r1, =gScriptResult - movs r0, 0x1 - b _0818DA24 - .pool -_0818DA20: - ldr r1, =gScriptResult - movs r0, 0 -_0818DA24: - strh r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818D9C0 - - thumb_func_start SetLilycoveLady -SetLilycoveLady: @ 818DA30 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r1, [r0, 0xB] - lsls r1, 8 - ldrb r0, [r0, 0xA] - orrs r0, r1 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 17 - adds r1, r0, 0 - cmp r0, 0x1 - beq _0818DA68 - cmp r0, 0x1 - bgt _0818DA5C - cmp r0, 0 - beq _0818DA62 - b _0818DA72 - .pool -_0818DA5C: - cmp r1, 0x2 - beq _0818DA6E - b _0818DA72 -_0818DA62: - bl sub_818DF68 - b _0818DA72 -_0818DA68: - bl sub_818DB7C - b _0818DA72 -_0818DA6E: - bl sub_818E638 -_0818DA72: - pop {r0} - bx r0 - thumb_func_end SetLilycoveLady - - thumb_func_start sub_818DA78 -sub_818DA78: @ 818DA78 - push {lr} - bl sub_818D9AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0818DA9C - cmp r0, 0x1 - bgt _0818DA90 - cmp r0, 0 - beq _0818DA96 - b _0818DAA6 -_0818DA90: - cmp r0, 0x2 - beq _0818DAA2 - b _0818DAA6 -_0818DA96: - bl sub_818E004 - b _0818DAA6 -_0818DA9C: - bl sub_818DBC4 - b _0818DAA6 -_0818DAA2: - bl sub_818E674 -_0818DAA6: - pop {r0} - bx r0 - thumb_func_end sub_818DA78 - - thumb_func_start sub_818DAAC -sub_818DAAC: @ 818DAAC - push {lr} - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - beq _0818DADC - cmp r0, 0x1 - bgt _0818DAD0 - cmp r0, 0 - beq _0818DAD6 - b _0818DAE6 -_0818DAD0: - cmp r1, 0x2 - beq _0818DAE2 - b _0818DAE6 -_0818DAD6: - bl sub_818DF68 - b _0818DAE6 -_0818DADC: - bl sub_818DB7C - b _0818DAE6 -_0818DAE2: - bl sub_818E638 -_0818DAE6: - pop {r0} - bx r0 - thumb_func_end sub_818DAAC - - thumb_func_start sub_818DAEC -sub_818DAEC: @ 818DAEC - push {r4,lr} - ldr r4, =gScriptResult - bl sub_818D9AC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DAEC - - thumb_func_start sub_818DB04 -sub_818DB04: @ 818DB04 - push {lr} - adds r1, r0, 0 - movs r2, 0 - b _0818DB14 -_0818DB0C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r1, 0x2 -_0818DB14: - ldrh r0, [r1] - cmp r0, 0 - bne _0818DB0C - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_818DB04 - - thumb_func_start sub_818DB20 -sub_818DB20: @ 818DB20 - push {r4-r6,lr} - bl Random - ldr r5, =gUnknown_0203CD64 - ldr r4, [r5] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - strb r0, [r4, 0xC] - ldr r6, =gUnknown_0860B2EC - ldr r0, [r5] - ldrb r0, [r0, 0xC] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - bl sub_818DB04 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 24 - ldr r2, [r5] - ldrb r1, [r2, 0xC] - lsls r1, 2 - adds r1, r6 - ldr r1, [r1] - lsrs r0, 23 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2, 0x10] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DB20 - - thumb_func_start sub_818DB7C -sub_818DB7C: @ 818DB7C - push {lr} - ldr r2, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r2] - movs r3, 0 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r2] - strb r3, [r0, 0x1] - ldr r1, [r2] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r0, [r2] - strb r3, [r0, 0x2] - ldr r0, [r2] - strb r3, [r0, 0x3] - ldr r1, [r2] - strh r3, [r1, 0xE] - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r1, 0x12] - bl sub_818DB20 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DB7C - - thumb_func_start sub_818DBC4 -sub_818DBC4: @ 818DBC4 - ldr r3, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r3] - movs r2, 0 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r3] - strb r2, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_818DBC4 - - thumb_func_start sub_818DBE8 -sub_818DBE8: @ 818DBE8 - push {lr} - ldr r1, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0x1] - cmp r0, 0x2 - bne _0818DC0C - movs r0, 0x2 - b _0818DC16 - .pool -_0818DC0C: - cmp r0, 0x1 - beq _0818DC14 - movs r0, 0 - b _0818DC16 -_0818DC14: - movs r0, 0x1 -_0818DC16: - pop {r1} - bx r1 - thumb_func_end sub_818DBE8 - - thumb_func_start sub_818DC1C -sub_818DC1C: @ 818DC1C - lsls r0, 24 - ldr r1, =gUnknown_0860B224 - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - bx lr - .pool - thumb_func_end sub_818DC1C - - thumb_func_start sub_818DC2C -sub_818DC2C: @ 818DC2C - push {r4,lr} - ldr r1, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldr r4, =gStringVar1 - ldrb r0, [r0, 0xC] - bl sub_818DC1C - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DC2C - - thumb_func_start sub_818DC60 -sub_818DC60: @ 818DC60 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r2, =0x00003b58 - adds r0, r1, r2 - str r0, [r5] - ldrb r0, [r0, 0x4] - cmp r0, 0xFF - bne _0818DC84 - movs r0, 0 - b _0818DC9C - .pool -_0818DC84: - ldr r4, =gStringVar3 - ldr r0, =0x00003b5c - adds r1, r0 - adds r0, r4, 0 - bl StringCopy7 - ldr r0, [r5] - ldrb r1, [r0, 0x12] - adds r0, r4, 0 - bl ConvertInternationalString - movs r0, 0x1 -_0818DC9C: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818DC60 - - thumb_func_start sub_818DCAC -sub_818DCAC: @ 818DCAC - push {r4,lr} - adds r4, r0, 0 - lsls r0, r1, 16 - lsrs r0, 16 - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_818DCAC - - thumb_func_start sub_818DCC8 -sub_818DCC8: @ 818DCC8 - push {lr} - ldr r2, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =0x00003b58 - adds r1, r0 - str r1, [r2] - ldr r0, =gStringVar2 - ldrh r1, [r1, 0xE] - bl sub_818DCAC - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DCC8 - - thumb_func_start sub_818DCF4 -sub_818DCF4: @ 818DCF4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0xFF - movs r2, 0x8 - bl memset - adds r0, r4, 0 - adds r1, r5, 0 - bl StringCopy7 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_818DCF4 - - thumb_func_start sub_818DD14 -sub_818DD14: @ 818DD14 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r1, r0, r2 - str r1, [r5] - ldr r1, =0x00003b5c - adds r0, r1 - ldr r4, =gStringVar3 - adds r1, r4, 0 - bl sub_818DCF4 - ldr r0, [r5] - ldrb r1, [r0, 0x12] - adds r0, r4, 0 - bl ConvertInternationalString - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DD14 - - thumb_func_start sub_818DD54 -sub_818DD54: @ 818DD54 - ldr r1, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r1, [r0, 0x2] - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_818DD54 - - thumb_func_start sub_818DD78 -sub_818DD78: @ 818DD78 - push {lr} - bl sub_81AAC50 - pop {r0} - bx r0 - thumb_func_end sub_818DD78 - - thumb_func_start sub_818DD84 -sub_818DD84: @ 818DD84 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r5, r0, 16 - ldr r4, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r4] - ldr r1, =gUnknown_0860B2EC - mov r8, r1 - ldrb r0, [r0, 0xC] - lsls r0, 2 - add r0, r8 - ldr r0, [r0] - bl sub_818DB04 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x1] - ldr r0, =gStringVar2 - adds r1, r5, 0 - bl sub_818DCAC - ldr r1, [r4] - strh r5, [r1, 0xE] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r1, 0x4 - bl sub_818DCF4 - ldr r1, [r4] - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r1, 0x12] - movs r7, 0 - movs r3, 0 - cmp r7, r6 - bcs _0818DE36 - mov r12, r8 -_0818DDDC: - ldr r2, [r4] - ldrb r0, [r2, 0xC] - lsls r0, 2 - add r0, r12 - ldr r1, [r0] - lsls r0, r3, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r5 - bne _0818DE28 - movs r7, 0x1 - ldrb r0, [r2, 0x3] - adds r0, 0x1 - strb r0, [r2, 0x3] - ldr r0, [r4] - strb r7, [r0, 0x2] - ldr r1, [r4] - ldrh r0, [r1, 0x10] - cmp r0, r5 - bne _0818DE36 - movs r0, 0x5 - strb r0, [r1, 0x3] - b _0818DE36 - .pool -_0818DE28: - movs r0, 0 - strb r0, [r2, 0x2] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r6 - bcc _0818DDDC -_0818DE36: - adds r0, r7, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818DD84 - - thumb_func_start sub_818DE44 -sub_818DE44: @ 818DE44 - push {lr} - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl sub_818DD84 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_818DE44 - - thumb_func_start sub_818DE5C -sub_818DE5C: @ 818DE5C - push {lr} - ldr r1, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0x3] - movs r1, 0 - cmp r0, 0x4 - bls _0818DE74 - movs r1, 0x1 -_0818DE74: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_818DE5C - - thumb_func_start sub_818DE88 -sub_818DE88: @ 818DE88 - push {lr} - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =gStringVar2 - bl sub_818DCAC - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DE88 - - thumb_func_start sub_818DEA0 -sub_818DEA0: @ 818DEA0 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r5] - ldr r1, =gUnknown_0860B304 - ldrb r0, [r0, 0xC] - lsls r0, 1 - adds r0, r1 - ldrh r4, [r0] - adds r0, r4, 0 - bl sub_818DE88 - ldr r1, [r5] - movs r0, 0x2 - strb r0, [r1, 0x1] - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818DEA0 - - thumb_func_start sub_818DEDC -sub_818DEDC: @ 818DEDC - push {lr} - bl sub_818DB7C - ldr r0, =gUnknown_0203CD64 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DEDC - - thumb_func_start sub_818DEF4 -sub_818DEF4: @ 818DEF4 - push {lr} - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_818DEF4 - - thumb_func_start sub_818DF00 -sub_818DF00: @ 818DF00 - push {r4-r7,lr} - bl Random - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0xF - ands r4, r0 - movs r3, 0 - ldr r5, =gUnknown_0203CD68 - ldr r1, =gUnknown_0860B1A4 - lsls r0, r4, 2 - adds r6, r0, r1 - adds r7, r5, 0 -_0818DF1A: - ldr r2, [r5] - lsls r1, r3, 1 - adds r2, 0x2 - adds r2, r1 - ldr r0, [r6] - adds r1, r0 - ldrh r0, [r1] - strh r0, [r2] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x8 - bls _0818DF1A - ldr r2, [r7] - ldr r0, =gUnknown_0860B1E4 - lsls r1, r4, 1 - adds r0, r1, r0 - ldrh r0, [r0] - strh r0, [r2, 0x14] - ldr r0, =gUnknown_0860B204 - adds r1, r0 - ldrh r0, [r1] - strh r0, [r2, 0x28] - adds r2, 0x2B - strb r4, [r2] - ldr r1, [r7] - movs r0, 0xFF - strb r0, [r1, 0x18] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DF00 - - thumb_func_start sub_818DF68 -sub_818DF68: @ 818DF68 - push {r4-r6,lr} - ldr r2, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - movs r3, 0 - adds r4, r2, 0 - ldr r6, =gGameLanguage - adds r5, r4, 0 - ldr r0, =0x0000ffff - adds r2, r0, 0 -_0818DF8A: - ldr r1, [r5] - lsls r0, r3, 1 - adds r1, 0x2 - adds r1, r0 - ldrh r0, [r1] - orrs r0, r2 - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x8 - bls _0818DF8A - ldr r0, [r4] - ldr r1, =0x0000ffff - strh r1, [r0, 0x14] - movs r1, 0x1 - negs r1, r1 - strh r1, [r0, 0x16] - movs r3, 0 - adds r5, r4, 0 - movs r2, 0 -_0818DFB4: - ldr r0, [r5] - lsls r1, r3, 1 - adds r0, 0x20 - adds r0, r1 - strh r2, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _0818DFB4 - ldr r0, [r4] - movs r2, 0 - movs r1, 0 - strh r1, [r0, 0x28] - adds r0, 0x2A - strb r2, [r0] - ldr r0, [r4] - adds r0, 0x2C - movs r1, 0x10 - strb r1, [r0] - ldr r0, [r4] - ldrb r1, [r6] - adds r0, 0x2D - strb r1, [r0] - bl sub_818DF00 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DF68 - - thumb_func_start sub_818E004 -sub_818E004: @ 818E004 - ldr r2, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - ldr r0, [r2] - adds r0, 0x2A - strb r1, [r0] - ldr r1, [r2] - ldr r0, =0x0000ffff - strh r0, [r1, 0x16] - bx lr - .pool - thumb_func_end sub_818E004 - - thumb_func_start sub_818E038 -sub_818E038: @ 818E038 - push {lr} - ldr r1, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0x1] - cmp r0, 0x2 - bne _0818E05C - movs r0, 0x2 - b _0818E066 - .pool -_0818E05C: - cmp r0, 0x1 - beq _0818E064 - movs r0, 0 - b _0818E066 -_0818E064: - movs r0, 0x1 -_0818E066: - pop {r1} - bx r1 - thumb_func_end sub_818E038 - - thumb_func_start sub_818E06C -sub_818E06C: @ 818E06C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gSaveBlock1Ptr - ldr r4, [r0] - ldr r0, =0x00003b58 - adds r7, r4, r0 - ldrh r0, [r7, 0x14] - bl sub_811F8D8 - cmp r0, 0 - bne _0818E0EC - ldr r1, =0x00003b83 - adds r0, r4, r1 - ldrb r5, [r0] - ldr r0, =0x00003b5a - adds r0, r4 - mov r8, r0 - adds r1, r4 - mov r10, r1 - ldr r6, =gUnknown_0860B1E4 -_0818E09A: - adds r5, 0x1 - cmp r5, 0xF - ble _0818E0A2 - movs r5, 0 -_0818E0A2: - lsls r4, r5, 1 - adds r0, r4, r6 - ldrh r0, [r0] - bl sub_811F8D8 - cmp r0, 0 - beq _0818E09A - movs r3, 0 - ldr r0, =gUnknown_0860B1E4 - mov r12, r0 - lsls r1, r5, 2 - ldr r0, =gUnknown_0860B204 - mov r9, r0 - ldr r0, =gUnknown_0860B1A4 - adds r6, r1, r0 - mov r2, r8 -_0818E0C2: - lsls r0, r3, 1 - ldr r1, [r6] - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x8 - ble _0818E0C2 - mov r1, r12 - adds r0, r4, r1 - ldrh r0, [r0] - strh r0, [r7, 0x14] - mov r1, r9 - adds r0, r4, r1 - ldrh r0, [r0] - strh r0, [r7, 0x28] - mov r0, r10 - strb r5, [r0] - movs r0, 0xFF - strb r0, [r7, 0x18] -_0818E0EC: - bl sub_818E13C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0818E118 - movs r0, 0x2 - b _0818E12C - .pool -_0818E118: - cmp r0, 0x2 - beq _0818E126 - bl sub_818E1F4 - lsls r0, 24 - cmp r0, 0 - beq _0818E12A -_0818E126: - movs r0, 0x1 - b _0818E12C -_0818E12A: - movs r0, 0 -_0818E12C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818E06C - - thumb_func_start sub_818E13C -sub_818E13C: @ 818E13C - push {r4-r7,lr} - movs r7, 0x1 - ldr r5, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r2, =0x00003b58 - adds r0, r1, r2 - str r0, [r5] - ldrb r0, [r0, 0x18] - cmp r0, 0xFF - bne _0818E174 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085EEB7E - bl StringCopy7 - movs r7, 0 - b _0818E1DC - .pool -_0818E174: - ldr r4, =gStringVar1 - ldr r0, =0x00003b70 - adds r1, r0 - adds r0, r4, 0 - bl StringCopy7 - ldr r0, [r5] - adds r0, 0x2D - ldrb r1, [r0] - adds r0, r4, 0 - bl ConvertInternationalString - ldr r0, [r5] - adds r0, 0x18 - bl sub_818E258 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - bl sub_818E258 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _0818E1DC - ldr r0, [r5] - movs r2, 0 - cmp r2, r4 - bcs _0818E1DC - ldr r1, [r6] - ldrb r0, [r0, 0x18] - ldrb r1, [r1] - cmp r0, r1 - bne _0818E1DA -_0818E1BA: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r4 - bcs _0818E1DC - ldr r0, =gUnknown_0203CD68 - ldr r1, [r0] - adds r1, 0x18 - adds r1, r2 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, r2 - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - beq _0818E1BA -_0818E1DA: - movs r7, 0x2 -_0818E1DC: - adds r0, r7, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818E13C - - thumb_func_start sub_818E1F4 -sub_818E1F4: @ 818E1F4 - push {r4-r6,lr} - ldr r3, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r2, =0x00003b58 - adds r0, r1, r2 - str r0, [r3] - movs r5, 0 - movs r4, 0 - ldr r0, =0x00003b78 - adds r1, r0 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrh r1, [r1] - adds r6, r3, 0 - adds r3, r0, 0 - ldrb r2, [r2, 0xA] - cmp r1, r2 - bne _0818E23A -_0818E21A: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bhi _0818E23C - ldr r1, [r6] - lsls r0, r4, 1 - adds r1, 0x20 - adds r1, r0 - ldr r0, [r3] - adds r0, 0xA - adds r0, r4 - ldrh r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - beq _0818E21A -_0818E23A: - movs r5, 0x1 -_0818E23C: - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818E1F4 - - thumb_func_start sub_818E258 -sub_818E258: @ 818E258 - push {lr} - movs r2, 0 - adds r1, r0, 0 - b _0818E268 -_0818E260: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r1, 0x1 -_0818E268: - ldrb r0, [r1] - cmp r0, 0xFF - bne _0818E260 - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_818E258 - - thumb_func_start sub_818E274 -sub_818E274: @ 818E274 - push {r4,lr} - ldr r4, =gStringVar1 - ldr r0, =gUnknown_0203CD68 - ldr r0, [r0] - ldrh r0, [r0, 0x28] - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E274 - - thumb_func_start sub_818E298 -sub_818E298: @ 818E298 - push {r4,lr} - ldr r4, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r4] - bl sub_818E13C - lsls r0, 24 - cmp r0, 0 - beq _0818E2C0 - movs r0, 0 - b _0818E2CC - .pool -_0818E2C0: - ldr r0, [r4] - ldr r1, =gGameLanguage - ldrb r1, [r1] - adds r0, 0x2D - strb r1, [r0] - movs r0, 0x1 -_0818E2CC: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818E298 - - thumb_func_start sub_818E2D8 -sub_818E2D8: @ 818E2D8 - ldr r2, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x00003b58 - adds r1, r0, r3 - str r1, [r2] - ldr r1, =0x00003b82 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_818E2D8 - - thumb_func_start sub_818E2FC -sub_818E2FC: @ 818E2FC - push {lr} - bl easy_chat_input_maybe - pop {r0} - bx r0 - thumb_func_end sub_818E2FC - - thumb_func_start sub_818E308 -sub_818E308: @ 818E308 - push {r4-r6,lr} - ldr r5, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r5] - ldr r6, =gStringVar1 - ldrh r1, [r0, 0x14] - adds r0, r6, 0 - bl CopyEasyChatWord - ldr r4, =gStringVar2 - ldr r0, [r5] - ldrh r1, [r0, 0x16] - adds r0, r4, 0 - bl CopyEasyChatWord - adds r0, r6, 0 - adds r1, r4, 0 - bl StringCompare - movs r1, 0 - cmp r0, 0 - bne _0818E33C - movs r1, 0x1 -_0818E33C: - adds r0, r1, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818E308 - - thumb_func_start sub_818E358 -sub_818E358: @ 818E358 - ldr r1, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldr r1, =gSpecialVar_0x8005 - ldrh r0, [r0, 0x28] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_818E358 - - thumb_func_start sub_818E37C -sub_818E37C: @ 818E37C - ldr r1, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - movs r1, 0x1 - strb r1, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_818E37C - - thumb_func_start sub_818E39C -sub_818E39C: @ 818E39C - ldr r1, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - movs r1, 0x2 - strb r1, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_818E39C - - thumb_func_start sub_818E3BC -sub_818E3BC: @ 818E3BC - ldr r1, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldr r1, =0x0000ffff - strh r1, [r0, 0x16] - bx lr - .pool - thumb_func_end sub_818E3BC - - thumb_func_start sub_818E3E0 -sub_818E3E0: @ 818E3E0 - push {lr} - bl sub_81AAC70 - pop {r0} - bx r0 - thumb_func_end sub_818E3E0 - - thumb_func_start sub_818E3EC -sub_818E3EC: @ 818E3EC - push {r4,lr} - ldr r4, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r4] - bl sub_818E298 - lsls r0, 24 - cmp r0, 0 - beq _0818E41C - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0x2B - ldrb r1, [r1] - adds r0, 0x2C - b _0818E422 - .pool -_0818E41C: - ldr r0, [r4] - adds r0, 0x2C - movs r1, 0x10 -_0818E422: - strb r1, [r0] - bl sub_818DF00 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_818E3EC - - thumb_func_start sub_818E430 -sub_818E430: @ 818E430 - push {r4,r5,lr} - ldr r1, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - movs r2, 0 - adds r5, r1, 0 - adds r4, r5, 0 - ldr r0, =0x0000ffff - adds r3, r0, 0 -_0818E448: - ldr r1, [r4] - lsls r0, r2, 1 - adds r1, 0x2 - adds r1, r0 - ldrh r0, [r1] - orrs r0, r3 - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x8 - bls _0818E448 - ldr r1, [r5] - ldr r0, =0x0000ffff - strh r0, [r1, 0x14] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E430 - - thumb_func_start sub_818E47C -sub_818E47C: @ 818E47C - push {lr} - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x11 - strh r0, [r1] - bl easy_chat_input_maybe - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E47C - - thumb_func_start sub_818E490 -sub_818E490: @ 818E490 - push {lr} - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - movs r1, 0x1 - bl RemoveBagItem - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E490 - - thumb_func_start sub_818E4A4 -sub_818E4A4: @ 818E4A4 - push {r4-r6,lr} - ldr r2, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r2] - ldr r1, =gUnknown_0203CE7C - ldrh r1, [r1] - strh r1, [r0, 0x28] - movs r3, 0 - adds r4, r2, 0 - ldr r6, =gSaveBlock2Ptr - adds r5, r4, 0 - adds r2, r6, 0 -_0818E4C2: - ldr r1, [r5] - lsls r0, r3, 1 - adds r1, 0x20 - adds r1, r0 - ldr r0, [r2] - adds r0, 0xA - adds r0, r3 - ldrb r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _0818E4C2 - ldr r0, [r4] - adds r0, 0x18 - ldr r1, [r6] - bl StringCopy7 - ldr r0, [r4] - ldr r1, =gGameLanguage - ldrb r1, [r1] - adds r0, 0x2D - strb r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E4A4 - - thumb_func_start sub_818E510 -sub_818E510: @ 818E510 - ldr r2, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x00003b58 - adds r1, r0, r3 - str r1, [r2] - ldr r1, =0x00003b82 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_818E510 - - thumb_func_start sub_818E538 -sub_818E538: @ 818E538 - push {lr} - ldr r2, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =0x00003b58 - adds r1, r0 - str r1, [r2] - ldr r0, =gStringVar3 - ldrh r1, [r1, 0x14] - bl CopyEasyChatWord - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E538 - - thumb_func_start sub_818E564 -sub_818E564: @ 818E564 - push {lr} - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_818E564 - - thumb_func_start sub_818E570 -sub_818E570: @ 818E570 - push {r4-r7,lr} - ldr r2, =gUnknown_0203CD68 - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r4, =0x00003b58 - adds r3, r1, r4 - str r3, [r2] - adds r6, r0, 0 - adds r6, 0x2C - ldrb r4, [r6] - adds r7, r2, 0 - cmp r4, 0xF - bhi _0818E5EC - ldrb r0, [r3] - cmp r0, 0 - bne _0818E5EC - movs r5, 0 - ldr r2, =0x00003b83 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r4, r0 - bne _0818E5E4 - adds r4, r7, 0 -_0818E59E: - bl Random - ldr r2, [r4] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - adds r2, 0x2B - strb r0, [r2] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bhi _0818E5C6 - ldr r0, [r4] - adds r0, 0x2B - ldrb r1, [r6] - ldrb r0, [r0] - cmp r1, r0 - beq _0818E59E -_0818E5C6: - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0x2B - ldrb r0, [r6] - ldr r7, =gUnknown_0203CD68 - ldrb r4, [r2] - cmp r0, r4 - bne _0818E5E4 - ldrb r1, [r2] - adds r3, r1, 0x1 - adds r0, r3, 0 - asrs r0, 4 - lsls r0, 4 - subs r0, r3, r0 - strb r0, [r2] -_0818E5E4: - ldr r0, [r7] - ldrb r1, [r6] - adds r0, 0x2C - strb r1, [r0] -_0818E5EC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E570 - - thumb_func_start sub_818E604 -sub_818E604: @ 818E604 - push {r4,lr} - ldr r4, =gUnknown_0203CD6C - ldr r1, [r4] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r0, [r4] - movs r1, 0 - strb r1, [r0, 0x2] - ldr r0, [r4] - strb r1, [r0, 0x3] - ldr r0, [r4] - strb r1, [r0, 0xC] - bl Random - ldr r4, [r4] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - strb r0, [r4, 0xD] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E604 - - thumb_func_start sub_818E638 -sub_818E638: @ 818E638 - push {r4,lr} - ldr r4, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r4] - movs r2, 0 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r4] - strb r2, [r0, 0x1] - bl sub_818E604 - ldr r1, [r4] - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r1, 0xE] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E638 - - thumb_func_start sub_818E674 -sub_818E674: @ 818E674 - push {lr} - ldr r2, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r2] - movs r3, 0 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r2] - strb r3, [r0, 0x1] - ldr r2, [r2] - ldrb r0, [r2, 0x2] - cmp r0, 0x5 - beq _0818E69A - ldrb r0, [r2, 0x3] - cmp r0, 0x5 - bne _0818E69E -_0818E69A: - bl sub_818E604 -_0818E69E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E674 - - thumb_func_start sub_818E6B0 -sub_818E6B0: @ 818E6B0 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r4, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x00003b58 - adds r1, r0, r3 - str r1, [r4] - ldrb r0, [r1, 0xC] - cmp r0, r2 - bhi _0818E6EA - strb r2, [r1, 0xC] - ldr r0, [r4] - adds r0, 0x4 - movs r1, 0xFF - movs r2, 0x8 - bl memset - ldr r1, [r4] - ldr r0, =gSaveBlock2Ptr - adds r1, 0x4 - ldr r0, [r0] - ldm r0!, {r2,r3} - stm r1!, {r2,r3} - ldr r1, [r4] - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r1, 0xE] -_0818E6EA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E6B0 - - thumb_func_start sub_818E704 -sub_818E704: @ 818E704 - push {r4,r5,lr} - adds r2, r0, 0 - movs r3, 0 - movs r4, 0 - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r5, =0x00003b58 - adds r0, r5 - str r0, [r1] - ldrb r0, [r0, 0xD] - adds r5, r1, 0 - cmp r0, 0x4 - bhi _0818E76A - lsls r0, 2 - ldr r1, =_0818E73C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0818E73C: - .4byte _0818E750 - .4byte _0818E754 - .4byte _0818E758 - .4byte _0818E75C - .4byte _0818E760 -_0818E750: - ldrb r0, [r2, 0x1] - b _0818E762 -_0818E754: - ldrb r0, [r2, 0x2] - b _0818E762 -_0818E758: - ldrb r0, [r2, 0x3] - b _0818E762 -_0818E75C: - ldrb r0, [r2, 0x4] - b _0818E762 -_0818E760: - ldrb r0, [r2, 0x5] -_0818E762: - cmp r0, 0 - beq _0818E76A - adds r3, r0, 0 - movs r4, 0x1 -_0818E76A: - cmp r4, 0x1 - bne _0818E784 - adds r0, r3, 0 - bl sub_818E6B0 - ldr r0, =gUnknown_0203CD6C - ldr r1, [r0] - ldrb r0, [r1, 0x2] - adds r0, 0x1 - strb r0, [r1, 0x2] - b _0818E78C - .pool -_0818E784: - ldr r1, [r5] - ldrb r0, [r1, 0x3] - adds r0, 0x1 - strb r0, [r1, 0x3] -_0818E78C: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_818E704 - - thumb_func_start sub_818E794 -sub_818E794: @ 818E794 - push {r4,r5,lr} - adds r5, r1, 0 - ldr r4, =gUnknown_0203CD6C - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r2, =0x00003b58 - adds r1, r2 - str r1, [r4] - ldr r2, =gUnknown_0860B324 - ldrb r1, [r1, 0xD] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - ldr r1, =gUnknown_0860B310 - ldr r0, [r4] - ldrb r0, [r0, 0xD] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl StringCopy10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E794 - - thumb_func_start sub_818E7E0 -sub_818E7E0: @ 818E7E0 - push {r4,lr} - adds r3, r1, 0 - ldr r2, =gUnknown_0203CD6C - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r4, =0x00003b58 - adds r1, r4 - str r1, [r2] - ldrb r2, [r1, 0xD] - strb r2, [r0] - ldr r2, =gUnknown_0860B310 - ldrb r0, [r1, 0xD] - lsls r0, 2 - adds r0, r2 - ldr r1, [r0] - adds r0, r3, 0 - bl StringCopy - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E7E0 - - thumb_func_start sub_818E81C -sub_818E81C: @ 818E81C - push {r4,lr} - ldr r3, =gUnknown_0203CD6C - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r4, =0x00003b58 - adds r2, r1, r4 - str r2, [r3] - ldr r2, =0x00003b5c - adds r1, r2 - bl StringCopy - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E81C - - thumb_func_start sub_818E848 -sub_818E848: @ 818E848 - ldr r2, =gUnknown_0203CD6C - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r3, =0x00003b58 - adds r1, r3 - str r1, [r2] - ldrb r1, [r1, 0xE] - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_818E848 - - thumb_func_start sub_818E868 -sub_818E868: @ 818E868 - push {lr} - lsls r1, 24 - ldr r2, =gUnknown_0860B338 - lsrs r1, 22 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E868 - - thumb_func_start sub_818E880 -sub_818E880: @ 818E880 - push {lr} - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0x2] - cmp r0, 0x4 - bls _0818E8A4 - movs r0, 0x1 - b _0818E8AE - .pool -_0818E8A4: - cmp r0, 0 - beq _0818E8AC - movs r0, 0 - b _0818E8AE -_0818E8AC: - movs r0, 0x2 -_0818E8AE: - pop {r1} - bx r1 - thumb_func_end sub_818E880 - - thumb_func_start sub_818E8B4 -sub_818E8B4: @ 818E8B4 - push {lr} - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - beq _0818E8D8 - movs r0, 0 - b _0818E8DA - .pool -_0818E8D8: - movs r0, 0x1 -_0818E8DA: - pop {r1} - bx r1 - thumb_func_end sub_818E8B4 - - thumb_func_start sub_818E8E0 -sub_818E8E0: @ 818E8E0 - push {r4,lr} - movs r3, 0 - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r4, =0x00003b58 - adds r2, r0, r4 - str r2, [r1] - ldrb r0, [r2, 0x2] - cmp r0, 0x4 - bhi _0818E8FC - ldrb r0, [r2, 0x3] - cmp r0, 0x4 - bls _0818E8FE -_0818E8FC: - movs r3, 0x1 -_0818E8FE: - adds r0, r3, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818E8E0 - - thumb_func_start sub_818E914 -sub_818E914: @ 818E914 - push {lr} - ldr r0, =gStringVar2 - ldr r1, =gStringVar1 - bl sub_818E794 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E914 - - thumb_func_start sub_818E92C -sub_818E92C: @ 818E92C - push {lr} - ldr r1, =c2_exit_to_overworld_2_switch - movs r0, 0x3 - bl sub_81357FC - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E92C - - thumb_func_start sub_818E940 -sub_818E940: @ 818E940 - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - movs r1, 0x1 - strb r1, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_818E940 - - thumb_func_start sub_818E960 -sub_818E960: @ 818E960 - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldr r2, =gSpecialVar_0x8005 - ldr r1, =gUnknown_0860B34C - ldrb r0, [r0, 0xD] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_818E960 - - thumb_func_start sub_818E990 -sub_818E990: @ 818E990 - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0xD] - bx lr - .pool - thumb_func_end sub_818E990 - - thumb_func_start sub_818E9AC -sub_818E9AC: @ 818E9AC - push {lr} - ldr r1, =gUnknown_0860D090 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E9AC - - thumb_func_start sub_818E9CC -sub_818E9CC: @ 818E9CC - push {r4-r7,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, [r4] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r6, 0 - strb r6, [r0] - ldr r1, [r4] - adds r2, 0xA - adds r0, r1, r2 - strh r6, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r4, [r4] - ldr r0, =0x00000cdc - adds r3, r4, r0 - ldr r2, =gUnknown_0860D0EC - lsls r1, r5, 2 - lsls r0, r7, 3 - adds r1, r0 - adds r1, r2 - ldr r0, [r3] - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _0818EA3E - lsls r0, r5, 1 - lsls r1, r7, 2 - adds r0, r1 - ldr r2, =0x00000d0c - adds r1, r4, r2 - adds r1, r0 - strh r6, [r1] -_0818EA3E: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - ldr r0, =gUnknown_02038BCA - strh r6, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E9CC - - thumb_func_start sub_818EA84 -sub_818EA84: @ 818EA84 - push {r4-r6,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x9 - bls _0818EAA8 - b _0818ED10 -_0818EAA8: - lsls r0, 2 - ldr r1, =_0818EAC8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0818EAC8: - .4byte _0818EAF0 - .4byte _0818EB14 - .4byte _0818EB48 - .4byte _0818EB64 - .4byte _0818EB80 - .4byte _0818EB98 - .4byte _0818EBB4 - .4byte _0818EC40 - .4byte _0818ECD0 - .4byte _0818ECF4 -_0818EAF0: - ldr r3, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r5, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000d0c - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r3] - b _0818ED10 - .pool -_0818EB14: - ldr r4, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r3, =0x00000cdc - adds r2, r3 - ldr r3, =gUnknown_0860D0EC - lsls r0, r5, 2 - lsls r1, r6, 3 - adds r0, r1 - adds r0, r3 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - strh r0, [r4] - b _0818ED10 - .pool -_0818EB48: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 31 - b _0818ECBE - .pool -_0818EB64: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 30 - b _0818ECBE - .pool -_0818EB80: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - b _0818ECBA - .pool -_0818EB98: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 28 - b _0818ECBE - .pool -_0818EBB4: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _0818EC04 - cmp r5, 0 - beq _0818EBE8 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 26 - b _0818ECBE - .pool -_0818EBE8: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 27 - b _0818ECBE - .pool -_0818EC04: - cmp r5, 0 - beq _0818EC24 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - b _0818ECBE - .pool -_0818EC24: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 31 - b _0818ECBE - .pool -_0818EC40: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _0818EC90 - cmp r5, 0 - beq _0818EC74 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsrs r0, 7 - strh r0, [r1] - b _0818ED10 - .pool -_0818EC74: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 25 - b _0818ECBE - .pool -_0818EC90: - cmp r5, 0 - beq _0818ECB0 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 28 - b _0818ECBE - .pool -_0818ECB0: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 -_0818ECBA: - ldrb r0, [r0] - lsls r0, 29 -_0818ECBE: - lsrs r0, 31 - strh r0, [r1] - b _0818ED10 - .pool -_0818ECD0: - bl sub_81B8558 - ldr r2, =gUnknown_0203CEF8 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xCB - lsls r1, 4 - adds r0, r1 - ldrh r1, [r0] - strb r1, [r2] - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r2, 0x1] - b _0818ED10 - .pool -_0818ECF4: - ldr r2, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r3, =0x00000d0a - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 1 - adds r3, 0x1 - adds r1, r3 - ldr r3, =0x0000fffd - adds r0, r3 - ldrb r1, [r1] - adds r0, r1 - strh r0, [r2] -_0818ED10: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818EA84 - - thumb_func_start sub_818ED28 -sub_818ED28: @ 818ED28 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x8 - bls _0818ED4C - b _0818F01E -_0818ED4C: - lsls r0, 2 - ldr r1, =_0818ED6C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0818ED6C: - .4byte _0818ED90 - .4byte _0818EDB4 - .4byte _0818EE10 - .4byte _0818EE34 - .4byte _0818EE5C - .4byte _0818EE78 - .4byte _0818EEA0 - .4byte _0818EF50 - .4byte _0818F008 -_0818ED90: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r0, r4, 1 - lsls r1, r5, 2 - adds r0, r1 - ldr r1, =0x00000d0c - adds r2, r1 - adds r2, r0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - strh r0, [r2] - b _0818F01E - .pool -_0818EDB4: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _0818EDE8 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_0860D0EC - lsls r1, r4, 2 - lsls r0, r5, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - orrs r0, r1 - str r0, [r2] - b _0818F01E - .pool -_0818EDE8: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, =0x00000cdc - adds r2, r1 - ldr r3, =gUnknown_0860D0FC - lsls r1, r4, 2 - lsls r0, r5, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - ands r0, r1 - str r0, [r2] - b _0818F01E - .pool -_0818EE10: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r2, r1 - movs r1, 0x1 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x2 - negs r0, r0 - b _0818EF74 - .pool -_0818EE34: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3] - movs r0, 0x3 - negs r0, r0 - b _0818EFF4 - .pool -_0818EE5C: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r3, r1 - b _0818EFE8 - .pool -_0818EE78: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 - b _0818EFF4 - .pool -_0818EEA0: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1 - bne _0818EF00 - cmp r4, 0 - beq _0818EEDC - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - ands r1, r0 - lsls r1, 5 - ldrb r2, [r3] - movs r0, 0x21 - negs r0, r0 - b _0818EFF4 - .pool -_0818EEDC: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - ands r1, r0 - lsls r1, 4 - ldrb r2, [r3] - movs r0, 0x11 - negs r0, r0 - b _0818EFF4 - .pool -_0818EF00: - cmp r4, 0 - beq _0818EF2C - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3] - movs r0, 0x3 - negs r0, r0 - b _0818EFF4 - .pool -_0818EF2C: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r2, r1 - movs r1, 0x1 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x2 - negs r0, r0 - b _0818EF74 - .pool -_0818EF50: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1 - bne _0818EFB0 - cmp r4, 0 - beq _0818EF8C - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r1, [r0] - ldr r0, =0x00000d08 - adds r2, r0 - lsls r1, 7 - ldrb r3, [r2] - movs r0, 0x7F -_0818EF74: - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - b _0818F01E - .pool -_0818EF8C: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - ands r1, r0 - lsls r1, 6 - ldrb r2, [r3] - movs r0, 0x41 - negs r0, r0 - b _0818EFF4 - .pool -_0818EFB0: - cmp r4, 0 - beq _0818EFDC - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 - b _0818EFF4 - .pool -_0818EFDC: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 -_0818EFE8: - movs r1, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 -_0818EFF4: - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _0818F01E - .pool -_0818F008: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gUnknown_0203CEF8 - ldrb r1, [r0] - ldrb r0, [r0, 0x1] - lsls r0, 8 - orrs r1, r0 - movs r0, 0xCB - lsls r0, 4 - adds r2, r0 - strh r1, [r2] -_0818F01E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818ED28 - - thumb_func_start sub_818F02C -sub_818F02C: @ 818F02C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x3C - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x20 - bl AllocZeroed - str r0, [sp, 0x18] - movs r0, 0x18 - bl AllocZeroed - str r0, [sp, 0x1C] - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - adds r0, 0x1 - ldr r3, =0x00000d0a - adds r1, r3 - strb r0, [r1] - ldr r0, =0x000040ce - bl VarGet - ldr r1, [r4] - adds r0, 0x1 - ldr r5, =0x00000d0b - adds r1, r5 - strb r0, [r1] - ldr r2, [r4] - ldr r7, =0x00000d24 - adds r3, r2, r7 - ldrh r0, [r3] - ldr r5, =0x000003ff - adds r1, r5, 0 - orrs r0, r1 - strh r0, [r3] - ldr r3, =0x00000d25 - adds r2, r3 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r1, [r4] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x19 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x1F - ands r0, r2 - strb r0, [r1] - movs r7, 0 - mov r10, r7 - mov r8, r4 - ldr r0, =gUnknown_02024488 - mov r9, r0 - movs r4, 0 -_0818F0BA: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00000caa - adds r0, r2 - adds r0, r4 - ldrh r0, [r0] - movs r3, 0x64 - muls r0, r3 - add r0, r9 - movs r1, 0xB - movs r2, 0 - bl GetMonData - mov r5, r8 - ldr r1, [r5] - ldr r7, =0x00000d64 - adds r1, r7 - adds r1, r4 - strh r0, [r1] - movs r5, 0 - mov r0, r10 - lsls r7, r0, 4 - adds r6, r7, 0 -_0818F0E8: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00000caa - adds r0, r2 - adds r0, r4 - ldrh r0, [r0] - movs r3, 0x64 - muls r0, r3 - add r0, r9 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - bl GetMonData - mov r2, r8 - ldr r1, [r2] - ldr r3, =0x00000efc - adds r1, r3 - adds r1, r6 - strh r0, [r1] - adds r6, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0818F0E8 - movs r5, 0 - ldr r6, =gSaveBlock2Ptr -_0818F11C: - ldr r0, [r6] - ldr r1, =0x00000caa - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - movs r2, 0x64 - muls r0, r2 - add r0, r9 - adds r1, r5, 0 - adds r1, 0x1A - movs r2, 0 - bl GetMonData - ldr r1, [r6] - adds r2, r5, r7 - ldr r3, =0x00000f04 - adds r1, r3 - adds r1, r2 - strb r0, [r1] - adds r5, 0x1 - cmp r5, 0x5 - ble _0818F11C - mov r5, r8 - ldr r0, [r5] - ldr r1, =0x00000caa - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - movs r2, 0x64 - muls r0, r2 - add r0, r9 - bl GetNature - ldr r1, [r5] - adds r1, r7 - ldr r3, =0x00000f0a - adds r1, r3 - strb r0, [r1] - adds r4, 0x2 - movs r5, 0x1 - add r10, r5 - mov r7, r10 - cmp r7, 0x2 - ble _0818F0BA - mov r10, r5 - movs r0, 0x4 - str r0, [sp, 0x34] - movs r1, 0x6 - str r1, [sp, 0x38] -_0818F17E: - mov r2, r10 - cmp r2, 0x5 - ble _0818F22C -_0818F184: - bl sub_81A39C4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r5, 0x1 - cmp r5, r10 - bge _0818F1CA - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r7, =0x00000d28 - adds r0, r7 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - adds r2, r3, 0 - cmp r0, r4 - beq _0818F1CA - ldr r3, =0x00000d24 -_0818F1B2: - adds r5, 0x1 - cmp r5, r10 - bge _0818F1CA - ldr r0, [r2] - lsls r1, r5, 2 - adds r0, r1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r4 - bne _0818F1B2 -_0818F1CA: - cmp r5, r10 - bne _0818F184 - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r1, [sp, 0x34] - adds r3, r1 - ldr r2, =0x00000d24 - adds r3, r2 - ldr r5, =0x000003ff - adds r0, r5, 0 - adds r2, r4, 0 - ands r2, r0 - ldrh r0, [r3] - ldr r7, =0xfffffc00 - adds r1, r7, 0 - b _0818F292 - .pool -_0818F22C: - bl sub_81A39C4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r5, 0x1 - cmp r5, r10 - bge _0818F274 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000d28 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - adds r2, r1, 0 - cmp r0, r4 - beq _0818F274 - ldr r3, =0x00000d24 -_0818F25C: - adds r5, 0x1 - cmp r5, r10 - bge _0818F274 - ldr r0, [r2] - lsls r1, r5, 2 - adds r0, r1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r4 - bne _0818F25C -_0818F274: - cmp r5, r10 - bne _0818F22C - ldr r5, =gSaveBlock2Ptr - ldr r3, [r5] - ldr r7, [sp, 0x34] - adds r3, r7 - ldr r0, =0x00000d24 - adds r3, r0 - ldr r1, =0x000003ff - adds r0, r1, 0 - adds r2, r4, 0 - ands r2, r0 - ldrh r0, [r3] - ldr r5, =0xfffffc00 - adds r1, r5, 0 -_0818F292: - ands r0, r1 - orrs r0, r2 - strh r0, [r3] - movs r5, 0 - lsls r4, 16 - str r4, [sp, 0x2C] - ldr r7, [sp, 0x38] - str r7, [sp, 0x20] -_0818F2A2: - lsls r0, r5, 1 - mov r9, r0 - adds r1, r5, 0x1 - str r1, [sp, 0x24] - lsls r2, r5, 2 - str r2, [sp, 0x28] -_0818F2AE: - ldr r3, [sp, 0x2C] - lsrs r0, r3, 16 - bl sub_8163524 - lsls r0, 16 - lsrs r6, r0, 16 - movs r7, 0 - cmp r7, r5 - bge _0818F300 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, [sp, 0x8] - mov r8, r1 - ldr r2, [sp, 0xC] - mov r12, r2 - ldr r3, =0x00000d64 - adds r0, r3 - ldr r1, [sp, 0x20] - adds r4, r1, r0 -_0818F2D4: - ldrh r3, [r4] - cmp r3, r6 - beq _0818F300 - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - lsls r0, r6, 4 - adds r2, r0, r1 - ldrh r0, [r2] - cmp r8, r0 - beq _0818F300 - cmp r12, r0 - beq _0818F300 - lsls r0, r3, 4 - adds r0, r1 - ldrb r0, [r0, 0xA] - ldrb r2, [r2, 0xA] - cmp r0, r2 - beq _0818F300 - adds r4, 0x2 - adds r7, 0x1 - cmp r7, r5 - blt _0818F2D4 -_0818F300: - cmp r7, r5 - bne _0818F2AE - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, [sp, 0x38] - add r1, r9 - ldr r5, =0x00000d64 - adds r0, r5 - adds r0, r1 - strh r6, [r0] - ldr r2, [sp, 0x28] - add r2, sp - adds r2, 0x8 - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - lsls r0, r6, 4 - adds r0, r1 - ldrh r0, [r0] - str r0, [r2] - ldr r5, [sp, 0x24] - cmp r5, 0x2 - ble _0818F2A2 - ldr r2, [r3] - ldr r7, [sp, 0x34] - adds r2, r7 - ldr r0, =0x00000d25 - adds r2, r0 - ldrb r0, [r2] - movs r3, 0x5 - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - strb r0, [r2] - ldr r5, =gSaveBlock2Ptr - ldr r2, [r5] - adds r2, r7 - ldr r7, =0x00000d25 - adds r2, r7 - ldrb r0, [r2] - subs r3, 0x14 - adds r1, r3, 0 - ands r0, r1 - strb r0, [r2] - ldr r1, [r5] - ldr r5, [sp, 0x34] - adds r1, r5 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x1F - ands r0, r2 - strb r0, [r1] - adds r5, 0x4 - str r5, [sp, 0x34] - ldr r7, [sp, 0x38] - adds r7, 0x6 - str r7, [sp, 0x38] - movs r0, 0x1 - add r10, r0 - mov r1, r10 - cmp r1, 0xF - bgt _0818F37C - b _0818F17E -_0818F37C: - movs r7, 0 - ldr r2, [sp, 0x18] - strh r7, [r2] - movs r3, 0 - mov r10, r3 - ldr r6, =gBitTable - ldr r5, =gBaseStats -_0818F38A: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - mov r2, r10 - lsls r1, r2, 1 - ldr r3, =0x00000caa - adds r0, r3 - adds r0, r1 - ldrh r0, [r0] - subs r4, r0, 0x1 - movs r0, 0x64 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x3B - movs r2, 0 - bl GetMonData - ldr r2, [sp, 0x18] - ldrh r1, [r2] - adds r1, r0 - strh r1, [r2] - adds r0, r4, 0 - movs r1, 0x3C - movs r2, 0 - bl GetMonData - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - adds r0, r4, 0 - movs r1, 0x3E - movs r2, 0 - bl GetMonData - ldr r2, [sp, 0x18] - ldrh r1, [r2] - adds r1, r0 - strh r1, [r2] - adds r0, r4, 0 - movs r1, 0x3F - movs r2, 0 - bl GetMonData - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - adds r0, r4, 0 - movs r1, 0x3D - movs r2, 0 - bl GetMonData - ldr r2, [sp, 0x18] - ldrh r1, [r2] - adds r1, r0 - strh r1, [r2] - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x6] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - orrs r7, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x7] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - orrs r7, r0 - movs r0, 0x1 - add r10, r0 - mov r1, r10 - cmp r1, 0x2 - ble _0818F38A - movs r4, 0 - movs r1, 0x1 - movs r5, 0x1F -_0818F458: - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _0818F462 - adds r4, 0x1 -_0818F462: - asrs r7, 1 - subs r5, 0x1 - cmp r5, 0 - bge _0818F458 - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - adds r2, r0, 0 - adds r0, r4, 0 - muls r0, r2 - movs r1, 0x14 - bl __divsi3 - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - movs r5, 0x1 - mov r10, r5 - adds r6, r3, 0 - adds r6, 0x2 - movs r7, 0x2 - str r7, [sp, 0x30] -_0818F494: - movs r7, 0 - strh r7, [r6] - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - mov r2, r10 - lsls r1, r2, 2 - adds r0, r1 - ldr r3, =0x00000d24 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - bl sub_8190168 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r0, [sp, 0x30] - mov r9, r0 -_0818F4BC: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - mov r4, r9 - add r4, r10 - adds r4, r5 - lsls r4, 1 - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r4 - ldrh r1, [r0] - ldr r3, =gUnknown_0203BC8C - ldr r0, [r3] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] - ldrb r3, [r1, 0xB] - ldrb r1, [r1, 0xC] - str r1, [sp] - ldr r1, [sp, 0x1C] - str r1, [sp, 0x4] - ldr r1, [sp, 0x14] - mov r2, r8 - bl sub_818F720 - ldr r2, [sp, 0x1C] - ldr r1, [r2, 0x4] - ldrh r0, [r6] - adds r0, r1 - ldr r1, [r2, 0x8] - adds r0, r1 - ldr r1, [r2, 0x10] - adds r0, r1 - ldr r1, [r2, 0x14] - adds r0, r1 - ldr r1, [r2, 0xC] - adds r0, r1 - ldr r1, [r2] - adds r0, r1 - strh r0, [r6] - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, =0x00000d64 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - lsls r0, 4 - adds r0, r1 - ldrh r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r3, =gBaseStats - adds r1, r3 - ldrb r0, [r1, 0x6] - lsls r0, 2 - ldr r2, =gBitTable - adds r0, r2 - ldr r0, [r0] - orrs r7, r0 - ldrb r0, [r1, 0x7] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - orrs r7, r0 - adds r5, 0x1 - cmp r5, 0x2 - ble _0818F4BC - movs r4, 0 - movs r1, 0x1 - movs r5, 0x1F -_0818F54C: - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _0818F556 - adds r4, 0x1 -_0818F556: - asrs r7, 1 - subs r5, 0x1 - cmp r5, 0 - bge _0818F54C - ldr r3, [sp, 0x14] - adds r0, r4, 0 - muls r0, r3 - movs r1, 0x14 - bl __divsi3 - ldrh r1, [r6] - adds r1, r0 - strh r1, [r6] - adds r6, 0x2 - ldr r5, [sp, 0x30] - adds r5, 0x2 - str r5, [sp, 0x30] - movs r7, 0x1 - add r10, r7 - mov r0, r10 - cmp r0, 0xF - ble _0818F494 - movs r1, 0 - mov r10, r1 - ldr r2, =0x000003ff - mov r8, r2 -_0818F58A: - mov r5, r10 - adds r5, 0x1 - adds r7, r5, 0 - cmp r5, 0xF - bgt _0818F626 - mov r3, r10 - lsls r0, r3, 1 - ldr r1, [sp, 0x18] - adds r6, r0, r1 - lsls r0, r5, 1 - adds r4, r0, r1 -_0818F5A0: - ldrh r1, [r6] - ldrh r0, [r4] - cmp r1, r0 - bcc _0818F5C2 - cmp r1, r0 - bne _0818F61E - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r5, 2 - adds r0, r1, r0 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r2, r0, 22 - lsrs r0, r2, 22 - cmp r0, r8 - bne _0818F602 -_0818F5C2: - mov r0, r10 - adds r1, r5, 0 - ldr r2, [sp, 0x18] - bl sub_818F904 - b _0818F600 - .pool -_0818F600: - b _0818F61E -_0818F602: - mov r3, r10 - lsls r0, r3, 2 - adds r0, r1, r0 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - cmp r0, r2 - bls _0818F61E - mov r0, r10 - adds r1, r5, 0 - ldr r2, [sp, 0x18] - bl sub_818F904 -_0818F61E: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0xF - ble _0818F5A0 -_0818F626: - mov r10, r7 - mov r2, r10 - cmp r2, 0xE - ble _0818F58A - bl sub_81A3610 - lsls r0, 24 - cmp r0, 0 - beq _0818F6EE - movs r3, 0 - mov r10, r3 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r4, =0x00000d24 - adds r1, r4 - ldrh r1, [r1] - lsls r1, 22 - lsrs r1, 22 - ldr r3, =0x000003ff - adds r2, r0, 0 - ldr r6, =gUnknown_0860D3F1 - cmp r1, r3 - beq _0818F674 - adds r5, r2, 0 -_0818F656: - movs r7, 0x1 - add r10, r7 - mov r0, r10 - cmp r0, 0xF - bgt _0818F674 - ldr r0, [r5] - mov r7, r10 - lsls r1, r7, 2 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - bne _0818F656 -_0818F674: - mov r1, r10 - lsls r0, r1, 1 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - beq _0818F6AC - movs r5, 0 - ldr r2, [r2] - ldr r3, =0x00000d24 - adds r2, r3 - ldrh r1, [r2] - ldr r0, =0xfffffc00 - ands r0, r1 - ldr r7, =0x000003fe - adds r1, r7, 0 - b _0818F6BE - .pool -_0818F6AC: - movs r5, 0x1 - ldr r2, [r2] - ldr r0, =0x00000d28 - adds r2, r0 - ldrh r1, [r2] - ldr r0, =0xfffffc00 - ands r0, r1 - ldr r3, =0x000003fe - adds r1, r3, 0 -_0818F6BE: - orrs r0, r1 - strh r0, [r2] - movs r7, 0 - mov r10, r7 - lsls r0, r5, 1 - adds r0, r5 - lsls r4, r0, 1 -_0818F6CC: - mov r1, r10 - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_81A4FF0 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000d64 - adds r1, r2 - adds r1, r4 - strh r0, [r1] - adds r4, 0x2 - movs r3, 0x1 - add r10, r3 - mov r5, r10 - cmp r5, 0x2 - ble _0818F6CC -_0818F6EE: - ldr r0, [sp, 0x18] - bl Free - ldr r0, [sp, 0x1C] - bl Free - add sp, 0x3C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F02C - - thumb_func_start sub_818F720 -sub_818F720: @ 818F720 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r7, r1, 0 - mov r9, r2 - ldr r1, [sp, 0x3C] - ldr r2, [sp, 0x40] - mov r8, r2 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r3, 24 - lsrs r5, r3, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x18] - movs r1, 0 - adds r4, r5, 0 - movs r3, 0x1 - movs r2, 0x5 -_0818F74C: - adds r0, r4, 0 - ands r0, r3 - cmp r0, 0 - beq _0818F756 - adds r1, 0x1 -_0818F756: - lsrs r4, 1 - subs r2, 0x1 - cmp r2, 0 - bge _0818F74C - movs r0, 0xFF - lsls r0, 1 - bl __divsi3 - lsls r0, 16 - lsrs r3, r0, 16 - lsls r0, r6, 3 - mov r10, r0 - movs r1, 0 - mov r12, r1 - mov r1, sp - movs r2, 0x5 -_0818F776: - mov r0, r12 - str r0, [r1] - adds r0, r5, 0 - ands r0, r4 - cmp r0, 0 - beq _0818F784 - str r3, [r1] -_0818F784: - lsls r0, r4, 25 - lsrs r4, r0, 24 - adds r1, 0x4 - subs r2, 0x1 - cmp r2, 0 - bge _0818F776 - ldr r0, =0x0000012f - cmp r6, r0 - bne _0818F7A0 - movs r0, 0x1 - b _0818F7CA - .pool -_0818F7A0: - mov r2, r10 - subs r0, r2, r6 - lsls r0, 2 - ldr r1, =gBaseStats - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp] - cmp r0, 0 - bge _0818F7BA - adds r0, 0x3 -_0818F7BA: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r0, r7 - adds r0, 0xA -_0818F7CA: - mov r1, r8 - str r0, [r1] - mov r2, r10 - subs r0, r2, r6 - lsls r0, 2 - ldr r1, =gBaseStats - adds r4, r0, r1 - ldrb r0, [r4, 0x1] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp, 0x4] - cmp r0, 0 - bge _0818F7E8 - adds r0, 0x3 -_0818F7E8: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r0, r8 - str r1, [r0, 0x4] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x1 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0x4] - ldrb r0, [r4, 0x2] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp, 0x8] - cmp r0, 0 - bge _0818F820 - adds r0, 0x3 -_0818F820: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r0, r8 - str r1, [r0, 0x8] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x2 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0x8] - ldrb r0, [r4, 0x3] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp, 0xC] - cmp r0, 0 - bge _0818F858 - adds r0, 0x3 -_0818F858: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r0, r8 - str r1, [r0, 0xC] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x3 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0xC] - ldrb r0, [r4, 0x4] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp, 0x10] - cmp r0, 0 - bge _0818F890 - adds r0, 0x3 -_0818F890: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r0, r8 - str r1, [r0, 0x10] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x4 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0x10] - ldrb r0, [r4, 0x5] - lsls r0, 1 - mov r1, r9 - adds r2, r0, r1 - ldr r0, [sp, 0x14] - cmp r0, 0 - bge _0818F8C8 - adds r0, 0x3 -_0818F8C8: - asrs r0, 2 - adds r0, r2, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r2, r8 - str r1, [r2, 0x14] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x5 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0x14] - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F720 - - thumb_func_start sub_818F904 -sub_818F904: @ 818F904 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r3, r0, 1 - mov r12, r3 - adds r4, r3, r2 - ldrh r5, [r4] - lsls r7, r1, 1 - mov r9, r7 - add r2, r9 - ldrh r3, [r2] - strh r3, [r4] - strh r5, [r2] - ldr r2, =gSaveBlock2Ptr - ldr r5, [r2] - lsls r6, r0, 2 - adds r6, r5, r6 - ldr r3, =0x00000d24 - adds r6, r3 - ldrh r7, [r6] - mov r10, r7 - mov r2, r10 - lsls r2, 22 - mov r8, r2 - lsls r2, r1, 2 - adds r5, r2 - adds r5, r3 - ldrh r4, [r5] - lsls r4, 22 - lsrs r4, 22 - ldr r3, =0xfffffc00 - adds r2, r3, 0 - mov r7, r10 - ands r2, r7 - orrs r2, r4 - strh r2, [r6] - mov r2, r8 - lsrs r2, 22 - mov r8, r2 - ldrh r2, [r5] - ands r3, r2 - mov r7, r8 - orrs r3, r7 - strh r3, [r5] - ldr r2, =gSaveBlock2Ptr - mov r8, r2 - add r12, r0 - add r9, r1 - mov r3, r9 - lsls r4, r3, 1 - mov r7, r12 - lsls r3, r7, 1 - ldr r7, =0x00000d64 - movs r6, 0x2 -_0818F974: - mov r1, r8 - ldr r0, [r1] - adds r0, r7 - adds r2, r0, r3 - ldrh r5, [r2] - adds r0, r4 - ldrh r1, [r0] - strh r1, [r2] - strh r5, [r0] - adds r4, 0x2 - adds r3, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _0818F974 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F904 - - thumb_func_start sub_818F9B0 -sub_818F9B0: @ 818F9B0 - push {lr} - ldr r0, =gStringVar1 - ldr r2, =gUnknown_085CCD20 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r1, r3 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F9B0 - - thumb_func_start sub_818F9E0 -sub_818F9E0: @ 818F9E0 - push {lr} - ldr r0, =gStringVar1 - ldr r2, =gUnknown_085CCD20 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r1, r3 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - ldr r0, =gStringVar2 - ldr r1, =gUnknown_02038BCA - ldrh r1, [r1] - bl sub_8195898 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F9E0 - - thumb_func_start sub_818FA20 -sub_818FA20: @ 818FA20 - push {r4,r5,lr} - ldr r1, =gUnknown_0203CD70 - movs r0, 0 - str r0, [r1] - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - ldr r5, =gUnknown_0203CD74 - str r0, [r5] - adds r4, 0x64 - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - ldr r1, [r5] - adds r1, r0 - str r1, [r5] - bl calc_player_party_count - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - bl sub_8195358 - lsls r0, 16 - lsrs r0, 16 - bl sub_818FBDC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818FA20 - - thumb_func_start sub_818FA74 -sub_818FA74: @ 818FA74 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - adds r5, r2, 0 - str r3, [sp, 0x14] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x28] - lsls r5, 24 - lsrs r5, 24 - add r0, sp, 0xC - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r0, [sp, 0x28] - bl sub_8190168 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - str r6, [sp, 0x2C] - bl sub_8165C40 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x64 - ldr r4, [sp, 0x10] - adds r3, r4, 0 - muls r3, r0 - str r3, [sp, 0x18] - ldr r6, =gEnemyParty - adds r0, r3, r6 - ldr r7, =gSaveBlock2Ptr - ldr r4, [r7] - lsls r5, 1 - ldr r3, [sp, 0x28] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 1 - adds r1, r5, r1 - ldr r6, =0x00000d64 - adds r4, r6 - adds r4, r1 - ldrh r3, [r4] - ldr r7, =gUnknown_0203BC8C - ldr r7, [r7] - mov r8, r7 - lsls r3, 4 - add r3, r8 - ldrh r1, [r3] - ldrb r3, [r3, 0xC] - ldr r6, [sp, 0x2C] - str r6, [sp] - ldrh r4, [r4] - lsls r4, 4 - add r4, r8 - ldrb r4, [r4, 0xB] - str r4, [sp, 0x4] - ldr r7, [sp, 0x14] - str r7, [sp, 0x8] - bl sub_8068634 - add r0, sp, 0xC - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - movs r6, 0 - ldr r2, [sp, 0x18] - str r2, [sp, 0x1C] - mov r10, r5 - ldr r3, =0x00000d64 - mov r9, r3 - ldr r3, =gUnknown_0203BC8C - mov r4, r10 - str r4, [sp, 0x20] -_0818FB18: - ldr r7, =gSaveBlock2Ptr - ldr r1, [r7] - ldr r2, [sp, 0x28] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 1 - mov r8, r0 - mov r5, r10 - add r5, r8 - add r1, r9 - adds r1, r5 - ldrh r0, [r1] - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - lsls r4, r6, 1 - adds r0, 0x2 - adds r0, r4 - ldrh r1, [r0] - lsls r2, r6, 24 - lsrs r2, 24 - mov r12, r2 - ldr r7, [sp, 0x1C] - ldr r2, =gEnemyParty - adds r0, r7, r2 - mov r2, r12 - str r3, [sp, 0x24] - bl sub_80691F4 - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - add r0, r9 - adds r0, r5 - ldrh r0, [r0] - ldr r3, [sp, 0x24] - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - adds r0, 0x2 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0xDA - bne _0818FB74 - movs r1, 0 - add r0, sp, 0xC - strb r1, [r0] -_0818FB74: - adds r6, 0x1 - cmp r6, 0x3 - ble _0818FB18 - movs r0, 0x64 - ldr r1, [sp, 0x10] - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0xC - bl SetMonData - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, [sp, 0x20] - add r1, r8 - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - add sp, 0x30 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818FA74 - - thumb_func_start sub_818FBDC -sub_818FBDC: @ 818FBDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - movs r6, 0 - bl ZeroEnemyPartyMons - mov r0, r8 - bl sub_818FC78 - adds r5, r0, 0 - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r7, r4, 16 - lsls r0, 16 - orrs r7, r0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bls _0818FC46 - movs r4, 0 -_0818FC20: - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _0818FC3C - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r6, 0 - mov r1, r8 - adds r3, r7, 0 - bl sub_818FA74 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0818FC3C: - asrs r5, 1 - adds r4, 0x1 - cmp r4, 0x2 - ble _0818FC20 - b _0818FC6C -_0818FC46: - movs r4, 0x2 -_0818FC48: - movs r0, 0x4 - ands r0, r5 - cmp r0, 0 - beq _0818FC64 - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r6, 0 - mov r1, r8 - adds r3, r7, 0 - bl sub_818FA74 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0818FC64: - lsls r5, 1 - subs r4, 0x1 - cmp r4, 0 - bge _0818FC48 -_0818FC6C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_818FBDC - - thumb_func_start sub_818FC78 -sub_818FC78: @ 818FC78 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl Random - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0818FCA2 - adds r0, r4, 0 - movs r1, 0 - bl sub_818FCBC - cmp r0, 0 - bne _0818FCB6 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_818FDB8 - b _0818FCB6 -_0818FCA2: - adds r0, r5, 0 - movs r1, 0 - bl sub_818FDB8 - cmp r0, 0 - bne _0818FCB6 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_818FCBC -_0818FCB6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_818FC78 - - thumb_func_start sub_818FCBC -sub_818FCBC: @ 818FCBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0xC] - movs r0, 0 - mov r9, r0 - mov r1, r8 - lsls r1, 2 - str r1, [sp, 0x18] -_0818FCDE: - mov r2, r9 - lsls r0, r2, 2 - mov r2, sp - adds r1, r2, r0 - movs r0, 0 - str r0, [r1] - movs r7, 0 - mov r0, r9 - adds r0, 0x1 - str r0, [sp, 0x14] - adds r5, r1, 0 - mov r1, r9 - lsls r1, 1 - str r1, [sp, 0x10] -_0818FCFA: - movs r6, 0 - adds r2, r7, 0x1 - mov r10, r2 -_0818FD00: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, [sp, 0x18] - adds r0, r1, r2 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - ldr r2, =0x000003fe - cmp r0, r2 - bne _0818FD3C - mov r1, r9 - lsls r0, r1, 24 - lsls r1, r7, 24 - lsrs r0, 24 - lsrs r1, 24 - bl sub_81A5060 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - b _0818FD60 - .pool -_0818FD3C: - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 1 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldr r2, =0x00000d64 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - lsls r1, r7, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r4, [r0] -_0818FD60: - movs r0, 0x64 - muls r0, r6 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - bl sub_818FFC0 - ldr r1, [r5] - adds r1, r0 - str r1, [r5] - adds r6, 0x1 - cmp r6, 0x2 - ble _0818FD00 - mov r7, r10 - cmp r7, 0x3 - ble _0818FCFA - ldr r0, [sp, 0x14] - mov r9, r0 - cmp r0, 0x2 - ble _0818FCDE - mov r0, sp - ldr r1, [sp, 0xC] - bl sub_818FEB4 - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818FCBC - - thumb_func_start sub_818FDB8 -sub_818FDB8: @ 818FDB8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0xC] - movs r0, 0 - mov r9, r0 - mov r1, r8 - lsls r1, 2 - str r1, [sp, 0x18] -_0818FDDA: - mov r2, r9 - lsls r0, r2, 2 - mov r2, sp - adds r1, r2, r0 - movs r0, 0 - str r0, [r1] - movs r7, 0 - mov r0, r9 - adds r0, 0x1 - str r0, [sp, 0x14] - adds r5, r1, 0 - mov r1, r9 - lsls r1, 1 - str r1, [sp, 0x10] -_0818FDF6: - movs r6, 0 - adds r2, r7, 0x1 - mov r10, r2 -_0818FDFC: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, [sp, 0x18] - adds r0, r1, r2 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - ldr r2, =0x000003fe - cmp r0, r2 - bne _0818FE38 - mov r1, r9 - lsls r0, r1, 24 - lsls r1, r7, 24 - lsrs r0, 24 - lsrs r1, 24 - bl sub_81A5060 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - b _0818FE5C - .pool -_0818FE38: - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 1 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldr r2, =0x00000d64 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - lsls r1, r7, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r4, [r0] -_0818FE5C: - movs r0, 0x64 - muls r0, r6 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0x1 - bl sub_818FFC0 - ldr r1, [r5] - adds r1, r0 - str r1, [r5] - adds r6, 0x1 - cmp r6, 0x2 - ble _0818FDFC - mov r7, r10 - cmp r7, 0x3 - ble _0818FDF6 - ldr r0, [sp, 0x14] - mov r9, r0 - cmp r0, 0x2 - ble _0818FDDA - mov r0, sp - ldr r1, [sp, 0xC] - bl sub_818FEB4 - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818FDB8 - - thumb_func_start sub_818FEB4 -sub_818FEB4: @ 818FEB4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r10, r0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - str r0, [sp, 0xC] - movs r3, 0x2 - add r0, sp, 0x8 -_0818FECE: - str r3, [r0] - subs r0, 0x4 - subs r3, 0x1 - cmp r3, 0 - bge _0818FECE - mov r3, r10 - ldr r2, [r3] - ldr r0, [r3, 0x4] - cmp r2, r0 - bne _0818FF20 - ldr r0, [r3, 0x8] - cmp r2, r0 - bne _0818FF20 - cmp r1, 0 - beq _0818FFAA - movs r3, 0 - ldr r4, =gBitTable -_0818FEF0: - str r3, [sp, 0x14] - bl Random - movs r1, 0x3 - ands r1, r0 - ldr r3, [sp, 0x14] - cmp r1, 0x3 - beq _0818FF16 - lsls r0, r1, 2 - adds r0, r4 - ldr r1, [r0] - ldr r0, [sp, 0xC] - ands r0, r1 - cmp r0, 0 - bne _0818FF16 - ldr r0, [sp, 0xC] - orrs r0, r1 - str r0, [sp, 0xC] - adds r3, 0x1 -_0818FF16: - cmp r3, 0x2 - bne _0818FEF0 - b _0818FFAA - .pool -_0818FF20: - movs r3, 0 - mov r9, sp - mov r8, r10 -_0818FF26: - adds r2, r3, 0x1 - cmp r2, 0x2 - bgt _0818FF84 - mov r6, r8 - mov r7, r9 - lsls r0, r2, 2 - mov r1, sp - adds r5, r0, r1 - mov r1, r10 - adds r4, r0, r1 -_0818FF3A: - ldr r0, [r6] - ldr r1, [r4] - cmp r0, r1 - bge _0818FF4E - str r1, [r6] - str r0, [r4] - ldr r1, [r7] - ldr r0, [r5] - str r0, [r7] - str r1, [r5] -_0818FF4E: - ldr r1, [r6] - ldr r0, [r4] - cmp r1, r0 - bne _0818FF7A - str r2, [sp, 0x10] - str r3, [sp, 0x14] - bl Random - movs r1, 0x1 - ands r1, r0 - ldr r2, [sp, 0x10] - ldr r3, [sp, 0x14] - cmp r1, 0 - beq _0818FF7A - ldr r1, [r6] - ldr r0, [r4] - str r0, [r6] - str r1, [r4] - ldr r1, [r7] - ldr r0, [r5] - str r0, [r7] - str r1, [r5] -_0818FF7A: - adds r5, 0x4 - adds r4, 0x4 - adds r2, 0x1 - cmp r2, 0x2 - ble _0818FF3A -_0818FF84: - movs r4, 0x4 - add r9, r4 - add r8, r4 - adds r3, 0x1 - cmp r3, 0x1 - ble _0818FF26 - ldr r2, =gBitTable - mov r1, sp - movs r3, 0x1 -_0818FF96: - ldm r1!, {r0} - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ldr r4, [sp, 0xC] - orrs r4, r0 - str r4, [sp, 0xC] - subs r3, 0x1 - cmp r3, 0 - bge _0818FF96 -_0818FFAA: - ldr r0, [sp, 0xC] - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818FEB4 - - thumb_func_start sub_818FFC0 -sub_818FFC0: @ 818FFC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r3, r0, 0 - adds r4, r1, 0 - str r2, [sp] - movs r6, 0 - movs r2, 0x14 - cmp r3, 0 - beq _0818FFF0 - ldr r0, =0x0000ffff - cmp r3, r0 - beq _0818FFF0 - ldr r0, =gBattleMoves - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3, 0x1] - cmp r0, 0 - bne _0818FFFC -_0818FFF0: - movs r0, 0 - b _08190156 - .pool -_0818FFFC: - ldr r1, =gBaseStats - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x6] - mov r10, r1 - ldrb r1, [r0, 0x7] - mov r9, r1 - ldrb r0, [r0, 0x16] - mov r8, r0 - ldrb r3, [r3, 0x2] - str r3, [sp, 0x4] - cmp r0, 0x1A - bne _0819002C - cmp r3, 0x4 - bne _0819002C - ldr r0, [sp] - cmp r0, 0x1 - bne _081900AA - movs r2, 0x8 - b _081900A4 - .pool -_0819002C: - ldr r0, =gUnknown_0831ACE8 - adds r1, r6, r0 - ldrb r0, [r1] - ldr r7, =gUnknown_0831ACE8 - cmp r0, 0xFF - beq _081900A4 - adds r4, r1, 0 -_0819003A: - ldrb r0, [r4] - cmp r0, 0xFE - beq _08190096 - ldrb r0, [r4] - ldr r1, [sp, 0x4] - cmp r0, r1 - bne _08190096 - ldrb r0, [r4, 0x1] - adds r5, r6, 0x1 - cmp r0, r10 - bne _0819006C - adds r1, r6, 0x2 - mov r0, r8 - cmp r0, 0x19 - bne _0819005E - ldrb r0, [r4, 0x2] - cmp r0, 0x28 - bne _0819006C -_0819005E: - adds r0, r1, r7 - ldrb r0, [r0] - muls r0, r2 - movs r1, 0xA - bl __divsi3 - adds r2, r0, 0 -_0819006C: - adds r0, r5, r7 - ldrb r0, [r0] - cmp r0, r9 - bne _08190096 - cmp r10, r9 - beq _08190096 - adds r1, r6, 0x2 - mov r0, r8 - cmp r0, 0x19 - bne _08190088 - adds r0, r1, r7 - ldrb r0, [r0] - cmp r0, 0x28 - bne _08190096 -_08190088: - adds r0, r1, r7 - ldrb r0, [r0] - muls r0, r2 - movs r1, 0xA - bl __divsi3 - adds r2, r0, 0 -_08190096: - adds r4, 0x3 - adds r6, 0x3 - ldr r1, =gUnknown_0831ACE8 - adds r0, r6, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0819003A -_081900A4: - ldr r0, [sp] - cmp r0, 0x1 - beq _081900E0 -_081900AA: - ldr r1, [sp] - cmp r1, 0x1 - bgt _081900BC - cmp r1, 0 - beq _081900C4 - b _08190154 - .pool -_081900BC: - ldr r0, [sp] - cmp r0, 0x2 - beq _08190114 - b _08190154 -_081900C4: - cmp r2, 0xA - beq _08190146 - cmp r2, 0xA - ble _08190146 - cmp r2, 0x28 - beq _0819014A - cmp r2, 0x28 - bgt _081900DA - cmp r2, 0x14 - beq _08190104 - b _08190146 -_081900DA: - cmp r2, 0x50 - bne _08190146 - b _08190100 -_081900E0: - cmp r2, 0xA - beq _08190104 - cmp r2, 0xA - bgt _081900F2 - cmp r2, 0 - beq _08190100 - cmp r2, 0x5 - beq _0819014A - b _08190146 -_081900F2: - cmp r2, 0x28 - beq _08190108 - cmp r2, 0x28 - ble _08190146 - cmp r2, 0x50 - beq _0819010E - b _08190146 -_08190100: - movs r2, 0x8 - b _08190154 -_08190104: - movs r2, 0x2 - b _08190154 -_08190108: - movs r2, 0x2 - negs r2, r2 - b _08190154 -_0819010E: - movs r2, 0x4 - negs r2, r2 - b _08190154 -_08190114: - cmp r2, 0xA - beq _08190146 - cmp r2, 0xA - bgt _08190126 - cmp r2, 0 - beq _0819013A - cmp r2, 0x5 - beq _08190140 - b _08190146 -_08190126: - cmp r2, 0x28 - beq _0819014E - cmp r2, 0x28 - bgt _08190134 - cmp r2, 0x14 - beq _0819014A - b _08190146 -_08190134: - cmp r2, 0x50 - beq _08190152 - b _08190146 -_0819013A: - movs r2, 0x10 - negs r2, r2 - b _08190154 -_08190140: - movs r2, 0x8 - negs r2, r2 - b _08190154 -_08190146: - movs r2, 0 - b _08190154 -_0819014A: - movs r2, 0x4 - b _08190154 -_0819014E: - movs r2, 0xC - b _08190154 -_08190152: - movs r2, 0x14 -_08190154: - adds r0, r2, 0 -_08190156: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818FFC0 - - thumb_func_start sub_8190168 -sub_8190168: @ 8190168 - push {lr} - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - cmp r0, 0x63 - bls _0819019A - movs r1, 0x6 - cmp r0, 0x77 - bls _0819019A - movs r1, 0x9 - cmp r0, 0x8B - bls _0819019A - movs r1, 0xC - cmp r0, 0x9F - bls _0819019A - movs r1, 0xF - cmp r0, 0xB3 - bls _0819019A - movs r1, 0x12 - cmp r0, 0xC7 - bls _0819019A - movs r1, 0x1F - cmp r0, 0xDB - bhi _0819019A - movs r1, 0x15 -_0819019A: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_8190168 - - thumb_func_start sub_81901A0 -sub_81901A0: @ 81901A0 - push {r4-r7,lr} - adds r3, r0, 0 - adds r2, r1, 0 - movs r5, 0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r4, =0x00000d24 - adds r1, r4 - ldrh r1, [r1] - lsls r1, 22 - lsrs r1, 22 - mov r12, r0 - ldr r6, =gUnknown_0860D10C - cmp r1, r2 - beq _081901D8 - mov r7, r12 -_081901C0: - adds r5, 0x1 - cmp r5, 0xF - bgt _081901D8 - ldr r0, [r7] - lsls r1, r5, 2 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r2 - bne _081901C0 -_081901D8: - cmp r3, 0 - beq _0819026C - cmp r3, 0x3 - bne _081901FC - lsls r0, r5, 2 - adds r1, r0, 0x3 - adds r1, r6 - ldrb r1, [r1] - adds r4, r1, 0 - adds r4, 0x8 - b _08190206 - .pool -_081901FC: - lsls r0, r5, 2 - adds r1, r3, r0 - adds r1, r6 - ldrb r1, [r1] - adds r4, r1, 0x4 -_08190206: - adds r0, r3, r0 - adds r0, r6 - ldrb r2, [r0] - cmp r2, r4 - bge _08190256 - ldr r1, =gUnknown_0860D14C - adds r0, r2, r1 - ldrb r3, [r0] - adds r6, r1, 0 - cmp r3, r5 - beq _08190234 - mov r1, r12 - ldr r0, [r1] - lsls r1, r3, 2 - adds r0, r1 - ldr r3, =0x00000d25 - adds r0, r3 - b _0819024E - .pool -_08190234: - adds r2, 0x1 - cmp r2, r4 - bge _08190256 - adds r0, r2, r6 - ldrb r1, [r0] - cmp r1, r5 - beq _08190234 - mov r3, r12 - ldr r0, [r3] - lsls r1, 2 - adds r0, r1 - ldr r1, =0x00000d25 - adds r0, r1 -_0819024E: - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08190234 -_08190256: - cmp r2, r4 - beq _08190286 - ldr r0, =gUnknown_0860D14C - adds r0, r2, r0 - ldrb r0, [r0] - b _08190292 - .pool -_0819026C: - mov r3, r12 - ldr r1, [r3] - lsls r0, r5, 2 - adds r0, r6 - ldrb r2, [r0] - lsls r0, r2, 2 - adds r1, r0 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - bge _08190290 -_08190286: - movs r0, 0xFF - b _08190292 - .pool -_08190290: - adds r0, r2, 0 -_08190292: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81901A0 - - thumb_func_start sub_8190298 -sub_8190298: @ 8190298 - push {lr} - bl sub_81902AC - ldr r1, =gUnknown_02038BCA - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190298 - - thumb_func_start sub_81902AC -sub_81902AC: @ 81902AC - push {r4,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r1, =0x00000cb2 - adds r0, r4, r1 - ldrh r0, [r0] - ldr r1, =0x000003ff - bl sub_81901A0 - lsls r0, 2 - adds r4, r0 - ldr r0, =0x00000d24 - adds r4, r0 - ldrh r0, [r4] - lsls r0, 22 - lsrs r0, 22 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81902AC - - thumb_func_start sub_81902E4 -sub_81902E4: @ 81902E4 - push {lr} - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - movs r1, 0 - bl sub_8162614 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81902E4 - - thumb_func_start sub_81902F8 -sub_81902F8: @ 81902F8 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81902F8 - - thumb_func_start sub_819033C -sub_819033C: @ 819033C - push {r4,r5,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r4, [r0] - lsls r4, 30 - lsrs r4, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - ldr r1, [r5] - lsls r4, 1 - lsrs r0, 22 - adds r4, r0 - ldr r3, =0x00000d0c - adds r1, r3 - adds r1, r4 - ldrh r0, [r1] - ldr r2, =0x000003e6 - cmp r0, r2 - bhi _0819036E - adds r0, 0x1 - strh r0, [r1] -_0819036E: - ldr r0, [r5] - ldr r1, =0x00000d1c - adds r0, r1 - adds r1, r0, r4 - ldrh r0, [r1] - cmp r0, r2 - bhi _08190380 - adds r0, 0x1 - strh r0, [r1] -_08190380: - ldr r0, [r5] - adds r1, r0, r3 - adds r1, r4 - ldr r2, =0x00000d14 - adds r0, r2 - adds r0, r4 - ldrh r1, [r1] - ldrh r2, [r0] - cmp r1, r2 - bls _08190396 - strh r1, [r0] -_08190396: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819033C - - thumb_func_start sub_81903B8 -sub_81903B8: @ 81903B8 - push {r4,r5,lr} - ldr r0, =sub_8190400 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gTasks - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r5, 0 - strh r5, [r4, 0x8] - bl sub_81902AC - lsls r0, 16 - lsrs r0, 16 - bl sub_8195358 - strh r0, [r4, 0xA] - strh r5, [r4, 0xC] - strh r5, [r4, 0xE] - ldr r0, =sub_8194B54 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81903B8 - - thumb_func_start sub_8190400 -sub_8190400: @ 8190400 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r10 - lsls r0, 3 - adds r6, r0, r1 - movs r0, 0xA - ldrsh r5, [r6, r0] - movs r2, 0xC - ldrsh r1, [r6, r2] - mov r9, r1 - movs r0, 0xE - ldrsh r7, [r6, r0] - movs r1, 0x8 - ldrsh r4, [r6, r1] - cmp r4, 0x1 - beq _08190508 - cmp r4, 0x1 - bgt _08190440 - cmp r4, 0 - beq _0819044E - b _08190772 - .pool -_08190440: - cmp r4, 0x2 - bne _08190446 - b _08190570 -_08190446: - cmp r4, 0x3 - bne _0819044C - b _08190634 -_0819044C: - b _08190772 -_0819044E: - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0x1 - bl EnableInterrupts - str r4, [sp, 0x4] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x4 - bl CpuSet - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0860CE84 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_0860CEB4 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r0, =gUnknown_02022E14 - strh r4, [r0] - ldr r0, =gUnknown_02022E16 - strh r4, [r0] - ldr r0, =gUnknown_02022E18 - strh r4, [r0] - ldr r0, =gUnknown_02022E1A - strh r4, [r0] - ldr r0, =gUnknown_02022E20 - strh r4, [r0] - ldr r0, =gUnknown_02022E22 - strh r4, [r0] - mov r2, r9 - cmp r2, 0x2 - bne _081904DC - ldr r0, =gUnknown_02022E1C - strh r4, [r0] - ldr r0, =gUnknown_02022E1E - strh r4, [r0] - b _081904E6 - .pool -_081904DC: - ldr r0, =gUnknown_02022E1C - strh r4, [r0] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] -_081904E6: - ldr r0, =gTasks - mov r2, r10 - lsls r1, r2, 2 - add r1, r10 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _08190772 - .pool -_08190508: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x3F - bl SetGpuReg - bl ResetPaletteFade - bl ResetSpriteData - bl FreeAllSpritePalettes - ldr r1, =gReservedSpritePaletteCount - movs r0, 0x4 - strb r0, [r1] - b _08190602 - .pool -_08190570: - ldr r1, =gUnknown_08D83D50 - movs r5, 0x80 - lsls r5, 6 - movs r7, 0 - str r7, [sp] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D84970 - movs r4, 0x1 - str r4, [sp] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D84F00 - movs r2, 0x80 - lsls r2, 4 - str r4, [sp] - movs r0, 0x3 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r0, =gUnknown_0860CF50 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08D85358 - movs r4, 0x80 - lsls r4, 2 - movs r1, 0 - adds r2, r4, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85444 - movs r1, 0x80 - lsls r1, 1 - adds r2, r4, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85600 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadCompressedPalette - mov r0, r9 - cmp r0, 0x2 - bne _081905DE - ldr r0, =gUnknown_08D854C8 - movs r1, 0x50 - movs r2, 0x20 - bl LoadCompressedPalette -_081905DE: - str r7, [sp, 0x8] - add r0, sp, 0x8 - ldr r1, =gPlttBufferFaded - ldr r2, =0x05000100 - bl CpuSet - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg -_08190602: - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _08190772 - .pool -_08190634: - ldr r0, =sub_8194B70 - bl SetVBlankCallback - ldr r4, =gUnknown_0203CD78 - movs r0, 0x14 - bl AllocZeroed - str r0, [r4] - movs r6, 0 - lsls r5, 24 - movs r2, 0xFF -_0819064A: - ldr r1, [r4] - adds r1, r6 - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0xF - ble _0819064A - bl sub_80D2F04 - ldr r0, =sub_8190CD4 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - strh r1, [r0, 0xC] - mov r1, r9 - strh r1, [r0, 0xE] - strh r7, [r0, 0x10] - mov r2, r9 - cmp r2, 0x2 - bne _081906A8 - lsrs r1, r5, 24 - movs r0, 0 - bl sub_819314C - ldr r0, =gUnknown_0203CD78 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x10] - b _081906B0 - .pool -_081906A8: - lsrs r1, r5, 24 - movs r0, 0 - bl sub_81924E0 -_081906B0: - movs r1, 0xFA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - mov r0, r9 - cmp r0, 0 - beq _0819076C - ldr r5, =gUnknown_0860D068 - adds r0, r5, 0 - movs r1, 0x78 - movs r2, 0x4 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - ldr r1, =gSprites - mov r8, r1 - add r4, r8 - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnim - strh r6, [r4, 0x2E] - adds r0, r5, 0 - movs r1, 0x78 - movs r2, 0x9C - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAnim - strh r6, [r4, 0x2E] - ldr r5, =gUnknown_0860D050 - adds r0, r5, 0 - movs r1, 0x6 - movs r2, 0x50 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - mov r2, r8 - adds r4, r0, r2 - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnim - strh r6, [r4, 0x2E] - movs r0, 0 - strh r0, [r4, 0x30] - mov r1, r9 - cmp r1, 0x1 - bne _08190746 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08190746: - adds r0, r5, 0 - movs r1, 0xEA - movs r2, 0x50 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAnim - strh r6, [r4, 0x2E] - movs r0, 0x1 - strh r0, [r4, 0x30] -_0819076C: - mov r0, r10 - bl DestroyTask -_08190772: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190400 - - thumb_func_start sub_8190790 -sub_8190790: @ 8190790 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x22] - adds r1, r0, 0x4 - strh r1, [r2, 0x22] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _081907D4 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - blt _081907BC - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_081907BC: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - bne _081907F0 - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] - b _081907F0 - .pool -_081907D4: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xBF - ble _081907F0 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r3, 0x32 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrh r0, [r2, 0x34] - bl sub_818D8F0 -_081907F0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190790 - - thumb_func_start sub_81907F8 -sub_81907F8: @ 81907F8 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x22] - subs r1, r0, 0x4 - strh r1, [r2, 0x22] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _08190838 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xC0 - bgt _08190820 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_08190820: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - bne _08190858 - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] - b _08190858 - .pool -_08190838: - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bgt _08190858 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r3, 0x32 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrh r0, [r2, 0x34] - bl sub_818D8F0 -_08190858: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81907F8 - - thumb_func_start sub_8190860 -sub_8190860: @ 8190860 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x20] - adds r1, r0, 0x4 - strh r1, [r2, 0x20] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _081908A4 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - blt _0819088C - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_0819088C: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _081908C0 - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] - b _081908C0 - .pool -_081908A4: - lsls r1, 16 - ldr r0, =0x010f0000 - cmp r1, r0 - ble _081908C0 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r3, 0x32 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrh r0, [r2, 0x34] - bl sub_818D8F0 -_081908C0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190860 - - thumb_func_start sub_81908CC -sub_81908CC: @ 81908CC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x20] - subs r1, r0, 0x4 - strh r1, [r2, 0x20] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _08190910 - lsls r1, 16 - movs r0, 0x88 - lsls r0, 17 - cmp r1, r0 - bgt _081908F6 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_081908F6: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _08190930 - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] - b _08190930 - .pool -_08190910: - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bgt _08190930 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r3, 0x32 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrh r0, [r2, 0x34] - bl sub_818D8F0 -_08190930: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81908CC - - thumb_func_start sub_8190938 -sub_8190938: @ 8190938 - push {lr} - adds r1, r0, 0 - movs r2, 0x34 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0819094A - adds r0, r1, 0 - bl sub_80D30DC -_0819094A: - pop {r0} - bx r0 - thumb_func_end sub_8190938 - - thumb_func_start sub_8190950 -sub_8190950: @ 8190950 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08190962 - adds r0, r4, 0 - bl sub_80D30DC -_08190962: - ldrh r0, [r4, 0x22] - adds r1, r0, 0x4 - strh r1, [r4, 0x22] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _081909A4 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - blt _0819098A - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0819098A: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - bne _081909C0 - ldr r0, =sub_8190938 - str r0, [r4, 0x1C] - b _081909C0 - .pool -_081909A4: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xAF - ble _081909C0 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - adds r0, r4, 0 - bl sub_80D2EF8 -_081909C0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190950 - - thumb_func_start sub_81909CC -sub_81909CC: @ 81909CC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081909DE - adds r0, r4, 0 - bl sub_80D30DC -_081909DE: - ldrh r0, [r4, 0x22] - subs r1, r0, 0x4 - strh r1, [r4, 0x22] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08190A1C - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xB0 - bgt _08190A02 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08190A02: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - bne _08190A3C - ldr r0, =sub_8190938 - str r0, [r4, 0x1C] - b _08190A3C - .pool -_08190A1C: - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bgt _08190A3C - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - adds r0, r4, 0 - bl sub_80D2EF8 -_08190A3C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81909CC - - thumb_func_start sub_8190A48 -sub_8190A48: @ 8190A48 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08190A5A - adds r0, r4, 0 - bl sub_80D30DC -_08190A5A: - ldrh r0, [r4, 0x20] - adds r1, r0, 0x4 - strh r1, [r4, 0x20] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08190A9C - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - blt _08190A82 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08190A82: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _08190AB8 - ldr r0, =sub_8190938 - str r0, [r4, 0x1C] - b _08190AB8 - .pool -_08190A9C: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _08190AB8 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - adds r0, r4, 0 - bl sub_80D2EF8 -_08190AB8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190A48 - - thumb_func_start sub_8190AC4 -sub_8190AC4: @ 8190AC4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08190AD6 - adds r0, r4, 0 - bl sub_80D30DC -_08190AD6: - ldrh r0, [r4, 0x20] - subs r1, r0, 0x4 - strh r1, [r4, 0x20] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08190B14 - lsls r1, 16 - movs r0, 0x80 - lsls r0, 17 - cmp r1, r0 - bgt _08190AFC - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08190AFC: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _08190B34 - ldr r0, =sub_8190938 - str r0, [r4, 0x1C] - b _08190B34 - .pool -_08190B14: - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bgt _08190B34 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - adds r0, r4, 0 - bl sub_80D2EF8 -_08190B34: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190AC4 - - thumb_func_start sub_8190B40 -sub_8190B40: @ 8190B40 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r3, r0, 0 - movs r0, 0x2E - ldrsh r6, [r3, r0] - ldr r2, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r2 - movs r7, 0x10 - ldrsh r1, [r4, r7] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0xA - ldrsh r0, [r0, r1] - ldr r1, =gUnknown_0860D080 - adds r0, r1 - ldrb r0, [r0] - mov r10, r0 - ldr r1, =gSaveBlock2Ptr - ldr r5, [r1] - ldr r7, =0x00000cb2 - adds r0, r5, r7 - ldrh r0, [r0] - mov r12, r0 - movs r7, 0xE - ldrsh r0, [r4, r7] - mov r9, r2 - mov r8, r1 - cmp r0, 0x1 - bne _08190C0C - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _08190BFC - mov r2, r10 - lsls r0, r2, 2 - adds r1, r5, r0 - ldr r7, =0x00000d25 - adds r1, r7 - ldrb r2, [r1] - lsls r1, r2, 29 - adds r4, r0, 0 - cmp r1, 0 - bge _08190BB6 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r1, [r0, 0x10] - subs r1, 0x1 - lsls r0, r2, 27 - lsrs r0, 30 - cmp r1, r0 - blt _08190C32 -_08190BB6: - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08190BD4 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - subs r0, 0x1 - cmp r0, r12 - blt _08190C32 -_08190BD4: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - add r0, r9 - movs r7, 0x8 - ldrsh r0, [r0, r7] - b _08190C4C - .pool -_08190BFC: - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _08190C32 - b _08190C48 - .pool -_08190C0C: - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _08190C28 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bls _08190C32 - movs r7, 0x8 - ldrsh r0, [r4, r7] - b _08190C4C - .pool -_08190C28: - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _08190C48 -_08190C32: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - b _08190C5C - .pool -_08190C48: - movs r1, 0x8 - ldrsh r0, [r4, r1] -_08190C4C: - cmp r0, 0x2 - bne _08190C5C - adds r0, r3, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08190C5C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8190B40 - - thumb_func_start sub_8190C6C -sub_8190C6C: @ 8190C6C - push {lr} - adds r3, r0, 0 - movs r0, 0x2E - ldrsh r1, [r3, r0] - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r1, r0, r2 - movs r2, 0xE - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _08190C9C - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _08190CA6 - b _08190CC0 - .pool -_08190C9C: - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - beq _08190CC0 -_08190CA6: - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0x2 - bne _08190CCE - adds r0, r3, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _08190CCE - .pool -_08190CC0: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08190CCE: - pop {r0} - bx r0 - thumb_func_end sub_8190C6C - - thumb_func_start sub_8190CD4 -sub_8190CD4: @ 8190CD4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r3, 0xE - ldrsh r2, [r0, r3] - mov r9, r2 - movs r4, 0x10 - ldrsh r7, [r0, r4] - movs r5, 0x8 - ldrsh r0, [r0, r5] - cmp r0, 0x8 - bls _08190D06 - bl _08192202 -_08190D06: - lsls r0, 2 - ldr r1, =_08190D18 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08190D18: - .4byte _08190D3C - .4byte _08190D7C - .4byte _08190DA8 - .4byte _08190E48 - .4byte _08191FF8 - .4byte _08192038 - .4byte _08192078 - .4byte _081920BC - .4byte _08192106 -_08190D3C: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08190D50 - bl _08192202 -_08190D50: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r1, =gTasks - mov r6, r8 - lsls r0, r6, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - bl _08192202 - .pool -_08190D7C: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08190D8C - bl _08192202 -_08190D8C: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - ldr r2, =gTasks - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x8] - bl _08192202 - .pool -_08190DA8: - mov r0, r8 - bl sub_819221C - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x8 - bgt _08190DBE - cmp r6, 0x1 - bge _08190DF0 - bl _08192202 -_08190DBE: - cmp r6, 0x9 - beq _08190DC6 - bl _08192202 -_08190DC6: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - strh r1, [r0, 0x8] - bl _08192202 - .pool -_08190DF0: - ldr r1, =gTasks - mov r4, r8 - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x12] - movs r5, 0xC - ldrsh r0, [r0, r5] - movs r1, 0 - mov r9, r2 - cmp r0, 0 - beq _08190E0C - movs r1, 0x9 -_08190E0C: - adds r6, r1, 0 - adds r0, r6, 0 - adds r0, 0x9 - cmp r6, r0 - bge _08190E32 - adds r5, r0, 0 -_08190E18: - lsls r4, r6, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r6, 0x1 - cmp r6, r5 - blt _08190E18 -_08190E32: - ldr r0, =gTasks - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x3 - strh r0, [r1, 0x8] - bl _08192202 - .pool -_08190E48: - mov r6, r8 - lsls r1, r6, 2 - adds r0, r1, r6 - lsls r0, 3 - ldr r2, =gTasks - adds r0, r2 - movs r3, 0x12 - ldrsh r6, [r0, r3] - subs r0, r6, 0x1 - mov r9, r1 - cmp r0, 0x7 - bls _08190E64 - bl _08192202 -_08190E64: - lsls r0, 2 - ldr r1, =_08190E78 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08190E78: - .4byte _08190E98 - .4byte _08191234 - .4byte _081915CC - .4byte _08191B08 - .4byte _08190E98 - .4byte _08191234 - .4byte _0819187C - .4byte _08191D68 -_08190E98: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08190ED4 - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r0, =gUnknown_02022E18 - strh r1, [r0] - ldr r1, =gUnknown_02022E1A - movs r0, 0xA0 - strh r0, [r1] - b _08190EE6 - .pool -_08190ED4: - ldr r0, =gUnknown_02022E14 - strh r2, [r0] - ldr r1, =gUnknown_02022E16 - movs r0, 0xA0 - strh r0, [r1] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_08190EE6: - cmp r6, 0x1 - bne _08190F9C - ldr r5, =gUnknown_0203CD78 - ldr r0, [r5] - ldrb r1, [r0, 0x10] - cmp r1, 0 - bne _08190F50 - ldr r0, =gUnknown_02022E1C - strh r1, [r0] - ldr r1, =gUnknown_02022E1E - movs r6, 0xA0 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r1] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r4, 0xA - ldrsh r1, [r0, r4] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x10 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - b _08191084 - .pool -_08190F50: - ldr r1, =gUnknown_02022E1C - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E1E - movs r4, 0 - strh r4, [r0] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r6, 0xA - ldrsh r1, [r0, r6] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x10 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - ldr r0, [r5] - strb r4, [r0, 0x10] - b _08191084 - .pool -_08190F9C: - ldr r6, =gUnknown_0203CD78 - ldr r1, [r6] - ldrb r5, [r1, 0x10] - cmp r5, 0 - bne _08190FF8 - ldr r4, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - movs r2, 0xA - ldrsh r0, [r0, r2] - adds r2, r0, 0 - subs r2, 0x10 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, 0x11 - bl sub_8192F08 - ldr r0, =gUnknown_02022E1C - strh r5, [r0] - ldr r1, =gUnknown_02022E1E - movs r3, 0xA0 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r2, [r6] - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r4 - ldrb r1, [r0, 0xC] - movs r0, 0x10 - orrs r0, r1 - ldrb r1, [r2, 0x11] - bl sub_81924E0 - b _08191084 - .pool -_08190FF8: - cmp r5, 0x2 - bne _0819104C - ldr r4, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - movs r5, 0xA - ldrsh r0, [r0, r5] - adds r2, r0, 0 - subs r2, 0x10 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, 0x11 - bl sub_8192F08 - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r2, [r6] - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r4 - ldrb r1, [r0, 0xC] - movs r0, 0x10 - orrs r0, r1 - ldrb r1, [r2, 0x12] - bl sub_81924E0 - b _08191084 - .pool -_0819104C: - ldr r1, =gUnknown_02022E1C - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r4, 0xA - ldrsh r0, [r0, r4] - adds r2, r0, 0 - subs r2, 0x10 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x10 - orrs r0, r1 - lsls r1, r2, 24 - lsrs r1, 24 - bl sub_819314C -_08191084: - movs r6, 0 - ldr r5, =gUnknown_0203CD78 - mov r10, r5 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_0819109E: - cmp r6, 0x1 - bgt _0819110C - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191150 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190790 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191150 - .pool -_0819110C: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191150 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190950 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191150: - adds r6, 0x1 - cmp r6, 0x7 - ble _0819109E - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_0819116E: - cmp r6, 0x9 - bgt _081911D4 - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191214 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190790 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191214 - .pool -_081911D4: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191214 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190950 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191214: - adds r6, 0x1 - cmp r6, 0xF - ble _0819116E - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x4 - bl _08191FE8 - .pool -_08191234: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08191278 - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r0, =gUnknown_02022E18 - strh r1, [r0] - ldr r1, =gUnknown_02022E1A - ldr r2, =0x0000ff60 - adds r0, r2, 0 - strh r0, [r1] - b _0819128C - .pool -_08191278: - ldr r0, =gUnknown_02022E14 - strh r2, [r0] - ldr r1, =gUnknown_02022E16 - ldr r3, =0x0000ff60 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_0819128C: - cmp r6, 0x2 - bne _0819133C - ldr r5, =gUnknown_0203CD78 - ldr r0, [r5] - ldrb r1, [r0, 0x10] - cmp r1, 0 - bne _081912F4 - ldr r0, =gUnknown_02022E1C - strh r1, [r0] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r4, 0xA - ldrsh r1, [r0, r4] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x4 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - b _0819141C - .pool -_081912F4: - ldr r0, =gUnknown_02022E1C - movs r4, 0 - strh r4, [r0] - ldr r0, =gUnknown_02022E1E - strh r4, [r0] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r6, 0xA - ldrsh r1, [r0, r6] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x4 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - ldr r0, [r5] - strb r4, [r0, 0x10] - b _0819141C - .pool -_0819133C: - ldr r6, =gUnknown_0203CD78 - ldr r1, [r6] - ldrb r5, [r1, 0x10] - cmp r5, 0 - bne _08191394 - ldr r4, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - movs r2, 0xA - ldrsh r0, [r0, r2] - adds r2, r0, 0 - subs r2, 0x10 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, 0x11 - bl sub_8192F08 - ldr r0, =gUnknown_02022E1C - strh r5, [r0] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r2, [r6] - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r4 - ldrb r1, [r0, 0xC] - movs r0, 0x4 - orrs r0, r1 - ldrb r1, [r2, 0x11] - bl sub_81924E0 - b _0819141C - .pool -_08191394: - cmp r5, 0x2 - bne _081913E4 - ldr r4, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - movs r3, 0xA - ldrsh r0, [r0, r3] - adds r2, r0, 0 - subs r2, 0x10 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, 0x11 - bl sub_8192F08 - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r2, [r6] - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r4 - ldrb r1, [r0, 0xC] - movs r0, 0x4 - orrs r0, r1 - ldrb r1, [r2, 0x12] - bl sub_81924E0 - b _0819141C - .pool -_081913E4: - ldr r1, =gUnknown_02022E1C - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0 - strh r0, [r1] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r5, 0xA - ldrsh r0, [r0, r5] - adds r2, r0, 0 - subs r2, 0x10 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x4 - orrs r0, r1 - lsls r1, r2, 24 - lsrs r1, 24 - bl sub_819314C -_0819141C: - movs r6, 0 - ldr r0, =gUnknown_0203CD78 - mov r10, r0 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_08191436: - cmp r6, 0x1 - bgt _081914A4 - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _081914E8 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_81907F8 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _081914E8 - .pool -_081914A4: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _081914E8 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_81909CC - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_081914E8: - adds r6, 0x1 - cmp r6, 0x7 - ble _08191436 - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_08191506: - cmp r6, 0x9 - bgt _0819156C - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _081915AC - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81907F8 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _081915AC - .pool -_0819156C: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _081915AC - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81909CC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_081915AC: - adds r6, 0x1 - cmp r6, 0xF - ble _08191506 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x5 - bl _08191FE8 - .pool -_081915CC: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _0819160C - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r2, =gUnknown_02022E18 - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _08191622 - .pool -_0819160C: - ldr r1, =gUnknown_02022E14 - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E16 - strh r2, [r0] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_08191622: - ldr r0, =gUnknown_0203CD78 - ldr r4, [r0] - ldrb r0, [r4, 0x10] - cmp r0, 0 - bne _08191688 - ldr r1, =gUnknown_02022E1C - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r5, 0xA - ldrsh r1, [r0, r5] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x8 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - b _081916C6 - .pool -_08191688: - ldr r1, =gUnknown_02022E1C - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0 - strh r0, [r1] - ldr r3, =gUnknown_0860D15C - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r5, 0xA - ldrsh r1, [r0, r5] - lsls r1, 2 - subs r1, 0x1 - ldrb r4, [r4, 0x10] - adds r1, r4 - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x8 - orrs r0, r2 - ldrb r1, [r1] - bl sub_819314C -_081916C6: - movs r6, 0 - ldr r0, =gUnknown_0203CD78 - mov r10, r0 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_081916E0: - cmp r6, 0x1 - bgt _08191754 - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191798 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190860 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191798 - .pool -_08191754: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191798 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190A48 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191798: - adds r6, 0x1 - cmp r6, 0x7 - ble _081916E0 - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_081917B6: - cmp r6, 0x9 - bgt _0819181C - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _0819185C - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190860 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _0819185C - .pool -_0819181C: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _0819185C - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190A48 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_0819185C: - adds r6, 0x1 - cmp r6, 0xF - ble _081917B6 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x6 - b _08191FE8 - .pool -_0819187C: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _081918BC - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r2, =gUnknown_02022E18 - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _081918D2 - .pool -_081918BC: - ldr r1, =gUnknown_02022E14 - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E16 - strh r2, [r0] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_081918D2: - ldr r0, =gUnknown_0203CD78 - ldr r2, [r0] - ldrb r0, [r2, 0x10] - cmp r0, 0 - bne _08191924 - ldr r1, =gUnknown_02022E1C - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x8 - orrs r0, r1 - ldrb r1, [r2, 0x11] - bl sub_81924E0 - b _08191958 - .pool -_08191924: - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r5, 0xA - ldrsh r0, [r0, r5] - adds r2, r0, 0 - subs r2, 0x10 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x8 - orrs r0, r1 - lsls r1, r2, 24 - lsrs r1, 24 - bl sub_819314C -_08191958: - movs r6, 0 - ldr r0, =gUnknown_0203CD78 - mov r10, r0 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_08191972: - cmp r6, 0x1 - bgt _081919E0 - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191A24 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190860 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191A24 - .pool -_081919E0: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191A24 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190A48 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191A24: - adds r6, 0x1 - cmp r6, 0x7 - ble _08191972 - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_08191A42: - cmp r6, 0x9 - bgt _08191AA8 - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191AE8 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190860 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191AE8 - .pool -_08191AA8: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191AE8 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190A48 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191AE8: - adds r6, 0x1 - cmp r6, 0xF - ble _08191A42 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x6 - b _08191FE8 - .pool -_08191B08: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08191B48 - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r2, =gUnknown_02022E18 - movs r6, 0xFF - lsls r6, 8 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _08191B5E - .pool -_08191B48: - ldr r1, =gUnknown_02022E14 - movs r3, 0xFF - lsls r3, 8 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E16 - strh r2, [r0] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_08191B5E: - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bne _08191B94 - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - b _08191B9E - .pool -_08191B94: - ldr r0, =gUnknown_02022E1C - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E1E - strh r1, [r0] -_08191B9E: - ldr r4, =gUnknown_0860D15C - ldr r5, =gUnknown_0203CD78 - ldr r3, [r5] - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r6, 0xA - ldrsh r1, [r0, r6] - lsls r1, 2 - subs r1, 0x1 - ldrb r3, [r3, 0x10] - adds r1, r3 - adds r1, r4 - mov r4, r9 - add r4, r8 - lsls r4, 3 - adds r4, r2 - ldrb r2, [r4, 0xC] - movs r0, 0x2 - orrs r0, r2 - ldrb r1, [r1] - bl sub_819314C - movs r6, 0 - ldr r7, =gSprites - mov r12, r6 - mov r10, r5 - adds r5, r7, 0 - adds r5, 0x1C -_08191BDC: - cmp r6, 0x1 - bgt _08191C50 - mov r1, r10 - ldr r0, [r1] - adds r3, r0, r6 - ldrb r0, [r3] - cmp r0, 0xFF - beq _08191C96 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =sub_81908CC - str r1, [r0] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r4, 0xC] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0, 0x2E] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r12 - strh r2, [r0, 0x30] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r6, [r0, 0x32] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r1, [r0, 0x34] - b _08191C96 - .pool -_08191C50: - mov r3, r10 - ldr r0, [r3] - adds r3, r0, r6 - ldrb r0, [r3] - cmp r0, 0xFF - beq _08191C96 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =sub_8190AC4 - str r1, [r0] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r4, 0xC] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0, 0x2E] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r6, [r0, 0x32] -_08191C96: - adds r6, 0x1 - cmp r6, 0x7 - ble _08191BDC - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_08191CB4: - cmp r6, 0x9 - bgt _08191D1C - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191D5C - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81908CC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191D5C - .pool -_08191D1C: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191D5C - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190AC4 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191D5C: - adds r6, 0x1 - cmp r6, 0xF - ble _08191CB4 - b _08191FDA - .pool -_08191D68: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08191DA8 - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r2, =gUnknown_02022E18 - movs r6, 0xFF - lsls r6, 8 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _08191DBE - .pool -_08191DA8: - ldr r1, =gUnknown_02022E14 - movs r3, 0xFF - lsls r3, 8 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E16 - strh r2, [r0] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_08191DBE: - ldr r0, =gUnknown_0203CD78 - ldr r2, [r0] - ldrb r0, [r2, 0x10] - cmp r0, 0x2 - bne _08191E10 - ldr r1, =gUnknown_02022E1C - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x2 - orrs r0, r1 - ldrb r1, [r2, 0x12] - bl sub_81924E0 - b _08191E44 - .pool -_08191E10: - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r5, 0xA - ldrsh r0, [r0, r5] - adds r2, r0, 0 - subs r2, 0x10 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x2 - orrs r0, r1 - lsls r1, r2, 24 - lsrs r1, 24 - bl sub_819314C -_08191E44: - movs r6, 0 - ldr r0, =gUnknown_0203CD78 - mov r10, r0 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_08191E5E: - cmp r6, 0x1 - bgt _08191ECC - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191F10 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_81908CC - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191F10 - .pool -_08191ECC: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191F10 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190AC4 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191F10: - adds r6, 0x1 - cmp r6, 0x7 - ble _08191E5E - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_08191F2E: - cmp r6, 0x9 - bgt _08191F94 - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191FD4 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81908CC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191FD4 - .pool -_08191F94: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191FD4 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190AC4 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191FD4: - adds r6, 0x1 - cmp r6, 0xF - ble _08191F2E -_08191FDA: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x7 -_08191FE8: - strh r1, [r0, 0x8] - strh r2, [r0, 0x12] - b _08192202 - .pool -_08191FF8: - mov r4, r8 - lsls r0, r4, 2 - add r0, r8 - lsls r0, 3 - ldr r5, =gTasks - adds r1, r0, r5 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x29 - beq _08192100 - ldr r1, =gUnknown_02022E16 - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1A - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - b _081920A4 - .pool -_08192038: - mov r6, r8 - lsls r0, r6, 2 - add r0, r8 - lsls r0, 3 - ldr r2, =gTasks - adds r1, r0, r2 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x29 - beq _08192100 - ldr r1, =gUnknown_02022E16 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1A - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - b _081920E8 - .pool -_08192078: - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r1, r0, r4 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x41 - beq _08192100 - ldr r1, =gUnknown_02022E14 - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E18 - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1C -_081920A4: - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - b _08192202 - .pool -_081920BC: - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - ldr r6, =gTasks - adds r1, r0, r6 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x41 - beq _08192100 - ldr r1, =gUnknown_02022E14 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E18 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1C -_081920E8: - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - b _08192202 - .pool -_08192100: - movs r0, 0x2 - strh r0, [r1, 0x8] - b _08192202 -_08192106: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08192202 - movs r6, 0 - ldr r4, =gUnknown_0203CD78 -_08192116: - cmp r6, 0x1 - bgt _08192134 - ldr r0, [r4] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0819214E - bl sub_818D8F0 - b _0819214E - .pool -_08192134: - ldr r0, [r4] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0819214E - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl sub_80D2EF8 -_0819214E: - adds r6, 0x1 - cmp r6, 0x7 - ble _08192116 - movs r6, 0x8 - ldr r4, =gUnknown_0203CD78 -_08192158: - cmp r6, 0x9 - bgt _08192174 - ldr r0, [r4] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0819218E - bl sub_818D8F0 - b _0819218E - .pool -_08192174: - ldr r0, [r4] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0819218E - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl sub_80D2EF8 -_0819218E: - adds r6, 0x1 - cmp r6, 0xF - ble _08192158 - bl sub_80D2F9C - ldr r4, =gUnknown_0203CD78 - ldr r0, [r4] - bl Free - movs r5, 0 - str r5, [r4] - bl FreeAllWindowBuffers - mov r0, r9 - cmp r0, 0 - bne _081921C4 - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - b _081921FC - .pool -_081921C4: - ldr r0, =sub_8194220 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - strh r5, [r1, 0xA] - movs r0, 0x3 - strh r0, [r1, 0xC] - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0x10] - strh r0, [r1, 0xE] - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0x14] - strh r0, [r1, 0x10] -_081921FC: - mov r0, r8 - bl DestroyTask -_08192202: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190CD4 - - thumb_func_start sub_819221C -sub_819221C: @ 819221C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r7, 0 - ldr r2, =gTasks - lsls r0, 2 - add r0, r9 - lsls r0, 3 - adds r0, r2 - mov r12, r0 - movs r1, 0x10 - ldrsh r6, [r0, r1] - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r2 - movs r3, 0xA - ldrsh r5, [r0, r3] - ldr r0, =gUnknown_0860D080 - adds r0, r5, r0 - ldrb r0, [r0] - mov r10, r0 - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - mov r8, r0 - ldr r1, =gMain - ldrh r4, [r1, 0x2E] - movs r0, 0x3 - ands r0, r4 - adds r2, r1, 0 - cmp r0, 0 - beq _0819226E - movs r7, 0x9 -_0819226E: - mov r3, r12 - movs r1, 0xE - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _0819227A - b _081924CC -_0819227A: - cmp r0, 0x1 - beq _08192280 - b _081923B0 -_08192280: - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - beq _081922BA - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _081922BA - cmp r5, 0 - bne _081922B4 - movs r5, 0xF - b _081922B6 - .pool -_081922B4: - subs r5, 0x1 -_081922B6: - movs r7, 0x1 - b _08192360 -_081922BA: - ldrh r1, [r2, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081922E2 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _081922E2 - cmp r5, 0xF - bne _081922DC - movs r5, 0 - b _081922DE - .pool -_081922DC: - adds r5, 0x1 -_081922DE: - movs r7, 0x2 - b _08192360 -_081922E2: - ldrh r1, [r2, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08192304 - ldr r0, =gUnknown_0203CD78 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _08192304 - subs r0, 0x1 - strb r0, [r1, 0x10] - movs r7, 0x3 - b _08192360 - .pool -_08192304: - ldrh r1, [r2, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08192360 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - mov r3, r10 - lsls r1, r3, 2 - adds r0, r1 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r3, [r0] - lsls r0, r3, 29 - mov r12, r1 - cmp r0, 0 - bge _0819233C - ldr r0, =gUnknown_0203CD78 - ldr r2, [r0] - ldrb r4, [r2, 0x10] - subs r1, r4, 0x1 - lsls r0, r3, 27 - lsrs r0, 30 - cmp r1, r0 - bge _0819233C - adds r0, r4, 0x1 - strb r0, [r2, 0x10] - movs r7, 0x4 -_0819233C: - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - add r0, r12 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08192360 - ldr r0, =gUnknown_0203CD78 - ldr r3, [r0] - ldrb r1, [r3, 0x10] - subs r0, r1, 0x1 - cmp r0, r8 - bge _08192360 - adds r0, r1, 0x1 - strb r0, [r3, 0x10] - movs r7, 0x4 -_08192360: - cmp r7, 0x9 - beq _08192366 - b _081924A0 -_08192366: - ldr r0, =gUnknown_0203CD78 - ldr r3, [r0] - ldrb r0, [r3, 0x10] - cmp r0, 0 - beq _081923A0 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r2, =gTasks - adds r1, r2 - ldr r2, =gUnknown_0860D1A0 - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r0, 1 - lsls r0, 2 - subs r0, 0x1 - ldrb r3, [r3, 0x10] - adds r0, r3 - b _08192482 - .pool -_081923A0: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - b _0819249E - .pool -_081923B0: - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - beq _081923DE - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bne _081923DE - cmp r5, 0x10 - bne _081923D8 - ldr r0, =gUnknown_0860D19C - add r0, r8 - ldrb r5, [r0] - b _081923DA - .pool -_081923D8: - subs r5, 0x1 -_081923DA: - movs r7, 0x5 - b _08192446 -_081923DE: - ldrh r1, [r2, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819240E - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bne _0819240E - ldr r0, =gUnknown_0860D19C - add r0, r8 - ldrb r0, [r0] - cmp r5, r0 - bne _08192408 - movs r5, 0x10 - b _0819240A - .pool -_08192408: - adds r5, 0x1 -_0819240A: - movs r7, 0x6 - b _08192446 -_0819240E: - ldrh r1, [r2, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819242C - ldr r0, =gUnknown_0203CD78 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _0819242C - movs r7, 0x7 - subs r0, 0x1 - b _08192444 - .pool -_0819242C: - ldrh r1, [r2, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08192446 - ldr r0, =gUnknown_0203CD78 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0x1 - bhi _08192446 - movs r7, 0x8 - adds r0, 0x1 -_08192444: - strb r0, [r1, 0x10] -_08192446: - cmp r7, 0x9 - bne _081924A0 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r1, [r0, 0x10] - cmp r1, 0 - bne _08192470 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r2, =gTasks - adds r1, r2 - ldr r2, =gUnknown_0860D1C0 - ldrb r0, [r0, 0x11] - b _08192482 - .pool -_08192470: - cmp r1, 0x2 - bne _08192494 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r3, =gTasks - adds r1, r3 - ldr r2, =gUnknown_0860D1C0 - ldrb r0, [r0, 0x12] -_08192482: - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1, 0xA] - b _081924A0 - .pool -_08192494: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 -_0819249E: - strh r5, [r0, 0xA] -_081924A0: - cmp r7, 0 - beq _081924CC - cmp r7, 0x9 - beq _081924CC - movs r0, 0x5 - bl PlaySE - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0xA] - mov r2, r9 - lsls r0, r2, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0xC] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0, 0xC] -_081924CC: - adds r0, r7, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_819221C - - thumb_func_start sub_81924E0 -sub_81924E0: @ 81924E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x58 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x20] - movs r5, 0 - movs r0, 0 - str r0, [sp, 0x28] - movs r1, 0 - str r1, [sp, 0x2C] - movs r2, 0 - str r2, [sp, 0x30] - movs r4, 0 - movs r0, 0x24 - bl AllocZeroed - mov r8, r0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r3, [sp, 0x20] - lsls r0, r3, 2 - adds r0, r1, r0 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - str r0, [sp, 0x24] - movs r0, 0x1 - ldr r3, [sp, 0x1C] - ands r0, r3 - cmp r0, 0 - beq _08192538 - movs r5, 0x8 - movs r4, 0x9 - str r4, [sp, 0x28] - movs r4, 0x2 -_08192538: - movs r0, 0x2 - ldr r2, [sp, 0x1C] - ands r0, r2 - cmp r0, 0 - beq _08192548 - movs r3, 0x80 - lsls r3, 1 - str r3, [sp, 0x2C] -_08192548: - movs r0, 0x4 - ldr r2, [sp, 0x1C] - ands r0, r2 - cmp r0, 0 - beq _08192556 - movs r3, 0xA0 - str r3, [sp, 0x30] -_08192556: - movs r0, 0x8 - ldr r2, [sp, 0x1C] - ands r0, r2 - cmp r0, 0 - beq _08192564 - ldr r3, =0xffffff00 - str r3, [sp, 0x2C] -_08192564: - movs r0, 0x10 - ldr r2, [sp, 0x1C] - ands r0, r2 - cmp r0, 0 - beq _08192574 - movs r3, 0xA0 - negs r3, r3 - str r3, [sp, 0x30] -_08192574: - ldr r0, =0x000003ff - ldr r2, [sp, 0x24] - cmp r2, r0 - bne _08192598 - ldrb r0, [r1, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r0, 16 - b _081925B6 - .pool -_08192598: - ldr r0, =0x000003fe - ldr r3, [sp, 0x24] - cmp r3, r0 - bne _081925AC - bl sub_8195910 - b _081925B2 - .pool -_081925AC: - ldr r0, [sp, 0x24] - bl sub_8162AA0 -_081925B2: - lsls r0, 24 - lsrs r0, 24 -_081925B6: - ldr r2, [sp, 0x2C] - adds r2, 0x30 - ldr r3, [sp, 0x30] - adds r3, 0x40 - adds r1, r4, 0 - adds r1, 0xC - str r1, [sp] - ldr r1, =0x0000ffff - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D8AC - ldr r1, =gUnknown_0203CD78 - ldr r1, [r1] - adds r1, r5 - strb r0, [r1] - movs r0, 0x1E - ldr r4, [sp, 0x1C] - ands r0, r4 - cmp r0, 0 - beq _081925FC - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_081925FC: - movs r7, 0 - ldr r0, [sp, 0x20] - lsls r0, 1 - str r0, [sp, 0x3C] - adds r1, r5, 0x2 - ldr r2, [sp, 0x28] - lsls r2, 24 - str r2, [sp, 0x44] - ldr r3, [sp, 0x28] - adds r3, 0x4 - str r3, [sp, 0x40] - ldr r4, [sp, 0x20] - adds r0, r4 - ldr r6, =gUnknown_0203CD78 - ldr r2, =gSprites - mov r10, r2 - adds r4, r1, 0 - lsls r5, r0, 1 - movs r3, 0 - mov r9, r3 -_08192624: - ldr r0, =0x000003ff - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192660 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =gUnknown_0860D340 - adds r1, r7, r1 - ldrb r2, [r1] - ldr r3, [sp, 0x2C] - orrs r2, r3 - b _081926B0 - .pool -_08192660: - ldr r0, =0x000003fe - ldr r3, [sp, 0x24] - cmp r3, r0 - bne _08192690 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000d64 - adds r0, r1 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =gUnknown_0860D340 - adds r1, r7, r1 - ldrb r2, [r1] - ldr r3, [sp, 0x2C] - orrs r2, r3 - b _081926B0 - .pool -_08192690: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d64 - adds r0, r3 - adds r0, r5 - ldrh r1, [r0] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0860D340 - adds r1, r7, r1 - ldrb r2, [r1] - ldr r1, [sp, 0x2C] - orrs r2, r1 -_081926B0: - ldr r1, =gUnknown_0860D343 - adds r1, r7, r1 - ldrb r3, [r1] - ldr r1, [sp, 0x30] - adds r3, r1 - mov r1, r9 - str r1, [sp] - str r1, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - ldr r1, =sub_8190938 - bl sub_80D2CC4 - ldr r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrb r1, [r0, 0x5] - movs r2, 0xD - negs r2, r2 - ands r1, r2 - strb r1, [r0, 0x5] - movs r0, 0x1E - ldr r3, [sp, 0x1C] - ands r0, r3 - cmp r0, 0 - beq _0819270A - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0819270A: - adds r4, 0x1 - adds r5, 0x2 - adds r7, 0x1 - cmp r7, 0x2 - ble _08192624 - add r0, sp, 0xC - movs r2, 0 - movs r3, 0x2 - strb r3, [r0, 0x5] - strb r2, [r0, 0x6] - strb r2, [r0, 0x7] - adds r1, r0, 0 - adds r0, r2, 0 - strb r0, [r1, 0x8] - adds r0, r1, 0 - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - adds r0, r1, 0 - strb r3, [r0, 0xA] - strb r2, [r0, 0xB] - adds r3, r0, 0 - ldrb r2, [r3, 0xC] - movs r1, 0x10 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - adds r2, r3, 0 - movs r0, 0xE0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - adds r1, r2, 0 - movs r0, 0xD0 - strb r0, [r1, 0xD] - movs r7, 0 - ldr r0, =0x000003ff - ldr r4, [sp, 0x24] - cmp r4, r0 - bne _08192784 - ldr r0, =gTrainerClassNameIndices - adds r0, 0x3C - ldrb r5, [r0] - b _081927A2 - .pool -_08192784: - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192798 - bl sub_8195924 - b _0819279E - .pool -_08192798: - ldr r0, [sp, 0x24] - bl sub_8162BD8 -_0819279E: - lsls r0, 24 - lsrs r5, r0, 24 -_081927A2: - ldr r2, =gTrainerClassNames - movs r0, 0xD - adds r1, r5, 0 - muls r1, r0 - adds r0, r7, r1 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0xFF - beq _081927CA - ldr r3, =gStringVar1 - adds r0, r1, r2 - adds r2, r7, r0 -_081927BA: - adds r0, r7, r3 - ldrb r1, [r2] - strb r1, [r0] - adds r2, 0x1 - adds r7, 0x1 - ldrb r0, [r2] - cmp r0, 0xFF - bne _081927BA -_081927CA: - ldr r5, =gStringVar1 - adds r1, r7, r5 - movs r0, 0 - strb r0, [r1] - adds r0, r7, 0x1 - adds r0, r5 - movs r1, 0xFF - strb r1, [r0] - ldr r0, =0x000003ff - ldr r2, [sp, 0x24] - cmp r2, r0 - bne _08192800 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r5, 0 - bl StringAppend - b _08192836 - .pool -_08192800: - ldr r0, =0x000003fe - ldr r3, [sp, 0x24] - cmp r3, r0 - bne _08192824 - ldr r4, =gStringVar2 - adds r0, r4, 0 - bl sub_8195938 - adds r0, r5, 0 - adds r1, r4, 0 - bl StringAppend - b _08192836 - .pool -_08192824: - ldr r4, =gStringVar2 - ldr r1, [sp, 0x24] - adds r0, r4, 0 - bl sub_8195898 - adds r0, r5, 0 - adds r1, r4, 0 - bl StringAppend -_08192836: - add r0, sp, 0xC - ldrb r0, [r0, 0x5] - ldr r4, =gStringVar1 - add r1, sp, 0xC - ldrb r3, [r1, 0xA] - adds r1, r4, 0 - movs r2, 0xD0 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0xC - movs r5, 0 - strb r0, [r1, 0x8] - str r4, [sp, 0xC] - adds r0, r1, 0 - add r4, sp, 0x28 - ldrb r4, [r4] - strb r4, [r0, 0x4] - ldr r0, [sp, 0x44] - lsrs r4, r0, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - add r0, sp, 0xC - strb r5, [r0, 0xA] - movs r7, 0 - adds r6, r0, 0 - ldr r1, [sp, 0x3C] - ldr r2, [sp, 0x20] - adds r0, r1, r2 - lsls r0, 1 - mov r9, r0 - movs r3, 0xB - mov r10, r3 -_0819288A: - ldr r0, =gUnknown_0860D346 - adds r0, r7, r0 - ldrb r0, [r0] - strb r0, [r6, 0x9] - ldr r0, =0x000003ff - ldr r4, [sp, 0x24] - cmp r4, r0 - bne _081928C0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r7, 1 - add r0, r9 - ldr r2, =0x00000d64 - adds r1, r2 - b _081928FA - .pool -_081928C0: - ldr r0, =0x000003fe - ldr r4, [sp, 0x24] - cmp r4, r0 - bne _081928E4 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r7, 1 - add r0, r9 - ldr r2, =0x00000d64 - adds r1, r2 - b _081928FA - .pool -_081928E4: - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - lsls r0, r7, 1 - add r0, r9 - ldr r2, =0x00000d64 - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 -_081928FA: - adds r1, r0 - ldrh r0, [r1] - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - ldr r1, =gSpeciesNames - adds r0, r1 - str r0, [sp, 0xC] - adds r0, r7, 0x1 - ldr r4, [sp, 0x28] - adds r0, r4 - movs r1, 0 - strb r0, [r6, 0x4] - cmp r7, 0x1 - bne _08192930 - movs r0, 0x7 - strb r0, [r6, 0x8] - b _08192932 - .pool -_08192930: - strb r1, [r6, 0x8] -_08192932: - adds r5, r7, 0x1 - ldr r0, [sp, 0x28] - adds r4, r5, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - adds r7, r5, 0 - cmp r7, 0x2 - ble _0819288A - ldr r4, [sp, 0x40] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192980 - ldr r0, =gUnknown_0860D1D0 - ldr r0, [r0, 0x40] - b _0819298A - .pool -_08192980: - ldr r0, =gUnknown_0860D1D0 - ldr r2, [sp, 0x20] - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] -_0819298A: - str r0, [sp, 0xC] - add r1, sp, 0xC - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x5] - adds r0, r1, 0 - add r3, sp, 0x40 - ldrb r3, [r3] - strb r3, [r0, 0x4] - strb r2, [r0, 0x8] - movs r1, 0x4 - strb r1, [r0, 0x7] - strb r1, [r0, 0x9] - movs r1, 0 - bl AddTextPrinter - movs r7, 0 - ldr r3, =gUnknown_0860B358 -_081929AE: - movs r5, 0 - adds r4, r7, 0x1 - str r4, [sp, 0x38] - lsls r0, r7, 1 - str r0, [sp, 0x34] - lsls r2, r7, 4 -_081929BA: - movs r6, 0 - lsls r1, r5, 1 - mov r10, r1 - mov r4, r8 - mov r9, r2 -_081929C4: - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192A00 - lsls r0, r7, 24 - lsls r1, r5, 24 - lsrs r0, 24 - lsrs r1, 24 - str r2, [sp, 0x48] - str r3, [sp, 0x4C] - bl sub_81A5060 - lsls r0, 16 - lsrs r0, 12 - adds r0, r6, r0 - ldr r3, [sp, 0x4C] - adds r0, r3 - ldrh r1, [r4] - ldrb r0, [r0] - adds r1, r0 - strh r1, [r4] - ldr r2, [sp, 0x48] - b _08192A58 - .pool -_08192A00: - ldr r0, =0x000003ff - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192A20 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000efc - adds r0, r1 - add r0, r9 - b _08192A48 - .pool -_08192A20: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - mov r12, r0 - ldr r0, [sp, 0x3C] - ldr r1, [sp, 0x20] - adds r0, r1 - str r0, [sp, 0x50] - lsls r0, 1 - ldr r1, [sp, 0x34] - adds r0, r1, r0 - ldr r1, =0x00000d64 - add r1, r12 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - adds r0, 0x2 - add r0, r10 -_08192A48: - ldrh r0, [r0] - lsls r0, 4 - adds r0, r6, r0 - adds r0, r3 - ldrh r1, [r4] - ldrb r0, [r0] - adds r1, r0 - strh r1, [r4] -_08192A58: - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0xF - ble _081929C4 - adds r2, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _081929BA - ldr r7, [sp, 0x38] - cmp r7, 0x2 - ble _081929AE - movs r7, 0 - ldr r2, =gUnknown_0860D214 - mov r9, r2 - ldr r3, =gUnknown_0860C988 - mov r10, r3 -_08192A78: - movs r4, 0 - movs r6, 0 - movs r5, 0 - mov r3, r8 - lsls r0, r7, 4 - mov r1, r10 - adds r2, r0, r1 -_08192A86: - ldrb r0, [r2] - cmp r0, 0 - beq _08192A9E - adds r4, 0x1 - movs r1, 0 - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _08192A9E - ldrb r1, [r2] - cmp r0, r1 - blt _08192A9E - adds r6, 0x1 -_08192A9E: - adds r3, 0x2 - adds r2, 0x1 - adds r5, 0x1 - cmp r5, 0xF - ble _08192A86 - cmp r4, r6 - beq _08192AB2 - adds r7, 0x1 - cmp r7, 0x1E - bls _08192A78 -_08192AB2: - lsls r0, r7, 2 - add r0, r9 - ldr r0, [r0] - str r0, [sp, 0xC] - add r0, sp, 0xC - movs r1, 0x14 - strb r1, [r0, 0x7] - strb r1, [r0, 0x9] - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - movs r1, 0 - mov r0, r8 - adds r0, 0x22 -_08192AD0: - strh r1, [r0] - subs r0, 0x2 - cmp r0, r8 - bge _08192AD0 - ldr r2, [sp, 0x24] - ldr r3, =0xfffffc02 - adds r0, r2, r3 - cmp r0, 0x1 - bls _08192AE4 - b _08192C24 -_08192AE4: - movs r7, 0 - movs r4, 0 - mov r9, r4 -_08192AEA: - movs r5, 0 - mov r4, r8 - mov r6, r9 -_08192AF0: - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192B24 - lsls r1, r5, 24 - lsrs r1, 24 - lsrs r0, r6, 24 - bl sub_81A50F0 - lsls r0, 24 - lsrs r0, 24 - b _08192B34 - .pool -_08192B24: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r7, 4 - adds r1, r5, r1 - ldr r2, =0x00000f04 - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] -_08192B34: - strh r0, [r4] - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x5 - ble _08192AF0 - mov r3, r8 - ldrh r0, [r3] - ldrh r4, [r3, 0xC] - adds r0, r4 - strh r0, [r3, 0xC] - movs r5, 0 - mov r4, r8 -_08192B4C: - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192B70 - mov r2, r9 - lsrs r0, r2, 24 - bl sub_81A50B0 - lsls r0, 24 - lsrs r2, r0, 24 - b _08192B7E - .pool -_08192B70: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r7, 4 - adds r0, r1 - ldr r3, =0x00000f0a - adds r0, r3 - ldrb r2, [r0] -_08192B7E: - ldr r1, =gNatureStatTable - lsls r0, r2, 2 - adds r0, r2 - adds r0, r5, r0 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - ble _08192BB4 - movs r0, 0x2 - ldrsh r1, [r4, r0] - movs r0, 0x6E - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - ldrh r1, [r4, 0xE] - adds r1, r0 - strh r1, [r4, 0xE] - b _08192BDC - .pool -_08192BB4: - cmp r0, 0 - bge _08192BD4 - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r0, 0x5A - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - ldrh r1, [r4, 0xE] - adds r1, r0 - strh r1, [r4, 0xE] - ldrh r0, [r4, 0x1A] - adds r0, 0x1 - strh r0, [r4, 0x1A] - b _08192BDC -_08192BD4: - ldrh r0, [r4, 0x2] - ldrh r3, [r4, 0xE] - adds r0, r3 - strh r0, [r4, 0xE] -_08192BDC: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x4 - ble _08192B4C - movs r4, 0x80 - lsls r4, 17 - add r9, r4 - adds r7, 0x1 - cmp r7, 0x2 - bgt _08192BF2 - b _08192AEA -_08192BF2: - movs r5, 0 - mov r1, r8 - movs r7, 0x5 -_08192BF8: - movs r2, 0xC - ldrsh r0, [r1, r2] - adds r5, r0 - adds r1, 0x2 - subs r7, 0x1 - cmp r7, 0 - bge _08192BF8 - movs r6, 0x64 - mov r4, r8 - movs r7, 0x5 -_08192C0C: - movs r3, 0xC - ldrsh r0, [r4, r3] - muls r0, r6 - adds r1, r5, 0 - bl __divsi3 - strh r0, [r4] - adds r4, 0x2 - subs r7, 0x1 - cmp r7, 0 - bge _08192C0C - b _08192D70 -_08192C24: - ldr r4, =gUnknown_0203BC8C - mov r10, r4 - ldr r1, [sp, 0x3C] - ldr r2, [sp, 0x20] - adds r0, r1, r2 - lsls r0, 1 - mov r9, r0 - movs r7, 0x2 -_08192C34: - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r4, =0x00000d64 - adds r0, r4 - add r0, r9 - ldrh r0, [r0] - mov r2, r10 - ldr r1, [r2] - lsls r0, 4 - adds r0, r1 - ldrb r2, [r0, 0xB] - movs r6, 0 - movs r4, 0 - movs r3, 0x1 - mov r1, r8 - movs r5, 0x5 -_08192C54: - strh r4, [r1] - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _08192C60 - adds r6, 0x1 -_08192C60: - asrs r2, 1 - adds r1, 0x2 - subs r5, 0x1 - cmp r5, 0 - bge _08192C54 - movs r0, 0xFF - lsls r0, 1 - adds r1, r6, 0 - bl __divsi3 - adds r6, r0, 0 - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r4, =0x00000d64 - adds r0, r4 - add r0, r9 - ldrh r0, [r0] - mov r2, r10 - ldr r1, [r2] - lsls r0, 4 - adds r0, r1 - ldrb r2, [r0, 0xB] - movs r3, 0x1 - mov r1, r8 - movs r5, 0x5 -_08192C92: - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _08192C9C - strh r6, [r1] -_08192C9C: - asrs r2, 1 - adds r1, 0x2 - subs r5, 0x1 - cmp r5, 0 - bge _08192C92 - mov r3, r8 - ldrh r0, [r3] - ldrh r4, [r3, 0xC] - adds r0, r4 - strh r0, [r3, 0xC] - movs r5, 0 - mov r4, r8 -_08192CB4: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000d64 - adds r0, r2 - add r0, r9 - ldrh r0, [r0] - mov r3, r10 - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - ldrb r2, [r0, 0xC] - lsls r0, r2, 2 - adds r0, r2 - adds r0, r5, r0 - ldr r1, =gNatureStatTable - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - ble _08192D04 - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r0, 0x6E - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - ldrh r1, [r4, 0xE] - adds r1, r0 - strh r1, [r4, 0xE] - b _08192D2C - .pool -_08192D04: - cmp r0, 0 - bge _08192D24 - movs r3, 0x2 - ldrsh r1, [r4, r3] - movs r0, 0x5A - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - ldrh r1, [r4, 0xE] - adds r1, r0 - strh r1, [r4, 0xE] - ldrh r0, [r4, 0x1A] - adds r0, 0x1 - strh r0, [r4, 0x1A] - b _08192D2C -_08192D24: - ldrh r0, [r4, 0x2] - ldrh r1, [r4, 0xE] - adds r0, r1 - strh r0, [r4, 0xE] -_08192D2C: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x4 - ble _08192CB4 - movs r2, 0x2 - add r9, r2 - subs r7, 0x1 - cmp r7, 0 - blt _08192D40 - b _08192C34 -_08192D40: - movs r5, 0 - mov r1, r8 - movs r7, 0x5 -_08192D46: - movs r3, 0xC - ldrsh r0, [r1, r3] - adds r5, r0 - adds r1, 0x2 - subs r7, 0x1 - cmp r7, 0 - bge _08192D46 - movs r6, 0x64 - mov r4, r8 - movs r7, 0x5 -_08192D5A: - movs r1, 0xC - ldrsh r0, [r4, r1] - muls r0, r6 - adds r1, r5, 0 - bl __divsi3 - strh r0, [r4] - adds r4, 0x2 - subs r7, 0x1 - cmp r7, 0 - bge _08192D5A -_08192D70: - movs r7, 0 - movs r5, 0 - movs r6, 0 - mov r4, r8 - mov r10, r8 - mov r9, r8 -_08192D7C: - movs r2, 0 - ldrsh r1, [r4, r2] - cmp r1, 0x1D - ble _08192DDE - cmp r7, 0x2 - bne _08192DD4 - mov r3, r8 - movs r0, 0xC - ldrsh r3, [r3, r0] - mov r12, r3 - cmp r12, r1 - bge _08192DC6 - mov r2, r8 - ldrh r2, [r2, 0xE] - add r3, sp, 0x54 - strh r2, [r3] - mov r2, r8 - movs r3, 0xE - ldrsh r0, [r2, r3] - cmp r0, r1 - bge _08192DBA - cmp r12, r0 - bge _08192DB4 - add r0, sp, 0x54 - ldrh r0, [r0] - strh r0, [r2, 0xC] - strh r6, [r2, 0xE] - b _08192DDE -_08192DB4: - mov r1, r8 - strh r6, [r1, 0xE] - b _08192DDE -_08192DBA: - add r2, sp, 0x54 - ldrh r3, [r2] - mov r2, r8 - strh r3, [r2, 0xC] - strh r6, [r2, 0xE] - b _08192DDE -_08192DC6: - mov r3, r8 - movs r2, 0xE - ldrsh r0, [r3, r2] - cmp r0, r1 - bge _08192DDE - strh r6, [r3, 0xE] - b _08192DDE -_08192DD4: - mov r3, r9 - strh r6, [r3, 0xC] - movs r0, 0x2 - add r9, r0 - adds r7, 0x1 -_08192DDE: - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08192E64 - cmp r5, 0x2 - bne _08192E5A - movs r2, 0x18 - ldrsh r0, [r4, r2] - cmp r0, 0x1 - bgt _08192E18 - cmp r0, 0x1 - bne _08192E64 - mov r3, r8 - movs r1, 0x10 - ldrsh r0, [r3, r1] - lsls r0, 1 - add r0, r8 - movs r2, 0x18 - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _08192E22 - movs r1, 0x12 - ldrsh r0, [r3, r1] - lsls r0, 1 - add r0, r8 - movs r2, 0x18 - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _08192E22 -_08192E18: - mov r3, r8 - ldrh r0, [r3, 0x12] - strh r0, [r3, 0x10] - strh r6, [r3, 0x12] - b _08192E64 -_08192E22: - movs r1, 0x18 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08192E64 - mov r2, r8 - movs r3, 0x10 - ldrsh r0, [r2, r3] - lsls r0, 1 - add r0, r8 - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08192E44 - ldrh r0, [r2, 0x12] - strh r0, [r2, 0x10] - strh r6, [r2, 0x12] - b _08192E64 -_08192E44: - mov r2, r8 - movs r3, 0x12 - ldrsh r0, [r2, r3] - lsls r0, 1 - add r0, r8 - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08192E64 - strh r6, [r2, 0x12] - b _08192E64 -_08192E5A: - mov r2, r10 - strh r6, [r2, 0x10] - movs r3, 0x2 - add r10, r3 - adds r5, 0x1 -_08192E64: - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _08192D7C - cmp r7, 0x2 - bne _08192E8C - ldr r0, =gUnknown_0860D349 - mov r4, r8 - movs r1, 0xC - ldrsh r2, [r4, r1] - adds r0, r2, r0 - movs r3, 0xE - ldrsh r1, [r4, r3] - subs r1, 0x1 - subs r1, r2 - ldrb r0, [r0] - adds r7, r1, r0 - b _08192ED2 - .pool -_08192E8C: - cmp r7, 0x1 - bne _08192E9C - mov r4, r8 - movs r1, 0xC - ldrsh r0, [r4, r1] - adds r7, r0, 0 - adds r7, 0xF - b _08192ED2 -_08192E9C: - cmp r5, 0x2 - bne _08192EC0 - ldr r0, =gUnknown_0860D349 - mov r3, r8 - movs r4, 0x10 - ldrsh r2, [r3, r4] - adds r0, r2, r0 - movs r4, 0x12 - ldrsh r1, [r3, r4] - subs r1, 0x1 - subs r1, r2 - ldrb r0, [r0] - adds r1, r0 - adds r7, r1, 0 - adds r7, 0x15 - b _08192ED2 - .pool -_08192EC0: - cmp r5, 0x1 - bne _08192ED0 - mov r1, r8 - movs r2, 0x10 - ldrsh r0, [r1, r2] - adds r7, r0, 0 - adds r7, 0x24 - b _08192ED2 -_08192ED0: - movs r7, 0x2A -_08192ED2: - lsls r0, r7, 2 - ldr r3, =gUnknown_0860D294 - adds r0, r3 - ldr r0, [r0] - str r0, [sp, 0xC] - add r0, sp, 0xC - movs r1, 0x24 - strb r1, [r0, 0x7] - strb r1, [r0, 0x9] - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - mov r0, r8 - bl Free - add sp, 0x58 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81924E0 - - thumb_func_start sub_8192F08 -sub_8192F08: @ 8192F08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - str r1, [sp] - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0 - str r0, [sp, 0x4] - mov r8, r0 - ldr r2, =gUnknown_0860D3C4 - lsls r0, r7, 1 - adds r0, r7 - adds r1, r0, r2 - ldrb r6, [r1] - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - adds r0, r6, r0 - adds r3, r2, 0 - cmp r6, r0 - bge _08192FD4 - ldr r5, =gSaveBlock2Ptr - ldr r1, =0x000003ff - mov r10, r1 - ldr r2, =0x000003fe - mov r9, r2 -_08192F42: - ldr r0, =gUnknown_0860D3B4 - adds r0, r6, r0 - ldrb r4, [r0] - ldr r0, [r5] - lsls r1, r4, 2 - adds r0, r1 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08192FBE - ldr r0, [sp] - add r0, r8 - strb r4, [r0] - ldr r2, [r5] - adds r0, r2, r1 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r1, r0, 22 - lsrs r0, r1, 22 - cmp r0, r10 - bne _08192F9C - ldr r0, =gStringVar1 - adds r1, r2, 0 - bl StringCopy - b _08192FB8 - .pool -_08192F9C: - lsrs r0, r1, 22 - cmp r0, r9 - bne _08192FB0 - ldr r0, =gStringVar1 - bl sub_8195938 - b _08192FB8 - .pool -_08192FB0: - lsrs r1, 22 - ldr r0, =gStringVar1 - bl sub_8195898 -_08192FB8: - movs r2, 0x1 - add r8, r2 - ldr r3, =gUnknown_0860D3C4 -_08192FBE: - adds r6, 0x1 - lsls r1, r7, 1 - adds r1, r7 - adds r0, r1, r3 - ldrb r2, [r0] - adds r0, r3, 0x1 - adds r1, r0 - ldrb r0, [r1] - adds r2, r0 - cmp r6, r2 - blt _08192F42 -_08192FD4: - mov r5, r8 - cmp r5, 0x2 - bne _08192FE8 - movs r0, 0 - b _0819313C - .pool -_08192FE8: - mov r12, r3 - lsls r3, r7, 1 - adds r0, r3, r7 - mov r2, r12 - adds r1, r0, r2 - ldrb r6, [r1] - mov r1, r12 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - adds r0, r6, r0 - str r3, [sp, 0x8] - cmp r6, r0 - blt _08193006 - b _08193126 -_08193006: - ldr r5, =gSaveBlock2Ptr - mov r10, r5 - ldr r0, =0x00000d25 - mov r9, r0 -_0819300E: - ldr r0, =gUnknown_0860D3B4 - adds r0, r6, r0 - ldrb r4, [r0] - mov r1, r10 - ldr r0, [r1] - lsls r2, r4, 2 - str r2, [sp, 0xC] - adds r0, r2 - add r0, r9 - ldrb r2, [r0] - lsls r0, r2, 29 - cmp r0, 0 - bge _08193100 - lsls r2, 27 - adds r1, r3, r7 - mov r0, r12 - adds r0, 0x2 - adds r1, r0 - lsrs r2, 30 - ldrb r1, [r1] - cmp r2, r1 - bcc _08193100 - ldr r0, [sp] - add r0, r8 - strb r4, [r0] - movs r5, 0x1 - add r8, r5 - mov r0, r10 - ldr r3, [r0] - ldr r5, [sp, 0xC] - adds r2, r3, r5 - adds r0, r2, 0 - add r0, r9 - ldrb r5, [r0] - mov r12, r5 - mov r0, r12 - lsls r0, 27 - lsrs r0, 30 - cmp r0, r1 - bne _081930BC - lsls r4, 1 - movs r1, 0xEC - lsls r1, 4 - adds r0, r3, r1 - adds r0, r4 - ldrh r1, [r0] - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - ldr r0, =gStringVar2 - bl StringCopy - mov r2, r10 - ldr r1, [r2] - ldr r5, [sp, 0xC] - adds r0, r1, r5 - add r0, r9 - ldrb r0, [r0] - lsls r2, r0, 24 - lsrs r0, r2, 29 - lsls r0, 1 - str r0, [sp, 0x4] - movs r0, 0xEC - lsls r0, 4 - adds r1, r0 - adds r1, r4 - ldrh r0, [r1] - cmp r0, 0 - bne _08193100 - lsrs r0, r2, 29 - cmp r0, 0 - bne _08193100 - movs r1, 0x4 - str r1, [sp, 0x4] - b _08193100 - .pool -_081930BC: - ldr r5, =0x00000d24 - adds r0, r2, r5 - ldrh r0, [r0] - lsls r1, r0, 22 - ldr r0, =0xffc00000 - cmp r1, r0 - bne _081930E0 - ldr r0, =gStringVar1 - adds r1, r3, 0 - bl StringCopy - b _08193100 - .pool -_081930E0: - ldr r0, =0xff800000 - cmp r1, r0 - bne _081930F8 - ldr r0, =gStringVar1 - bl sub_8195938 - b _08193100 - .pool -_081930F8: - lsrs r1, 22 - ldr r0, =gStringVar1 - bl sub_8195898 -_08193100: - mov r0, r8 - cmp r0, 0x2 - beq _08193126 - adds r6, 0x1 - ldr r1, =gUnknown_0860D3C4 - mov r12, r1 - ldr r3, [sp, 0x8] - adds r1, r3, r7 - mov r2, r12 - adds r0, r1, r2 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - adds r2, r0 - cmp r6, r2 - bge _08193126 - b _0819300E -_08193126: - cmp r7, 0xE - beq _08193138 - ldr r0, [sp, 0x4] - adds r0, 0x1 - b _0819313C - .pool -_08193138: - ldr r0, [sp, 0x4] - adds r0, 0x2 -_0819313C: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8192F08 - - thumb_func_start sub_819314C -sub_819314C: @ 819314C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x80 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x34] - lsls r1, 24 - lsrs r6, r1, 24 - movs r0, 0 - str r0, [sp, 0x3C] - movs r7, 0 - movs r1, 0 - str r1, [sp, 0x40] - movs r2, 0 - str r2, [sp, 0x44] - mov r9, r2 - movs r0, 0x1 - ldr r3, [sp, 0x34] - ands r0, r3 - cmp r0, 0 - beq _08193186 - movs r7, 0x8 - str r7, [sp, 0x3C] - movs r7, 0x9 - movs r0, 0x2 - mov r9, r0 -_08193186: - movs r0, 0x2 - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _08193196 - movs r2, 0x80 - lsls r2, 1 - str r2, [sp, 0x40] -_08193196: - movs r0, 0x4 - ldr r3, [sp, 0x34] - ands r0, r3 - cmp r0, 0 - beq _081931A4 - movs r0, 0xA0 - str r0, [sp, 0x44] -_081931A4: - movs r0, 0x8 - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _081931B2 - ldr r2, =0xffffff00 - str r2, [sp, 0x40] -_081931B2: - movs r0, 0x10 - ldr r3, [sp, 0x34] - ands r0, r3 - cmp r0, 0 - beq _081931C2 - movs r0, 0xA0 - negs r0, r0 - str r0, [sp, 0x44] -_081931C2: - ldr r4, =gUnknown_0203CD78 - ldr r1, [r4] - adds r1, 0x11 - adds r0, r6, 0 - bl sub_8192F08 - str r0, [sp, 0x38] - movs r5, 0 - mov r1, sp - adds r1, 0x1C - str r1, [sp, 0x48] - mov r2, sp - adds r2, 0x24 - str r2, [sp, 0x4C] - lsls r1, r6, 1 - mov r3, sp - adds r3, 0x2C - str r3, [sp, 0x50] - ldr r0, [sp, 0x40] - adds r0, 0x30 - mov r8, r0 - ldr r2, [sp, 0x44] - adds r2, 0x58 - str r2, [sp, 0x78] - movs r3, 0xC - add r3, r9 - mov r10, r3 - ldr r0, [sp, 0x40] - adds r0, 0xC0 - str r0, [sp, 0x7C] - mov r2, r9 - adds r2, 0xD - str r2, [sp, 0x74] - ldr r3, [sp, 0x3C] - adds r3, 0x1 - mov r9, r3 - ldr r0, [sp, 0x3C] - adds r0, 0x2 - str r0, [sp, 0x54] - ldr r2, [sp, 0x3C] - adds r2, 0x5 - str r2, [sp, 0x5C] - adds r3, r7, 0 - adds r3, 0x8 - str r3, [sp, 0x6C] - adds r0, r7, 0x6 - str r0, [sp, 0x64] - adds r2, r7, 0x7 - str r2, [sp, 0x68] - lsls r3, r6, 2 - str r3, [sp, 0x58] - adds r0, r7, 0x5 - str r0, [sp, 0x60] - ldr r0, [r4] - adds r0, 0x11 - mov r12, r0 - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r0, =gUnknown_0860D3C6 - movs r3, 0 - adds r1, r6 - adds r1, r0 - ldrb r6, [r1] -_08193240: - ldr r1, [sp, 0x48] - adds r2, r3, r1 - mov r7, r12 - adds r0, r7, r5 - ldrb r0, [r0] - str r0, [r2] - ldr r7, [sp, 0x4C] - adds r1, r3, r7 - lsls r0, 2 - adds r0, r4, r0 - ldr r7, =0x00000d24 - adds r0, r7 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - str r0, [r1] - ldr r0, [r2] - lsls r0, 2 - adds r0, r4, r0 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 27 - lsrs r0, 30 - cmp r0, r6 - bhi _0819329C - lsls r0, r1, 29 - cmp r0, 0 - bge _0819329C - ldr r2, [sp, 0x50] - adds r1, r3, r2 - movs r0, 0x1 - b _081932A2 - .pool -_0819329C: - ldr r7, [sp, 0x50] - adds r1, r3, r7 - movs r0, 0 -_081932A2: - str r0, [r1] - adds r3, 0x4 - adds r5, 0x1 - cmp r5, 0x1 - ble _08193240 - ldr r1, [sp, 0x24] - ldr r0, =0x000003ff - cmp r1, r0 - bne _081932D4 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r0, 16 - mov r2, r8 - ldr r3, [sp, 0x78] - mov r1, r10 - str r1, [sp] - b _081932F8 - .pool -_081932D4: - ldr r0, =0x000003fe - cmp r1, r0 - bne _081932E4 - bl sub_8195910 - b _081932EC - .pool -_081932E4: - lsls r0, r1, 16 - lsrs r0, 16 - bl sub_8162AA0 -_081932EC: - lsls r0, 24 - lsrs r0, 24 - mov r2, r8 - ldr r3, [sp, 0x78] - mov r7, r10 - str r7, [sp] -_081932F8: - ldr r1, =0x0000ffff - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D8AC - ldr r1, =gUnknown_0203CD78 - ldr r1, [r1] - ldr r2, [sp, 0x3C] - adds r1, r2 - strb r0, [r1] - movs r0, 0x1E - ldr r3, [sp, 0x34] - ands r0, r3 - cmp r0, 0 - beq _08193334 - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldr r7, [sp, 0x3C] - adds r0, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08193334: - ldr r0, [sp, 0x2C] - cmp r0, 0 - beq _0819335A - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldr r1, [sp, 0x3C] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x5] - movs r1, 0xF - ands r1, r2 - movs r2, 0x30 - orrs r1, r2 - strb r1, [r0, 0x5] -_0819335A: - ldr r2, [sp, 0x4C] - ldr r1, [r2, 0x4] - ldr r0, =0x000003ff - cmp r1, r0 - bne _08193388 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r0, 16 - b _081933B0 - .pool -_08193388: - ldr r0, =0x000003fe - cmp r1, r0 - bne _081933A4 - bl sub_8195910 - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x7C] - ldr r3, [sp, 0x78] - ldr r1, [sp, 0x74] - str r1, [sp] - b _081933B8 - .pool -_081933A4: - lsls r0, r1, 16 - lsrs r0, 16 - bl sub_8162AA0 - lsls r0, 24 - lsrs r0, 24 -_081933B0: - ldr r2, [sp, 0x7C] - ldr r3, [sp, 0x78] - ldr r7, [sp, 0x74] - str r7, [sp] -_081933B8: - ldr r1, =0x0000ffff - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D8AC - ldr r1, =gUnknown_0203CD78 - ldr r1, [r1] - add r1, r9 - strb r0, [r1] - movs r0, 0x1E - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _081933F0 - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_081933F0: - ldr r2, [sp, 0x50] - ldr r0, [r2, 0x4] - cmp r0, 0 - beq _08193416 - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x5] - movs r1, 0xF - ands r1, r2 - movs r2, 0x30 - orrs r1, r2 - strb r1, [r0, 0x5] -_08193416: - movs r5, 0 - ldr r3, [sp, 0x38] - lsls r3, 2 - str r3, [sp, 0x70] - mov r8, r5 - ldr r6, =gUnknown_0203CD78 - ldr r7, =gSprites - ldr r4, [sp, 0x54] - mov r9, r5 - movs r0, 0x1 - mov r10, r0 -_0819342C: - ldr r1, [sp, 0x24] - ldr r0, =0x000003ff - cmp r1, r0 - bne _08193464 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, [sp, 0x1C] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - b _081934B0 - .pool -_08193464: - ldr r0, =0x000003fe - cmp r1, r0 - bne _08193490 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, [sp, 0x1C] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - b _081934B0 - .pool -_08193490: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, [sp, 0x1C] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r1, [r2] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] -_081934B0: - ldr r1, =gUnknown_0860D3A8 - adds r1, r5, r1 - ldrb r2, [r1] - ldr r3, [sp, 0x40] - orrs r2, r3 - ldr r1, =gUnknown_0860D3AB - adds r1, r5, r1 - ldrb r3, [r1] - ldr r1, [sp, 0x44] - adds r3, r1 - mov r1, r8 - str r1, [sp] - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - ldr r1, =sub_8190938 - bl sub_80D2CC4 - ldr r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrb r1, [r0, 0x5] - movs r3, 0xD - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - strb r1, [r0, 0x5] - movs r0, 0x1E - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _08193516 - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08193516: - ldr r0, [sp, 0x2C] - cmp r0, 0 - beq _08193548 - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - movs r2, 0x30 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r10 - strh r2, [r0, 0x34] -_08193548: - adds r4, 0x1 - movs r3, 0x2 - add r9, r3 - adds r5, 0x1 - cmp r5, 0x2 - bgt _08193556 - b _0819342C -_08193556: - movs r5, 0 - ldr r6, =gUnknown_0203CD78 - ldr r7, =gSprites - mov r8, r7 - ldr r4, [sp, 0x5C] - mov r9, r5 - movs r7, 0 -_08193564: - ldr r0, [sp, 0x4C] - ldr r1, [r0, 0x4] - ldr r0, =0x000003ff - cmp r1, r0 - bne _081935AC - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r3, [sp, 0x48] - ldr r1, [r3, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - b _081935FA - .pool -_081935AC: - ldr r0, =0x000003fe - cmp r1, r0 - bne _081935D8 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, [sp, 0x48] - ldr r1, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - b _081935FA - .pool -_081935D8: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, [sp, 0x48] - ldr r1, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r1, [r2] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] -_081935FA: - ldr r1, =gUnknown_0860D3AE - adds r1, r5, r1 - ldrb r2, [r1] - ldr r3, [sp, 0x40] - orrs r2, r3 - ldr r1, =gUnknown_0860D3B1 - adds r1, r5, r1 - ldrb r3, [r1] - ldr r1, [sp, 0x44] - adds r3, r1 - str r7, [sp] - str r7, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - ldr r1, =sub_8190938 - bl sub_80D2CC4 - ldr r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r1, [r0, 0x5] - movs r3, 0xD - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - strb r1, [r0, 0x5] - movs r0, 0x1E - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _0819365E - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0819365E: - ldr r2, [sp, 0x50] - ldr r0, [r2, 0x4] - cmp r0, 0 - beq _08193692 - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - movs r2, 0x30 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - movs r1, 0x1 - strh r1, [r0, 0x34] -_08193692: - adds r4, 0x1 - movs r3, 0x2 - add r9, r3 - adds r5, 0x1 - cmp r5, 0x2 - bgt _081936A0 - b _08193564 -_081936A0: - add r0, sp, 0xC - movs r5, 0 - strb r5, [r0, 0x6] - adds r1, r0, 0 - movs r0, 0x2 - strb r0, [r1, 0x7] - adds r0, r1, 0 - ldrb r0, [r0, 0x6] - strb r0, [r1, 0x8] - adds r0, r1, 0 - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - adds r0, r1, 0 - strb r5, [r0, 0xA] - strb r5, [r0, 0xB] - adds r3, r0, 0 - ldrb r2, [r3, 0xC] - movs r1, 0x10 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - adds r2, r3, 0 - movs r0, 0xE0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - adds r1, r2, 0 - movs r0, 0xD0 - strb r0, [r1, 0xD] - ldr r4, =gStringVar4 - ldr r0, =gUnknown_0860D38C - ldr r7, [sp, 0x70] - adds r0, r7, r0 - ldr r1, [r0] - adds r0, r4, 0 - bl StringExpandPlaceholders - str r4, [sp, 0xC] - add r0, sp, 0xC - add r1, sp, 0x6C - ldrb r1, [r1] - strb r1, [r0, 0x4] - adds r1, r0, 0 - movs r0, 0x1 - strb r0, [r1, 0x5] - ldr r4, [sp, 0x6C] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - strb r5, [r0, 0x8] - adds r1, r0, 0 - strb r5, [r0, 0x7] - strb r5, [r1, 0x9] - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - ldr r1, [sp, 0x24] - ldr r0, =0x000003ff - cmp r1, r0 - bne _0819375C - ldr r0, =gStringVar1 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - b _0819377E - .pool -_0819375C: - ldr r0, =0x000003fe - cmp r1, r0 - bne _08193774 - ldr r0, =gStringVar1 - bl sub_8195938 - b _0819377E - .pool -_08193774: - ldr r0, =gStringVar1 - lsls r1, 16 - lsrs r1, 16 - bl sub_8195898 -_0819377E: - add r0, sp, 0xC - movs r4, 0x2 - strb r4, [r0, 0x5] - strb r4, [r0, 0xA] - ldr r5, =gStringVar1 - str r5, [sp, 0xC] - add r2, sp, 0x64 - ldrb r2, [r2] - strb r2, [r0, 0x4] - ldrb r0, [r0, 0x5] - ldr r1, [sp, 0xC] - add r2, sp, 0xC - ldrb r3, [r2, 0xA] - movs r2, 0x40 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0xC - strb r0, [r1, 0x8] - adds r0, r1, 0 - strb r4, [r0, 0x7] - strb r4, [r1, 0x9] - ldr r4, [sp, 0x64] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - ldr r3, [sp, 0x4C] - ldr r1, [r3, 0x4] - ldr r0, =0x000003ff - cmp r1, r0 - bne _081937E4 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r5, 0 - bl StringCopy - b _08193802 - .pool -_081937E4: - ldr r0, =0x000003fe - cmp r1, r0 - bne _081937F8 - adds r0, r5, 0 - bl sub_8195938 - b _08193802 - .pool -_081937F8: - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl sub_8195898 -_08193802: - ldr r0, =gStringVar1 - str r0, [sp, 0xC] - add r0, sp, 0xC - movs r6, 0 - add r7, sp, 0x68 - ldrb r7, [r7] - strb r7, [r0, 0x4] - ldrb r0, [r0, 0x5] - ldr r1, [sp, 0xC] - add r2, sp, 0xC - ldrb r3, [r2, 0xA] - movs r2, 0x40 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0xC - strb r0, [r1, 0x8] - adds r0, r1, 0 - movs r5, 0x2 - strb r5, [r0, 0x7] - strb r5, [r1, 0x9] - ldr r4, [sp, 0x68] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - add r0, sp, 0xC - strb r6, [r0, 0xA] - ldr r0, =gUnknown_0860D350 - ldr r1, [sp, 0x58] - adds r0, r1, r0 - ldr r0, [r0] - str r0, [sp, 0xC] - add r0, sp, 0xC - add r2, sp, 0x60 - ldrb r2, [r2] - strb r2, [r0, 0x4] - ldrb r0, [r0, 0x5] - ldr r1, [sp, 0xC] - add r2, sp, 0xC - ldrb r3, [r2, 0xA] - movs r2, 0xA0 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0xC - strb r0, [r1, 0x8] - adds r0, r1, 0 - strb r5, [r0, 0x7] - strb r5, [r1, 0x9] - ldr r4, [sp, 0x60] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - add sp, 0x80 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819314C - - thumb_func_start sub_81938A4 -sub_81938A4: @ 81938A4 - push {lr} - ldr r0, =sub_8194220 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - strh r2, [r1, 0x8] - strh r2, [r1, 0xA] - movs r0, 0x2 - strh r0, [r1, 0xC] - strh r2, [r1, 0x10] - ldr r0, =sub_8194B54 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81938A4 - - thumb_func_start sub_81938E0 -sub_81938E0: @ 81938E0 - push {r4,lr} - bl sub_8194D48 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - ldr r1, =0x00000d0a - adds r0, r2, r1 - ldrb r1, [r0] - subs r1, 0x1 - ldr r0, =0x00000ca9 - adds r2, r0 - movs r0, 0x3 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r4] - ldr r1, =0x00000cb2 - adds r0, r1 - movs r4, 0 - movs r1, 0x3 - strh r1, [r0] - ldr r0, =sub_8194220 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - strh r4, [r1, 0xA] - movs r0, 0x2 - strh r0, [r1, 0xC] - movs r0, 0x1 - strh r0, [r1, 0x10] - ldr r0, =sub_8194B54 - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81938E0 - - thumb_func_start sub_819395C -sub_819395C: @ 819395C - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0xA - ldrsh r7, [r0, r2] - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x7 - bls _0819397E - b _08193BC2 -_0819397E: - lsls r0, 2 - ldr r1, =_08193990 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08193990: - .4byte _081939B0 - .4byte _08193A00 - .4byte _08193A20 - .4byte _08193AA8 - .4byte _08193BC2 - .4byte _08193B20 - .4byte _08193BC2 - .4byte _08193B84 -_081939B0: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _081939C2 - b _08193BC2 -_081939C2: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x1 - bl StartSpriteAnim - b _08193BC2 - .pool -_08193A00: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08193A0E - b _08193BC2 -_08193A0E: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193A20: - adds r0, r5, 0 - bl sub_8193BDC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08193A30 - b _08193BC2 -_08193A30: - cmp r0, 0x1 - ble _08193A3C - cmp r0, 0x2 - beq _08193A60 - cmp r0, 0x3 - beq _08193A84 -_08193A3C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x7 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193A60: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x3 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193A84: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x5 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193AA8: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _08193ABA - b _08193BC2 -_08193ABA: - bl FreeAllWindowBuffers - bl remove_some_task - ldr r4, =gUnknown_0203CD7C - ldr r0, [r4] - bl Free - str r6, [r4] - ldr r0, =sub_8190400 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gTasks - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r2 - movs r3, 0 - strh r6, [r1, 0x8] - ldr r0, =gUnknown_0860D080 - adds r0, r7, r0 - ldrb r0, [r0] - strh r0, [r1, 0xA] - movs r0, 0x1 - strh r0, [r1, 0xC] - strh r5, [r1, 0xE] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0x4 - strh r1, [r0, 0x8] - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - strb r3, [r0, 0x10] - b _08193BC2 - .pool -_08193B20: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08193BC2 - bl FreeAllWindowBuffers - bl remove_some_task - ldr r4, =gUnknown_0203CD7C - ldr r0, [r4] - bl Free - str r6, [r4] - ldr r0, =sub_8190400 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gTasks - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r2 - strh r6, [r0, 0x8] - adds r1, r7, 0 - subs r1, 0x10 - strh r1, [r0, 0xA] - movs r1, 0x2 - strh r1, [r0, 0xC] - strh r5, [r0, 0xE] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0x6 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193B84: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08193BC2 - bl FreeAllWindowBuffers - bl remove_some_task - ldr r4, =gUnknown_0203CD7C - ldr r0, [r4] - bl Free - str r6, [r4] - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x16] - bl DestroyTask - adds r0, r5, 0 - bl DestroyTask -_08193BC2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819395C - - thumb_func_start sub_8193BDC -sub_8193BDC: @ 8193BDC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x1 - mov r9, r0 - movs r1, 0x4 - mov r8, r1 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0xA - ldrsh r5, [r0, r1] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r6, [r0] - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - adds r2, r1, 0 - adds r3, r0, 0 - cmp r2, 0x2 - beq _08193C20 - mov r0, r9 - ands r0, r1 - cmp r0, 0 - beq _08193C58 - cmp r5, 0x1F - bne _08193C3C -_08193C20: - movs r0, 0x5 - bl PlaySE - movs r0, 0 - mov r9, r0 - b _08193CDE - .pool -_08193C3C: - cmp r5, 0xF - bgt _08193C4C - movs r0, 0x5 - bl PlaySE - movs r1, 0x2 - mov r9, r1 - b _08193CDE -_08193C4C: - movs r0, 0x5 - bl PlaySE - movs r0, 0x3 - mov r9, r0 - b _08193CDE -_08193C58: - cmp r2, 0x40 - bne _08193C78 - ldr r0, =gUnknown_0860CBF1 - lsls r1, r5, 2 - adds r1, r5 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08193C78 - movs r1, 0 - mov r8, r1 - b _08193CDE - .pool -_08193C78: - ldrh r0, [r3, 0x2E] - cmp r0, 0x80 - bne _08193C9C - ldr r0, =gUnknown_0860CBF1 - lsls r1, r5, 2 - adds r1, r5 - adds r1, r6 - lsls r1, 2 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08193C9C - movs r0, 0x1 - b _08193CDC - .pool -_08193C9C: - ldrh r0, [r3, 0x2E] - cmp r0, 0x20 - bne _08193CC0 - ldr r0, =gUnknown_0860CBF1 - lsls r1, r5, 2 - adds r1, r5 - adds r1, r6 - lsls r1, 2 - adds r0, 0x2 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08193CC0 - movs r1, 0x2 - mov r8, r1 - b _08193CDE - .pool -_08193CC0: - ldrh r0, [r3, 0x2E] - cmp r0, 0x10 - bne _08193CDE - ldr r0, =gUnknown_0860CBF1 - lsls r1, r5, 2 - adds r1, r5 - adds r1, r6 - lsls r1, 2 - adds r0, 0x3 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08193CDE - movs r0, 0x3 -_08193CDC: - mov r8, r0 -_08193CDE: - mov r1, r8 - cmp r1, 0x4 - beq _08193D26 - movs r0, 0x5 - bl PlaySE - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - movs r1, 0 - bl StartSpriteAnim - ldr r2, =gUnknown_0860CBF1 - lsls r1, r6, 2 - add r1, r8 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrb r5, [r1] - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAnim - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0xA] -_08193D26: - mov r0, r9 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8193BDC - - thumb_func_start sub_8193D40 -sub_8193D40: @ 8193D40 - push {lr} - ldr r0, =sub_8194220 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - strh r2, [r1, 0x8] - movs r0, 0x1 - strh r0, [r1, 0xA] - movs r0, 0x2 - strh r0, [r1, 0xC] - strh r2, [r1, 0x10] - ldr r0, =sub_8194B54 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8193D40 - - thumb_func_start sub_8193D7C -sub_8193D7C: @ 8193D7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r7, =gSpecialVar_0x8005 - ldrh r0, [r7] - cmp r0, 0x1 - bne _08193E10 - ldr r5, =gUnknown_02038BCA - ldrh r0, [r5] - bl sub_8195358 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - lsls r0, 2 - adds r2, r0 - ldr r6, =0x00000d25 - adds r2, r6 - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r5] - bl sub_8195358 - ldr r1, [r4] - lsls r0, 2 - adds r0, r1, r0 - ldr r2, =0x00000cb2 - mov r8, r2 - add r1, r8 - adds r0, r6 - movs r3, 0x3 - ldrb r2, [r1] - ands r2, r3 - lsls r2, 3 - ldrb r3, [r0] - movs r1, 0x19 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0] - ldrh r0, [r5] - bl sub_8195358 - ldr r2, [r4] - lsls r0, 1 - movs r3, 0xEC - lsls r3, 4 - adds r1, r2, r3 - adds r1, r0 - ldr r0, =gUnknown_03005D10 - ldrh r0, [r0, 0x22] - strh r0, [r1] - add r2, r8 - ldrh r0, [r2] - cmp r0, 0x2 - bhi _08193EAE - lsls r0, 24 - lsrs r0, 24 - bl sub_8195438 - b _08193EAE - .pool -_08193E10: - ldr r5, =0x000003ff - adds r0, r5, 0 - bl sub_8195358 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - lsls r0, 2 - adds r2, r0 - ldr r6, =0x00000d25 - adds r2, r6 - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - adds r0, r5, 0 - bl sub_8195358 - ldr r1, [r4] - lsls r0, 2 - adds r0, r1, r0 - ldr r2, =0x00000cb2 - adds r1, r2 - adds r0, r6 - movs r3, 0x3 - ldrb r2, [r1] - ands r2, r3 - lsls r2, 3 - ldrb r3, [r0] - movs r1, 0x19 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0] - adds r0, r5, 0 - bl sub_8195358 - ldr r1, [r4] - lsls r0, 1 - movs r3, 0xEC - lsls r3, 4 - adds r1, r3 - adds r1, r0 - ldr r0, =gUnknown_03005D10 - ldrh r0, [r0, 0x24] - strh r0, [r1] - ldr r0, =gBattleOutcome - ldrb r0, [r0] - cmp r0, 0x9 - beq _08193E78 - ldrh r0, [r7] - cmp r0, 0x9 - bne _08193E92 -_08193E78: - adds r0, r5, 0 - bl sub_8195358 - ldr r2, [r4] - lsls r0, 2 - adds r2, r0 - adds r2, r6 - ldrb r1, [r2] - movs r0, 0x1F - ands r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2] -_08193E92: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r4, [r0] - cmp r4, 0x3 - bgt _08193EAE -_08193EA0: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_8195438 - adds r4, 0x1 - cmp r4, 0x3 - ble _08193EA0 -_08193EAE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8193D7C - - thumb_func_start sub_8193ED0 -sub_8193ED0: @ 8193ED0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x84 - str r0, [sp, 0x48] - str r1, [sp, 0x4C] - lsls r4, r2, 24 - lsrs r4, 24 - movs r0, 0 - str r0, [sp, 0x54] - movs r1, 0 - str r1, [sp, 0x58] - bl sub_8165C40 - movs r2, 0 - str r2, [sp, 0x50] - add r3, sp, 0x30 - mov r10, r3 - ldr r5, [sp, 0x4C] - lsls r5, 1 - str r5, [sp, 0x70] - subs r4, 0x1 - str r4, [sp, 0x78] -_08193F02: - movs r0, 0 - mov r9, r0 - ldr r1, [sp, 0x50] - lsls r1, 2 - str r1, [sp, 0x74] - ldr r2, [sp, 0x48] - lsls r2, 2 - str r2, [sp, 0x6C] - ldr r3, [sp, 0x50] - adds r3, 0x1 - str r3, [sp, 0x60] -_08193F18: - ldr r4, [sp, 0x74] - add r4, r9 - lsls r0, r4, 2 - mov r5, sp - adds r1, r5, r0 - movs r0, 0 - str r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r1, [sp, 0x6C] - adds r0, r3, r1 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - ldr r1, =0xff800000 - cmp r0, r1 - bne _08193F60 - ldr r3, [sp, 0x50] - lsls r0, r3, 24 - mov r5, r9 - lsls r1, r5, 24 - lsrs r1, 24 - lsrs r0, 24 - bl sub_81A5060 - lsls r1, r4, 1 - add r1, r10 - strh r0, [r1] - b _08193F8C - .pool -_08193F60: - lsls r2, r4, 1 - add r2, r10 - ldr r1, [sp, 0x48] - lsls r0, r1, 1 - adds r0, r1 - ldr r4, [sp, 0x50] - adds r0, r4 - lsls r0, 1 - ldr r5, =0x00000d64 - adds r1, r3, r5 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - mov r3, r9 - lsls r1, r3, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] -_08193F8C: - ldr r0, =gBattleMoves - ldr r1, [sp, 0x74] - add r1, r9 - lsls r1, 1 - add r1, r10 - ldrh r2, [r1] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r6, [r1, 0x1] - cmp r6, 0 - bne _08193FB8 - movs r6, 0x28 - b _08193FD0 - .pool -_08193FB8: - cmp r6, 0x1 - bne _08193FC0 - movs r6, 0x3C - b _08193FD0 -_08193FC0: - adds r1, r2, 0 - cmp r1, 0x78 - beq _08193FCA - cmp r1, 0x99 - bne _08193FD0 -_08193FCA: - lsrs r0, r6, 31 - adds r0, r6, r0 - asrs r6, r0, 1 -_08193FD0: - movs r1, 0 - mov r4, r9 - adds r4, 0x1 - str r4, [sp, 0x64] - ldr r5, [sp, 0x70] - ldr r2, [sp, 0x4C] - adds r0, r5, r2 - lsls r0, 1 - str r0, [sp, 0x5C] -_08193FE2: - lsls r7, r1, 1 - adds r1, 0x1 - str r1, [sp, 0x68] - ldr r3, [sp, 0x5C] - adds r3, r7 - mov r8, r3 -_08193FEE: - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r5, r4, 16 - lsls r0, 16 - orrs r5, r0 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r4, =0x00000d64 - adds r0, r4 - add r0, r8 - ldrh r4, [r0] - ldr r3, =gUnknown_0203BC8C - ldr r0, [r3] - lsls r4, 4 - adds r4, r0 - adds r0, r5, 0 - str r2, [sp, 0x7C] - str r3, [sp, 0x80] - bl GetNatureFromPersonality - ldrb r1, [r4, 0xC] - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x7C] - ldr r3, [sp, 0x80] - cmp r1, r0 - bne _08193FEE - ldr r0, [r2] - ldr r2, [sp, 0x5C] - adds r1, r7, r2 - ldr r4, =0x00000d64 - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x1 - ands r5, r0 - cmp r5, 0 - beq _08194068 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r5, =gBaseStats - adds r0, r5 - ldrb r2, [r0, 0x17] - b _08194074 - .pool -_08194068: - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r2, =gBaseStats - adds r0, r2 - ldrb r2, [r0, 0x16] -_08194074: - ldr r4, [sp, 0x74] - add r4, r9 - lsls r0, r4, 1 - add r0, r10 - ldrh r0, [r0] - bl ai_rate_move - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x6 - ands r0, r5 - cmp r0, 0x6 - bne _0819409C - lsls r0, r4, 2 - mov r3, sp - adds r1, r3, r0 - b _081940D8 - .pool -_0819409C: - movs r0, 0x29 - ands r0, r5 - cmp r0, 0 - bne _081940DE - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _081940B6 - lsls r0, r4, 2 - mov r5, sp - adds r2, r5, r0 - lsls r1, r6, 1 - b _081940CA -_081940B6: - movs r0, 0x4 - ands r5, r0 - cmp r5, 0 - beq _081940D2 - lsls r0, r4, 2 - mov r1, sp - adds r2, r1, r0 - lsrs r1, r6, 31 - adds r1, r6, r1 - asrs r1, 1 -_081940CA: - ldr r0, [r2] - adds r0, r1 - str r0, [r2] - b _081940DE -_081940D2: - lsls r0, r4, 2 - mov r2, sp - adds r1, r2, r0 -_081940D8: - ldr r0, [r1] - adds r0, r6 - str r0, [r1] -_081940DE: - ldr r1, [sp, 0x68] - cmp r1, 0x2 - bgt _081940E6 - b _08193FE2 -_081940E6: - ldr r2, [sp, 0x74] - add r2, r9 - lsls r0, r2, 2 - add r0, sp - ldr r1, [r0] - ldr r3, [sp, 0x54] - cmp r3, r1 - bge _08194104 - lsls r0, r2, 16 - lsrs r0, 16 - str r0, [sp, 0x58] - lsls r0, r1, 16 - lsrs r0, 16 - str r0, [sp, 0x54] - b _08194122 -_08194104: - ldr r4, [sp, 0x54] - cmp r4, r1 - bne _08194122 - ldr r5, [sp, 0x58] - lsls r0, r5, 1 - add r0, r10 - lsls r1, r2, 1 - add r1, r10 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - bcs _08194122 - lsls r0, r2, 16 - lsrs r0, 16 - str r0, [sp, 0x58] -_08194122: - ldr r0, [sp, 0x64] - mov r9, r0 - cmp r0, 0x3 - bgt _0819412C - b _08193F18 -_0819412C: - ldr r1, [sp, 0x60] - str r1, [sp, 0x50] - cmp r1, 0x2 - bgt _08194136 - b _08193F02 -_08194136: - ldr r2, [sp, 0x58] - mov r9, r2 - b _08194182 -_0819413C: - movs r3, 0 - mov r9, r3 - movs r1, 0 - mov r4, r10 - mov r3, r10 - mov r2, sp -_08194148: - ldr r0, [r2] - ldr r5, [sp, 0x54] - cmp r5, r0 - bge _0819415A - mov r9, r1 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x54] - b _08194170 -_0819415A: - ldr r5, [sp, 0x54] - cmp r5, r0 - bne _08194170 - mov r5, r9 - lsls r0, r5, 1 - adds r0, r4, r0 - ldrh r0, [r0] - ldrh r5, [r3] - cmp r0, r5 - bcs _08194170 - mov r9, r1 -_08194170: - adds r3, 0x2 - adds r2, 0x4 - adds r1, 0x1 - cmp r1, 0xB - ble _08194148 - ldr r0, [sp, 0x50] - ldr r1, [sp, 0x78] - cmp r0, r1 - beq _081941F4 -_08194182: - movs r2, 0 - str r2, [sp, 0x50] - mov r3, r9 - lsls r7, r3, 2 - ldr r4, [sp, 0x78] - cmp r2, r4 - bge _081941CA - lsls r0, r3, 1 - mov r5, r10 - adds r6, r5, r0 - ldr r0, [sp, 0x48] - lsls r5, r0, 24 -_0819419A: - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r2, [sp, 0x50] - lsls r1, r2, 24 - lsrs r1, 24 - lsrs r0, r5, 24 - bl sub_81953E8 - lsls r0, 24 - lsrs r0, 23 - movs r3, 0xEC - lsls r3, 4 - adds r4, r3 - adds r4, r0 - ldrh r0, [r4] - ldrh r4, [r6] - cmp r0, r4 - beq _081941CA - ldr r0, [sp, 0x50] - adds r0, 0x1 - str r0, [sp, 0x50] - ldr r1, [sp, 0x78] - cmp r0, r1 - blt _0819419A -_081941CA: - ldr r2, [sp, 0x50] - ldr r3, [sp, 0x78] - cmp r2, r3 - beq _081941F4 - mov r4, sp - adds r1, r4, r7 - movs r0, 0 - str r0, [r1] - movs r5, 0 - str r5, [sp, 0x54] - mov r9, r5 - mov r2, sp - movs r1, 0xB -_081941E4: - ldm r2!, {r0} - add r9, r0 - subs r1, 0x1 - cmp r1, 0 - bge _081941E4 - mov r0, r9 - cmp r0, 0 - bne _0819413C -_081941F4: - mov r1, r9 - lsls r0, r1, 2 - add r0, sp - ldr r0, [r0] - cmp r0, 0 - bne _08194204 - ldr r2, [sp, 0x58] - mov r9, r2 -_08194204: - mov r3, r9 - lsls r0, r3, 1 - add r0, r10 - ldrh r0, [r0] - add sp, 0x84 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8193ED0 - - thumb_func_start sub_8194220 -sub_8194220: @ 8194220 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r2, 0xA - ldrsh r1, [r0, r2] - mov r10, r1 - movs r3, 0xC - ldrsh r4, [r0, r3] - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x5 - bls _08194250 - b _081948C2 -_08194250: - lsls r0, 2 - ldr r1, =_08194264 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08194264: - .4byte _0819427C - .4byte _0819431C - .4byte _0819438C - .4byte _0819447C - .4byte _081944FC - .4byte _081947C8 -_0819427C: - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0x3 - bl EnableInterrupts - movs r4, 0 - str r4, [sp, 0x14] - add r0, sp, 0x14 - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - bl CpuSet - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0860CE74 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_0860CE94 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r0, =gUnknown_02022E14 - strh r4, [r0] - ldr r0, =gUnknown_02022E16 - strh r4, [r0] - ldr r0, =gUnknown_02022E18 - strh r4, [r0] - ldr r0, =gUnknown_02022E1A - strh r4, [r0] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r1, 0xB0 - lsls r1, 4 - movs r0, 0x3 - movs r2, 0 - bl ChangeBgY - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - b _0819443C - .pool -_0819431C: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r1, =0x00005860 - movs r0, 0x40 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0x9F - bl SetGpuReg - ldr r1, =0x00009098 - movs r0, 0x42 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0x9F - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x3F - bl SetGpuReg - bl ResetPaletteFade - bl ResetSpriteData - bl FreeAllSpritePalettes - ldr r1, =gTasks - mov r3, r8 - lsls r0, r3, 2 - b _0819443C - .pool -_0819438C: - ldr r4, =gUnknown_0203CD7C - movs r0, 0x80 - lsls r0, 4 - bl AllocZeroed - adds r1, r0, 0 - str r1, [r4] - ldr r0, =gUnknown_08D83900 - bl LZDecompressWram - ldr r1, [r4] - movs r0, 0x1 - bl SetBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - ldr r1, =gUnknown_08D82F10 - movs r5, 0x80 - lsls r5, 6 - movs r6, 0 - str r6, [sp] - movs r0, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D834FC - str r6, [sp] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D83B2C - movs r4, 0x1 - str r4, [sp] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D83C3C - str r4, [sp] - movs r0, 0x3 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r0, =gUnknown_08D85358 - movs r4, 0x80 - lsls r4, 2 - movs r1, 0 - adds r2, r4, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85444 - movs r1, 0x80 - lsls r1, 1 - adds r2, r4, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85600 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadCompressedPalette - str r6, [sp, 0x18] - add r0, sp, 0x18 - ldr r1, =gPlttBufferFaded - ldr r2, =0x05000100 - bl CpuSet - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldr r1, =gTasks - mov r4, r8 - lsls r0, r4, 2 -_0819443C: - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _081948C2 - .pool -_0819447C: - ldr r0, =gUnknown_0860CF50 - bl LoadCompressedObjectPic - mov r0, r8 - lsls r0, 2 - str r0, [sp, 0x1C] - mov r1, r10 - cmp r1, 0 - bne _081944E8 - movs r5, 0 - ldr r4, =gUnknown_0860D411 -_08194492: - ldrb r1, [r4] - ldrb r2, [r4, 0x1] - ldr r0, =gUnknown_0860CFA8 - movs r3, 0 - bl CreateSprite - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x1E - bls _08194492 - ldr r0, =gTasks - ldr r1, [sp, 0x1C] - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r2, 0x10 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _081944DC - ldr r0, =gUnknown_0860D008 - movs r1, 0xDA - movs r2, 0xC - movs r3, 0 - bl CreateSprite - b _081944E8 - .pool -_081944DC: - ldr r0, =gUnknown_0860CFD8 - movs r1, 0xDA - movs r2, 0xC - movs r3, 0 - bl CreateSprite -_081944E8: - ldr r1, =0x00007f40 - movs r0, 0 - bl SetGpuReg - b _081947A6 - .pool -_081944FC: - add r0, sp, 0x4 - movs r2, 0 - movs r1, 0x2 - strb r1, [r0, 0x5] - ldr r0, =gUnknown_085CCCEE - str r0, [sp, 0x4] - add r0, sp, 0x4 - strb r1, [r0, 0x4] - strb r2, [r0, 0x6] - strb r2, [r0, 0x7] - strb r1, [r0, 0xA] - strb r2, [r0, 0xB] - ldrb r0, [r0, 0x5] - ldr r1, [sp, 0x4] - add r2, sp, 0x4 - ldrb r3, [r2, 0xA] - movs r2, 0x70 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0x4 - strb r0, [r1, 0x8] - movs r0, 0x1 - strb r0, [r1, 0x9] - adds r3, r1, 0 - ldrb r2, [r3, 0xC] - movs r1, 0x10 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - adds r2, r3, 0 - movs r0, 0xE0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - adds r1, r2, 0 - movs r0, 0xD0 - strb r0, [r1, 0xD] - adds r0, r1, 0 - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - mov r3, r8 - lsls r3, 2 - str r3, [sp, 0x1C] - add r4, sp, 0x4 - movs r0, 0xF - mov r9, r0 - movs r1, 0 - str r1, [sp, 0x20] - movs r2, 0 - str r2, [sp, 0x24] - movs r7, 0 - movs r5, 0xF -_0819456C: - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - adds r0, r7 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 22 - lsrs r1, 22 - ldr r0, =gUnknown_02022E2C - bl sub_8195898 - mov r2, r10 - cmp r2, 0x1 - bne _081945C4 - ldr r3, =gSaveBlock2Ptr - ldr r2, [r3] - adds r0, r2, r7 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 29 - cmp r0, 0 - blt _081945DC - ldr r3, =0x00000cb2 - adds r0, r2, r3 - ldrh r1, [r0] - cmp r1, 0x1 - beq _08194634 - ldr r2, [sp, 0x24] - lsrs r0, r2, 24 - subs r1, 0x2 - b _081945EA - .pool -_081945C4: - mov r3, r10 - cmp r3, 0 - bne _08194634 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r0, r2, r7 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 29 - cmp r0, 0 - bge _081945FC -_081945DC: - lsls r1, 27 - lsrs r0, r1, 30 - cmp r0, 0 - beq _08194634 - subs r1, r0, 0x1 - ldr r2, [sp, 0x24] - lsrs r0, r2, 24 -_081945EA: - lsls r1, 24 - lsrs r1, 24 - bl sub_81948EC - b _08194634 - .pool -_081945FC: - ldr r3, =0x00000cb2 - adds r1, r2, r3 - ldrh r0, [r1] - cmp r0, 0 - beq _08194634 - ldr r0, [sp, 0x1C] - add r0, r8 - lsls r0, 3 - ldr r2, =gTasks - adds r0, r2 - movs r3, 0x10 - ldrsh r0, [r0, r3] - cmp r0, 0 - beq _08194624 - ldrh r1, [r1] - b _08194628 - .pool -_08194624: - ldrh r0, [r1] - subs r1, r0, 0x1 -_08194628: - ldr r2, [sp, 0x24] - lsrs r0, r2, 24 - lsls r1, 24 - lsrs r1, 24 - bl sub_81948EC -_08194634: - ldr r0, [sp, 0x1C] - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r1, 0x10 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08194660 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r3, =0x00000cb2 - adds r0, r3 - ldrh r3, [r0] - adds r6, r2, 0 - b _0819466E - .pool -_08194660: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000cb2 - adds r0, r2 - ldrh r0, [r0] - subs r3, r0, 0x1 - adds r6, r1, 0 -_0819466E: - mov r0, r10 - cmp r0, 0x1 - bne _0819468E - ldr r2, [r6] - adds r0, r2, r7 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r1, [r0] - lsls r1, 27 - lsrs r1, 30 - ldr r0, =0x00000cb2 - adds r2, r0 - ldrh r0, [r2] - subs r0, 0x1 - cmp r1, r0 - blt _081946A6 -_0819468E: - mov r1, r10 - cmp r1, 0 - bne _081946FA - ldr r0, [r6] - adds r0, r7 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 30 - cmp r0, r3 - bgt _081946FA -_081946A6: - ldr r0, [r6] - adds r1, r0, r7 - ldr r3, =0x00000d25 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081946FA - ldr r2, =0x00000d24 - adds r0, r1, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - ldr r3, =0x000003ff - cmp r0, r3 - bne _081946F0 - ldrb r1, [r4, 0xC] - mov r0, r9 - ands r0, r1 - movs r1, 0x30 - orrs r0, r1 - strb r0, [r4, 0xC] - ldrb r1, [r4, 0xD] - mov r0, r9 - ands r0, r1 - movs r1, 0x40 - b _08194740 - .pool -_081946F0: - ldrb r1, [r4, 0xC] - mov r0, r9 - ands r0, r1 - movs r1, 0xB0 - b _08194734 -_081946FA: - ldr r0, [r6] - adds r0, r7 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - ldr r2, =0x000003ff - cmp r0, r2 - bne _0819472C - ldrb r1, [r4, 0xC] - mov r0, r9 - ands r0, r1 - movs r1, 0x30 - orrs r0, r1 - strb r0, [r4, 0xC] - ldrb r1, [r4, 0xD] - mov r0, r9 - ands r0, r1 - movs r1, 0x40 - b _08194740 - .pool -_0819472C: - ldrb r1, [r4, 0xC] - mov r0, r9 - ands r0, r1 - movs r1, 0xE0 -_08194734: - orrs r0, r1 - strb r0, [r4, 0xC] - ldrb r1, [r4, 0xD] - mov r0, r9 - ands r0, r1 - movs r1, 0xD0 -_08194740: - orrs r0, r1 - strb r0, [r4, 0xD] - ldr r0, =gUnknown_0860D3F1 - ldr r3, [sp, 0x20] - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _08194768 - ldrb r0, [r4, 0x5] - ldrb r3, [r4, 0xA] - ldr r1, =gUnknown_02022E2C - movs r2, 0x3D - bl GetStringWidthDifference - b _0819476A - .pool -_08194768: - movs r0, 0x3 -_0819476A: - strb r0, [r4, 0x8] - ldr r0, =gUnknown_02022E2C - str r0, [sp, 0x4] - ldr r0, =gUnknown_0860D3F1 - ldr r1, [sp, 0x20] - adds r0, r1, r0 - ldrb r0, [r0] - strb r0, [r4, 0x4] - ldr r2, =gUnknown_0860D3F2 - adds r0, r1, r2 - ldrb r0, [r0] - strb r0, [r4, 0x9] - add r0, sp, 0x4 - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - ldr r3, [sp, 0x20] - adds r3, 0x2 - str r3, [sp, 0x20] - ldr r0, [sp, 0x24] - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - str r0, [sp, 0x24] - adds r7, 0x4 - subs r5, 0x1 - cmp r5, 0 - blt _081947A6 - b _0819456C -_081947A6: - ldr r0, =gTasks - ldr r1, [sp, 0x1C] - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _081948C2 - .pool -_081947C8: - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =sub_8194BEC - bl SetHBlankCallback - ldr r0, =sub_8194CE4 - bl SetVBlankCallback - cmp r4, 0x2 - bne _0819485C - mov r2, r10 - cmp r2, 0 - bne _08194844 - ldr r0, =sub_819395C - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r2 - mov r3, r10 - strh r3, [r1, 0x8] - strh r3, [r1, 0xA] - mov r4, r8 - lsls r0, r4, 2 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0x10] - strh r0, [r1, 0x14] - b _08194878 - .pool -_08194844: - ldr r0, =sub_8194950 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - b _0819486C - .pool -_0819485C: - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r3, 0xE - ldrsh r5, [r0, r3] -_0819486C: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] -_08194878: - bl dp12_8087EA4 - ldr r0, =gUnknown_02038C28 - ldr r2, =0x00001f0a - movs r4, 0xF0 - lsls r4, 3 - adds r1, r0, r4 - movs r5, 0x5A -_08194888: - strh r2, [r0] - strh r2, [r1] - adds r1, 0x2 - adds r0, 0x2 - subs r5, 0x1 - cmp r5, 0 - bge _08194888 - movs r5, 0x5B - ldr r3, =gUnknown_0860CF44 - ldr r0, =gUnknown_02038C28 - ldr r2, =0x00001f09 - ldr r4, =0x00000836 - adds r1, r0, r4 - adds r0, 0xB6 -_081948A4: - strh r2, [r0] - strh r2, [r1] - adds r1, 0x2 - adds r0, 0x2 - adds r5, 0x1 - cmp r5, 0x9F - ble _081948A4 - ldr r0, [r3] - ldr r1, [r3, 0x4] - ldr r2, [r3, 0x8] - bl sub_80BA038 - mov r0, r8 - bl DestroyTask -_081948C2: - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194220 - - thumb_func_start sub_81948EC -sub_81948EC: @ 81948EC - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r4, =gUnknown_0860DD10 - lsls r2, r1, 2 - lsls r3, r0, 4 - adds r2, r3 - adds r2, r4 - ldr r3, [r2] - ldr r2, =gUnknown_0860DE10 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _08194938 - movs r7, 0x1 - adds r4, r3, 0 - adds r5, r4, 0x2 - adds r6, r0, 0 -_0819491A: - ldrb r2, [r4] - ldrb r3, [r4, 0x1] - str r7, [sp] - str r7, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - adds r1, r5, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - adds r4, 0x4 - adds r5, 0x4 - subs r6, 0x1 - cmp r6, 0 - bne _0819491A -_08194938: - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81948EC - - thumb_func_start sub_8194950 -sub_8194950: @ 8194950 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bls _08194974 - b _08194B3C -_08194974: - lsls r0, 2 - ldr r1, =_08194988 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08194988: - .4byte _0819499C - .4byte _081949C0 - .4byte _08194AD4 - .4byte _08194AEE - .4byte _08194B24 -_0819499C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - b _08194B3C - .pool -_081949C0: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081949CE - b _08194B3C -_081949CE: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - movs r2, 0 - movs r3, 0x2 - movs r1, 0x2 - strh r1, [r0, 0x8] - movs r1, 0x40 - strh r1, [r0, 0xE] - add r0, sp, 0x4 - strb r3, [r0, 0x5] - strb r2, [r0, 0x6] - strb r2, [r0, 0x7] - strb r3, [r0, 0xA] - strb r2, [r0, 0xB] - adds r3, r0, 0 - ldrb r2, [r3, 0xC] - subs r1, 0x50 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - adds r2, r3, 0 - movs r0, 0xB0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - adds r1, r2, 0 - movs r0, 0xD0 - strb r0, [r1, 0xD] - movs r7, 0 - ldr r0, =gUnknown_02022E2C - mov r9, r0 - ldr r1, =gSaveBlock2Ptr - mov r8, r1 - adds r4, r2, 0 - ldr r6, =gUnknown_0860D3F1 - movs r5, 0 -_08194A1C: - mov r2, r8 - ldr r0, [r2] - adds r0, r5 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 22 - lsrs r1, 22 - mov r0, r9 - bl sub_8195898 - mov r0, r8 - ldr r2, [r0] - adds r0, r2, r5 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r3, [r0] - lsls r1, r3, 27 - lsrs r1, 30 - ldr r0, =0x00000cb2 - adds r2, r0 - ldrh r0, [r2] - subs r0, 0x1 - cmp r1, r0 - bne _08194A9E - lsls r0, r3, 29 - cmp r0, 0 - bge _08194A9E - ldrb r0, [r6] - cmp r0, 0 - bne _08194A84 - ldrb r0, [r4, 0x5] - ldrb r3, [r4, 0xA] - mov r1, r9 - movs r2, 0x3D - bl GetStringWidthDifference - b _08194A86 - .pool -_08194A84: - movs r0, 0x3 -_08194A86: - strb r0, [r4, 0x8] - mov r1, r9 - str r1, [sp, 0x4] - ldrb r0, [r6] - strb r0, [r4, 0x4] - ldrb r0, [r6, 0x1] - strb r0, [r4, 0x9] - add r0, sp, 0x4 - movs r1, 0 - movs r2, 0 - bl AddTextPrinter -_08194A9E: - mov r2, r8 - ldr r1, [r2] - adds r0, r1, r5 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08194AC4 - subs r2, 0x73 - adds r0, r1, r2 - ldrh r1, [r0] - subs r1, 0x1 - lsls r0, r7, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - bl sub_81948EC -_08194AC4: - adds r6, 0x2 - adds r5, 0x4 - adds r7, 0x1 - cmp r7, 0xF - ble _08194A1C - b _08194B3C - .pool -_08194AD4: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0xE] - subs r0, 0x1 - strh r0, [r1, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _08194B3C - movs r0, 0x3 - strh r0, [r1, 0x8] - b _08194B3C -_08194AEE: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08194B3C - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x4 - strh r1, [r0, 0x8] - b _08194B3C - .pool -_08194B24: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08194B3C - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_08194B3C: - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194950 - - thumb_func_start sub_8194B54 -sub_8194B54: @ 8194B54 - push {lr} - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_8194B54 - - thumb_func_start sub_8194B70 -sub_8194B70: @ 8194B70 - push {lr} - movs r0, 0x3 - movs r1, 0x80 - movs r2, 0x1 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0x80 - movs r2, 0x2 - bl ChangeBgY - ldr r0, =gUnknown_02022E14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =gUnknown_02022E16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =gUnknown_02022E18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =gUnknown_02022E1A - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, =gUnknown_02022E1C - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - ldr r0, =gUnknown_02022E1E - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194B70 - - thumb_func_start sub_8194BEC -sub_8194BEC: @ 8194BEC - push {lr} - ldr r0, =0x04000006 - ldrh r0, [r0] - adds r1, r0, 0 - cmp r0, 0x29 - bls _08194CC8 - cmp r0, 0x31 - bhi _08194C1C - ldr r1, =0x04000048 - ldr r2, =0x00003b3b - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x989b5558 - b _08194CD4 - .pool -_08194C1C: - cmp r0, 0x39 - bls _08194CC8 - cmp r0, 0x4A - bhi _08194C40 - ldr r1, =0x04000048 - ldr r2, =0x00003b3b - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x90985860 - b _08194CD4 - .pool -_08194C40: - cmp r0, 0x51 - bhi _08194C60 - ldr r1, =0x04000048 - ldr r2, =0x00003b3b - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x989b5558 - b _08194CD4 - .pool -_08194C60: - cmp r0, 0x5E - bls _08194CC8 - cmp r0, 0x66 - bhi _08194C84 - ldr r1, =0x04000048 - ldr r2, =0x00003737 - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x989b5558 - b _08194CD4 - .pool -_08194C84: - cmp r0, 0x76 - bhi _08194CA4 - ldr r1, =0x04000048 - ldr r2, =0x00003737 - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x90985860 - b _08194CD4 - .pool -_08194CA4: - cmp r0, 0x7E - bls _08194CC8 - cmp r1, 0x86 - bhi _08194CC8 - ldr r1, =0x04000048 - ldr r2, =0x00003737 - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x989b5558 - b _08194CD4 - .pool -_08194CC8: - ldr r1, =0x04000048 - ldr r2, =0x00003f3f - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - movs r0, 0 -_08194CD4: - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194BEC - - thumb_func_start sub_8194CE4 -sub_8194CE4: @ 8194CE4 - push {lr} - ldr r0, =gUnknown_02022E14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =gUnknown_02022E16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =gUnknown_02022E18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =gUnknown_02022E1A - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - movs r0, 0x2 - movs r1, 0x80 - movs r2, 0x2 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0x80 - movs r2, 0x1 - bl ChangeBgY - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194CE4 - - thumb_func_start sub_8194D48 -sub_8194D48: @ 8194D48 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8194D48 - - thumb_func_start sub_8194D68 -sub_8194D68: @ 8194D68 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r3, 0 -_08194D76: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =gUnknown_0203CEF8 - adds r0, r3, r0 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 1 - ldr r2, =0x00000caa - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - subs r0, 0x1 - mov r10, r0 - movs r6, 0 - adds r0, r3, 0x1 - str r0, [sp] - movs r1, 0x64 - mov r0, r10 - muls r0, r1 - movs r2, 0x8E - lsls r2, 2 - adds r2, r0 - mov r9, r2 - adds r7, r3, 0 - muls r7, r1 -_08194DA8: - movs r5, 0 - adds r0, r6, 0x1 - mov r8, r0 - b _08194DBE - .pool -_08194DBC: - adds r5, 0x1 -_08194DBE: - cmp r5, 0x3 - bgt _08194DEA - ldr r1, =gSaveBlock1Ptr - ldr r0, [r1] - add r0, r9 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - str r3, [sp, 0x4] - bl GetMonData - adds r4, r0, 0 - adds r1, r6, 0 - adds r1, 0xD - ldr r2, =gPlayerParty - adds r0, r7, r2 - movs r2, 0 - bl GetMonData - ldr r3, [sp, 0x4] - cmp r4, r0 - bne _08194DBC -_08194DEA: - cmp r5, 0x4 - bne _08194E00 - lsls r2, r6, 24 - lsrs r2, 24 - ldr r1, =gPlayerParty - adds r0, r7, r1 - movs r1, 0xA6 - str r3, [sp, 0x4] - bl sub_80691F4 - ldr r3, [sp, 0x4] -_08194E00: - mov r6, r8 - cmp r6, 0x3 - ble _08194DA8 - ldr r2, =gSaveBlock1Ptr - ldr r0, [r2] - movs r2, 0x64 - mov r1, r10 - muls r1, r2 - adds r0, r1 - movs r1, 0x8E - lsls r1, 2 - adds r0, r1 - adds r1, r3, 0 - muls r1, r2 - ldr r2, =gPlayerParty - adds r1, r2 - movs r2, 0x64 - bl memcpy - ldr r3, [sp] - cmp r3, 0x1 - ble _08194D76 - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194D68 - - thumb_func_start sub_8194E44 -sub_8194E44: @ 8194E44 - push {r4-r7,lr} - sub sp, 0x4 - movs r4, 0 - ldr r7, =gSaveBlock1Ptr - movs r6, 0x64 - movs r5, 0 -_08194E50: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =gUnknown_0203CEF8 - adds r0, r4, r0 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 1 - ldr r2, =0x00000caa - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - subs r0, 0x1 - adds r1, r0, 0 - muls r1, r6 - movs r0, 0x8E - lsls r0, 2 - adds r1, r0 - ldr r0, [r7] - adds r0, r1 - movs r1, 0xC - movs r2, 0 - bl GetMonData - mov r1, sp - strh r0, [r1] - ldr r0, =gPlayerParty - adds r0, r5, r0 - movs r1, 0xC - mov r2, sp - bl SetMonData - adds r5, 0x64 - adds r4, 0x1 - cmp r4, 0x1 - ble _08194E50 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194E44 - - thumb_func_start sub_8194EB4 -sub_8194EB4: @ 8194EB4 - push {lr} - bl sub_80F94E8 - pop {r0} - bx r0 - thumb_func_end sub_8194EB4 - - thumb_func_start sub_8194EC0 -sub_8194EC0: @ 8194EC0 - push {r4,lr} - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - bl sub_8195358 - adds r4, r0, 0 - ldr r0, =0x000003ff - bl sub_8195358 - cmp r4, r0 - ble _08194EE8 - ldr r1, =gScriptResult - movs r0, 0x1 - b _08194EEC - .pool -_08194EE8: - ldr r1, =gScriptResult - movs r0, 0x2 -_08194EEC: - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194EC0 - - thumb_func_start sub_8194EF8 -sub_8194EF8: @ 8194EF8 - push {r4,lr} - bl sub_8194D48 - movs r2, 0 - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _08194F2A - adds r4, r3, 0 - adds r3, r1, 0 -_08194F14: - adds r2, 0x1 - cmp r2, 0xF - bgt _08194F2A - ldr r0, [r4] - lsls r1, r2, 2 - adds r0, r1 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08194F14 -_08194F2A: - ldr r0, =gStringVar1 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsls r2, 2 - adds r1, r2 - ldr r2, =0x00000d24 - adds r1, r2 - ldrh r1, [r1] - lsls r1, 22 - lsrs r1, 22 - bl sub_8195898 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194EF8 - - thumb_func_start sub_8194F58 -sub_8194F58: @ 8194F58 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - ldr r5, =0x00000d0a - adds r0, r2, r5 - ldrb r1, [r0] - ldr r6, =0x00000d0b - adds r0, r2, r6 - ldrb r0, [r0] - cmn r1, r0 - beq _08194F8C - ldr r1, =0x00000ca8 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08194F8C - b _0819533E -_08194F8C: - movs r0, 0x20 - bl AllocZeroed - str r0, [sp, 0x18] - movs r0, 0x18 - bl AllocZeroed - str r0, [sp, 0x1C] - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r1, r2 - ldrb r2, [r1] - lsls r0, r2, 30 - lsrs r0, 30 - str r0, [sp, 0x14] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, [r4] - movs r1, 0x1 - adds r0, r5 - strb r1, [r0] - ldr r0, [r4] - adds r0, r6 - strb r1, [r0] - movs r3, 0 - mov r10, r3 - movs r4, 0 - str r4, [sp, 0x38] - movs r5, 0 - str r5, [sp, 0x3C] -_08194FCC: - mov r0, r10 - cmp r0, 0x4 - bgt _08194FFC - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - b _08195030 - .pool -_08194FFC: - mov r1, r10 - cmp r1, 0xE - bgt _0819501A - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r4, r0, 0 - adds r4, 0xA - b _08195030 -_0819501A: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r4, r0, 0 - adds r4, 0x1E -_08195030: - movs r6, 0 - cmp r6, r10 - bge _08195064 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r3, =0x00000d24 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r4 - beq _08195064 - adds r3, r2, 0 - ldr r2, =0x00000d24 -_0819504C: - adds r6, 0x1 - cmp r6, r10 - bge _08195064 - ldr r0, [r3] - lsls r1, r6, 2 - adds r0, r1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r4 - bne _0819504C -_08195064: - cmp r6, r10 - bne _08194FCC - ldr r5, =gSaveBlock2Ptr - ldr r3, [r5] - ldr r0, [sp, 0x38] - adds r3, r0 - ldr r1, =0x00000d24 - adds r3, r1 - ldr r2, =0x000003ff - adds r0, r2, 0 - adds r2, r4, 0 - ands r2, r0 - ldrh r0, [r3] - ldr r5, =0xfffffc00 - adds r1, r5, 0 - ands r0, r1 - orrs r0, r2 - strh r0, [r3] - movs r6, 0 - lsls r4, 16 - str r4, [sp, 0x30] - ldr r0, [sp, 0x3C] - str r0, [sp, 0x20] -_08195092: - adds r1, r6, 0x1 - str r1, [sp, 0x24] - lsls r2, r6, 2 - str r2, [sp, 0x2C] - lsls r3, r6, 1 - str r3, [sp, 0x28] -_0819509E: - ldr r4, [sp, 0x30] - lsrs r0, r4, 16 - bl sub_8163524 - lsls r0, 16 - lsrs r5, r0, 16 - movs r7, 0 - cmp r7, r6 - bge _081950F4 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gUnknown_0203BC8C - mov r9, r1 - ldr r2, [sp, 0x8] - mov r8, r2 - ldr r3, [sp, 0xC] - mov r12, r3 - ldr r4, =0x00000d64 - adds r0, r4 - ldr r1, [sp, 0x20] - adds r4, r1, r0 -_081950C8: - ldrh r3, [r4] - cmp r3, r5 - beq _081950F4 - mov r2, r9 - ldr r1, [r2] - lsls r0, r5, 4 - adds r2, r0, r1 - ldrh r0, [r2] - cmp r8, r0 - beq _081950F4 - cmp r12, r0 - beq _081950F4 - lsls r0, r3, 4 - adds r0, r1 - ldrb r0, [r0, 0xA] - ldrb r2, [r2, 0xA] - cmp r0, r2 - beq _081950F4 - adds r4, 0x2 - adds r7, 0x1 - cmp r7, r6 - blt _081950C8 -_081950F4: - cmp r7, r6 - bne _0819509E - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r4, [sp, 0x28] - ldr r2, [sp, 0x3C] - adds r1, r4, r2 - ldr r3, =0x00000d64 - adds r0, r3 - adds r0, r1 - strh r5, [r0] - ldr r2, [sp, 0x2C] - add r2, sp - adds r2, 0x8 - ldr r3, =gUnknown_0203BC8C - ldr r1, [r3] - lsls r0, r5, 4 - adds r0, r1 - ldrh r0, [r0] - str r0, [r2] - ldr r6, [sp, 0x24] - cmp r6, 0x2 - ble _08195092 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - ldr r5, [sp, 0x38] - adds r2, r5 - ldr r0, =0x00000d25 - adds r2, r0 - ldrb r0, [r2] - movs r4, 0x5 - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - strb r0, [r2] - ldr r5, =gSaveBlock2Ptr - ldr r2, [r5] - ldr r0, [sp, 0x38] - adds r2, r0 - ldr r1, =0x00000d25 - adds r2, r1 - ldrb r0, [r2] - subs r4, 0x14 - adds r1, r4, 0 - ands r0, r1 - strb r0, [r2] - ldr r1, [r5] - ldr r5, [sp, 0x38] - adds r1, r5 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x1F - ands r0, r2 - strb r0, [r1] - adds r5, 0x4 - str r5, [sp, 0x38] - ldr r1, [sp, 0x3C] - adds r1, 0x6 - str r1, [sp, 0x3C] - movs r2, 0x1 - add r10, r2 - mov r4, r10 - cmp r4, 0xF - bgt _08195178 - b _08194FCC -_08195178: - movs r5, 0 - mov r10, r5 - ldr r5, [sp, 0x18] - movs r0, 0 - str r0, [sp, 0x34] -_08195182: - movs r7, 0 - strh r7, [r5] - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - mov r2, r10 - lsls r1, r2, 2 - adds r0, r1 - ldr r3, =0x00000d24 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - bl sub_8190168 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r6, 0 - ldr r4, [sp, 0x34] - mov r9, r4 -_081951AA: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - mov r4, r9 - add r4, r10 - adds r4, r6 - lsls r4, 1 - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r4 - ldrh r1, [r0] - ldr r3, =gUnknown_0203BC8C - ldr r0, [r3] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] - ldrb r3, [r1, 0xB] - ldrb r1, [r1, 0xC] - str r1, [sp] - ldr r1, [sp, 0x1C] - str r1, [sp, 0x4] - movs r1, 0x32 - mov r2, r8 - bl sub_818F720 - ldr r2, [sp, 0x1C] - ldr r1, [r2, 0x4] - ldrh r0, [r5] - adds r0, r1 - ldr r1, [r2, 0x8] - adds r0, r1 - ldr r1, [r2, 0x10] - adds r0, r1 - ldr r1, [r2, 0x14] - adds r0, r1 - ldr r1, [r2, 0xC] - adds r0, r1 - ldr r1, [r2] - adds r0, r1 - strh r0, [r5] - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, =0x00000d64 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - lsls r0, 4 - adds r0, r1 - ldrh r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r3, =gBaseStats - adds r1, r3 - ldrb r0, [r1, 0x6] - lsls r0, 2 - ldr r4, =gBitTable - adds r0, r4 - ldr r0, [r0] - orrs r7, r0 - ldrb r0, [r1, 0x7] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - orrs r7, r0 - adds r6, 0x1 - cmp r6, 0x2 - ble _081951AA - movs r4, 0 - movs r1, 0x1 - movs r6, 0x1F -_0819523A: - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _08195244 - adds r4, 0x1 -_08195244: - asrs r7, 1 - subs r6, 0x1 - cmp r6, 0 - bge _0819523A - movs r1, 0x32 - adds r0, r4, 0 - muls r0, r1 - movs r1, 0x14 - bl __divsi3 - ldrh r1, [r5] - adds r1, r0 - strh r1, [r5] - adds r5, 0x2 - ldr r2, [sp, 0x34] - adds r2, 0x2 - str r2, [sp, 0x34] - movs r3, 0x1 - add r10, r3 - mov r4, r10 - cmp r4, 0xF - ble _08195182 - movs r5, 0 - mov r10, r5 - ldr r7, [sp, 0x18] -_08195276: - mov r6, r10 - adds r6, 0x1 - cmp r6, 0xF - bgt _081952F8 - mov r8, r7 - ldr r5, =0x00000d24 - lsls r0, r6, 1 - ldr r1, [sp, 0x18] - adds r4, r0, r1 -_08195288: - mov r2, r8 - ldrh r1, [r2] - ldrh r0, [r4] - cmp r1, r0 - bcs _081952C4 - mov r0, r10 - adds r1, r6, 0 - ldr r2, [sp, 0x18] - bl sub_818F904 - b _081952F0 - .pool -_081952C4: - cmp r1, r0 - bne _081952F0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r3, r10 - lsls r0, r3, 2 - adds r0, r1, r0 - adds r0, r5 - ldrh r2, [r0] - lsls r2, 22 - lsls r0, r6, 2 - adds r1, r0 - adds r1, r5 - ldrh r0, [r1] - lsls r0, 22 - cmp r2, r0 - bls _081952F0 - mov r0, r10 - adds r1, r6, 0 - ldr r2, [sp, 0x18] - bl sub_818F904 -_081952F0: - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0xF - ble _08195288 -_081952F8: - adds r7, 0x2 - movs r4, 0x1 - add r10, r4 - mov r5, r10 - cmp r5, 0xE - ble _08195276 - ldr r0, [sp, 0x18] - bl Free - ldr r0, [sp, 0x1C] - bl Free - movs r0, 0 - mov r10, r0 -_08195314: - mov r1, r10 - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_8195438 - movs r2, 0x1 - add r10, r2 - mov r3, r10 - cmp r3, 0x3 - ble _08195314 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r4, =0x00000ca9 - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - ldr r5, [sp, 0x14] - orrs r0, r5 - strb r0, [r1] -_0819533E: - add sp, 0x40 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194F58 - - thumb_func_start sub_8195358 -sub_8195358: @ 8195358 - push {r4,r5,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - beq _0819538E - adds r5, r4, 0 - adds r4, r1, 0 -_08195376: - adds r2, 0x1 - cmp r2, 0xF - bgt _0819538E - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - bne _08195376 -_0819538E: - adds r0, r2, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8195358 - - thumb_func_start sub_81953A0 -sub_81953A0: @ 81953A0 - push {r4,r5,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - beq _081953D6 - adds r5, r4, 0 - adds r4, r1, 0 -_081953BE: - adds r2, 0x1 - cmp r2, 0xF - bgt _081953D6 - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - bne _081953BE -_081953D6: - adds r0, r2, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81953A0 - - thumb_func_start sub_81953E8 -sub_81953E8: @ 81953E8 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_0860D1A0 - ldr r0, =gUnknown_0860D1C0 - adds r0, r4, r0 - ldrb r0, [r0] - lsrs r0, 1 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - bl sub_8192F08 - mov r0, sp - ldrb r0, [r0] - cmp r4, r0 - beq _0819542C - mov r0, sp - ldrb r0, [r0] - b _08195430 - .pool -_0819542C: - mov r0, sp - ldrb r0, [r0, 0x1] -_08195430: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81953E8 - - thumb_func_start sub_8195438 -sub_8195438: @ 8195438 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0xC] - movs r1, 0 - str r1, [sp, 0x10] - movs r5, 0 - movs r1, 0x3 - ldr r0, [sp] - ands r0, r1 - lsls r0, 3 - str r0, [sp, 0x14] -_0819545E: - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - lsls r4, r5, 2 - adds r1, r0, r4 - ldr r3, =0x00000d25 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 29 - adds r2, r5, 0x1 - str r2, [sp, 0x24] - cmp r0, 0 - bge _08195478 - b _08195876 -_08195478: - subs r3, 0x1 - adds r0, r1, r3 - ldrh r0, [r0] - lsls r1, r0, 22 - ldr r0, =0xffc00000 - cmp r1, r0 - bne _08195488 - b _08195876 -_08195488: - str r5, [sp, 0x4] - lsrs r1, 22 - ldr r0, [sp] - bl sub_81901A0 - str r0, [sp, 0x8] - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r0, r3, r4 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - ldr r1, =0xff800000 - cmp r0, r1 - bne _08195504 - ldr r2, [sp, 0x8] - cmp r2, 0xFF - beq _08195504 - lsls r2, 2 - adds r1, r3, r2 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r1, r2 - ldr r2, =0x00000d25 - adds r1, r2 - ldrb r0, [r1] - subs r3, 0x1D - ands r0, r3 - ldr r2, [sp, 0x14] - orrs r0, r2 - strb r0, [r1] - adds r0, r5, 0 - ldr r1, [sp, 0x8] - ldr r2, [sp] - bl sub_8193ED0 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r5, [sp, 0x8] - lsls r2, r5, 1 - movs r3, 0xEC - lsls r3, 4 - adds r1, r3 - adds r1, r2 - b _08195874 - .pool -_08195504: - ldr r4, =gSaveBlock2Ptr - ldr r3, [r4] - ldr r0, [sp, 0x8] - lsls r2, r0, 2 - adds r0, r3, r2 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - ldr r1, =0xff800000 - str r2, [sp, 0x30] - cmp r0, r1 - bne _0819557C - ldr r2, [sp, 0x4] - cmp r2, 0xFF - beq _0819557C - lsls r2, 2 - adds r1, r3, r2 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r1] - ldr r1, [r4] - adds r1, r2 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - ldr r3, [sp, 0x14] - orrs r0, r3 - strb r0, [r1] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x4] - ldr r2, [sp] - bl sub_8193ED0 - ldr r1, [r4] - ldr r3, [sp, 0x4] - lsls r2, r3, 1 - movs r3, 0xEC - lsls r3, 4 - adds r1, r3 - adds r1, r2 - strh r0, [r1] - adds r5, 0x1 - str r5, [sp, 0x24] - b _08195876 - .pool -_0819557C: - adds r5, 0x1 - str r5, [sp, 0x24] - ldr r5, [sp, 0x8] - cmp r5, 0xFF - bne _08195588 - b _08195876 -_08195588: - movs r0, 0 - mov r10, r0 - lsls r1, r5, 1 - str r1, [sp, 0x2C] - ldr r2, [sp, 0x4] - lsls r2, 1 - str r2, [sp, 0x28] - ldr r3, [sp, 0x4] - adds r0, r2, r3 - lsls r0, 1 - mov r9, r0 - adds r0, r1, r5 - lsls r0, 1 - str r0, [sp, 0x18] -_081955A4: - movs r5, 0 - mov r0, r9 - str r0, [sp, 0x38] -_081955AA: - movs r6, 0 - lsls r7, r5, 1 - ldr r4, [sp, 0x18] -_081955B0: - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - ldr r3, =0x00000d64 - adds r1, r3 - ldr r2, [sp, 0x38] - adds r0, r1, r2 - ldrh r0, [r0] - ldr r3, =gUnknown_0203BC8C - mov r8, r3 - ldr r2, [r3] - lsls r0, 4 - adds r0, r2 - adds r0, 0x2 - adds r0, r7 - ldrh r0, [r0] - adds r1, r4 - ldrh r1, [r1] - lsls r1, 4 - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - bl sub_818FFC0 - ldr r1, [sp, 0xC] - adds r1, r0 - str r1, [sp, 0xC] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x2 - ble _081955B0 - adds r5, 0x1 - cmp r5, 0x3 - ble _081955AA - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r3, =0x00000d64 - adds r0, r3 - add r0, r9 - ldrh r0, [r0] - mov r5, r8 - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrh r2, [r0] - ldr r0, =gBaseStats - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - ldrb r2, [r1, 0x1] - adds r0, r2 - ldrb r2, [r1, 0x2] - adds r0, r2 - ldrb r2, [r1, 0x3] - adds r0, r2 - ldrb r3, [r1, 0x4] - adds r0, r3 - ldrb r1, [r1, 0x5] - adds r0, r1 - movs r1, 0xA - bl __divsi3 - ldr r5, [sp, 0xC] - adds r5, r0 - str r5, [sp, 0xC] - movs r0, 0x2 - add r9, r0 - movs r1, 0x1 - add r10, r1 - mov r2, r10 - cmp r2, 0x2 - ble _081955A4 - bl Random - movs r1, 0x1F - ands r1, r0 - adds r5, r1 - ldr r3, [sp, 0x4] - adds r5, r3 - str r5, [sp, 0xC] - movs r5, 0 - mov r10, r5 - ldr r1, [sp, 0x2C] - ldr r2, [sp, 0x8] - adds r0, r1, r2 - lsls r0, 1 - str r0, [sp, 0x1C] - ldr r5, [sp, 0x28] - adds r0, r5, r3 - lsls r0, 1 - str r0, [sp, 0x20] -_08195668: - movs r5, 0 - mov r0, r10 - lsls r3, r0, 1 - movs r1, 0x1 - add r10, r1 - ldr r2, [sp, 0x1C] - adds r2, r3 - mov r8, r2 -_08195678: - movs r6, 0 - lsls r7, r5, 1 - adds r5, 0x1 - str r5, [sp, 0x3C] - ldr r4, [sp, 0x20] -_08195682: - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r0, =0x00000d64 - adds r1, r0 - mov r2, r8 - adds r0, r1, r2 - ldrh r0, [r0] - ldr r5, =gUnknown_0203BC8C - mov r9, r5 - ldr r2, [r5] - lsls r0, 4 - adds r0, r2 - adds r0, 0x2 - adds r0, r7 - ldrh r0, [r0] - adds r1, r4 - ldrh r1, [r1] - lsls r1, 4 - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - str r3, [sp, 0x34] - bl sub_818FFC0 - ldr r1, [sp, 0x10] - adds r1, r0 - str r1, [sp, 0x10] - adds r4, 0x2 - adds r6, 0x1 - ldr r3, [sp, 0x34] - cmp r6, 0x2 - ble _08195682 - ldr r5, [sp, 0x3C] - cmp r5, 0x3 - ble _08195678 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r5, [sp, 0x1C] - adds r1, r3, r5 - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - mov r3, r9 - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - ldrh r2, [r0] - ldr r0, =gBaseStats - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - ldrb r2, [r1, 0x1] - adds r0, r2 - ldrb r5, [r1, 0x2] - adds r0, r5 - ldrb r2, [r1, 0x3] - adds r0, r2 - ldrb r2, [r1, 0x4] - adds r0, r2 - ldrb r1, [r1, 0x5] - adds r0, r1 - movs r1, 0xA - bl __divsi3 - ldr r3, [sp, 0x10] - adds r3, r0 - str r3, [sp, 0x10] - mov r5, r10 - cmp r5, 0x2 - ble _08195668 - bl Random - movs r1, 0x1F - ands r1, r0 - ldr r0, [sp, 0x10] - adds r0, r1 - ldr r1, [sp, 0x8] - adds r0, r1 - str r0, [sp, 0x10] - ldr r2, [sp, 0xC] - cmp r2, r0 - ble _08195784 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r5, [sp, 0x30] - adds r1, r5 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, r5 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r5, 0x19 - negs r5, r5 - ands r0, r5 - ldr r2, [sp, 0x14] - orrs r0, r2 - strb r0, [r1] - ldr r0, [sp, 0x4] - ldr r1, [sp, 0x8] - ldr r2, [sp] - bl sub_8193ED0 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - movs r5, 0xEC - lsls r5, 4 - adds r1, r5 - ldr r2, [sp, 0x2C] - adds r1, r2 - b _08195874 - .pool -_08195784: - ldr r3, [sp, 0xC] - ldr r5, [sp, 0x10] - cmp r3, r5 - bge _081957DC - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r3, [sp, 0x4] - lsls r2, r3, 2 - adds r1, r2 - ldr r5, =0x00000d25 - adds r1, r5 - ldrb r0, [r1] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r1] - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - adds r1, r2 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - ldr r3, [sp, 0x14] - orrs r0, r3 - strb r0, [r1] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x4] - ldr r2, [sp] - bl sub_8193ED0 - ldr r1, [r5] - movs r5, 0xEC - lsls r5, 4 - adds r1, r5 - ldr r2, [sp, 0x28] - adds r1, r2 - b _08195874 - .pool -_081957DC: - ldr r3, [sp, 0x4] - ldr r5, [sp, 0x8] - cmp r3, r5 - ble _08195830 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, [sp, 0x30] - adds r1, r2 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r5, 0x4 - orrs r0, r5 - strb r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r1, r2 - adds r1, r3 - ldrb r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - ldr r3, [sp, 0x14] - orrs r0, r3 - strb r0, [r1] - ldr r0, [sp, 0x4] - ldr r1, [sp, 0x8] - ldr r2, [sp] - bl sub_8193ED0 - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - movs r2, 0xEC - lsls r2, 4 - adds r1, r2 - ldr r3, [sp, 0x2C] - b _08195872 - .pool -_08195830: - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r0, [sp, 0x4] - lsls r2, r0, 2 - adds r1, r2 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r5, 0x4 - orrs r0, r5 - strb r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r1, r2 - adds r1, r3 - ldrb r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - ldr r3, [sp, 0x14] - orrs r0, r3 - strb r0, [r1] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x4] - ldr r2, [sp] - bl sub_8193ED0 - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - movs r2, 0xEC - lsls r2, 4 - adds r1, r2 - ldr r3, [sp, 0x28] -_08195872: - adds r1, r3 -_08195874: - strh r0, [r1] -_08195876: - ldr r5, [sp, 0x24] - cmp r5, 0xF - bgt _0819587E - b _0819545E -_0819587E: - add sp, 0x40 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195438 - - thumb_func_start sub_8195898 -sub_8195898: @ 8195898 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 - bl sub_8165C40 - ldr r0, =0x000003fe - cmp r5, r0 - bne _081958B8 - adds r0, r6, 0 - bl sub_8195938 - b _08195902 - .pool -_081958B8: - ldr r0, =0x000003ff - cmp r5, r0 - bne _081958DC - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] -_081958C2: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - ble _081958C2 - b _081958FC - .pool -_081958DC: - ldr r0, =0x0000012b - cmp r5, r0 - bhi _081958FC - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r5 - adds r0, r1 - adds r2, r0, 0x4 -_081958EE: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - ble _081958EE -_081958FC: - adds r1, r6, r4 - movs r0, 0xFF - strb r0, [r1] -_08195902: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195898 - - thumb_func_start sub_8195910 -sub_8195910: @ 8195910 - ldr r0, =gTrainers - ldr r1, =0x00007df3 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8195910 - - thumb_func_start sub_8195924 -sub_8195924: @ 8195924 - ldr r0, =gTrainers - ldr r1, =0x00007df1 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8195924 - - thumb_func_start sub_8195938 -sub_8195938: @ 8195938 - push {r4,lr} - adds r3, r0, 0 - movs r2, 0 - ldr r4, =gTrainers + TRAINER_TUCKER * 0x28 + 0x4 @ Tucker's name -_08195940: - adds r0, r3, r2 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x6 - ble _08195940 - adds r1, r3, r2 - movs r0, 0xFF - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195938 - - thumb_func_start sub_8195960 -sub_8195960: @ 8195960 - push {lr} - ldr r1, =gUnknown_0860DE50 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195960 - - thumb_func_start sub_8195980 -sub_8195980: @ 8195980 - push {r4-r7,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, [r4] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r6, 0 - strb r6, [r0] - ldr r1, [r4] - adds r2, 0xA - adds r0, r1, r2 - strh r6, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r4, [r4] - ldr r0, =0x00000cdc - adds r3, r4, r0 - ldr r2, =gUnknown_0860DE98 - lsls r1, r5, 2 - lsls r0, r7, 3 - adds r1, r0 - adds r1, r2 - ldr r0, [r3] - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _081959F2 - lsls r0, r5, 1 - lsls r1, r7, 2 - adds r0, r1 - ldr r2, =0x00000dc8 - adds r1, r4, r2 - adds r1, r0 - strh r6, [r1] -_081959F2: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - ldr r0, =gUnknown_02038BCA - strh r6, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195980 - - thumb_func_start sub_8195A38 -sub_8195A38: @ 8195A38 - push {r4-r7,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r7, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _08195A90 - cmp r0, 0x1 - bgt _08195A74 - cmp r0, 0 - beq _08195A7A - b _08195AD0 - .pool -_08195A74: - cmp r0, 0x2 - beq _08195AB0 - b _08195AD0 -_08195A7A: - ldr r0, =gScriptResult - ldr r1, [r5] - ldr r2, =0x00000dc6 - adds r1, r2 - ldrh r1, [r1] - strh r1, [r0] - b _08195AD0 - .pool -_08195A90: - ldr r3, =gScriptResult - ldr r0, [r5] - lsls r1, r7, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000dc8 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r3] - b _08195AD0 - .pool -_08195AB0: - ldr r4, =gScriptResult - ldr r2, [r5] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_0860DE98 - lsls r0, r7, 2 - lsls r1, r6, 3 - adds r0, r1 - adds r0, r3 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - strh r0, [r4] -_08195AD0: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195A38 - - thumb_func_start sub_8195AE4 -sub_8195AE4: @ 8195AE4 - push {r4-r6,lr} - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _08195B3C - cmp r0, 0x1 - bgt _08195B20 - cmp r0, 0 - beq _08195B26 - b _08195BA0 - .pool -_08195B20: - cmp r0, 0x2 - beq _08195B5C - b _08195BA0 -_08195B26: - ldr r0, [r6] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000dc6 - adds r0, r2 - strh r1, [r0] - b _08195BA0 - .pool -_08195B3C: - ldr r2, [r6] - lsls r0, r5, 1 - lsls r1, r4, 2 - adds r0, r1 - ldr r1, =0x00000dc8 - adds r2, r1 - adds r2, r0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - strh r0, [r2] - b _08195BA0 - .pool -_08195B5C: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _08195B88 - ldr r2, [r6] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_0860DE98 - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - orrs r0, r1 - b _08195B9E - .pool -_08195B88: - ldr r2, [r6] - ldr r1, =0x00000cdc - adds r2, r1 - ldr r3, =gUnknown_0860DEA8 - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - ands r0, r1 -_08195B9E: - str r0, [r2] -_08195BA0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195AE4 - - thumb_func_start sub_8195BB0 -sub_8195BB0: @ 8195BB0 - push {r4,lr} - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - ldr r3, =0x00000ca9 - adds r1, r2, r3 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - lsrs r0, 14 - adds r1, r0 - ldr r0, =0x00000dc8 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - cmp r0, 0x31 - bhi _08195C00 - ldr r4, =gScriptResult - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - strh r0, [r4] - b _08195C16 - .pool -_08195C00: - cmp r0, 0x62 - bhi _08195C10 - ldr r1, =gScriptResult - movs r0, 0x3 - b _08195C14 - .pool -_08195C10: - ldr r1, =gScriptResult - movs r0, 0x4 -_08195C14: - strh r0, [r1] -_08195C16: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195BB0 - - thumb_func_start sub_8195C20 -sub_8195C20: @ 8195C20 - push {r4,lr} - ldr r4, =gUnknown_02038BCA - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xFF - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsrs r1, 6 - strh r1, [r4] - ldrh r0, [r4] - movs r1, 0 - bl sub_8162614 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195C20 - - thumb_func_start sub_8195C50 -sub_8195C50: @ 8195C50 - push {lr} - ldr r3, =gUnknown_02038BCA - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _08195C6C - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString -_08195C6C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195C50 - - thumb_func_start sub_8195C7C -sub_8195C7C: @ 8195C7C - push {r4-r7,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r7, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - ldr r4, [r4] - lsls r1, r7, 1 - lsrs r5, r0, 22 - adds r1, r5 - ldr r3, =0x00000dc8 - adds r6, r4, r3 - adds r3, r6, r1 - ldrh r2, [r3] - ldr r0, =0x0000270e - cmp r2, r0 - bhi _08195CCA - adds r2, 0x1 - strh r2, [r3] - movs r3, 0xDD - lsls r3, 4 - adds r0, r4, r3 - adds r1, r0, r1 - adds r0, r5, 0 - ldrh r3, [r1] - cmp r7, r3 - bls _08195CC0 - adds r0, 0x2 -_08195CC0: - adds r0, r6, r0 - ldrh r0, [r0] - cmp r0, 0 - beq _08195CCA - strh r2, [r1] -_08195CCA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195C7C - - thumb_func_start sub_8195CE4 -sub_8195CE4: @ 8195CE4 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195CE4 - - thumb_func_start sub_8195D28 -sub_8195D28: @ 8195D28 - push {r4,r5,lr} - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - ldr r3, =0x00000ca9 - adds r1, r2, r3 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - lsrs r0, 14 - adds r1, r0 - ldr r0, =0x00000dc8 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - cmp r0, 0x29 - bls _08195D88 - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_0860DE84 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =0x00000dc6 - adds r4, r1 - b _08195DA6 - .pool -_08195D88: - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_0860DE78 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r3, =0x00000dc6 - adds r4, r3 -_08195DA6: - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195D28 - - thumb_func_start sub_8195DB8 -sub_8195DB8: @ 8195DB8 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000dc6 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _08195E00 - ldr r0, [r4] - ldr r1, =0x00000dc6 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000dc6 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _08195E06 - .pool -_08195E00: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_08195E06: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195DB8 - - thumb_func_start sub_8195E10 -sub_8195E10: @ 8195E10 - push {lr} - bl RtcCalcLocalTime - ldr r0, =gLocalTime - bl sub_8195E34 - ldr r1, =gUnknown_0203CD80 - adds r0, 0xA - str r0, [r1] - movs r0, 0 - strb r0, [r1, 0x6] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195E10 - - thumb_func_start sub_8195E34 -sub_8195E34: @ 8195E34 - adds r3, r0, 0 - movs r1, 0 - ldrsh r0, [r3, r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 5 - movs r2, 0x2 - ldrsb r2, [r3, r2] - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 2 - adds r0, r1 - movs r1, 0x3 - ldrsb r1, [r3, r1] - adds r0, r1 - bx lr - thumb_func_end sub_8195E34 - - thumb_func_start sub_8195E58 -sub_8195E58: @ 8195E58 - push {lr} - bl RtcCalcLocalTime - ldr r0, =gLocalTime - bl sub_8195E34 - adds r1, r0, 0 - ldr r2, =gUnknown_0203CD80 - ldr r0, [r2] - cmp r0, r1 - bhi _08195E74 - subs r0, r1, r0 - cmp r0, 0x9 - bls _08195E84 -_08195E74: - str r1, [r2] - movs r0, 0x1 - b _08195E86 - .pool -_08195E84: - movs r0, 0 -_08195E86: - pop {r1} - bx r1 - thumb_func_end sub_8195E58 - - thumb_func_start sub_8195E8C -sub_8195E8C: @ 8195E8C - push {r4,r5,lr} - movs r5, 0x1 - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0x6 - bl GetMonData - cmp r0, 0 - bne _08195EAE - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bne _08195EAE - movs r5, 0x2 -_08195EAE: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r5, 1 - adds r1, r5 - cmp r0, r1 - blt _08195ED0 - movs r0, 0 - b _08195ED2 - .pool -_08195ED0: - movs r0, 0x1 -_08195ED2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8195E8C - - thumb_func_start sub_8195ED8 -sub_8195ED8: @ 8195ED8 - push {r4,lr} - ldr r4, =gMapHeader - ldrb r0, [r4, 0x17] - bl is_light_level_1_2_3_or_6 - lsls r0, 24 - cmp r0, 0 - beq _08195F30 - ldrb r0, [r4, 0x14] - cmp r0, 0x39 - beq _08195F30 - cmp r0, 0xE - bne _08195F0E - movs r0, 0xF9 - lsls r0, 2 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08195F0E - movs r0, 0xDC - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08195F30 -_08195F0E: - ldr r0, =gMapHeader - ldrb r0, [r0, 0x14] - cmp r0, 0x38 - bne _08195F38 - movs r0, 0xCF - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08195F38 - movs r0, 0x8B - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08195F38 -_08195F30: - movs r0, 0 - b _08195F3A - .pool -_08195F38: - movs r0, 0x1 -_08195F3A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8195ED8 - - thumb_func_start sub_8195F40 -sub_8195F40: @ 8195F40 - push {lr} - ldr r1, =gUnknown_0203CD80 - ldrb r0, [r1, 0x6] - adds r0, 0x1 - strb r0, [r1, 0x6] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x9 - bhi _08195F5C - movs r0, 0 - b _08195F62 - .pool -_08195F5C: - movs r0, 0 - strb r0, [r1, 0x6] - movs r0, 0x1 -_08195F62: - pop {r1} - bx r1 - thumb_func_end sub_8195F40 - - thumb_func_start sub_8195F68 -sub_8195F68: @ 8195F68 - push {r4,lr} - bl sub_8195FCC - adds r4, r0, 0 - cmp r4, 0 - beq _08195FB8 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __umodsi3 - bl sub_8195FF8 - ldr r2, =gUnknown_0203CD80 - movs r1, 0 - strh r0, [r2, 0x4] - strb r1, [r2, 0x7] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4E - beq _08195FB8 - ldrh r0, [r2, 0x4] - bl sub_8196844 - adds r4, r0, 0 - bl sub_819672C - ldr r1, =gMapHeader - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x14] - cmp r0, r1 - bne _08195FC4 - adds r0, r4, 0 - bl sub_8196710 - cmp r0, 0 - bne _08195FC4 -_08195FB8: - movs r0, 0 - b _08195FC6 - .pool -_08195FC4: - movs r0, 0x1 -_08195FC6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8195F68 - - thumb_func_start sub_8195FCC -sub_8195FCC: @ 8195FCC - push {r4,r5,lr} - movs r4, 0 - movs r5, 0 -_08195FD2: - movs r1, 0xAE - lsls r1, 1 - adds r0, r4, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08195FE8 - adds r5, 0x1 -_08195FE8: - adds r4, 0x1 - cmp r4, 0x3F - bls _08195FD2 - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8195FCC - - thumb_func_start sub_8195FF8 -sub_8195FF8: @ 8195FF8 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - ldr r6, =gUnknown_085500A4 -_08196000: - movs r1, 0xAE - lsls r1, 1 - adds r0, r4, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08196022 - cmp r5, 0 - bne _08196020 - ldrh r0, [r6] - b _0819602C - .pool -_08196020: - subs r5, 0x1 -_08196022: - adds r6, 0x10 - adds r4, 0x1 - cmp r4, 0x3F - bls _08196000 - movs r0, 0x4E -_0819602C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8195FF8 - - thumb_func_start sub_8196034 -sub_8196034: @ 8196034 - push {lr} - ldr r0, =0x0000012f - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08196078 - bl sub_8195F40 - cmp r0, 0 - beq _08196078 - bl sub_8195E58 - cmp r0, 0 - beq _08196078 - bl sub_8195E8C - cmp r0, 0 - beq _08196078 - bl sub_8195ED8 - cmp r0, 0 - beq _08196078 - bl sub_8195F68 - cmp r0, 0 - beq _08196078 - bl task_prev_quest - movs r0, 0x1 - b _0819607A - .pool -_08196078: - movs r0, 0 -_0819607A: - pop {r1} - bx r1 - thumb_func_end sub_8196034 - - thumb_func_start sub_8196080 -sub_8196080: @ 8196080 - push {lr} - ldr r1, =gUnknown_0203CD80 - movs r0, 0x1 - strb r0, [r1, 0x7] - bl task_prev_quest - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196080 - - thumb_func_start sub_8196094 -sub_8196094: @ 8196094 - push {lr} - ldr r0, =sub_81960E0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196094 - - thumb_func_start task_prev_quest -task_prev_quest: @ 81960A8 - push {lr} - ldr r0, =gUnknown_0203CD80 - ldrb r0, [r0, 0x7] - cmp r0, 0 - bne _081960C2 - bl script_env_2_enable - bl player_bitmagic - bl sub_808B864 - bl sub_808BCF4 -_081960C2: - ldr r0, =0x00000107 - bl PlaySE - ldr r0, =sub_81960E0 - movs r1, 0x1 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end task_prev_quest - - thumb_func_start sub_81960E0 -sub_81960E0: @ 81960E0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r1, =gUnknown_0860EF78 - movs r2, 0 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 - cmp r0, 0 - beq _0819611E - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r1, 0 - strh r1, [r4, 0x2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7 - bls _0819611E - adds r0, r5, 0 - bl DestroyTask -_0819611E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81960E0 - - thumb_func_start sub_819612C -sub_819612C: @ 819612C - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r0, =gUnknown_0860EF98 - bl AddWindow - strh r0, [r5, 0x4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - bne _0819615C - adds r0, r4, 0 - b _081961E0 - .pool -_0819615C: - ldr r1, =gUnknown_0860EA6C - movs r2, 0x80 - lsls r2, 1 - movs r3, 0x9C - lsls r3, 2 - movs r0, 0 - bl LoadBgTiles - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _08196188 - ldrb r0, [r5, 0x4] - bl RemoveWindow - adds r0, r4, 0 - b _081961E0 - .pool -_08196188: - ldr r1, =gUnknown_0860EB8C - ldr r3, =0x00000279 - movs r0, 0 - str r0, [sp] - movs r2, 0 - bl decompress_and_copy_tile_data_to_vram - cmp r0, 0 - beq _081961D8 - ldrb r0, [r5, 0x4] - movs r1, 0x88 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0860EA4C - movs r1, 0xE0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0860EB6C - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldr r1, =0xffffe000 - movs r0, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - b _081961E6 - .pool -_081961D8: - ldrb r0, [r5, 0x4] - bl RemoveWindow - adds r0, r6, 0 -_081961E0: - bl DestroyTask - movs r0, 0 -_081961E6: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_819612C - - thumb_func_start sub_81961F0 -sub_81961F0: @ 81961F0 - push {r4,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _08196268 - ldrb r0, [r4, 0x4] - bl PutWindowTilemap - movs r1, 0x4 - ldrsh r0, [r4, r1] - movs r1, 0x9C - lsls r1, 2 - movs r2, 0xE - bl sub_819645C - ldr r1, =0x0000f279 - movs r0, 0x4 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0 - movs r2, 0x1 - movs r3, 0xF - bl WriteSequenceToBgTilemapBuffer - ldr r0, =sub_8196694 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xA] - ldrb r0, [r4, 0x4] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - b _0819626A - .pool -_08196268: - movs r0, 0 -_0819626A: - add sp, 0x10 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81961F0 - - thumb_func_start sub_8196274 -sub_8196274: @ 8196274 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _08196298 - movs r0, 0 - b _081962A4 - .pool -_08196298: - movs r1, 0x4 - ldrsh r0, [r4, r1] - ldr r1, =gUnknown_0860EF70 - bl sub_81965D8 - movs r0, 0x1 -_081962A4: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196274 - - thumb_func_start sub_81962B0 -sub_81962B0: @ 81962B0 - push {lr} - movs r1, 0xC0 - lsls r1, 3 - movs r0, 0 - movs r2, 0x1 - bl ChangeBgY - cmp r0, 0 - bge _081962C6 - movs r0, 0 - b _081962D2 -_081962C6: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 -_081962D2: - pop {r1} - bx r1 - thumb_func_end sub_81962B0 - - thumb_func_start sub_81962D8 -sub_81962D8: @ 81962D8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0x4 - ldrsh r0, [r4, r1] - bl sub_8196648 - cmp r0, 0 - bne _08196328 - ldrb r0, [r4, 0x4] - movs r1, 0x88 - bl FillWindowPixelBuffer - ldr r1, =gUnknown_0203CD80 - ldrb r0, [r1, 0x7] - cmp r0, 0 - bne _0819630C - ldrh r0, [r1, 0x4] - ldr r1, =gStringVar4 - bl sub_81967AC -_0819630C: - movs r1, 0x4 - ldrsh r0, [r4, r1] - ldr r1, =gStringVar4 - bl sub_81965D8 - movs r0, 0x1 - b _0819632A - .pool -_08196328: - movs r0, 0 -_0819632A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81962D8 - - thumb_func_start sub_8196330 -sub_8196330: @ 8196330 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0x4 - ldrsh r0, [r4, r1] - bl sub_8196648 - cmp r0, 0 - bne _08196388 - bl IsSEPlaying - lsls r0, 24 - cmp r0, 0 - bne _08196388 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08196388 - ldrb r0, [r4, 0x4] - movs r1, 0x88 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x4] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x84 - lsls r0, 1 - bl PlaySE - movs r0, 0x1 - b _0819638A - .pool -_08196388: - movs r0, 0 -_0819638A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8196330 - - thumb_func_start sub_8196390 -sub_8196390: @ 8196390 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0xC0 - lsls r1, 3 - movs r0, 0 - movs r2, 0x2 - bl ChangeBgY - ldr r1, =0xffffe000 - cmp r0, r1 - ble _081963C0 - movs r0, 0 - b _081963E8 - .pool -_081963C0: - movs r0, 0x1E - str r0, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0xE - bl FillBgTilemapBufferRect_Palette0 - ldrb r0, [r4, 0xA] - bl DestroyTask - ldrb r0, [r4, 0x4] - bl RemoveWindow - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 -_081963E8: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8196390 - - thumb_func_start sub_81963F0 -sub_81963F0: @ 81963F0 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08196454 - bl IsSEPlaying - lsls r0, 24 - cmp r0, 0 - bne _08196454 - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r0, =gUnknown_0203CD80 - ldrb r0, [r0, 0x7] - cmp r0, 0 - bne _08196446 - bl sub_81973A4 - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gMapObjects - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - bl sub_809757C - bl script_env_2_disable -_08196446: - movs r0, 0x1 - b _08196456 - .pool -_08196454: - movs r0, 0 -_08196456: - pop {r1} - bx r1 - thumb_func_end sub_81963F0 - - thumb_func_start sub_819645C -sub_819645C: @ 819645C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r4, r0, 0 - adds r5, r1, 0 - adds r7, r2, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl GetWindowAttribute - mov r9, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl GetWindowAttribute - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x2 - bl GetWindowAttribute - str r0, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0x3 - bl GetWindowAttribute - adds r6, r0, 0 - adds r0, r4, 0 - movs r1, 0x4 - bl GetWindowAttribute - str r0, [sp, 0x10] - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r1, 0xA - bl GetBgAttribute - lsls r0, 16 - lsrs r0, 16 - adds r5, r0 - lsls r7, 12 - movs r1, 0xF0 - lsls r1, 8 - adds r0, r1, 0 - ands r7, r0 - adds r1, r7, 0 - orrs r1, r5 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x8] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - ldr r4, [sp, 0xC] - subs r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - movs r3, 0x1 - mov r8, r3 - str r3, [sp] - str r3, [sp, 0x4] - mov r0, r9 - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x1 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x8] - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - lsls r0, r6, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - str r0, [sp] - mov r2, r8 - str r2, [sp, 0x4] - mov r0, r9 - ldr r2, [sp, 0x14] - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x2 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r3, [sp, 0x8] - adds r0, r3, r6 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - mov r0, r8 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r9 - ldr r2, [sp, 0x1C] - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x3 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0xC] - lsls r6, r2, 24 - lsrs r6, 24 - mov r3, r8 - str r3, [sp] - ldr r0, [sp, 0x10] - lsls r4, r0, 24 - lsrs r4, 24 - str r4, [sp, 0x4] - mov r0, r9 - mov r2, r10 - adds r3, r6, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x4 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - mov r2, r8 - str r2, [sp] - str r4, [sp, 0x4] - mov r0, r9 - ldr r2, [sp, 0x1C] - adds r3, r6, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x5 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r3, [sp, 0xC] - ldr r2, [sp, 0x10] - adds r0, r3, r2 - lsls r0, 24 - lsrs r4, r0, 24 - mov r3, r8 - str r3, [sp] - str r3, [sp, 0x4] - mov r0, r9 - mov r2, r10 - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x6 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - str r0, [sp] - mov r2, r8 - str r2, [sp, 0x4] - mov r0, r9 - ldr r2, [sp, 0x14] - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r5, 0x7 - orrs r5, r7 - lsls r5, 16 - lsrs r5, 16 - mov r3, r8 - str r3, [sp] - str r3, [sp, 0x4] - mov r0, r9 - adds r1, r5, 0 - ldr r2, [sp, 0x1C] - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819645C - - thumb_func_start sub_81965D8 -sub_81965D8: @ 81965D8 - push {lr} - sub sp, 0x10 - str r1, [sp] - mov r1, sp - movs r3, 0 - strb r0, [r1, 0x4] - mov r0, sp - movs r1, 0x1 - strb r1, [r0, 0x5] - movs r2, 0x20 - strb r2, [r0, 0x6] - strb r1, [r0, 0x7] - strb r2, [r0, 0x8] - strb r1, [r0, 0x9] - strb r3, [r0, 0xA] - strb r3, [r0, 0xB] - mov r3, sp - ldrb r2, [r3, 0xC] - subs r1, 0x11 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - mov r2, sp - movs r3, 0xF - movs r0, 0xA0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - movs r0, 0x8 - orrs r1, r0 - strb r1, [r2, 0xD] - ands r1, r3 - movs r0, 0xE0 - orrs r1, r0 - strb r1, [r2, 0xD] - ldr r2, =gTextFlags - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl sav2_get_text_speed - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - movs r2, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81965D8 - - thumb_func_start sub_8196648 -sub_8196648: @ 8196648 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gMain - ldrh r1, [r0, 0x2C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0819666C - ldr r0, =gTextFlags - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _08196678 - .pool -_0819666C: - ldr r2, =gTextFlags - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08196678: - bl RunTextPrinters - lsls r0, r4, 24 - lsrs r0, 24 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196648 - - thumb_func_start sub_8196694 -sub_8196694: @ 8196694 - push {lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r2, r1, r0 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _081966FC - movs r1, 0 - strh r1, [r2] - ldrh r0, [r2, 0x2] - adds r0, 0x1 - strh r0, [r2, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _081966C8 - strh r1, [r2, 0x2] -_081966C8: - movs r0, 0x2 - ldrsh r1, [r2, r0] - lsls r1, 4 - ldr r0, =0x00000279 - adds r1, r0 - strh r1, [r2, 0x4] - ldr r2, =0xfffff000 - adds r0, r2, 0 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0 - movs r2, 0x1 - movs r3, 0xF - bl WriteSequenceToBgTilemapBuffer - movs r0, 0 - bl CopyBgTilemapBufferToVram -_081966FC: - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196694 - - thumb_func_start sub_8196710 -sub_8196710: @ 8196710 - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r2, =0x000009ca - adds r1, r2 - adds r1, r0 - ldrb r1, [r1] - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_8196710 - - thumb_func_start sub_819672C -sub_819672C: @ 819672C - push {lr} - ldr r1, =gUnknown_085500A4 - lsls r0, 4 - adds r0, r1 - ldrh r2, [r0, 0xA] - ldrh r1, [r0, 0xC] - adds r0, r2, 0 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x14] - pop {r1} - bx r1 - .pool - thumb_func_end sub_819672C - - thumb_func_start sub_8196748 -sub_8196748: @ 8196748 - push {r4-r6,lr} - movs r5, 0 - movs r6, 0 - ldr r4, =gUnknown_085500A4 -_08196750: - ldrh r0, [r4] - bl trainer_flag_check - lsls r0, 24 - cmp r0, 0 - beq _0819675E - adds r6, 0x1 -_0819675E: - adds r4, 0x10 - adds r5, 0x1 - cmp r5, 0x3F - bls _08196750 - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196748 - - thumb_func_start sub_8196774 -sub_8196774: @ 8196774 - push {r4-r7,lr} - adds r7, r0, 0 - movs r4, 0 - movs r6, 0 - ldr r5, =gUnknown_085500A4 -_0819677E: - ldrh r0, [r5] - bl trainer_flag_check - lsls r0, 24 - cmp r0, 0 - beq _0819679A - cmp r6, r7 - bne _08196798 - adds r0, r4, 0 - b _081967A4 - .pool -_08196798: - adds r6, 0x1 -_0819679A: - adds r5, 0x10 - adds r4, 0x1 - cmp r4, 0x4D - bls _0819677E - movs r0, 0x4E -_081967A4: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8196774 - - thumb_func_start sub_81967AC -sub_81967AC: @ 81967AC - push {r4-r7,lr} - adds r6, r1, 0 - movs r7, 0 - bl sub_8196844 - adds r5, r0, 0 - ldr r0, =gUnknown_0203CD88 - strh r7, [r0] - adds r0, r5, 0 - bl sub_8196710 - cmp r0, 0 - beq _081967EC - adds r0, r5, 0 - bl sub_819672C - ldr r1, =gMapHeader - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x14] - cmp r0, r1 - bne _081967EC - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_8196864 - b _08196830 - .pool -_081967EC: - adds r0, r5, 0 - bl sub_8196D74 - cmp r0, 0 - beq _0819680A - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_8196890 - adds r4, r0, 0 - movs r7, 0x1 - adds r0, r5, 0 - bl sub_80B1E94 - b _08196832 -_0819680A: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08196828 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_81968BC - b _08196830 -_08196828: - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_8196910 -_08196830: - adds r4, r0, 0 -_08196832: - adds r0, r5, 0 - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_81969E0 - adds r0, r7, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81967AC - - thumb_func_start sub_8196844 -sub_8196844: @ 8196844 - push {lr} - adds r3, r0, 0 - movs r2, 0 - ldr r1, =gUnknown_0860DEB8 -_0819684C: - ldrh r0, [r1] - cmp r0, r3 - beq _0819685C - adds r1, 0x14 - adds r2, 0x1 - b _0819684C - .pool -_0819685C: - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_8196844 - - thumb_func_start sub_8196864 -sub_8196864: @ 8196864 - ldr r2, =gUnknown_0860DEB8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r1, [r1, 0xE] - movs r2, 0xFF - lsrs r0, r1, 8 - subs r0, 0x1 - ands r1, r2 - subs r1, 0x1 - ldr r2, =gUnknown_0860EA2C - lsls r0, 2 - adds r0, r2 - lsls r1, 3 - ldr r0, [r0] - adds r0, r1 - bx lr - .pool - thumb_func_end sub_8196864 - - thumb_func_start sub_8196890 -sub_8196890: @ 8196890 - ldr r2, =gUnknown_0860DEB8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r1, [r1, 0x10] - movs r2, 0xFF - lsrs r0, r1, 8 - subs r0, 0x1 - ands r1, r2 - subs r1, 0x1 - ldr r2, =gUnknown_0860EA2C - lsls r0, 2 - adds r0, r2 - lsls r1, 3 - ldr r0, [r0] - adds r0, r1 - bx lr - .pool - thumb_func_end sub_8196890 - - thumb_func_start sub_81968BC -sub_81968BC: @ 81968BC - push {r4,lr} - adds r4, r0, 0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - ldr r2, =gUnknown_0860DEB8 - lsrs r0, 15 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 2 - adds r0, r1 - adds r2, 0x4 - adds r0, r2 - ldrh r4, [r0] - cmp r4, 0 - bne _081968EC - movs r0, 0 - bl SpriteCallbackDummy -_081968EC: - movs r1, 0xFF - lsrs r0, r4, 8 - subs r0, 0x1 - ands r4, r1 - subs r1, r4, 0x1 - ldr r2, =gUnknown_0860EA20 - lsls r0, 2 - adds r0, r2 - lsls r1, 3 - ldr r0, [r0] - adds r0, r1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81968BC - - thumb_func_start sub_8196910 -sub_8196910: @ 8196910 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081969AC - movs r5, 0 - movs r4, 0 - lsls r7, r6, 2 -_0819692C: - lsls r0, r4, 16 - lsrs r0, 16 - mov r1, sp - bl sub_8196E04 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _08196940 - adds r5, 0x1 -_08196940: - adds r4, 0x1 - cmp r4, 0x6 - ble _0819692C - cmp r5, 0 - beq _081969AC - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - adds r5, r0, 0 - movs r4, 0 - b _08196962 -_0819695E: - subs r5, 0x1 -_08196960: - adds r4, 0x1 -_08196962: - cmp r4, 0x6 - bgt _08196980 - lsls r0, r4, 16 - lsrs r0, 16 - mov r1, sp - bl sub_8196E04 - ldr r1, =gUnknown_0203CD88 - strh r0, [r1, 0x2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _08196960 - cmp r5, 0 - bne _0819695E -_08196980: - ldr r0, =gUnknown_0203CD88 - strh r4, [r0] - ldr r1, =gUnknown_0860DEB8 - adds r0, r7, r6 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0xC] - subs r2, r0, 0x1 - ldr r1, =gUnknown_0860EA34 - ldr r0, [sp] - lsls r0, 2 - adds r0, r1 - lsls r1, r2, 3 - ldr r0, [r0] - adds r0, r1 - b _081969D0 - .pool -_081969AC: - ldr r1, =gUnknown_0860DEB8 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrh r2, [r0, 0xA] - lsrs r1, r2, 8 - subs r1, 0x1 - str r1, [sp] - movs r0, 0xFF - ands r0, r2 - subs r2, r0, 0x1 - ldr r0, =gUnknown_0860EA34 - lsls r1, 2 - adds r1, r0 - lsls r2, 3 - ldr r0, [r1] - adds r0, r2 -_081969D0: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196910 - - thumb_func_start sub_81969E0 -sub_81969E0: @ 81969E0 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - adds r1, r4, 0x4 - bl sub_81969FC - ldr r1, [r4] - adds r0, r5, 0 - bl StringExpandPlaceholders - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81969E0 - - thumb_func_start sub_81969FC -sub_81969FC: @ 81969FC - push {r4-r7,lr} - adds r7, r0, 0 - adds r6, r1, 0 - movs r4, 0 - ldr r5, =gUnknown_0860EFA0 -_08196A06: - adds r1, r6, r4 - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0 - blt _08196A1A - adds r1, r0, 0 - ldr r2, [r5] - adds r0, r7, 0 - bl sub_8196A2C -_08196A1A: - adds r5, 0x4 - adds r4, 0x1 - cmp r4, 0x2 - ble _08196A06 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81969FC - - thumb_func_start sub_8196A2C -sub_8196A2C: @ 8196A2C - push {lr} - ldr r3, =gUnknown_0860EFAC - lsls r1, 2 - adds r1, r3 - ldr r3, [r1] - adds r1, r2, 0 - bl _call_via_r3 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196A2C - - thumb_func_start sub_8196A44 -sub_8196A44: @ 8196A44 - push {r4-r6,lr} - adds r5, r1, 0 - ldr r2, =gUnknown_0860DEB8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r4, [r1] - movs r2, 0 - ldr r3, =gUnknown_0860EFC4 - adds r6, r3, 0 -_08196A5A: - lsls r1, r2, 3 - ldrh r0, [r3] - cmp r0, r4 - bne _08196A78 - adds r0, r6, 0x4 - adds r0, r1, r0 - ldr r1, [r0] - adds r0, r5, 0 - bl StringCopy - b _08196A90 - .pool -_08196A78: - adds r3, 0x8 - adds r2, 0x1 - cmp r2, 0x5 - bls _08196A5A - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - ldr r0, =gTrainers + 0x4 @ name offset - adds r1, r0 - adds r0, r5, 0 - bl StringCopy -_08196A90: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196A44 - - thumb_func_start sub_8196A9C -sub_8196A9C: @ 8196A9C - push {r4,lr} - adds r4, r1, 0 - bl sub_819672C - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - bl GetMapName - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8196A9C - - thumb_func_start sub_8196AB8 -sub_8196AB8: @ 8196AB8 - push {lr} - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x13 - bgt _08196AD4 - movs r0, 0 - b _08196B4A -_08196AD4: - adds r0, r1, 0 - subs r0, 0x14 - cmp r0, 0x13 - bhi _08196AE0 - movs r0, 0x1 - b _08196B4A -_08196AE0: - adds r0, r1, 0 - subs r0, 0x28 - cmp r0, 0x9 - bhi _08196AEC - movs r0, 0x2 - b _08196B4A -_08196AEC: - adds r0, r1, 0 - subs r0, 0x32 - cmp r0, 0x9 - bhi _08196AF8 - movs r0, 0x3 - b _08196B4A -_08196AF8: - adds r0, r1, 0 - subs r0, 0x3C - cmp r0, 0x9 - bhi _08196B04 - movs r0, 0x4 - b _08196B4A -_08196B04: - adds r0, r1, 0 - subs r0, 0x46 - cmp r0, 0x9 - bhi _08196B10 - movs r0, 0x5 - b _08196B4A -_08196B10: - adds r0, r1, 0 - subs r0, 0x50 - cmp r0, 0x4 - bhi _08196B1C - movs r0, 0x6 - b _08196B4A -_08196B1C: - adds r0, r1, 0 - subs r0, 0x55 - cmp r0, 0x4 - bhi _08196B28 - movs r0, 0x7 - b _08196B4A -_08196B28: - adds r0, r1, 0 - subs r0, 0x5A - cmp r0, 0x3 - bhi _08196B34 - movs r0, 0x8 - b _08196B4A -_08196B34: - adds r0, r1, 0 - subs r0, 0x5E - cmp r0, 0x3 - bhi _08196B40 - movs r0, 0x9 - b _08196B4A -_08196B40: - cmp r1, 0x62 - beq _08196B48 - movs r0, 0xB - b _08196B4A -_08196B48: - movs r0, 0xA -_08196B4A: - pop {r1} - bx r1 - thumb_func_end sub_8196AB8 - - thumb_func_start sub_8196B50 -sub_8196B50: @ 8196B50 - push {lr} - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x3B - bgt _08196B6C - movs r0, 0 - b _08196B92 -_08196B6C: - adds r0, r1, 0 - subs r0, 0x3C - cmp r0, 0x1D - bhi _08196B78 - movs r0, 0x1 - b _08196B92 -_08196B78: - adds r0, r1, 0 - subs r0, 0x5A - cmp r0, 0x4 - bhi _08196B84 - movs r0, 0x2 - b _08196B92 -_08196B84: - adds r0, r1, 0 - subs r0, 0x5F - cmp r0, 0x3 - bls _08196B90 - movs r0, 0x4 - b _08196B92 -_08196B90: - movs r0, 0x3 -_08196B92: - pop {r1} - bx r1 - thumb_func_end sub_8196B50 - - thumb_func_start sub_8196B98 -sub_8196B98: @ 8196B98 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r2, r0, 0 - mov r8, r1 - movs r3, 0 - ldr r0, =gWildMonHeaders - ldrb r1, [r0] - adds r7, r0, 0 - cmp r1, 0xFF - beq _08196C5C - ldr r1, =gUnknown_085500A4 - lsls r0, r2, 4 - adds r2, r0, r1 - ldrh r4, [r2, 0xA] - adds r1, r7, 0 -_08196BBA: - ldrb r0, [r1] - cmp r0, r4 - bne _08196BC8 - ldrb r0, [r1, 0x1] - ldrh r5, [r2, 0xC] - cmp r0, r5 - beq _08196BD2 -_08196BC8: - adds r1, 0x14 - adds r3, 0x1 - ldrb r0, [r1] - cmp r0, 0xFF - bne _08196BBA -_08196BD2: - adds r1, r7, 0 - lsls r0, r3, 2 - adds r0, r3 - lsls r5, r0, 2 - adds r0, r5, r1 - ldrb r0, [r0] - cmp r0, 0xFF - beq _08196C5C - movs r6, 0 - adds r0, r1, 0x4 - adds r0, r5, r0 - ldr r4, [r0] - cmp r4, 0 - beq _08196C02 - bl sub_8196AB8 - lsls r0, 24 - mov r2, sp - ldr r1, [r4, 0x4] - lsrs r0, 22 - adds r0, r1 - ldrh r0, [r0, 0x2] - strh r0, [r2] - movs r6, 0x1 -_08196C02: - adds r0, r7, 0 - adds r0, 0x8 - adds r0, r5, r0 - ldr r4, [r0] - cmp r4, 0 - beq _08196C26 - bl sub_8196B50 - lsls r0, 24 - lsls r1, r6, 1 - mov r3, sp - adds r2, r3, r1 - ldr r1, [r4, 0x4] - lsrs r0, 22 - adds r0, r1 - ldrh r0, [r0, 0x2] - strh r0, [r2] - adds r6, 0x1 -_08196C26: - cmp r6, 0 - beq _08196C5C - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 1 - add r0, sp - ldrh r1, [r0] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - mov r0, r8 - bl StringCopy - b _08196C62 - .pool -_08196C5C: - movs r0, 0xFF - mov r5, r8 - strb r0, [r5] -_08196C62: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8196B98 - - thumb_func_start sub_8196C70 -sub_8196C70: @ 8196C70 - push {r4-r7,lr} - adds r7, r1, 0 - ldr r2, =gUnknown_0860DEB8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1] - bl sub_80B2250 - lsls r0, 16 - lsrs r0, 16 - ldr r5, =gTrainers - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r0, r5, 0 - adds r0, 0x24 - adds r0, r4, r0 - ldr r6, [r0] - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r4, r5 - adds r1, r4, 0 - adds r1, 0x20 - ldrb r1, [r1] - bl __modsi3 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r4] - cmp r1, 0x1 - beq _08196CD4 - cmp r1, 0x1 - ble _08196CC2 - cmp r1, 0x2 - beq _08196CD0 - cmp r1, 0x3 - beq _08196CD4 -_08196CC2: - lsls r0, 3 - b _08196CD6 - .pool -_08196CD0: - lsls r0, 3 - b _08196CD6 -_08196CD4: - lsls r0, 4 -_08196CD6: - adds r0, r6 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r7, 0 - bl StringCopy - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196C70 - - thumb_func_start sub_8196CF4 -sub_8196CF4: @ 8196CF4 - push {lr} - adds r0, r1, 0 - ldr r2, =gUnknown_0860EFF4 - ldr r1, =gUnknown_0203CD88 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196CF4 - - thumb_func_start sub_8196D14 -sub_8196D14: @ 8196D14 - push {r4-r6,lr} - adds r5, r1, 0 - movs r4, 0 - ldr r0, =gUnknown_0203CD88 - ldrh r1, [r0, 0x2] - adds r6, r0, 0 - cmp r1, 0 - beq _08196D34 -_08196D24: - adds r0, r1, 0 - movs r1, 0xA - bl __divsi3 - adds r1, r0, 0 - adds r4, 0x1 - cmp r1, 0 - bne _08196D24 -_08196D34: - ldrh r1, [r6, 0x2] - lsls r3, r4, 24 - lsrs r3, 24 - adds r0, r5, 0 - movs r2, 0 - bl ConvertIntToDecimalStringN - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196D14 - - thumb_func_start sub_8196D4C -sub_8196D4C: @ 8196D4C - push {r4,r5,lr} - movs r4, 0 - ldr r5, =gUnknown_0860F010 - b _08196D5C - .pool -_08196D58: - adds r5, 0x2 - adds r4, 0x1 -_08196D5C: - cmp r4, 0x7 - bhi _08196D6C - ldrh r0, [r5] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08196D58 -_08196D6C: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8196D4C - - thumb_func_start sub_8196D74 -sub_8196D74: @ 8196D74 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - bl sub_8196D4C - cmp r0, 0x4 - ble _08196DF4 - bl RtcGetLocalDayCount - adds r4, r0, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xA - bl ReadUnalignedWord - adds r6, r0, 0 - ldr r0, =0x0000ffff - ands r6, r0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00002e6a - adds r0, r1 - ldrh r5, [r0] - bl sub_8196748 - mov r9, r0 - movs r0, 0xD - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - movs r1, 0xA - bl __divsi3 - mov r8, r0 - movs r0, 0x9 - bl GetGameStat - eors r4, r5 - eors r5, r0 - adds r4, r5 - eors r4, r6 - adds r0, r4, 0 - mov r1, r8 - bl __modsi3 - cmp r0, r9 - bge _08196DF4 - bl sub_8196774 - cmp r0, r7 - bne _08196DF4 - movs r0, 0x1 - b _08196DF6 - .pool -_08196DF4: - movs r0, 0 -_08196DF6: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8196D74 - - thumb_func_start sub_8196E04 -sub_8196E04: @ 8196E04 - push {r4-r6,lr} - adds r5, r1, 0 - lsls r0, 16 - lsrs r0, 16 - movs r4, 0 - cmp r0, 0x6 - bls _08196E14 - b _08196F7E -_08196E14: - lsls r0, 2 - ldr r1, =_08196E24 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08196E24: - .4byte _08196E9C - .4byte _08196E40 - .4byte _08196ED0 - .4byte _08196F38 - .4byte _08196E74 - .4byte _08196F04 - .4byte _08196F60 -_08196E40: - movs r3, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000d14 - adds r0, r1 -_08196E4A: - lsls r1, r3, 2 - adds r3, 0x1 - adds r1, r0 - movs r2, 0x1 -_08196E52: - ldrh r6, [r1] - cmp r4, r6 - bcs _08196E5A - ldrh r4, [r1] -_08196E5A: - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08196E52 - cmp r3, 0x1 - ble _08196E4A - movs r0, 0x3 - b _08196F7C - .pool -_08196E74: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e08 - adds r0, r1 - movs r3, 0x1 -_08196E7E: - ldrh r6, [r0] - cmp r4, r6 - bcs _08196E86 - ldrh r4, [r0] -_08196E86: - adds r0, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _08196E7E - movs r0, 0x4 - b _08196F7C - .pool -_08196E9C: - movs r3, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xCF - lsls r1, 4 - adds r0, r1 -_08196EA8: - lsls r1, r3, 2 - adds r3, 0x1 - adds r1, r0 - movs r2, 0x1 -_08196EB0: - ldrh r6, [r1] - cmp r4, r6 - bcs _08196EB8 - ldrh r4, [r1] -_08196EB8: - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08196EB0 - movs r2, 0x2 - cmp r3, 0x3 - ble _08196EA8 - str r2, [r5] - b _08196F7E - .pool -_08196ED0: - movs r3, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xDD - lsls r1, 4 - adds r0, r1 -_08196EDC: - lsls r1, r3, 2 - adds r3, 0x1 - adds r1, r0 - movs r2, 0x1 -_08196EE4: - ldrh r6, [r1] - cmp r4, r6 - bcs _08196EEC - ldrh r4, [r1] -_08196EEC: - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08196EE4 - movs r2, 0x2 - cmp r3, 0x1 - ble _08196EDC - str r2, [r5] - b _08196F7E - .pool -_08196F04: - movs r3, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000dea - adds r0, r1 -_08196F0E: - lsls r1, r3, 2 - adds r3, 0x1 - adds r1, r0 - movs r2, 0x1 -_08196F16: - ldrh r6, [r1] - cmp r4, r6 - bcs _08196F1E - ldrh r4, [r1] -_08196F1E: - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08196F16 - movs r2, 0x2 - cmp r3, 0x1 - ble _08196F0E - str r2, [r5] - b _08196F7E - .pool -_08196F38: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000dde - adds r0, r1 - movs r3, 0x1 -_08196F42: - ldrh r6, [r0] - cmp r4, r6 - bcs _08196F4A - ldrh r4, [r0] -_08196F4A: - adds r0, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _08196F42 - movs r3, 0x2 - str r3, [r5] - b _08196F7E - .pool -_08196F60: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e1e - adds r0, r1 - movs r3, 0x1 -_08196F6A: - ldrh r6, [r0] - cmp r4, r6 - bcs _08196F72 - ldrh r4, [r0] -_08196F72: - adds r0, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _08196F6A - movs r0, 0x5 -_08196F7C: - str r0, [r5] -_08196F7E: - adds r0, r4, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196E04 - - thumb_func_start sub_8196F90 -sub_8196F90: @ 8196F90 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x9 - bhi _08196F9E - movs r0, 0 - b _0819707A -_08196F9E: - cmp r4, 0x13 - bhi _08196FA6 - movs r0, 0x1 - b _0819707A -_08196FA6: - cmp r4, 0x1D - bhi _08196FAE - movs r0, 0x2 - b _0819707A -_08196FAE: - cmp r4, 0x27 - bhi _08196FB6 - movs r0, 0x3 - b _0819707A -_08196FB6: - cmp r4, 0x31 - bhi _08196FBE - movs r0, 0x4 - b _0819707A -_08196FBE: - cmp r4, 0x3B - bhi _08196FC6 - movs r0, 0x5 - b _0819707A -_08196FC6: - cmp r4, 0x45 - bhi _08196FCE - movs r0, 0x6 - b _0819707A -_08196FCE: - cmp r4, 0x4F - bhi _08196FD6 - movs r0, 0x7 - b _0819707A -_08196FD6: - cmp r4, 0x59 - bhi _08196FDE - movs r0, 0x8 - b _0819707A -_08196FDE: - cmp r4, 0x63 - bhi _08196FE6 - movs r0, 0x9 - b _0819707A -_08196FE6: - cmp r4, 0x6D - bhi _08196FEE - movs r0, 0xA - b _0819707A -_08196FEE: - cmp r4, 0x77 - bhi _08196FF6 - movs r0, 0xB - b _0819707A -_08196FF6: - cmp r4, 0x81 - bhi _08196FFE - movs r0, 0xC - b _0819707A -_08196FFE: - cmp r4, 0x8B - bhi _08197006 - movs r0, 0xD - b _0819707A -_08197006: - cmp r4, 0x95 - bhi _0819700E - movs r0, 0xE - b _0819707A -_0819700E: - cmp r4, 0x9F - bhi _08197016 - movs r0, 0xF - b _0819707A -_08197016: - cmp r4, 0xA9 - bhi _0819701E - movs r0, 0x10 - b _0819707A -_0819701E: - cmp r4, 0xB3 - bhi _08197026 - movs r0, 0x11 - b _0819707A -_08197026: - cmp r4, 0xBD - bhi _0819702E - movs r0, 0x12 - b _0819707A -_0819702E: - cmp r4, 0xC7 - bls _08197078 - movs r0, 0xCD - lsls r0, 1 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _08197050 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_08197050: - ldr r0, =0x00000199 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _0819706C - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_0819706C: - cmp r4, 0xC7 - bls _08197078 - movs r0, 0x14 - b _0819707A - .pool -_08197078: - movs r0, 0x13 -_0819707A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8196F90 - - thumb_func_start sub_8197080 -sub_8197080: @ 8197080 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r0 - movs r0, 0xFA - lsls r0, 2 - bl Alloc - adds r7, r0, 0 - cmp r7, 0 - bne _081970A2 - movs r0, 0xFF - mov r1, r8 - strb r0, [r1] - b _0819715C -_081970A2: - movs r0, 0 - bl sub_80C0844 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x1 - bl sub_80C0844 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gStringVar1 - mov r10, r0 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r1, =gStringVar2 - mov r9, r1 - mov r0, r9 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r0, r6, 0 - bl sub_8196F90 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gUnknown_082A5C9C - adds r0, r7, 0 - bl StringCopy - adds r5, r0, 0 - movs r6, 0xFB - strb r6, [r5] - adds r5, 0x1 - ldr r1, =gUnknown_082A5D2C - adds r0, r5, 0 - bl StringCopy - adds r5, r0, 0 - strb r6, [r5] - adds r5, 0x1 - ldr r0, =gUnknown_0860F020 - lsls r4, 2 - adds r4, r0 - ldr r1, [r4] - adds r0, r5, 0 - bl StringCopy - mov r0, r8 - adds r1, r7, 0 - bl StringExpandPlaceholders - adds r5, r0, 0 - bl IsNationalPokedexEnabled - cmp r0, 0 - beq _08197156 - strb r6, [r5] - adds r5, 0x1 - movs r0, 0 - bl pokedex_count - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x1 - bl pokedex_count - lsls r0, 16 - lsrs r6, r0, 16 - mov r0, r10 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - mov r0, r9 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_082A633D - adds r0, r5, 0 - bl StringExpandPlaceholders -_08197156: - adds r0, r7, 0 - bl Free -_0819715C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197080 - - thumb_func_start sub_8197184 -sub_8197184: @ 8197184 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0860EA6C - movs r2, 0x80 - lsls r2, 1 - lsls r4, 16 - lsrs r4, 16 - adds r3, r4, 0 - bl LoadBgTiles - ldr r0, =gUnknown_0860EA4C - lsls r5, 20 - lsrs r5, 16 - adds r1, r5, 0 - movs r2, 0x20 - bl LoadPalette - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197184 - - thumb_func_start sub_81971C4 -sub_81971C4: @ 81971C4 - push {lr} - bl sub_819645C - pop {r0} - bx r0 - thumb_func_end sub_81971C4 - - thumb_func_start sub_81971D0 -sub_81971D0: @ 81971D0 - push {lr} - ldr r0, =gUnknown_0860F098 - bl InitWindows - ldr r0, =gUnknown_0203CD8C - movs r1, 0xFF - strb r1, [r0] - ldr r0, =gUnknown_0203CD8D - strb r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81971D0 - - thumb_func_start sub_81971F4 -sub_81971F4: @ 81971F4 - push {lr} - bl FreeAllWindowBuffers - pop {r0} - bx r0 - thumb_func_end sub_81971F4 - - thumb_func_start sub_8197200 -sub_8197200: @ 8197200 - push {lr} - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - bl DeactivateAllTextPrinters - bl sub_81973A4 - pop {r0} - bx r0 - thumb_func_end sub_8197200 - - thumb_func_start sub_8197224 -sub_8197224: @ 8197224 - push {lr} - bl RunTextPrinters - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_8197224 - - thumb_func_start AddTextPrinterParametrized -@ u16 AddTextPrinterParametrized(u8 windowId, u8 fontId, u8 *str, u8 speed, void ( *callback)(u16, struct TextPrinter *), u8 fgColor, u8 bgColor, u8 shadowColor) -AddTextPrinterParametrized: @ 8197238 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - ldr r7, [sp, 0x28] - ldr r4, [sp, 0x2C] - mov r8, r4 - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - str r2, [sp] - mov r2, sp - movs r4, 0 - strb r0, [r2, 0x4] - mov r0, sp - strb r1, [r0, 0x5] - strb r4, [r0, 0x6] - movs r1, 0x1 - strb r1, [r0, 0x7] - strb r4, [r0, 0x8] - strb r1, [r0, 0x9] - strb r4, [r0, 0xA] - strb r4, [r0, 0xB] - mov r4, sp - ldrb r2, [r4, 0xC] - subs r1, 0x11 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r4, 0xC] - mov r0, sp - mov r2, r8 - lsls r2, 4 - movs r4, 0xF - strb r2, [r0, 0xC] - mov r2, sp - ands r5, r4 - ldrb r0, [r2, 0xD] - ands r1, r0 - orrs r1, r5 - strb r1, [r2, 0xD] - mov r0, sp - lsrs r6, 20 - ands r1, r4 - orrs r1, r6 - strb r1, [r0, 0xD] - ldr r2, =gTextFlags - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - mov r0, sp - adds r1, r3, 0 - adds r2, r7, 0 - bl AddTextPrinter - lsls r0, 16 - lsrs r0, 16 - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddTextPrinterParametrized - - thumb_func_start AddTextPrinterForMessage -@ void AddTextPrinterForMessage(u8 allowSkippingDelayWithButtonPress) -AddTextPrinterForMessage: @ 81972C4 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - ldr r3, =gTextFlags - movs r4, 0x1 - ands r0, r4 - ldrb r2, [r3] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3] - bl sav2_get_text_speed - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r2, =gStringVar4 - str r5, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end AddTextPrinterForMessage - - thumb_func_start AddTextPrinterForMessage_2 -@ void AddTextPrinterForMessage_2(u8 allowSkippingDelayWithButtonPress) -AddTextPrinterForMessage_2: @ 8197310 - push {r4,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gTextFlags - movs r4, 0x1 - ands r0, r4 - ldrb r2, [r3] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3] - bl sav2_get_text_speed - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r2, =gStringVar4 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end AddTextPrinterForMessage_2 - - thumb_func_start AddTextPrinterWithCustomSpeedForMessage -@ void AddTextPrinterWithCustomSpeedForMessage(u8 allowSkippingDelayWithButtonPress, u8 speed) -AddTextPrinterWithCustomSpeedForMessage: @ 819735C - push {r4,r5,lr} - sub sp, 0x10 - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r4, =gTextFlags - movs r5, 0x1 - ands r0, r5 - ldrb r2, [r4] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r4] - ldr r2, =gStringVar4 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end AddTextPrinterWithCustomSpeedForMessage - - thumb_func_start sub_81973A4 -sub_81973A4: @ 81973A4 - push {lr} - movs r1, 0x80 - lsls r1, 2 - movs r0, 0 - movs r2, 0xF0 - bl copy_textbox_border_tile_patterns_to_vram - movs r1, 0x85 - lsls r1, 2 - movs r0, 0 - movs r2, 0xE0 - bl sub_809882C - pop {r0} - bx r0 - thumb_func_end sub_81973A4 - - thumb_func_start sub_81973C4 -sub_81973C4: @ 81973C4 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_81975F4 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _081973F2 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_081973F2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81973C4 - - thumb_func_start sub_81973FC -sub_81973FC: @ 81973FC - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_81974A4 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _0819742A - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0819742A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81973FC - - thumb_func_start sub_8197434 -sub_8197434: @ 8197434 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_8197804 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl ClearWindowTilemap - cmp r4, 0x1 - bne _08197462 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197462: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197434 - - thumb_func_start sub_819746C -sub_819746C: @ 819746C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_81977BC - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl ClearWindowTilemap - cmp r4, 0x1 - bne _0819749A - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0819749A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819746C - - thumb_func_start sub_81974A4 -sub_81974A4: @ 81974A4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r4, r2, 0 - ldr r2, [sp, 0x3C] - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsls r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x10] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - movs r3, 0x85 - lsls r3, 2 - lsrs r0, r1, 24 - str r0, [sp, 0xC] - movs r2, 0xFF - lsls r2, 24 - adds r2, r1 - mov r8, r2 - lsrs r2, 24 - lsrs r0, r4, 24 - mov r9, r0 - movs r0, 0xFF - lsls r0, 24 - adds r4, r0 - lsrs r4, 24 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - movs r6, 0xE - str r6, [sp, 0x8] - adds r0, r7, 0 - adds r1, r3, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000215 - ldr r2, [sp, 0x10] - str r2, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0xC] - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000216 - ldr r3, [sp, 0xC] - ldr r2, [sp, 0x10] - adds r0, r3, r2 - lsls r0, 24 - mov r10, r0 - lsrs r2, r0, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r7, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - mov r5, r9 - ldr r0, [sp, 0x14] - add r0, r9 - cmp r9, r0 - bge _08197578 - mov r3, r8 - str r3, [sp, 0x18] - movs r6, 0x1 - movs r0, 0xE - mov r8, r0 -_0819753E: - lsls r4, r5, 24 - lsrs r4, 24 - str r6, [sp] - str r6, [sp, 0x4] - mov r2, r8 - str r2, [sp, 0x8] - adds r0, r7, 0 - ldr r1, =0x00000217 - ldr r3, [sp, 0x18] - lsrs r2, r3, 24 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - str r6, [sp] - str r6, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - adds r0, r7, 0 - ldr r1, =0x00000219 - mov r3, r10 - lsrs r2, r3, 24 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - adds r5, 0x1 - ldr r0, [sp, 0x14] - add r0, r9 - cmp r5, r0 - blt _0819753E -_08197578: - ldr r1, =0x0000021a - ldr r2, [sp, 0xC] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r4, [sp, 0x14] - add r4, r9 - lsls r4, 24 - lsrs r4, 24 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - movs r6, 0xE - str r6, [sp, 0x8] - adds r0, r7, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x0000021b - ldr r0, [sp, 0x10] - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0xC] - adds r3, r4, 0 - bl FillBgTilemapBufferRect - movs r1, 0x87 - lsls r1, 2 - ldr r3, [sp, 0xC] - ldr r0, [sp, 0x10] - adds r2, r3, r0 - lsls r2, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r7, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81974A4 - - thumb_func_start sub_81975F4 -sub_81975F4: @ 81975F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - adds r6, r0, 0 - adds r5, r2, 0 - mov r8, r3 - ldr r2, [sp, 0x44] - lsls r6, 24 - lsrs r6, 24 - lsls r0, r1, 24 - lsls r5, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp, 0x10] - ldr r1, =0x00000201 - lsrs r2, r0, 24 - str r2, [sp, 0xC] - movs r3, 0xFE - lsls r3, 24 - adds r2, r0, r3 - lsrs r2, 24 - str r2, [sp, 0x14] - lsrs r0, r5, 24 - mov r10, r0 - movs r2, 0xFF - lsls r2, 24 - adds r5, r2 - lsrs r5, 24 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r3, 0xF - mov r9, r3 - str r3, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x14] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000203 - ldr r0, [sp, 0xC] - subs r0, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x18] - str r4, [sp] - str r4, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r6, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - movs r1, 0x81 - lsls r1, 2 - mov r0, r8 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - str r0, [sp] - str r4, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0xC] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000205 - ldr r7, [sp, 0xC] - add r7, r8 - subs r0, r7, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x20] - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - adds r0, r6, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000206 - lsls r2, r7, 24 - lsrs r7, r2, 24 - str r4, [sp] - str r4, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r6, 0 - adds r2, r7, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000207 - str r4, [sp] - movs r5, 0x5 - str r5, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x14] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000209 - add r8, r4 - mov r3, r8 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - str r5, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x18] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x0000020a - str r4, [sp] - str r5, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - adds r2, r7, 0 - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a01 - ldr r3, [sp, 0x10] - add r10, r3 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x14] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a03 - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x18] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a04 - ldr r0, [sp, 0x1C] - str r0, [sp] - str r4, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0xC] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a05 - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x20] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a06 - str r4, [sp] - str r4, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r6, 0 - adds r2, r7, 0 - mov r3, r10 - bl FillBgTilemapBufferRect - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81975F4 - - thumb_func_start sub_81977BC -sub_81977BC: @ 81977BC - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsls r5, 24 - lsls r3, 24 - lsls r1, 24 - movs r2, 0xFF - lsls r2, 24 - adds r4, r2 - lsrs r4, 24 - adds r5, r2 - lsrs r5, 24 - movs r2, 0x80 - lsls r2, 18 - adds r3, r2 - lsrs r3, 24 - str r3, [sp] - adds r1, r2 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r1, 0xE - str r1, [sp, 0x8] - movs r1, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81977BC - - thumb_func_start sub_8197804 -sub_8197804: @ 8197804 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsls r5, 24 - lsls r3, 24 - lsls r1, 24 - movs r2, 0xFD - lsls r2, 24 - adds r4, r2 - lsrs r4, 24 - movs r2, 0xFF - lsls r2, 24 - adds r5, r2 - lsrs r5, 24 - movs r2, 0xC0 - lsls r2, 19 - adds r3, r2 - lsrs r3, 24 - str r3, [sp] - movs r2, 0x80 - lsls r2, 18 - adds r1, r2 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r1, 0xE - str r1, [sp, 0x8] - movs r1, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8197804 - - thumb_func_start SetStandardWindowBorderStyle -@ void SetStandardWindowBorderStyle(u8 windowId, bool copyToVram) -SetStandardWindowBorderStyle: @ 8197854 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0x85 - lsls r2, 2 - movs r3, 0xE - bl SetWindowBorderStyle - pop {r0} - bx r0 - thumb_func_end SetStandardWindowBorderStyle - - thumb_func_start sub_819786C -sub_819786C: @ 819786C - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r6, 0x80 - lsls r6, 2 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0xF0 - bl copy_textbox_border_tile_patterns_to_vram - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - movs r3, 0xF - bl sub_8197B1C - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819786C - - thumb_func_start sub_819789C -sub_819789C: @ 819789C - push {lr} - ldr r0, =gUnknown_0860F074 - movs r1, 0xE0 - movs r2, 0x14 - bl LoadPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_819789C - - thumb_func_start sub_81978B0 -sub_81978B0: @ 81978B0 - push {lr} - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =gUnknown_0860F074 - movs r2, 0x14 - bl LoadPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_81978B0 - - thumb_func_start sub_81978C8 -sub_81978C8: @ 81978C8 - ldr r0, =gUnknown_0860F074 - bx lr - .pool - thumb_func_end sub_81978C8 - - thumb_func_start sub_81978D0 -sub_81978D0: @ 81978D0 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _081978DC - movs r1, 0 -_081978DC: - ldr r0, =gUnknown_0860F074 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81978D0 - - thumb_func_start DisplayItemMessageOnField -@ void DisplayItemMessageOnField(u8 taskId, u8 *str, void ( *callback)(u8 taskId)) -DisplayItemMessageOnField: @ 81978EC - push {r4-r6,lr} - sub sp, 0x10 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81973A4 - bl sav2_get_text_speed - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 2 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - str r5, [sp, 0x8] - str r6, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0 - movs r3, 0xF - bl DisplayMessageAndContinueTask - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end DisplayItemMessageOnField - - thumb_func_start sub_8197930 -sub_8197930: @ 8197930 - push {lr} - ldr r0, =gUnknown_0860F0A8 - movs r1, 0x85 - lsls r1, 2 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197930 - - thumb_func_start sub_8197948 -sub_8197948: @ 8197948 - push {lr} - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0860F0A8 - movs r1, 0x85 - lsls r1, 2 - movs r2, 0xE - bl CreateYesNoMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197948 - - thumb_func_start sub_8197964 -sub_8197964: @ 8197964 - push {lr} - ldr r0, =gTextFlags - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _08197988 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x14] - lsls r0, 29 - lsrs r0, 29 - b _0819798A - .pool -_08197988: - movs r0, 0x1 -_0819798A: - pop {r1} - bx r1 - thumb_func_end sub_8197964 - - thumb_func_start sav2_get_text_speed -sav2_get_text_speed: @ 8197990 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x14] - lsls r0, r1, 29 - lsrs r0, 29 - cmp r0, 0x2 - bls _081979AC - movs r0, 0x8 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x14] -_081979AC: - bl sub_8197964 - ldr r1, =gUnknown_0860F094 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sav2_get_text_speed - - thumb_func_start sub_81979C4 -sub_81979C4: @ 81979C4 - push {r4,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r1, r0, 24 - ldr r4, =gUnknown_0203CD8C - ldrb r0, [r4] - cmp r0, 0xFF - bne _081979F6 - lsls r0, r1, 25 - movs r1, 0x80 - lsls r1, 18 - adds r0, r1 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - ldr r0, =0x00000139 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x16 - movs r2, 0x1 - movs r3, 0x7 - bl sub_8198AA4 - strb r0, [r4] -_081979F6: - ldrb r0, [r4] - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81979C4 - - thumb_func_start get_start_menu_window_id_maybe -get_start_menu_window_id_maybe: @ 8197A08 - ldr r0, =gUnknown_0203CD8C - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_start_menu_window_id_maybe - - thumb_func_start remove_start_menu_window_maybe -remove_start_menu_window_maybe: @ 8197A14 - push {r4,lr} - ldr r4, =gUnknown_0203CD8C - ldrb r0, [r4] - cmp r0, 0xFF - beq _08197A26 - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_08197A26: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end remove_start_menu_window_maybe - - thumb_func_start sub_8197A30 -sub_8197A30: @ 8197A30 - movs r0, 0x80 - lsls r0, 2 - bx lr - thumb_func_end sub_8197A30 - - thumb_func_start sub_8197A38 -sub_8197A38: @ 8197A38 - movs r0, 0x85 - lsls r0, 2 - bx lr - thumb_func_end sub_8197A38 - - thumb_func_start AddMapNamePopUpWindow -AddMapNamePopUpWindow: @ 8197A40 - push {r4,lr} - sub sp, 0xC - ldr r4, =gUnknown_0203CD8D - ldrb r0, [r4] - cmp r0, 0xFF - bne _08197A66 - movs r0, 0x3 - str r0, [sp] - movs r0, 0xE - str r0, [sp, 0x4] - adds r0, 0xF9 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x1 - movs r3, 0xA - bl sub_8198AA4 - strb r0, [r4] -_08197A66: - ldrb r0, [r4] - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end AddMapNamePopUpWindow - - thumb_func_start GetMapNamePopUpWindowId -GetMapNamePopUpWindowId: @ 8197A74 - ldr r0, =gUnknown_0203CD8D - ldrb r0, [r0] - bx lr - .pool - thumb_func_end GetMapNamePopUpWindowId - - thumb_func_start RemoveMapNamePopUpWindow -RemoveMapNamePopUpWindow: @ 8197A80 - push {r4,lr} - ldr r4, =gUnknown_0203CD8D - ldrb r0, [r4] - cmp r0, 0xFF - beq _08197A92 - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_08197A92: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveMapNamePopUpWindow - - thumb_func_start AddTextPrinterWithCallbackForMessage -@ void AddTextPrinterWithCallbackForMessage(u8 allowSkippingDelayWithButtonPress, void ( *callback)(u16, struct TextPrinter *)) -AddTextPrinterWithCallbackForMessage: @ 8197A9C - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gTextFlags - movs r4, 0x1 - ands r0, r4 - ldrb r2, [r3] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3] - bl sav2_get_text_speed - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r2, =gStringVar4 - str r5, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end AddTextPrinterWithCallbackForMessage - - thumb_func_start sub_8197AE8 -sub_8197AE8: @ 8197AE8 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - cmp r4, 0x1 - bne _08197B12 - movs r0, 0 - bl CopyBgTilemapBufferToVram -_08197B12: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8197AE8 - - thumb_func_start sub_8197B1C -sub_8197B1C: @ 8197B1C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CD9C - strh r2, [r0] - ldr r0, =gUnknown_0203CD9E - strb r3, [r0] - ldr r1, =sub_8197BB4 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _08197B52 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197B52: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197B1C - - thumb_func_start sub_8197B64 -sub_8197B64: @ 8197B64 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CD9C - strh r2, [r0] - ldr r5, =gUnknown_0203CD9E - adds r0, r6, 0 - movs r1, 0x5 - bl GetWindowAttribute - strb r0, [r5] - ldr r1, =sub_8197BB4 - adds r0, r6, 0 - bl CallWindowFunction - adds r0, r6, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r6, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _08197BA2 - adds r0, r6, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197BA2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197B64 - - thumb_func_start sub_8197BB4 -sub_8197BB4: @ 8197BB4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - mov r8, r0 - adds r5, r2, 0 - adds r6, r3, 0 - ldr r2, [sp, 0x44] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, r1, 24 - lsls r5, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp, 0x10] - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - lsrs r3, r0, 24 - str r3, [sp, 0xC] - movs r3, 0xFE - lsls r3, 24 - adds r2, r0, r3 - lsrs r2, 24 - str r2, [sp, 0x14] - lsrs r0, r5, 24 - mov r9, r0 - movs r2, 0xFF - lsls r2, 24 - adds r5, r2 - lsrs r5, 24 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - ldr r3, =gUnknown_0203CD9E - mov r10, r3 - ldrb r0, [r3] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x14] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r0, =gUnknown_0203CD9C - ldrh r1, [r0] - adds r1, 0x3 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0xC] - subs r0, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x18] - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x18] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x4 - lsls r1, 16 - lsrs r1, 16 - subs r0, r6, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - str r0, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0xC] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x5 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0xC] - adds r7, r0, r6 - subs r0, r7, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x20] - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x20] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x6 - lsls r1, 16 - lsrs r1, 16 - lsls r2, r7, 24 - lsrs r7, r2, 24 - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - adds r2, r7, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - movs r5, 0x5 - str r5, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x14] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x9 - lsls r1, 16 - lsrs r1, 16 - adds r6, 0x1 - lsls r6, 24 - lsrs r6, 24 - str r6, [sp] - str r5, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x18] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0xA - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - str r5, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - adds r2, r7, 0 - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r3, =0x00000801 - adds r1, r3, 0 - ldr r0, =gUnknown_0203CD9C - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x10] - add r9, r2 - mov r3, r9 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x14] - bl FillBgTilemapBufferRect - ldr r3, =0x00000803 - adds r1, r3, 0 - ldr r0, =gUnknown_0203CD9C - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x18] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r3, =0x00000804 - adds r1, r3, 0 - ldr r0, =gUnknown_0203CD9C - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x1C] - str r2, [sp] - str r4, [sp, 0x4] - mov r3, r10 - ldrb r0, [r3] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0xC] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r0, =0x00000805 - adds r1, r0, 0 - ldr r2, =gUnknown_0203CD9C - ldrh r2, [r2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r10 - ldrb r0, [r3] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x20] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r0, =0x00000806 - adds r1, r0, 0 - ldr r2, =gUnknown_0203CD9C - ldrh r2, [r2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r10 - ldrb r0, [r3] - str r0, [sp, 0x8] - mov r0, r8 - adds r2, r7, 0 - mov r3, r9 - bl FillBgTilemapBufferRect - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197BB4 - - thumb_func_start sub_8197DF8 -sub_8197DF8: @ 8197DF8 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_8197E30 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl ClearWindowTilemap - cmp r4, 0x1 - bne _08197E26 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197E26: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197DF8 - - thumb_func_start sub_8197E30 -sub_8197E30: @ 8197E30 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsls r5, 24 - lsls r3, 24 - lsls r1, 24 - movs r2, 0xFD - lsls r2, 24 - adds r4, r2 - lsrs r4, 24 - movs r2, 0xFF - lsls r2, 24 - adds r5, r2 - lsrs r5, 24 - movs r2, 0xC0 - lsls r2, 19 - adds r3, r2 - lsrs r3, 24 - str r3, [sp] - movs r2, 0x80 - lsls r2, 18 - adds r1, r2 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - adds r2, r4, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8197E30 - - thumb_func_start SetWindowBorderStyle -@ void SetWindowBorderStyle(u8 windowId, bool copyToVram, s16 tileStart, s8 palette) -SetWindowBorderStyle: @ 8197E80 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CD9C - strh r2, [r0] - ldr r0, =gUnknown_0203CD9E - strb r3, [r0] - ldr r1, =DrawWindowBorder - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _08197EB6 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197EB6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end SetWindowBorderStyle - - thumb_func_start sub_8197EC8 -sub_8197EC8: @ 8197EC8 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CD9C - strh r2, [r0] - ldr r5, =gUnknown_0203CD9E - adds r0, r6, 0 - movs r1, 0x5 - bl GetWindowAttribute - strb r0, [r5] - ldr r1, =DrawWindowBorder - adds r0, r6, 0 - bl CallWindowFunction - adds r0, r6, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r6, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _08197F06 - adds r0, r6, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197F06: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197EC8 - - thumb_func_start DrawWindowBorder -DrawWindowBorder: @ 8197F18 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r9, r0 - adds r6, r1, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x38] - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r6, 24 - lsls r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x10] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - lsrs r0, r6, 24 - str r0, [sp, 0xC] - movs r2, 0xFF - lsls r2, 24 - adds r6, r2 - lsrs r6, 24 - lsrs r0, r4, 24 - mov r8, r0 - adds r4, r2 - lsrs r4, 24 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - ldr r7, =gUnknown_0203CD9E - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x10] - str r0, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - ldr r2, [sp, 0xC] - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x2 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0xC] - ldr r2, [sp, 0x10] - adds r0, r2 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - str r5, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - mov r2, r10 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r0, =gUnknown_0203CD9C - ldrh r1, [r0] - adds r1, 0x3 - lsls r1, 16 - lsrs r1, 16 - str r5, [sp] - ldr r2, [sp, 0x14] - str r2, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - adds r2, r6, 0 - mov r3, r8 - bl FillBgTilemapBufferRect - ldr r0, =gUnknown_0203CD9C - ldrh r1, [r0] - adds r1, 0x5 - lsls r1, 16 - lsrs r1, 16 - str r5, [sp] - ldr r2, [sp, 0x14] - str r2, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - mov r2, r10 - mov r3, r8 - bl FillBgTilemapBufferRect - ldr r0, =gUnknown_0203CD9C - ldrh r1, [r0] - adds r1, 0x6 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x14] - add r8, r2 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - str r5, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - adds r2, r6, 0 - mov r3, r8 - bl FillBgTilemapBufferRect - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x10] - str r0, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - ldr r2, [sp, 0xC] - mov r3, r8 - bl FillBgTilemapBufferRect - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x8 - lsls r1, 16 - lsrs r1, 16 - str r5, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - mov r2, r10 - mov r3, r8 - bl FillBgTilemapBufferRect - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DrawWindowBorder - - thumb_func_start sub_8198070 -sub_8198070: @ 8198070 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_81980A8 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl ClearWindowTilemap - cmp r4, 0x1 - bne _0819809E - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0819809E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198070 - - thumb_func_start sub_81980A8 -sub_81980A8: @ 81980A8 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsls r5, 24 - lsls r3, 24 - lsls r1, 24 - movs r2, 0xFF - lsls r2, 24 - adds r4, r2 - lsrs r4, 24 - adds r5, r2 - lsrs r5, 24 - movs r2, 0x80 - lsls r2, 18 - adds r3, r2 - lsrs r3, 24 - str r3, [sp] - adds r1, r2 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - adds r2, r4, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81980A8 - - thumb_func_start sub_81980F0 -sub_81980F0: @ 81980F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - ldr r4, [sp, 0x20] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r5, r3, 24 - lsls r4, 16 - lsrs r4, 16 - mov r0, sp - movs r1, 0 - movs r2, 0x8 - bl memset - cmp r6, 0x3 - bls _08198126 - movs r1, 0 - mov r0, sp - strb r1, [r0] - b _0819812A -_08198126: - mov r0, sp - strb r6, [r0] -_0819812A: - mov r1, sp - mov r0, r8 - strb r0, [r1, 0x2] - movs r0, 0x2 - strb r0, [r1, 0x4] - movs r0, 0x1E - subs r0, r7 - strb r0, [r1, 0x1] - strb r7, [r1, 0x3] - strb r5, [r1, 0x5] - strh r4, [r1, 0x6] - ldr r4, =gUnknown_0203CDA0 - mov r0, sp - bl AddWindow - strb r0, [r4] - cmp r5, 0xF - bls _08198158 - movs r5, 0xF0 - b _0819815C - .pool -_08198158: - lsls r0, r5, 28 - lsrs r5, r0, 24 -_0819815C: - ldr r0, =gUnknown_0860F0B0 - adds r1, r5, 0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0203CDA0 - ldrb r0, [r0] - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81980F0 - - thumb_func_start sub_8198180 -sub_8198180: @ 8198180 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r6, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldr r5, =gUnknown_0203CDA0 - ldrb r0, [r5] - cmp r0, 0xFF - beq _081981EE - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0xFF - bl FillWindowPixelBuffer - movs r0, 0 - adds r1, r6, 0 - movs r2, 0 - bl GetStringWidth - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r5] - movs r1, 0x1 - bl GetWindowAttribute - movs r2, 0xEC - subs r2, r7 - lsls r0, 3 - subs r2, r0 - subs r2, r4 - lsls r2, 24 - lsrs r2, 24 - ldrb r0, [r5] - ldr r1, =gUnknown_0860F0D0 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r6, [sp, 0x8] - movs r3, 0x1 - bl box_print - mov r0, r8 - cmp r0, 0 - beq _081981EE - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram -_081981EE: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198180 - - thumb_func_start sub_8198204 -sub_8198204: @ 8198204 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r10, r0 - adds r6, r1, 0 - ldr r0, [sp, 0x38] - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r4, 0 - ldr r0, =gUnknown_0203CDA0 - ldrb r1, [r0] - adds r7, r0, 0 - cmp r1, 0xFF - beq _081982C8 - cmp r2, 0 - beq _08198244 - add r0, sp, 0x14 - strb r4, [r0] - adds r1, r0, 0 - b _0819824A - .pool -_08198244: - add r1, sp, 0x14 - movs r0, 0xF - strb r0, [r1] -_0819824A: - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x2 - strb r0, [r1, 0x2] - adds r5, r7, 0 - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0xFF - bl FillWindowPixelBuffer - cmp r6, 0 - beq _0819829E - movs r0, 0 - adds r1, r6, 0 - movs r2, 0 - bl GetStringWidth - lsls r0, 16 - lsrs r4, r0, 16 - ldrb r0, [r5] - movs r1, 0x1 - bl GetWindowAttribute - movs r2, 0xEC - mov r1, r8 - subs r2, r1 - lsls r0, 3 - subs r2, r0 - subs r2, r4 - lsls r2, 24 - lsrs r2, 24 - ldrb r0, [r5] - add r1, sp, 0x14 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r6, [sp, 0x8] - movs r3, 0x1 - bl box_print -_0819829E: - ldrb r0, [r7] - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - add r2, sp, 0x14 - str r2, [sp, 0x8] - str r1, [sp, 0xC] - mov r1, r10 - str r1, [sp, 0x10] - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - mov r2, r9 - cmp r2, 0 - beq _081982C8 - ldrb r0, [r7] - movs r1, 0x3 - bl CopyWindowToVram -_081982C8: - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198204 - - thumb_func_start sub_81982D8 -sub_81982D8: @ 81982D8 - push {lr} - ldr r1, =gUnknown_0203CDA0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081982E8 - movs r1, 0x3 - bl CopyWindowToVram -_081982E8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81982D8 - - thumb_func_start sub_81982F0 -sub_81982F0: @ 81982F0 - push {r4,lr} - ldr r4, =gUnknown_0203CDA0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _08198308 - movs r1, 0xFF - bl FillWindowPixelBuffer - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram -_08198308: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81982F0 - - thumb_func_start sub_8198314 -sub_8198314: @ 8198314 - push {r4,lr} - ldr r4, =gUnknown_0203CDA0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _0819833C - movs r1, 0 - bl FillWindowPixelBuffer - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_0819833C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198314 - - thumb_func_start sub_8198348 -sub_8198348: @ 8198348 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, [sp, 0x18] - mov r8, r4 - ldr r4, [sp, 0x1C] - ldr r5, [sp, 0x20] - ldr r6, [sp, 0x24] - mov r12, r6 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r7, r5, 24 - ldr r5, =gUnknown_0203CD90 - movs r6, 0 - strb r2, [r5] - strb r3, [r5, 0x1] - strb r6, [r5, 0x3] - subs r4, 0x1 - strb r4, [r5, 0x4] - strb r0, [r5, 0x5] - strb r1, [r5, 0x6] - mov r0, r8 - strb r0, [r5, 0x8] - mov r4, r12 - strb r4, [r5, 0xB] - cmp r7, 0 - blt _08198388 - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r7, r0 - ble _08198390 -_08198388: - strb r6, [r5, 0x2] - b _08198392 - .pool -_08198390: - strb r7, [r5, 0x2] -_08198392: - movs r0, 0 - bl MoveMenuCursor - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8198348 - - thumb_func_start sub_81983AC -sub_81983AC: @ 81983AC - push {r4-r6,lr} - sub sp, 0x10 - ldr r4, [sp, 0x20] - ldr r5, [sp, 0x24] - ldr r6, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r4, 0 - str r4, [sp, 0xC] - bl sub_8198348 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x10 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81983AC - - thumb_func_start sub_81983EC -sub_81983EC: @ 81983EC - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x14 - mov r8, r0 - adds r6, r1, 0 - ldr r4, [sp, 0x28] - ldr r5, [sp, 0x2C] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r6, 24 - lsrs r6, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - movs r1, 0x1 - str r2, [sp, 0xC] - str r3, [sp, 0x10] - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - mov r0, r8 - adds r1, r6, 0 - ldr r2, [sp, 0xC] - ldr r3, [sp, 0x10] - bl sub_81983AC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81983EC - - thumb_func_start RedrawMenuCursor -@ void RedrawMenuCursor(s8 oldPos, s8 newPos) -RedrawMenuCursor: @ 8198448 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0xC - adds r6, r0, 0 - mov r8, r1 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r5, =gUnknown_0203CD90 - ldrb r0, [r5, 0x6] - movs r1, 0 - bl GetMenuCursorDimensionByFont - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5, 0x6] - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r5, 0x5] - mov r9, r1 - ldrb r2, [r5] - ldrb r1, [r5, 0x8] - adds r3, r1, 0 - muls r3, r6 - ldrb r6, [r5, 0x1] - adds r3, r6 - lsls r3, 16 - lsrs r3, 16 - str r4, [sp] - str r0, [sp, 0x4] - mov r0, r9 - movs r1, 0x11 - bl FillWindowPixelRect - ldrb r0, [r5, 0x5] - ldrb r1, [r5, 0x6] - ldr r2, =gUnknown_085EE498 - ldrb r3, [r5] - ldrb r4, [r5, 0x8] - mov r6, r8 - muls r6, r4 - adds r4, r6, 0 - ldrb r5, [r5, 0x1] - adds r4, r5 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - bl Print - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end RedrawMenuCursor - - thumb_func_start MoveMenuCursor -@ s8 MoveMenuCursor(s8 cursorDelta) -MoveMenuCursor: @ 81984D8 - push {r4,r5,lr} - ldr r1, =gUnknown_0203CD90 - ldrb r5, [r1, 0x2] - movs r2, 0x2 - ldrsb r2, [r1, r2] - lsls r0, 24 - asrs r3, r0, 24 - adds r2, r3 - movs r0, 0x3 - ldrsb r0, [r1, r0] - adds r4, r1, 0 - cmp r2, r0 - bge _081984FC - ldrb r0, [r4, 0x4] - b _0819850A - .pool -_081984FC: - movs r0, 0x4 - ldrsb r0, [r4, r0] - cmp r2, r0 - ble _08198508 - ldrb r0, [r4, 0x3] - b _0819850A -_08198508: - adds r0, r3, r5 -_0819850A: - strb r0, [r4, 0x2] - ldrb r1, [r4, 0x2] - adds r0, r5, 0 - bl RedrawMenuCursor - ldrb r0, [r4, 0x2] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end MoveMenuCursor - - thumb_func_start MoveMenuCursorNoWrapAround -@ s8 MoveMenuCursorNoWrapAround(s8 cursorDelta) -MoveMenuCursorNoWrapAround: @ 819851C - push {r4,r5,lr} - ldr r1, =gUnknown_0203CD90 - ldrb r5, [r1, 0x2] - movs r2, 0x2 - ldrsb r2, [r1, r2] - lsls r0, 24 - asrs r3, r0, 24 - adds r2, r3 - movs r0, 0x3 - ldrsb r0, [r1, r0] - adds r4, r1, 0 - cmp r2, r0 - bge _08198540 - ldrb r0, [r4, 0x3] - b _0819854E - .pool -_08198540: - movs r0, 0x4 - ldrsb r0, [r4, r0] - cmp r2, r0 - ble _0819854C - ldrb r0, [r4, 0x4] - b _0819854E -_0819854C: - adds r0, r3, r5 -_0819854E: - strb r0, [r4, 0x2] - ldrb r1, [r4, 0x2] - adds r0, r5, 0 - bl RedrawMenuCursor - ldrb r0, [r4, 0x2] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end MoveMenuCursorNoWrapAround - - thumb_func_start GetMenuCursorPos -GetMenuCursorPos: @ 8198560 - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - bx lr - .pool - thumb_func_end GetMenuCursorPos - - thumb_func_start ProcessMenuInput -ProcessMenuInput: @ 819856C - push {r4,lr} - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08198598 - ldr r4, =gUnknown_0203CD90 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _08198588 - movs r0, 0x5 - bl PlaySE -_08198588: - movs r0, 0x2 - ldrsb r0, [r4, r0] - b _081985D2 - .pool -_08198598: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081985A6 - movs r0, 0x1 - negs r0, r0 - b _081985D2 -_081985A6: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081985BA - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _081985CA -_081985BA: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081985CE - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_081985CA: - bl MoveMenuCursor -_081985CE: - movs r0, 0x2 - negs r0, r0 -_081985D2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end ProcessMenuInput - - thumb_func_start ProcessMenuInputNoWrapAround -@ int ProcessMenuInputNoWrapAround() -ProcessMenuInputNoWrapAround: @ 81985D8 - push {r4-r6,lr} - ldr r4, =gUnknown_0203CD90 - ldrb r5, [r4, 0x2] - adds r6, r5, 0 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08198608 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _081985F8 - movs r0, 0x5 - bl PlaySE -_081985F8: - movs r0, 0x2 - ldrsb r0, [r4, r0] - b _08198650 - .pool -_08198608: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08198616 - movs r0, 0x1 - negs r0, r0 - b _08198650 -_08198616: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08198630 - movs r0, 0x1 - negs r0, r0 - bl MoveMenuCursorNoWrapAround - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _0819864C - b _08198646 -_08198630: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819864C - movs r0, 0x1 - bl MoveMenuCursorNoWrapAround - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _0819864C -_08198646: - movs r0, 0x5 - bl PlaySE -_0819864C: - movs r0, 0x2 - negs r0, r0 -_08198650: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end ProcessMenuInputNoWrapAround - - thumb_func_start ProcessMenuInput_other -ProcessMenuInput_other: @ 8198658 - push {r4,lr} - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08198684 - ldr r4, =gUnknown_0203CD90 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _08198674 - movs r0, 0x5 - bl PlaySE -_08198674: - movs r0, 0x2 - ldrsb r0, [r4, r0] - b _081986BC - .pool -_08198684: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08198692 - movs r0, 0x1 - negs r0, r0 - b _081986BC -_08198692: - ldrh r0, [r2, 0x30] - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0x40 - bne _081986A8 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _081986B4 -_081986A8: - cmp r1, 0x80 - bne _081986B8 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_081986B4: - bl MoveMenuCursor -_081986B8: - movs r0, 0x2 - negs r0, r0 -_081986BC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end ProcessMenuInput_other - - thumb_func_start ProcessMenuInputNoWrapAround_other -ProcessMenuInputNoWrapAround_other: @ 81986C4 - push {r4-r6,lr} - ldr r4, =gUnknown_0203CD90 - ldrb r5, [r4, 0x2] - adds r6, r5, 0 - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081986F4 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _081986E4 - movs r0, 0x5 - bl PlaySE -_081986E4: - movs r0, 0x2 - ldrsb r0, [r4, r0] - b _0819873A - .pool -_081986F4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08198702 - movs r0, 0x1 - negs r0, r0 - b _0819873A -_08198702: - ldrh r0, [r2, 0x30] - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0x40 - bne _0819871E - movs r0, 0x1 - negs r0, r0 - bl MoveMenuCursorNoWrapAround - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _08198736 - b _08198730 -_0819871E: - cmp r1, 0x80 - bne _08198736 - movs r0, 0x1 - bl MoveMenuCursorNoWrapAround - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _08198736 -_08198730: - movs r0, 0x5 - bl PlaySE -_08198736: - movs r0, 0x2 - negs r0, r0 -_0819873A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end ProcessMenuInputNoWrapAround_other - - thumb_func_start PrintTextArray -PrintTextArray: @ 8198740 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r4, [sp, 0x2C] - ldr r5, [sp, 0x30] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r4, 24 - lsrs r7, r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r4, 0 - cmp r4, r5 - bcs _081987A4 -_08198774: - lsls r0, r4, 3 - ldr r1, [sp, 0x34] - adds r0, r1 - ldr r2, [r0] - adds r0, r7, 0 - muls r0, r4 - add r0, r8 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r6, 0 - mov r1, r10 - mov r3, r9 - bl Print - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08198774 -_081987A4: - adds r0, r6, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end PrintTextArray - - thumb_func_start sub_81987BC -sub_81987BC: @ 81987BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, [sp, 0x40] - ldr r5, [sp, 0x44] - ldr r6, [sp, 0x4C] - ldr r7, [sp, 0x50] - mov r8, r7 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x18] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x1C] - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - mov r9, r6 - mov r0, r8 - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - cmp r4, r5 - bcs _0819883C -_08198804: - lsls r0, r4, 3 - ldr r1, [sp, 0x48] - adds r0, r1 - ldr r2, [r0] - mov r0, r10 - muls r0, r4 - ldr r1, [sp, 0x1C] - adds r0, r1, r0 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - str r6, [sp, 0x10] - adds r0, r7, 0 - ldr r1, [sp, 0x14] - ldr r3, [sp, 0x18] - bl sub_8199F74 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08198804 -_0819883C: - adds r0, r7, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81987BC - - thumb_func_start sub_8198854 -sub_8198854: @ 8198854 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - mov r8, r0 - adds r6, r1, 0 - adds r4, r2, 0 - adds r5, r3, 0 - ldr r7, [sp, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - movs r1, 0 - bl GetFontAttribute - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r7, [sp, 0x8] - mov r0, r8 - adds r1, r6, 0 - movs r3, 0x1 - bl PrintTextArray - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198854 - - thumb_func_start AddItemMenuActionTextPrinters -AddItemMenuActionTextPrinters: @ 81988A4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r6, r1, 0 - mov r8, r2 - ldr r1, [sp, 0x38] - mov r9, r1 - ldr r1, [sp, 0x3C] - ldr r2, [sp, 0x40] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - lsls r6, 24 - lsrs r6, 24 - mov r4, r8 - lsls r4, 24 - lsrs r4, 24 - mov r8, r4 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r7, r2, 24 - mov r0, sp - ldrb r1, [r0, 0x10] - strb r1, [r0, 0x4] - strb r6, [r0, 0x5] - adds r0, r6, 0 - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - adds r0, r6, 0 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - adds r0, r6, 0 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - adds r0, r6, 0 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - mov r0, sp - mov r2, r9 - strb r2, [r0, 0xA] - adds r0, r6, 0 - movs r1, 0x3 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xB] - mov r0, sp - mov r4, r8 - strb r4, [r0, 0x6] - strb r4, [r0, 0x8] - movs r4, 0 - cmp r4, r7 - bcs _0819899E - mov r5, sp -_0819896E: - ldr r1, [sp, 0x48] - adds r0, r1, r4 - ldrb r0, [r0] - lsls r0, 3 - ldr r2, [sp, 0x44] - adds r0, r2 - ldr r0, [r0] - str r0, [sp] - mov r0, r10 - muls r0, r4 - ldr r1, [sp, 0x14] - adds r0, r1, r0 - strb r0, [r5, 0x7] - strb r0, [r5, 0x9] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r7 - bcc _0819896E -_0819899E: - ldr r0, [sp, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end AddItemMenuActionTextPrinters - - thumb_func_start sub_81989B8 -sub_81989B8: @ 81989B8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - mov r9, r0 - adds r4, r1, 0 - adds r6, r2, 0 - mov r8, r3 - ldr r7, [sp, 0x30] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0 - bl GetFontAttribute - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r4, 0 - movs r1, 0x2 - bl GetFontAttribute - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - str r6, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - str r7, [sp, 0xC] - ldr r0, [sp, 0x34] - str r0, [sp, 0x10] - mov r0, r9 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl AddItemMenuActionTextPrinters - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81989B8 - - thumb_func_start rbox_template_set -@ void rbox_template_set(WindowTemplate *template, char bg_id, char x, char y, char w, char h, char a7, s16 a8) -rbox_template_set: @ 8198A24 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, [sp, 0x18] - ldr r5, [sp, 0x1C] - ldr r6, [sp, 0x20] - ldr r7, [sp, 0x24] - mov r8, r7 - strb r1, [r0] - strb r2, [r0, 0x1] - strb r3, [r0, 0x2] - strb r4, [r0, 0x3] - strb r5, [r0, 0x4] - strb r6, [r0, 0x5] - mov r1, r8 - strh r1, [r0, 0x6] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end rbox_template_set - - thumb_func_start sub_8198A50 -sub_8198A50: @ 8198A50 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x18 - mov r8, r0 - ldr r0, [sp, 0x2C] - ldr r4, [sp, 0x30] - ldr r5, [sp, 0x34] - ldr r6, [sp, 0x38] - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 16 - lsrs r6, 16 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - str r6, [sp, 0xC] - add r0, sp, 0x10 - bl rbox_template_set - ldr r0, [sp, 0x10] - ldr r1, [sp, 0x14] - mov r2, r8 - str r0, [r2] - str r1, [r2, 0x4] - mov r0, r8 - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r2} - bx r2 - thumb_func_end sub_8198A50 - - thumb_func_start sub_8198AA4 -sub_8198AA4: @ 8198AA4 - push {r4-r6,lr} - sub sp, 0x18 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r0, [sp, 0x28] - ldr r1, [sp, 0x2C] - ldr r2, [sp, 0x30] - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 16 - lsrs r2, 16 - str r3, [sp] - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r2, [sp, 0xC] - add r0, sp, 0x10 - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl rbox_template_set - add r0, sp, 0x10 - bl AddWindow - lsls r0, 16 - lsrs r0, 16 - add sp, 0x18 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8198AA4 - - thumb_func_start sub_8198AF8 -sub_8198AF8: @ 8198AF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r6, r1, 0 - mov r8, r2 - mov r9, r3 - ldr r4, [sp, 0x3C] - ldr r5, [sp, 0x40] - ldr r1, [sp, 0x44] - mov r10, r1 - lsls r6, 24 - lsrs r6, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - mov r1, r10 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - ldr r7, =gUnknown_0203CD9F - bl AddWindow - strb r0, [r7] - ldrb r0, [r7] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r5, 0 - bl SetWindowBorderStyle - ldr r0, =gUnknown_085EE491 - str r0, [sp, 0xC] - add r1, sp, 0xC - ldrb r0, [r7] - strb r0, [r1, 0x4] - adds r0, r1, 0 - strb r6, [r0, 0x5] - adds r0, r6, 0 - movs r1, 0 - bl GetFontAttribute - add r1, sp, 0xC - add r0, r8 - strb r0, [r1, 0x6] - adds r0, r1, 0 - mov r1, r9 - strb r1, [r0, 0x7] - adds r1, r0, 0 - ldrb r0, [r0, 0x6] - strb r0, [r1, 0x8] - adds r0, r1, 0 - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - adds r0, r6, 0 - movs r1, 0x5 - bl GetFontAttribute - add r3, sp, 0xC - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - adds r0, r6, 0 - movs r1, 0x6 - bl GetFontAttribute - add r3, sp, 0xC - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - adds r0, r6, 0 - movs r1, 0x7 - bl GetFontAttribute - add r3, sp, 0xC - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - adds r0, r6, 0 - movs r1, 0x4 - bl GetFontAttribute - add r1, sp, 0xC - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - adds r0, r6, 0 - movs r1, 0x2 - bl GetFontAttribute - add r1, sp, 0xC - strb r0, [r1, 0xA] - adds r0, r6, 0 - movs r1, 0x3 - bl GetFontAttribute - add r1, sp, 0xC - strb r0, [r1, 0xB] - adds r0, r1, 0 - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r6, 0 - movs r1, 0x1 - bl GetFontAttribute - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r7] - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r1, 0 - adds r1, r6, 0 - mov r2, r8 - mov r3, r9 - bl sub_81983AC - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198AF8 - - thumb_func_start sub_8198C34 -sub_8198C34: @ 8198C34 - push {lr} - sub sp, 0xC - lsls r1, 24 - lsrs r1, 24 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 24 - lsrs r3, 24 - str r2, [sp] - str r3, [sp, 0x4] - movs r2, 0 - str r2, [sp, 0x8] - movs r3, 0x1 - bl sub_8198AF8 - add sp, 0xC - pop {r0} - bx r0 - thumb_func_end sub_8198C34 - - thumb_func_start sub_8198C58 -sub_8198C58: @ 8198C58 - push {r4,lr} - bl ProcessMenuInputNoWrapAround - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _08198C6E - bl sub_8198C78 -_08198C6E: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8198C58 - - thumb_func_start sub_8198C78 -sub_8198C78: @ 8198C78 - push {r4,lr} - ldr r4, =gUnknown_0203CD9F - ldrb r0, [r4] - movs r1, 0x1 - bl sub_8198070 - ldrb r0, [r4] - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198C78 - - thumb_func_start sub_8198C94 -sub_8198C94: @ 8198C94 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, [sp, 0x40] - ldr r5, [sp, 0x44] - ldr r6, [sp, 0x48] - ldr r7, [sp, 0x4C] - mov r8, r7 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0xC] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x18] - lsls r5, 24 - lsrs r5, 24 - str r5, [sp, 0x1C] - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r5, 0 - cmp r5, r9 - bcs _08198D3A -_08198CE0: - movs r4, 0 - adds r1, r5, 0x1 - mov r8, r1 - cmp r4, r6 - bcs _08198D30 - ldr r7, [sp, 0x1C] - adds r0, r7, 0 - muls r0, r5 - ldr r1, [sp, 0x14] - adds r0, r1, r0 - lsls r0, 24 - lsrs r7, r0, 24 -_08198CF8: - adds r0, r5, 0 - muls r0, r6 - adds r0, r4 - lsls r0, 3 - ldr r1, [sp, 0x50] - adds r0, r1 - ldr r2, [r0] - ldr r0, [sp, 0x18] - adds r3, r0, 0 - muls r3, r4 - ldr r1, [sp, 0x10] - adds r3, r1, r3 - lsls r3, 24 - lsrs r3, 24 - str r7, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r10 - ldr r1, [sp, 0xC] - bl Print - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _08198CF8 -_08198D30: - mov r7, r8 - lsls r0, r7, 24 - lsrs r5, r0, 24 - cmp r5, r9 - bcc _08198CE0 -_08198D3A: - mov r0, r10 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198C94 - - thumb_func_start sub_8198D54 -sub_8198D54: @ 8198D54 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - mov r9, r0 - mov r8, r1 - adds r4, r2, 0 - adds r5, r3, 0 - ldr r6, [sp, 0x34] - ldr r3, [sp, 0x38] - ldr r7, [sp, 0x3C] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0 - str r3, [sp, 0x14] - bl GetFontAttribute - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - ldr r3, [sp, 0x14] - str r3, [sp, 0xC] - str r7, [sp, 0x10] - mov r0, r9 - mov r1, r8 - movs r3, 0 - bl sub_8198C94 - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198D54 - - thumb_func_start sub_8198DBC -sub_8198DBC: @ 8198DBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, [sp, 0x40] - ldr r5, [sp, 0x44] - ldr r6, [sp, 0x48] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x18] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x1C] - lsls r5, 24 - lsrs r5, 24 - mov r8, r5 - lsls r6, 24 - lsrs r6, 24 - mov r10, r6 - mov r0, sp - ldrb r1, [r0, 0x10] - strb r1, [r0, 0x4] - strb r7, [r0, 0x5] - adds r0, r7, 0 - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - adds r0, r7, 0 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - adds r0, r7, 0 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - adds r0, r7, 0 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - adds r0, r7, 0 - movs r1, 0x2 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xA] - adds r0, r7, 0 - movs r1, 0x3 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xB] - movs r6, 0 - cmp r6, r10 - bcs _08198EDE -_08198E7A: - movs r5, 0 - adds r2, r6, 0x1 - mov r9, r2 - cmp r5, r8 - bcs _08198ED4 - mov r4, sp -_08198E86: - mov r0, r8 - muls r0, r6 - adds r0, r5 - ldr r1, [sp, 0x50] - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 3 - ldr r2, [sp, 0x4C] - adds r0, r2 - ldr r0, [r0] - str r0, [sp] - ldr r1, [sp, 0x1C] - adds r0, r1, 0 - muls r0, r5 - ldr r2, [sp, 0x14] - adds r0, r2, r0 - strb r0, [r4, 0x6] - adds r0, r7, 0 - movs r1, 0x1 - bl GetFontAttribute - adds r1, r6, 0 - muls r1, r0 - ldr r0, [sp, 0x18] - adds r1, r0, r1 - strb r1, [r4, 0x7] - ldrb r0, [r4, 0x6] - strb r0, [r4, 0x8] - strb r1, [r4, 0x9] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r8 - bcc _08198E86 -_08198ED4: - mov r1, r9 - lsls r0, r1, 24 - lsrs r6, r0, 24 - cmp r6, r10 - bcc _08198E7A -_08198EDE: - ldr r0, [sp, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198DBC - - thumb_func_start sub_8198EF8 -sub_8198EF8: @ 8198EF8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - mov r8, r0 - adds r3, r1, 0 - adds r4, r2, 0 - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - ldr r7, [sp, 0x38] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - adds r0, r3, 0 - movs r1, 0 - str r3, [sp, 0x14] - bl GetFontAttribute - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - str r7, [sp, 0xC] - ldr r0, [sp, 0x3C] - str r0, [sp, 0x10] - mov r0, r8 - ldr r3, [sp, 0x14] - adds r1, r3, 0 - movs r3, 0 - bl sub_8198DBC - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198EF8 - - thumb_func_start sub_8198F58 -sub_8198F58: @ 8198F58 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, [sp, 0x20] - mov r12, r4 - ldr r4, [sp, 0x24] - mov r8, r4 - ldr r4, [sp, 0x28] - mov r9, r4 - ldr r4, [sp, 0x2C] - mov r10, r4 - ldr r4, [sp, 0x30] - ldr r5, [sp, 0x34] - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r7, r5, 24 - ldr r5, =gUnknown_0203CD90 - movs r6, 0 - strb r2, [r5] - strb r3, [r5, 0x1] - strb r6, [r5, 0x3] - subs r4, 0x1 - strb r4, [r5, 0x4] - strb r0, [r5, 0x5] - strb r1, [r5, 0x6] - mov r0, r12 - strb r0, [r5, 0x7] - mov r4, r8 - strb r4, [r5, 0x8] - mov r0, r9 - strb r0, [r5, 0x9] - mov r4, r10 - strb r4, [r5, 0xA] - cmp r7, 0 - blt _08198FAC - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r7, r0 - ble _08198FB4 -_08198FAC: - strb r6, [r5, 0x2] - b _08198FB6 - .pool -_08198FB4: - strb r7, [r5, 0x2] -_08198FB6: - movs r0, 0 - movs r1, 0 - bl sub_8199134 - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8198F58 - - thumb_func_start sub_8198FD4 -sub_8198FD4: @ 8198FD4 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x20 - mov r9, r0 - mov r8, r1 - mov r10, r2 - ldr r6, [sp, 0x3C] - ldr r4, [sp, 0x40] - ldr r5, [sp, 0x44] - ldr r2, [sp, 0x48] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r2, 24 - lsrs r2, 24 - mov r0, r8 - movs r1, 0x1 - str r2, [sp, 0x18] - str r3, [sp, 0x1C] - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - muls r1, r5 - lsls r1, 24 - lsrs r1, 24 - str r6, [sp] - str r0, [sp, 0x4] - str r4, [sp, 0x8] - str r5, [sp, 0xC] - str r1, [sp, 0x10] - ldr r2, [sp, 0x18] - str r2, [sp, 0x14] - mov r0, r9 - mov r1, r8 - mov r2, r10 - ldr r3, [sp, 0x1C] - bl sub_8198F58 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8198FD4 - - thumb_func_start sub_8199060 -sub_8199060: @ 8199060 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r8, r0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, r1, 24 - lsrs r7, r0, 24 - ldr r5, =gUnknown_0203CD90 - ldrb r0, [r5, 0x6] - movs r1, 0 - bl GetMenuCursorDimensionByFont - mov r9, r0 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - ldrb r0, [r5, 0x6] - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldrb r0, [r5, 0x9] - mov r10, r0 - mov r0, r8 - mov r1, r10 - bl __umodsi3 - ldrb r1, [r5, 0x7] - adds r4, r1, 0 - muls r4, r0 - ldrb r1, [r5] - adds r4, r1 - lsls r4, 24 - lsrs r4, 24 - mov r0, r8 - mov r1, r10 - bl __udivsi3 - ldrb r1, [r5, 0x8] - adds r3, r1, 0 - muls r3, r0 - ldrb r0, [r5, 0x1] - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r5, 0x5] - mov r1, r9 - str r1, [sp] - str r6, [sp, 0x4] - movs r1, 0x11 - adds r2, r4, 0 - bl FillWindowPixelRect - ldrb r6, [r5, 0x9] - adds r0, r7, 0 - adds r1, r6, 0 - bl __umodsi3 - ldrb r1, [r5, 0x7] - adds r4, r1, 0 - muls r4, r0 - ldrb r0, [r5] - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r7, 0 - adds r1, r6, 0 - bl __udivsi3 - ldrb r1, [r5, 0x8] - adds r3, r1, 0 - muls r3, r0 - ldrb r1, [r5, 0x1] - adds r3, r1 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r5, 0x5] - ldrb r1, [r5, 0x6] - ldr r2, =gUnknown_085EE498 - str r3, [sp] - movs r3, 0 - str r3, [sp, 0x4] - str r3, [sp, 0x8] - adds r3, r4, 0 - bl Print - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8199060 - - thumb_func_start sub_8199134 -sub_8199134: @ 8199134 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - ldr r1, =gUnknown_0203CD90 - ldrb r2, [r1, 0x2] - mov r8, r2 - lsls r0, 24 - asrs r6, r0, 24 - adds r5, r1, 0 - cmp r6, 0 - beq _0819918A - movs r7, 0x2 - ldrsb r7, [r5, r7] - ldrb r4, [r5, 0x9] - adds r0, r7, 0 - adds r1, r4, 0 - bl __modsi3 - adds r0, r6 - cmp r0, 0 - bge _08199174 - adds r0, r4, 0 - adds r0, 0xFF - add r0, r8 - b _08199188 - .pool -_08199174: - cmp r0, r4 - blt _08199184 - adds r0, r7, 0 - adds r1, r4, 0 - bl __divsi3 - muls r0, r4 - b _08199188 -_08199184: - mov r1, r8 - adds r0, r6, r1 -_08199188: - strb r0, [r5, 0x2] -_0819918A: - mov r2, r9 - lsls r0, r2, 24 - asrs r6, r0, 24 - cmp r6, 0 - beq _081991CE - movs r0, 0x2 - ldrsb r0, [r5, r0] - ldrb r4, [r5, 0x9] - adds r1, r4, 0 - bl __divsi3 - adds r1, r0, r6 - cmp r1, 0 - bge _081991B2 - ldrb r0, [r5, 0xA] - subs r0, 0x1 - muls r0, r4 - ldrb r1, [r5, 0x2] - adds r0, r1 - b _081991CC -_081991B2: - ldrb r0, [r5, 0xA] - cmp r1, r0 - blt _081991C4 - subs r0, 0x1 - adds r1, r4, 0 - muls r1, r0 - ldrb r0, [r5, 0x2] - subs r0, r1 - b _081991CC -_081991C4: - adds r0, r4, 0 - muls r0, r6 - ldrb r2, [r5, 0x2] - adds r0, r2 -_081991CC: - strb r0, [r5, 0x2] -_081991CE: - movs r1, 0x2 - ldrsb r1, [r5, r1] - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r1, r0 - bgt _081991E4 - ldrb r1, [r5, 0x2] - mov r0, r8 - bl sub_8199060 - b _081991E8 -_081991E4: - mov r0, r8 - strb r0, [r5, 0x2] -_081991E8: - ldrb r0, [r5, 0x2] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8199134 - - thumb_func_start sub_81991F8 -sub_81991F8: @ 81991F8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - ldr r1, =gUnknown_0203CD90 - ldrb r7, [r1, 0x2] - lsls r0, 24 - asrs r4, r0, 24 - adds r5, r1, 0 - cmp r4, 0 - beq _0819922C - movs r0, 0x2 - ldrsb r0, [r5, r0] - ldrb r6, [r5, 0x9] - adds r1, r6, 0 - bl __modsi3 - adds r0, r4 - cmp r0, 0 - blt _0819922C - cmp r0, r6 - bge _0819922C - adds r0, r4, r7 - strb r0, [r5, 0x2] -_0819922C: - mov r1, r8 - lsls r0, r1, 24 - asrs r4, r0, 24 - cmp r4, 0 - beq _08199258 - movs r0, 0x2 - ldrsb r0, [r5, r0] - ldrb r6, [r5, 0x9] - adds r1, r6, 0 - bl __divsi3 - adds r0, r4 - cmp r0, 0 - blt _08199258 - ldrb r1, [r5, 0xA] - cmp r0, r1 - bge _08199258 - adds r0, r6, 0 - muls r0, r4 - ldrb r1, [r5, 0x2] - adds r0, r1 - strb r0, [r5, 0x2] -_08199258: - movs r1, 0x2 - ldrsb r1, [r5, r1] - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r1, r0 - bgt _08199274 - ldrb r1, [r5, 0x2] - adds r0, r7, 0 - bl sub_8199060 - b _08199276 - .pool -_08199274: - strb r7, [r5, 0x2] -_08199276: - ldrb r0, [r5, 0x2] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81991F8 - - thumb_func_start sub_8199284 -sub_8199284: @ 8199284 - push {r4,lr} - ldr r4, =gMain - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081992AC - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - b _0819932C - .pool -_081992AC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081992BA - movs r0, 0x1 - negs r0, r0 - b _0819932C -_081992BA: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081992D0 - movs r0, 0x5 - bl PlaySE - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - b _08199324 -_081992D0: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081992E4 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - movs r1, 0x1 - b _08199324 -_081992E4: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081992F8 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08199304 -_081992F8: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _08199322 -_08199304: - ldrh r1, [r4, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0819931A - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08199328 -_0819931A: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_08199322: - movs r1, 0 -_08199324: - bl sub_8199134 -_08199328: - movs r0, 0x2 - negs r0, r0 -_0819932C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8199284 - - thumb_func_start sub_8199334 -sub_8199334: @ 8199334 - push {r4-r6,lr} - ldr r5, =gUnknown_0203CD90 - ldrb r4, [r5, 0x2] - ldr r6, =gMain - ldrh r1, [r6, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0819935C - movs r0, 0x5 - bl PlaySE - movs r0, 0x2 - ldrsb r0, [r5, r0] - b _081993D2 - .pool -_0819935C: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819936A - movs r0, 0x1 - negs r0, r0 - b _081993D2 -_0819936A: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819937A - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - b _081993BC -_0819937A: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08199388 - movs r0, 0 - movs r1, 0x1 - b _081993BC -_08199388: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0819939C - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081993A2 -_0819939C: - movs r0, 0x1 - negs r0, r0 - b _081993BA -_081993A2: - ldrh r1, [r6, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081993B8 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081993CE -_081993B8: - movs r0, 0x1 -_081993BA: - movs r1, 0 -_081993BC: - bl sub_81991F8 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - beq _081993CE - movs r0, 0x5 - bl PlaySE -_081993CE: - movs r0, 0x2 - negs r0, r0 -_081993D2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8199334 - - thumb_func_start sub_81993D8 -sub_81993D8: @ 81993D8 - push {r4,r5,lr} - ldr r4, =gMain - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08199400 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - b _0819947C - .pool -_08199400: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819940E - movs r0, 0x1 - negs r0, r0 - b _0819947C -_0819940E: - ldrh r0, [r4, 0x30] - movs r5, 0xF0 - adds r1, r5, 0 - ands r1, r0 - cmp r1, 0x40 - bne _08199428 - movs r0, 0x5 - bl PlaySE - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - b _08199474 -_08199428: - cmp r1, 0x80 - bne _08199438 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - movs r1, 0x1 - b _08199474 -_08199438: - cmp r1, 0x20 - beq _08199448 - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08199454 -_08199448: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _08199472 -_08199454: - ldrh r1, [r4, 0x30] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0x10 - beq _0819946A - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08199478 -_0819946A: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_08199472: - movs r1, 0 -_08199474: - bl sub_8199134 -_08199478: - movs r0, 0x2 - negs r0, r0 -_0819947C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81993D8 - - thumb_func_start sub_8199484 -sub_8199484: @ 8199484 - push {r4-r6,lr} - ldr r6, =gUnknown_0203CD90 - ldrb r4, [r6, 0x2] - ldr r5, =gMain - ldrh r1, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081994AC - movs r0, 0x5 - bl PlaySE - movs r0, 0x2 - ldrsb r0, [r6, r0] - b _0819951E - .pool -_081994AC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081994BA - movs r0, 0x1 - negs r0, r0 - b _0819951E -_081994BA: - ldrh r0, [r5, 0x30] - movs r6, 0xF0 - adds r1, r6, 0 - ands r1, r0 - cmp r1, 0x40 - bne _081994CE - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - b _08199508 -_081994CE: - cmp r1, 0x80 - bne _081994D8 - movs r0, 0 - movs r1, 0x1 - b _08199508 -_081994D8: - cmp r1, 0x20 - beq _081994E8 - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081994EE -_081994E8: - movs r0, 0x1 - negs r0, r0 - b _08199506 -_081994EE: - ldrh r1, [r5, 0x30] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0x10 - beq _08199504 - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0819951A -_08199504: - movs r0, 0x1 -_08199506: - movs r1, 0 -_08199508: - bl sub_81991F8 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - beq _0819951A - movs r0, 0x5 - bl PlaySE -_0819951A: - movs r0, 0x2 - negs r0, r0 -_0819951E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8199484 - - thumb_func_start InitMenuInUpperLeftCorner -@ int InitMenuInUpperLeftCorner(s8 windowId, s8 numItems, u8 initialCursorPos, bool doNotPlaySoundWhenAPressed) -InitMenuInUpperLeftCorner: @ 8199524 - push {r4-r6,lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - ldr r4, =gUnknown_0203CD90 - movs r6, 0 - strb r6, [r4] - movs r2, 0x1 - strb r2, [r4, 0x1] - strb r6, [r4, 0x3] - subs r1, 0x1 - strb r1, [r4, 0x4] - strb r0, [r4, 0x5] - strb r2, [r4, 0x6] - movs r0, 0x10 - strb r0, [r4, 0x8] - strb r3, [r4, 0xB] - cmp r5, 0 - blt _08199554 - movs r0, 0x4 - ldrsb r0, [r4, r0] - cmp r5, r0 - ble _0819955C -_08199554: - strb r6, [r4, 0x2] - b _0819955E - .pool -_0819955C: - strb r5, [r4, 0x2] -_0819955E: - movs r0, 0 - bl MoveMenuCursor - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end InitMenuInUpperLeftCorner - - thumb_func_start InitMenuInUpperLeftCornerPlaySoundWhenAPressed -InitMenuInUpperLeftCornerPlaySoundWhenAPressed: @ 8199570 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - movs r3, 0 - bl InitMenuInUpperLeftCorner - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end InitMenuInUpperLeftCornerPlaySoundWhenAPressed - - thumb_func_start PrintMenuTable -PrintMenuTable: @ 819958C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - movs r5, 0 - cmp r5, r7 - bcs _081995D0 - movs r6, 0x80 - lsls r6, 17 - adds r4, r2, 0 -_081995AA: - ldr r2, [r4] - lsrs r0, r6, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r8 - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0x80 - lsls r0, 21 - adds r6, r0 - adds r4, 0x8 - adds r5, 0x1 - cmp r5, r7 - bcc _081995AA -_081995D0: - mov r0, r8 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end PrintMenuTable - - thumb_func_start sub_81995E4 -sub_81995E4: @ 81995E4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - mov r9, r2 - mov r8, r3 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - mov r0, sp - movs r1, 0 - mov r10, r1 - strb r6, [r0, 0x4] - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x5] - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - movs r0, 0x1 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - mov r0, sp - mov r1, r10 - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - movs r1, 0x8 - strb r1, [r0, 0x6] - strb r1, [r0, 0x8] - movs r4, 0 - cmp r4, r7 - bcs _081996A6 - mov r5, sp -_0819967C: - mov r1, r8 - adds r0, r1, r4 - ldrb r0, [r0] - lsls r0, 3 - add r0, r9 - ldr r0, [r0] - str r0, [sp] - lsls r0, r4, 4 - adds r0, 0x1 - strb r0, [r5, 0x7] - strb r0, [r5, 0x9] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r7 - bcc _0819967C -_081996A6: - adds r0, r6, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81995E4 - - thumb_func_start CreateYesNoMenu -@ void CreateYesNoMenu(struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos) -CreateYesNoMenu: @ 81996C0 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x10 - adds r4, r1, 0 - adds r5, r2, 0 - adds r6, r3, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r1, =gUnknown_0203CD9F - mov r8, r1 - bl AddWindow - mov r2, r8 - strb r0, [r2] - ldrb r0, [r2] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r5, 0 - bl SetWindowBorderStyle - ldr r0, =gUnknown_085EE491 - str r0, [sp] - mov r1, sp - mov r2, r8 - ldrb r0, [r2] - movs r2, 0 - mov r9, r2 - strb r0, [r1, 0x4] - mov r0, sp - movs r2, 0x1 - strb r2, [r0, 0x5] - movs r0, 0x8 - strb r0, [r1, 0x6] - mov r0, sp - strb r2, [r0, 0x7] - ldrb r0, [r0, 0x6] - strb r0, [r1, 0x8] - mov r0, sp - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - movs r0, 0x1 - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - movs r0, 0x1 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - mov r0, sp - mov r1, r9 - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - mov r2, r8 - ldrb r0, [r2] - movs r1, 0x2 - adds r2, r6, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end CreateYesNoMenu - - thumb_func_start sub_81997AC -sub_81997AC: @ 81997AC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0xC] - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x10] - movs r7, 0 - cmp r7, r3 - bcs _08199824 -_081997D4: - movs r4, 0 - adds r0, r7, 0x1 - mov r9, r0 - cmp r4, r6 - bcs _0819981C - lsls r0, r7, 4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0x80 - lsls r5, 20 -_081997EC: - adds r0, r7, 0 - muls r0, r6 - adds r0, r4 - lsls r0, 3 - ldr r1, [sp, 0x34] - adds r0, r1 - ldr r2, [r0] - lsrs r3, r5, 24 - mov r0, r8 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r10 - movs r1, 0x1 - bl Print - ldr r1, [sp, 0xC] - lsls r0, r1, 24 - adds r5, r0 - adds r4, 0x1 - cmp r4, r6 - bcc _081997EC -_0819981C: - mov r7, r9 - ldr r4, [sp, 0x10] - cmp r7, r4 - bcc _081997D4 -_08199824: - mov r0, r10 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81997AC - - thumb_func_start sub_819983C -sub_819983C: @ 819983C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - mov r0, sp - movs r6, 0 - ldrb r1, [r0, 0x10] - strb r1, [r0, 0x4] - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x5] - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - movs r0, 0x1 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - mov r0, sp - strb r6, [r0, 0xA] - strb r6, [r0, 0xB] - movs r7, 0 - cmp r7, r10 - bcs _0819992A -_081998D6: - movs r5, 0 - adds r2, r7, 0x1 - mov r9, r2 - cmp r5, r8 - bcs _08199920 - mov r4, sp - lsls r0, r7, 4 - adds r6, r0, 0x1 -_081998E6: - mov r0, r8 - muls r0, r7 - adds r0, r5 - ldr r1, [sp, 0x3C] - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 3 - ldr r2, [sp, 0x38] - adds r0, r2 - ldr r0, [r0] - str r0, [sp] - ldr r1, [sp, 0x14] - adds r0, r1, 0 - muls r0, r5 - adds r0, 0x8 - strb r0, [r4, 0x6] - strb r6, [r4, 0x7] - strb r0, [r4, 0x8] - strb r6, [r4, 0x9] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r8 - bcc _081998E6 -_08199920: - mov r2, r9 - lsls r0, r2, 24 - lsrs r7, r0, 24 - cmp r7, r10 - bcc _081998D6 -_0819992A: - ldr r0, [sp, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819983C - - thumb_func_start sub_8199944 -sub_8199944: @ 8199944 - push {r4-r7,lr} - ldr r4, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r7, r4, 24 - ldr r6, =gUnknown_0203CD90 - movs r4, 0 - mov r12, r4 - mov r4, r12 - strb r4, [r6] - movs r5, 0x1 - strb r5, [r6, 0x1] - strb r4, [r6, 0x3] - adds r4, r2, 0 - muls r4, r3 - subs r4, 0x1 - strb r4, [r6, 0x4] - strb r0, [r6, 0x5] - strb r5, [r6, 0x6] - strb r1, [r6, 0x7] - movs r0, 0x10 - strb r0, [r6, 0x8] - strb r2, [r6, 0x9] - strb r3, [r6, 0xA] - cmp r7, 0 - blt _08199986 - movs r0, 0x4 - ldrsb r0, [r6, r0] - cmp r7, r0 - ble _08199990 -_08199986: - mov r0, r12 - strb r0, [r6, 0x2] - b _08199992 - .pool -_08199990: - strb r7, [r6, 0x2] -_08199992: - movs r0, 0 - movs r1, 0 - bl sub_8199134 - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8199944 - - thumb_func_start clear_scheduled_bg_copies_to_vram -@ void clear_scheduled_bg_copies_to_vram() -clear_scheduled_bg_copies_to_vram: @ 81999A8 - push {lr} - ldr r0, =gUnknown_0203CDA4 - movs r1, 0 - movs r2, 0x4 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end clear_scheduled_bg_copies_to_vram - - thumb_func_start schedule_bg_copy_tilemap_to_vram -@ void schedule_bg_copy_tilemap_to_vram(u8 bg_id) -schedule_bg_copy_tilemap_to_vram: @ 81999BC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CDA4 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - bx lr - .pool - thumb_func_end schedule_bg_copy_tilemap_to_vram - - thumb_func_start do_scheduled_bg_tilemap_copies_to_vram -@ void do_scheduled_bg_tilemap_copies_to_vram() -do_scheduled_bg_tilemap_copies_to_vram: @ 81999D0 - push {r4,lr} - ldr r4, =gUnknown_0203CDA4 - ldrb r0, [r4] - cmp r0, 0x1 - bne _081999E4 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0 - strb r0, [r4] -_081999E4: - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - bne _081999F4 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0 - strb r0, [r4, 0x1] -_081999F4: - ldrb r0, [r4, 0x2] - cmp r0, 0x1 - bne _08199A04 - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0 - strb r0, [r4, 0x2] -_08199A04: - ldrb r0, [r4, 0x3] - cmp r0, 0x1 - bne _08199A14 - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - movs r0, 0 - strb r0, [r4, 0x3] -_08199A14: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end do_scheduled_bg_tilemap_copies_to_vram - - thumb_func_start reset_temp_tile_data_buffers -@ void reset_temp_tile_data_buffers() -reset_temp_tile_data_buffers: @ 8199A20 - push {lr} - ldr r3, =gUnknown_0203CDA8 - ldr r1, =gUnknown_0203CDAC - movs r2, 0 - adds r0, r1, 0 - adds r0, 0x7C -_08199A2C: - str r2, [r0] - subs r0, 0x4 - cmp r0, r1 - bge _08199A2C - movs r0, 0 - strh r0, [r3] - pop {r0} - bx r0 - .pool - thumb_func_end reset_temp_tile_data_buffers - - thumb_func_start free_temp_tile_data_buffers_if_possible -free_temp_tile_data_buffers_if_possible: @ 8199A44 - push {r4-r6,lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08199A88 - ldr r1, =gUnknown_0203CDA8 - ldrh r0, [r1] - cmp r0, 0 - beq _08199A7C - movs r4, 0 - ldrh r1, [r1] - cmp r4, r1 - bge _08199A76 - ldr r5, =gUnknown_0203CDAC - movs r6, 0 -_08199A64: - ldr r0, [r5] - bl Free - stm r5!, {r6} - adds r4, 0x1 - ldr r0, =gUnknown_0203CDA8 - ldrh r0, [r0] - cmp r4, r0 - blt _08199A64 -_08199A76: - ldr r1, =gUnknown_0203CDA8 - movs r0, 0 - strh r0, [r1] -_08199A7C: - movs r0, 0 - b _08199A8A - .pool -_08199A88: - movs r0, 0x1 -_08199A8A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end free_temp_tile_data_buffers_if_possible - - thumb_func_start decompress_and_copy_tile_data_to_vram -@ int decompress_and_copy_tile_data_to_vram(u8 bg_id, int src, int size, u16 offset, u8 mode) -decompress_and_copy_tile_data_to_vram: @ 8199A90 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r3, 16 - lsrs r3, 16 - mov r9, r3 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r6, =gUnknown_0203CDA8 - ldrh r0, [r6] - cmp r0, 0x1F - bhi _08199AF8 - adds r0, r4, 0 - add r1, sp, 0x4 - bl malloc_and_decompress - adds r4, r0, 0 - cmp r5, 0 - bne _08199AC8 - ldr r5, [sp, 0x4] -_08199AC8: - cmp r4, 0 - beq _08199AEC - lsls r2, r5, 16 - lsrs r2, 16 - str r7, [sp] - mov r0, r8 - adds r1, r4, 0 - mov r3, r9 - bl copy_decompressed_tile_data_to_vram - ldr r2, =gUnknown_0203CDAC - ldrh r0, [r6] - adds r1, r0, 0x1 - strh r1, [r6] - lsls r0, 16 - lsrs r0, 14 - adds r0, r2 - str r4, [r0] -_08199AEC: - adds r0, r4, 0 - b _08199AFA - .pool -_08199AF8: - movs r0, 0 -_08199AFA: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end decompress_and_copy_tile_data_to_vram - - thumb_func_start copy_decompressed_tile_data_to_vram_autofree -@ void copy_decompressed_tile_data_to_vram_autofree(u8 bg_id, int src, u16 size, u16 offset, u8 mode) -copy_decompressed_tile_data_to_vram_autofree: @ 8199B08 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r5, r2, 0 - ldr r2, [sp, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r3, 16 - lsrs r3, 16 - mov r9, r3 - lsls r2, 24 - lsrs r7, r2, 24 - adds r0, r1, 0 - add r1, sp, 0x4 - bl malloc_and_decompress - adds r6, r0, 0 - cmp r5, 0 - bne _08199B36 - ldr r5, [sp, 0x4] -_08199B36: - cmp r6, 0 - beq _08199B6E - ldr r0, =task_free_buf_after_copying_tile_data_to_vram - movs r1, 0 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, r5, 16 - lsrs r2, 16 - str r7, [sp] - mov r0, r8 - adds r1, r6, 0 - mov r3, r9 - bl copy_decompressed_tile_data_to_vram - ldr r2, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r2 - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r6, 0 - bl SetWordTaskArg -_08199B6E: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end copy_decompressed_tile_data_to_vram_autofree - - thumb_func_start task_free_buf_after_copying_tile_data_to_vram -@ void task_free_buf_after_copying_tile_data_to_vram(int task_id) -task_free_buf_after_copying_tile_data_to_vram: @ 8199B84 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - bl CheckForSpaceForDma3Request - lsls r0, 16 - cmp r0, 0 - bne _08199BB4 - adds r0, r4, 0 - movs r1, 0x1 - bl GetWordTaskArg - bl Free - adds r0, r4, 0 - bl DestroyTask -_08199BB4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_free_buf_after_copying_tile_data_to_vram - - thumb_func_start malloc_and_decompress -@ void *malloc_and_decompress(void *src, int *size) -malloc_and_decompress: @ 8199BC0 - push {r4,r5,lr} - adds r5, r0, 0 - ldrb r0, [r5, 0x1] - strb r0, [r1] - ldrb r0, [r5, 0x2] - strb r0, [r1, 0x1] - ldrb r0, [r5, 0x3] - strb r0, [r1, 0x2] - movs r0, 0 - strb r0, [r1, 0x3] - ldr r0, [r1] - bl Alloc - adds r4, r0, 0 - cmp r4, 0 - beq _08199BE8 - adds r0, r5, 0 - adds r1, r4, 0 - bl LZ77UnCompWram -_08199BE8: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end malloc_and_decompress - - thumb_func_start copy_decompressed_tile_data_to_vram -@ s16 copy_decompressed_tile_data_to_vram(u8 bg_id, int src, u16 size, u16 offset, u8 mode) -copy_decompressed_tile_data_to_vram: @ 8199BF0 - push {r4,lr} - adds r4, r1, 0 - ldr r1, [sp, 0x8] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0 - beq _08199C18 - cmp r1, 0x1 - beq _08199C20 - ldr r0, =0x0000ffff - b _08199C2A - .pool -_08199C18: - adds r1, r4, 0 - bl LoadBgTiles - b _08199C26 -_08199C20: - adds r1, r4, 0 - bl LoadBgTilemap -_08199C26: - lsls r0, 16 - lsrs r0, 16 -_08199C2A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end copy_decompressed_tile_data_to_vram - - thumb_func_start sub_8199C30 -sub_8199C30: @ 8199C30 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r2, 0 - ldr r4, [sp, 0x28] - ldr r2, [sp, 0x2C] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x4] - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - bl GetBgTilemapBuffer - mov r8, r0 - adds r0, r5, r4 - cmp r5, r0 - bge _08199CA8 - mov r9, r0 -_08199C6E: - ldr r3, [sp] - ldr r1, [sp, 0x4] - adds r0, r3, r1 - adds r7, r5, 0x1 - cmp r3, r0 - bge _08199CA0 - lsls r6, r5, 5 - ldr r1, =0x00000fff - mov r12, r1 - mov r1, r10 - lsls r5, r1, 12 - adds r4, r0, 0 -_08199C86: - adds r1, r6, r3 - lsls r1, 1 - add r1, r8 - ldrh r2, [r1] - mov r0, r12 - ands r0, r2 - orrs r0, r5 - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r4 - blt _08199C86 -_08199CA0: - lsls r0, r7, 24 - lsrs r5, r0, 24 - cmp r5, r9 - blt _08199C6E -_08199CA8: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8199C30 - - thumb_func_start sub_8199CBC -sub_8199CBC: @ 8199CBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r10, r1 - ldr r1, [sp, 0x24] - ldr r4, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - lsls r1, 24 - lsrs r5, r1, 24 - lsls r4, 24 - lsrs r4, 24 - mov r8, r4 - bl GetBgTilemapBuffer - adds r7, r0, 0 - movs r0, 0 - cmp r0, r8 - bcs _08199D2A -_08199CF4: - movs r2, 0 - adds r6, r0, 0x1 - cmp r2, r5 - bcs _08199D22 - adds r4, r0, 0 - muls r4, r5 - ldr r1, [sp] - adds r0, r1 - lsls r3, r0, 5 -_08199D06: - adds r1, r4, r2 - lsls r1, 1 - add r1, r10 - adds r0, r3, r2 - add r0, r9 - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r5 - bcc _08199D06 -_08199D22: - lsls r0, r6, 24 - lsrs r0, 24 - cmp r0, r8 - bcc _08199CF4 -_08199D2A: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8199CBC - - thumb_func_start sub_8199D3C -sub_8199D3C: @ 8199D3C - push {r4-r7,lr} - adds r6, r0, 0 - adds r5, r1, 0 - ldr r0, [sp, 0x14] - adds r4, r2, 0 - muls r4, r3 - cmp r0, 0x1 - bne _08199D64 - adds r3, r6, 0 - movs r2, 0 - cmp r2, r4 - bge _08199D8C -_08199D54: - adds r1, r3, r2 - ldrb r0, [r1] - adds r0, r5 - strb r0, [r1] - adds r2, 0x1 - cmp r2, r4 - blt _08199D54 - b _08199D8C -_08199D64: - cmp r4, 0 - ble _08199D8C - movs r0, 0xFC - lsls r0, 8 - mov r12, r0 - ldr r0, =0x000003ff - adds r7, r0, 0 - adds r3, r6, 0 - adds r2, r4, 0 -_08199D76: - ldrh r0, [r3] - mov r1, r12 - ands r1, r0 - adds r0, r5 - ands r0, r7 - orrs r1, r0 - strh r1, [r3] - adds r3, 0x2 - subs r2, 0x1 - cmp r2, 0 - bne _08199D76 -_08199D8C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8199D3C - - thumb_func_start sub_8199D98 -sub_8199D98: @ 8199D98 - push {lr} - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - pop {r0} - bx r0 - thumb_func_end sub_8199D98 - - thumb_func_start sub_8199DF0 -sub_8199DF0: @ 8199DF0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r8, r2 - mov r9, r3 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - movs r1, 0x4 - bl GetBgAttribute - lsls r0, 16 - movs r7, 0x40 - cmp r0, 0 - bne _08199E16 - movs r7, 0x20 -_08199E16: - adds r0, r5, 0 - movs r1, 0x1 - bl GetBgAttribute - adds r4, r0, 0 - adds r0, r5, 0 - movs r1, 0xA - bl GetBgAttribute - lsls r4, 16 - lsrs r4, 2 - lsls r0, 16 - lsrs r0, 16 - add r0, r8 - muls r0, r7 - adds r4, r0 - lsls r0, r6, 24 - lsls r1, r6, 16 - orrs r0, r1 - lsls r1, r6, 8 - orrs r0, r1 - orrs r0, r6 - movs r1, 0xC0 - lsls r1, 19 - adds r4, r1 - mov r2, r9 - muls r2, r7 - lsls r2, 16 - lsrs r2, 16 - adds r1, r4, 0 - movs r3, 0x1 - bl RequestDma3Fill - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8199DF0 - - thumb_func_start box_print -box_print: @ 8199E64 - push {r4-r6,lr} - sub sp, 0x10 - adds r4, r1, 0 - ldr r6, [sp, 0x20] - ldr r5, [sp, 0x24] - ldr r1, [sp, 0x28] - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - str r1, [sp] - mov r1, sp - strb r0, [r1, 0x4] - mov r0, sp - strb r4, [r0, 0x5] - strb r2, [r0, 0x6] - strb r3, [r0, 0x7] - ldrb r0, [r0, 0x6] - strb r0, [r1, 0x8] - mov r0, sp - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - adds r0, r4, 0 - movs r1, 0x2 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x3 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xB] - mov r3, sp - ldrb r2, [r3, 0xC] - movs r1, 0x10 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - mov r2, sp - ldrb r0, [r6, 0x1] - lsls r0, 4 - movs r4, 0xF - strb r0, [r2, 0xC] - ldrb r2, [r6] - adds r0, r4, 0 - ands r0, r2 - ldrb r2, [r3, 0xD] - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - mov r2, sp - ldrb r0, [r6, 0x2] - lsls r0, 4 - ands r1, r4 - orrs r1, r0 - strb r1, [r2, 0xD] - mov r0, sp - adds r1, r5, 0 - movs r2, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end box_print - - thumb_func_start AddTextPrinterParametrized2 -@ void AddTextPrinterParametrized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, struct TextColor *color, u8 speed, u8 *str) -AddTextPrinterParametrized2: @ 8199EEC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x10 - adds r5, r1, 0 - ldr r1, [sp, 0x28] - mov r8, r1 - ldr r1, [sp, 0x2C] - mov r9, r1 - ldr r6, [sp, 0x30] - ldr r1, [sp, 0x34] - ldr r4, [sp, 0x38] - str r4, [sp] - mov r4, sp - strb r0, [r4, 0x4] - mov r0, sp - strb r5, [r0, 0x5] - strb r2, [r0, 0x6] - strb r3, [r0, 0x7] - mov r2, sp - ldrb r0, [r0, 0x6] - strb r0, [r2, 0x8] - mov r0, sp - ldrb r0, [r0, 0x7] - strb r0, [r2, 0x9] - mov r0, sp - mov r2, r8 - strb r2, [r0, 0xA] - mov r2, r9 - strb r2, [r0, 0xB] - ldrb r3, [r4, 0xC] - movs r2, 0x10 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r4, 0xC] - mov r3, sp - ldrb r0, [r6, 0x1] - lsls r0, 4 - movs r5, 0xF - strb r0, [r3, 0xC] - ldrb r3, [r6] - adds r0, r5, 0 - ands r0, r3 - ldrb r3, [r4, 0xD] - ands r2, r3 - orrs r2, r0 - strb r2, [r4, 0xD] - mov r3, sp - ldrb r0, [r6, 0x2] - lsls r0, 4 - ands r2, r5 - orrs r2, r0 - strb r2, [r3, 0xD] - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - movs r2, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end AddTextPrinterParametrized2 - - thumb_func_start sub_8199F74 -sub_8199F74: @ 8199F74 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - adds r6, r1, 0 - ldr r4, [sp, 0x2C] - ldr r1, [sp, 0x30] - mov r8, r1 - ldr r7, [sp, 0x34] - ldr r5, [sp, 0x38] - ldr r1, [sp, 0x3C] - mov r9, r1 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - str r2, [sp] - mov r1, sp - strb r0, [r1, 0x4] - mov r0, sp - strb r6, [r0, 0x5] - strb r3, [r0, 0x6] - strb r4, [r0, 0x7] - strb r3, [r0, 0x8] - strb r4, [r0, 0x9] - strb r5, [r0, 0xA] - mov r1, r9 - strb r1, [r0, 0xB] - mov r2, sp - ldrb r1, [r2, 0xC] - movs r5, 0x10 - negs r5, r5 - adds r0, r5, 0 - ands r0, r1 - strb r0, [r2, 0xC] - adds r0, r6, 0 - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r4, 0xF - adds r1, r4, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - adds r0, r6, 0 - movs r1, 0x6 - bl GetFontAttribute - mov r2, sp - adds r1, r4, 0 - ands r1, r0 - ldrb r0, [r2, 0xD] - ands r5, r0 - orrs r5, r1 - strb r5, [r2, 0xD] - adds r0, r6, 0 - movs r1, 0x7 - bl GetFontAttribute - mov r2, sp - lsls r0, 4 - ldrb r1, [r2, 0xD] - ands r4, r1 - orrs r4, r0 - strb r4, [r2, 0xD] - mov r0, sp - mov r1, r8 - adds r2, r7, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8199F74 - - thumb_func_start sub_819A024 -sub_819A024: @ 819A024 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - lsls r2, 16 - lsrs r4, r2, 16 - lsls r3, 16 - lsrs r5, r3, 16 - movs r2, 0 - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldrb r0, [r3] - ldr r6, =gStringVar4 - cmp r0, 0xFF - beq _0819A04C -_0819A042: - adds r2, 0x1 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0819A042 -_0819A04C: - adds r0, r6, 0 - bl StringExpandPlaceholders - lsls r3, r4, 24 - lsrs r3, 24 - lsls r0, r5, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - adds r2, r6, 0 - bl Print - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A024 - - thumb_func_start sub_819A080 -sub_819A080: @ 819A080 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, [sp, 0x48] - ldr r4, [sp, 0x4C] - ldr r1, [sp, 0x50] - ldr r5, [sp, 0x54] - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x8] - lsls r3, 16 - lsrs r3, 16 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0xC] - lsls r4, 16 - lsrs r4, 16 - lsls r1, 16 - lsrs r1, 16 - lsls r5, 16 - lsrs r5, 16 - ldr r2, [sp, 0x4] - ldrh r0, [r2, 0x4] - ldr r2, [sp, 0xC] - subs r0, r2 - ldr r2, [sp, 0x8] - adds r2, r1, r2 - str r2, [sp, 0x10] - cmp r0, r1 - bge _0819A0CC - ldr r1, [sp, 0x8] - adds r0, r1 - str r0, [sp, 0x10] -_0819A0CC: - ldr r2, [sp, 0x4] - ldrh r1, [r2, 0x6] - subs r0, r1, r4 - cmp r0, r5 - bge _0819A0DE - adds r0, r3, r1 - subs r0, r4 - str r0, [sp, 0x14] - b _0819A0E2 -_0819A0DE: - adds r5, r3, r5 - str r5, [sp, 0x14] -_0819A0E2: - ldr r0, [sp] - ldrh r1, [r0, 0x4] - movs r2, 0x7 - adds r0, r1, 0 - ands r0, r2 - adds r1, r0 - asrs r1, 3 - str r1, [sp, 0x18] - ldr r0, [sp, 0x4] - ldrh r1, [r0, 0x4] - adds r0, r1, 0 - ands r0, r2 - adds r1, r0 - asrs r1, 3 - str r1, [sp, 0x1C] - mov r12, r3 - mov r8, r4 - ldr r1, [sp, 0x14] - cmp r12, r1 - blt _0819A10C - b _0819A24A -_0819A10C: - ldr r5, [sp, 0x8] - ldr r6, [sp, 0xC] - mov r2, r12 - adds r2, 0x1 - str r2, [sp, 0x20] - mov r0, r8 - adds r0, 0x1 - str r0, [sp, 0x24] - ldr r1, [sp, 0x10] - cmp r5, r1 - blt _0819A124 - b _0819A23A -_0819A124: - movs r7, 0x1 - movs r2, 0xF0 - mov r10, r2 - movs r0, 0xF - mov r9, r0 -_0819A12E: - asrs r0, r5, 1 - movs r1, 0x3 - ands r0, r1 - ldr r2, [sp] - ldr r1, [r2] - adds r1, r0 - asrs r0, r5, 3 - lsls r0, 5 - adds r1, r0 - mov r2, r12 - asrs r0, r2, 3 - ldr r2, [sp, 0x18] - muls r0, r2 - lsls r0, 5 - adds r1, r0 - mov r2, r12 - lsls r0, r2, 29 - lsrs r0, 27 - adds r3, r1, r0 - asrs r0, r6, 1 - movs r1, 0x3 - ands r0, r1 - ldr r2, [sp, 0x4] - ldr r1, [r2] - adds r1, r0 - asrs r0, r6, 3 - lsls r0, 5 - adds r1, r0 - mov r2, r8 - asrs r0, r2, 3 - ldr r2, [sp, 0x1C] - muls r0, r2 - lsls r0, 5 - adds r1, r0 - mov r2, r8 - lsls r0, r2, 29 - lsrs r0, 27 - adds r4, r1, r0 - adds r0, r4, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1DA - subs r4, 0x1 - adds r0, r6, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1B2 - ldrh r0, [r4] - ldr r2, =0x00000fff - ands r2, r0 - adds r0, r5, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1A8 - ldrb r1, [r3] - mov r0, r10 - ands r0, r1 - lsls r0, 8 - b _0819A22A - .pool -_0819A1A8: - ldrb r1, [r3] - mov r0, r9 - ands r0, r1 - lsls r0, 12 - b _0819A22A -_0819A1B2: - ldrh r0, [r4] - ldr r2, =0x0000f0ff - ands r2, r0 - adds r0, r5, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1D0 - ldrb r1, [r3] - mov r0, r10 - ands r0, r1 - lsls r0, 4 - b _0819A22A - .pool -_0819A1D0: - ldrb r1, [r3] - mov r0, r9 - ands r0, r1 - lsls r0, 8 - b _0819A22A -_0819A1DA: - adds r0, r6, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A206 - ldrh r0, [r4] - ldr r2, =0x0000ff0f - ands r2, r0 - adds r0, r5, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1FC - ldrb r1, [r3] - mov r0, r10 - b _0819A228 - .pool -_0819A1FC: - ldrb r1, [r3] - mov r0, r9 - ands r0, r1 - lsls r0, 4 - b _0819A22A -_0819A206: - ldrh r0, [r4] - ldr r2, =0x0000fff0 - ands r2, r0 - adds r0, r5, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A224 - ldrb r1, [r3] - mov r0, r10 - ands r0, r1 - lsrs r0, 4 - b _0819A22A - .pool -_0819A224: - ldrb r1, [r3] - mov r0, r9 -_0819A228: - ands r0, r1 -_0819A22A: - orrs r2, r0 - strh r2, [r4] - adds r5, 0x1 - adds r6, 0x1 - ldr r0, [sp, 0x10] - cmp r5, r0 - bge _0819A23A - b _0819A12E -_0819A23A: - ldr r1, [sp, 0x20] - mov r12, r1 - ldr r2, [sp, 0x24] - mov r8, r2 - ldr r0, [sp, 0x14] - cmp r12, r0 - bge _0819A24A - b _0819A10C -_0819A24A: - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819A080 - - thumb_func_start sub_819A25C -sub_819A25C: @ 819A25C - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - lsrs r0, 16 - bl sub_80D30B0 - adds r1, r4, 0 - movs r2, 0x20 - bl LoadPalette - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819A25C - - thumb_func_start sub_819A27C -sub_819A27C: @ 819A27C - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r4, r3, 0 - ldr r5, [sp, 0x18] - lsls r6, 24 - lsrs r6, 24 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - movs r2, 0x1 - bl sub_80D2EDC - adds r1, r0, 0 - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl BlitBitmapToWindow - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819A27C - - thumb_func_start sub_819A2BC -sub_819A2BC: @ 819A2BC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _0819A2DC - cmp r1, 0x1 - ble _0819A2D2 - cmp r1, 0x2 - beq _0819A2E4 -_0819A2D2: - ldr r0, =gUnknown_08DC4318 - b _0819A2E6 - .pool -_0819A2DC: - ldr r0, =gUnknown_08DC4338 - b _0819A2E6 - .pool -_0819A2E4: - ldr r0, =gUnknown_08DC4358 -_0819A2E6: - adds r1, r2, 0 - movs r2, 0x20 - bl LoadPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A2BC - - thumb_func_start blit_move_info_icon -@ void blit_move_info_icon(u8 windowId, u8 a2, u16 x, u16 y) -blit_move_info_icon: @ 819A2F8 - push {r4,r5,lr} - sub sp, 0x18 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 16 - lsrs r3, 16 - ldr r4, =gUnknown_0860F0D4 - lsrs r1, 22 - adds r1, r4 - ldrh r5, [r1, 0x2] - lsls r5, 5 - ldr r4, =gUnknown_08DC4378 - adds r5, r4 - movs r4, 0x80 - str r4, [sp] - str r4, [sp, 0x4] - str r2, [sp, 0x8] - str r3, [sp, 0xC] - ldrb r2, [r1] - str r2, [sp, 0x10] - ldrb r1, [r1, 0x1] - str r1, [sp, 0x14] - adds r1, r5, 0 - movs r2, 0 - movs r3, 0 - bl BlitBitmapRectToWindow - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end blit_move_info_icon - - thumb_func_start sub_819A344 -sub_819A344: @ 819A344 - push {r4-r7,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r2, 24 - lsrs r2, 24 - adds r5, r1, 0 - movs r1, 0xFC - strb r1, [r5] - adds r5, 0x1 - movs r0, 0x1 - strb r0, [r5] - adds r5, 0x1 - strb r2, [r5] - adds r5, 0x1 - strb r1, [r5] - adds r5, 0x1 - movs r0, 0x3 - strb r0, [r5] - adds r5, 0x1 - adds r2, 0x1 - strb r2, [r5] - adds r5, 0x1 - cmp r3, 0x4 - bhi _0819A43C - lsls r0, r3, 2 - ldr r1, =_0819A384 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819A384: - .4byte _0819A398 - .4byte _0819A3A8 - .4byte _0819A3D6 - .4byte _0819A404 - .4byte _0819A414 -_0819A398: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r5, 0 - bl StringCopy - b _0819A43C - .pool -_0819A3A8: - bl IsNationalPokedexEnabled - cmp r0, 0 - beq _0819A3B8 - movs r0, 0x1 - bl pokedex_count - b _0819A3BE -_0819A3B8: - movs r0, 0x1 - bl sub_80C0844 -_0819A3BE: - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r5, r0, 0 - movs r0, 0xFF - strb r0, [r5] - b _0819A43C -_0819A3D6: - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldrh r1, [r0, 0xE] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r5, r0, 0 - movs r0, 0xF0 - strb r0, [r5] - adds r5, 0x1 - ldr r0, [r4] - ldrb r1, [r0, 0x10] - adds r0, r5, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - b _0819A43C - .pool -_0819A404: - ldr r0, =gMapHeader - ldrb r1, [r0, 0x14] - adds r0, r5, 0 - bl sub_81245DC - b _0819A43C - .pool -_0819A414: - ldr r4, =0x00000867 - movs r6, 0 - adds r7, r5, 0x1 -_0819A41A: - lsls r0, r4, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0819A42A - adds r6, 0x1 -_0819A42A: - adds r4, 0x1 - ldr r0, =0x0000086e - cmp r4, r0 - ble _0819A41A - adds r0, r6, 0 - subs r0, 0x5F - strb r0, [r5] - movs r0, 0xFF - strb r0, [r7] -_0819A43C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A344 - - thumb_func_start sub_819A44C -sub_819A44C: @ 819A44C - push {r4,r5,lr} - adds r5, r0, 0 - ldrb r4, [r5, 0x5] - lsrs r4, 4 - movs r0, 0x65 - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsls r4, 16 - lsrs r4, 16 - lsrs r0, 24 - cmp r4, r0 - bne _0819A4BA - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0819A4B0 - ldrh r1, [r5, 0x2E] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _0819A484 - subs r0, r1, 0x1 - strh r0, [r5, 0x2E] - b _0819A4C2 -_0819A484: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _0819A4A6 - adds r0, r5, 0 - movs r1, 0 - bl StartSpriteAnim - movs r0, 0x20 - strh r0, [r5, 0x2E] - b _0819A4C2 -_0819A4A6: - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAnim - b _0819A4C2 -_0819A4B0: - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAnimIfDifferent - b _0819A4C2 -_0819A4BA: - adds r0, r5, 0 - movs r1, 0 - bl StartSpriteAnimIfDifferent -_0819A4C2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819A44C - - thumb_func_start sub_819A4C8 -sub_819A4C8: @ 819A4C8 - push {lr} - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_819A4C8 - - thumb_func_start sub_819A4E4 -sub_819A4E4: @ 819A4E4 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_819A4E4 - - thumb_func_start sub_819A4F8 -sub_819A4F8: @ 819A4F8 - push {lr} - ldr r0, =gUnknown_0300127C - movs r1, 0 - str r1, [r0] - ldr r0, =sub_819A514 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A4F8 - - thumb_func_start sub_819A514 -sub_819A514: @ 819A514 - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xA - bls _0819A528 - b _0819A98E -_0819A528: - lsls r0, 2 - ldr r1, =_0819A53C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819A53C: - .4byte _0819A568 - .4byte _0819A5C0 - .4byte _0819A69C - .4byte _0819A77C - .4byte _0819A7CC - .4byte _0819A868 - .4byte _0819A8A4 - .4byte _0819A8AC - .4byte _0819A8C4 - .4byte _0819A8DC - .4byte _0819A8FC -_0819A568: - ldr r4, =gUnknown_0203CE3C - ldr r0, [r4] - cmp r0, 0 - beq _0819A578 - bl Free - movs r0, 0 - str r0, [r4] -_0819A578: - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x8 - bl CpuSet - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08610428 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r0, =gUnknown_08610434 - bl InitWindows - bl DeactivateAllTextPrinters - b _0819A8E6 - .pool -_0819A5C0: - ldr r5, =gUnknown_0203CE2C - movs r4, 0x88 - lsls r4, 3 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203CE30 - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - ldr r5, =gUnknown_0203CE34 - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203CE38 - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - ldr r1, =gMain - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0819A8EE - .pool -_0819A69C: - bl ResetPaletteFade - bl ResetSpriteData - bl ResetTasks - bl FreeAllSpritePalettes - ldr r0, =gUnknown_08DC0754 - ldr r5, =gUnknown_0203CE2C - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 2 - bl CpuSet - ldr r0, =gUnknown_0861033C - ldr r4, =gUnknown_0203CE30 - ldr r1, [r4] - movs r2, 0x30 - bl CpuSet - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 3 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTiles - ldr r1, [r4] - movs r0, 0x3 - movs r2, 0x60 - movs r3, 0 - bl LoadBgTiles - ldr r0, =gUnknown_08DC0B94 - ldr r4, =gUnknown_0203CE34 - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 3 - bl CpuSet - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 4 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTilemap - ldr r0, =gUnknown_08DC0714 - movs r1, 0 - movs r2, 0x40 - bl LoadPalette - ldr r4, =gUnknown_0861046C - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0x8 - bl LoadPalette - adds r0, r4, 0 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r0, [r1, 0x6] - cmp r0, 0x1 - bne _0819A738 - ldr r0, =gPlttBufferUnfaded - movs r2, 0xA9 - lsls r2, 2 - adds r1, r2 - ldrh r1, [r1] - movs r3, 0xE4 - lsls r3, 1 - adds r0, r3 - strh r1, [r0] -_0819A738: - ldr r0, =gUnknown_0861039C - movs r1, 0x20 - movs r2, 0x4 - bl LoadPalette - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819A8EE - .pool -_0819A77C: - ldr r0, =gUnknown_0203CE38 - ldr r1, [r0] - movs r0, 0x3 - bl SetBgTilemapBuffer - ldr r5, =gUnknown_0861023C - movs r4, 0x8 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - adds r1, r5, 0 - movs r2, 0xB - movs r3, 0x4 - bl CopyToBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - adds r1, r5, 0 - movs r2, 0x2 - movs r3, 0x4 - bl CopyToBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - adds r1, r5, 0 - movs r2, 0x14 - movs r3, 0x4 - bl CopyToBgTilemapBufferRect - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _0819A8E6 - .pool -_0819A7CC: - ldr r0, =gUnknown_086103F4 - bl LoadSpritePalettes - ldr r0, =gUnknown_086103BC - bl LoadSpriteSheets - ldr r0, =gUnknown_086103E4 - bl LoadCompressedObjectPic - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - ldr r0, =sub_819A4E4 - bl SetVBlankCallback - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r1, 0x9A - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - bne _0819A854 - movs r0, 0x58 - movs r1, 0x98 - movs r2, 0x20 - movs r3, 0x60 - bl sub_819C5D0 - movs r0, 0x3 - bl ShowBg - ldr r1, =0x00001248 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _0819A85A - .pool -_0819A854: - movs r0, 0x3 - bl HideBg -_0819A85A: - ldr r1, =gMain - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0819A8EE - .pool -_0819A868: - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - ldrb r0, [r1, 0x6] - cmp r0, 0x1 - bne _0819A878 - ldr r0, =gUnknown_0203CF20 - ldrb r0, [r0] - strb r0, [r1, 0x3] -_0819A878: - bl sub_819A9AC - bl sub_819AA18 - ldr r0, [r4] - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - bne _0819A88C - bl sub_819BE34 -_0819A88C: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819A8EE - .pool -_0819A8A4: - bl sub_819BA64 - movs r0, 0x2 - b _0819A8E2 -_0819A8AC: - bl sub_819BCF8 - movs r0, 0x5 - bl PutWindowTilemap - ldr r1, =gMain - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0819A8EE - .pool -_0819A8C4: - bl sub_819B9E8 - movs r0, 0x1 - bl PutWindowTilemap - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819A8EE - .pool -_0819A8DC: - bl sub_819B9B4 - movs r0, 0 -_0819A8E2: - bl PutWindowTilemap -_0819A8E6: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_0819A8EE: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0819A98E - .pool -_0819A8FC: - ldr r0, =sub_819C69C - movs r1, 0 - bl CreateTask - ldr r2, =gUnknown_0300127C - ldr r1, [r2] - ldr r3, =0x000002a1 - adds r1, r3 - strb r0, [r1] - ldr r3, [r2] - ldrb r5, [r3, 0x6] - cmp r5, 0 - bne _0819A954 - ldr r4, =gTasks - ldr r1, =0x000002a1 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r5, [r0, 0x8] - ldr r0, =sub_819B378 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r5, [r0, 0x8] - b _0819A988 - .pool -_0819A954: - ldr r4, =gTasks - ldr r2, =0x000002a1 - adds r0, r3, r2 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r2, 0 - movs r1, 0x1 - strh r1, [r0, 0x8] - ldr r1, =0x000002a2 - adds r0, r3, r1 - strb r2, [r0] - ldr r0, =sub_819B124 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0xD - strh r1, [r0, 0x8] -_0819A988: - ldr r0, =sub_819A4C8 - bl SetMainCallback2 -_0819A98E: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A514 - - thumb_func_start sub_819A9AC -sub_819A9AC: @ 819A9AC - push {r4,r5,lr} - ldr r5, =gUnknown_0300127C - ldr r4, [r5] - cmp r4, 0 - bne _0819AA12 - movs r0, 0xAB - lsls r0, 2 - bl AllocZeroed - str r0, [r5] - strb r4, [r0, 0x3] - ldr r1, [r5] - movs r0, 0x1 - strb r0, [r1, 0x5] - ldr r0, [r5] - strb r4, [r0, 0x6] - movs r2, 0 - movs r4, 0x6C - movs r3, 0 -_0819A9D2: - ldr r0, [r5] - adds r1, r2, 0 - muls r1, r4 - adds r0, r1 - strb r3, [r0, 0x10] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819A9D2 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _0819AA0C - movs r0, 0 - bl sub_819B484 - b _0819AA12 - .pool -_0819AA0C: - movs r0, 0 - bl sub_819B63C -_0819AA12: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819A9AC - - thumb_func_start sub_819AA18 -sub_819AA18: @ 819AA18 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r4, 0 - mov r8, r4 - ldr r7, =gSprites -_0819AA24: - lsls r1, r4, 3 - adds r1, r4 - lsls r1, 2 - subs r1, r4 - adds r1, 0x20 - lsls r1, 16 - asrs r1, 16 - ldr r0, =gUnknown_086105D8 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r6, =gUnknown_0300127C - ldr r2, [r6] - movs r5, 0x6C - adds r1, r4, 0 - muls r1, r5 - adds r2, r1 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r2, 0xE] - ldrh r1, [r2, 0xE] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r1, r8 - strh r1, [r0, 0x2E] - adds r0, r4, 0 - bl sub_819ADAC - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _0819AA24 - ldr r0, [r6] - ldrb r1, [r0, 0x3] - ldr r4, =gSprites - muls r1, r5 - adds r0, r1 - ldrh r0, [r0, 0xE] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldr r0, =gUnknown_086105F0 - movs r2, 0x20 - ldrsh r1, [r1, r2] - movs r2, 0x58 - movs r3, 0 - bl CreateSprite - ldr r1, [r6] - movs r5, 0 - strb r0, [r1, 0x4] - ldr r0, =gUnknown_08610608 - movs r1, 0xB0 - movs r2, 0x70 - movs r3, 0 - bl CreateSprite - ldr r1, [r6] - strb r0, [r1, 0x1] - ldr r0, =gUnknown_08610620 - movs r1, 0xB0 - movs r2, 0x90 - movs r3, 0 - bl CreateSprite - ldr r1, [r6] - strb r0, [r1, 0x2] - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x28 - strb r5, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x29 - strb r5, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x28 - strb r5, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x29 - strb r5, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AA18 - - thumb_func_start sub_819AB40 -sub_819AB40: @ 819AB40 - push {r4-r6,lr} - movs r4, 0 -_0819AB44: - ldr r6, =gUnknown_0300127C - ldr r1, [r6] - movs r0, 0x6C - muls r0, r4 - adds r1, r0 - ldrh r1, [r1, 0xE] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _0819AB44 - ldr r0, [r6] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AB40 - - thumb_func_start sub_819ABA8 -sub_819ABA8: @ 819ABA8 - push {r4,lr} - lsls r0, 24 - cmp r0, 0 - ble _0819ABC8 - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1, 0x3] - adds r2, r0, 0 - cmp r3, 0x5 - beq _0819ABC4 - adds r0, r3, 0x1 - b _0819ABDE - .pool -_0819ABC4: - movs r0, 0 - b _0819ABDE -_0819ABC8: - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1, 0x3] - adds r2, r0, 0 - cmp r3, 0 - beq _0819ABDC - subs r0, r3, 0x1 - b _0819ABDE - .pool -_0819ABDC: - movs r0, 0x5 -_0819ABDE: - strb r0, [r1, 0x3] - ldr r2, [r2] - ldrb r3, [r2, 0x3] - ldr r4, =gSprites - ldrb r0, [r2, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - movs r0, 0x6C - muls r0, r3 - adds r2, r0 - ldrh r2, [r2, 0xE] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x20] - strh r0, [r1, 0x20] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ABA8 - - thumb_func_start sub_819AC10 -sub_819AC10: @ 819AC10 - push {lr} - lsls r0, 24 - cmp r0, 0 - ble _0819AC30 - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1] - adds r2, r0, 0 - cmp r3, 0x2 - beq _0819AC2C - adds r0, r3, 0x1 - b _0819AC46 - .pool -_0819AC2C: - movs r0, 0 - b _0819AC46 -_0819AC30: - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1] - adds r2, r0, 0 - cmp r3, 0 - beq _0819AC44 - subs r0, r3, 0x1 - b _0819AC46 - .pool -_0819AC44: - movs r0, 0x2 -_0819AC46: - strb r0, [r1] - ldr r3, =gSprites - ldr r2, [r2] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AC10 - - thumb_func_start sub_819AC78 -sub_819AC78: @ 819AC78 - push {lr} - lsls r0, 24 - cmp r0, 0 - ble _0819AC98 - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1, 0x7] - adds r2, r0, 0 - cmp r3, 0x1 - beq _0819AC94 - adds r0, r3, 0x1 - b _0819ACAE - .pool -_0819AC94: - movs r0, 0 - b _0819ACAE -_0819AC98: - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1, 0x7] - adds r2, r0, 0 - cmp r3, 0 - beq _0819ACAC - subs r0, r3, 0x1 - b _0819ACAE - .pool -_0819ACAC: - movs r0, 0x1 -_0819ACAE: - strb r0, [r1, 0x7] - ldr r3, =gSprites - ldr r2, [r2] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2, 0x7] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2, 0x7] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AC78 - - thumb_func_start sub_819ACE0 -sub_819ACE0: @ 819ACE0 - push {r4-r6,lr} - ldr r5, =gUnknown_0300127C - ldr r0, [r5] - ldrb r6, [r0, 0x3] - movs r1, 0x6C - adds r4, r6, 0 - muls r4, r1 - adds r0, r4 - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _0819AD60 - movs r0, 0x64 - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, [r5] - ldrb r0, [r1, 0x5] - cmp r0, 0x3 - bne _0819AD44 - adds r0, r1, r4 - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bne _0819AD44 - movs r2, 0 - ldrb r0, [r1, 0x10] - cmp r0, 0x2 - beq _0819AD32 - movs r4, 0x6C -_0819AD1A: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bhi _0819AD32 - ldr r0, [r5] - adds r1, r2, 0 - muls r1, r4 - adds r0, r1 - ldrb r0, [r0, 0x10] - cmp r0, 0x2 - bne _0819AD1A -_0819AD32: - cmp r2, 0x6 - beq _0819AD9C - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - movs r0, 0x6C - muls r0, r2 - adds r1, r0 - movs r0, 0x1 - strb r0, [r1, 0x10] -_0819AD44: - ldr r2, =gUnknown_0300127C - ldr r1, [r2] - movs r0, 0x6C - muls r0, r6 - adds r1, r0 - movs r0, 0 - strb r0, [r1, 0x10] - ldr r1, [r2] - ldrb r0, [r1, 0x5] - subs r0, 0x1 - b _0819AD78 - .pool -_0819AD60: - movs r0, 0x65 - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, [r5] - adds r1, r0, r4 - ldrb r0, [r0, 0x5] - strb r0, [r1, 0x10] - ldr r1, [r5] - ldrb r0, [r1, 0x5] - adds r0, 0x1 -_0819AD78: - strb r0, [r1, 0x5] - ldr r2, =gSprites - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - movs r1, 0x6C - muls r1, r6 - adds r0, r1 - ldrh r0, [r0, 0xE] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] -_0819AD9C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ACE0 - - thumb_func_start sub_819ADAC -sub_819ADAC: @ 819ADAC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - movs r1, 0x6C - muls r1, r4 - adds r0, r1 - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _0819ADCC - movs r0, 0x65 - b _0819ADCE - .pool -_0819ADCC: - movs r0, 0x64 -_0819ADCE: - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gSprites - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - movs r1, 0x6C - muls r1, r4 - adds r0, r1 - ldrh r0, [r0, 0xE] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ADAC - - thumb_func_start sub_819AE08 -sub_819AE08: @ 819AE08 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r6, r0, r1 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x7 - beq _0819AE64 - cmp r0, 0x7 - bgt _0819AE30 - cmp r0, 0x6 - beq _0819AE36 - b _0819AF50 - .pool -_0819AE30: - cmp r0, 0x8 - beq _0819AEE8 - b _0819AF50 -_0819AE36: - ldr r1, =gPlttBufferUnfaded - ldr r0, =gPlttBufferFaded - movs r2, 0xE4 - lsls r2, 1 - adds r0, r2 - ldrh r0, [r0] - adds r1, r2 - movs r2, 0 - strh r0, [r1] - movs r0, 0x1 - negs r0, r0 - str r2, [sp] - movs r1, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - movs r0, 0x7 - strh r0, [r6, 0x8] - b _0819AF50 - .pool -_0819AE64: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819AF50 - ldr r4, =gUnknown_0300127C - ldr r0, [r4] - ldr r2, =0x000002a1 - adds r0, r2 - ldrb r0, [r0] - bl DestroyTask - ldr r1, [r4] - movs r3, 0xA6 - lsls r3, 2 - adds r0, r1, r3 - ldr r0, [r0] - movs r2, 0xA8 - lsls r2, 2 - adds r1, r2 - bl sub_819F444 - bl sub_819AB40 - ldr r4, =gUnknown_0203CE2C - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE30 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE34 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE38 - ldr r0, [r4] - bl Free - str r5, [r4] - bl FreeAllWindowBuffers - movs r0, 0x8 - strh r0, [r6, 0x8] - b _0819AF50 - .pool -_0819AEE8: - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - ldr r0, =gPlttBufferUnfaded - movs r3, 0xE4 - lsls r3, 1 - adds r0, r3 - ldrh r0, [r0] - adds r3, 0xDC - adds r1, r3 - strh r0, [r1] - adds r0, r2, 0 - bl DestroyTask - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x6] - ldr r0, [r4] - ldrb r6, [r0, 0x3] - ldr r4, =gUnknown_0203CE3C - movs r0, 0x96 - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - movs r4, 0 -_0819AF1A: - ldr r5, =gUnknown_0203CE3C - ldr r1, [r5] - movs r0, 0x64 - muls r0, r4 - adds r0, r1 - ldr r1, =gUnknown_0300127C - ldr r1, [r1] - movs r2, 0x6C - muls r2, r4 - adds r1, r2 - adds r1, 0x14 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _0819AF1A - ldr r1, [r5] - ldr r0, =sub_819A514 - str r0, [sp] - movs r0, 0x1 - adds r2, r6, 0 - movs r3, 0x5 - bl sub_81BF8EC -_0819AF50: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AE08 - - thumb_func_start bc_exit_to_overworld -bc_exit_to_overworld: @ 819AF68 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gUnknown_0300127C - ldr r0, [r7] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819B00E - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _0819AFA0 - cmp r1, 0x1 - beq _0819AFB8 - b _0819B00E - .pool -_0819AFA0: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819B00E -_0819AFB8: - bl UpdatePaletteFade - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819B00E - bl sub_819B764 - ldr r0, [r7] - ldr r1, =0x000002a1 - adds r0, r1 - ldrb r0, [r0] - bl DestroyTask - bl sub_819AB40 - ldr r4, =gUnknown_0203CE2C - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE34 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE38 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r0, [r7] - bl Free - str r5, [r7] - bl FreeAllWindowBuffers - ldr r0, =sub_80861B0 - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask -_0819B00E: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bc_exit_to_overworld - - thumb_func_start sub_819B02C -sub_819B02C: @ 819B02C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r7, =gUnknown_0300127C - ldr r0, [r7] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819B11A - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x5 - beq _0819B084 - cmp r0, 0x5 - bgt _0819B06C - cmp r0, 0x4 - beq _0819B07A - b _0819B11A - .pool -_0819B06C: - cmp r0, 0xA - bne _0819B11A - bl sub_819C4B4 - movs r0, 0x4 - strh r0, [r5, 0x8] - b _0819B11A -_0819B07A: - bl sub_819B8D4 - movs r0, 0x5 - strh r0, [r5, 0x8] - b _0819B11A -_0819B084: - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - mov r8, r0 - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0819B0B8 - movs r0, 0x5 - bl PlaySE - ldr r0, [r7] - ldrb r4, [r0, 0x7] - cmp r4, 0 - bne _0819B0C6 - bl sub_819C568 - strh r4, [r5, 0x8] - ldr r0, =bc_exit_to_overworld - str r0, [r5] - b _0819B11A - .pool -_0819B0B8: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819B0EC - movs r0, 0x5 - bl PlaySE -_0819B0C6: - movs r0, 0x4 - bl sub_819B958 - bl sub_819BC9C - ldr r0, [r7] - ldr r1, =0x000002a2 - adds r0, r1 - mov r1, r8 - strb r1, [r0] - strh r6, [r5, 0x8] - ldr r0, =sub_819B378 - str r0, [r5] - b _0819B11A - .pool -_0819B0EC: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819B106 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - bl sub_819AC78 - b _0819B11A -_0819B106: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819B11A - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl sub_819AC78 -_0819B11A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819B02C - - thumb_func_start sub_819B124 -sub_819B124: @ 819B124 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x8] - subs r0, 0x2 - lsls r0, 16 - asrs r0, 16 - adds r6, r1, 0 - cmp r0, 0xB - bls _0819B144 - b _0819B36E -_0819B144: - lsls r0, 2 - ldr r1, =_0819B158 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819B158: - .4byte _0819B188 - .4byte _0819B1EC - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B1BC - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B300 - .4byte _0819B35C -_0819B188: - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _0819B1A2 - ldr r2, =0x00000299 - adds r0, r1, r2 - movs r7, 0xA8 - lsls r7, 2 - adds r1, r7 - movs r2, 0 - bl sub_819F2B4 -_0819B1A2: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0x9 - b _0819B36C - .pool -_0819B1BC: - ldr r4, =gUnknown_0300127C - ldr r0, [r4] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819B1CE - b _0819B36E -_0819B1CE: - bl sub_819B844 - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x6] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - b _0819B344 - .pool -_0819B1EC: - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r7, 0x1 - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0819B27C - movs r0, 0x5 - bl PlaySE - bl sub_819BC04 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - bne _0819B228 - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldr r2, =0x000002a2 - adds r0, r2 - b _0819B2AC - .pool -_0819B228: - cmp r0, 0x2 - bne _0819B248 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xA - strh r1, [r0, 0x8] - ldr r1, =sub_819B02C - str r1, [r0] - b _0819B36E - .pool -_0819B248: - cmp r1, 0x3 - bne _0819B260 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xB - strh r1, [r0, 0x8] - b _0819B2BA - .pool -_0819B260: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x6 - strh r1, [r0, 0x8] - ldr r1, =sub_819AE08 - str r1, [r0] - b _0819B36E - .pool -_0819B27C: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819B2D0 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r2, 0x8 - adds r1, r2 - movs r2, 0 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819B958 - ldr r0, [r4] - ldr r1, =0x000002a2 - adds r0, r1 -_0819B2AC: - strb r7, [r0] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x8] -_0819B2BA: - ldr r1, =sub_819B378 - str r1, [r0] - b _0819B36E - .pool -_0819B2D0: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819B2EA - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - bl sub_819AC10 - b _0819B36E -_0819B2EA: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819B36E - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl sub_819AC10 - b _0819B36E -_0819B300: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _0819B36E - ldr r4, =gUnknown_0300127C - ldr r2, [r4] - ldrb r0, [r2, 0x6] - cmp r0, 0x1 - bne _0819B338 - ldr r1, =gPlttBufferFaded - movs r7, 0xA9 - lsls r7, 2 - adds r0, r2, r7 - ldrh r0, [r0] - movs r2, 0xE4 - lsls r2, 1 - adds r1, r2 - strh r0, [r1] - ldr r0, =gPlttBufferUnfaded - subs r7, 0xBC - adds r1, r0, r7 - ldrh r1, [r1] - adds r0, r2 - strh r1, [r0] -_0819B338: - ldr r0, [r4] - strb r3, [r0, 0x6] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r6 -_0819B344: - movs r1, 0x3 - strh r1, [r0, 0x8] - b _0819B36E - .pool -_0819B35C: - bl sub_819B844 - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0xC -_0819B36C: - strh r0, [r1, 0x8] -_0819B36E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B124 - - thumb_func_start sub_819B378 -sub_819B378: @ 819B378 - push {r4-r7,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r5, =gUnknown_0300127C - ldr r3, [r5] - movs r7, 0xA8 - lsls r7, 2 - adds r0, r3, r7 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819B476 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0819B3DC - cmp r1, 0x1 - bgt _0819B3B4 - cmp r1, 0 - beq _0819B3BA - b _0819B476 - .pool -_0819B3B4: - cmp r1, 0xB - beq _0819B440 - b _0819B476 -_0819B3BA: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0819B476 - movs r0, 0x1 - movs r1, 0x1 - strh r1, [r4, 0x8] - ldr r2, =0x000002a2 - adds r1, r3, r2 - strb r0, [r1] - b _0819B476 - .pool -_0819B3DC: - ldr r2, =gMain - ldrh r0, [r2, 0x2E] - ands r1, r0 - cmp r1, 0 - beq _0819B40C - movs r0, 0x5 - bl PlaySE - ldr r0, [r5] - ldr r1, =0x000002a2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - movs r0, 0x2 - strh r0, [r4, 0x8] - ldr r0, =sub_819B124 - str r0, [r4] - b _0819B476 - .pool -_0819B40C: - ldrh r1, [r2, 0x30] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819B422 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _0819B432 -_0819B422: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0819B476 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_0819B432: - bl sub_819ABA8 - bl sub_819BCF8 - bl sub_819B9E8 - b _0819B476 -_0819B440: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0819B476 - movs r0, 0x5 - bl PlaySE - ldr r1, [r5] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r1, r7 - movs r2, 0 - bl sub_819F3F8 - bl sub_819BA64 - ldr r0, [r5] - ldr r1, =0x000002a2 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - strh r6, [r4, 0x8] -_0819B476: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B378 - - thumb_func_start sub_819B484 -sub_819B484: @ 819B484 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - movs r6, 0 - add r0, sp, 0xC - strb r6, [r0] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r7, =gSaveBlock2Ptr - ldr r2, [r7] - ldr r0, =0x00000ca9 - adds r4, r2, r0 - ldrb r0, [r4] - lsls r0, 30 - lsrs r0, 30 - adds r5, r0, 0 - lsls r0, r5, 1 - lsls r1, r6, 2 - adds r0, r1 - ldr r1, =0x00000de2 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - ldrb r1, [r4] - movs r0, 0x3 - ands r0, r1 - movs r2, 0x32 - str r2, [sp, 0x14] - cmp r0, 0 - beq _0819B4EA - movs r3, 0x64 - str r3, [sp, 0x14] -_0819B4EA: - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_81A6F70 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - ldr r1, [r7] - ldrb r0, [r1, 0xA] - mov r9, r0 - ldrb r0, [r1, 0xB] - lsls r0, 8 - mov r2, r9 - orrs r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r2, r0 - mov r9, r2 - movs r3, 0 - mov r8, r3 -_0819B518: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 2 - adds r1, r0 - movs r3, 0xE7 - lsls r3, 4 - adds r1, r3 - ldrh r5, [r1] - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldr r2, [sp, 0x10] - add r2, r8 - movs r3, 0x6C - adds r0, r2, 0 - muls r0, r3 - adds r1, r0 - strh r5, [r1, 0xC] - mov r10, r2 - ldr r0, [sp, 0x1C] - cmp r8, r0 - bcs _0819B570 - ldr r0, [sp, 0x18] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _0819B572 - .pool -_0819B570: - ldr r0, [sp, 0x18] -_0819B572: - movs r1, 0 - bl sub_81A6CA8 - lsls r0, 24 - lsrs r6, r0, 24 - movs r1, 0x6C - mov r4, r10 - muls r4, r1 - adds r4, 0xC - ldr r2, =gUnknown_0300127C - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r1, =gUnknown_0203BC8C - ldr r2, [r1] - lsls r5, 4 - adds r2, r5, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - str r6, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - ldr r2, [sp, 0x14] - bl sub_8068634 - movs r1, 0 - add r0, sp, 0xC - strb r1, [r0] - movs r6, 0 - adds r7, r5, 0 - movs r3, 0x1 - add r8, r3 - ldr r3, =gUnknown_0300127C -_0819B5B8: - ldr r0, [r3] - adds r0, r4 - adds r0, 0x8 - ldr r5, =gUnknown_0203BC8C - ldr r1, [r5] - adds r1, r7, r1 - lsls r2, r6, 1 - adds r1, 0x2 - adds r1, r2 - ldrh r1, [r1] - adds r2, r6, 0 - str r3, [sp, 0x20] - bl sub_81A7024 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, [sp, 0x20] - cmp r6, 0x3 - bls _0819B5B8 - movs r0, 0x6C - mov r4, r10 - muls r4, r0 - adds r4, 0xC - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - movs r1, 0x20 - add r2, sp, 0xC - bl SetMonData - ldr r2, =gUnknown_0300127C - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r1, [r5] - adds r1, r7, r1 - ldrb r2, [r1, 0xA] - lsls r2, 1 - ldr r1, =gBattleFrontierHeldItems - adds r2, r1 - movs r1, 0xC - bl SetMonData - mov r3, r8 - lsls r0, r3, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x5 - bhi _0819B620 - b _0819B518 -_0819B620: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B484 - - thumb_func_start sub_819B63C -sub_819B63C: @ 819B63C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - add r0, sp, 0xC - movs r1, 0 - strb r1, [r0] - ldr r2, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons - str r0, [r2] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldrb r3, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r3, r0 - mov r10, r3 - movs r7, 0 - mov r9, r7 -_0819B678: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r2, r9 - lsls r0, r2, 1 - add r0, r9 - lsls r0, 2 - adds r1, r0 - movs r3, 0xE7 - lsls r3, 4 - adds r1, r3 - ldrh r1, [r1] - mov r8, r1 - ldr r7, =gUnknown_0300127C - ldr r0, [r7] - ldr r6, [sp, 0x10] - add r6, r9 - movs r1, 0x6C - adds r4, r6, 0 - muls r4, r1 - adds r1, r0, r4 - mov r2, r8 - strh r2, [r1, 0xC] - adds r4, 0xC - adds r0, r4 - adds r0, 0x8 - ldr r3, =gUnknown_0203BC8C - ldr r2, [r3] - mov r7, r8 - lsls r5, r7, 4 - adds r2, r5, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - movs r7, 0 - str r7, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - mov r2, r10 - str r2, [sp, 0x8] - movs r2, 0x1E - bl sub_8068634 - add r0, sp, 0xC - movs r3, 0 - strb r3, [r0] - movs r0, 0x1 - add r9, r0 -_0819B6D4: - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - ldr r3, =gUnknown_0203BC8C - ldr r2, [r3] - mov r3, r8 - lsls r1, r3, 4 - adds r1, r2 - lsls r2, r7, 1 - adds r1, 0x2 - adds r1, r2 - ldrh r1, [r1] - adds r2, r7, 0 - bl sub_81A7024 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _0819B6D4 - movs r7, 0x6C - adds r4, r6, 0 - muls r4, r7 - adds r4, 0xC - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - movs r1, 0x20 - add r2, sp, 0xC - bl SetMonData - ldr r2, =gUnknown_0300127C - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r3, =gUnknown_0203BC8C - ldr r1, [r3] - adds r1, r5, r1 - ldrb r2, [r1, 0xA] - lsls r2, 1 - ldr r1, =gBattleFrontierHeldItems - adds r2, r1 - movs r1, 0xC - bl SetMonData - mov r7, r9 - lsls r0, r7, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0x5 - bls _0819B678 - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B63C - - thumb_func_start sub_819B764 -sub_819B764: @ 819B764 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r7, 0 - ldr r0, =gUnknown_0300127C - mov r10, r0 - ldr r1, =gSaveBlock2Ptr - mov r8, r1 -_0819B778: - movs r2, 0 - adds r0, r7, 0x1 - mov r9, r0 -_0819B77E: - mov r1, r10 - ldr r0, [r1] - movs r1, 0x6C - adds r6, r2, 0 - muls r6, r1 - adds r1, r0, r6 - ldrb r0, [r1, 0x10] - cmp r0, r9 - bne _0819B81C - movs r0, 0x64 - adds r5, r7, 0 - muls r5, r0 - ldr r2, =gPlayerParty - adds r5, r2 - adds r1, 0x14 - adds r0, r5, 0 - movs r2, 0x64 - bl memcpy - mov r0, r8 - ldr r1, [r0] - lsls r4, r7, 1 - adds r4, r7 - lsls r4, 2 - adds r1, r4 - mov r2, r10 - ldr r0, [r2] - adds r0, r6 - ldrh r0, [r0, 0xC] - movs r2, 0xE7 - lsls r2, 4 - adds r1, r2 - strh r0, [r1] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r2, r8 - ldr r1, [r2] - ldr r2, =0x00000e74 - adds r1, r2 - adds r1, r4 - str r0, [r1] - adds r0, r5, 0 - movs r1, 0x2E - movs r2, 0 - bl pokemon_getattr_encrypted - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e79 - adds r1, r2 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x28 - movs r2, 0 - bl pokemon_getattr_encrypted - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e78 - adds r1, r2 - strb r0, [r1] - b _0819B826 - .pool -_0819B81C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819B77E -_0819B826: - mov r1, r9 - lsls r0, r1, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _0819B778 - bl calc_player_party_count - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819B764 - - thumb_func_start sub_819B844 -sub_819B844: @ 819B844 - push {r4,r5,lr} - ldr r5, =gUnknown_0300127C - ldr r1, [r5] - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _0819B852 - strb r0, [r1] -_0819B852: - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819BAFC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B844 - - thumb_func_start sub_819B8D4 -sub_819B8D4: @ 819B8D4 - push {r4,r5,lr} - ldr r5, =gUnknown_0300127C - ldr r1, [r5] - movs r0, 0 - strb r0, [r1, 0x7] - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r3, 0x70 - strh r3, [r0, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r3, [r0, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819BBA8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B8D4 - - thumb_func_start sub_819B958 -sub_819B958: @ 819B958 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gSprites - ldr r3, =gUnknown_0300127C - ldr r0, [r3] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r3] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - bl ClearWindowTilemap - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B958 - - thumb_func_start sub_819B9B4 -sub_819B9B4: @ 819B9B4 - push {lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EEBB2 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x2 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B9B4 - - thumb_func_start sub_819B9E8 -sub_819B9E8: @ 819B9E8 - push {r4,r5,lr} - sub sp, 0xC - ldr r5, =gUnknown_0300127C - ldr r0, [r5] - ldrb r4, [r0, 0x3] - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x6C - muls r0, r4 - ldr r1, [r5] - adds r0, r1 - adds r0, 0x14 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gStringVar4 - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08610479 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B9E8 - - thumb_func_start sub_819BA64 -sub_819BA64: @ 819BA64 - push {lr} - sub sp, 0xC - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0, 0x5] - cmp r0, 0x1 - bne _0819BA88 - ldr r2, =gUnknown_085EEBC1 - b _0819BA9C - .pool -_0819BA88: - cmp r0, 0x2 - bne _0819BA94 - ldr r2, =gUnknown_085EEBDB - b _0819BA9C - .pool -_0819BA94: - ldr r2, =gUnknown_085EEC2D - cmp r0, 0x3 - bne _0819BA9C - ldr r2, =gUnknown_085EEBF6 -_0819BA9C: - movs r0, 0x5 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0x2 - bl Print - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BA64 - - thumb_func_start sub_819BAC8 -sub_819BAC8: @ 819BAC8 - push {lr} - sub sp, 0xC - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EEC50 - movs r0, 0x5 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0x2 - bl Print - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BAC8 - - thumb_func_start sub_819BAFC -sub_819BAFC: @ 819BAFC - push {r4-r6,lr} - sub sp, 0xC - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r2, [r0, 0x3] - movs r1, 0x6C - muls r1, r2 - adds r0, r1 - ldrb r5, [r0, 0x10] - movs r0, 0x3 - bl PutWindowTilemap - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_08610476 - str r4, [sp] - movs r6, 0 - str r6, [sp, 0x4] - ldr r0, =gUnknown_085EEC15 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl box_print - cmp r5, 0 - beq _0819BB60 - str r4, [sp] - str r6, [sp, 0x4] - ldr r0, =gUnknown_085EEC24 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print - b _0819BB74 - .pool -_0819BB60: - str r4, [sp] - str r5, [sp, 0x4] - ldr r0, =gUnknown_085EEC10 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print -_0819BB74: - ldr r0, =gUnknown_08610476 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085EEC1D - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x21 - bl box_print - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BAFC - - thumb_func_start sub_819BBA8 -sub_819BBA8: @ 819BBA8 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0x4 - bl PutWindowTilemap - movs r0, 0x4 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_08610476 - str r5, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EEC49 - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl box_print - str r5, [sp] - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EEC4D - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print - movs r0, 0x4 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BBA8 - - thumb_func_start sub_819BC04 -sub_819BC04: @ 819BC04 - push {lr} - ldr r2, =gUnknown_030062E8 - ldr r1, =gUnknown_0861041C - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_819BC04 - - thumb_func_start sub_819BC30 -sub_819BC30: @ 819BC30 - push {r4,lr} - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r2, [r0, 0x3] - movs r1, 0x6C - muls r1, r2 - adds r0, r1 - ldrb r1, [r0, 0x10] - ldrh r0, [r0, 0xC] - cmp r1, 0 - bne _0819BC60 - bl sub_819C634 - cmp r0, 0 - bne _0819BC60 - bl sub_819BAC8 - movs r0, 0x3 - bl sub_819B958 - movs r0, 0x3 - b _0819BC96 - .pool -_0819BC60: - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r2, 0x8 - adds r1, r2 - movs r2, 0 - bl sub_819F3F8 - bl sub_819ACE0 - bl sub_819BA64 - movs r0, 0x3 - bl sub_819B958 - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0x3 - bhi _0819BC94 - movs r0, 0x1 - b _0819BC96 - .pool -_0819BC94: - movs r0, 0x2 -_0819BC96: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_819BC30 - - thumb_func_start sub_819BC9C -sub_819BC9C: @ 819BC9C - push {lr} - bl sub_819C568 - bl sub_819ACE0 - bl sub_819BA64 - movs r0, 0x3 - bl sub_819B958 - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0, 0x5] - cmp r0, 0x3 - bhi _0819BCC4 - movs r0, 0x1 - b _0819BCC6 - .pool -_0819BCC4: - movs r0, 0x2 -_0819BCC6: - pop {r1} - bx r1 - thumb_func_end sub_819BC9C - - thumb_func_start sub_819BCCC -sub_819BCCC: @ 819BCCC - movs r0, 0 - bx lr - thumb_func_end sub_819BCCC - - thumb_func_start sub_819BCD0 -sub_819BCD0: @ 819BCD0 - push {lr} - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r2, 0x8 - adds r1, r2 - movs r2, 0 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819B958 - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_819BCD0 - - thumb_func_start sub_819BCF8 -sub_819BCF8: @ 819BCF8 - push {r4,r5,lr} - sub sp, 0x2C - ldr r5, =gUnknown_0300127C - ldr r0, [r5] - ldrb r4, [r0, 0x3] - cmp r4, 0x5 - bhi _0819BD64 - movs r0, 0x5 - bl PutWindowTilemap - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x6C - muls r0, r4 - ldr r1, [r5] - adds r0, r1 - adds r0, 0x14 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - add r1, sp, 0xC - bl sub_81DB468 - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x76 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x5 - movs r1, 0x1 - add r2, sp, 0xC - bl Print - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram -_0819BD64: - add sp, 0x2C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BCF8 - - thumb_func_start sub_819BD70 -sub_819BD70: @ 819BD70 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x10 - ldr r6, =gUnknown_0300127C - ldr r2, [r6] - ldrb r1, [r2, 0x3] - movs r0, 0x6C - adds r4, r1, 0 - muls r4, r0 - adds r4, r2 - adds r4, 0x14 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r8, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - mov r2, r8 - movs r3, 0x1 - bl sub_818D7D8 - ldr r1, [r6] - movs r2, 0xA6 - lsls r2, 2 - adds r1, r2 - movs r3, 0 - strb r0, [r1] - ldr r4, =gSprites - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x28 - strb r3, [r0] - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x29 - strb r3, [r0] - ldr r0, [r6] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - strb r3, [r0] - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BD70 - - thumb_func_start sub_819BE20 -sub_819BE20: @ 819BE20 - ldr r1, =gUnknown_0300127C - ldr r1, [r1] - movs r2, 0xA8 - lsls r2, 2 - adds r1, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_819BE20 - - thumb_func_start sub_819BE34 -sub_819BE34: @ 819BE34 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r0, =gUnknown_08610638 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r6, =gUnknown_0300127C - ldr r1, [r6] - ldr r2, =0x00000299 - mov r10, r2 - add r1, r10 - movs r7, 0 - strb r0, [r1] - ldr r0, [r6] - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - mov r8, r1 - add r0, r8 - movs r1, 0x2 - bl StartSpriteAffineAnim - ldr r2, [r6] - ldrb r1, [r2, 0x3] - movs r0, 0x6C - adds r4, r1, 0 - muls r4, r0 - adds r4, r2 - adds r4, 0x14 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r9, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - mov r2, r9 - movs r3, 0x1 - bl sub_818D7D8 - ldr r1, [r6] - movs r2, 0xA6 - lsls r2, 2 - adds r1, r2 - strb r0, [r1] - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r6] - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BE34 - - thumb_func_start sub_819BF2C -sub_819BF2C: @ 819BF2C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - movs r7, 0 - ldr r0, =gUnknown_0300127C - mov r9, r0 -_0819BF3E: - movs r2, 0 - adds r1, r7, 0x1 - mov r10, r1 - lsls r0, r7, 2 - mov r8, r0 -_0819BF48: - mov r0, r9 - ldr r1, [r0] - movs r0, 0x6C - adds r4, r2, 0 - muls r4, r0 - adds r0, r1, r4 - ldrb r0, [r0, 0x10] - cmp r0, r10 - bne _0819C008 - adds r4, r1 - adds r4, 0x14 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - adds r6, r0, 0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - lsls r0, r7, 3 - adds r0, r7 - lsls r0, 19 - movs r2, 0x80 - lsls r2, 13 - adds r0, r2 - asrs r0, 16 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - adds r0, r7, 0 - adds r0, 0xD - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - adds r2, r6, 0 - movs r3, 0x1 - bl sub_818D7D8 - mov r2, r9 - ldr r1, [r2] - add r1, r8 - movs r2, 0xA5 - lsls r2, 2 - adds r1, r2 - strb r0, [r1] - mov r1, r9 - ldr r0, [r1] - add r0, r8 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r2, =gSprites - adds r0, r2 - adds r0, 0x28 - movs r1, 0 - strb r1, [r0] - mov r2, r9 - ldr r0, [r2] - add r0, r8 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r2, =gSprites - adds r0, r2 - adds r0, 0x29 - movs r1, 0 - strb r1, [r0] - b _0819C012 - .pool -_0819C008: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819BF48 -_0819C012: - mov r2, r10 - lsls r0, r2, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _0819BF3E - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BF2C - - thumb_func_start sub_819C040 -sub_819C040: @ 819C040 - push {r4-r6,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819C0DC - ldr r3, =gSprites - ldr r6, =gUnknown_0300127C - ldr r2, [r6] - ldr r0, =0x00000295 - adds r5, r2, r0 - ldrb r0, [r5] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - adds r1, 0x3F - ldrb r0, [r1] - lsls r0, 26 - cmp r0, 0 - bge _0819C0DC - ldr r1, =0x0000029d - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _0819C0DC - adds r1, r4, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x0000029d - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, =sub_819C1D0 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - ldr r0, =SpriteCallbackDummy - str r0, [r4, 0x1C] -_0819C0DC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C040 - - thumb_func_start sub_819C100 -sub_819C100: @ 819C100 - push {r4-r7,lr} - adds r5, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819C1BA - ldr r6, =gSprites - ldr r4, =gUnknown_0300127C - ldr r2, [r4] - ldr r7, =0x00000295 - adds r0, r2, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _0819C1BA - ldr r1, =0x0000029d - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _0819C1BA - ldrb r0, [r5, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - ldr r0, [r4] - adds r0, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - ldr r0, [r4] - ldr r1, =0x0000029d - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - ldr r0, [r4] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - adds r0, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl DestroySprite - ldr r0, [r4] - ldr r1, =0x0000029d - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl DestroySprite - adds r0, r5, 0 - bl DestroySprite -_0819C1BA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C100 - - thumb_func_start sub_819C1D0 -sub_819C1D0: @ 819C1D0 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0819C24E - cmp r0, 0x1 - bgt _0819C1F8 - cmp r0, 0 - beq _0819C1FE - b _0819C2BA - .pool -_0819C1F8: - cmp r0, 0x2 - beq _0819C270 - b _0819C2BA -_0819C1FE: - movs r0, 0x10 - strh r0, [r4, 0xE] - movs r0, 0xE0 - strh r0, [r4, 0x38] - movs r0, 0x40 - strh r0, [r4, 0x12] - movs r0, 0x41 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x38] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - b _0819C2C6 -_0819C24E: - movs r0, 0x3 - bl ShowBg - ldr r1, =0x00001248 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _0819C2C6 - .pool -_0819C270: - ldrh r0, [r4, 0x12] - subs r0, 0x4 - strh r0, [r4, 0x12] - ldrh r1, [r4, 0x18] - adds r1, 0x4 - strh r1, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - ble _0819C28C - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x5F - ble _0819C29E -_0819C28C: - movs r0, 0x20 - strh r0, [r4, 0x12] - movs r0, 0x60 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits -_0819C29E: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0x20 - bne _0819C2CC - b _0819C2C6 -_0819C2BA: - adds r0, r2, 0 - bl DestroyTask - bl sub_819BF2C - b _0819C2CC -_0819C2C6: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819C2CC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819C1D0 - - thumb_func_start sub_819C2D4 -sub_819C2D4: @ 819C2D4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0819C2F6 - b _0819C410 -_0819C2F6: - cmp r0, 0x1 - bne _0819C2FC - b _0819C460 -_0819C2FC: - movs r0, 0x3 - bl HideBg - ldr r4, =gSprites - ldr r0, =gUnknown_0300127C - mov r8, r0 - ldr r0, [r0] - ldr r1, =0x00000299 - mov r12, r1 - add r0, r12 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r2, [r1] - movs r3, 0x5 - negs r3, r3 - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - mov r0, r8 - ldr r2, [r0] - mov r1, r12 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r6, r4, 0 - adds r6, 0x1C - adds r0, r6 - ldr r1, =sub_819C100 - str r1, [r0] - ldr r0, =0x00000295 - mov r9, r0 - add r2, r9 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r3, 0 - ands r1, r2 - strb r1, [r0] - mov r1, r8 - ldr r2, [r1] - mov r1, r9 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r1, =SpriteCallbackDummy - mov r10, r1 - str r1, [r0] - ldr r5, =0x0000029d - adds r2, r5 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - mov r0, r8 - ldr r2, [r0] - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r10 - str r1, [r0] - add r2, r12 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAffineAnim - mov r1, r8 - ldr r0, [r1] - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAffineAnim - mov r1, r8 - ldr r0, [r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAffineAnim - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits - adds r0, r7, 0 - bl DestroyTask - b _0819C4A4 - .pool -_0819C410: - movs r0, 0x10 - strh r0, [r4, 0xE] - movs r0, 0xE0 - strh r0, [r4, 0x38] - movs r0, 0x20 - strh r0, [r4, 0x12] - movs r0, 0x60 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x38] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - b _0819C49E -_0819C460: - ldrh r0, [r4, 0x12] - adds r0, 0x4 - strh r0, [r4, 0x12] - ldrh r1, [r4, 0x18] - subs r1, 0x4 - strh r1, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - bgt _0819C47C - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x41 - bgt _0819C484 -_0819C47C: - movs r0, 0x40 - strh r0, [r4, 0x12] - movs r0, 0x41 - strh r0, [r4, 0x18] -_0819C484: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - bne _0819C4A4 -_0819C49E: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819C4A4: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819C2D4 - - thumb_func_start sub_819C4B4 -sub_819C4B4: @ 819C4B4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r4, =gUnknown_08610638 - adds r0, r4, 0 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r6, =gUnknown_0300127C - ldr r1, [r6] - ldr r2, =0x00000299 - mov r8, r2 - add r1, r8 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2C - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r6] - ldr r5, =0x00000295 - adds r1, r5 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0xC4 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r6] - ldr r4, =0x0000029d - adds r1, r4 - strb r0, [r1] - ldr r3, =gSprites - ldr r2, [r6] - add r8, r2 - mov r0, r8 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, 0x1C - adds r0, r3 - ldr r1, =sub_819C040 - str r1, [r0] - adds r5, r2, r5 - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r5, =SpriteCallbackDummy - str r5, [r0] - adds r4, r2, r4 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - str r5, [r0] - movs r0, 0xA8 - lsls r0, 2 - adds r2, r0 - movs r0, 0x1 - strb r0, [r2] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C4B4 - - thumb_func_start sub_819C568 -sub_819C568: @ 819C568 - push {r4,lr} - ldr r4, =gUnknown_0300127C - ldr r0, [r4] - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - bl sub_818D820 - ldr r0, [r4] - movs r1, 0xA6 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - bl sub_818D820 - ldr r0, [r4] - movs r1, 0xA7 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - bl sub_818D820 - ldr r0, =sub_819C2D4 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - ldr r0, [r4] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C568 - - thumb_func_start sub_819C5D0 -sub_819C5D0: @ 819C5D0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r0, 0 - adds r6, r1, 0 - adds r5, r2, 0 - mov r8, r3 - lsls r4, 16 - lsrs r4, 16 - lsls r6, 16 - lsrs r6, 16 - lsls r5, 16 - lsrs r5, 16 - mov r0, r8 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - lsls r4, 24 - lsrs r4, 16 - orrs r4, r6 - movs r0, 0x40 - adds r1, r4, 0 - bl SetGpuReg - lsls r5, 24 - lsrs r5, 16 - mov r0, r8 - orrs r5, r0 - movs r0, 0x44 - adds r1, r5, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819C5D0 - - thumb_func_start sub_819C634 -sub_819C634: @ 819C634 - push {r4-r7,lr} - lsls r0, 16 - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - lsrs r0, 12 - adds r0, r1 - ldrh r6, [r0] - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r5, [r0, 0x5] - movs r3, 0x1 - cmp r3, r5 - bcs _0819C694 - adds r4, r0, 0 - movs r0, 0x6C - mov r12, r0 - adds r7, r2, 0 -_0819C656: - movs r2, 0 -_0819C658: - mov r0, r12 - muls r0, r2 - adds r1, r4, r0 - ldrb r0, [r1, 0x10] - cmp r0, r3 - bne _0819C680 - ldrh r0, [r1, 0xC] - ldr r1, [r7] - lsls r0, 4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r6 - bne _0819C68A - movs r0, 0 - b _0819C696 - .pool -_0819C680: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819C658 -_0819C68A: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r5 - bcc _0819C656 -_0819C694: - movs r0, 0x1 -_0819C696: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_819C634 - - thumb_func_start sub_819C69C -sub_819C69C: @ 819C69C - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r0, 0x8 - ldrsh r2, [r5, r0] - cmp r2, 0x1 - beq _0819C6F8 - cmp r2, 0x1 - bgt _0819C6C4 - cmp r2, 0 - beq _0819C6CA - b _0819C7D8 - .pool -_0819C6C4: - cmp r2, 0x2 - beq _0819C7B4 - b _0819C7D8 -_0819C6CA: - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - ldr r3, =0x000002a7 - adds r0, r3 - strb r2, [r0] - ldr r0, [r1] - adds r3, 0x1 - adds r0, r3 - strb r2, [r0] - ldr r0, [r1] - ldr r1, =0x000002a6 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - strh r1, [r5, 0x8] - b _0819C7D8 - .pool -_0819C6F8: - ldr r0, =gUnknown_0300127C - ldr r3, [r0] - ldr r2, =0x000002a2 - adds r1, r3, r2 - ldrb r1, [r1] - adds r7, r0, 0 - cmp r1, 0 - beq _0819C7D8 - ldr r1, =0x000002a9 - adds r0, r3, r1 - ldrb r4, [r0] - cmp r4, 0 - beq _0819C724 - movs r0, 0x2 - strh r0, [r5, 0x8] - b _0819C7D8 - .pool -_0819C724: - ldr r2, =0x000002a7 - adds r1, r3, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r7] - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x6 - bls _0819C764 - strb r4, [r1] - ldr r1, [r7] - subs r2, 0x1 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _0819C758 - movs r3, 0xAA - lsls r3, 2 - adds r1, r3 - ldrb r0, [r1] - subs r0, 0x1 - b _0819C762 - .pool -_0819C758: - movs r0, 0xAA - lsls r0, 2 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 -_0819C762: - strb r0, [r1] -_0819C764: - movs r0, 0x80 - lsls r0, 7 - ldr r1, [r7] - movs r4, 0xAA - lsls r4, 2 - adds r1, r4 - ldrb r1, [r1] - movs r2, 0 - bl BlendPalettes - ldr r2, [r7] - adds r4, r2, r4 - ldrb r0, [r4] - cmp r0, 0x5 - bls _0819C790 - ldr r3, =0x000002a6 - adds r1, r2, r3 - movs r0, 0 - b _0819C7D6 - .pool -_0819C790: - cmp r0, 0 - bne _0819C7D8 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x8] - ldr r0, =0x000002a6 - adds r1, r2, r0 - movs r0, 0x1 - b _0819C7D6 - .pool -_0819C7B4: - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldr r2, =0x000002a9 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xE - bls _0819C7D4 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - strh r0, [r5, 0x8] - b _0819C7D8 - .pool -_0819C7D4: - adds r0, 0x1 -_0819C7D6: - strb r0, [r1] -_0819C7D8: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819C69C - - thumb_func_start sub_819C7E0 -sub_819C7E0: @ 819C7E0 - push {lr} - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_819C7E0 - - thumb_func_start sub_819C7FC -sub_819C7FC: @ 819C7FC - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_819C7FC - - thumb_func_start sub_819C810 -sub_819C810: @ 819C810 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - ldr r4, =gPlayerParty - ldr r5, =gUnknown_03001284 - ldr r1, [r5] - ldrb r0, [r1, 0x12] - movs r6, 0x64 - muls r0, r6 - adds r0, r4 - ldr r2, =gEnemyParty - mov r9, r2 - ldrb r1, [r1, 0x13] - muls r1, r6 - add r1, r9 - movs r2, 0x64 - bl memcpy - movs r1, 0 - mov r0, sp - strb r1, [r0] - ldr r0, [r5] - ldrb r0, [r0, 0x12] - muls r0, r6 - adds r0, r4 - movs r1, 0x20 - mov r2, sp - bl SetMonData - ldr r3, =gSaveBlock2Ptr - mov r8, r3 - ldr r3, [r3] - ldr r4, [r5] - ldrb r0, [r4, 0x12] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r2, r3, r2 - ldrb r1, [r4, 0x13] - adds r1, 0x3 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3, r0 - movs r1, 0xE7 - lsls r1, 4 - adds r0, r1 - ldrh r0, [r0] - adds r2, r1 - strh r0, [r2] - ldrb r0, [r4, 0x12] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r2, r3, r2 - ldrb r1, [r4, 0x13] - adds r1, 0x3 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - ldr r0, =0x00000e78 - adds r3, r0 - ldrb r1, [r3] - adds r2, r0 - strb r1, [r2] - ldr r0, [r5] - ldrb r0, [r0, 0x13] - muls r0, r6 - add r0, r9 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r1, r8 - ldr r2, [r1] - ldr r4, [r5] - ldrb r3, [r4, 0x12] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - ldr r3, =0x00000e74 - adds r2, r3 - adds r2, r1 - str r0, [r2] - ldrb r0, [r4, 0x13] - muls r0, r6 - add r0, r9 - movs r1, 0x2E - movs r2, 0 - bl pokemon_getattr_encrypted - mov r1, r8 - ldr r2, [r1] - ldr r1, [r5] - ldrb r3, [r1, 0x12] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - adds r2, r1 - ldr r3, =0x00000e79 - adds r2, r3 - strb r0, [r2] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C810 - - thumb_func_start sub_819C90C -sub_819C90C: @ 819C90C - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r6, r0, r1 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x7 - beq _0819C950 - cmp r0, 0x7 - bgt _0819C934 - cmp r0, 0x6 - beq _0819C93A - b _0819C9F0 - .pool -_0819C934: - cmp r0, 0x8 - beq _0819C9C4 - b _0819C9F0 -_0819C93A: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - movs r0, 0x7 - strh r0, [r6, 0x8] - b _0819C9F0 -_0819C950: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819C9F0 - ldr r4, =gUnknown_03001284 - ldr r0, [r4] - adds r0, 0x21 - ldrb r0, [r0] - bl DestroyTask - ldr r1, [r4] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - bl sub_819F444 - bl sub_819E538 - ldr r4, =gUnknown_0203CE40 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE44 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE48 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE4C - ldr r0, [r4] - bl Free - str r5, [r4] - bl FreeAllWindowBuffers - movs r0, 0x8 - strh r0, [r6, 0x8] - b _0819C9F0 - .pool -_0819C9C4: - adds r0, r2, 0 - bl DestroyTask - ldr r2, =gUnknown_03001284 - ldr r1, [r2] - movs r0, 0x1 - strb r0, [r1, 0x15] - ldr r2, [r2] - ldr r0, =gPlttBufferUnfaded - movs r1, 0xF4 - lsls r1, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2, 0x24] - ldr r1, =gPlayerParty - ldrb r2, [r2, 0x3] - ldr r0, =sub_819DC1C - str r0, [sp] - movs r0, 0 - movs r3, 0x2 - bl sub_81BF8EC -_0819C9F0: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C90C - - thumb_func_start sub_819CA08 -sub_819CA08: @ 819CA08 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gUnknown_03001284 - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CAFE - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0819CA78 - cmp r1, 0x1 - bgt _0819CA44 - cmp r1, 0 - beq _0819CA4E - b _0819CAFE - .pool -_0819CA44: - cmp r1, 0x2 - beq _0819CA8C - cmp r1, 0x3 - beq _0819CAA4 - b _0819CAFE -_0819CA4E: - adds r0, r2, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819CA68 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldr r0, =gScriptResult - strh r1, [r0] - b _0819CAFE - .pool -_0819CA68: - movs r0, 0x2 - strh r0, [r4, 0x8] - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - b _0819CAFE - .pool -_0819CA78: - adds r0, r2, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819CA9C - ldrb r0, [r2, 0x3] - strb r0, [r2, 0x13] - bl sub_819C810 - b _0819CA9C -_0819CA8C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade -_0819CA9C: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819CAFE -_0819CAA4: - bl UpdatePaletteFade - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819CAFE - ldr r0, [r7] - adds r0, 0x21 - ldrb r0, [r0] - bl DestroyTask - bl sub_819E538 - ldr r4, =gUnknown_0203CE40 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE44 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE48 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE4C - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r0, [r7] - bl Free - str r5, [r7] - bl FreeAllWindowBuffers - ldr r0, =sub_80861B0 - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask -_0819CAFE: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CA08 - - thumb_func_start sub_819CB1C -sub_819CB1C: @ 819CB1C - push {r4-r7,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r7, =gUnknown_03001284 - ldr r0, [r7] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CBD6 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - beq _0819CB50 - cmp r0, 0x5 - beq _0819CB5A - b _0819CBD6 - .pool -_0819CB50: - bl sub_819E9E0 - movs r0, 0x5 - strh r0, [r4, 0x8] - b _0819CBD6 -_0819CB5A: - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r6, 0x1 - adds r5, r6, 0 - ands r5, r1 - cmp r5, 0 - beq _0819CB86 - movs r0, 0x5 - bl PlaySE - ldr r0, [r7] - ldrb r0, [r0, 0x16] - cmp r0, 0 - bne _0819CB80 - strh r6, [r4, 0xA] - b _0819CB9C - .pool -_0819CB80: - movs r0, 0 - strh r0, [r4, 0xA] - b _0819CB96 -_0819CB86: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819CBA8 - movs r0, 0x5 - bl PlaySE - strh r5, [r4, 0xA] -_0819CB96: - movs r0, 0x4 - bl sub_819EA64 -_0819CB9C: - ldrh r0, [r4, 0x14] - ldrh r1, [r4, 0x16] - lsls r0, 16 - orrs r0, r1 - str r0, [r4] - b _0819CBD6 -_0819CBA8: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819CBC2 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - bl sub_819E758 - b _0819CBD6 -_0819CBC2: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819CBD6 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl sub_819E758 -_0819CBD6: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819CB1C - - thumb_func_start sub_819CBDC -sub_819CBDC: @ 819CBDC - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r2, r1, r2 - movs r1, 0xA - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _0819CC04 - movs r0, 0 - strh r0, [r2, 0x8] - ldr r0, =sub_819CA08 - b _0819CC16 - .pool -_0819CC04: - movs r0, 0 - strh r0, [r2, 0x8] - ldr r1, =sub_819CE40 - lsrs r0, r1, 16 - strh r0, [r2, 0x14] - strh r1, [r2, 0x16] - movs r0, 0x1 - strh r0, [r2, 0x12] - ldr r0, =sub_819D770 -_0819CC16: - str r0, [r2] - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CBDC - - thumb_func_start sub_819CC24 -sub_819CC24: @ 819CC24 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _0819CC5A - ldr r0, =gUnknown_085EECBB - bl sub_819EBEC - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x20 - strb r5, [r0] - movs r0, 0x4 - strh r0, [r4, 0x8] - ldr r1, =sub_819CBDC - lsrs r0, r1, 16 - strh r0, [r4, 0x14] - strh r1, [r4, 0x16] - ldr r0, =sub_819CB1C - str r0, [r4] -_0819CC5A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CC24 - - thumb_func_start sub_819CC74 -sub_819CC74: @ 819CC74 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0xA - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _0819CCB0 - movs r0, 0 - strh r0, [r2, 0x8] - ldr r0, =sub_819CA08 - b _0819CCC2 - .pool -_0819CCB0: - movs r0, 0 - strh r0, [r2, 0x8] - ldr r1, =sub_819CE40 - lsrs r0, r1, 16 - strh r0, [r2, 0x14] - strh r1, [r2, 0x16] - movs r0, 0x1 - strh r0, [r2, 0x12] - ldr r0, =sub_819D770 -_0819CCC2: - str r0, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CC74 - - thumb_func_start sub_819CCD4 -sub_819CCD4: @ 819CCD4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0819CD1A - ldr r4, =gUnknown_03001284 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x2D - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F2B4 - ldr r0, =gUnknown_085EECF0 - bl sub_819EBEC - ldr r0, [r4] - adds r0, 0x20 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0x4 - strh r0, [r5, 0x8] - ldr r1, =sub_819CC74 - lsrs r0, r1, 16 - strh r0, [r5, 0x14] - strh r1, [r5, 0x16] - ldr r0, =sub_819CB1C - str r0, [r5] -_0819CD1A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CCD4 - - thumb_func_start sub_819CD34 -sub_819CD34: @ 819CD34 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x3 - beq _0819CDA4 - cmp r0, 0x3 - bgt _0819CD60 - cmp r0, 0x2 - beq _0819CD66 - b _0819CE36 - .pool -_0819CD60: - cmp r0, 0x9 - beq _0819CD88 - b _0819CE36 -_0819CD66: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x15] - cmp r0, 0 - bne _0819CD7C - adds r0, r1, 0 - adds r0, 0x2D - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F2B4 -_0819CD7C: - movs r0, 0x9 - strh r0, [r5, 0x8] - b _0819CE36 - .pool -_0819CD88: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CE36 - bl sub_819E944 - movs r0, 0x3 - strh r0, [r5, 0x8] - b _0819CE36 - .pool -_0819CDA4: - ldr r7, =gUnknown_03001284 - ldr r0, [r7] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CE36 - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - mov r8, r0 - mov r4, r8 - ands r4, r1 - cmp r4, 0 - beq _0819CDD8 - movs r0, 0x5 - bl PlaySE - adds r0, r6, 0 - bl sub_819F0A0 - b _0819CE36 - .pool -_0819CDD8: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819CE14 - movs r0, 0x5 - bl PlaySE - ldr r1, [r7] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819EA64 - strh r4, [r5, 0x8] - ldr r1, =sub_819CE40 - lsrs r0, r1, 16 - strh r0, [r5, 0x14] - strh r1, [r5, 0x16] - mov r1, r8 - strh r1, [r5, 0x12] - ldr r0, =sub_819D770 - str r0, [r5] - b _0819CE36 - .pool -_0819CE14: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819CE28 - movs r0, 0x1 - negs r0, r0 - bl sub_819E7C0 - b _0819CE36 -_0819CE28: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819CE36 - movs r0, 0x1 - bl sub_819E7C0 -_0819CE36: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819CD34 - - thumb_func_start sub_819CE40 -sub_819CE40: @ 819CE40 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0819CE64 - cmp r0, 0x1 - beq _0819CE88 - b _0819CF4C - .pool -_0819CE64: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0819CF4C - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0x1 - strb r1, [r0] - strh r1, [r4, 0x8] - b _0819CF4C - .pool -_0819CE88: - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - adds r5, r1, 0 - ands r5, r0 - cmp r5, 0 - beq _0819CEBC - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0 - strb r1, [r0] - bl sub_819EE08 - bl sub_819EAC0 - adds r0, r6, 0 - bl sub_819F184 - b _0819CF4C - .pool -_0819CEBC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819CEF8 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - strb r5, [r0] - bl sub_819EE08 - bl sub_819EAC0 - ldr r1, =sub_819CC24 - lsrs r0, r1, 16 - strh r0, [r4, 0x14] - strh r1, [r4, 0x16] - strh r5, [r4, 0x8] - strh r5, [r4, 0x12] - ldr r0, =sub_819D588 - str r0, [r4] - b _0819CF4C - .pool -_0819CEF8: - ldrh r1, [r2, 0x30] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819CF0C - movs r0, 0x1 - negs r0, r0 - bl sub_819E694 - b _0819CF2A -_0819CF0C: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0819CF1C - movs r0, 0x1 - bl sub_819E694 - b _0819CF2A -_0819CF1C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819CF34 - movs r0, 0x1 - bl sub_819E6E8 -_0819CF2A: - bl sub_819EFA8 - bl sub_819EB4C - b _0819CF4C -_0819CF34: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819CF4C - movs r0, 0x1 - negs r0, r0 - bl sub_819E6E8 - bl sub_819EFA8 - bl sub_819EB4C -_0819CF4C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819CE40 - - thumb_func_start sub_819CF54 -sub_819CF54: @ 819CF54 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r2, [r4, r0] - cmp r2, 0x1 - beq _0819CFA0 - cmp r2, 0x1 - bgt _0819CF7C - cmp r2, 0 - beq _0819CF82 - b _0819D05C - .pool -_0819CF7C: - cmp r2, 0x2 - beq _0819D03C - b _0819D05C -_0819CF82: - ldr r1, =gUnknown_03001284 - ldr r0, [r1] - adds r0, 0x27 - strb r2, [r0] - ldr r0, [r1] - adds r0, 0x28 - strb r2, [r0] - ldr r0, [r1] - adds r0, 0x26 - movs r1, 0x1 - strb r1, [r0] - strh r1, [r4, 0x8] - b _0819D05C - .pool -_0819CFA0: - ldr r1, =gUnknown_03001284 - ldr r2, [r1] - adds r0, r2, 0 - adds r0, 0x22 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0 - beq _0819D05C - adds r0, r2, 0 - adds r0, 0x29 - ldrb r3, [r0] - cmp r3, 0 - beq _0819CFC4 - movs r0, 0x2 - strh r0, [r4, 0x8] - b _0819D05C - .pool -_0819CFC4: - adds r1, r2, 0 - adds r1, 0x27 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x27 - ldrb r0, [r1] - cmp r0, 0x6 - bls _0819CFF8 - strb r3, [r1] - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x26 - ldrb r0, [r0] - cmp r0, 0 - bne _0819CFF0 - adds r1, 0x28 - ldrb r0, [r1] - subs r0, 0x1 - b _0819CFF6 -_0819CFF0: - adds r1, 0x28 - ldrb r0, [r1] - adds r0, 0x1 -_0819CFF6: - strb r0, [r1] -_0819CFF8: - movs r0, 0x80 - lsls r0, 7 - ldr r1, [r6] - adds r1, 0x28 - ldrb r1, [r1] - movs r2, 0 - bl BlendPalettes - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x28 - ldrb r0, [r0] - cmp r0, 0x5 - bls _0819D01C - adds r1, r2, 0 - adds r1, 0x26 - movs r0, 0 - b _0819D05A -_0819D01C: - cmp r0, 0 - bne _0819D05C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x8] - adds r1, r2, 0 - adds r1, 0x26 - movs r0, 0x1 - b _0819D05A - .pool -_0819D03C: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x29 - ldrb r0, [r1] - cmp r0, 0xE - bls _0819D058 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - strh r0, [r4, 0x8] - b _0819D05C - .pool -_0819D058: - adds r0, 0x1 -_0819D05A: - strb r0, [r1] -_0819D05C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819CF54 - - thumb_func_start sub_819D064 -sub_819D064: @ 819D064 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0819D0A4 - cmp r1, 0x1 - bgt _0819D08C - cmp r1, 0 - beq _0819D092 - b _0819D118 - .pool -_0819D08C: - cmp r1, 0x2 - beq _0819D0BC - b _0819D118 -_0819D092: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x27 - strb r1, [r0] - strh r1, [r4, 0x10] - b _0819D0AE - .pool -_0819D0A4: - ldr r0, =gPlttBufferUnfaded+ 0x1E0 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette -_0819D0AE: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819D118 - .pool -_0819D0BC: - ldr r2, =gUnknown_03001284 - ldr r0, [r2] - adds r0, 0x28 - ldrb r0, [r0] - cmp r0, 0xF - bls _0819D0D2 - movs r0, 0x1 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819D0D2: - ldr r1, [r2] - adds r1, 0x27 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - adds r1, r0, 0 - adds r1, 0x27 - ldrb r0, [r1] - cmp r0, 0x3 - bls _0819D108 - movs r0, 0 - strb r0, [r1] - ldr r1, =gPlttBufferUnfaded - ldr r0, =gPlttBufferFaded - movs r3, 0xE4 - lsls r3, 1 - adds r0, r3 - ldrh r0, [r0] - adds r3, 0x20 - adds r1, r3 - strh r0, [r1] - ldr r1, [r2] - adds r1, 0x28 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0819D108: - movs r0, 0x80 - lsls r0, 7 - ldr r1, [r2] - adds r1, 0x28 - ldrb r1, [r1] - movs r2, 0 - bl BlendPalettes -_0819D118: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D064 - - thumb_func_start sub_819D12C -sub_819D12C: @ 819D12C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - ldr r1, =gTasks - lsls r0, 2 - ldr r2, [sp] - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r2, 0x8 - ldrsh r3, [r4, r2] - cmp r3, 0 - beq _0819D15C - cmp r3, 0x1 - beq _0819D168 - b _0819D310 - .pool -_0819D15C: - strh r3, [r4, 0xA] - strh r3, [r4, 0xC] - strh r3, [r4, 0xE] - movs r0, 0x1 - strh r0, [r4, 0x8] - b _0819D310 -_0819D168: - movs r3, 0 - str r3, [sp, 0x4] - movs r1, 0x2 - str r0, [sp, 0x8] - ldr r0, =gTasks - str r0, [sp, 0xC] -_0819D174: - lsls r0, r1, 24 - asrs r4, r0, 24 - mov r9, r0 - cmp r4, 0x2 - beq _0819D1F2 - ldr r2, =gSprites - ldr r3, =gUnknown_03001284 - ldr r0, [r3] - adds r0, 0x5 - mov r8, r0 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r6, r0, r2 - ldrh r1, [r6, 0x20] - mov r12, r1 - mov r7, r12 - ldr r1, [sp, 0x4] - subs r0, r1, r7 - lsls r0, 24 - lsrs r5, r0, 24 - mov r10, r2 - cmp r5, 0x10 - beq _0819D1BE - adds r0, r4, 0x2 - lsls r0, 1 - ldr r2, [sp, 0x8] - adds r0, r2 - ldr r1, =gTasks - adds r1, 0x8 - adds r0, r1 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0x1 - bne _0819D1D8 -_0819D1BE: - lsls r0, r7, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - mov r0, r12 - adds r0, 0xA - strh r0, [r6, 0x20] - b _0819D210 - .pool -_0819D1D8: - cmp r5, 0x10 - bls _0819D210 - adds r0, r4, 0x1 - add r0, r8 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrh r0, [r0, 0x20] - subs r0, 0x30 - strh r0, [r6, 0x20] - b _0819D210 -_0819D1F2: - ldr r3, =gSprites - ldr r4, =gUnknown_03001284 - ldr r0, [r4] - ldrb r1, [r0, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r2, [r0, 0x20] - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - adds r2, 0xA - strh r2, [r0, 0x20] - mov r10, r3 -_0819D210: - mov r0, r9 - asrs r2, r0, 24 - adds r0, r2, 0x1 - lsls r0, 1 - ldr r1, [sp, 0x8] - adds r0, r1 - ldr r1, =gTasks - adds r1, 0x8 - adds r0, r1 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0x1 - bne _0819D26A - ldr r1, =gUnknown_03001284 - ldr r0, [r1] - adds r0, 0x5 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r3, r10 - adds r1, r0, r3 - movs r0, 0x20 - ldrsh r3, [r1, r0] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 4 - adds r0, 0x48 - cmp r3, r0 - ble _0819D260 - strh r0, [r1, 0x20] - movs r7, 0x1 - b _0819D26C - .pool -_0819D260: - movs r7, 0 - cmp r3, r0 - bne _0819D26C - movs r7, 0x1 - b _0819D26C -_0819D26A: - movs r7, 0 -_0819D26C: - mov r6, r10 - ldr r5, =gUnknown_03001284 - ldr r2, [r5] - mov r1, r9 - asrs r4, r1, 24 - adds r0, r2, 0x5 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r6 - movs r3, 0x20 - ldrsh r0, [r1, r3] - subs r0, 0x10 - cmp r0, 0xF0 - ble _0819D2F8 - ldrh r0, [r1, 0x20] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldr r0, =0x0000fff0 - strh r0, [r1, 0x20] - ldrb r0, [r2, 0x14] - cmp r0, 0x1 - bne _0819D2C0 - movs r0, 0x65 - bl IndexOfSpritePaletteTag - ldr r1, [r5] - adds r1, 0x5 - adds r1, r4 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r6 - b _0819D2D8 - .pool -_0819D2C0: - movs r0, 0x64 - bl IndexOfSpritePaletteTag - ldr r2, =gUnknown_03001284 - ldr r1, [r2] - adds r1, 0x5 - adds r1, r4 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - add r2, r10 -_0819D2D8: - lsls r0, 4 - ldrb r3, [r2, 0x5] - movs r1, 0xF - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x5] - mov r3, r9 - asrs r0, r3, 23 - adds r0, 0x2 - ldr r1, [sp, 0x8] - adds r0, r1 - ldr r2, [sp, 0xC] - adds r2, 0x8 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0] -_0819D2F8: - movs r0, 0xFF - lsls r0, 24 - add r0, r9 - lsrs r1, r0, 24 - cmp r0, 0 - blt _0819D306 - b _0819D174 -_0819D306: - cmp r7, 0x1 - bne _0819D310 - ldr r0, [sp] - bl DestroyTask -_0819D310: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D12C - - thumb_func_start sub_819D324 -sub_819D324: @ 819D324 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0 - mov r8, r0 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r2, r0, r1 - ldrb r4, [r2, 0xE] - movs r0, 0xC - ldrsh r5, [r2, r0] - mov r10, r1 - cmp r5, 0x1 - bne _0819D352 - lsls r0, r4, 24 - negs r0, r0 - lsrs r4, r0, 24 -_0819D352: - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0819D368 - cmp r0, 0x1 - bne _0819D360 - b _0819D480 -_0819D360: - b _0819D570 - .pool -_0819D368: - ldr r3, =gSprites - ldr r2, =gUnknown_03001284 - ldr r0, [r2] - ldrb r1, [r0, 0x8] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x20] - cmp r5, 0 - bne _0819D39C - lsls r0, 16 - asrs r0, 16 - lsls r2, r4, 24 - asrs r1, r2, 24 - adds r0, r1 - movs r1, 0x1 - cmp r0, 0xEF - ble _0819D3B2 - movs r1, 0 - movs r0, 0xF0 - b _0819D3B0 - .pool -_0819D39C: - lsls r0, 16 - asrs r0, 16 - lsls r2, r4, 24 - asrs r1, r2, 24 - adds r0, r1 - movs r1, 0x1 - cmp r0, 0xA0 - bgt _0819D3B2 - movs r1, 0 - movs r0, 0xA0 -_0819D3B0: - mov r8, r0 -_0819D3B2: - cmp r1, 0x1 - bne _0819D3FC - movs r3, 0 - ldr r7, =gSprites - ldr r6, =gUnknown_03001284 - asrs r5, r2, 24 -_0819D3BE: - movs r4, 0 - adds r2, r3, 0x1 -_0819D3C2: - ldr r1, [r6] - lsls r0, r4, 1 - adds r0, r4 - adds r0, r3, r0 - adds r1, 0x8 - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, r5 - strh r1, [r0, 0x20] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819D3C2 - lsls r0, r2, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _0819D3BE - b _0819D570 - .pool -_0819D3FC: - movs r4, 0 - lsls r1, r7, 2 - mov r12, r1 - mov r6, r8 - adds r6, 0x10 - movs r0, 0x30 - add r0, r8 - mov r9, r0 - ldr r5, =gSprites -_0819D40E: - ldr r1, =gUnknown_03001284 - ldr r2, [r1] - lsls r3, r4, 1 - adds r3, r4 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x20] - adds r0, r2, 0 - adds r0, 0x9 - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x20] - adds r2, 0xA - adds r2, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r9 - strh r1, [r0, 0x20] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819D40E - mov r1, r12 - adds r0, r1, r7 - lsls r0, 3 - add r0, r10 - ldrb r1, [r0, 0xA] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - add r0, r10 - movs r1, 0x1 - strh r1, [r0, 0xE] - adds r0, r7, 0 - bl DestroyTask - b _0819D570 - .pool -_0819D480: - ldr r2, =gSprites - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r1, [r0, 0xE] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x20] - cmp r5, 0 - bne _0819D4B4 - lsls r0, 16 - asrs r0, 16 - lsls r2, r4, 24 - asrs r1, r2, 24 - adds r0, r1 - movs r1, 0x1 - cmp r0, 0xEF - ble _0819D4CA - movs r1, 0 - movs r0, 0xF0 - b _0819D4C8 - .pool -_0819D4B4: - lsls r0, 16 - asrs r0, 16 - lsls r2, r4, 24 - asrs r1, r2, 24 - adds r0, r1 - movs r1, 0x1 - cmp r0, 0xC0 - bgt _0819D4CA - movs r1, 0 - movs r0, 0xC0 -_0819D4C8: - mov r8, r0 -_0819D4CA: - cmp r1, 0x1 - bne _0819D510 - movs r3, 0 - ldr r7, =gSprites - ldr r6, =gUnknown_03001284 - asrs r5, r2, 24 -_0819D4D6: - movs r4, 0 - adds r2, r3, 0x1 -_0819D4DA: - ldr r0, [r6] - lsls r1, r4, 1 - adds r1, r3, r1 - adds r0, 0xE - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, r5 - strh r1, [r0, 0x20] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819D4DA - lsls r0, r2, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bls _0819D4D6 - b _0819D570 - .pool -_0819D510: - movs r4, 0 - lsls r1, r7, 2 - mov r12, r1 - mov r6, r8 - adds r6, 0x10 - ldr r5, =gSprites - ldr r0, =gUnknown_03001284 - mov r9, r0 -_0819D520: - mov r1, r9 - ldr r2, [r1] - lsls r3, r4, 1 - adds r0, r2, 0 - adds r0, 0xE - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x20] - adds r2, 0xF - adds r2, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x20] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819D520 - mov r1, r12 - adds r0, r1, r7 - lsls r0, 3 - add r0, r10 - ldrb r1, [r0, 0xA] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - add r0, r10 - movs r1, 0x1 - strh r1, [r0, 0x10] - adds r0, r7, 0 - bl DestroyTask -_0819D570: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D324 - - thumb_func_start sub_819D588 -sub_819D588: @ 819D588 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - mov r8, r1 - cmp r0, 0x5 - bls _0819D5AA - b _0819D762 -_0819D5AA: - lsls r0, 2 - ldr r1, =_0819D5BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819D5BC: - .4byte _0819D5D4 - .4byte _0819D5F0 - .4byte _0819D60C - .4byte _0819D63C - .4byte _0819D6F0 - .4byte _0819D73A -_0819D5D4: - ldr r0, =gUnknown_08610918 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette - bl sub_819ED34 - movs r0, 0x5 - bl PutWindowTilemap - b _0819D622 - .pool -_0819D5F0: - movs r0, 0x3 - bl sub_819EA64 - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0819D762 - .pool -_0819D60C: - movs r0, 0x80 - lsls r0, 7 - ldr r1, =gUnknown_0860F13C - adds r1, 0x4A - ldrh r1, [r1] - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade -_0819D622: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _0819D762 - .pool -_0819D63C: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _0819D64E - b _0819D762 -_0819D64E: - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0x1 - bne _0819D6B0 - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r2, r5, 2 - adds r2, r5 - lsls r2, 3 - adds r2, r1 - strh r6, [r2, 0xE] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0xA] - strh r6, [r0, 0x8] - strh r6, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - movs r0, 0x5 - strh r0, [r2, 0xC] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _0819D762 - .pool -_0819D6B0: - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, =gTasks - lsls r2, r5, 2 - adds r2, r5 - lsls r2, 3 - adds r2, r3 - movs r1, 0x1 - strh r1, [r2, 0xE] - strh r6, [r2, 0x10] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - strh r5, [r0, 0xA] - strh r1, [r0, 0x8] - strh r6, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - ldrh r0, [r2, 0x8] - adds r0, 0x2 - strh r0, [r2, 0x8] - b _0819D762 - .pool -_0819D6F0: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - mov r1, r8 - adds r6, r0, r1 - ldrh r0, [r6, 0xC] - movs r2, 0xC - ldrsh r7, [r6, r2] - cmp r7, 0 - bne _0819D734 - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - strh r7, [r6, 0x10] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - add r0, r8 - strh r5, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0x8] - strh r7, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _0819D762 - .pool -_0819D734: - subs r0, 0x1 - strh r0, [r6, 0xC] - b _0819D762 -_0819D73A: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - mov r1, r8 - adds r2, r0, r1 - movs r1, 0xE - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _0819D762 - movs r1, 0x10 - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _0819D762 - ldrh r0, [r2, 0x12] - strh r0, [r2, 0x8] - ldrh r0, [r2, 0x14] - ldrh r1, [r2, 0x16] - lsls r0, 16 - orrs r0, r1 - str r0, [r2] -_0819D762: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819D588 - - thumb_func_start sub_819D770 -sub_819D770: @ 819D770 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gUnknown_03001284 - ldr r0, [r1] - adds r0, 0x30 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x1 - bne _0819D78C - b _0819D9D8 -_0819D78C: - ldr r0, =gTasks - lsls r2, r6, 2 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - movs r4, 0x8 - ldrsh r1, [r1, r4] - mov r8, r0 - adds r5, r2, 0 - cmp r1, 0x8 - bls _0819D7A4 - b _0819D9D8 -_0819D7A4: - lsls r0, r1, 2 - ldr r1, =_0819D7BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819D7BC: - .4byte _0819D7E0 - .4byte _0819D868 - .4byte _0819D8AE - .4byte _0819D8F4 - .4byte _0819D910 - .4byte _0819D928 - .4byte _0819D936 - .4byte _0819D948 - .4byte _0819D9B0 -_0819D7E0: - ldr r0, [r3] - ldrb r7, [r0, 0x14] - cmp r7, 0x1 - bne _0819D828 - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, =gTasks - adds r2, r5, r6 - lsls r2, 3 - adds r2, r3 - movs r1, 0 - strh r1, [r2, 0xE] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - strh r6, [r0, 0xA] - strh r1, [r0, 0x8] - strh r7, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - movs r0, 0xA - strh r0, [r2, 0xC] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _0819D9D8 - .pool -_0819D828: - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, =gTasks - adds r2, r5, r6 - lsls r2, 3 - adds r2, r3 - movs r0, 0 - movs r1, 0x1 - strh r1, [r2, 0xE] - strh r0, [r2, 0x10] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - strh r6, [r0, 0xA] - strh r1, [r0, 0x8] - strh r1, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - ldrh r0, [r2, 0x8] - adds r0, 0x2 - strh r0, [r2, 0x8] - b _0819D9D8 - .pool -_0819D868: - adds r0, r5, r6 - lsls r0, 3 - mov r1, r8 - adds r5, r0, r1 - ldrh r0, [r5, 0xC] - movs r2, 0xC - ldrsh r7, [r5, r2] - cmp r7, 0 - bne _0819D8A8 - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - strh r7, [r5, 0x10] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - add r0, r8 - strh r6, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0x8] - strh r1, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _0819D9D8 - .pool -_0819D8A8: - subs r0, 0x1 - strh r0, [r5, 0xC] - b _0819D9D8 -_0819D8AE: - adds r0, r5, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0x1 - beq _0819D8C0 - b _0819D9D8 -_0819D8C0: - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0819D8CA - b _0819D9D8 -_0819D8CA: - ldr r1, =gPlttBufferFaded - ldr r0, =gUnknown_0860F13C - adds r0, 0x4A - ldrh r0, [r0] - movs r2, 0xE2 - lsls r2, 1 - adds r1, r2 - strh r0, [r1] - bl sub_819ED34 - movs r0, 0x5 - bl PutWindowTilemap - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819D9D8 - .pool -_0819D8F4: - movs r0, 0x80 - lsls r0, 7 - ldr r1, =gUnknown_0860F13C - adds r1, 0x4A - ldrh r1, [r1] - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - b _0819D990 - .pool -_0819D910: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0819D9D8 - movs r0, 0 - bl sub_819EDBC - b _0819D990 - .pool -_0819D928: - movs r0, 0x1 - bl sub_819EDBC - movs r0, 0x3 - bl PutWindowTilemap - b _0819D990 -_0819D936: - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - b _0819D990 -_0819D948: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _0819D964 - ldr r0, =gUnknown_085EEC73 - bl sub_819EBEC - b _0819D96A - .pool -_0819D964: - ldr r0, =gUnknown_085EEC8B - bl sub_819EBEC -_0819D96A: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - cmp r0, 0x2 - bhi _0819D98C - ldr r2, =gSprites - ldrb r1, [r1, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] -_0819D98C: - bl sub_819EFA8 -_0819D990: - ldr r0, =gTasks - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0819D9D8 - .pool -_0819D9B0: - bl sub_819EEF0 - bl sub_819EADC - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0x1 - strb r1, [r0] - ldr r1, =gTasks - adds r0, r5, r6 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x12] - strh r1, [r0, 0x8] - ldrh r1, [r0, 0x14] - ldrh r2, [r0, 0x16] - lsls r1, 16 - orrs r1, r2 - str r1, [r0] -_0819D9D8: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D770 - - thumb_func_start sub_819D9EC -sub_819D9EC: @ 819D9EC - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819DA00 - b _0819DBCA -_0819DA00: - ldr r0, =gTasks - lsls r2, r6, 2 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - movs r3, 0x8 - ldrsh r1, [r1, r3] - adds r3, r0, 0 - adds r7, r2, 0 - cmp r1, 0x4 - bls _0819DA18 - b _0819DBCA -_0819DA18: - lsls r0, r1, 2 - ldr r1, =_0819DA30 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819DA30: - .4byte _0819DA44 - .4byte _0819DA58 - .4byte _0819DA8C - .4byte _0819DABC - .4byte _0819DBB0 -_0819DA44: - bl sub_819EEF0 - ldr r0, =gTasks - adds r1, r7, r6 - lsls r1, 3 - adds r1, r0 - b _0819DB96 - .pool -_0819DA58: - bl sub_819EADC - ldr r2, =gSprites - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, =gTasks - adds r1, r7, r6 - lsls r1, 3 - adds r1, r0 - b _0819DB96 - .pool -_0819DA8C: - ldr r0, =sub_819D12C - movs r1, 0 - bl CreateTask - ldr r2, =gTasks - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_819D064 - str r1, [r0] - b _0819DB90 - .pool -_0819DABC: - ldr r0, =sub_819D12C - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - beq _0819DACA - b _0819DBCA -_0819DACA: - ldr r2, =gTasks - ldr r4, =gUnknown_03001284 - ldr r0, [r4] - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x10 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - bne _0819DBCA - bl sub_819EAC0 - ldr r0, [r4] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _0819DB04 - movs r0, 0x1 - bl sub_819F048 - b _0819DB32 - .pool -_0819DB04: - movs r0, 0 - bl sub_819F048 - movs r2, 0 - ldr r5, =gSprites - movs r3, 0x4 -_0819DB10: - ldr r0, [r4] - adds r0, 0xB - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _0819DB10 -_0819DB32: - ldr r5, =gSprites - ldr r4, =gUnknown_03001284 - ldr r3, [r4] - ldrb r0, [r3, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r0, r3, 0x5 - ldrb r2, [r3, 0x3] - adds r0, r2 - ldrb r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - ldrh r0, [r0, 0x20] - movs r5, 0 - strh r0, [r1, 0x20] - ldr r2, =gTasks - adds r0, r3, 0 - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_819CF54 - str r1, [r0] - adds r3, 0x27 - strb r5, [r3] - ldr r0, [r4] - adds r0, 0x28 - movs r1, 0x6 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x26 - strb r5, [r0] - ldr r0, [r4] - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x8] -_0819DB90: - adds r1, r7, r6 - lsls r1, 3 - adds r1, r2 -_0819DB96: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0819DBCA - .pool -_0819DBB0: - adds r0, r7, r6 - lsls r0, 3 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x8] - ldr r2, =sub_819CE40 - lsrs r1, r2, 16 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x12] - ldr r1, =sub_819D770 - str r1, [r0] -_0819DBCA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D9EC - - thumb_func_start sub_819DBD8 -sub_819DBD8: @ 819DBD8 - push {r4,r5,lr} - ldr r5, =gUnknown_03001284 - ldr r4, [r5] - cmp r4, 0 - bne _0819DBF6 - movs r0, 0x34 - bl AllocZeroed - str r0, [r5] - strb r4, [r0, 0x3] - ldr r0, [r5] - adds r0, 0x30 - strb r4, [r0] - ldr r0, [r5] - strb r4, [r0, 0x15] -_0819DBF6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819DBD8 - - thumb_func_start sub_819DC00 -sub_819DC00: @ 819DC00 - push {lr} - ldr r0, =gUnknown_03001284 - movs r1, 0 - str r1, [r0] - ldr r0, =sub_819DC1C - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_819DC00 - - thumb_func_start sub_819DC1C -sub_819DC1C: @ 819DC1C - push {r4-r6,lr} - sub sp, 0xC - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xF - bls _0819DC32 - b _0819E0AA -_0819DC32: - lsls r0, 2 - ldr r1, =_0819DC44 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819DC44: - .4byte _0819DC84 - .4byte _0819DCD4 - .4byte _0819DDA8 - .4byte _0819DE68 - .4byte _0819DE94 - .4byte _0819DECC - .4byte _0819DEEC - .4byte _0819DF10 - .4byte _0819DF30 - .4byte _0819DF3C - .4byte _0819DF64 - .4byte _0819DF70 - .4byte _0819DF78 - .4byte _0819DF8C - .4byte _0819DFA4 - .4byte _0819E01C -_0819DC84: - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x8 - bl CpuSet - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_086108B8 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_086108C8 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DCD4: - ldr r5, =gUnknown_0203CE40 - movs r4, 0x88 - lsls r4, 3 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203CE44 - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - ldr r5, =gUnknown_0203CE48 - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203CE4C - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - b _0819E006 - .pool -_0819DDA8: - bl ResetPaletteFade - bl ResetSpriteData - bl ResetTasks - bl FreeAllSpritePalettes - bl dp13_810BB8C - ldr r0, =gUnknown_08DC0754 - ldr r5, =gUnknown_0203CE40 - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 2 - bl CpuSet - ldr r0, =gUnknown_0861033C - ldr r4, =gUnknown_0203CE44 - ldr r1, [r4] - movs r2, 0x30 - bl CpuSet - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 3 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTiles - ldr r1, [r4] - movs r0, 0x3 - movs r2, 0x60 - movs r3, 0 - bl LoadBgTiles - ldr r0, =gUnknown_08DC0B94 - ldr r4, =gUnknown_0203CE48 - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 3 - bl CpuSet - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 4 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTilemap - ldr r0, =gUnknown_08DC0714 - movs r1, 0 - movs r2, 0x40 - bl LoadPalette - ldr r4, =gUnknown_08610918 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA - bl LoadPalette - adds r0, r4, 0 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette - ldr r0, =gUnknown_0861039C - movs r1, 0x20 - movs r2, 0x4 - bl LoadPalette - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DE68: - ldr r0, =gUnknown_0203CE4C - ldr r1, [r0] - movs r0, 0x3 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_0861023C - movs r0, 0x8 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x3 - movs r2, 0xB - movs r3, 0x4 - bl CopyToBgTilemapBufferRect - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _0819E006 - .pool -_0819DE94: - ldr r0, =gUnknown_086106B0 - bl LoadSpritePalettes - ldr r0, =gUnknown_08610650 - bl LoadSpriteSheets - ldr r0, =gUnknown_086106A0 - bl LoadCompressedObjectPic - ldr r0, =sub_819C7FC - bl SetVBlankCallback - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DECC: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x15] - cmp r0, 0x1 - bne _0819DEDC - ldr r0, =gUnknown_0203CF20 - ldrb r0, [r0] - strb r0, [r1, 0x3] -_0819DEDC: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _0819E00E - .pool -_0819DEEC: - bl sub_819DBD8 - bl sub_819E0C0 - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0x1 - bne _0819DF02 - bl sub_819F304 -_0819DF02: - movs r0, 0 - bl sub_819F048 - b _0819E006 - .pool -_0819DF10: - ldr r0, =gUnknown_085EEC73 - bl sub_819EBEC - movs r0, 0x2 - bl PutWindowTilemap - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DF30: - bl sub_819EFA8 - movs r0, 0x8 - bl PutWindowTilemap - b _0819E006 -_0819DF3C: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0 - bne _0819DF4A - bl sub_819EB4C -_0819DF4A: - movs r0, 0x1 - bl PutWindowTilemap - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DF64: - bl sub_819EB18 - movs r0, 0 - bl PutWindowTilemap - b _0819E006 -_0819DF70: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _0819E00E -_0819DF78: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0 - beq _0819E006 - bl sub_819EE08 - b _0819E006 - .pool -_0819DF8C: - bl sub_819ED78 - movs r0, 0x3 - bl PutWindowTilemap - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DFA4: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0x1 - bne _0819E000 - movs r0, 0x3 - bl ShowBg - ldr r1, =0x00001248 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _0819E006 - .pool -_0819E000: - movs r0, 0x3 - bl HideBg -_0819E006: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_0819E00E: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0819E0AA - .pool -_0819E01C: - ldr r0, =sub_819CF54 - movs r1, 0 - bl CreateTask - ldr r6, =gUnknown_03001284 - ldr r1, [r6] - adds r1, 0x21 - strb r0, [r1] - ldr r0, [r6] - ldrb r5, [r0, 0x15] - cmp r5, 0 - bne _0819E06C - ldr r4, =gTasks - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r5, [r0, 0x8] - ldr r0, =sub_819CE40 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r5, [r0, 0x8] - b _0819E0A4 - .pool -_0819E06C: - bl sub_819EAF8 - ldr r4, =gTasks - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r3, 0 - movs r1, 0x1 - strh r1, [r0, 0x8] - adds r2, 0x22 - strb r3, [r2] - ldr r0, =sub_819CD34 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x8] -_0819E0A4: - ldr r0, =sub_819C7E0 - bl SetMainCallback2 -_0819E0AA: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819DC1C - - thumb_func_start sub_819E0C0 -sub_819E0C0: @ 819E0C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - mov r1, sp - ldr r0, =gUnknown_08610834 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r5,r6} - stm r1!, {r2,r5,r6} - mov r1, sp - movs r0, 0x65 - strh r0, [r1, 0x2] - movs r6, 0 - ldr r4, =gUnknown_03001284 - movs r7, 0 - ldr r5, =gSprites -_0819E0E6: - lsls r1, r6, 1 - adds r1, r6 - lsls r1, 20 - movs r3, 0x90 - lsls r3, 15 - adds r1, r3 - asrs r1, 16 - mov r0, sp - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r4] - adds r1, 0x5 - adds r1, r6 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0x5 - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r7, [r0, 0x2E] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _0819E0E6 - ldr r7, =gUnknown_03001284 - ldr r1, [r7] - adds r0, r1, 0x5 - ldrb r1, [r1, 0x3] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - movs r5, 0x20 - ldrsh r1, [r0, r5] - ldr r0, =gUnknown_0861084C - movs r2, 0x58 - movs r3, 0 - bl CreateSprite - ldr r1, [r7] - movs r4, 0 - strb r0, [r1, 0x4] - ldr r0, =gUnknown_08610864 - movs r1, 0xB0 - movs r2, 0x70 - movs r3, 0 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x1] - ldr r0, =gUnknown_0861087C - movs r1, 0xB0 - movs r2, 0x90 - movs r3, 0 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x2] - ldr r0, [r7] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r6, =gSprites - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x28 - strb r4, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x29 - strb r4, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x28 - strb r4, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x29 - strb r4, [r0] - ldr r0, [r7] - ldrb r0, [r0, 0x15] - movs r1, 0xC0 - str r1, [sp, 0x18] - cmp r0, 0x1 - bne _0819E1E8 - movs r2, 0xF0 - str r2, [sp, 0x18] -_0819E1E8: - mov r1, sp - ldr r0, =gUnknown_0861084C - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - mov r0, sp - movs r4, 0x68 - mov r10, r4 - mov r5, r10 - strh r5, [r0] - movs r1, 0xF0 - movs r2, 0x78 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x8] - mov r1, sp - ldr r0, =gUnknown_08610864 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r4-r6} - stm r1!, {r4-r6} - mov r0, sp - movs r1, 0x69 - mov r9, r1 - mov r2, r9 - strh r2, [r0] - movs r4, 0x80 - lsls r4, 1 - adds r1, r4, 0 - movs r2, 0x78 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x9] - movs r5, 0x90 - lsls r5, 1 - mov r0, sp - adds r1, r5, 0 - movs r2, 0x78 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xA] - mov r1, sp - ldr r0, =gUnknown_0861084C - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - mov r0, sp - movs r3, 0x6A - mov r8, r3 - mov r6, r8 - strh r6, [r0] - movs r1, 0xF0 - movs r2, 0x78 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xB] - mov r1, sp - ldr r0, =gUnknown_08610864 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - mov r1, sp - movs r0, 0x6B - strh r0, [r1] - mov r0, sp - adds r1, r4, 0 - movs r2, 0x78 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xC] - mov r0, sp - movs r6, 0x6C - strh r6, [r0] - adds r1, r5, 0 - movs r2, 0x78 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xD] - mov r1, sp - ldr r0, =gUnknown_0861084C - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r0, sp - mov r4, r10 - strh r4, [r0] - ldr r1, [sp, 0x18] - movs r2, 0x90 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xE] - mov r1, sp - ldr r0, =gUnknown_08610864 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r4,r5} - stm r1!, {r2,r4,r5} - mov r0, sp - mov r3, r9 - strh r3, [r0] - ldr r4, [sp, 0x18] - adds r4, 0x10 - adds r1, r4, 0 - movs r2, 0x90 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xF] - mov r1, sp - ldr r0, =gUnknown_0861084C - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r0, sp - mov r5, r8 - strh r5, [r0] - ldr r1, [sp, 0x18] - movs r2, 0x90 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x10] - mov r1, sp - ldr r0, =gUnknown_08610864 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r0, sp - strh r6, [r0] - adds r1, r4, 0 - movs r2, 0x90 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x11] - movs r6, 0 - ldr r5, =gSprites - adds r4, r7, 0 - movs r7, 0 - movs r0, 0x4 - mov r10, r0 -_0819E330: - ldr r0, [r4] - lsls r3, r6, 1 - adds r2, r3, r6 - adds r0, 0x8 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0x8 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0x9 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0x9 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xA - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xA - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xE - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xE - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xF - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xF - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0x8 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - mov r8, r0 - ldrb r1, [r0] - mov r0, r10 - orrs r1, r0 - mov r0, r8 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x9 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - mov r8, r0 - ldrb r1, [r0] - mov r0, r10 - orrs r1, r0 - mov r0, r8 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0xA - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - mov r2, r10 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0xE - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0xF - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, =gUnknown_03001284 - mov r8, r3 - ldr r0, =gSprites - mov r9, r0 - cmp r6, 0x1 - bhi _0819E496 - b _0819E330 -_0819E496: - ldr r0, [r3] - ldrb r0, [r0, 0xE] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r9 - adds r1, 0x3E - ldrb r2, [r1] - movs r3, 0x5 - negs r3, r3 - adds r0, r3, 0 - b _0819E4C8 - .pool -_0819E4C8: - ands r0, r2 - strb r0, [r1] - mov r1, r8 - ldr r0, [r1] - ldrb r1, [r0, 0xF] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r3, 0 - ands r1, r2 - strb r1, [r0] - mov r2, r8 - ldr r0, [r2] - ldrb r1, [r0, 0x8] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r3, 0 - ands r1, r2 - strb r1, [r0] - mov r4, r8 - ldr r0, [r4] - ldrb r1, [r0, 0x9] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r3, 0 - ands r1, r2 - strb r1, [r0] - ldr r0, [r4] - ldrb r1, [r0, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819E0C0 - - thumb_func_start sub_819E538 -sub_819E538: @ 819E538 - push {r4-r7,lr} - movs r5, 0 -_0819E53C: - ldr r6, =gUnknown_03001284 - ldr r0, [r6] - adds r0, 0x5 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl DestroySprite - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _0819E53C - ldr r0, [r6] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - movs r5, 0 -_0819E590: - movs r4, 0 - lsls r6, r5, 1 -_0819E594: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r1, r6, r5 - adds r1, r4, r1 - adds r0, 0x8 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0819E594 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _0819E590 - movs r5, 0 -_0819E5C6: - movs r4, 0 - adds r7, r5, 0x1 - lsls r6, r5, 1 -_0819E5CC: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r1, r4, r6 - adds r0, 0xE - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819E5CC - lsls r0, r7, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _0819E5C6 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E538 - - thumb_func_start sub_819E608 -sub_819E608: @ 819E608 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bhi _0819E65C - ldr r4, =gSprites - ldr r5, =gUnknown_03001284 - ldr r0, [r5] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - bl sub_819E8EC - ldr r0, [r5] - ldrb r2, [r0, 0x4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - adds r0, 0x5 - adds r0, r6 - ldrb r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x20] - strh r0, [r1, 0x20] - b _0819E684 - .pool -_0819E65C: - ldr r2, =gSprites - ldr r3, =gUnknown_03001284 - ldr r0, [r3] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r3] - ldr r1, [r0, 0x18] - lsls r0, r6, 3 - adds r0, r1 - ldrb r0, [r0] - bl sub_819E838 -_0819E684: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E608 - - thumb_func_start sub_819E694 -sub_819E694: @ 819E694 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - lsls r4, 24 - cmp r4, 0 - ble _0819E6C0 - ldr r1, =gUnknown_03001284 - ldr r2, [r1] - ldrb r0, [r2, 0x3] - adds r0, 0x1 - ldrb r3, [r2, 0x17] - cmp r0, r3 - bne _0819E6D8 - movs r0, 0 - b _0819E6D8 - .pool -_0819E6C0: - ldr r0, =gUnknown_03001284 - ldr r2, [r0] - ldrb r3, [r2, 0x3] - adds r1, r0, 0 - cmp r3, 0 - beq _0819E6D4 - subs r0, r3, 0x1 - b _0819E6D8 - .pool -_0819E6D4: - ldrb r0, [r2, 0x17] - subs r0, 0x1 -_0819E6D8: - strb r0, [r2, 0x3] - ldr r0, [r1] - ldrb r0, [r0, 0x3] - bl sub_819E608 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819E694 - - thumb_func_start sub_819E6E8 -sub_819E6E8: @ 819E6E8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - lsls r4, 24 - cmp r4, 0 - ble _0819E728 - ldr r0, =gUnknown_03001284 - ldr r2, [r0] - ldrb r1, [r2, 0x3] - adds r4, r0, 0 - cmp r1, 0x2 - bhi _0819E714 - movs r0, 0x3 - strb r0, [r2, 0x3] - b _0819E74A - .pool -_0819E714: - ldrb r0, [r2, 0x3] - adds r0, 0x1 - ldrb r1, [r2, 0x17] - cmp r0, r1 - beq _0819E722 - strb r0, [r2, 0x3] - b _0819E74A -_0819E722: - movs r0, 0 - strb r0, [r2, 0x3] - b _0819E74A -_0819E728: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1, 0x3] - adds r2, r3, 0 - adds r4, r0, 0 - cmp r2, 0x2 - bls _0819E744 - cmp r2, 0 - beq _0819E744 - subs r0, r3, 0x1 - b _0819E748 - .pool -_0819E744: - ldrb r0, [r1, 0x17] - subs r0, 0x1 -_0819E748: - strb r0, [r1, 0x3] -_0819E74A: - ldr r0, [r4] - ldrb r0, [r0, 0x3] - bl sub_819E608 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819E6E8 - - thumb_func_start sub_819E758 -sub_819E758: @ 819E758 - push {lr} - lsls r0, 24 - cmp r0, 0 - ble _0819E778 - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1, 0x16] - adds r2, r0, 0 - cmp r3, 0x1 - beq _0819E774 - adds r0, r3, 0x1 - b _0819E78E - .pool -_0819E774: - movs r0, 0 - b _0819E78E -_0819E778: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1, 0x16] - adds r2, r0, 0 - cmp r3, 0 - beq _0819E78C - subs r0, r3, 0x1 - b _0819E78E - .pool -_0819E78C: - movs r0, 0x1 -_0819E78E: - strb r0, [r1, 0x16] - ldr r3, =gSprites - ldr r2, [r2] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2, 0x16] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2, 0x16] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E758 - - thumb_func_start sub_819E7C0 -sub_819E7C0: @ 819E7C0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - lsls r4, 24 - cmp r4, 0 - ble _0819E7EC - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1] - adds r2, r0, 0 - cmp r3, 0x2 - beq _0819E7E8 - adds r0, r3, 0x1 - b _0819E802 - .pool -_0819E7E8: - movs r0, 0 - b _0819E802 -_0819E7EC: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1] - adds r2, r0, 0 - cmp r3, 0 - beq _0819E800 - subs r0, r3, 0x1 - b _0819E802 - .pool -_0819E800: - movs r0, 0x2 -_0819E802: - strb r0, [r1] - ldr r3, =gSprites - ldr r2, [r2] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E7C0 - - thumb_func_start sub_819E838 -sub_819E838: @ 819E838 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - movs r0, 0x5 - negs r0, r0 - mov r9, r0 - movs r2, 0x4 - mov r8, r2 - ldr r0, =gSprites - mov r12, r0 - ldr r7, =gUnknown_03001284 -_0819E856: - cmp r6, 0x2 - bne _0819E898 - ldr r5, =gSprites - ldr r3, =gUnknown_03001284 - ldr r0, [r3] - adds r0, 0xB - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r2, [r1] - mov r0, r9 - ands r0, r2 - strb r0, [r1] - cmp r4, 0x1 - bhi _0819E8D4 - ldr r0, [r3] - adds r0, 0x10 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - b _0819E8CA - .pool -_0819E898: - cmp r6, 0x3 - bne _0819E8D4 - cmp r4, 0x1 - bhi _0819E8BA - ldr r0, [r7] - adds r0, 0x10 - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r12 - adds r1, 0x3E - ldrb r2, [r1] - mov r0, r9 - ands r0, r2 - strb r0, [r1] -_0819E8BA: - ldr r0, [r7] - adds r0, 0xB - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r12 -_0819E8CA: - adds r0, 0x3E - ldrb r1, [r0] - mov r2, r8 - orrs r1, r2 - strb r1, [r0] -_0819E8D4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0819E856 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819E838 - - thumb_func_start sub_819E8EC -sub_819E8EC: @ 819E8EC - push {r4-r6,lr} - movs r2, 0 - ldr r5, =gSprites - ldr r4, =gUnknown_03001284 - adds r6, r5, 0 - movs r3, 0x4 -_0819E8F8: - ldr r0, [r4] - adds r0, 0xB - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - cmp r2, 0x1 - bhi _0819E92C - ldr r0, [r4] - adds r0, 0x10 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] -_0819E92C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _0819E8F8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E8EC - - thumb_func_start sub_819E944 -sub_819E944: @ 819E944 - push {r4,r5,lr} - ldr r0, =gUnknown_03001284 - ldr r3, [r0] - ldrb r1, [r3, 0x15] - adds r5, r0, 0 - cmp r1, 0x1 - bne _0819E95C - movs r0, 0 - strb r0, [r3, 0x15] - b _0819E960 - .pool -_0819E95C: - movs r0, 0 - strb r0, [r3] -_0819E960: - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819EC20 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E944 - - thumb_func_start sub_819E9E0 -sub_819E9E0: @ 819E9E0 - push {r4,r5,lr} - ldr r5, =gUnknown_03001284 - ldr r1, [r5] - movs r0, 0 - strb r0, [r1, 0x16] - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r3, 0x70 - strh r3, [r0, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r3, [r0, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819EC94 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E9E0 - - thumb_func_start sub_819EA64 -sub_819EA64: @ 819EA64 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gSprites - ldr r3, =gUnknown_03001284 - ldr r0, [r3] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r3] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - bl ClearWindowTilemap - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EA64 - - thumb_func_start sub_819EAC0 -sub_819EAC0: @ 819EAC0 - push {lr} - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_819EAC0 - - thumb_func_start sub_819EADC -sub_819EADC: @ 819EADC - push {lr} - movs r0, 0x7 - bl PutWindowTilemap - movs r0, 0x7 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x7 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_819EADC - - thumb_func_start sub_819EAF8 -sub_819EAF8: @ 819EAF8 - push {lr} - bl sub_819EAC0 - movs r0, 0x5 - bl PutWindowTilemap - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_819EAF8 - - thumb_func_start sub_819EB18 -sub_819EB18: @ 819EB18 - push {lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EEC66 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x2 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EB18 - - thumb_func_start sub_819EB4C -sub_819EB4C: @ 819EB4C - push {r4,lr} - sub sp, 0xC - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - cmp r0, 0x2 - bls _0819EB70 - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - b _0819EBD4 - .pool -_0819EB70: - ldrb r2, [r1, 0x3] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819EB84 - movs r0, 0x64 - muls r0, r2 - ldr r1, =gPlayerParty - b _0819EB8A - .pool -_0819EB84: - movs r0, 0x64 - muls r0, r2 - ldr r1, =gEnemyParty -_0819EB8A: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - ldr r4, =gStringVar4 - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08610925 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram -_0819EBD4: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EB4C - - thumb_func_start sub_819EBEC -sub_819EBEC: @ 819EBEC - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x2 - bl Print - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819EBEC - - thumb_func_start sub_819EC20 -sub_819EC20: @ 819EC20 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0x3 - bl PutWindowTilemap - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_08610922 - str r5, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECAA - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0xF - movs r3, 0x1 - bl box_print - str r5, [sp] - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECA5 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0xF - movs r3, 0x11 - bl box_print - str r5, [sp] - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECB2 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0xF - movs r3, 0x21 - bl box_print - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EC20 - - thumb_func_start sub_819EC94 -sub_819EC94: @ 819EC94 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0x4 - bl PutWindowTilemap - movs r0, 0x4 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_08610922 - str r5, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECCA - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl box_print - str r5, [sp] - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECCE - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print - movs r0, 0x4 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EC94 - - thumb_func_start sub_819ECF0 -sub_819ECF0: @ 819ECF0 - push {r4-r6,lr} - sub sp, 0xC - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - movs r0, 0 - adds r1, r6, 0 - movs r2, 0x46 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_08610922 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0 - adds r3, r5, 0 - bl box_print - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ECF0 - - thumb_func_start sub_819ED34 -sub_819ED34: @ 819ED34 - push {lr} - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0 - beq _0819ED56 - cmp r0, 0x1 - bne _0819ED60 - ldr r0, =gUnknown_085EECD1 - movs r1, 0 - movs r2, 0x5 - bl sub_819ECF0 -_0819ED56: - ldr r0, =gUnknown_085EECDD - movs r1, 0x18 - movs r2, 0x5 - bl sub_819ECF0 -_0819ED60: - movs r0, 0x5 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ED34 - - thumb_func_start sub_819ED78 -sub_819ED78: @ 819ED78 - push {lr} - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0 - beq _0819ED9A - cmp r0, 0x1 - bne _0819EDA4 - ldr r0, =gUnknown_085EECD1 - movs r1, 0x8 - movs r2, 0x3 - bl sub_819ECF0 -_0819ED9A: - ldr r0, =gUnknown_085EECDD - movs r1, 0x20 - movs r2, 0x3 - bl sub_819ECF0 -_0819EDA4: - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ED78 - - thumb_func_start sub_819EDBC -sub_819EDBC: @ 819EDBC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0819EDCC - cmp r0, 0x1 - beq _0819EDEC - b _0819EDF6 -_0819EDCC: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0x1 - bne _0819EDF6 - ldr r0, =gUnknown_085EECD1 - movs r1, 0x8 - movs r2, 0x3 - bl sub_819ECF0 - b _0819EDF6 - .pool -_0819EDEC: - ldr r0, =gUnknown_085EECDD - movs r1, 0x20 - movs r2, 0x3 - bl sub_819ECF0 -_0819EDF6: - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EDBC - - thumb_func_start sub_819EE08 -sub_819EE08: @ 819EE08 - push {r4,lr} - sub sp, 0x18 - ldr r0, =gUnknown_08610918 - add r1, sp, 0xC - movs r2, 0x4 - bl CpuSet - ldr r0, =gUnknown_03001284 - ldr r2, [r0] - ldrb r0, [r2, 0x15] - cmp r0, 0 - bne _0819EE3C - add r0, sp, 0xC - ldr r1, =gPlttBufferFaded - movs r2, 0xE4 - lsls r2, 1 - adds r1, r2 - ldrh r1, [r1] - strh r1, [r0, 0x8] - b _0819EE42 - .pool -_0819EE3C: - add r1, sp, 0xC - ldrh r0, [r2, 0x24] - strh r0, [r1, 0x8] -_0819EE42: - add r0, sp, 0xC - movs r1, 0xF0 - movs r2, 0xA - bl LoadPalette - movs r0, 0x7 - bl PutWindowTilemap - movs r0, 0x7 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - cmp r0, 0x2 - bls _0819EE74 - movs r0, 0x7 - movs r1, 0x3 - bl CopyWindowToVram - b _0819EED8 - .pool -_0819EE74: - ldrb r2, [r1, 0x3] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819EE88 - movs r0, 0x64 - muls r0, r2 - ldr r1, =gPlayerParty - b _0819EE8E - .pool -_0819EE88: - movs r0, 0x64 - muls r0, r2 - ldr r1, =gEnemyParty -_0819EE8E: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - ldr r4, =gStringVar4 - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08610925 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x7 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0x7 - movs r1, 0x3 - bl CopyWindowToVram -_0819EED8: - add sp, 0x18 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EE08 - - thumb_func_start sub_819EEF0 -sub_819EEF0: @ 819EEF0 - push {r4,lr} - sub sp, 0xC - ldr r0, =gUnknown_08610918 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette - ldr r0, =gPlttBufferUnfaded+ 0x1E0 - ldr r1, =gPlttBufferFaded + 0x1C0 - movs r2, 0x5 - bl CpuSet - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - cmp r0, 0x2 - bls _0819EF2C - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - b _0819EF90 - .pool -_0819EF2C: - ldrb r2, [r1, 0x3] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819EF40 - movs r0, 0x64 - muls r0, r2 - ldr r1, =gPlayerParty - b _0819EF46 - .pool -_0819EF40: - movs r0, 0x64 - muls r0, r2 - ldr r1, =gEnemyParty -_0819EF46: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - ldr r4, =gStringVar4 - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08610925 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram -_0819EF90: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EEF0 - - thumb_func_start sub_819EFA8 -sub_819EFA8: @ 819EFA8 - push {r4-r6,lr} - sub sp, 0x2C - ldr r6, =gUnknown_03001284 - ldr r0, [r6] - ldrb r4, [r0, 0x3] - adds r5, r4, 0 - movs r0, 0x8 - movs r1, 0 - bl FillWindowPixelBuffer - cmp r4, 0x2 - bls _0819EFD0 - movs r0, 0x8 - movs r1, 0x2 - bl CopyWindowToVram - b _0819F03A - .pool -_0819EFD0: - movs r0, 0x8 - bl PutWindowTilemap - ldr r0, [r6] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _0819EFEC - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - b _0819EFF2 - .pool -_0819EFEC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty -_0819EFF2: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - add r1, sp, 0xC - bl sub_81DB468 - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x76 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x8 - movs r1, 0x1 - add r2, sp, 0xC - bl Print - movs r0, 0x8 - movs r1, 0x2 - bl CopyWindowToVram -_0819F03A: - add sp, 0x2C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EFA8 - - thumb_func_start sub_819F048 -sub_819F048: @ 819F048 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r4, =gUnknown_03001284 - ldr r3, [r4] - ldrb r0, [r3, 0x15] - cmp r0, 0x1 - beq _0819F094 - cmp r2, 0 - beq _0819F068 - cmp r2, 0x1 - beq _0819F080 - b _0819F094 - .pool -_0819F068: - strb r2, [r3, 0x14] - ldr r0, [r4] - strb r2, [r0, 0x3] - ldr r1, [r4] - movs r0, 0x4 - strb r0, [r1, 0x17] - ldr r1, [r4] - ldr r0, =gUnknown_08610928 - b _0819F092 - .pool -_0819F080: - movs r1, 0 - strb r2, [r3, 0x14] - ldr r0, [r4] - strb r1, [r0, 0x3] - ldr r1, [r4] - movs r0, 0x5 - strb r0, [r1, 0x17] - ldr r1, [r4] - ldr r0, =gUnknown_08610948 -_0819F092: - str r0, [r1, 0x18] -_0819F094: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F048 - - thumb_func_start sub_819F0A0 -sub_819F0A0: @ 819F0A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_03001280 - ldr r2, =gUnknown_086108AC - ldr r1, =gUnknown_03001284 - ldr r1, [r1] - ldrb r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - str r1, [r3] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F0A0 - - thumb_func_start sub_819F0CC -sub_819F0CC: @ 819F0CC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gUnknown_03001284 - ldr r1, [r5] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - ldr r0, [r5] - ldrb r1, [r0, 0x3] - movs r5, 0 - strb r1, [r0, 0x12] - movs r0, 0x3 - bl sub_819EA64 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x8] - ldr r1, =sub_819D9EC - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F0CC - - thumb_func_start sub_819F114 -sub_819F114: @ 819F114 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x6 - strh r0, [r1, 0x8] - ldr r0, =sub_819C90C - str r0, [r1] - bx lr - .pool - thumb_func_end sub_819F114 - - thumb_func_start sub_819F134 -sub_819F134: @ 819F134 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819EA64 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - ldr r2, =sub_819CE40 - lsrs r1, r2, 16 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x12] - ldr r1, =sub_819D770 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F134 - - thumb_func_start sub_819F184 -sub_819F184: @ 819F184 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_03001280 - ldr r1, =gUnknown_03001284 - ldr r2, [r1] - ldrb r1, [r2, 0x3] - ldr r2, [r2, 0x18] - lsls r1, 3 - adds r1, r2 - ldr r1, [r1, 0x4] - str r1, [r3] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F184 - - thumb_func_start sub_819F1AC -sub_819F1AC: @ 819F1AC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_819CC24 - lsrs r0, r2, 16 - movs r3, 0 - strh r0, [r1, 0x14] - strh r2, [r1, 0x16] - strh r3, [r1, 0x8] - strh r3, [r1, 0x12] - ldr r0, =sub_819D588 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_819F1AC - - thumb_func_start sub_819F1DC -sub_819F1DC: @ 819F1DC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_819D9EC - lsrs r0, r2, 16 - movs r3, 0 - strh r0, [r1, 0x14] - strh r2, [r1, 0x16] - strh r3, [r1, 0x12] - strh r3, [r1, 0x8] - ldr r0, =sub_819D588 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_819F1DC - - thumb_func_start sub_819F20C -sub_819F20C: @ 819F20C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =gUnknown_03001284 - ldr r1, [r5] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819F240 - ldr r3, =gTasks - lsls r4, r6, 2 - adds r0, r4, r6 - lsls r0, 3 - adds r0, r3 - ldr r2, =sub_819CD34 - lsrs r1, r2, 16 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - movs r1, 0x2 - strh r1, [r0, 0x12] - b _0819F292 - .pool -_0819F240: - ldrb r0, [r1, 0x3] - bl sub_819F59C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _0819F278 - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0x2D - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F2B4 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - strh r4, [r0, 0x12] - ldr r1, =sub_819F488 - b _0819F29E - .pool -_0819F278: - ldr r4, =gTasks - lsls r5, r6, 2 - adds r0, r5, r6 - lsls r0, 3 - adds r0, r4 - ldr r2, =sub_819CCD4 - lsrs r1, r2, 16 - movs r3, 0 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - strh r3, [r0, 0x12] - adds r3, r4, 0 - adds r4, r5, 0 -_0819F292: - adds r0, r4, r6 - lsls r0, 3 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x8] - ldr r1, =sub_819D588 -_0819F29E: - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F20C - - thumb_func_start sub_819F2B4 -sub_819F2B4: @ 819F2B4 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r5, r2, 24 - lsrs r5, 24 - ldr r0, =gUnknown_08610894 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - strb r0, [r4] - ldr r2, =gSprites - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r2, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_819F600 - str r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x3C] - movs r0, 0x1 - strb r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F2B4 - - thumb_func_start sub_819F304 -sub_819F304: @ 819F304 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x10 - ldr r0, =gUnknown_08610894 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r6, =gUnknown_03001284 - ldr r1, [r6] - adds r1, 0x2D - movs r2, 0 - mov r10, r2 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x2D - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - mov r8, r1 - add r0, r8 - movs r1, 0x2 - bl StartSpriteAffineAnim - ldr r0, [r6] - ldrb r1, [r0, 0x3] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r9, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r2, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - mov r1, r9 - movs r3, 0x1 - bl sub_818D7D8 - ldr r1, [r6] - adds r1, 0x2C - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x2C - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x28 - mov r2, r10 - strb r2, [r0] - ldr r0, [r6] - adds r0, 0x2C - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x29 - strb r2, [r0] - ldr r0, [r6] - adds r0, 0x2D - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F304 - - thumb_func_start sub_819F3F8 -sub_819F3F8: @ 819F3F8 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r5, r2, 24 - lsrs r5, 24 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_818D820 - ldr r0, =sub_819F7B4 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x16] - lsrs r4, 8 - lsls r4, 24 - lsrs r4, 24 - strh r4, [r1, 0x14] - ldr r1, [r1] - bl _call_via_r1 - movs r0, 0x1 - strb r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F3F8 - - thumb_func_start sub_819F444 -sub_819F444: @ 819F444 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_818D820 - ldr r5, =gSprites - lsls r4, 16 - lsrs r1, r4, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - movs r0, 0 - strb r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F444 - - thumb_func_start sub_819F488 -sub_819F488: @ 819F488 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_03001284 - ldr r0, [r1] - adds r0, 0x30 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x1 - beq _0819F58A - ldr r2, =gTasks - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r5, r1, 0 - cmp r0, 0x4 - bhi _0819F58A - lsls r0, 2 - ldr r1, =_0819F4C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819F4C8: - .4byte _0819F4DC - .4byte _0819F4F8 - .4byte _0819F52C - .4byte _0819F548 - .4byte _0819F568 -_0819F4DC: - ldr r0, =gUnknown_085EED0A - bl sub_819EBEC - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x20 - movs r1, 0 - strb r1, [r0] - b _0819F54E - .pool -_0819F4F8: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0819F50C - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819F58A -_0819F50C: - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - b _0819F54E - .pool -_0819F52C: - ldr r0, [r3] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819F58A - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - b _0819F54E -_0819F548: - ldr r0, =gUnknown_085EEC8B - bl sub_819EBEC -_0819F54E: - ldr r0, =gTasks - adds r1, r5, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0819F58A - .pool -_0819F568: - bl sub_819EEF0 - bl sub_819EADC - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0x1 - strb r1, [r0] - ldr r1, =gTasks - adds r0, r5, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x12] - strh r1, [r0, 0x8] - ldr r1, =sub_819CE40 - str r1, [r0] -_0819F58A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F488 - - thumb_func_start sub_819F59C -sub_819F59C: @ 819F59C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - movs r4, 0 -_0819F5B8: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x12] - cmp r4, r0 - beq _0819F5EC - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - cmp r0, r5 - bne _0819F5EC - movs r0, 0x1 - b _0819F5F8 - .pool -_0819F5EC: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0819F5B8 - movs r0, 0 -_0819F5F8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_819F59C - - thumb_func_start sub_819F600 -sub_819F600: @ 819F600 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819F640 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_819F69C - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r2, [r4, 0x3C] - strh r2, [r1, 0x16] - ldr r1, [r1] - bl _call_via_r1 - ldr r0, =SpriteCallbackDummy - str r0, [r4, 0x1C] -_0819F640: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F600 - - thumb_func_start sub_819F654 -sub_819F654: @ 819F654 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819F694 - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _0819F688 - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x30 - movs r1, 0 - strb r1, [r0] - b _0819F68E - .pool -_0819F688: - movs r0, 0 - bl sub_819BE20 -_0819F68E: - adds r0, r4, 0 - bl DestroySprite -_0819F694: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819F654 - - thumb_func_start sub_819F69C -sub_819F69C: @ 819F69C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0819F71A - cmp r0, 0x1 - bgt _0819F6C4 - cmp r0, 0 - beq _0819F6CA - b _0819F77C - .pool -_0819F6C4: - cmp r0, 0x2 - beq _0819F73C - b _0819F77C -_0819F6CA: - movs r0, 0x58 - strh r0, [r4, 0xE] - movs r0, 0x98 - strh r0, [r4, 0x38] - movs r0, 0x40 - strh r0, [r4, 0x12] - movs r0, 0x41 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x38] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - b _0819F7A6 -_0819F71A: - movs r0, 0x3 - bl ShowBg - ldr r1, =0x00001248 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _0819F7A6 - .pool -_0819F73C: - ldrh r0, [r4, 0x12] - subs r0, 0x4 - strh r0, [r4, 0x12] - ldrh r1, [r4, 0x18] - adds r1, 0x4 - strh r1, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - ble _0819F758 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x5F - ble _0819F760 -_0819F758: - movs r0, 0x20 - strh r0, [r4, 0x12] - movs r0, 0x60 - strh r0, [r4, 0x18] -_0819F760: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r2, 0x12 - ldrsh r0, [r4, r2] - cmp r0, 0x20 - bne _0819F7AC - b _0819F7A6 -_0819F77C: - adds r0, r5, 0 - bl DestroyTask - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0x16 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _0819F7A0 - bl sub_819F8E0 - b _0819F7AC - .pool -_0819F7A0: - bl sub_819BD70 - b _0819F7AC -_0819F7A6: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819F7AC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819F69C - - thumb_func_start sub_819F7B4 -sub_819F7B4: @ 819F7B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0819F844 - cmp r0, 0x1 - beq _0819F894 - movs r0, 0x3 - bl HideBg - ldr r3, =gSprites - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r4, 0x16] - strh r1, [r0, 0x3C] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_819F654 - str r1, [r0] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x1 - bl StartSpriteAffineAnim - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits - adds r0, r5, 0 - bl DestroyTask - b _0819F8D8 - .pool -_0819F844: - movs r0, 0x58 - strh r0, [r4, 0xE] - movs r0, 0x98 - strh r0, [r4, 0x38] - movs r0, 0x20 - strh r0, [r4, 0x12] - movs r0, 0x60 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x38] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - b _0819F8D2 -_0819F894: - ldrh r0, [r4, 0x12] - adds r0, 0x4 - strh r0, [r4, 0x12] - ldrh r1, [r4, 0x18] - subs r1, 0x4 - strh r1, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - bgt _0819F8B0 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x41 - bgt _0819F8B8 -_0819F8B0: - movs r0, 0x40 - strh r0, [r4, 0x12] - movs r0, 0x41 - strh r0, [r4, 0x18] -_0819F8B8: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - bne _0819F8D8 -_0819F8D2: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819F8D8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819F7B4 - - thumb_func_start sub_819F8E0 -sub_819F8E0: @ 819F8E0 - push {r4-r6,lr} - sub sp, 0x10 - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819F900 - ldrb r1, [r1, 0x3] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - b _0819F908 - .pool -_0819F900: - ldrb r1, [r1, 0x3] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gEnemyParty -_0819F908: - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - adds r0, r6, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl sub_818D7D8 - ldr r2, =gUnknown_03001284 - ldr r1, [r2] - adds r1, 0x2C - movs r3, 0 - strb r0, [r1] - ldr r4, =gSprites - ldr r0, [r2] - adds r0, 0x2C - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x28 - strb r3, [r0] - ldr r0, [r2] - adds r0, 0x2C - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x29 - strb r3, [r0] - ldr r0, [r2] - adds r0, 0x30 - strb r3, [r0] - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F8E0 - - thumb_func_start sub_819F99C -sub_819F99C: @ 819F99C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDE - ldrb r1, [r1] - movs r6, 0 - adds r7, r2, 0 - ldr r0, =gStringVar1 - mov r8, r0 - cmp r1, 0 - beq _0819F9DC -_0819F9C2: - adds r0, r1, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r1, r0, 24 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r1, 0 - beq _0819F9DC - cmp r6, 0x3 - bls _0819F9C2 -_0819F9DC: - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - ldr r1, [r7] - adds r1, r4, r1 - movs r0, 0x8A - lsls r0, 1 - adds r1, r0 - mov r0, r8 - bl StringCopy7 - ldr r0, [r7] - adds r0, r4 - ldr r1, =0x0000011b - adds r0, r1 - ldrb r1, [r0] - mov r0, r8 - bl ConvertInternationalString - ldr r0, =gStringVar2 - ldr r1, [r7] - adds r1, r4 - adds r1, 0xDE - ldrb r1, [r1] - movs r2, 0x1 - adds r3, r6, 0 - bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_08611330 - ldr r0, [r7] - adds r0, r4 - adds r0, 0xDC - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 25 - adds r0, r1 - ldr r1, [r0] - ldr r0, =gStringVar4 - bl StringExpandPlaceholders - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F99C - - thumb_func_start sub_819FA50 -sub_819FA50: @ 819FA50 - push {lr} - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_819FA50 - - thumb_func_start sub_819FA5C -sub_819FA5C: @ 819FA5C - push {r4,r5,lr} - adds r3, r0, 0 - movs r2, 0 - adds r4, r3, 0 - adds r4, 0x28 - ldr r0, =0x0000ffff - adds r5, r0, 0 -_0819FA6A: - lsls r0, r2, 1 - adds r0, r4, r0 - ldrh r1, [r0] - orrs r1, r5 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819FA6A - adds r1, r3, 0 - adds r1, 0x38 - movs r0, 0xFF - strb r0, [r1] - ldrb r1, [r3] - movs r0, 0x20 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r3] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819FA5C - - thumb_func_start sub_819FAA0 -sub_819FAA0: @ 819FAA0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - adds r1, 0xB2 - ldrb r2, [r1] - movs r0, 0x19 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r0, 0 - mov r12, r0 - adds r5, r3, 0 - mov r8, r0 - ldr r1, =0x0000ffff - mov r10, r1 -_0819FAC6: - movs r2, 0 - mov r3, r12 - lsls r7, r3, 4 - movs r4, 0x1 - add r4, r12 - mov r9, r4 - adds r0, r7, r3 - lsls r3, r0, 2 -_0819FAD6: - ldr r1, [r5] - lsls r0, r2, 1 - adds r0, r3 - movs r4, 0x82 - lsls r4, 1 - adds r1, r4 - adds r1, r0 - ldrh r0, [r1] - mov r4, r10 - orrs r0, r4 - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819FAD6 - ldr r2, [r5] - mov r0, r12 - adds r3, r7, r0 - lsls r3, 2 - adds r2, r3 - adds r2, 0xDC - ldrb r1, [r2] - movs r0, 0x20 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r5] - adds r0, r3 - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xDC - ldrb r2, [r1] - movs r0, 0x61 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, r3 - adds r0, 0xDE - mov r4, r8 - strb r4, [r0] - ldr r0, [r5] - adds r0, r3 - adds r0, 0xDD - strb r4, [r0] - movs r2, 0 - ldr r6, =gSaveBlock2Ptr - movs r4, 0x88 - lsls r4, 1 -_0819FB48: - ldr r0, [r6] - adds r1, r2, r3 - adds r0, r4 - adds r0, r1 - mov r1, r8 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _0819FB48 - ldr r0, [r5] - mov r3, r12 - adds r2, r7, r3 - lsls r2, 2 - adds r0, r2 - ldr r4, =gGameLanguage - ldrb r1, [r4] - ldr r3, =0x0000011b - adds r0, r3 - strb r1, [r0] - ldr r0, [r5] - movs r4, 0x8E - lsls r4, 1 - adds r0, r4 - adds r0, r2 - mov r1, r8 - str r1, [r0] - mov r3, r9 - lsls r0, r3, 24 - lsrs r0, 24 - mov r12, r0 - cmp r0, 0x3 - bls _0819FAC6 - bl sub_81A087C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819FAA0 - - thumb_func_start sub_819FBB0 -sub_819FBB0: @ 819FBB0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r0, [r0] - movs r1, 0x3 - ands r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_819FBB0 - - thumb_func_start sub_819FBC8 -sub_819FBC8: @ 819FBC8 - push {r4,r5,lr} - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - adds r0, 0xDE - ldrb r0, [r0] - cmp r0, 0 - bne _0819FC10 - adds r4, r2, 0 - ldr r5, =gUnknown_08611548 -_0819FBDA: - bl Random - ldr r2, [r4] - lsls r0, 16 - movs r1, 0xE0 - lsls r1, 11 - ands r1, r0 - lsrs r1, 16 - adds r1, r5 - ldrb r0, [r1] - adds r2, 0xB0 - strb r0, [r2] - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xB0 - adds r0, 0xDC - ldrb r0, [r0] - lsls r0, 27 - ldrb r1, [r1] - lsrs r0, 27 - cmp r1, r0 - beq _0819FBDA - b _0819FC38 - .pool -_0819FC10: - adds r4, r2, 0 -_0819FC12: - bl Random - ldr r2, [r4] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - adds r2, 0xB0 - strb r0, [r2] - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xB0 - adds r0, 0xDC - ldrb r0, [r0] - lsls r0, 27 - ldrb r1, [r1] - lsrs r0, 27 - cmp r1, r0 - beq _0819FC12 -_0819FC38: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819FBC8 - - thumb_func_start sub_819FC40 -sub_819FC40: @ 819FC40 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - adds r2, 0xB1 - movs r1, 0x3 - ands r0, r1 - ldrb r3, [r2] - subs r1, 0x7 - ands r1, r3 - orrs r1, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end sub_819FC40 - - thumb_func_start sub_819FC60 -sub_819FC60: @ 819FC60 - push {r4-r7,lr} - sub sp, 0xC - movs r5, 0 -_0819FC66: - mov r1, sp - adds r0, r1, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _0819FC66 - movs r5, 0 -_0819FC78: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r7, sp - adds r2, r7, r4 - ldrb r3, [r2] - adds r1, r7, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x31 - bls _0819FC78 - movs r5, 0 - ldr r6, =gSaveBlock2Ptr - movs r4, 0xF -_0819FCBC: - ldr r3, [r6] - adds r3, 0xB4 - adds r3, r5 - lsls r2, r5, 1 - mov r1, sp - adds r0, r1, r2 - ldrb r0, [r0] - adds r1, r4, 0 - ands r1, r0 - lsls r1, 4 - adds r2, 0x1 - mov r7, sp - adds r0, r7, r2 - ldrb r2, [r0] - adds r0, r4, 0 - ands r0, r2 - orrs r1, r0 - strb r1, [r3] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _0819FCBC - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819FC60 - - thumb_func_start sub_819FCF8 -sub_819FCF8: @ 819FCF8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - cmp r0, 0x2 - bne _0819FD4C - ldr r6, =gUnknown_030062EC -_0819FD06: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - movs r2, 0 - ldr r1, [r6] - lsls r0, r5, 2 - adds r0, r5 - lsls r4, r0, 1 - adds r1, 0x2 -_0819FD26: - lsls r0, r2, 1 - adds r0, r4 - adds r0, r1, r0 - ldrh r0, [r0] - cmp r0, 0 - beq _0819FD38 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_0819FD38: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x4 - bls _0819FD26 - cmp r3, 0x3 - bhi _0819FD06 - b _0819FD5A - .pool -_0819FD4C: - cmp r0, 0x1 - bne _0819FD5A - ldrb r0, [r2] - adds r1, r0 - ldrb r5, [r1] - adds r0, 0x1 - strb r0, [r2] -_0819FD5A: - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_819FCF8 - - thumb_func_start sub_819FD64 -sub_819FD64: @ 819FD64 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - movs r5, 0 - mov r0, sp - adds r0, 0xC - str r0, [sp, 0x14] - mov r1, sp - adds r1, 0x10 - str r1, [sp, 0x18] - adds r1, r0, 0 -_0819FD80: - adds r0, r1, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _0819FD80 - movs r5, 0 - ldr r6, [sp, 0x14] -_0819FD92: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - adds r2, r6, r4 - ldrb r3, [r2] - adds r1, r6, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _0819FD92 - movs r5, 0 - ldr r2, =gUnknown_086114D3 -_0819FDD0: - mov r4, sp - adds r1, r4, r5 - adds r0, r5, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _0819FDD0 - movs r5, 0 -_0819FDE6: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r6, sp - adds r2, r6, r4 - ldrb r3, [r2] - adds r1, r6, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x31 - bls _0819FDE6 - ldr r4, =gUnknown_030062EC - movs r0, 0x30 - bl AllocZeroed - str r0, [r4] - movs r1, 0 - strb r1, [r0] - movs r5, 0 - movs r2, 0x4 -_0819FE34: - movs r3, 0 -_0819FE36: - ldr r0, [r4] - lsls r1, r3, 2 - adds r1, r3 - adds r1, r5, r1 - adds r0, 0x20 - adds r0, r1 - strb r2, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _0819FE36 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _0819FE34 - movs r0, 0 - ldr r7, [sp, 0x18] - strb r0, [r7] - movs r5, 0 -_0819FE60: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - lsls r4, r5, 2 - adds r3, r4 - mov r1, sp - adds r6, r1, r5 - ldrb r0, [r6] - adds r3, 0xB8 - movs r2, 0x3 - ands r2, r0 - ldrb r0, [r3] - movs r7, 0x4 - negs r7, r7 - adds r1, r7, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3] - ldrb r0, [r6] - adds r5, 0x1 - str r5, [sp, 0x1C] - mov r8, r4 - cmp r0, 0x3 - beq _0819FF62 - ldrb r0, [r6] - ldr r1, [sp, 0x14] - ldr r2, [sp, 0x18] - bl sub_819FCF8 - ldr r1, =gSaveBlock2Ptr - ldr r3, [r1] - add r3, r8 - adds r3, 0xB8 - movs r2, 0x3 - ands r2, r0 - lsls r2, 2 - ldrb r0, [r3] - movs r4, 0xD - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3] - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - add r0, r8 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r7, r0, 30 - ldrb r0, [r6] - cmp r0, 0x2 - bne _0819FF62 - lsls r0, r7, 2 - adds r0, r7 - mov r10, r0 - ldr r0, =gUnknown_030062EC - mov r9, r0 -_0819FED2: - bl Random - lsls r0, 16 - lsrs r4, r0, 16 - movs r1, 0x3 - ands r4, r1 - movs r3, 0 - mov r6, r9 - ldr r2, [r6] - ldrb r0, [r2] - adds r1, r0, 0x1 - lsls r5, r7, 2 - cmp r3, r1 - bge _0819FF12 - adds r2, 0x20 - mov r6, r10 - adds r0, r2, r6 - ldrb r0, [r0] - cmp r0, r4 - beq _0819FF12 - adds r6, r1, 0 - adds r1, r5, r7 -_0819FEFE: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r6 - bge _0819FF12 - adds r0, r3, r1 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, r4 - bne _0819FEFE -_0819FF12: - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0] - adds r0, 0x1 - ldr r1, =gUnknown_030062EC - cmp r3, r0 - bne _0819FED2 - ldr r0, [r1] - orrs r5, r7 - ldrb r2, [r0] - adds r1, r5, r2 - adds r0, 0x20 - adds r0, r1 - strb r4, [r0] - ldr r6, =gSaveBlock2Ptr - ldr r2, [r6] - add r2, r8 - adds r2, 0xB8 - movs r7, 0x3 - ands r4, r7 - lsls r3, r4, 4 - ldrb r0, [r2] - movs r4, 0x31 - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r3 - strb r0, [r2] - ldr r0, [r6] - add r0, r8 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r0, 30 - bl sub_819FF98 - ldr r1, [r6] - add r1, r8 - adds r1, 0xBA - strh r0, [r1] -_0819FF62: - ldr r6, [sp, 0x1C] - lsls r0, r6, 24 - lsrs r5, r0, 24 - cmp r5, 0x8 - bhi _0819FF6E - b _0819FE60 -_0819FF6E: - ldr r4, =gUnknown_030062EC - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819FD64 - - thumb_func_start sub_819FF98 -sub_819FF98: @ 819FF98 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0xC] - movs r7, 0 - ldr r1, [sp] - cmp r1, 0x2 - bhi _0819FFE0 - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0xB4 - ldr r3, [sp] - adds r0, r3 - ldrb r4, [r0] - adds r1, 0xB2 - ldrb r0, [r1] - lsls r0, 29 - lsrs r0, 29 - asrs r0, r3 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - asrs r4, r0 - movs r0, 0xF - ands r4, r0 - b _0819FFE4 - .pool -_0819FFE0: - movs r4, 0 - ldr r2, =gSaveBlock2Ptr -_0819FFE4: - ldr r3, =gUnknown_08610970 - lsls r1, r4, 1 - ldr r4, [r2] - adds r0, r4, 0 - adds r0, 0xB0 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, r0 - adds r3, 0x34 - adds r1, r3 - ldrh r1, [r1] - str r1, [sp, 0x8] - ldr r1, =gLevelUpLearnsetPointers - ldr r2, [sp, 0x8] - lsls r0, r2, 2 - adds r0, r1 - ldr r6, [r0] - movs r3, 0 - adds r4, 0xB1 - ldrb r1, [r4] - movs r0, 0x3 - ands r0, r1 - movs r5, 0x3C - cmp r0, 0x1 - bne _081A001A - movs r5, 0x32 -_081A001A: - ldrh r1, [r6] - ldr r4, =0x0000ffff - cmp r1, r4 - beq _081A004C - movs r2, 0xFE - lsls r2, 8 - adds r0, r2, 0 - ands r0, r1 - lsls r1, r5, 9 - cmp r0, r1 - bgt _081A004C - adds r5, r2, 0 - adds r2, r1, 0 -_081A0034: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 1 - adds r0, r6 - ldrh r1, [r0] - cmp r1, r4 - beq _081A004C - adds r0, r5, 0 - ands r0, r1 - cmp r0, r2 - ble _081A0034 -_081A004C: - adds r5, r3, 0 - movs r3, 0 - str r3, [sp, 0x4] -_081A0052: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081A0068 - ldr r0, [sp, 0xC] - cmp r0, 0x1 - bne _081A00E0 -_081A0068: - ldr r1, =0x000001ff - mov r8, r1 -_081A006C: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3A - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, [sp, 0x8] - adds r1, r4, 0 - bl sub_806E064 - adds r2, r0, 0 - cmp r2, 0 - beq _081A006C - ldr r2, =0x00000121 - adds r0, r4, r2 - bl ItemIdToBattleMoveId - lsls r0, 16 - lsrs r7, r0, 16 - movs r2, 0x1 - cmp r5, 0x4 - bhi _081A00BC - movs r3, 0 - b _081A00C6 - .pool -_081A00BC: - subs r0, r5, 0x4 - b _081A00C2 -_081A00C0: - adds r0, r3, 0x1 -_081A00C2: - lsls r0, 24 - lsrs r3, r0, 24 -_081A00C6: - cmp r3, r5 - bcs _081A00DA - lsls r0, r3, 1 - adds r0, r6 - ldrh r0, [r0] - mov r1, r8 - ands r0, r1 - cmp r0, r7 - bne _081A00C0 - movs r2, 0 -_081A00DA: - cmp r2, 0x1 - bne _081A006C - b _081A0146 -_081A00E0: - cmp r5, 0x4 - bhi _081A00EA - movs r2, 0x1 - str r2, [sp, 0xC] - b _081A0168 -_081A00EA: - subs r4, r5, 0x4 - ldr r3, =0x000001ff - mov r10, r3 - mov r8, r3 - lsls r0, r4, 24 - mov r9, r0 -_081A00F6: - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 24 - lsrs r0, 23 - adds r0, r6 - ldrh r0, [r0] - mov r7, r8 - ands r7, r0 - movs r2, 0x1 - mov r1, r9 - lsrs r3, r1, 24 - cmp r3, r5 - bcs _081A0142 - lsls r0, r3, 1 - adds r0, r6 - ldrh r1, [r0] - mov r0, r8 - b _081A013A - .pool -_081A0128: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r5 - bcs _081A0142 - lsls r0, r3, 1 - adds r0, r6 - ldrh r0, [r0] - mov r1, r10 -_081A013A: - ands r0, r1 - cmp r0, r7 - bne _081A0128 - movs r2, 0 -_081A0142: - cmp r2, 0x1 - bne _081A00F6 -_081A0146: - ldr r0, [sp] - adds r1, r7, 0 - bl sub_81A0194 - lsls r0, 24 - cmp r0, 0 - beq _081A0168 - ldr r0, =gUnknown_08611370 - adds r0, r7, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _081A0170 - ldr r0, [sp, 0x4] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] -_081A0168: - ldr r2, [sp, 0x4] - cmp r2, 0x4 - bhi _081A0170 - b _081A0052 -_081A0170: - ldr r0, =gUnknown_030062EC - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - adds r0, r7, 0 - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_819FF98 - - thumb_func_start sub_81A0194 -sub_81A0194: @ 81A0194 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - movs r3, 0 - ldr r0, =gUnknown_030062EC - mov r12, r0 - ldr r2, [r0] - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r6, r0, 1 - adds r2, 0x2 - adds r7, r1, 0 -_081A01B0: - lsls r0, r3, 1 - adds r0, r6 - adds r0, r2, r0 - ldrh r0, [r0] - cmp r0, r5 - bne _081A01C4 - movs r0, 0 - b _081A01E2 - .pool -_081A01C4: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x4 - bls _081A01B0 - mov r2, r12 - ldr r1, [r2] - adds r0, r7, r4 - ldrb r2, [r1] - adds r0, r2 - lsls r0, 1 - adds r1, 0x2 - adds r1, r0 - strh r5, [r1] - movs r0, 0x1 -_081A01E2: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A0194 - - thumb_func_start sub_81A01E8 -sub_81A01E8: @ 81A01E8 - push {r4-r7,lr} - mov r12, r1 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - movs r4, 0x3C - cmp r0, 0x1 - bne _081A0204 - movs r4, 0x32 -_081A0204: - ldr r1, =gLevelUpLearnsetPointers - lsls r0, r2, 2 - adds r0, r1 - ldr r6, [r0] - movs r5, 0 - ldrh r1, [r6] - ldr r3, =0x0000ffff - cmp r1, r3 - beq _081A0240 - movs r2, 0xFE - lsls r2, 8 - adds r0, r2, 0 - ands r0, r1 - lsls r1, r4, 9 - cmp r0, r1 - bgt _081A0240 - adds r4, r2, 0 - adds r2, r1, 0 -_081A0228: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 1 - adds r0, r6 - ldrh r1, [r0] - cmp r1, r3 - beq _081A0240 - adds r0, r4, 0 - ands r0, r1 - cmp r0, r2 - ble _081A0228 -_081A0240: - adds r4, r5, 0 - cmp r4, 0x4 - bls _081A0248 - movs r4, 0x4 -_081A0248: - movs r2, 0 - cmp r2, r4 - bcs _081A026C - ldr r7, =0x000001ff -_081A0250: - lsls r3, r2, 1 - add r3, r12 - adds r2, 0x1 - subs r0, r5, r2 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r0] - adds r0, r7, 0 - ands r0, r1 - strh r0, [r3] - lsls r2, 24 - lsrs r2, 24 - cmp r2, r4 - bcc _081A0250 -_081A026C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A01E8 - - thumb_func_start sub_81A0284 -sub_81A0284: @ 81A0284 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - adds r0, r2, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - adds r7, r1, 0 - cmp r0, 0x2 - bhi _081A02B8 - movs r0, 0 - b _081A037C - .pool -_081A02B8: - movs r4, 0 - movs r3, 0 - adds r0, r2, 0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - ldr r1, =gUnknown_08610970 - mov r12, r1 - lsls r6, 1 - lsls r5, 1 - mov r9, r5 - cmp r0, 0 - beq _081A02F4 - adds r2, r7, 0 -_081A02D4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x8 - bhi _081A02F4 - ldr r0, [r2] - lsls r1, r3, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A02D4 -_081A02F4: - ldr r0, [r7] - adds r0, 0xB0 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r6, r0 - mov r1, r12 - adds r1, 0x34 - adds r0, r1 - ldrh r0, [r0] - mov r1, sp - bl sub_81A01E8 - movs r3, 0 - cmp r3, r4 - bcs _081A0376 - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - cmp r3, r0 - bge _081A0376 - adds r6, r7, 0 - adds r5, r1, 0 -_081A032A: - lsls r0, r3, 2 - adds r2, r5, r0 - adds r0, r2, 0 - adds r0, 0xB8 - ldrb r1, [r0] - lsls r0, r1, 30 - lsrs r0, 30 - cmp r0, 0x2 - bne _081A035C - lsls r0, r1, 28 - lsrs r0, 30 - cmp r0, r8 - bne _081A035C - lsrs r0, r1, 6 - cmp r0, 0 - beq _081A035C - lsls r0, r1, 26 - lsrs r0, 30 - lsls r0, 1 - mov r7, sp - adds r1, r7, r0 - adds r0, r2, 0 - adds r0, 0xBA - ldrh r0, [r0] - strh r0, [r1] -_081A035C: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r4 - bcs _081A0376 - ldr r0, [r6] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - cmp r3, r0 - blt _081A032A -_081A0376: - mov r0, sp - add r0, r9 - ldrh r0, [r0] -_081A037C: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A0284 - - thumb_func_start sub_81A0390 -sub_81A0390: @ 81A0390 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r7, =gSaveBlock2Ptr - adds r6, r7, 0 - movs r4, 0 -_081A03A6: - ldr r0, [r6] - lsls r2, r5, 1 - adds r2, r5 - lsls r2, 2 - adds r0, r2 - adds r1, r0, 0 - adds r1, 0xE0 - strh r4, [r1] - adds r0, 0xEA - strh r4, [r0] - movs r3, 0 -_081A03BC: - ldr r0, [r6] - lsls r1, r3, 1 - adds r1, r2 - adds r0, 0xE2 - adds r0, r1 - strh r4, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _081A03BC - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _081A03A6 - ldr r0, [r7] - adds r0, 0xB1 - ldrb r0, [r0] - lsrs r3, r0, 6 - movs r5, 0 -_081A03E6: - lsls r0, r3, 2 - mov r1, sp - adds r2, r1, r0 - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, 0xE0 - ldr r1, [r7] - adds r1, r0 - str r1, [r2] - adds r0, r3, 0x1 - movs r1, 0x3 - bl __modsi3 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _081A03E6 - movs r5, 0 - ldr r7, =gSaveBlock2Ptr - ldr r6, =gUnknown_086109A4 -_081A0416: - ldr r0, [r7] - mov r12, r0 - adds r0, 0xB4 - adds r0, r5 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0xB2 - ldrb r0, [r0] - lsls r0, 29 - lsrs r0, 29 - asrs r0, r5 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - asrs r2, r0 - movs r0, 0xF - ands r2, r0 - lsls r0, r5, 2 - mov r1, sp - adds r3, r1, r0 - ldr r4, [r3] - lsls r2, 1 - mov r0, r12 - adds r0, 0xB0 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r2, r0 - adds r2, r6 - ldrh r0, [r2] - strh r0, [r4] - ldr r1, [r3] - ldrh r0, [r1] - adds r1, 0x2 - bl sub_81A01E8 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _081A0416 - movs r5, 0 - cmp r5, r8 - bcs _081A04D6 - ldr r7, =gSaveBlock2Ptr -_081A0470: - ldr r1, [r7] - lsls r0, r5, 2 - adds r4, r1, r0 - adds r0, r4, 0 - adds r0, 0xB8 - ldrb r2, [r0] - lsls r0, r2, 30 - lsrs r1, r0, 30 - lsls r0, r2, 28 - lsrs r3, r0, 30 - adds r6, r3, 0 - cmp r1, 0x1 - bne _081A04A8 - lsrs r0, r2, 6 - cmp r0, 0 - beq _081A04CC - lsls r0, r3, 2 - add r0, sp - ldr r1, [r0] - adds r0, r4, 0 - adds r0, 0xBA - ldrh r0, [r0] - strh r0, [r1, 0xA] - b _081A04CC - .pool -_081A04A8: - cmp r1, 0x2 - bne _081A04CC - lsls r0, r2, 24 - lsrs r0, 30 - cmp r0, 0 - beq _081A04CC - lsls r2, 26 - lsrs r2, 30 - lsls r0, r6, 2 - add r0, sp - ldr r1, [r0] - lsls r2, 1 - adds r1, 0x2 - adds r1, r2 - adds r0, r4, 0 - adds r0, 0xBA - ldrh r0, [r0] - strh r0, [r1] -_081A04CC: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r8 - bcc _081A0470 -_081A04D6: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A0390 - - thumb_func_start sub_81A04E4 -sub_81A04E4: @ 81A04E4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r0, 24 - movs r7, 0x2 - cmp r0, 0x6 - bls _081A04FC - b _081A064C -_081A04FC: - lsls r0, 2 - ldr r1, =_081A050C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A050C: - .4byte _081A0528 - .4byte _081A0540 - .4byte _081A05B4 - .4byte _081A05F4 - .4byte _081A061C - .4byte _081A064C - .4byte _081A0634 -_081A0528: - movs r0, 0x12 - mov r10, r0 - movs r6, 0x8 - ldr r0, =gUnknown_085EAEB1 - str r0, [sp, 0xC] - ldr r0, =gUnknown_085EAEB8 - str r0, [sp, 0x10] - b _081A0652 - .pool -_081A0540: - movs r7, 0x3 - movs r1, 0x12 - mov r10, r1 - movs r6, 0x6 - movs r4, 0 - ldr r0, =gSpeciesNames - mov r9, r0 - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - movs r1, 0xB2 - adds r1, r3 - mov r12, r1 - adds r5, r3, 0 - adds r5, 0xB0 - ldr r0, =gUnknown_086109A4 - mov r8, r0 -_081A0560: - adds r0, r3, 0 - adds r0, 0xB4 - adds r0, r4 - ldrb r2, [r0] - mov r1, r12 - ldrb r0, [r1] - lsls r0, 29 - lsrs r0, 29 - asrs r0, r4 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - asrs r2, r0 - movs r0, 0xF - ands r2, r0 - lsls r2, 1 - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r2, r0 - add r2, r8 - ldrh r1, [r2] - lsls r0, r4, 2 - mov r2, sp - adds r2, r0 - adds r2, 0xC - movs r0, 0xB - muls r0, r1 - add r0, r9 - str r0, [r2] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A0560 - b _081A0652 - .pool -_081A05B4: - movs r0, 0x12 - mov r10, r0 - movs r6, 0x8 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - cmp r0, 0x2 - bls _081A05CC - b _081A06FA -_081A05CC: - ldr r0, =gUnknown_030062F0 - ldr r3, [r0] - ldrh r0, [r3, 0x2] - movs r2, 0xB - muls r0, r2 - ldr r1, =gSpeciesNames - adds r0, r1 - str r0, [sp, 0x10] - ldrh r0, [r3] - muls r0, r2 - adds r0, r1 - str r0, [sp, 0xC] - b _081A0652 - .pool -_081A05F4: - movs r1, 0x11 - mov r10, r1 - movs r6, 0x8 - ldr r0, =gUnknown_030062F0 - ldr r3, [r0] - ldrh r0, [r3, 0x4] - movs r2, 0xD - muls r0, r2 - ldr r1, =gMoveNames - adds r0, r1 - str r0, [sp, 0xC] - ldrh r0, [r3, 0x6] - muls r0, r2 - adds r0, r1 - str r0, [sp, 0x10] - b _081A0652 - .pool -_081A061C: - movs r0, 0x12 - mov r10, r0 - movs r6, 0x8 - ldr r0, =gUnknown_085ED193 - str r0, [sp, 0xC] - ldr r0, =gUnknown_085ED198 - str r0, [sp, 0x10] - b _081A0652 - .pool -_081A0634: - movs r1, 0x14 - mov r10, r1 - movs r6, 0x8 - ldr r0, =gUnknown_085EAE62 - str r0, [sp, 0xC] - ldr r0, =gUnknown_085EAE66 - str r0, [sp, 0x10] - b _081A0652 - .pool -_081A064C: - movs r0, 0 - mov r10, r0 - movs r6, 0 -_081A0652: - movs r5, 0 - movs r4, 0 - lsls r1, r7, 25 - mov r8, r1 - cmp r4, r7 - bcs _081A067E -_081A065E: - lsls r0, r4, 2 - add r0, sp - adds r0, 0xC - ldr r1, [r0] - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - cmp r0, r5 - ble _081A0674 - adds r5, r0, 0 -_081A0674: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r7 - bcc _081A065E -_081A067E: - adds r0, r5, 0 - bl convert_pixel_width_to_tile_width - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r0, r10 - adds r1, r4, 0 - bl sub_80E2D5C - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - mov r0, r8 - lsrs r3, r0, 24 - mov r0, r10 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_81A0784 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - movs r1, 0 - bl SetStandardWindowBorderStyle - movs r4, 0 - cmp r4, r7 - bcs _081A06E6 -_081A06B8: - lsls r0, r4, 2 - add r0, sp - adds r0, 0xC - ldr r2, [r0] - lsls r0, r4, 4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - movs r3, 0x8 - bl Print - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r7 - bcc _081A06B8 -_081A06E6: - adds r0, r5, 0 - adds r1, r7, 0 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0x1 - adds r1, r7, 0 - adds r2, r5, 0 - bl sub_81A0804 -_081A06FA: - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A04E4 - - thumb_func_start sub_81A070C -sub_81A070C: @ 81A070C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081A0730 - bl ProcessMenuInputNoWrapAround - b _081A0734 - .pool -_081A0730: - bl ProcessMenuInput -_081A0734: - lsls r0, 24 - lsrs r0, 24 - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _081A0778 - adds r0, 0x1 - cmp r1, r0 - bne _081A0764 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081A0778 - movs r0, 0x5 - bl PlaySE - ldr r1, =gScriptResult - movs r0, 0x7F - strh r0, [r1] - b _081A0768 - .pool -_081A0764: - ldr r0, =gScriptResult - strh r1, [r0] -_081A0768: - ldrb r0, [r4, 0xC] - bl sub_81A07E8 - adds r0, r5, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_081A0778: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A070C - - thumb_func_start sub_81A0784 -sub_81A0784: @ 81A0784 - push {r4,r5,lr} - sub sp, 0x20 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsls r5, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x80 - lsls r0, 17 - adds r4, r0 - lsrs r4, 24 - adds r5, r0 - lsrs r5, 24 - str r2, [sp] - str r3, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0x64 - str r0, [sp, 0xC] - add r0, sp, 0x10 - movs r1, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_8198A50 - ldr r0, [sp, 0x10] - ldr r1, [sp, 0x14] - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - add r0, sp, 0x18 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0 - add sp, 0x20 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A0784 - - thumb_func_start sub_81A07E8 -sub_81A07E8: @ 81A07E8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8198070 - adds r0, r4, 0 - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A07E8 - - thumb_func_start sub_81A0804 -sub_81A0804: @ 81A0804 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, =sub_81A070C - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r1 - strh r4, [r1, 0x10] - cmp r5, 0x3 - bls _081A0840 - movs r0, 0x1 - b _081A0842 - .pool -_081A0840: - movs r0, 0 -_081A0842: - strh r0, [r1, 0x12] - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x14] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0804 - - thumb_func_start sub_81A085C -sub_81A085C: @ 81A085C - push {lr} - ldr r1, =gUnknown_086114E0 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A085C - - thumb_func_start sub_81A087C -sub_81A087C: @ 81A087C - push {r4-r7,lr} - bl sub_819FBC8 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - adds r1, 0xB1 - ldrb r2, [r1] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0xB1 - ldrb r2, [r1] - movs r0, 0x3D - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0xB1 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0xB2 - ldrb r2, [r1] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r4, 0 - movs r1, 0 -_081A08BE: - ldr r0, [r3] - adds r0, 0xB4 - adds r0, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A08BE - movs r4, 0 - ldr r5, =gSaveBlock2Ptr - movs r0, 0x4 - negs r0, r0 - mov r12, r0 - movs r7, 0xD - negs r7, r7 - movs r6, 0x31 - negs r6, r6 -_081A08E2: - ldr r1, [r5] - lsls r3, r4, 2 - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - mov r0, r12 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, r3 - adds r0, 0xBA - movs r1, 0 - strh r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x8 - bls _081A08E2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A087C - - thumb_func_start sub_81A093C -sub_81A093C: @ 81A093C - push {lr} - bl sub_819FBB0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081A0954 - ldr r0, =gScriptResult - strh r1, [r0] - b _081A095A - .pool -_081A0954: - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] -_081A095A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A093C - - thumb_func_start sub_81A0964 -sub_81A0964: @ 81A0964 - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] - bl sub_819FC40 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0964 - - thumb_func_start sub_81A0978 -sub_81A0978: @ 81A0978 - push {lr} - bl sub_819FBC8 - pop {r0} - bx r0 - thumb_func_end sub_81A0978 - - thumb_func_start sub_81A0984 -sub_81A0984: @ 81A0984 - push {lr} - bl sub_819FD64 - pop {r0} - bx r0 - thumb_func_end sub_81A0984 - - thumb_func_start sub_81A0990 -sub_81A0990: @ 81A0990 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r2, 0xB1 - ldrb r3, [r2] - lsls r1, r3, 26 - lsrs r1, 28 - adds r1, 0x1 - movs r0, 0xF - ands r1, r0 - lsls r1, 2 - movs r0, 0x3D - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_81A0990 - - thumb_func_start sub_81A09B4 -sub_81A09B4: @ 81A09B4 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A09B4 - - thumb_func_start sub_81A09D0 -sub_81A09D0: @ 81A09D0 - push {lr} - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r1, r0, 0x3 - cmp r1, 0 - bge _081A09F4 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - b _081A0A1C - .pool -_081A09F4: - ldr r2, =gScriptResult - cmp r1, 0x8 - ble _081A09FE - movs r0, 0x1 - strh r0, [r2] -_081A09FE: - ldr r0, [r3] - lsls r1, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A0A18 - movs r0, 0x1 - b _081A0A1A - .pool -_081A0A18: - movs r0, 0 -_081A0A1A: - strh r0, [r2] -_081A0A1C: - pop {r0} - bx r0 - thumb_func_end sub_81A09D0 - - thumb_func_start sub_81A0A20 -sub_81A0A20: @ 81A0A20 - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] - bl sub_81A04E4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0A20 - - thumb_func_start sub_81A0A34 -sub_81A0A34: @ 81A0A34 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8197224 - lsls r0, 16 - cmp r0, 0 - bne _081A0A68 - adds r0, r4, 0 - bl DestroyTask - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A0A64 - ldr r0, =script_env_2_enable_and_set_ctx_running - bl sub_81A172C - b _081A0A68 - .pool -_081A0A64: - bl script_env_2_enable_and_set_ctx_running -_081A0A68: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A0A34 - - thumb_func_start sub_81A0A70 -sub_81A0A70: @ 81A0A70 - push {lr} - ldr r1, =gSpecialVar_0x8006 - ldrh r0, [r1] - cmp r0, 0x6 - bne _081A0A94 - ldr r1, =gUnknown_08610FF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0A94: - cmp r0, 0x7 - bne _081A0AB0 - ldr r1, =gUnknown_08610FF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0AB0: - cmp r0, 0x8 - bne _081A0ACC - ldr r1, =gUnknown_086111B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0ACC: - cmp r0, 0x9 - bne _081A0AE8 - ldr r1, =gUnknown_086111B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0AE8: - cmp r0, 0x4 - bne _081A0B04 - ldr r1, =gUnknown_08611230 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0B04: - cmp r0, 0x5 - bne _081A0B20 - ldr r1, =gUnknown_08611230 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0B20: - cmp r0, 0xA - bne _081A0B40 - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - b _081A0BD6 - .pool -_081A0B40: - cmp r0, 0xB - bne _081A0B5C - ldr r1, =gUnknown_086112B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0B5C: - cmp r0, 0xC - bne _081A0B7C - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0xC - b _081A0BD6 - .pool -_081A0B7C: - cmp r0, 0xD - bne _081A0B9C - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x4 - b _081A0BD6 - .pool -_081A0B9C: - ldrh r0, [r1] - cmp r0, 0x10 - bne _081A0BC0 - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x10 - b _081A0BD6 - .pool -_081A0BC0: - cmp r0, 0xE - bne _081A0BE4 - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x8 -_081A0BD6: - adds r0, r2 - ldr r1, [r0] - b _081A0C7A - .pool -_081A0BE4: - cmp r0, 0xF - bne _081A0C00 - ldr r1, =gUnknown_086112B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0C00: - cmp r0, 0 - bne _081A0C1C - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - b _081A0C66 - .pool -_081A0C1C: - cmp r0, 0x1 - bne _081A0C38 - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0C38: - cmp r0, 0x2 - bne _081A0C54 - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - adds r1, 0x8 - b _081A0C66 - .pool -_081A0C54: - cmp r0, 0x3 - bne _081A0C74 - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - adds r1, 0xC -_081A0C66: - adds r0, r1 - ldr r1, [r0] - b _081A0C7A - .pool -_081A0C74: - bl script_env_2_enable_and_set_ctx_running - b _081A0C8E -_081A0C7A: - ldr r0, =gStringVar4 - bl StringExpandPlaceholders - movs r0, 0x1 - bl AddTextPrinterForMessage - ldr r0, =sub_81A0A34 - movs r1, 0x1 - bl CreateTask -_081A0C8E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0A70 - - thumb_func_start sub_81A0C9C -sub_81A0C9C: @ 81A0C9C - push {lr} - bl script_env_2_enable - bl player_bitmagic - bl sub_808B864 - bl sub_808BCF4 - movs r0, 0 - movs r1, 0x1 - bl sub_81973C4 - bl sub_81A0A70 - pop {r0} - bx r0 - thumb_func_end sub_81A0C9C - - thumb_func_start sub_81A0CC0 -sub_81A0CC0: @ 81A0CC0 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r1, r0, 26 - lsrs r0, r1, 28 - cmp r0, 0x2 - bhi _081A0CE4 - ldr r1, =gScriptResult - movs r0, 0x2 - b _081A0D34 - .pool -_081A0CE4: - lsrs r0, r1, 28 - cmp r0, 0xB - bhi _081A0D30 - lsrs r0, r1, 28 - subs r0, 0x3 - lsls r0, 2 - adds r0, r2, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x2 - beq _081A0D18 - cmp r0, 0x2 - bgt _081A0D08 - cmp r0, 0x1 - beq _081A0D0E - b _081A0D30 -_081A0D08: - cmp r0, 0x3 - beq _081A0D24 - b _081A0D30 -_081A0D0E: - ldr r1, =gScriptResult - movs r0, 0x4 - b _081A0D34 - .pool -_081A0D18: - ldr r1, =gScriptResult - movs r0, 0x3 - b _081A0D34 - .pool -_081A0D24: - ldr r1, =gScriptResult - movs r0, 0x1 - b _081A0D34 - .pool -_081A0D30: - ldr r1, =gScriptResult - movs r0, 0x5 -_081A0D34: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0CC0 - - thumb_func_start sub_81A0D40 -sub_81A0D40: @ 81A0D40 - push {r4,lr} - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A0D6E - ldr r4, =gSpecialVar_0x8006 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r2, 0xB2 - ldrb r3, [r2] - lsls r0, r3, 29 - lsrs r0, 29 - movs r1, 0x1 - ldrb r4, [r4] - lsls r1, r4 - orrs r1, r0 - movs r0, 0x7 - ands r1, r0 - movs r0, 0x8 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] -_081A0D6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0D40 - - thumb_func_start sub_81A0D80 -sub_81A0D80: @ 81A0D80 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r1, r0, 26 - lsrs r0, r1, 28 - cmp r0, 0x2 - bls _081A0DCE - subs r0, 0x3 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A0DC0 - lsls r2, 2 - adds r2, r3, r2 - adds r2, 0xB8 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - b _081A0DCE - .pool -_081A0DC0: - lsls r0, r2, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r2, [r0] - movs r1, 0x3F - ands r1, r2 - strb r1, [r0] -_081A0DCE: - pop {r0} - bx r0 - thumb_func_end sub_81A0D80 - - thumb_func_start sub_81A0DD4 -sub_81A0DD4: @ 81A0DD4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r6, 0 - movs r2, 0 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - ldr r3, =gUnknown_030062F0 - mov r9, r3 - cmp r0, 0 - beq _081A0E14 - adds r3, r1, 0 -_081A0DF4: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x8 - bhi _081A0E14 - ldr r0, [r3] - lsls r1, r2, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A0DF4 -_081A0E14: - mov r4, r9 - movs r0, 0x8 - bl AllocZeroed - adds r7, r0, 0 - str r7, [r4] - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x2 - bne _081A0E88 - ldr r0, =gSaveBlock2Ptr - ldr r5, [r0] - adds r6, r5, 0 - adds r6, 0xB1 - ldrb r0, [r6] - lsls r1, r0, 26 - lsrs r0, r1, 28 - cmp r0, 0x2 - bls _081A0E3C - b _081A0FCE -_081A0E3C: - adds r2, r5, 0 - adds r2, 0xB4 - adds r0, r2, r0 - ldrb r0, [r0] - lsrs r4, r0, 4 - ldr r3, =gUnknown_08610970 - lsls r1, r4, 1 - adds r5, 0xB0 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0 - adds r3, 0x34 - adds r1, r3 - ldrh r0, [r1] - strh r0, [r7, 0x2] - ldrb r0, [r6] - lsls r0, 26 - lsrs r0, 28 - adds r2, r0 - ldrb r1, [r2] - movs r0, 0xF - ands r0, r1 - lsls r0, 1 - ldrb r1, [r5] - muls r1, r4 - adds r0, r1 - adds r0, r3 - b _081A0FCA - .pool -_081A0E88: - cmp r0, 0x3 - bne _081A0F54 - ldr r0, =gSaveBlock2Ptr - mov r8, r0 - ldr r5, [r0] - movs r1, 0xB1 - adds r1, r5 - mov r12, r1 - ldrb r0, [r1] - lsls r2, r0, 26 - lsrs r0, r2, 28 - cmp r0, 0x2 - bhi _081A0EA4 - b _081A0FCE -_081A0EA4: - adds r1, r0, 0 - adds r0, r6, 0x3 - cmp r1, r0 - blt _081A0EAE - b _081A0FCE -_081A0EAE: - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x2 - beq _081A0EC4 - b _081A0FCE -_081A0EC4: - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r6, r0, 30 - adds r0, r5, 0 - adds r0, 0xB2 - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 29 - asrs r1, r6 - movs r0, 0x1 - ands r1, r0 - adds r0, r5, 0 - adds r0, 0xB4 - adds r0, r6 - ldrb r4, [r0] - lsls r1, 2 - asrs r4, r1 - movs r0, 0xF - ands r4, r0 - ldr r2, =gUnknown_08610970 - lsls r1, r4, 1 - adds r0, r5, 0 - adds r0, 0xB0 - ldrb r3, [r0] - movs r0, 0x58 - muls r0, r3 - adds r1, r0 - adds r2, 0x34 - adds r1, r2 - ldrh r0, [r1] - strh r0, [r7] - mov r3, r12 - ldrb r0, [r3] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0xB8 - ldrb r2, [r0] - lsls r2, 26 - lsrs r2, 30 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81A0284 - mov r1, r9 - ldr r2, [r1] - strh r0, [r2, 0x4] - mov r3, r8 - ldr r1, [r3] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r1, r0 - adds r1, 0xBA - ldrh r0, [r1] - strh r0, [r2, 0x6] - b _081A0FCE - .pool -_081A0F54: - cmp r0, 0x4 - bne _081A0FCE - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r2, r0, 26 - lsrs r0, r2, 28 - cmp r0, 0x2 - bls _081A0FCE - adds r1, r0, 0 - adds r0, r6, 0x3 - cmp r1, r0 - bge _081A0FCE - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _081A0FCE - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r6, r0, 30 - adds r0, r3, 0 - adds r0, 0xB2 - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 29 - asrs r1, r6 - movs r0, 0x1 - ands r1, r0 - adds r0, r3, 0 - adds r0, 0xB4 - adds r0, r6 - ldrb r0, [r0] - lsls r1, 2 - asrs r0, r1 - movs r1, 0xF - ands r0, r1 - ldr r2, =gUnknown_08610970 - lsls r0, 1 - adds r1, r3, 0 - adds r1, 0xB0 - ldrb r3, [r1] - movs r1, 0x58 - muls r1, r3 - adds r0, r1 - adds r2, 0x34 - adds r0, r2 -_081A0FCA: - ldrh r0, [r0] - strh r0, [r7] -_081A0FCE: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0DD4 - - thumb_func_start sub_81A0FE4 -sub_81A0FE4: @ 81A0FE4 - push {r4,lr} - ldr r4, =gUnknown_030062F0 - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0FE4 - - thumb_func_start sub_81A0FFC -sub_81A0FFC: @ 81A0FFC - push {r4-r6,lr} - sub sp, 0x10 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _081A1028 - cmp r0, 0x1 - bgt _081A1018 - cmp r0, 0 - beq _081A101E - b _081A11E6 - .pool -_081A1018: - cmp r0, 0x2 - beq _081A1030 - b _081A11E6 -_081A101E: - ldr r5, =gStringVar1 - b _081A1032 - .pool -_081A1028: - ldr r5, =gStringVar2 - b _081A1032 - .pool -_081A1030: - ldr r5, =gStringVar3 -_081A1032: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0x9 - bls _081A103C - b _081A11E6 -_081A103C: - lsls r0, 2 - ldr r1, =_081A1054 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A1054: - .4byte _081A107C - .4byte _081A1094 - .4byte _081A10AC - .4byte _081A10C4 - .4byte _081A10DC - .4byte _081A10F4 - .4byte _081A1118 - .4byte _081A1164 - .4byte _081A1140 - .4byte _081A1184 -_081A107C: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - b _081A1174 - .pool -_081A1094: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0, 0x2] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - b _081A1174 - .pool -_081A10AC: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - b _081A1174 - .pool -_081A10C4: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - b _081A1174 - .pool -_081A10DC: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0, 0x6] - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - b _081A1174 - .pool -_081A10F4: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r1, r0 - adds r1, 0xBA - ldrh r0, [r1] - bl ItemId_GetItem - adds r1, r0, 0 - b _081A1174 - .pool -_081A1118: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - movs r1, 0x2 - bl sub_81A1650 - adds r1, r0, 0 - mov r0, sp - movs r2, 0x2 - bl sub_81DB5E8 - adds r0, r5, 0 - mov r1, sp - bl StringCopy - b _081A11E6 - .pool -_081A1140: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _081A115C - ldr r1, =gUnknown_085EAEB1 - b _081A1174 - .pool -_081A115C: - ldr r1, =gUnknown_085EAEB8 - b _081A1174 - .pool -_081A1164: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0x82 - lsls r1, 1 - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - ldr r1, =gStringVar4 -_081A1174: - adds r0, r5, 0 - bl StringCopy - b _081A11E6 - .pool -_081A1184: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r1, r3, 0 - adds r1, 0xB1 - ldrb r1, [r1] - lsls r4, r1, 24 - lsrs r1, r4, 30 - adds r6, r0, 0 - cmp r1, 0x2 - bhi _081A11C0 - adds r0, r3, 0 - adds r0, 0xB4 - adds r0, r1 - ldrb r2, [r0] - adds r0, r3, 0 - adds r0, 0xB2 - ldrb r0, [r0] - lsls r0, 29 - lsrs r0, 29 - asrs r0, r1 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - asrs r2, r0 - movs r0, 0xF - ands r2, r0 - b _081A11C2 - .pool -_081A11C0: - movs r2, 0 -_081A11C2: - ldr r3, =gUnknown_08610970 - lsls r1, r2, 1 - ldr r0, [r6] - adds r0, 0xB0 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, r0 - adds r3, 0x34 - adds r1, r3 - ldrh r1, [r1] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r5, 0 - bl StringCopy -_081A11E6: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0FFC - - thumb_func_start sub_81A11F8 -sub_81A11F8: @ 81A11F8 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8005 - ldrb r1, [r0] - adds r2, 0xB1 - lsls r1, 6 - ldrb r3, [r2] - movs r0, 0x3F - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_81A11F8 - - thumb_func_start sub_81A1218 -sub_81A1218: @ 81A1218 - push {lr} - bl sub_81AAC28 - pop {r0} - bx r0 - thumb_func_end sub_81A1218 - - thumb_func_start sub_81A1224 -sub_81A1224: @ 81A1224 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r1, =gSaveBlock2Ptr - ldr r3, [r1] - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - adds r7, r1, 0 - cmp r0, 0x2 - bhi _081A1242 - b _081A1362 -_081A1242: - movs r5, 0 - movs r2, 0 - adds r0, r3, 0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - ldr r1, =gSpecialVar_0x8005 - mov r12, r1 - ldr r1, =gScriptResult - mov r8, r1 - cmp r0, 0 - beq _081A127C - adds r3, r7, 0 -_081A125C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x8 - bhi _081A127C - ldr r0, [r3] - lsls r1, r2, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A125C -_081A127C: - movs r4, 0 - cmp r4, r5 - bcs _081A1322 - ldr r0, [r7] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - cmp r4, r0 - bge _081A1322 - adds r6, r7, 0 - mov r9, r4 -_081A1296: - ldr r3, [r6] - lsls r0, r4, 2 - adds r2, r3, r0 - adds r0, r2, 0 - adds r0, 0xB8 - ldrb r1, [r0] - lsls r0, r1, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _081A1308 - lsrs r0, r1, 6 - cmp r0, 0 - beq _081A1308 - adds r0, r2, 0 - adds r0, 0xBA - ldrh r0, [r0] - mov r2, r12 - ldrh r2, [r2] - cmp r0, r2 - bne _081A1308 - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r2, [r0] - movs r1, 0x3F - ands r1, r2 - strb r1, [r0] - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r1, r0 - mov r2, r12 - ldrh r0, [r2] - adds r1, 0xBA - strh r0, [r1] - mov r1, r9 - mov r0, r8 - strh r1, [r0] - b _081A1362 - .pool -_081A1308: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcs _081A1322 - ldr r0, [r6] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - cmp r4, r0 - blt _081A1296 -_081A1322: - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r2, r0 - adds r2, 0xB8 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r1, r0 - mov r2, r12 - ldrh r0, [r2] - adds r1, 0xBA - strh r0, [r1] - movs r0, 0x1 - mov r1, r8 - strh r0, [r1] -_081A1362: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A1224 - - thumb_func_start sub_81A1370 -sub_81A1370: @ 81A1370 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - movs r2, 0x8A - lsls r2, 1 - adds r1, r2 - ldrb r1, [r1] - adds r4, r0, 0 - cmp r1, 0xFF - beq _081A1422 - movs r5, 0 -_081A138E: - ldr r1, [r4] - adds r2, r5, 0x1 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r3, r1, r0 - movs r5, 0x8A - lsls r5, 1 - adds r0, r3, r5 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081A13B8 - adds r0, r3, 0 - adds r0, 0xDC - adds r1, 0xDC - movs r2, 0x44 - bl memcpy - b _081A1422 - .pool -_081A13B8: - adds r5, r2, 0 - cmp r5, 0x2 - ble _081A138E - ldr r0, =0x0000ffff - mov r10, r0 - movs r2, 0x1 - negs r2, r2 - mov r9, r2 - movs r5, 0x1 - ldr r7, =gSaveBlock2Ptr - movs r0, 0x90 - lsls r0, 1 - mov r8, r0 - movs r6, 0x44 -_081A13D4: - ldr r0, [r7] - add r0, r8 - adds r0, 0x34 - bl ReadUnalignedWord - adds r4, r0, 0 - ldr r0, [r7] - adds r0, 0xA - bl ReadUnalignedWord - cmp r4, r0 - bne _081A13FC - ldr r0, [r7] - adds r0, r6 - adds r0, 0xDE - ldrb r0, [r0] - cmp r0, r10 - bge _081A13FC - mov r10, r0 - mov r9, r5 -_081A13FC: - movs r2, 0x44 - add r8, r2 - adds r6, 0x44 - adds r5, 0x1 - cmp r5, 0x3 - ble _081A13D4 - mov r5, r9 - cmp r5, 0 - ble _081A1422 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r5, 4 - add r0, r9 - lsls r0, 2 - adds r0, r1, r0 - adds r0, 0xDC - adds r1, 0xDC - bl memcpy -_081A1422: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1370 - - thumb_func_start sub_81A1438 -sub_81A1438: @ 81A1438 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0xB0 - ldrb r0, [r0] - adds r2, 0xDC - movs r1, 0x1F - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x20 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0xB1 - ldrb r1, [r0] - lsls r1, 30 - adds r2, 0xDC - lsrs r1, 25 - ldrb r3, [r2] - movs r0, 0x61 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - movs r2, 0 - ldr r0, [r4] - b _081A148C - .pool -_081A147C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x8 - bhi _081A1496 - ldr r0, [r4] - lsls r1, r2, 2 - adds r0, r1 -_081A148C: - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A147C -_081A1496: - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - adds r0, 0xDD - strb r2, [r0] - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xDE - ldrb r0, [r1] - cmp r0, 0xFE - bhi _081A14AE - adds r0, 0x1 - strb r0, [r1] -_081A14AE: - ldr r0, [r4] - adds r0, 0xDD - ldrb r0, [r0] - bl sub_81A0390 - movs r2, 0 - adds r3, r4, 0 - movs r4, 0x88 - lsls r4, 1 - adds r5, r3, 0 -_081A14C2: - ldr r0, [r3] - adds r1, r0, r4 - adds r1, r2 - adds r0, 0xA - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _081A14C2 - ldr r1, [r5] - movs r2, 0x8A - lsls r2, 1 - adds r0, r1, r2 - bl StringCopy - ldr r1, [r5] - ldr r0, =gGameLanguage - ldrb r0, [r0] - ldr r2, =0x0000011b - adds r1, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, 0xDC - bl sub_8165AE8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1438 - - thumb_func_start sub_81A150C -sub_81A150C: @ 81A150C - push {lr} - ldr r2, =gUnknown_08610970 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xDC - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x32 - ldrb r2, [r0] - movs r1, 0 - ldr r3, =gUnknown_085DCEDC - ldrb r0, [r3] - cmp r0, r2 - beq _081A1542 -_081A1530: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1D - bhi _081A1542 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081A1530 -_081A1542: - cmp r1, 0x1E - beq _081A1568 - ldr r0, =gUnknown_085DCF0E - adds r0, r1, r0 - ldrb r1, [r0] - ldr r0, =0x00004010 - bl VarSet - b _081A1594 - .pool -_081A1568: - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _081A1584 -_081A1572: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x13 - bhi _081A1584 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081A1572 -_081A1584: - cmp r1, 0x14 - beq _081A1594 - ldr r0, =gUnknown_085DCF2C - adds r0, r1, r0 - ldrb r1, [r0] - ldr r0, =0x00004010 - bl VarSet -_081A1594: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A150C - - thumb_func_start sub_81A15A4 -sub_81A15A4: @ 81A15A4 - push {lr} - ldr r2, =gUnknown_08610970 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x32 - ldrb r2, [r0] - movs r1, 0 - ldr r3, =gUnknown_085DCEDC - ldrb r0, [r3] - cmp r0, r2 - beq _081A15D6 -_081A15C4: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1D - bhi _081A15D6 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081A15C4 -_081A15D6: - cmp r1, 0x1E - beq _081A15FC - ldr r0, =gUnknown_085DCF0E - adds r0, r1, r0 - ldrb r1, [r0] - ldr r0, =0x00004010 - bl VarSet - b _081A1628 - .pool -_081A15FC: - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _081A1618 -_081A1606: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x13 - bhi _081A1618 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081A1606 -_081A1618: - cmp r1, 0x14 - beq _081A1628 - ldr r0, =gUnknown_085DCF2C - adds r0, r1, r0 - ldrb r1, [r0] - ldr r0, =0x00004010 - bl VarSet -_081A1628: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A15A4 - - thumb_func_start sub_81A1638 -sub_81A1638: @ 81A1638 - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A1638 - - thumb_func_start sub_81A1644 -sub_81A1644: @ 81A1644 - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A1644 - - thumb_func_start sub_81A1650 -sub_81A1650: @ 81A1650 - push {lr} - movs r2, 0x58 - muls r2, r0 - ldr r0, =gUnknown_08610970 - adds r2, r0 - subs r0, r1, 0x1 - cmp r0, 0x6 - bhi _081A16AC - lsls r0, 2 - ldr r1, =_081A1674 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A1674: - .4byte _081A1690 - .4byte _081A1694 - .4byte _081A169A - .4byte _081A16A0 - .4byte _081A16A6 - .4byte _081A16AC - .4byte _081A16AC -_081A1690: - adds r0, r2, 0 - b _081A16B0 -_081A1694: - adds r0, r2, 0 - adds r0, 0x8 - b _081A16B0 -_081A169A: - adds r0, r2, 0 - adds r0, 0x10 - b _081A16B0 -_081A16A0: - adds r0, r2, 0 - adds r0, 0x18 - b _081A16B0 -_081A16A6: - adds r0, r2, 0 - adds r0, 0x20 - b _081A16B0 -_081A16AC: - adds r0, r2, 0 - adds r0, 0x28 -_081A16B0: - pop {r1} - bx r1 - thumb_func_end sub_81A1650 - - thumb_func_start sub_81A16B4 -sub_81A16B4: @ 81A16B4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081A16CE - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081A16D4 -_081A16CE: - adds r0, r2, 0 - bl SwitchTaskToFollowupFunc -_081A16D4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A16B4 - - thumb_func_start sub_81A16DC -sub_81A16DC: @ 81A16DC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081A16F6 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081A1718 -_081A16F6: - ldr r2, =gUnknown_030062F4 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - movs r3, 0xA - ldrsh r0, [r0, r3] - lsls r0, 16 - orrs r1, r0 - str r1, [r2] - bl _call_via_r1 - adds r0, r4, 0 - bl DestroyTask -_081A1718: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A16DC - - thumb_func_start sub_81A172C -sub_81A172C: @ 81A172C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =sub_81A16DC - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - lsrs r4, 16 - strh r4, [r1, 0xA] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A172C - - thumb_func_start sub_81A175C -sub_81A175C: @ 81A175C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =sub_81A16B4 - adds r0, r4, 0 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - adds r2, r5, 0 - bl SetTaskFuncWithFollowupFunc - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A175C - - thumb_func_start sub_81A1780 -sub_81A1780: @ 81A1780 - push {lr} - ldr r1, =gUnknown_08611C18 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1780 - - thumb_func_start sub_81A17A0 -sub_81A17A0: @ 81A17A0 - push {lr} - movs r0, 0x80 - lsls r0, 7 - movs r1, 0xFF - bl VarSet - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca8 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - bhi _081A1822 - lsls r0, 2 - ldr r1, =_081A17D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A17D0: - .4byte _081A1822 - .4byte _081A17E4 - .4byte _081A1810 - .4byte _081A17EC - .4byte _081A17E8 -_081A17E4: - movs r0, 0 - b _081A17EE -_081A17E8: - movs r0, 0 - b _081A17EE -_081A17EC: - movs r0, 0x1 -_081A17EE: - bl sub_813A878 - movs r0, 0x80 - lsls r0, 7 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000ca8 - adds r1, r2 - ldrb r1, [r1] - bl VarSet - b _081A1822 - .pool -_081A1810: - movs r0, 0x80 - lsls r0, 7 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000ca8 - adds r1, r2 - ldrb r1, [r1] - bl VarSet -_081A1822: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A17A0 - - thumb_func_start sub_81A1830 -sub_81A1830: @ 81A1830 - push {r4-r6,lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - bl sub_81A3B30 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bne _081A184C - movs r5, 0x1 -_081A184C: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x7 - bls _081A1856 - b _081A1956 -_081A1856: - lsls r0, 2 - ldr r1, =_081A186C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A186C: - .4byte _081A188C - .4byte _081A18A8 - .4byte _081A18C8 - .4byte _081A18E4 - .4byte _081A1956 - .4byte _081A1900 - .4byte _081A1918 - .4byte _081A1938 -_081A188C: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ca8 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1] - b _081A1956 - .pool -_081A18A8: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - strh r0, [r1] - b _081A1956 - .pool -_081A18C8: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000cb2 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - b _081A1956 - .pool -_081A18E4: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - b _081A1926 - .pool -_081A1900: - ldr r2, =gScriptResult - ldr r1, =gBattleOutcome - ldrb r0, [r1] - strh r0, [r2] - movs r0, 0 - strb r0, [r1] - b _081A1956 - .pool -_081A1918: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 28 -_081A1926: - lsrs r0, 31 - strh r0, [r1] - b _081A1956 - .pool -_081A1938: - ldr r4, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - movs r0, 0xD0 - lsls r0, 4 - adds r2, r0 - ldr r3, =gUnknown_08611BFC - lsls r0, r5, 1 - lsls r1, r6, 2 - adds r0, r1 - adds r0, r3 - ldrh r1, [r2] - ldrh r0, [r0] - ands r0, r1 - strh r0, [r4] -_081A1956: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1830 - - thumb_func_start sub_81A1968 -sub_81A1968: @ 81A1968 - push {r4,r5,lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl sub_81A3B30 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bne _081A1984 - movs r4, 0x1 -_081A1984: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x7 - bls _081A198E - b _081A1AC4 -_081A198E: - lsls r0, 2 - ldr r1, =_081A19A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A19A4: - .4byte _081A19C4 - .4byte _081A19E0 - .4byte _081A1A0C - .4byte _081A1A28 - .4byte _081A1A50 - .4byte _081A1AC4 - .4byte _081A1A7C - .4byte _081A1AA8 -_081A19C4: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - b _081A1AC4 - .pool -_081A19E0: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r2, r1 - movs r1, 0x3 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - b _081A1AC4 - .pool -_081A1A0C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000cb2 - adds r0, r2 - strh r1, [r0] - b _081A1AC4 - .pool -_081A1A28: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - b _081A1A94 - .pool -_081A1A50: - movs r2, 0 - ldr r5, =gSaveBlock2Ptr - ldr r4, =0x00000caa - ldr r3, =gUnknown_0203CEF8 -_081A1A58: - ldr r1, [r5] - lsls r0, r2, 1 - adds r1, r4 - adds r1, r0 - adds r0, r2, r3 - ldrb r0, [r0] - strh r0, [r1] - adds r2, 0x1 - cmp r2, 0x3 - ble _081A1A58 - b _081A1AC4 - .pool -_081A1A7C: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000ca9 - adds r3, r2 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 -_081A1A94: - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _081A1AC4 - .pool -_081A1AA8: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - movs r0, 0xD0 - lsls r0, 4 - adds r2, r0 - ldr r3, =gUnknown_08611BFC - lsls r1, r4, 1 - lsls r0, r5, 2 - adds r1, r0 - adds r1, r3 - ldrh r0, [r2] - ldrh r1, [r1] - orrs r0, r1 - strh r0, [r2] -_081A1AC4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1968 - - thumb_func_start sub_81A1AD4 -sub_81A1AD4: @ 81A1AD4 - push {r4-r7,lr} - bl sub_81B8558 - movs r3, 0 - ldr r4, =gSpecialVar_0x8005 - ldrh r0, [r4] - cmp r3, r0 - bge _081A1B00 - ldr r7, =gUnknown_0203CEF8 - ldr r6, =gSaveBlock2Ptr - ldr r5, =0x00000caa -_081A1AEA: - adds r2, r3, r7 - ldr r0, [r6] - lsls r1, r3, 1 - adds r0, r5 - adds r0, r1 - ldrh r0, [r0] - strb r0, [r2] - adds r3, 0x1 - ldrh r0, [r4] - cmp r3, r0 - blt _081A1AEA -_081A1B00: - bl sub_80F94E8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1AD4 - - thumb_func_start sub_81A1B1C -sub_81A1B1C: @ 81A1B1C - push {lr} - bl DoSoftReset - pop {r0} - bx r0 - thumb_func_end sub_81A1B1C - - thumb_func_start sub_81A1B28 -sub_81A1B28: @ 81A1B28 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - bx lr - .pool - thumb_func_end sub_81A1B28 - - thumb_func_start sub_81A1B38 -sub_81A1B38: @ 81A1B38 - push {r4,r5,lr} - movs r4, 0 - movs r5, 0x64 -_081A1B3E: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000caa - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bhi _081A1B76 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrh r1, [r1] - subs r1, 0x1 - muls r1, r5 - adds r0, r1 - movs r1, 0x8E - lsls r1, 2 - adds r0, r1 - ldr r2, =gPlayerParty - adds r1, r4, 0 - muls r1, r5 - adds r1, r2 - movs r2, 0x64 - bl memcpy -_081A1B76: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081A1B3E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1B38 - - thumb_func_start sub_81A1B98 -sub_81A1B98: @ 81A1B98 - push {lr} - ldr r0, =gSpecialVar_0x8006 - ldrh r1, [r0] - adds r2, r0, 0 - cmp r1, 0x3 - bls _081A1BA8 - movs r0, 0 - strh r0, [r2] -_081A1BA8: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x7 - bhi _081A1C1E - lsls r0, 2 - ldr r1, =_081A1BC8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A1BC8: - .4byte _081A1BE8 - .4byte _081A1BF0 - .4byte _081A1BF8 - .4byte _081A1C0E - .4byte _081A1C06 - .4byte _081A1C00 - .4byte _081A1C14 - .4byte _081A1C1A -_081A1BE8: - ldrb r0, [r2] - bl sub_81A1EA8 - b _081A1C1E -_081A1BF0: - ldrb r0, [r2] - bl sub_81A2134 - b _081A1C1E -_081A1BF8: - ldrb r0, [r2] - bl sub_81A2460 - b _081A1C1E -_081A1C00: - bl sub_81A2698 - b _081A1C1E -_081A1C06: - ldrb r0, [r2] - bl sub_81A2C94 - b _081A1C1E -_081A1C0E: - bl sub_81A2968 - b _081A1C1E -_081A1C14: - bl sub_81A2F38 - b _081A1C1E -_081A1C1A: - bl sub_81A2FF8 -_081A1C1E: - pop {r0} - bx r0 - thumb_func_end sub_81A1B98 - - thumb_func_start sub_81A1C24 -sub_81A1C24: @ 81A1C24 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000cdc - adds r1, r2 - ldr r1, [r1] - ands r1, r0 - cmp r1, 0 - bne _081A1C44 - movs r0, 0 - b _081A1C46 - .pool -_081A1C44: - movs r0, 0x1 -_081A1C46: - pop {r1} - bx r1 - thumb_func_end sub_81A1C24 - - thumb_func_start sub_81A1C4C -sub_81A1C4C: @ 81A1C4C - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xE0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r0, r5, 3 - adds r5, r0, 0x1 - ldr r0, =gUnknown_0203AB74 - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - lsls r1, r5, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - bl Print - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1C4C - - thumb_func_start sub_81A1C90 -sub_81A1C90: @ 81A1C90 - push {r4,lr} - sub sp, 0x34 - adds r2, r0, 0 - ldr r3, =gUnknown_0203AB74 - movs r1, 0xAE - mov r0, sp - adds r0, 0x2F -_081A1C9E: - strb r1, [r0] - subs r0, 0x1 - add r4, sp, 0xC - cmp r0, r4 - bge _081A1C9E - add r1, sp, 0x30 - movs r0, 0xFF - strb r0, [r1] - lsls r0, r2, 3 - adds r2, r0, 0x1 - ldrb r0, [r3] - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x4 - bl Print - add sp, 0x34 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1C90 - - thumb_func_start sub_81A1CD8 -sub_81A1CD8: @ 81A1CD8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x30] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl Print - ldr r0, =0x0000270f - cmp r6, r0 - bls _081A1D24 - adds r6, r0, 0 -_081A1D24: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE302 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r7, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl Print - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1CD8 - - thumb_func_start sub_81A1D78 -sub_81A1D78: @ 81A1D78 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, [sp, 0x10] - lsls r0, 24 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =gSaveBlock2Ptr - ldr r4, [r4] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - movs r0, 0xCF - lsls r0, 4 - adds r4, r0 - adds r4, r1 - ldrh r1, [r4] - ldr r0, =gUnknown_085EE319 - str r5, [sp] - bl sub_81A1CD8 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1D78 - - thumb_func_start sub_81A1DBC -sub_81A1DBC: @ 81A1DBC - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - movs r0, 0xCE - lsls r0, 4 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A1DDE - adds r0, r1, 0 -_081A1DDE: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A1DBC - - thumb_func_start sub_81A1DEC -sub_81A1DEC: @ 81A1DEC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r4, [sp, 0x20] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - lsls r4, 24 - lsrs r7, r4, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_81A1DBC - lsls r0, 16 - lsrs r4, r0, 16 - cmp r5, 0x1 - beq _081A1E38 - cmp r5, 0x1 - ble _081A1E2C - cmp r5, 0x2 - beq _081A1E48 - cmp r5, 0x3 - beq _081A1E58 -_081A1E2C: - cmp r6, 0 - beq _081A1E34 - movs r0, 0x2 - b _081A1E66 -_081A1E34: - movs r0, 0x1 - b _081A1E66 -_081A1E38: - cmp r6, 0 - beq _081A1E42 - movs r0, 0x80 - lsls r0, 8 - b _081A1E66 -_081A1E42: - movs r0, 0x80 - lsls r0, 7 - b _081A1E66 -_081A1E48: - cmp r6, 0 - beq _081A1E52 - movs r0, 0x80 - lsls r0, 10 - b _081A1E66 -_081A1E52: - movs r0, 0x80 - lsls r0, 9 - b _081A1E66 -_081A1E58: - cmp r6, 0 - beq _081A1E62 - movs r0, 0x80 - lsls r0, 12 - b _081A1E66 -_081A1E62: - movs r0, 0x80 - lsls r0, 11 -_081A1E66: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A1E88 - ldr r0, =gUnknown_085EE311 - str r7, [sp] - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_81A1CD8 - b _081A1E96 - .pool -_081A1E88: - ldr r0, =gUnknown_085EE320 - str r7, [sp] - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_81A1CD8 -_081A1E96: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1DEC - - thumb_func_start sub_81A1EA8 -sub_81A1EA8: @ 81A1EA8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - cmp r7, 0 - bne _081A1EF0 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE158 - bl StringExpandPlaceholders - b _081A1F28 - .pool -_081A1EF0: - cmp r7, 0x1 - bne _081A1F08 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE178 - bl StringExpandPlaceholders - b _081A1F28 - .pool -_081A1F08: - cmp r7, 0x2 - bne _081A1F20 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE198 - bl StringExpandPlaceholders - b _081A1F28 - .pool -_081A1F20: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE1B7 - bl StringExpandPlaceholders -_081A1F28: - ldr r0, =gStringVar4 - movs r1, 0x2 - bl sub_81A1C4C - ldr r6, =gUnknown_0203AB74 - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x31 - mov r8, r1 - str r1, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl Print - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - mov r9, r1 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl Print - movs r0, 0xA - bl sub_81A1C90 - mov r0, r8 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x48 - movs r3, 0x84 - bl sub_81A1DEC - movs r0, 0x41 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x48 - movs r3, 0x84 - bl sub_81A1D78 - mov r1, r9 - str r1, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x48 - movs r3, 0x84 - bl sub_81A1DEC - movs r0, 0x71 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x48 - movs r3, 0x84 - bl sub_81A1D78 - ldrb r0, [r6] - bl PutWindowTilemap - ldrb r0, [r6] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1EA8 - - thumb_func_start sub_81A1FD8 -sub_81A1FD8: @ 81A1FD8 - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000d0c - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A1FF8 - adds r0, r1, 0 -_081A1FF8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A1FD8 - - thumb_func_start sub_81A2008 -sub_81A2008: @ 81A2008 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r12, r0 - adds r7, r1, 0 - adds r4, r2, 0 - ldr r6, [sp, 0x2C] - ldr r5, [sp, 0x30] - lsls r4, 16 - lsrs r4, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r5, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r12 - bl Print - ldr r0, =gStringVar1 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - adds r0, r4, 0 - adds r1, r7, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r5, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r6, 0 - bl Print - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2008 - - thumb_func_start sub_81A2094 -sub_81A2094: @ 81A2094 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - ldr r4, [sp, 0x24] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_81A1FD8 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r5, 0 - beq _081A20CC - cmp r5, 0x1 - beq _081A20D8 -_081A20CC: - cmp r6, 0 - beq _081A20D4 - movs r0, 0x8 - b _081A20E6 -_081A20D4: - movs r0, 0x4 - b _081A20E6 -_081A20D8: - cmp r6, 0 - beq _081A20E2 - movs r0, 0x80 - lsls r0, 14 - b _081A20E6 -_081A20E2: - movs r0, 0x80 - lsls r0, 13 -_081A20E6: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A210C - ldr r0, =gUnknown_085EE311 - ldr r1, =gUnknown_085EE338 - str r7, [sp] - str r4, [sp, 0x4] - mov r2, r8 - mov r3, r9 - bl sub_81A2008 - b _081A211C - .pool -_081A210C: - ldr r0, =gUnknown_085EE320 - ldr r1, =gUnknown_085EE338 - str r7, [sp] - str r4, [sp, 0x4] - mov r2, r8 - mov r3, r9 - bl sub_81A2008 -_081A211C: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2094 - - thumb_func_start sub_81A2134 -sub_81A2134: @ 81A2134 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - cmp r7, 0 - bne _081A217C - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE1DB - bl StringExpandPlaceholders - b _081A2184 - .pool -_081A217C: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE1FE - bl StringExpandPlaceholders -_081A2184: - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81A1C4C - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - ldr r2, =gUnknown_085EE2F2 - movs r6, 0x21 - str r6, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0xA - bl sub_81A1C90 - str r6, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x40 - movs r3, 0x79 - bl sub_81A2094 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - lsls r5, r7, 2 - ldr r1, =0x00000d14 - adds r0, r1 - adds r0, r5 - ldrh r2, [r0] - movs r0, 0x79 - mov r9, r0 - str r0, [sp] - movs r0, 0x31 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085EE319 - ldr r1, =gUnknown_085EE338 - movs r3, 0x40 - bl sub_81A2008 - ldr r1, =gUnknown_085EE332 - mov r10, r1 - ldr r0, =gUnknown_085EE349 - mov r8, r0 - ldr r0, [r4] - ldr r1, =0x00000d1c - adds r0, r1 - adds r0, r5 - ldrh r2, [r0] - movs r6, 0x70 - str r6, [sp] - movs r0, 0x41 - str r0, [sp, 0x4] - mov r0, r10 - mov r1, r8 - movs r3, 0x40 - bl sub_81A2008 - movs r0, 0x61 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x40 - movs r3, 0x79 - bl sub_81A2094 - ldr r0, [r4] - ldr r1, =0x00000d16 - adds r0, r1 - adds r0, r5 - ldrh r2, [r0] - mov r0, r9 - str r0, [sp] - movs r0, 0x71 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085EE319 - ldr r1, =gUnknown_085EE338 - movs r3, 0x40 - bl sub_81A2008 - ldr r0, [r4] - ldr r1, =0x00000d1e - adds r0, r1 - adds r0, r5 - ldrh r2, [r0] - str r6, [sp] - movs r0, 0x81 - str r0, [sp, 0x4] - mov r0, r10 - mov r1, r8 - movs r3, 0x40 - bl sub_81A2008 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - bl PutWindowTilemap - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2134 - - thumb_func_start sub_81A22B8 -sub_81A22B8: @ 81A22B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x30] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl Print - ldr r0, =0x0000270f - cmp r6, r0 - bls _081A2304 - adds r6, r0, 0 -_081A2304: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE302 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r7, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl Print - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A22B8 - - thumb_func_start sub_81A2358 -sub_81A2358: @ 81A2358 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, [sp, 0x10] - lsls r0, 24 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =gSaveBlock2Ptr - ldr r4, [r4] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - movs r0, 0xDD - lsls r0, 4 - adds r4, r0 - adds r4, r1 - ldrh r1, [r4] - ldr r0, =gUnknown_085EE319 - str r5, [sp] - bl sub_81A22B8 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2358 - - thumb_func_start sub_81A239C -sub_81A239C: @ 81A239C - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000dc8 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A23BC - adds r0, r1, 0 -_081A23BC: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A239C - - thumb_func_start sub_81A23CC -sub_81A23CC: @ 81A23CC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r4, [sp, 0x20] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - lsls r4, 24 - lsrs r7, r4, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_81A239C - lsls r0, 16 - lsrs r4, r0, 16 - cmp r5, 0 - beq _081A2404 - cmp r5, 0x1 - beq _081A2410 -_081A2404: - cmp r6, 0 - beq _081A240C - movs r0, 0x20 - b _081A241E -_081A240C: - movs r0, 0x10 - b _081A241E -_081A2410: - cmp r6, 0 - beq _081A241A - movs r0, 0x80 - lsls r0, 16 - b _081A241E -_081A241A: - movs r0, 0x80 - lsls r0, 15 -_081A241E: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2440 - ldr r0, =gUnknown_085EE311 - str r7, [sp] - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_81A22B8 - b _081A244E - .pool -_081A2440: - ldr r0, =gUnknown_085EE320 - str r7, [sp] - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_81A22B8 -_081A244E: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A23CC - - thumb_func_start sub_81A2460 -sub_81A2460: @ 81A2460 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - cmp r7, 0 - bne _081A24A8 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE221 - bl StringExpandPlaceholders - b _081A24B0 - .pool -_081A24A8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE241 - bl StringExpandPlaceholders -_081A24B0: - ldr r0, =gStringVar4 - movs r1, 0x2 - bl sub_81A1C4C - ldr r6, =gUnknown_0203AB74 - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x31 - mov r8, r1 - str r1, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl Print - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - mov r9, r1 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl Print - movs r0, 0xA - bl sub_81A1C90 - mov r0, r8 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x48 - movs r3, 0x83 - bl sub_81A23CC - movs r0, 0x41 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x48 - movs r3, 0x83 - bl sub_81A2358 - mov r1, r9 - str r1, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x48 - movs r3, 0x83 - bl sub_81A23CC - movs r0, 0x71 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x48 - movs r3, 0x83 - bl sub_81A2358 - ldrb r0, [r6] - bl PutWindowTilemap - ldrb r0, [r6] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2460 - - thumb_func_start sub_81A2560 -sub_81A2560: @ 81A2560 - push {lr} - lsls r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000e04 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A257A - adds r0, r1, 0 -_081A257A: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A2560 - - thumb_func_start sub_81A258C -sub_81A258C: @ 81A258C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r12, r0 - adds r7, r1, 0 - adds r4, r2, 0 - ldr r6, [sp, 0x2C] - ldr r5, [sp, 0x30] - lsls r4, 16 - lsrs r4, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r5, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r12 - bl Print - ldr r0, =gStringVar1 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - adds r0, r4, 0 - adds r1, r7, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r5, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r6, 0 - bl Print - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A258C - - thumb_func_start sub_81A2618 -sub_81A2618: @ 81A2618 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r5, r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - adds r0, r4, 0 - bl sub_81A2560 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r4, 0 - beq _081A2648 - movs r0, 0x80 - lsls r0, 4 - b _081A264C -_081A2648: - movs r0, 0x80 - lsls r0, 3 -_081A264C: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2674 - ldr r0, =gUnknown_085EE311 - ldr r1, =gUnknown_085EE35B - str r5, [sp] - str r6, [sp, 0x4] - adds r2, r7, 0 - mov r3, r8 - bl sub_81A2008 - b _081A2684 - .pool -_081A2674: - ldr r0, =gUnknown_085EE320 - ldr r1, =gUnknown_085EE35B - str r5, [sp] - str r6, [sp, 0x4] - adds r2, r7, 0 - mov r3, r8 - bl sub_81A2008 -_081A2684: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2618 - - thumb_func_start sub_81A2698 -sub_81A2698: @ 81A2698 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r6, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r6] - ldrb r0, [r6] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r6] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE261 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0 - bl sub_81A1C4C - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x21 - str r1, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0xA - bl sub_81A1C90 - movs r0, 0 - movs r1, 0x40 - movs r2, 0x72 - movs r3, 0x21 - bl sub_81A2618 - ldr r0, =gUnknown_085EE319 - mov r10, r0 - ldr r7, =gUnknown_085EE35B - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000e08 - adds r0, r1 - ldrh r2, [r0] - movs r4, 0x72 - str r4, [sp] - movs r0, 0x31 - str r0, [sp, 0x4] - mov r0, r10 - adds r1, r7, 0 - movs r3, 0x40 - bl sub_81A258C - ldr r0, =gUnknown_085EE332 - mov r8, r0 - ldr r1, =gUnknown_085EE36D - mov r9, r1 - ldr r0, [r5] - ldr r1, =0x00000e0c - adds r0, r1 - ldrh r2, [r0] - str r4, [sp] - movs r0, 0x41 - str r0, [sp, 0x4] - mov r0, r8 - mov r1, r9 - movs r3, 0x40 - bl sub_81A258C - movs r0, 0x1 - movs r1, 0x40 - movs r2, 0x72 - movs r3, 0x61 - bl sub_81A2618 - ldr r0, [r5] - ldr r1, =0x00000e0a - adds r0, r1 - ldrh r2, [r0] - str r4, [sp] - movs r0, 0x71 - str r0, [sp, 0x4] - mov r0, r10 - adds r1, r7, 0 - movs r3, 0x40 - bl sub_81A258C - ldr r0, [r5] - ldr r1, =0x00000e0e - adds r0, r1 - ldrh r2, [r0] - str r4, [sp] - movs r0, 0x81 - str r0, [sp, 0x4] - mov r0, r8 - mov r1, r9 - movs r3, 0x40 - bl sub_81A258C - ldrb r0, [r6] - bl PutWindowTilemap - ldrb r0, [r6] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2698 - - thumb_func_start sub_81A27E8 -sub_81A27E8: @ 81A27E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x30] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl Print - ldr r0, =0x0000270f - cmp r6, r0 - bls _081A2834 - adds r6, r0, 0 -_081A2834: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE381 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r7, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl Print - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A27E8 - - thumb_func_start sub_81A2888 -sub_81A2888: @ 81A2888 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000dde - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - ldr r0, =gUnknown_085EE319 - str r3, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_81A27E8 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2888 - - thumb_func_start sub_81A28CC -sub_81A28CC: @ 81A28CC - push {lr} - lsls r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000dda - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A28E6 - adds r0, r1, 0 -_081A28E6: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A28CC - - thumb_func_start sub_81A28F8 -sub_81A28F8: @ 81A28F8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r6, r3, 24 - adds r0, r4, 0 - bl sub_81A28CC - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - beq _081A2926 - movs r0, 0x80 - b _081A2928 -_081A2926: - movs r0, 0x40 -_081A2928: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2948 - ldr r0, =gUnknown_085EE311 - str r6, [sp] - adds r1, r5, 0 - adds r2, r7, 0 - mov r3, r8 - bl sub_81A27E8 - b _081A2956 - .pool -_081A2948: - ldr r0, =gUnknown_085EE320 - str r6, [sp] - adds r1, r5, 0 - adds r2, r7, 0 - mov r3, r8 - bl sub_81A27E8 -_081A2956: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A28F8 - - thumb_func_start sub_81A2968 -sub_81A2968: @ 81A2968 - push {r4-r6,lr} - sub sp, 0xC - ldr r5, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r5] - ldrb r0, [r5] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r5] - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0xA - bl sub_81A1C90 - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE27C - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x2 - bl sub_81A1C4C - ldrb r0, [r5] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x31 - str r1, [sp] - movs r6, 0xFF - str r6, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl Print - ldrb r0, [r5] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r6, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl Print - movs r0, 0 - movs r1, 0x48 - movs r2, 0x7E - movs r3, 0x31 - bl sub_81A28F8 - movs r0, 0 - movs r1, 0x48 - movs r2, 0x7E - movs r3, 0x41 - bl sub_81A2888 - movs r0, 0x1 - movs r1, 0x48 - movs r2, 0x7E - movs r3, 0x61 - bl sub_81A28F8 - movs r0, 0x1 - movs r1, 0x48 - movs r2, 0x7E - movs r3, 0x71 - bl sub_81A2888 - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2968 - - thumb_func_start sub_81A2A28 -sub_81A2A28: @ 81A2A28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r12, r0 - ldr r4, [sp, 0x38] - ldr r5, [sp, 0x3C] - ldr r0, [sp, 0x40] - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0xC] - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x10] - lsls r5, 24 - lsrs r5, 24 - str r5, [sp, 0x14] - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r6, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r12 - bl Print - ldr r0, =0x0000270f - cmp r7, r0 - bls _081A2A80 - adds r7, r0, 0 -_081A2A80: - ldr r5, =gStringVar1 - adds r0, r5, 0 - adds r1, r7, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE302 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r6, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0x10] - bl Print - adds r0, r5, 0 - ldr r1, [sp, 0xC] - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_085EE392 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r6, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0x14] - bl Print - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2A28 - - thumb_func_start sub_81A2B04 -sub_81A2B04: @ 81A2B04 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r6, r2, 0 - ldr r4, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r0, 24 - lsls r1, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r7, =0x00000dea - adds r0, r2, r7 - adds r0, r1 - ldrh r0, [r0] - mov r8, r0 - ldr r0, =0x00000dfa - adds r2, r0 - adds r2, r1 - ldrh r2, [r2] - ldr r0, =gUnknown_085EE319 - str r3, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - mov r1, r8 - adds r3, r6, 0 - bl sub_81A2A28 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2B04 - - thumb_func_start sub_81A2B70 -sub_81A2B70: @ 81A2B70 - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000de2 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A2B90 - adds r0, r1, 0 -_081A2B90: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A2B70 - - thumb_func_start sub_81A2BA0 -sub_81A2BA0: @ 81A2BA0 - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000df2 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A2BC0 - adds r0, r1, 0 -_081A2BC0: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A2BA0 - - thumb_func_start sub_81A2BD0 -sub_81A2BD0: @ 81A2BD0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r4, [sp, 0x30] - ldr r5, [sp, 0x34] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0xC] - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r4, 24 - lsrs r4, 24 - mov r9, r4 - lsls r5, 24 - lsrs r5, 24 - mov r10, r5 - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_81A2B70 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_81A2BA0 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r6, 0 - beq _081A2C20 - cmp r6, 0x1 - beq _081A2C30 -_081A2C20: - cmp r7, 0 - beq _081A2C2A - movs r0, 0x80 - lsls r0, 2 - b _081A2C3E -_081A2C2A: - movs r0, 0x80 - lsls r0, 1 - b _081A2C3E -_081A2C30: - cmp r7, 0 - beq _081A2C3A - movs r0, 0x80 - lsls r0, 18 - b _081A2C3E -_081A2C3A: - movs r0, 0x80 - lsls r0, 17 -_081A2C3E: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2C68 - ldr r0, =gUnknown_085EE311 - mov r1, r8 - str r1, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - adds r1, r5, 0 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl sub_81A2A28 - b _081A2C80 - .pool -_081A2C68: - ldr r0, =gUnknown_085EE320 - mov r1, r8 - str r1, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - adds r1, r5, 0 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl sub_81A2A28 -_081A2C80: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2BD0 - - thumb_func_start sub_81A2C94 -sub_81A2C94: @ 81A2C94 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - cmp r7, 0 - bne _081A2CD8 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE298 - bl StringExpandPlaceholders - b _081A2CE0 - .pool -_081A2CD8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE2B8 - bl StringExpandPlaceholders -_081A2CE0: - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81A1C4C - ldr r0, =gUnknown_0203AB74 - mov r8, r0 - ldrb r0, [r0] - ldr r2, =gUnknown_085EE2F2 - movs r6, 0x21 - str r6, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - mov r1, r8 - ldrb r0, [r1] - ldr r2, =gUnknown_085EE326 - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x98 - bl Print - mov r1, r8 - ldrb r0, [r1] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0xA - bl sub_81A1C90 - movs r4, 0x9E - str r4, [sp] - movs r0, 0x31 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x8 - movs r3, 0x40 - bl sub_81A2BD0 - str r4, [sp] - movs r0, 0x41 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x8 - movs r3, 0x40 - bl sub_81A2B04 - str r4, [sp] - movs r0, 0x71 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x8 - movs r3, 0x40 - bl sub_81A2BD0 - str r4, [sp] - movs r0, 0x81 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x8 - movs r3, 0x40 - bl sub_81A2B04 - mov r1, r8 - ldrb r0, [r1] - bl PutWindowTilemap - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2C94 - - thumb_func_start sub_81A2DB4 -sub_81A2DB4: @ 81A2DB4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x30] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl Print - ldr r0, =0x0000270f - cmp r6, r0 - bls _081A2E00 - adds r6, r0, 0 -_081A2E00: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE39C - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r7, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl Print - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2DB4 - - thumb_func_start sub_81A2E54 -sub_81A2E54: @ 81A2E54 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000e1e - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - ldr r0, =gUnknown_085EE319 - str r3, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_81A2DB4 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2E54 - - thumb_func_start sub_81A2E98 -sub_81A2E98: @ 81A2E98 - push {lr} - lsls r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A2EB2 - adds r0, r1, 0 -_081A2EB2: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A2E98 - - thumb_func_start sub_81A2EC4 -sub_81A2EC4: @ 81A2EC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r6, r3, 24 - adds r0, r4, 0 - bl sub_81A2E98 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - beq _081A2EF4 - movs r0, 0x80 - lsls r0, 6 - b _081A2EF8 -_081A2EF4: - movs r0, 0x80 - lsls r0, 5 -_081A2EF8: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2F18 - ldr r0, =gUnknown_085EE311 - str r6, [sp] - adds r1, r5, 0 - adds r2, r7, 0 - mov r3, r8 - bl sub_81A2DB4 - b _081A2F26 - .pool -_081A2F18: - ldr r0, =gUnknown_085EE320 - str r6, [sp] - adds r1, r5, 0 - adds r2, r7, 0 - mov r3, r8 - bl sub_81A2DB4 -_081A2F26: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2EC4 - - thumb_func_start sub_81A2F38 -sub_81A2F38: @ 81A2F38 - push {r4-r6,lr} - sub sp, 0xC - ldr r5, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r5] - ldrb r0, [r5] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r5] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE2D8 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x2 - bl sub_81A1C4C - ldrb r0, [r5] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x31 - str r1, [sp] - movs r6, 0xFF - str r6, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldrb r0, [r5] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r6, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0xA - bl sub_81A1C90 - movs r0, 0 - movs r1, 0x40 - movs r2, 0x6F - movs r3, 0x31 - bl sub_81A2EC4 - movs r0, 0 - movs r1, 0x40 - movs r2, 0x6F - movs r3, 0x41 - bl sub_81A2E54 - movs r0, 0x1 - movs r1, 0x40 - movs r2, 0x6F - movs r3, 0x61 - bl sub_81A2EC4 - movs r0, 0x1 - movs r1, 0x40 - movs r2, 0x6F - movs r3, 0x71 - bl sub_81A2E54 - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2F38 - - thumb_func_start sub_81A2FF8 -sub_81A2FF8: @ 81A2FF8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C7C - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gStringVar4 - mov r9, r0 - ldr r1, =gUnknown_085EDF86 - bl StringExpandPlaceholders - movs r0, 0x1 - mov r1, r9 - movs r2, 0xD0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r6, 0xFF - str r6, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - mov r2, r9 - bl Print - ldr r7, =gUnknown_085EDFA0 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x26 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - adds r3, 0x32 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x19 - mov r8, r1 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - bl Print - ldr r7, =gUnknown_085EDFA4 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x26 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - adds r3, 0x58 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - mov r2, r8 - str r2, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - bl Print - ldr r7, =gUnknown_085EDFA8 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x26 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - adds r3, 0x7E - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - mov r1, r8 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - bl Print - ldr r7, =gUnknown_085EDFAC - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x26 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - adds r3, 0xA4 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - mov r2, r8 - str r2, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - bl Print - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0E8 - movs r1, 0x29 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl Print - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0ED - movs r1, 0x39 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl Print - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0F4 - movs r1, 0x49 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl Print - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0F9 - movs r1, 0x59 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl Print - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0FF - movs r1, 0x69 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl Print - movs r1, 0 -_081A314A: - movs r5, 0 - adds r0, r1, 0x1 - mov r8, r0 - lsls r0, r1, 28 - movs r2, 0xA4 - lsls r2, 22 - adds r0, r2 - lsrs r7, r0, 24 - lsls r4, r1, 3 -_081A315C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000624 - adds r0, r1 - adds r0, r4 - ldrh r1, [r0] - mov r0, r9 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r6, =gUnknown_0203AB74 - ldrb r0, [r6] - movs r1, 0x26 - adds r3, r5, 0 - muls r3, r1 - adds r3, 0x40 - lsls r3, 24 - lsrs r3, 24 - str r7, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r9 - bl Print - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _081A315C - mov r1, r8 - cmp r1, 0x4 - ble _081A314A - ldrb r0, [r6] - bl PutWindowTilemap - ldrb r0, [r6] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2FF8 - - thumb_func_start sub_81A31FC -sub_81A31FC: @ 81A31FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r7, r0, 30 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r4, 0x6 - bls _081A3232 - b _081A35CE -_081A3232: - lsls r0, r4, 2 - ldr r1, =_081A3250 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A3250: - .4byte _081A326C - .4byte _081A33A8 - .4byte _081A3414 - .4byte _081A347C - .4byte _081A34CC - .4byte _081A354C - .4byte _081A3594 -_081A326C: - ldr r2, =gSaveBlock2Ptr - mov r9, r2 - ldr r0, [r2] - lsls r3, r7, 1 - mov r10, r3 - mov r2, r8 - lsls r1, r2, 2 - add r1, r10 - str r1, [sp, 0x20] - movs r3, 0xCE - lsls r3, 4 - adds r1, r0, r3 - ldr r2, [sp, 0x20] - adds r1, r2 - adds r3, 0x10 - adds r0, r3 - adds r0, r2 - ldrh r1, [r1] - ldrh r2, [r0] - cmp r1, r2 - bhi _081A3298 - b _081A35CE -_081A3298: - strh r1, [r0] - mov r3, r8 - cmp r3, 0x3 - bne _081A32F2 - ldr r6, =gBattleScripting - adds r6, 0x25 - ldrb r0, [r6] - movs r4, 0x1 - eors r0, r4 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r5, =gUnknown_020229F0 - adds r1, r5 - mov r0, sp - bl StringCopy - mov r0, sp - bl StripExtCtrlCodes - lsls r1, r7, 3 - ldr r0, =0x00000ee1 - adds r1, r0 - mov r2, r9 - ldr r0, [r2] - adds r0, r1 - mov r1, sp - bl StringCopy - ldrb r0, [r6] - eors r4, r0 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - subs r5, 0x4 - adds r0, r5 - ldr r0, [r0] - lsls r2, r7, 2 - ldr r1, =0x00000ef1 - adds r2, r1 - mov r3, r9 - ldr r1, [r3] - adds r1, r2 - bl WriteUnalignedWord -_081A32F2: - mov r7, r9 - ldr r0, [r7] - movs r1, 0xCE - lsls r1, 4 - adds r0, r1 - ldr r2, [sp, 0x20] - adds r0, r2 - ldrh r0, [r0] - cmp r0, 0x1 - bhi _081A3308 - b _081A35CE -_081A3308: - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - bne _081A3314 - b _081A35CE -_081A3314: - mov r3, r8 - cmp r3, 0x1 - beq _081A335A - cmp r3, 0x1 - bgt _081A3338 - cmp r3, 0 - beq _081A3344 - b _081A35CE - .pool -_081A3338: - mov r7, r8 - cmp r7, 0x2 - beq _081A3374 - cmp r7, 0x3 - beq _081A338E - b _081A35CE -_081A3344: - mov r1, r9 - ldr r0, [r1] - movs r2, 0xCE - lsls r2, 4 - adds r0, r2 - add r0, r10 - ldrh r0, [r0] - movs r1, 0x1 - bl sub_80EE8C8 - b _081A35CE -_081A335A: - mov r3, r9 - ldr r0, [r3] - mov r1, r10 - adds r1, 0x4 - movs r7, 0xCE - lsls r7, 4 - adds r0, r7 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x2 - bl sub_80EE8C8 - b _081A35CE -_081A3374: - mov r1, r9 - ldr r0, [r1] - mov r1, r10 - adds r1, 0x8 - movs r2, 0xCE - lsls r2, 4 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x3 - bl sub_80EE8C8 - b _081A35CE -_081A338E: - mov r3, r9 - ldr r0, [r3] - mov r1, r10 - adds r1, 0xC - movs r7, 0xCE - lsls r7, 4 - adds r0, r7 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x4 - bl sub_80EE8C8 - b _081A35CE -_081A33A8: - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - lsls r7, 1 - mov r2, r8 - lsls r1, r2, 2 - adds r4, r7, r1 - ldr r5, =0x00000d0c - adds r1, r0, r5 - adds r1, r4 - ldr r3, =0x00000d14 - adds r0, r3 - adds r0, r4 - ldrh r2, [r1] - ldrh r3, [r0] - cmp r2, r3 - bhi _081A33CA - b _081A35CE -_081A33CA: - strh r2, [r0] - ldrh r0, [r1] - cmp r0, 0x1 - bhi _081A33D4 - b _081A35CE -_081A33D4: - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - bne _081A33E0 - b _081A35CE -_081A33E0: - mov r0, r8 - cmp r0, 0 - bne _081A3404 - ldr r0, [r6] - adds r0, r5 - adds r0, r7 - ldrh r0, [r0] - movs r1, 0x5 - bl sub_80EE8C8 - b _081A35CE - .pool -_081A3404: - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x6 - bl sub_80EE8C8 - b _081A35CE -_081A3414: - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - lsls r7, 1 - mov r2, r8 - lsls r1, r2, 2 - adds r4, r7, r1 - ldr r5, =0x00000dc8 - adds r1, r0, r5 - adds r1, r4 - movs r3, 0xDD - lsls r3, 4 - adds r0, r3 - adds r0, r4 - ldrh r2, [r1] - ldrh r3, [r0] - cmp r2, r3 - bhi _081A3438 - b _081A35CE -_081A3438: - strh r2, [r0] - ldrh r0, [r1] - cmp r0, 0x1 - bhi _081A3442 - b _081A35CE -_081A3442: - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - bne _081A344E - b _081A35CE -_081A344E: - mov r0, r8 - cmp r0, 0 - bne _081A346C - ldr r0, [r6] - adds r0, r5 - adds r0, r7 - ldrh r0, [r0] - movs r1, 0xB - bl sub_80EE8C8 - b _081A35CE - .pool -_081A346C: - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0xC - bl sub_80EE8C8 - b _081A35CE -_081A347C: - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - lsls r4, r7, 1 - ldr r5, =0x00000dda - adds r0, r1, r5 - adds r0, r4 - ldr r2, =0x00000dde - adds r1, r2 - adds r1, r4 - ldrh r2, [r0] - ldrh r3, [r1] - cmp r2, r3 - bhi _081A3498 - b _081A35CE -_081A3498: - strh r2, [r1] - ldrh r0, [r0] - cmp r0, 0x1 - bhi _081A34A2 - b _081A35CE -_081A34A2: - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - bne _081A34AE - b _081A35CE -_081A34AE: - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0xA - bl sub_80EE8C8 - b _081A35CE - .pool -_081A34CC: - ldr r6, =gSaveBlock2Ptr - ldr r2, [r6] - lsls r7, 1 - mov r9, r7 - mov r7, r8 - lsls r0, r7, 2 - mov r1, r9 - adds r4, r1, r0 - ldr r5, =0x00000de2 - adds r0, r2, r5 - adds r3, r0, r4 - ldr r7, =0x00000dea - adds r0, r2, r7 - adds r0, r4 - ldrh r1, [r3] - ldrh r7, [r0] - cmp r1, r7 - bls _081A35CE - strh r1, [r0] - ldr r0, =0x00000dfa - adds r1, r2, r0 - adds r1, r4 - ldr r7, =0x00000df2 - adds r0, r2, r7 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - ldrh r0, [r3] - cmp r0, 0x1 - bls _081A35CE - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - beq _081A35CE - mov r0, r8 - cmp r0, 0 - bne _081A353C - ldr r0, [r6] - adds r0, r5 - add r0, r9 - ldrh r0, [r0] - movs r1, 0x7 - bl sub_80EE8C8 - b _081A35CE - .pool -_081A353C: - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x8 - bl sub_80EE8C8 - b _081A35CE -_081A354C: - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - lsls r4, r7, 1 - ldr r5, =0x00000e04 - adds r0, r1, r5 - adds r0, r4 - ldr r2, =0x00000e08 - adds r1, r2 - adds r1, r4 - ldrh r2, [r0] - ldrh r3, [r1] - cmp r2, r3 - bls _081A35CE - strh r2, [r1] - ldrh r0, [r0] - cmp r0, 0x1 - bls _081A35CE - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - beq _081A35CE - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x9 - bl sub_80EE8C8 - b _081A35CE - .pool -_081A3594: - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - lsls r4, r7, 1 - ldr r5, =0x00000e1a - adds r0, r1, r5 - adds r0, r4 - ldr r7, =0x00000e1e - adds r1, r7 - adds r1, r4 - ldrh r2, [r0] - ldrh r3, [r1] - cmp r2, r3 - bls _081A35CE - strh r2, [r1] - ldrh r0, [r0] - cmp r0, 0x1 - bls _081A35CE - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - beq _081A35CE - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0xD - bl sub_80EE8C8 -_081A35CE: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A31FC - - thumb_func_start sub_81A35EC -sub_81A35EC: @ 81A35EC - push {r4,lr} - ldr r0, =0x000040cf - bl VarGet - ldr r4, =gScriptResult - bl sub_81A3610 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A35EC - - thumb_func_start sub_81A3610 -sub_81A3610: @ 81A3610 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0 - mov r8, r0 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x000040ce - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81A39C4 - lsls r0, 16 - ldr r1, =gUnknown_08611550 - mov r9, r1 - lsls r7, r6, 2 - adds r1, 0x3 - adds r1, r7, r1 - lsrs r0, 16 - ldrb r1, [r1] - adds r5, r0, r1 - cmp r4, 0 - beq _081A365C - movs r0, 0 - b _081A36C2 - .pool -_081A365C: - lsls r0, r6, 24 - lsrs r0, 24 - bl sub_81A3B30 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - blt _081A3680 - cmp r1, 0x1 - bgt _081A3680 - adds r0, r1, r7 - add r0, r9 - ldrb r0, [r0] - cmp r5, r0 - bne _081A36BC - adds r1, 0x1 - mov r8, r1 - b _081A36BC -_081A3680: - ldr r1, =gUnknown_08611550 - lsls r2, r6, 2 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r5, r0 - bne _081A3694 - movs r0, 0x3 - b _081A36BA - .pool -_081A3694: - adds r0, r1, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r5, r0 - bne _081A36A4 - movs r1, 0x4 - mov r8, r1 - b _081A36BC -_081A36A4: - cmp r5, r0 - ble _081A36BC - subs r0, r5, r0 - adds r1, 0x2 - adds r1, r2, r1 - ldrb r1, [r1] - bl __modsi3 - cmp r0, 0 - bne _081A36BC - movs r0, 0x4 -_081A36BA: - mov r8, r0 -_081A36BC: - mov r1, r8 - lsls r0, r1, 24 - lsrs r0, 24 -_081A36C2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A3610 - - thumb_func_start sub_81A36D0 -sub_81A36D0: @ 81A36D0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - lsls r1, 16 - lsrs r3, r1, 16 - cmp r0, 0x1 - beq _081A3766 - cmp r0, 0x1 - bgt _081A36EA - cmp r0, 0 - beq _081A36F2 - b _081A38F8 -_081A36EA: - cmp r2, 0x2 - bne _081A36F0 - b _081A3818 -_081A36F0: - b _081A38F8 -_081A36F2: - movs r0, 0xFA - lsls r0, 1 - cmp r3, r0 - bne _081A370C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000bfc - b _081A38C4 - .pool -_081A370C: - ldr r0, =0x000003fe - cmp r3, r0 - beq _081A3786 - ldr r0, =0x0000012b - cmp r3, r0 - bhi _081A3738 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - adds r1, r3, 0 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A3738: - ldr r0, =0x0000018f - cmp r3, r0 - bhi _081A3758 - ldr r1, =gSaveBlock2Ptr - movs r0, 0xEC - muls r0, r3 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xfffef2b8 - b _081A38C4 - .pool -_081A3758: - adds r0, r3, 0 - adds r0, 0x70 - lsls r0, 24 - lsrs r0, 24 - bl sub_819F99C - b _081A38F8 -_081A3766: - movs r0, 0xFA - lsls r0, 1 - cmp r3, r0 - bne _081A3780 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000c08 - b _081A38C4 - .pool -_081A3780: - ldr r0, =0x000003fe - cmp r3, r0 - bne _081A3794 -_081A3786: - movs r0, 0 - bl sub_81A51A8 - b _081A38F8 - .pool -_081A3794: - ldr r0, =0x0000012b - cmp r3, r0 - bhi _081A37B8 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - adds r1, r3, 0 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0x18 - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A37B8: - ldr r0, =0x0000018f - cmp r3, r0 - bhi _081A37EC - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _081A387C - ldr r1, =gSaveBlock2Ptr - movs r0, 0xEC - muls r0, r3 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xfffef2c4 - b _081A38C4 - .pool -_081A37EC: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _081A387C - ldr r1, =gSaveBlock2Ptr - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xffff96c4 - b _081A38C4 - .pool -_081A3818: - movs r0, 0xFA - lsls r0, 1 - cmp r3, r0 - bne _081A3830 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000c14 - b _081A38C4 - .pool -_081A3830: - ldr r0, =0x000003fe - cmp r3, r0 - bne _081A3844 - movs r0, 0x1 - bl sub_81A51A8 - b _081A38F8 - .pool -_081A3844: - ldr r0, =0x0000012b - cmp r3, r0 - bhi _081A3868 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - adds r1, r3, 0 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0x24 - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A3868: - ldr r0, =0x0000018f - cmp r3, r0 - bhi _081A38A8 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A3890 -_081A387C: - bl sub_81864E0 - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A3890: - ldr r1, =gSaveBlock2Ptr - movs r0, 0xEC - muls r0, r3 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xfffef2d0 - b _081A38C4 - .pool -_081A38A8: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A38D4 - bl sub_81864A8 - lsls r0, 24 - lsrs r3, r0, 24 - movs r0, 0x58 - muls r0, r3 - ldr r1, =gUnknown_086109BA -_081A38C4: - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A38D4: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r3, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r3, r0, 27 - movs r0, 0x58 - muls r0, r3 - ldr r1, =gUnknown_086109BA - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString -_081A38F8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A36D0 - - thumb_func_start sub_81A3908 -sub_81A3908: @ 81A3908 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000cdc - adds r1, r2 - movs r2, 0 - str r2, [r1] - movs r4, 0 - mov r9, r0 - mov r8, r9 - movs r6, 0 -_081A3926: - movs r5, 0 - lsls r7, r4, 2 - mov r10, r7 - adds r0, r4, 0x1 - mov r12, r0 -_081A3930: - mov r1, r8 - ldr r2, [r1] - lsls r3, r5, 1 - mov r7, r10 - adds r1, r3, r7 - movs r7, 0xCE - lsls r7, 4 - adds r0, r2, r7 - adds r0, r1 - strh r6, [r0] - cmp r4, 0x1 - bgt _081A3960 - adds r7, 0x2C - adds r0, r2, r7 - adds r0, r1 - strh r6, [r0] - adds r7, 0xBC - adds r0, r2, r7 - adds r0, r1 - strh r6, [r0] - adds r7, 0x1A - adds r0, r2, r7 - adds r0, r1 - strh r6, [r0] -_081A3960: - cmp r4, 0 - bne _081A3980 - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00000dda - adds r1, r0, r2 - adds r1, r3 - strh r4, [r1] - ldr r7, =0x00000e04 - adds r1, r0, r7 - adds r1, r3 - strh r4, [r1] - ldr r1, =0x00000e1a - adds r0, r1 - adds r0, r3 - strh r4, [r0] -_081A3980: - adds r5, 0x1 - cmp r5, 0x1 - ble _081A3930 - mov r4, r12 - cmp r4, 0x3 - ble _081A3926 - mov r2, r9 - ldr r0, [r2] - ldr r7, =0x00000ca8 - adds r1, r0, r7 - ldrb r0, [r1] - cmp r0, 0 - beq _081A399E - movs r0, 0x1 - strb r0, [r1] -_081A399E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3908 - - thumb_func_start sub_81A39C4 -sub_81A39C4: @ 81A39C4 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bhi _081A3AC4 - lsls r0, 2 - ldr r1, =_081A3A0C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A3A0C: - .4byte _081A3A28 - .4byte _081A3A3C - .4byte _081A3A54 - .4byte _081A3A6C - .4byte _081A3A80 - .4byte _081A3A98 - .4byte _081A3AAC -_081A3A28: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - movs r2, 0xCE - lsls r2, 4 - b _081A3AB4 - .pool -_081A3A3C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000d0c - b _081A3AB4 - .pool -_081A3A54: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000dc8 - b _081A3AB4 - .pool -_081A3A6C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000dda - b _081A3AB4 - .pool -_081A3A80: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000de2 - b _081A3AB4 - .pool -_081A3A98: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e04 - b _081A3AB4 - .pool -_081A3AAC: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e1a -_081A3AB4: - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - b _081A3AC6 - .pool -_081A3AC4: - movs r0, 0 -_081A3AC6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A39C4 - - thumb_func_start sub_81A3ACC -sub_81A3ACC: @ 81A3ACC - push {r4,r5,lr} - movs r2, 0 - ldr r5, =gSaveBlock2Ptr - ldr r4, =0x00000cb4 - ldr r0, =0x0000ffff - adds r3, r0, 0 -_081A3AD8: - ldr r0, [r5] - lsls r1, r2, 1 - adds r0, r4 - adds r0, r1 - ldrh r1, [r0] - orrs r1, r3 - strh r1, [r0] - adds r2, 0x1 - cmp r2, 0x13 - ble _081A3AD8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3ACC - - thumb_func_start sub_81A3B00 -sub_81A3B00: @ 81A3B00 - push {lr} - ldr r0, =gUnknown_02038BCA - ldrh r1, [r0] - ldr r0, =0x000003fe - cmp r1, r0 - bne _081A3B20 - ldr r1, =gScriptResult - movs r0, 0x1 - b _081A3B24 - .pool -_081A3B20: - ldr r1, =gScriptResult - movs r0, 0 -_081A3B24: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3B00 - - thumb_func_start sub_81A3B30 -sub_81A3B30: @ 81A3B30 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 23 - ldr r1, =0x000008c4 - adds r0, r4, r1 - bl FlagGet - adds r5, r0, 0 - ldr r0, =0x000008c5 - adds r4, r0 - adds r0, r4, 0 - bl FlagGet - adds r5, r0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A3B30 - - thumb_func_start sub_81A3B64 -sub_81A3B64: @ 81A3B64 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r5, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - cmp r7, 0x6 - bhi _081A3C78 - lsls r0, r7, 2 - ldr r1, =_081A3BB4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A3BB4: - .4byte _081A3BD0 - .4byte _081A3BE4 - .4byte _081A3C00 - .4byte _081A3C18 - .4byte _081A3C2C - .4byte _081A3C44 - .4byte _081A3C60 -_081A3BD0: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - movs r2, 0xCE - lsls r2, 4 - b _081A3C68 - .pool -_081A3BE4: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000d0c - adds r0, r2 - adds r0, r1 - ldrh r5, [r0] - b _081A3C78 - .pool -_081A3C00: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000dc8 - b _081A3C68 - .pool -_081A3C18: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000dda - b _081A3C68 - .pool -_081A3C2C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000de2 - b _081A3C68 - .pool -_081A3C44: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e04 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0xE - b _081A3C70 - .pool -_081A3C60: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e1a -_081A3C68: - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x7 -_081A3C70: - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 -_081A3C78: - cmp r5, 0 - beq _081A3C7E - subs r5, 0x1 -_081A3C7E: - cmp r5, 0x1D - bls _081A3C84 - movs r5, 0x1D -_081A3C84: - ldr r2, =gUnknown_086118B4 - lsls r1, r7, 2 - adds r1, r6, r1 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r1, r0 - adds r7, r1, r2 - ldrb r5, [r7] - ldr r0, =gUnknown_02038BCA - mov r9, r0 - ldrh r0, [r0] - ldr r1, =0x000003fe - mov r8, r1 - cmp r0, r8 - bne _081A3CA6 - adds r5, 0xA -_081A3CA6: - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - ldr r4, =0x00000eb8 - adds r1, r4 - ldrh r0, [r1] - adds r0, r5 - strh r0, [r1] - ldr r0, =gStringVar1 - adds r1, r5, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r0, [r6] - adds r2, r0, r4 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A3CCE - strh r1, [r2] -_081A3CCE: - ldr r0, [r6] - ldr r4, =0x00000eba - adds r0, r4 - ldrh r5, [r0] - ldrb r0, [r7] - adds r5, r0 - bl sub_80EED60 - mov r2, r9 - ldrh r0, [r2] - cmp r0, r8 - bne _081A3CEE - adds r5, 0xA - movs r0, 0xA - bl sub_80EED60 -_081A3CEE: - ldr r0, =0x0000ffff - cmp r5, r0 - ble _081A3CF6 - adds r5, r0, 0 -_081A3CF6: - ldr r0, [r6] - adds r0, r4 - strh r5, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3B64 - - thumb_func_start sub_81A3D30 -sub_81A3D30: @ 81A3D30 - push {r4,lr} - ldr r0, =0x000040cf - bl VarGet - ldr r4, =gScriptResult - lsls r0, 24 - lsrs r0, 24 - bl sub_81A3B30 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3D30 - - thumb_func_start sub_81A3D58 -sub_81A3D58: @ 81A3D58 - push {r4,lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_81A3B30 - lsls r0, 24 - cmp r0, 0 - bne _081A3D88 - lsls r0, r4, 17 - ldr r1, =0x8C4 << 16 - adds r0, r1 - lsrs r0, 16 - bl FlagSet - b _081A3D94 - .pool -_081A3D88: - lsls r0, r4, 17 - ldr r1, =0x8C5 << 16 - adds r0, r1 - lsrs r0, 16 - bl FlagSet -_081A3D94: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3D58 - - thumb_func_start sub_81A3DA0 -sub_81A3DA0: @ 81A3DA0 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, [r0] - ands r2, r1 - cmp r2, 0 - beq _081A3DC4 - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - b _081A3DC8 - .pool -_081A3DC4: - ldr r0, =gScriptResult - strh r2, [r0] -_081A3DC8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3DA0 - - thumb_func_start sub_81A3DD0 -sub_81A3DD0: @ 81A3DD0 - push {r4-r6,lr} - adds r5, r2, 0 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - adds r0, r6, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _081A3ED6 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - subs r0, r4, 0x1 - cmp r0, 0xA - bhi _081A3EA0 - lsls r0, 2 - ldr r1, =_081A3E0C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A3E0C: - .4byte _081A3E38 - .4byte _081A3E68 - .4byte _081A3E38 - .4byte _081A3EA0 - .4byte _081A3E38 - .4byte _081A3EA0 - .4byte _081A3E38 - .4byte _081A3EA0 - .4byte _081A3E38 - .4byte _081A3EA0 - .4byte _081A3E38 -_081A3E38: - cmp r5, r4 - bne _081A3E50 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB79 - bl StringAppend - b _081A3EC8 - .pool -_081A3E50: - cmp r5, r4 - ble _081A3EC8 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB7F - bl StringAppend - b _081A3EC8 - .pool -_081A3E68: - cmp r4, r5 - bne _081A3E80 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB79 - bl StringAppend - b _081A3E88 - .pool -_081A3E80: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB7F - bl StringAppend -_081A3E88: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB86 - bl StringAppend - b _081A3EC8 - .pool -_081A3EA0: - cmp r4, r5 - bne _081A3EB8 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB79 - bl StringAppend - b _081A3EC0 - .pool -_081A3EB8: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB7F - bl StringAppend -_081A3EC0: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB84 - bl StringAppend -_081A3EC8: - ldr r0, =gStringVar1 - movs r1, 0xB - muls r1, r6 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringAppend -_081A3ED6: - adds r0, r4, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A3DD0 - - thumb_func_start sub_81A3EF0 -sub_81A3EF0: @ 81A3EF0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, [sp, 0x20] - ldr r4, [sp, 0x24] - mov r9, r4 - ldr r4, [sp, 0x28] - mov r10, r4 - ldr r7, [sp, 0x2C] - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r3, 24 - lsrs r3, 24 - mov r12, r3 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - movs r2, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - beq _081A3FBE - cmp r4, 0 - beq _081A3FBE - ldr r0, =gUnknown_08611C9A - ldrh r1, [r0] - ldr r5, =0x0000ffff - adds r3, r0, 0 - cmp r1, r5 - beq _081A3F54 - cmp r1, r4 - beq _081A3F48 - adds r1, r3, 0 -_081A3F3A: - adds r1, 0x2 - adds r2, 0x1 - ldrh r0, [r1] - cmp r0, r5 - beq _081A3F54 - cmp r0, r4 - bne _081A3F3A -_081A3F48: - lsls r0, r2, 1 - adds r0, r3 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081A3FBE -_081A3F54: - mov r0, r12 - cmp r0, 0 - bne _081A3F60 - mov r1, r8 - cmp r1, 0x32 - bhi _081A3FBE -_081A3F60: - movs r2, 0 - ldrb r3, [r7] - cmp r2, r3 - bge _081A3F80 - mov r1, r9 - ldrh r0, [r1] - cmp r0, r4 - beq _081A3F80 - adds r5, r3, 0 -_081A3F72: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, r5 - bge _081A3F80 - ldrh r0, [r1] - cmp r0, r4 - bne _081A3F72 -_081A3F80: - cmp r2, r3 - bne _081A3FBE - cmp r6, 0 - beq _081A3FAA - movs r2, 0 - cmp r2, r3 - bge _081A3FA6 - mov r1, r10 - ldrh r0, [r1] - cmp r0, r6 - beq _081A3FA6 - adds r5, r3, 0 -_081A3F98: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, r5 - bge _081A3FA6 - ldrh r0, [r1] - cmp r0, r6 - bne _081A3F98 -_081A3FA6: - cmp r2, r3 - bne _081A3FBE -_081A3FAA: - lsls r0, r3, 1 - add r0, r9 - strh r4, [r0] - ldrb r0, [r7] - lsls r0, 1 - add r0, r10 - strh r6, [r0] - ldrb r0, [r7] - adds r0, 0x1 - strb r0, [r7] -_081A3FBE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3EF0 - - thumb_func_start sub_81A3FD4 -sub_81A3FD4: @ 81A3FD4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - movs r0, 0 - str r0, [sp, 0x2C] - add r4, sp, 0x28 - strb r0, [r4] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - mov r10, r4 - cmp r0, 0x1 - beq _081A4016 - cmp r0, 0x1 - bgt _081A4008 - cmp r0, 0 - beq _081A4010 - b _081A402A - .pool -_081A4008: - cmp r0, 0x3 - bgt _081A402A - movs r0, 0x2 - b _081A4028 -_081A4010: - movs r1, 0x3 - str r1, [sp, 0x2C] - b _081A402A -_081A4016: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - movs r1, 0x3 - str r1, [sp, 0x2C] - cmp r0, 0 - bne _081A402A - movs r0, 0x4 -_081A4028: - str r0, [sp, 0x2C] -_081A402A: - movs r1, 0 - mov r9, r1 - b _081A4040 - .pool -_081A4034: - mov r1, r10 - ldrb r0, [r1] - ldr r1, [sp, 0x2C] - cmp r0, r1 - blt _081A4040 - b _081A41E0 -_081A4040: - mov r5, r9 - movs r0, 0 - mov r1, r10 - strb r0, [r1] - mov r0, r9 - adds r0, 0x1 - str r0, [sp, 0x30] -_081A404E: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r4, 0 - movs r1, 0x38 - bl GetMonData - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bne _081A40C8 - cmp r7, 0 - bne _081A40E4 - ldr r0, =gScriptResult - ldrb r3, [r0] - str r6, [sp] - add r1, sp, 0x10 - str r1, [sp, 0x4] - add r0, sp, 0x1C - str r0, [sp, 0x8] - mov r0, r10 - str r0, [sp, 0xC] - mov r0, r8 - movs r1, 0 - adds r2, r4, 0 - bl sub_81A3EF0 - b _081A40E4 - .pool -_081A40C8: - ldr r0, =gScriptResult - ldrb r3, [r0] - str r6, [sp] - add r1, sp, 0x10 - str r1, [sp, 0x4] - add r0, sp, 0x1C - str r0, [sp, 0x8] - mov r0, r10 - str r0, [sp, 0xC] - mov r0, r8 - adds r1, r7, 0 - adds r2, r4, 0 - bl sub_81A3EF0 -_081A40E4: - adds r5, 0x1 - cmp r5, 0x5 - ble _081A40EC - movs r5, 0 -_081A40EC: - cmp r5, r9 - bne _081A404E - ldr r1, [sp, 0x30] - mov r9, r1 - cmp r1, 0x5 - ble _081A4034 - mov r1, r10 - ldrb r0, [r1] - ldr r1, [sp, 0x2C] - cmp r0, r1 - bge _081A41E0 - movs r6, 0 - ldr r0, =gUnknown_08611C9A - ldrh r2, [r0] - ldr r1, =0x0000ffff - mov r8, r0 - cmp r2, r1 - beq _081A4134 - mov r4, r8 -_081A4112: - adds r0, r2, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _081A412A - adds r6, 0x1 -_081A412A: - adds r4, 0x2 - ldrh r2, [r4] - ldr r0, =0x0000ffff - cmp r2, r0 - bne _081A4112 -_081A4134: - ldr r1, =gStringVar1 - movs r0, 0xFF - strb r0, [r1] - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] - movs r0, 0 - mov r1, r10 - strb r0, [r1] - mov r1, r8 - ldrh r0, [r1] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _081A416A - mov r5, r10 - adds r7, r1, 0 - mov r4, r8 -_081A4156: - ldrh r0, [r4] - ldrb r1, [r5] - adds r2, r6, 0 - bl sub_81A3DD0 - strb r0, [r5] - adds r4, 0x2 - ldrh r0, [r4] - cmp r0, r7 - bne _081A4156 -_081A416A: - mov r0, r10 - ldrb r4, [r0] - cmp r4, 0 - bne _081A41A4 - ldr r4, =gStringVar1 - ldr r1, =gUnknown_085CCB82 - adds r0, r4, 0 - bl StringAppend - ldr r1, =gUnknown_085CCB88 - adds r0, r4, 0 - bl StringAppend - b _081A4202 - .pool -_081A41A4: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081A41C0 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB84 - bl StringAppend - b _081A41C8 - .pool -_081A41C0: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB82 - bl StringAppend -_081A41C8: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB8C - bl StringAppend - b _081A4202 - .pool -_081A41E0: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0 - strh r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gScriptResult - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r2, r1 - movs r1, 0x3 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] -_081A4202: - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3FD4 - - thumb_func_start sub_81A4224 -sub_81A4224: @ 81A4224 - push {lr} - bl sub_81652B4 - pop {r0} - bx r0 - thumb_func_end sub_81A4224 - - thumb_func_start sub_81A4230 -sub_81A4230: @ 81A4230 - push {r4-r7,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bls _081A425A - b _081A4394 -_081A425A: - lsls r0, 2 - ldr r1, =_081A4278 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A4278: - .4byte _081A4294 - .4byte _081A42DC - .4byte _081A431C - .4byte _081A4338 - .4byte _081A434C - .4byte _081A4368 - .4byte _081A437C -_081A4294: - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - lsls r4, 1 - lsls r1, r5, 2 - adds r1, r4, r1 - movs r6, 0xCE - lsls r6, 4 - adds r3, r0, r6 - adds r2, r3, r1 - ldrh r1, [r2] - ldr r0, =0x0000270e - cmp r1, r0 - bhi _081A4394 - adds r0, r1, 0x1 - strh r0, [r2] - cmp r5, 0 - bne _081A4394 - adds r0, r3, r4 - ldrh r1, [r0] - movs r0, 0x20 - bl sav12_xor_set - ldr r1, [r7] - adds r0, r1, r6 - adds r0, r4 - ldrh r0, [r0] - ldr r2, =0x00000d02 - adds r1, r2 - b _081A4392 - .pool -_081A42DC: - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - lsls r2, r4, 1 - lsls r1, r5, 2 - adds r1, r2, r1 - ldr r3, =0x00000d0c - adds r0, r3 - adds r3, r0, r1 - ldrh r0, [r3] - ldr r2, =0x0000270e - cmp r0, r2 - bhi _081A42F8 - adds r0, 0x1 - strh r0, [r3] -_081A42F8: - ldr r0, [r6] - ldr r3, =0x00000d1c - adds r0, r3 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, r2 - bhi _081A4394 - adds r0, 0x1 - b _081A4392 - .pool -_081A431C: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r0, r4, 1 - lsls r1, r5, 2 - adds r0, r1 - ldr r1, =0x00000dc8 - adds r2, r1 - adds r1, r2, r0 - b _081A4388 - .pool -_081A4338: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000dda - adds r0, r2 - b _081A4386 - .pool -_081A434C: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r0, r4, 1 - lsls r1, r5, 2 - adds r0, r1 - ldr r3, =0x00000de2 - adds r2, r3 - adds r1, r2, r0 - b _081A4388 - .pool -_081A4368: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e04 - adds r0, r2 - b _081A4386 - .pool -_081A437C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r3, =0x00000e1a - adds r0, r3 -_081A4386: - adds r1, r0, r1 -_081A4388: - ldrh r3, [r1] - ldr r0, =0x0000270e - cmp r3, r0 - bhi _081A4394 - adds r0, r3, 0x1 -_081A4392: - strh r0, [r1] -_081A4394: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4230 - - thumb_func_start sub_81A43A8 -sub_81A43A8: @ 81A43A8 - push {r4-r6,lr} - sub sp, 0x4 - movs r4, 0 - ldr r6, =gSaveBlock1Ptr - movs r5, 0x64 -_081A43B2: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000caa - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _081A43EE - adds r1, r0, 0 - muls r1, r5 - movs r0, 0xEA - lsls r0, 1 - adds r1, r0 - ldr r0, [r6] - adds r0, r1 - movs r1, 0xC - movs r2, 0 - bl GetMonData - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xC - mov r2, sp - bl SetMonData -_081A43EE: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081A43B2 - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A43A8 - - thumb_func_start sub_81A4410 -sub_81A4410: @ 81A4410 - push {r4,lr} - ldr r4, =gScriptResult - bl sub_8185338 - strh r0, [r4] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4410 - - thumb_func_start sub_81A443C -sub_81A443C: @ 81A443C - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A4450 - cmp r0, 0x1 - beq _081A4464 - b _081A446E - .pool -_081A4450: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_02038BCA - ldrh r1, [r1] - bl sub_8162E20 - b _081A446E - .pool -_081A4464: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_02038BCA - ldrh r1, [r1] - bl sub_8162E20 -_081A446E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A443C - - thumb_func_start sub_81A447C -sub_81A447C: @ 81A447C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r0, 0 - str r0, [sp] -_081A448C: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, [sp] - lsls r1, r2, 1 - ldr r4, =0x00000caa - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r1 - adds r2, 0x1 - str r2, [sp, 0x4] - cmp r0, 0x5 - bhi _081A454E - movs r6, 0 - ldr r0, [sp] - movs r2, 0x64 - adds r1, r0, 0 - muls r1, r2 - ldr r0, =gPlayerParty - adds r7, r1, r0 -_081A44BA: - movs r5, 0 - movs r4, 0xD - adds r4, r6 - mov r8, r4 - adds r0, r6, 0x1 - mov r10, r0 -_081A44C6: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000caa - adds r0, r2 - add r0, r9 - ldrh r0, [r0] - movs r4, 0x64 - adds r1, r0, 0 - muls r1, r4 - movs r0, 0xEA - lsls r0, 1 - adds r1, r0 - ldr r2, =gSaveBlock1Ptr - ldr r0, [r2] - adds r0, r1 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - adds r0, r7, 0 - mov r1, r8 - movs r2, 0 - bl GetMonData - cmp r4, r0 - beq _081A4508 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _081A44C6 -_081A4508: - cmp r5, 0x4 - bne _081A4516 - adds r0, r7, 0 - movs r1, 0xA6 - adds r2, r6, 0 - bl sub_80691F4 -_081A4516: - mov r4, r10 - lsls r0, r4, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _081A44BA - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - ldr r4, =0x00000caa - adds r1, r4 - add r1, r9 - ldrh r1, [r1] - subs r1, 0x1 - movs r3, 0x64 - muls r1, r3 - adds r0, r1 - movs r1, 0x8E - lsls r1, 2 - adds r0, r1 - ldr r2, =gPlayerParty - ldr r4, [sp] - adds r1, r4, 0 - muls r1, r3 - adds r1, r2 - movs r2, 0x64 - bl memcpy -_081A454E: - ldr r1, [sp, 0x4] - lsls r0, r1, 24 - lsrs r0, 24 - str r0, [sp] - cmp r0, 0x3 - bls _081A448C - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A447C - - thumb_func_start sub_81A457C -sub_81A457C: @ 81A457C - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sub_81A5030 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A457C - - thumb_func_start sub_81A4594 -sub_81A4594: @ 81A4594 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - mov r8, r1 - adds r6, r3, 0 - ldr r1, =gUnknown_0203AB74 - ldrb r5, [r1] - lsls r4, r0, 1 - adds r4, r0 - ldr r1, =gUnknown_085EE424 - adds r4, r1 - mov r1, r8 - lsls r3, r1, 27 - lsrs r3, 24 - lsls r1, r0, 2 - adds r1, r0 - adds r2, r1 - lsls r2, 3 - adds r2, 0x1 - lsls r2, 24 - lsrs r7, r2, 24 - str r7, [sp] - movs r0, 0xFF - mov r10, r0 - str r0, [sp, 0x4] - movs r1, 0 - mov r9, r1 - str r1, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl Print - movs r0, 0xFF - strb r0, [r6, 0xD] - ldrh r0, [r6, 0x4] - cmp r0, 0 - beq _081A465C - adds r1, r6, 0x6 - ldrb r2, [r6, 0xE] - add r0, sp, 0xC - bl sub_81DB5E8 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - mov r3, r8 - adds r3, 0x2 - lsls r3, 27 - lsrs r3, 24 - str r7, [sp] - mov r1, r10 - str r1, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl Print - ldrh r1, [r6, 0x4] - ldr r0, =0x0000270f - cmp r1, r0 - bls _081A4618 - adds r1, r0, 0 -_081A4618: - ldr r0, =gStringVar2 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r5, =gStringVar4 - ldr r1, =gUnknown_08611D08 - ldr r0, [sp, 0x4C] - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - adds r0, r5, 0 - adds r1, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xC8 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - str r7, [sp] - mov r1, r10 - str r1, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print -_081A465C: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4594 - - thumb_func_start sub_81A4684 -sub_81A4684: @ 81A4684 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - adds r6, r0, 0 - adds r7, r1, 0 - mov r10, r2 - adds r5, r3, 0 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - lsls r2, r6, 1 - adds r2, r6 - ldr r1, =gUnknown_085EE424 - adds r2, r1 - lsls r3, r7, 27 - lsrs r3, 24 - mov r12, r3 - lsls r1, r6, 2 - adds r1, r6 - mov r3, r10 - adds r4, r3, r1 - lsls r1, r4, 3 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r3, 0 - mov r8, r3 - str r3, [sp, 0x8] - movs r1, 0x1 - mov r3, r12 - bl Print - ldrh r0, [r5, 0x8] - cmp r0, 0 - beq _081A47BC - movs r0, 0xFF - strb r0, [r5, 0x11] - movs r0, 0x1 - negs r0, r0 - strb r0, [r5, 0x19] - adds r1, r5, 0 - adds r1, 0xA - ldrb r2, [r5, 0x1A] - add r0, sp, 0xC - bl sub_81DB5E8 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - adds r3, r7, 0x2 - lsls r3, 27 - lsrs r3, 24 - subs r1, r4, 0x1 - lsls r1, 3 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - mov r2, r9 - str r2, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl Print - adds r4, r5, 0 - adds r4, 0x12 - adds r0, r4, 0 - bl sub_8009228 - cmp r0, 0 - beq _081A4734 - add r0, sp, 0xC - adds r1, r4, 0 - movs r2, 0x1 - bl sub_81DB5E8 - b _081A473C - .pool -_081A4734: - add r0, sp, 0xC - adds r1, r4, 0 - bl StringCopy -_081A473C: - ldr r2, =gUnknown_0203AB74 - mov r9, r2 - ldrb r0, [r2] - adds r3, r7, 0x4 - lsls r3, 27 - lsrs r3, 24 - lsls r1, r6, 2 - adds r1, r6 - mov r2, r10 - adds r6, r2, r1 - adds r1, r6, 0x1 - lsls r1, 3 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - mov r8, r1 - str r1, [sp, 0x4] - movs r7, 0 - str r7, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl Print - ldrh r1, [r5, 0x8] - ldr r0, =0x0000270f - cmp r1, r0 - bls _081A4778 - adds r1, r0, 0 -_081A4778: - ldr r0, =gStringVar2 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r5, =gStringVar4 - ldr r0, =gUnknown_08611D08 - ldr r4, [r0, 0x24] - adds r0, r5, 0 - adds r1, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xC8 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r2, r9 - ldrb r0, [r2] - lsls r1, r6, 3 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print -_081A47BC: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4684 - - thumb_func_start sub_81A47E0 -sub_81A47E0: @ 81A47E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x44 - mov r9, r0 - mov r10, r1 - str r2, [sp, 0x40] - movs r0, 0xAC - lsls r0, 1 - bl AllocZeroed - mov r8, r0 - bl sub_80E8260 - add r0, sp, 0x30 - mov r12, r0 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r3, [sp, 0x40] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 4 - mov r4, r10 - lsls r0, r4, 1 - add r0, r10 - lsls r0, 5 - adds r1, r0 - adds r4, r1, r2 - mov r3, sp - movs r2, 0x2 -_081A4820: - adds r0, r3, 0 - movs r5, 0x87 - lsls r5, 2 - adds r1, r4, r5 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldr r1, [r1] - str r1, [r0] - adds r4, 0x10 - adds r3, 0x10 - subs r2, 0x1 - cmp r2, 0 - bge _081A4820 - ldr r6, [sp, 0x40] - lsls r0, r6, 4 - mov r7, r10 - lsls r1, r7, 5 - adds r0, r1 - mov r1, r12 - add r0, r8 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldr r0, [r0] - str r0, [r1] - movs r2, 0 -_081A4852: - movs r1, 0 - movs r4, 0 - movs r3, 0 - lsls r5, r2, 4 - adds r6, r2, 0x1 - mov r2, sp -_081A485E: - ldrh r0, [r2, 0x4] - cmp r0, r1 - ble _081A4868 - adds r4, r3, 0 - adds r1, r0, 0 -_081A4868: - adds r2, 0x10 - adds r3, 0x1 - cmp r3, 0x3 - ble _081A485E - mov r0, sp - ldrh r0, [r0, 0x34] - cmp r0, r1 - blt _081A487A - movs r4, 0x3 -_081A487A: - lsls r0, r4, 4 - mov r7, sp - adds r2, r7, r0 - mov r0, r9 - adds r1, r5, r0 - adds r0, r2, 0 - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldr r0, [r0] - str r0, [r1] - movs r0, 0 - strh r0, [r2, 0x4] - adds r2, r6, 0 - cmp r2, 0x2 - ble _081A4852 - mov r0, r8 - bl Free - add sp, 0x44 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A47E0 - - thumb_func_start sub_81A48B4 -sub_81A48B4: @ 81A48B4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x74 - mov r9, r0 - mov r10, r1 - movs r0, 0xAC - lsls r0, 1 - bl AllocZeroed - mov r8, r0 - bl sub_80E8260 - mov r0, sp - adds r0, 0x54 - str r0, [sp, 0x70] - add r1, sp, 0x5C - mov r12, r1 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - movs r0, 0x54 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - adds r3, r0, r1 - mov r2, sp - movs r4, 0x2 -_081A48EE: - adds r0, r2, 0 - ldr r5, =0x0000057c - adds r1, r3, r5 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldr r1, [r1] - str r1, [r0] - adds r3, 0x1C - adds r2, 0x1C - subs r4, 0x1 - cmp r4, 0 - bge _081A48EE - mov r6, r10 - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - add r0, r8 - ldr r1, [sp, 0x70] - movs r7, 0x90 - lsls r7, 1 - adds r0, r7 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldr r0, [r0] - str r0, [r1] - movs r4, 0 -_081A492A: - movs r1, 0 - movs r5, 0 - movs r3, 0 - lsls r6, r4, 3 - adds r7, r4, 0x1 - mov r2, sp -_081A4936: - ldrh r0, [r2, 0x8] - cmp r0, r1 - ble _081A4940 - adds r5, r3, 0 - adds r1, r0, 0 -_081A4940: - adds r2, 0x1C - adds r3, 0x1 - cmp r3, 0x2 - ble _081A4936 - mov r2, r12 - ldrh r0, [r2] - cmp r0, r1 - blt _081A4952 - movs r5, 0x3 -_081A4952: - subs r1, r6, r4 - lsls r1, 2 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - mov r3, sp - adds r2, r3, r0 - add r1, r9 - adds r0, r2, 0 - ldm r0!, {r4-r6} - stm r1!, {r4-r6} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldr r0, [r0] - str r0, [r1] - movs r0, 0 - strh r0, [r2, 0x8] - adds r4, r7, 0 - cmp r4, 0x2 - ble _081A492A - mov r0, r8 - bl Free - add sp, 0x74 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A48B4 - - thumb_func_start sub_81A4998 -sub_81A4998: @ 81A4998 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x94 - adds r7, r0, 0 - str r1, [sp, 0x90] - ldr r0, =gStringVar1 - ldr r4, =gUnknown_08611CB0 - lsls r5, r7, 3 - adds r1, r5, r4 - ldr r1, [r1] - bl StringCopy - ldr r6, =gStringVar4 - adds r4, 0x4 - adds r5, r4 - ldr r1, [r5] - adds r0, r6, 0 - bl StringExpandPlaceholders - ldr r0, =gUnknown_0203AB74 - mov r8, r0 - ldrb r0, [r0] - movs r1, 0x1 - mov r10, r1 - str r1, [sp] - movs r2, 0xFF - mov r9, r2 - str r2, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - adds r2, r6, 0 - movs r3, 0 - bl Print - ldr r1, =gUnknown_08611D00 - ldr r2, [sp, 0x90] - lsls r0, r2, 2 - adds r0, r1 - ldr r4, [r0] - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xD0 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - mov r1, r8 - ldrb r0, [r1] - lsls r3, 24 - lsrs r3, 24 - mov r2, r10 - str r2, [sp] - mov r1, r9 - str r1, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - bl Print - cmp r7, 0x9 - bne _081A4A6C - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r1, =0x00000ee8 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r2] - movs r2, 0xEF - lsls r2, 4 - adds r0, r2 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - add r4, sp, 0x3C - adds r0, r4, 0 - ldr r1, [sp, 0x90] - bl sub_81A48B4 -_081A4A3A: - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0x4 - adds r3, r4, 0 - bl sub_81A4684 - adds r4, 0x1C - adds r5, 0x1 - cmp r5, 0x2 - ble _081A4A3A - b _081A4A90 - .pool -_081A4A6C: - add r0, sp, 0xC - adds r1, r7, 0 - ldr r2, [sp, 0x90] - bl sub_81A47E0 - movs r5, 0 - add r4, sp, 0xC -_081A4A7A: - str r7, [sp] - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0x4 - adds r3, r4, 0 - bl sub_81A4594 - adds r4, 0x10 - adds r5, 0x1 - cmp r5, 0x2 - ble _081A4A7A -_081A4A90: - add sp, 0x94 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A4998 - - thumb_func_start sub_81A4AA0 -sub_81A4AA0: @ 81A4AA0 - push {r4,lr} - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C84 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - movs r1, 0 - bl sub_81A4998 - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4AA0 - - thumb_func_start sub_81A4AE8 -sub_81A4AE8: @ 81A4AE8 - push {r4,lr} - ldr r4, =gUnknown_0203AB74 - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - movs r1, 0x1 - bl sub_81A4998 - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4AE8 - - thumb_func_start sub_81A4B14 -sub_81A4B14: @ 81A4B14 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r1, 0 - ldr r3, =gSaveBlock2Ptr -_081A4B24: - movs r6, 0 - lsls r0, r1, 1 - adds r2, r1, 0x1 - mov r10, r2 - adds r0, r1 - lsls r0, 5 - mov r8, r0 - movs r7, 0 - movs r0, 0x87 - lsls r0, 2 - add r0, r8 - mov r9, r0 -_081A4B3C: - movs r5, 0 - adds r2, r7, 0 - mov r1, r8 - adds r4, r7, r1 -_081A4B44: - ldr r0, [r3] - add r0, r9 - adds r0, r2 - lsls r1, r5, 4 - adds r0, r1 - movs r1, 0 - str r2, [sp] - str r3, [sp, 0x4] - bl CopyUnalignedWord - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r0, r4 - ldr r1, =0x00000222 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r3] - adds r0, r4 - movs r1, 0x88 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - adds r4, 0x10 - adds r5, 0x1 - ldr r2, [sp] - cmp r5, 0x2 - ble _081A4B44 - adds r7, 0x30 - adds r6, 0x1 - cmp r6, 0x1 - ble _081A4B3C - mov r1, r10 - cmp r1, 0x8 - ble _081A4B24 - movs r6, 0 - ldr r7, =gSaveBlock2Ptr - movs r2, 0x54 - mov r10, r2 - movs r3, 0xFF - mov r9, r3 -_081A4B98: - adds r0, r6, 0x1 - mov r8, r0 - mov r1, r10 - muls r1, r6 - movs r0, 0x54 - adds r4, r6, 0 - muls r4, r0 - movs r2, 0 - ldr r3, =0x0000057c - adds r6, r1, r3 - movs r5, 0x2 -_081A4BAE: - ldr r0, [r7] - adds r0, r6 - adds r0, r2 - movs r1, 0 - str r2, [sp] - bl CopyUnalignedWord - ldr r0, [r7] - adds r0, r6 - ldr r2, [sp] - adds r0, r2 - adds r0, 0x4 - movs r1, 0 - bl CopyUnalignedWord - ldr r1, [r7] - adds r1, r4 - ldr r0, =0x00000586 - adds r1, r0 - ldrb r0, [r1] - mov r3, r9 - orrs r0, r3 - strb r0, [r1] - ldr r1, [r7] - adds r1, r4 - ldr r0, =0x0000058e - adds r1, r0 - ldrb r0, [r1] - orrs r0, r3 - strb r0, [r1] - ldr r0, [r7] - adds r0, r4 - ldr r1, =0x00000584 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - adds r4, 0x1C - ldr r2, [sp] - adds r2, 0x1C - subs r5, 0x1 - cmp r5, 0 - bge _081A4BAE - mov r6, r8 - cmp r6, 0x1 - ble _081A4B98 - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4B14 - - thumb_func_start sub_81A4C30 -sub_81A4C30: @ 81A4C30 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0x96 - lsls r0, 2 - bl AllocZeroed - adds r7, r0, 0 - adds r4, r7, 0 - movs r5, 0 - movs r0, 0xFA - lsls r0, 1 - adds r6, r7, r0 - ldr r0, =gPlayerParty - mov r8, r0 -_081A4C4E: - mov r0, r8 - adds r1, r5, r0 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy - adds r4, 0x64 - adds r5, 0x64 - cmp r4, r6 - ble _081A4C4E - ldr r4, =gPlayerPartyCount - ldrb r5, [r4] - bl copy_player_party_from_sav1 - bl sub_8076D5C - movs r0, 0x1 - bl TrySavingData - bl sav2_gender2_inplace_and_xFE - strb r5, [r4] - adds r4, r7, 0 - ldr r5, =gPlayerParty - movs r0, 0xFA - lsls r0, 1 - adds r6, r7, r0 -_081A4C84: - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r4, 0x64 - adds r5, 0x64 - cmp r4, r6 - ble _081A4C84 - adds r0, r7, 0 - bl Free - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4C30 - - thumb_func_start sub_81A4CB0 -sub_81A4CB0: @ 81A4CB0 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A4CD0 - bl sub_8185EA0 - lsls r0, 24 - lsrs r0, 24 - b _081A4CDA - .pool -_081A4CD0: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 -_081A4CDA: - ldr r2, =gTrainers - ldr r1, =gUnknown_08611D30 - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x3] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A4CB0 - - thumb_func_start sub_81A4D00 -sub_81A4D00: @ 81A4D00 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A4D20 - bl sub_8185EA0 - lsls r0, 24 - lsrs r0, 24 - b _081A4D2A - .pool -_081A4D20: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 -_081A4D2A: - ldr r2, =gTrainers - ldr r1, =gUnknown_08611D30 - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A4D00 - - thumb_func_start sub_81A4D50 -sub_81A4D50: @ 81A4D50 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A4D70 - bl sub_8185EA0 - lsls r0, 24 - lsrs r0, 24 - b _081A4D7A - .pool -_081A4D70: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 -_081A4D7A: - movs r3, 0 - lsls r0, 1 - ldr r2, =gTrainers - ldr r1, =gUnknown_08611D30 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r2, 0x4 - adds r2, r0, r2 -_081A4D90: - adds r1, r4, r3 - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r3, 0x1 - cmp r3, 0x6 - ble _081A4D90 - adds r1, r4, r3 - movs r0, 0xFF - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4D50 - - thumb_func_start sub_81A4DB8 -sub_81A4DB8: @ 81A4DB8 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - ldr r1, =gUnknown_08611C8C - lsrs r0, 15 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A4DB8 - - thumb_func_start sub_81A4DD8 -sub_81A4DD8: @ 81A4DD8 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - ldr r2, =0x00004010 - ldr r1, =gUnknown_08611C8C - lsrs r0, 15 - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4DD8 - - thumb_func_start sub_81A4E04 -sub_81A4E04: @ 81A4E04 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x44 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x20] - bl sub_81A513C - str r0, [sp, 0x24] - ldr r0, [sp, 0x20] - cmp r0, 0x1 - bne _081A4E44 - ldr r0, =0x000003fe - bl sub_81953A0 - lsls r0, 16 - lsrs r0, 16 - bl sub_818FC78 - adds r4, r0, 0 - b _081A4E46 - .pool -_081A4E44: - movs r4, 0x7 -_081A4E46: - bl ZeroEnemyPartyMons - movs r1, 0 - str r1, [sp, 0x18] - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - movs r2, 0 - str r2, [sp, 0x14] -_081A4E5C: - movs r0, 0x1 - ands r0, r4 - asrs r4, 1 - str r4, [sp, 0x30] - ldr r3, [sp, 0x14] - adds r3, 0x1 - str r3, [sp, 0x28] - cmp r0, 0 - bne _081A4E70 - b _081A4FC4 -_081A4E70: - ldr r4, [sp, 0x14] - lsls r4, 2 - mov r9, r4 - ldr r0, [sp, 0x24] - lsls r0, 4 - str r0, [sp, 0x38] - ldr r1, [sp, 0x20] - lsls r1, 4 - str r1, [sp, 0x34] - ldr r2, [sp, 0x1C] - lsls r2, 24 - str r2, [sp, 0x3C] - ldr r3, [sp, 0x18] - adds r3, 0x1 - str r3, [sp, 0x2C] - ldr r0, [sp, 0x14] - add r0, r9 - lsls r0, 2 - mov r8, r0 -_081A4E96: - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r7, r4, 16 - lsls r0, 16 - orrs r7, r0 - ldr r0, =0x0000ef2a - adds r1, r7, 0 - bl sub_806EBD0 - lsls r0, 24 - cmp r0, 0 - bne _081A4E96 - ldr r4, [sp, 0x38] - ldr r1, [sp, 0x24] - subs r0, r4, r1 - lsls r5, r0, 2 - mov r2, r8 - adds r4, r2, r5 - ldr r3, [sp, 0x34] - ldr r1, [sp, 0x20] - subs r0, r3, r1 - lsls r6, r0, 3 - adds r4, r6 - ldr r2, =gUnknown_0861156C - adds r4, r2 - adds r0, r7, 0 - bl GetNatureFromPersonality - ldrb r1, [r4, 0x5] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _081A4E96 - ldr r4, [sp, 0x18] - movs r0, 0x64 - adds r3, r4, 0 - muls r3, r0 - mov r8, r3 - ldr r1, =gEnemyParty - add r1, r8 - mov r10, r1 - ldr r4, [sp, 0x14] - add r4, r9 - lsls r4, 2 - adds r0, r4, r5 - adds r0, r6 - ldr r2, =gUnknown_0861156C - adds r0, r2 - ldrh r1, [r0] - ldr r3, [sp, 0x3C] - lsrs r2, r3, 24 - ldrb r3, [r0, 0x4] - movs r0, 0x1 - str r0, [sp] - str r7, [sp, 0x4] - str r0, [sp, 0x8] - ldr r0, =0x0000ef2a - str r0, [sp, 0xC] - mov r0, r10 - bl create_pokemon_set_level - ldr r0, =gUnknown_0861156C - adds r5, r0 - adds r5, r6, r5 - adds r4, r5, r4 - adds r4, 0x2 - mov r0, r10 - movs r1, 0xC - adds r2, r4, 0 - bl SetMonData - movs r7, 0 - mov r6, r8 - ldr r3, =gEnemyParty -_081A4F32: - adds r1, r7, 0 - adds r1, 0x1A - ldr r0, [sp, 0x14] - add r0, r9 - lsls r4, r0, 2 - adds r2, r5, r4 - adds r0, r7, 0x6 - adds r2, r0 - adds r0, r6, r3 - str r3, [sp, 0x40] - bl SetMonData - adds r7, 0x1 - ldr r3, [sp, 0x40] - cmp r7, 0x5 - ble _081A4F32 - movs r1, 0xFF - add r0, sp, 0x10 - strb r1, [r0] - movs r7, 0 - ldr r1, [sp, 0x18] - movs r2, 0x64 - adds r6, r1, 0 - muls r6, r2 - ldr r3, =gUnknown_08611578 - mov r8, r3 - ldr r3, =gEnemyParty - adds r5, r4, 0 -_081A4F6A: - ldr r4, [sp, 0x38] - ldr r0, [sp, 0x24] - subs r1, r4, r0 - lsls r1, 2 - adds r1, r5, r1 - ldr r2, [sp, 0x34] - ldr r4, [sp, 0x20] - subs r0, r2, r4 - lsls r0, 3 - adds r1, r0 - add r1, r8 - ldrh r4, [r1] - lsls r2, r7, 24 - lsrs r2, 24 - adds r0, r6, r3 - adds r1, r4, 0 - str r3, [sp, 0x40] - bl sub_80691F4 - ldr r3, [sp, 0x40] - cmp r4, 0xDA - bne _081A4F9C - movs r1, 0 - add r0, sp, 0x10 - strb r1, [r0] -_081A4F9C: - adds r5, 0x2 - adds r7, 0x1 - cmp r7, 0x3 - ble _081A4F6A - ldr r0, [sp, 0x18] - movs r1, 0x64 - adds r4, r0, 0 - muls r4, r1 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0x10 - bl SetMonData - adds r0, r4, 0 - bl pokemon_calc_effective_stats - ldr r2, [sp, 0x2C] - str r2, [sp, 0x18] -_081A4FC4: - ldr r4, [sp, 0x30] - ldr r3, [sp, 0x28] - str r3, [sp, 0x14] - cmp r3, 0x2 - bgt _081A4FD0 - b _081A4E5C -_081A4FD0: - add sp, 0x44 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4E04 - - thumb_func_start sub_81A4FF0 -sub_81A4FF0: @ 81A4FF0 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x000040cf - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl sub_81A513C - ldr r3, =gUnknown_0861156C - lsls r2, r4, 2 - adds r2, r4 - lsls r1, r0, 4 - subs r1, r0 - adds r1, r2 - lsls r1, 2 - lsls r0, r5, 4 - subs r0, r5 - lsls r0, 3 - adds r1, r0 - adds r1, r3 - ldrh r0, [r1] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A4FF0 - - thumb_func_start sub_81A5030 -sub_81A5030: @ 81A5030 - push {lr} - lsls r0, 24 - ldr r2, =gUnknown_02038BCA - ldr r3, =0x000003fe - adds r1, r3, 0 - strh r1, [r2] - ldr r2, =0x00004010 - ldr r1, =gUnknown_08611C8C - lsrs r0, 23 - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5030 - - thumb_func_start sub_81A5060 -sub_81A5060: @ 81A5060 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x000040cf - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl sub_81A513C - ldr r2, =gUnknown_0861156C - lsls r4, 1 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 2 - adds r4, r1 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 2 - adds r4, r1 - lsls r0, r5, 4 - subs r0, r5 - lsls r0, 3 - adds r4, r0 - adds r2, 0xC - adds r4, r2 - ldrh r0, [r4] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A5060 - - thumb_func_start sub_81A50B0 -sub_81A50B0: @ 81A50B0 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x000040cf - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl sub_81A513C - ldr r3, =gUnknown_0861156C - lsls r2, r4, 2 - adds r2, r4 - lsls r1, r0, 4 - subs r1, r0 - adds r1, r2 - lsls r1, 2 - lsls r0, r5, 4 - subs r0, r5 - lsls r0, 3 - adds r1, r0 - adds r1, r3 - ldrb r0, [r1, 0x5] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A50B0 - - thumb_func_start sub_81A50F0 -sub_81A50F0: @ 81A50F0 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x000040cf - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl sub_81A513C - ldr r2, =gUnknown_0861156C - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 2 - adds r4, r1 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 2 - adds r4, r1 - lsls r0, r5, 4 - subs r0, r5 - lsls r0, 3 - adds r4, r0 - adds r2, 0x6 - adds r4, r2 - ldrb r0, [r4] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A50F0 - - thumb_func_start sub_81A513C -sub_81A513C: @ 81A513C - push {r4,r5,lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_81A3B30 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bne _081A51A0 - bl sub_81A39C4 - lsls r0, 16 - ldr r3, =gUnknown_08611550 - lsls r2, r5, 2 - adds r1, r3, 0x3 - adds r1, r2, r1 - lsrs r0, 16 - ldrb r1, [r1] - adds r1, r0, r1 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r1, r0 - bne _081A5180 - movs r4, 0 - b _081A51A0 - .pool -_081A5180: - adds r0, r3, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r1, r0 - beq _081A519E - cmp r1, r0 - ble _081A51A0 - subs r0, r1, r0 - adds r1, r3, 0x2 - adds r1, r2, r1 - ldrb r1, [r1] - bl __modsi3 - cmp r0, 0 - bne _081A51A0 -_081A519E: - movs r4, 0x1 -_081A51A0: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A513C - - thumb_func_start sub_81A51A8 -sub_81A51A8: @ 81A51A8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A51D4 - bl sub_8185EA0 - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8185EAC - lsls r0, 24 - lsrs r1, r0, 24 - b _081A51E4 - .pool -_081A51D4: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - bl sub_81A513C - adds r1, r0, 0 -_081A51E4: - cmp r5, 0 - beq _081A51F4 - cmp r5, 0x1 - beq _081A5214 - b _081A5228 - .pool -_081A51F4: - ldr r0, =gStringVar4 - ldr r2, =gUnknown_08611DB0 - lsls r1, 2 - adds r1, r2 - ldr r2, [r1] - lsls r1, r4, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - b _081A5228 - .pool -_081A5214: - ldr r0, =gStringVar4 - ldr r2, =gUnknown_08611DB8 - lsls r1, 2 - adds r1, r2 - ldr r2, [r1] - lsls r1, r4, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy -_081A5228: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A51A8 - - thumb_func_start sub_81A5238 -sub_81A5238: @ 81A5238 - push {lr} - ldr r1, =gUnknown_08611F84 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5238 - - thumb_func_start sub_81A5258 -sub_81A5258: @ 81A5258 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r6, 0 - ldrb r0, [r5] - cmp r0, 0xA - bls _081A5268 - b _081A5544 -_081A5268: - lsls r0, 2 - ldr r1, =_081A5278 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A5278: - .4byte _081A52A4 - .4byte _081A52F4 - .4byte _081A531C - .4byte _081A53B4 - .4byte _081A540C - .4byte _081A542C - .4byte _081A544C - .4byte _081A5490 - .4byte _081A553E - .4byte _081A54D4 - .4byte _081A5520 -_081A52A4: - ldr r0, =0x7fffff1c - movs r1, 0 - str r1, [sp] - movs r1, 0x4 - movs r2, 0 - movs r3, 0x8 - bl BeginNormalPaletteFade - ldr r1, =0x00003f3e - movs r0, 0x48 - bl SetGpuReg - ldr r0, =gUnknown_08611F74 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08D855E8 - movs r1, 0xF8 - lsls r1, 1 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r1, =gUnknown_02022E24 - movs r0, 0xFF - strh r0, [r1] - ldr r1, =gUnknown_02022E26 - movs r0, 0x70 - strh r0, [r1] - b _081A553E - .pool -_081A52F4: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081A5306 - b _081A5544 -_081A5306: - str r0, [sp] - movs r0, 0x5 - movs r1, 0 - movs r2, 0x18 - movs r3, 0xD - bl sub_8056A3C - b _081A553E - .pool -_081A531C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081A5328 - b _081A5544 -_081A5328: - ldr r1, =gBattleTextBuff1 - movs r2, 0xA1 - strb r2, [r1] - movs r0, 0xFF - strb r0, [r1, 0x1] - ldr r1, =gBattleTextBuff2 - strb r2, [r1] - movs r0, 0x1 - negs r0, r0 - strb r0, [r1, 0x1] - ldr r0, =gUnknown_085CCDB2 - bl get_battle_strings_ - ldr r4, =gUnknown_02022E2C - adds r0, r4, 0 - movs r1, 0xF - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDB5 - movs r1, 0x10 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDB8 - bl get_battle_strings_ - adds r0, r4, 0 - movs r1, 0x11 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDBB - movs r1, 0x12 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDC0 - movs r1, 0x13 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDC6 - movs r1, 0x14 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDCB - bl get_battle_strings_ - adds r0, r4, 0 - movs r1, 0x15 - bl battle_show_message_maybe - b _081A553E - .pool -_081A53B4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081A53C0 - b _081A5544 -_081A53C0: - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - movs r6, 0x80 - lsls r6, 15 - movs r4, 0x7 -_081A53CE: - asrs r1, r6, 16 - ldr r0, =gUnknown_08611F5C - movs r2, 0x54 - movs r3, 0 - bl CreateSprite - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x3 - bl StartSpriteAnim - movs r0, 0x80 - lsls r0, 13 - adds r6, r0 - subs r4, 0x1 - cmp r4, 0 - bge _081A53CE - b _081A553C - .pool -_081A540C: - ldr r0, =0x00000109 - bl PlaySE - movs r0, 0x50 - movs r1, 0x28 - movs r2, 0 - movs r3, 0 - bl sub_81A5558 - movs r0, 0xA0 - movs r1, 0x28 - movs r2, 0 - b _081A5464 - .pool -_081A542C: - ldr r0, =0x00000109 - bl PlaySE - movs r0, 0x50 - movs r1, 0x38 - movs r2, 0x1 - movs r3, 0 - bl sub_81A5558 - movs r0, 0xA0 - movs r1, 0x38 - movs r2, 0x1 - b _081A5464 - .pool -_081A544C: - ldr r0, =0x00000109 - bl PlaySE - movs r0, 0x50 - movs r1, 0x48 - movs r2, 0x2 - movs r3, 0 - bl sub_81A5558 - movs r0, 0xA0 - movs r1, 0x48 - movs r2, 0x2 -_081A5464: - movs r3, 0x1 - bl sub_81A5558 - ldr r0, =gUnknown_085CCDCB - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C - movs r1, 0x15 - bl battle_show_message_maybe - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - movs r6, 0x1 - b _081A5544 - .pool -_081A5490: - movs r0, 0x85 - lsls r0, 1 - bl PlaySE - ldr r0, =gBattleTextBuff1 - ldr r1, =gBattleTextBuff2 - ldrb r2, [r0] - ldrb r0, [r1] - cmp r2, r0 - bls _081A54BC - movs r6, 0x2 - ldr r1, =gBattleScripting - movs r0, 0 - strb r0, [r1, 0x17] - b _081A553E - .pool -_081A54BC: - cmp r2, r0 - bcs _081A54D0 - movs r6, 0x3 - ldr r1, =gBattleScripting - movs r0, 0x1 - strb r0, [r1, 0x17] - b _081A553E - .pool -_081A54D0: - movs r6, 0x4 - b _081A553E -_081A54D4: - ldr r1, =0x00003f3e - movs r0, 0x48 - bl SetGpuReg - movs r0, 0x1 - str r0, [sp] - movs r0, 0x5 - movs r1, 0 - movs r2, 0x18 - movs r3, 0xD - bl sub_8056A3C - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl - ldr r0, =0x7fffff1c - movs r1, 0 - str r1, [sp] - movs r1, 0x4 - movs r2, 0x8 - movs r3, 0 - bl BeginNormalPaletteFade - b _081A553E - .pool -_081A5520: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081A5544 - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - movs r0, 0xFA - lsls r0, 2 - bl FreeSpriteTilesByTag -_081A553C: - movs r6, 0x1 -_081A553E: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] -_081A5544: - adds r0, r6, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A5258 - - thumb_func_start sub_81A5558 -sub_81A5558: @ 81A5558 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r7, r3, 24 - movs r6, 0 - movs r1, 0 - ldr r0, =gBattleStruct - ldr r0, [r0] - movs r3, 0xA6 - lsls r3, 2 - adds r4, r0, r3 - ldr r5, =0x0000029a - adds r3, r0, r5 - adds r5, 0x2 - adds r5, r0 - mov r8, r5 - cmp r2, 0x1 - beq _081A55C4 - cmp r2, 0x1 - bgt _081A55A8 - cmp r2, 0 - beq _081A55B0 - b _081A5612 - .pool -_081A55A8: - mov r0, r9 - cmp r0, 0x2 - beq _081A55D8 - b _081A5612 -_081A55B0: - adds r0, r4, r7 - movs r6, 0 - ldrsb r6, [r0, r6] - movs r1, 0x1 - adds r0, r7, 0 - eors r0, r1 - adds r0, r4, r0 - movs r1, 0 - ldrsb r1, [r0, r1] - b _081A5612 -_081A55C4: - adds r0, r3, r7 - movs r6, 0 - ldrsb r6, [r0, r6] - movs r1, 0x1 - adds r0, r7, 0 - eors r0, r1 - adds r0, r3, r0 - movs r1, 0 - ldrsb r1, [r0, r1] - b _081A5612 -_081A55D8: - ldr r3, =gBattleMons - mov r9, r3 - movs r5, 0x58 - adds r0, r7, 0 - muls r0, r5 - add r0, r9 - ldrh r0, [r0, 0x28] - movs r4, 0x64 - muls r0, r4 - lsls r1, r7, 1 - add r1, r8 - ldrh r1, [r1] - bl __divsi3 - adds r6, r0, 0 - movs r0, 0x1 - adds r1, r7, 0 - eors r1, r0 - adds r0, r1, 0 - muls r0, r5 - add r0, r9 - ldrh r0, [r0, 0x28] - muls r0, r4 - lsls r1, 1 - add r1, r8 - ldrh r1, [r1] - bl __divsi3 - adds r1, r0, 0 -_081A5612: - cmp r6, r1 - ble _081A5638 - movs r4, 0x2 - cmp r7, 0 - beq _081A5628 - ldr r1, =gBattleTextBuff2 - b _081A562A - .pool -_081A5628: - ldr r1, =gBattleTextBuff1 -_081A562A: - ldrb r0, [r1] - adds r0, 0x2 - strb r0, [r1] - b _081A565E - .pool -_081A5638: - cmp r6, r1 - bne _081A565C - movs r4, 0x1 - cmp r7, 0 - beq _081A564C - ldr r1, =gBattleTextBuff2 - b _081A564E - .pool -_081A564C: - ldr r1, =gBattleTextBuff1 -_081A564E: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081A565E - .pool -_081A565C: - movs r4, 0 -_081A565E: - ldr r0, =gUnknown_08611F5C - ldr r1, [sp] - mov r2, r10 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - adds r1, r4, 0 - bl StartSpriteAnim - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5558 - - thumb_func_start sub_81A5698 -sub_81A5698: @ 81A5698 - push {lr} - adds r1, r0, 0 - ldr r0, =gBattleCommunication - ldrb r0, [r0] - cmp r0, 0x8 - bls _081A56AA - adds r0, r1, 0 - bl DestroySprite -_081A56AA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5698 - - thumb_func_start sub_81A56B4 -sub_81A56B4: @ 81A56B4 - ldr r0, =gBattleStruct - ldr r2, [r0] - movs r0, 0xA6 - lsls r0, 2 - adds r1, r2, r0 - adds r0, 0x2 - adds r3, r2, r0 - adds r0, 0x2 - adds r2, r0 - movs r0, 0 - strb r0, [r1] - strb r0, [r1, 0x1] - strb r0, [r3] - strb r0, [r3, 0x1] - ldr r0, =gBattleMons - ldrh r1, [r0, 0x28] - strh r1, [r2] - adds r0, 0x80 - ldrh r0, [r0] - strh r0, [r2, 0x2] - bx lr - .pool - thumb_func_end sub_81A56B4 - - thumb_func_start sub_81A56E8 -sub_81A56E8: @ 81A56E8 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gBattleStruct - ldr r1, [r1] - movs r2, 0xA6 - lsls r2, 2 - adds r1, r2 - adds r1, r0 - ldr r2, =gBattleArenaMoveMindRatings - ldr r0, =gCurrentMove - ldrh r0, [r0] - adds r0, r2 - ldrb r0, [r0] - ldrb r2, [r1] - adds r0, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81A56E8 - - thumb_func_start sub_81A5718 -sub_81A5718: @ 81A5718 - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r6, r3, 0 - ldr r0, =gBattleStruct - ldr r2, [r0] - ldr r0, =0x0000029a - adds r5, r2, r0 - ldr r0, =gHitMarker - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _081A57DA - ldr r0, =0x000002a2 - adds r4, r2, r0 - ldrb r2, [r4] - ldr r0, =gBitTable - lsls r1, r3, 2 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081A576C - bics r2, r1 - strb r2, [r4] - adds r1, r5, r3 - ldrb r0, [r1] - subs r0, 0x2 - b _081A57D8 - .pool -_081A576C: - ldr r0, =gBattleMoveFlags - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _081A5798 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081A5788 - ldr r0, =gBattleCommunication - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - beq _081A57DA -_081A5788: - adds r1, r5, r3 - ldrb r0, [r1] - subs r0, 0x2 - b _081A57D8 - .pool -_081A5798: - movs r0, 0x6 - ands r0, r1 - cmp r0, 0x6 - bne _081A57A4 - adds r1, r5, r3 - b _081A57D4 -_081A57A4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081A57B4 - adds r1, r5, r3 - ldrb r0, [r1] - adds r0, 0x2 - b _081A57D8 -_081A57B4: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081A57C4 - adds r1, r5, r3 - ldrb r0, [r1] - subs r0, 0x1 - b _081A57D8 -_081A57C4: - ldr r0, =gProtectStructs - lsls r1, r6, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - bne _081A57DA - adds r1, r5, r6 -_081A57D4: - ldrb r0, [r1] - adds r0, 0x1 -_081A57D8: - strb r0, [r1] -_081A57DA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5718 - - thumb_func_start sub_81A57E4 -sub_81A57E4: @ 81A57E4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r1, 16 - adds r2, r1, 0 - ldr r0, =gBattleStruct - ldr r0, [r0] - ldr r5, =0x0000029a - adds r3, r0, r5 - movs r0, 0x99 - lsls r0, 1 - cmp r1, r0 - bgt _081A582A - subs r0, 0x1 - cmp r1, r0 - bge _081A585C - cmp r1, 0xC5 - bgt _081A581C - cmp r1, 0xC3 - bge _081A585C - cmp r1, 0x77 - beq _081A585C - b _081A5864 - .pool -_081A581C: - cmp r1, 0xC7 - blt _081A5864 - cmp r1, 0xCC - ble _081A585C - cmp r1, 0xCE - beq _081A585C - b _081A5864 -_081A582A: - ldr r0, =0x00000147 - cmp r1, r0 - beq _081A585C - cmp r1, r0 - bgt _081A5848 - subs r0, 0x12 - cmp r1, r0 - beq _081A585C - adds r0, 0x2 - cmp r1, r0 - beq _081A585C - b _081A5864 - .pool -_081A5848: - movs r0, 0xAD - lsls r0, 1 - cmp r2, r0 - blt _081A5864 - adds r0, 0x1 - cmp r2, r0 - ble _081A585C - adds r0, 0x3 - cmp r2, r0 - bne _081A5864 -_081A585C: - adds r1, r3, r4 - ldrb r0, [r1] - subs r0, 0x3 - strb r0, [r1] -_081A5864: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81A57E4 - - thumb_func_start sub_81A586C -sub_81A586C: @ 81A586C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gBattleStruct - ldr r3, [r1] - movs r1, 0xA7 - lsls r1, 2 - adds r3, r1 - lsls r2, r0, 1 - adds r2, r3 - ldr r5, =gBattleMons - movs r4, 0x58 - adds r1, r0, 0 - muls r1, r4 - adds r1, r5 - ldrh r1, [r1, 0x28] - strh r1, [r2] - movs r1, 0x1 - eors r0, r1 - lsls r1, r0, 1 - adds r1, r3 - muls r0, r4 - adds r0, r5 - ldrh r2, [r0, 0x28] - ldrh r0, [r1] - cmp r0, r2 - bls _081A58A4 - strh r2, [r1] -_081A58A4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A586C - - thumb_func_start sub_81A58B4 -sub_81A58B4: @ 81A58B4 - push {r4-r6,lr} - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r3, =0x00000ca9 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x00000ca8 - adds r1, r0 - movs r2, 0 - strb r2, [r1] - ldr r1, [r4] - ldr r6, =0x00000cb2 - adds r0, r1, r6 - strh r2, [r0] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - cmp r5, 0 - beq _081A5914 - ldr r0, [r4] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r2, [r0] - movs r0, 0x80 - b _081A591E - .pool -_081A5914: - ldr r0, [r4] - ldr r3, =0x00000cdc - adds r0, r3 - ldr r2, [r0] - movs r0, 0x40 -_081A591E: - ands r2, r0 - cmp r2, 0 - bne _081A5930 - ldr r0, [r4] - lsls r1, r5, 1 - ldr r6, =0x00000dda - adds r0, r6 - adds r0, r1 - strh r2, [r0] -_081A5930: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - ldr r1, =gUnknown_02038BCA - movs r0, 0 - strh r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A58B4 - - thumb_func_start sub_81A5964 -sub_81A5964: @ 81A5964 - push {r4,lr} - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r1, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _081A59B0 - cmp r0, 0x1 - bgt _081A5994 - cmp r0, 0 - beq _081A599A - b _081A59EE - .pool -_081A5994: - cmp r0, 0x2 - beq _081A59C8 - b _081A59EE -_081A599A: - ldr r0, =gScriptResult - ldr r2, =0x00000dd8 - adds r1, r3, r2 - ldrh r1, [r1] - strh r1, [r0] - b _081A59EE - .pool -_081A59B0: - ldr r2, =gScriptResult - lsls r1, 1 - ldr r4, =0x00000dda - adds r0, r3, r4 - adds r0, r1 - ldrh r0, [r0] - b _081A59EC - .pool -_081A59C8: - cmp r1, 0 - beq _081A59E0 - ldr r2, =gScriptResult - ldr r1, =0x00000cdc - adds r0, r3, r1 - ldr r0, [r0] - movs r1, 0x80 - b _081A59EA - .pool -_081A59E0: - ldr r2, =gScriptResult - ldr r4, =0x00000cdc - adds r0, r3, r4 - ldr r0, [r0] - movs r1, 0x40 -_081A59EA: - ands r0, r1 -_081A59EC: - strh r0, [r2] -_081A59EE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5964 - - thumb_func_start sub_81A59FC -sub_81A59FC: @ 81A59FC - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r1, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _081A5A48 - cmp r0, 0x1 - bgt _081A5A2C - cmp r0, 0 - beq _081A5A32 - b _081A5ABA - .pool -_081A5A2C: - cmp r0, 0x2 - beq _081A5A60 - b _081A5ABA -_081A5A32: - ldr r0, =gSpecialVar_0x8006 - ldrh r1, [r0] - ldr r3, =0x00000dd8 - adds r0, r2, r3 - strh r1, [r0] - b _081A5ABA - .pool -_081A5A48: - lsls r1, 1 - ldr r3, =0x00000dda - adds r0, r2, r3 - adds r0, r1 - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - strh r1, [r0] - b _081A5ABA - .pool -_081A5A60: - cmp r1, 0 - beq _081A5A90 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A5A80 - ldr r1, =0x00000cdc - adds r0, r2, r1 - ldr r1, [r0] - movs r2, 0x80 - orrs r1, r2 - b _081A5AB8 - .pool -_081A5A80: - ldr r3, =0x00000cdc - adds r0, r2, r3 - ldr r1, [r0] - movs r2, 0x81 - negs r2, r2 - b _081A5AB6 - .pool -_081A5A90: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A5AAC - ldr r1, =0x00000cdc - adds r0, r2, r1 - ldr r1, [r0] - movs r2, 0x40 - orrs r1, r2 - b _081A5AB8 - .pool -_081A5AAC: - ldr r3, =0x00000cdc - adds r0, r2, r3 - ldr r1, [r0] - movs r2, 0x41 - negs r2, r2 -_081A5AB6: - ands r1, r2 -_081A5AB8: - str r1, [r0] -_081A5ABA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A59FC - - thumb_func_start sub_81A5AC4 -sub_81A5AC4: @ 81A5AC4 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5AC4 - - thumb_func_start sub_81A5B08 -sub_81A5B08: @ 81A5B08 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000dda - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0x29 - bls _081A5B58 - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_08611FAC - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =0x00000dd8 - adds r4, r1 - b _081A5B76 - .pool -_081A5B58: - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_08611FA0 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r2, =0x00000dd8 - adds r4, r2 -_081A5B76: - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5B08 - - thumb_func_start sub_81A5B88 -sub_81A5B88: @ 81A5B88 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000dd8 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081A5BD0 - ldr r0, [r4] - ldr r1, =0x00000dd8 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000dd8 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081A5BD6 - .pool -_081A5BD0: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081A5BD6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5B88 - - thumb_func_start sub_81A5BE0 -sub_81A5BE0: @ 81A5BE0 - push {lr} - ldr r0, =gStringVar1 - ldr r1, =gUnknown_02038BCA - ldrh r1, [r1] - bl sub_8162E20 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5BE0 - - thumb_func_start sub_81A5BF8 -sub_81A5BF8: @ 81A5BF8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - movs r0, 0x1B - mov r8, r0 - movs r5, 0x7 - movs r4, 0x1 - str r4, [sp] - movs r6, 0x6 - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0xFE - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x20 - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x31 - movs r2, 0 - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x33 - movs r2, 0x1 - movs r3, 0xE - bl FillBgTilemapBufferRect - mov r0, r8 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x34 - movs r2, 0x2 - movs r3, 0xE - bl FillBgTilemapBufferRect - movs r0, 0x1C - mov r8, r0 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x35 - movs r2, 0x1C - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x36 - movs r2, 0x1D - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - movs r6, 0x5 - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x37 - movs r2, 0 - movs r3, 0xF - bl FillBgTilemapBufferRect - mov r0, r8 - str r0, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x39 - movs r2, 0x1 - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x3A - movs r2, 0x1D - movs r3, 0xF - bl FillBgTilemapBufferRect - ldr r1, =0x00000831 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0 - movs r3, 0x13 - bl FillBgTilemapBufferRect - ldr r1, =0x00000833 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0x1 - movs r3, 0x13 - bl FillBgTilemapBufferRect - ldr r1, =0x00000834 - movs r0, 0x1A - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0x2 - movs r3, 0x13 - bl FillBgTilemapBufferRect - ldr r1, =0x00000835 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0x1C - movs r3, 0x13 - bl FillBgTilemapBufferRect - ldr r1, =0x00000836 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0x1D - movs r3, 0x13 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5BF8 - - thumb_func_start sub_81A5D44 -sub_81A5D44: @ 81A5D44 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - movs r5, 0 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - movs r3, 0xE - bl FillBgTilemapBufferRect - movs r6, 0x4 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x4 - movs r2, 0x1 - movs r3, 0xE - bl FillBgTilemapBufferRect - movs r0, 0x1B - mov r8, r0 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x5 - movs r2, 0x2 - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x6 - movs r2, 0x1C - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x7 - movs r2, 0x1D - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x8 - movs r2, 0 - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x9 - movs r2, 0x1 - movs r3, 0xF - bl FillBgTilemapBufferRect - mov r0, r8 - str r0, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xA - movs r2, 0x2 - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xB - movs r2, 0x1C - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xC - movs r2, 0x1D - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xD - movs r2, 0 - movs r3, 0x13 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xE - movs r2, 0x1 - movs r3, 0x13 - bl FillBgTilemapBufferRect - mov r0, r8 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xF - movs r2, 0x2 - movs r3, 0x13 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x10 - movs r2, 0x1C - movs r3, 0x13 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x11 - movs r2, 0x1D - movs r3, 0x13 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81A5D44 - - thumb_func_start sub_81A5E74 -sub_81A5E74: @ 81A5E74 - push {lr} - ldr r1, =gUnknown_08612120 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5E74 - - thumb_func_start sub_81A5E94 -sub_81A5E94: @ 81A5E94 - push {r4-r7,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r4, =0x00000ca9 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r7, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, [r5] - ldr r1, =0x00000ca8 - adds r0, r1 - movs r2, 0 - strb r2, [r0] - ldr r1, [r5] - ldr r3, =0x00000cb2 - adds r0, r1, r3 - strh r2, [r0] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r4, [r5] - ldr r0, =0x00000cdc - adds r3, r4, r0 - ldr r2, =gUnknown_08612164 - lsls r0, r7, 2 - lsls r1, r6, 3 - adds r0, r1 - adds r0, r2 - ldr r3, [r3] - ldr r0, [r0] - ands r3, r0 - cmp r3, 0 - bne _081A5F0A - lsls r1, r7, 1 - lsls r0, r6, 2 - adds r1, r0 - ldr r2, =0x00000de2 - adds r0, r4, r2 - adds r0, r1 - strh r3, [r0] - adds r2, 0x10 - adds r0, r4, r2 - adds r0, r1 - strh r3, [r0] -_081A5F0A: - ldr r1, =gUnknown_03001288 - movs r0, 0 - strb r0, [r1] - movs r2, 0 - ldr r6, =gSaveBlock1Ptr - movs r4, 0xE7 - lsls r4, 4 - ldr r0, =0x0000ffff - adds r3, r0, 0 -_081A5F1C: - ldr r1, [r5] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, r4 - ldrh r0, [r1] - orrs r0, r3 - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _081A5F1C - movs r2, 0 - ldr r4, =gUnknown_03006298 - ldr r1, =0x0000ffff - adds r3, r1, 0 -_081A5F40: - lsls r0, r2, 1 - adds r0, r4 - ldrh r1, [r0] - orrs r1, r3 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _081A5F40 - ldr r0, [r6] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - ldr r1, =gUnknown_02038BCA - movs r0, 0 - strh r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5E94 - - thumb_func_start sub_81A5FA8 -sub_81A5FA8: @ 81A5FA8 - push {r4-r7,lr} - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r6, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x2 - beq _081A6000 - cmp r0, 0x2 - bgt _081A5FE4 - cmp r0, 0x1 - beq _081A5FEA - b _081A6044 - .pool -_081A5FE4: - cmp r0, 0x3 - beq _081A6030 - b _081A6044 -_081A5FEA: - ldr r3, =gScriptResult - ldr r0, [r7] - lsls r1, r6, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000de2 - b _081A603C - .pool -_081A6000: - ldr r4, =gScriptResult - ldr r2, [r7] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_08612164 - lsls r0, r6, 2 - lsls r1, r5, 3 - adds r0, r1 - adds r0, r3 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - strh r0, [r4] - b _081A6044 - .pool -_081A6030: - ldr r3, =gScriptResult - ldr r0, [r7] - lsls r1, r6, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000df2 -_081A603C: - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r3] -_081A6044: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5FA8 - - thumb_func_start sub_81A6054 -sub_81A6054: @ 81A6054 - push {r4-r6,lr} - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x2 - beq _081A60B4 - cmp r0, 0x2 - bgt _081A6090 - cmp r0, 0x1 - beq _081A6096 - b _081A6128 - .pool -_081A6090: - cmp r0, 0x3 - beq _081A6108 - b _081A6128 -_081A6096: - ldr r2, [r6] - lsls r0, r5, 1 - lsls r1, r4, 2 - adds r0, r1 - ldr r1, =0x00000de2 - adds r2, r1 - adds r2, r0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - strh r0, [r2] - b _081A6128 - .pool -_081A60B4: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A60E4 - ldr r2, [r6] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_08612164 - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - orrs r0, r1 - str r0, [r2] - b _081A6128 - .pool -_081A60E4: - ldr r2, [r6] - ldr r1, =0x00000cdc - adds r2, r1 - ldr r3, =gUnknown_08612174 - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - ands r0, r1 - str r0, [r2] - b _081A6128 - .pool -_081A6108: - ldr r3, =gUnknown_03001288 - ldrb r0, [r3] - cmp r0, 0x1 - bne _081A6128 - ldr r2, [r6] - lsls r0, r5, 1 - lsls r1, r4, 2 - adds r0, r1 - ldr r1, =0x00000df2 - adds r2, r1 - adds r2, r0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - movs r1, 0 - strh r0, [r2] - strb r1, [r3] -_081A6128: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A6054 - - thumb_func_start sub_81A613C -sub_81A613C: @ 81A613C - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A613C - - thumb_func_start nullsub_75 -nullsub_75: @ 81A6180 - bx lr - thumb_func_end nullsub_75 - - thumb_func_start nullsub_123 -nullsub_123: @ 81A6184 - bx lr - thumb_func_end nullsub_123 - - thumb_func_start sub_81A6188 -sub_81A6188: @ 81A6188 - push {lr} - bl ZeroPlayerPartyMons - bl sub_819A4F8 - pop {r0} - bx r0 - thumb_func_end sub_81A6188 - - thumb_func_start sub_81A6198 -sub_81A6198: @ 81A6198 - push {lr} - bl sub_819DC00 - pop {r0} - bx r0 - thumb_func_end sub_81A6198 - - thumb_func_start sub_81A61A4 -sub_81A61A4: @ 81A61A4 - ldr r1, =gUnknown_03001288 - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81A61A4 - - thumb_func_start sub_81A61B0 -sub_81A61B0: @ 81A61B0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - str r0, [sp, 0x10] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r1, [r4] - ldr r3, [sp, 0x10] - lsls r2, r3, 1 - lsrs r0, 14 - adds r2, r0 - ldr r6, =0x00000de2 - adds r1, r6 - adds r1, r2 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - ldr r2, =gUnknown_0203BC88 - ldr r1, =gBattleFrontierTrainers - str r1, [r2] - ldr r5, =0x00000cb2 - lsls r0, 24 - str r0, [sp, 0x20] - mov r8, r0 -_081A61FA: - ldr r0, [r4] - adds r0, r5 - ldrb r1, [r0] - mov r2, r8 - lsrs r0, r2, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - movs r7, 0 - ldr r1, [r4] - adds r0, r1, r5 - ldr r6, [sp, 0x10] - lsls r6, 24 - str r6, [sp, 0x1C] - ldrh r0, [r0] - cmp r7, r0 - bge _081A6244 - ldr r2, =0x00000cb4 - adds r0, r1, r2 - ldrh r0, [r0] - ldr r6, =gSaveBlock2Ptr - cmp r0, r3 - beq _081A6244 - ldr r1, [r6] - ldr r6, =0x00000cb2 - adds r0, r1, r6 - ldrh r2, [r0] - ldr r0, =0x00000cb4 - adds r1, r0 -_081A6236: - adds r1, 0x2 - adds r7, 0x1 - cmp r7, r2 - bge _081A6244 - ldrh r0, [r1] - cmp r0, r3 - bne _081A6236 -_081A6244: - ldr r0, [r4] - ldr r1, =0x00000cb2 - adds r0, r1 - ldr r6, =gSaveBlock2Ptr - ldrh r0, [r0] - cmp r7, r0 - bne _081A61FA - ldr r0, =gUnknown_02038BCA - strh r3, [r0] - ldr r2, [r6] - adds r1, r2, r1 - ldrh r0, [r1] - cmp r0, 0x5 - bhi _081A626C - adds r1, r0, 0 - lsls r1, 1 - ldr r4, =0x00000cb4 - adds r0, r2, r4 - adds r0, r1 - strh r3, [r0] -_081A626C: - movs r7, 0 - mov r10, sp - movs r6, 0 - lsls r6, 1 - str r6, [sp, 0x14] - add r6, sp - str r6, [sp, 0x18] -_081A627A: - ldr r1, [sp, 0x1C] - lsrs r0, r1, 24 - ldr r2, [sp, 0x20] - lsrs r1, r2, 24 - movs r2, 0 - bl sub_81A6EF0 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - ldr r4, =gUnknown_0203BC8C - ldr r2, [r4] - lsls r1, r0, 4 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, 0xC9 - beq _081A636E - movs r3, 0 - ldr r6, =gSaveBlock2Ptr - mov r8, r1 - adds r5, r0, 0 - ldr r1, [r6] -_081A62A6: - movs r4, 0xE7 - lsls r4, 4 - adds r0, r1, r4 - ldrh r0, [r0] - lsls r0, 4 - adds r0, r2 - ldrh r0, [r0] - cmp r5, r0 - beq _081A62C0 - adds r1, 0xC - adds r3, 0x1 - cmp r3, 0x5 - ble _081A62A6 -_081A62C0: - cmp r3, 0x6 - bne _081A636E - ldr r6, [sp, 0x10] - cmp r6, 0 - bne _081A62D0 - ldr r0, =0x00000351 - cmp r9, r0 - bhi _081A636E -_081A62D0: - movs r2, 0 - adds r4, r2, r7 - cmp r2, r4 - bge _081A6302 - ldr r1, [sp, 0x18] - ldrh r0, [r1] - cmp r0, r5 - beq _081A6302 - adds r6, r4, 0 - ldr r3, =gUnknown_0203BC8C - mov r12, r3 - mov r5, r8 - ldr r3, [sp, 0x14] - add r3, sp -_081A62EC: - adds r3, 0x2 - adds r2, 0x1 - cmp r2, r6 - bge _081A6302 - mov r1, r12 - ldr r0, [r1] - adds r0, r5, r0 - ldrh r1, [r3] - ldrh r0, [r0] - cmp r1, r0 - bne _081A62EC -_081A6302: - cmp r2, r4 - bne _081A636E - movs r2, 0 - cmp r2, r4 - bge _081A633E - ldr r3, =gBattleFrontierHeldItems - mov r12, r3 - add r0, sp, 0x8 - ldr r6, [sp, 0x14] - adds r3, r0, r6 - mov r0, r8 - str r0, [sp, 0x24] - adds r5, r4, 0 -_081A631C: - ldrh r1, [r3] - cmp r1, 0 - beq _081A6336 - ldr r6, =gUnknown_0203BC8C - ldr r0, [r6] - ldr r6, [sp, 0x24] - adds r0, r6, r0 - ldrb r0, [r0, 0xA] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - cmp r1, r0 - beq _081A633E -_081A6336: - adds r3, 0x2 - adds r2, 0x1 - cmp r2, r5 - blt _081A631C -_081A633E: - cmp r2, r4 - bne _081A636E - lsls r4, r7, 1 - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - add r1, r8 - ldrh r0, [r1] - mov r2, r10 - strh r0, [r2] - add r2, sp, 0x8 - adds r2, r4 - ldr r3, =gBattleFrontierHeldItems - ldrb r0, [r1, 0xA] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r2] - ldr r0, =gUnknown_03006298 - adds r4, r0 - mov r3, r9 - strh r3, [r4] - movs r4, 0x2 - add r10, r4 - adds r7, 0x1 -_081A636E: - cmp r7, 0x3 - bne _081A627A - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A61B0 - - thumb_func_start sub_81A63B8 -sub_81A63B8: @ 81A63B8 - push {lr} - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - movs r1, 0 - bl sub_8162614 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A63B8 - - thumb_func_start sub_81A63CC -sub_81A63CC: @ 81A63CC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _081A63FC - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - b _081A6400 - .pool -_081A63FC: - ldr r1, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons -_081A6400: - str r0, [r1] - movs r7, 0 - ldr r2, =gSaveBlock2Ptr - mov r8, r2 -_081A6408: - mov r0, r8 - ldr r1, [r0] - adds r0, r7, 0x3 - lsls r4, r0, 1 - adds r4, r0 - lsls r4, 2 - adds r1, r4 - ldr r0, =gUnknown_03006298 - lsls r6, r7, 1 - adds r6, r0 - ldrh r0, [r6] - movs r2, 0xE7 - lsls r2, 4 - adds r1, r2 - strh r0, [r1] - movs r0, 0x64 - adds r5, r7, 0 - muls r5, r0 - ldr r0, =gEnemyParty - adds r5, r0 - adds r0, r5, 0 - movs r1, 0x28 - movs r2, 0 - bl pokemon_getattr_encrypted - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e78 - adds r1, r2 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r2, r8 - ldr r1, [r2] - ldr r2, =0x00000e74 - adds r1, r2 - adds r1, r4 - str r0, [r1] - adds r0, r5, 0 - movs r1, 0x2E - movs r2, 0 - bl pokemon_getattr_encrypted - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e79 - adds r1, r2 - strb r0, [r1] - ldrh r1, [r6] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 - adds r1, r0 - ldrb r2, [r1, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r5, 0 - movs r1, 0xC - bl SetMonData - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _081A6408 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A63CC - - thumb_func_start sub_81A64C4 -sub_81A64C4: @ 81A64C4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r2, r0, r1 - ldrb r1, [r2] - movs r3, 0x3 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0x2 - bne _081A6500 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons - str r0, [r1] - movs r2, 0x1E - str r2, [sp, 0x14] - b _081A6518 - .pool -_081A6500: - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - ldrb r1, [r2] - adds r0, r3, 0 - ands r0, r1 - movs r4, 0x32 - str r4, [sp, 0x14] - cmp r0, 0 - beq _081A6518 - movs r5, 0x64 - str r5, [sp, 0x14] -_081A6518: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - bls _081A6522 - b _081A666C -_081A6522: - bl ZeroPlayerPartyMons - movs r0, 0 - mov r8, r0 - mov r1, sp - adds r1, 0x12 - str r1, [sp, 0x1C] - ldr r2, =gUnknown_0203BC8C - mov r9, r2 -_081A6534: - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - mov r5, r8 - lsls r5, 1 - mov r10, r5 - mov r3, r10 - add r3, r8 - lsls r3, 2 - adds r1, r2, r3 - movs r4, 0xE7 - lsls r4, 4 - adds r0, r1, r4 - ldrh r7, [r0] - ldr r5, =0x00000e78 - adds r1, r5 - ldrb r6, [r1] - movs r1, 0x64 - mov r0, r8 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - mov r4, r9 - ldr r1, [r4] - lsls r4, r7, 4 - adds r1, r4, r1 - ldrh r1, [r1] - movs r5, 0x1 - str r5, [sp] - ldr r5, =0x00000e74 - adds r2, r5 - adds r2, r3 - ldr r2, [r2] - str r2, [sp, 0x4] - movs r2, 0 - str r2, [sp, 0x8] - str r2, [sp, 0xC] - ldr r2, [sp, 0x14] - adds r3, r6, 0 - bl create_pokemon_set_level - movs r1, 0 - mov r2, r9 - ldr r0, [r2] - adds r4, r0 - ldrb r4, [r4, 0xB] - mov r5, r8 - adds r5, 0x1 - str r5, [sp, 0x18] - movs r5, 0x5 -_081A6596: - adds r0, r4, 0 - movs r2, 0x1 - ands r0, r2 - cmp r0, 0 - beq _081A65A2 - adds r1, 0x1 -_081A65A2: - lsrs r4, 1 - subs r5, 0x1 - cmp r5, 0 - bge _081A6596 - movs r0, 0xFF - lsls r0, 1 - bl __divsi3 - add r1, sp, 0x10 - strh r0, [r1] - movs r4, 0x1 - movs r5, 0 - lsls r7, 4 - movs r0, 0x64 - mov r6, r8 - muls r6, r0 - ldr r3, =gPlayerParty -_081A65C4: - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrb r0, [r0, 0xB] - ands r0, r4 - cmp r0, 0 - beq _081A65E2 - adds r1, r5, 0 - adds r1, 0x1A - adds r0, r6, r3 - add r2, sp, 0x10 - str r3, [sp, 0x20] - bl SetMonData - ldr r3, [sp, 0x20] -_081A65E2: - lsls r0, r4, 25 - lsrs r4, r0, 24 - adds r5, 0x1 - cmp r5, 0x5 - ble _081A65C4 - movs r2, 0x64 - mov r4, r8 - muls r4, r2 - ldr r5, =gPlayerParty - adds r0, r4, r5 - bl pokemon_calc_effective_stats - movs r0, 0 - ldr r1, [sp, 0x1C] - strb r0, [r1] - movs r6, 0 -_081A6602: - mov r2, r9 - ldr r0, [r2] - adds r0, r7, r0 - lsls r1, r6, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r1, [r0] - lsls r2, r6, 24 - lsrs r2, 24 - adds r0, r4, r5 - bl sub_81A7024 - adds r6, 0x1 - cmp r6, 0x3 - ble _081A6602 - movs r5, 0x64 - mov r4, r8 - muls r4, r5 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x1C] - bl SetMonData - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - mov r2, r10 - add r2, r8 - lsls r2, 2 - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - adds r2, r0 - ldr r0, =0x00000e79 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2E - bl SetMonData - ldr r1, [sp, 0x18] - mov r8, r1 - cmp r1, 0x2 - bgt _081A666C - b _081A6534 -_081A666C: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A667A - cmp r0, 0x2 - beq _081A667A - b _081A67AE -_081A667A: - movs r2, 0 - mov r8, r2 - ldr r4, =gUnknown_0203BC8C - mov r9, r4 -_081A6682: - ldr r5, =gSaveBlock2Ptr - ldr r3, [r5] - mov r0, r8 - adds r0, 0x3 - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r1, r3, r2 - movs r4, 0xE7 - lsls r4, 4 - adds r0, r1, r4 - ldrh r7, [r0] - ldr r5, =0x00000e78 - adds r1, r5 - ldrb r6, [r1] - movs r1, 0x64 - mov r0, r8 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - mov r4, r9 - ldr r1, [r4] - lsls r4, r7, 4 - adds r1, r4, r1 - ldrh r1, [r1] - movs r5, 0x1 - str r5, [sp] - ldr r5, =0x00000e74 - adds r3, r5 - adds r3, r2 - ldr r2, [r3] - str r2, [sp, 0x4] - movs r2, 0 - str r2, [sp, 0x8] - str r2, [sp, 0xC] - ldr r2, [sp, 0x14] - adds r3, r6, 0 - bl create_pokemon_set_level - movs r1, 0 - mov r2, r9 - ldr r0, [r2] - adds r4, r0 - ldrb r4, [r4, 0xB] - mov r5, r8 - lsls r5, 1 - mov r10, r5 - mov r0, r8 - adds r0, 0x1 - str r0, [sp, 0x18] - movs r5, 0x5 -_081A66E8: - adds r0, r4, 0 - movs r2, 0x1 - ands r0, r2 - cmp r0, 0 - beq _081A66F4 - adds r1, 0x1 -_081A66F4: - lsrs r4, 1 - subs r5, 0x1 - cmp r5, 0 - bge _081A66E8 - add r4, sp, 0x10 - movs r0, 0xFF - lsls r0, 1 - bl __divsi3 - strh r0, [r4] - movs r4, 0x1 - movs r5, 0 - lsls r7, 4 - movs r0, 0x64 - mov r6, r8 - muls r6, r0 - ldr r3, =gEnemyParty -_081A6716: - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrb r0, [r0, 0xB] - ands r0, r4 - cmp r0, 0 - beq _081A6734 - adds r1, r5, 0 - adds r1, 0x1A - adds r0, r6, r3 - add r2, sp, 0x10 - str r3, [sp, 0x20] - bl SetMonData - ldr r3, [sp, 0x20] -_081A6734: - lsls r0, r4, 25 - lsrs r4, r0, 24 - adds r5, 0x1 - cmp r5, 0x5 - ble _081A6716 - movs r2, 0x64 - mov r4, r8 - muls r4, r2 - ldr r5, =gEnemyParty - adds r0, r4, r5 - bl pokemon_calc_effective_stats - movs r6, 0 -_081A674E: - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - lsls r1, r6, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r1, [r0] - lsls r2, r6, 24 - lsrs r2, 24 - adds r0, r4, r5 - bl sub_81A7024 - adds r6, 0x1 - cmp r6, 0x3 - ble _081A674E - movs r2, 0x64 - mov r4, r8 - muls r4, r2 - ldr r0, =gEnemyParty - adds r4, r0 - mov r5, r9 - ldr r0, [r5] - adds r0, r7, r0 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - mov r2, r10 - add r2, r8 - lsls r2, 2 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - adds r2, r0 - ldr r5, =0x00000e9d - adds r2, r5 - adds r0, r4, 0 - movs r1, 0x2E - bl SetMonData - ldr r0, [sp, 0x18] - mov r8, r0 - cmp r0, 0x2 - bgt _081A67AE - b _081A6682 -_081A67AE: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A64C4 - - thumb_func_start sub_81A67EC -sub_81A67EC: @ 81A67EC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4C - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - mov r0, sp - adds r0, 0xC - str r0, [sp, 0x38] - mov r1, sp - adds r1, 0x18 - str r1, [sp, 0x3C] - ldr r2, =gSaveBlock2Ptr - mov r9, r2 - movs r2, 0 - adds r3, r1, 0 - adds r1, r0, 0 - mov r0, sp - movs r4, 0x5 - mov r8, r4 -_081A681A: - strh r2, [r0] - strh r2, [r1] - strh r2, [r3] - adds r3, 0x2 - adds r1, 0x2 - adds r0, 0x2 - movs r5, 0x1 - negs r5, r5 - add r8, r5 - mov r4, r8 - cmp r4, 0 - bge _081A681A - mov r5, r9 - ldr r0, [r5] - ldr r7, =0x00000ca9 - adds r0, r7 - ldrb r4, [r0] - lsls r4, 30 - lsrs r4, 30 - ldr r6, =0x000040ce - adds r0, r6, 0 - bl VarGet - lsls r0, 24 - ldr r1, [r5] - lsls r4, 1 - lsrs r0, 22 - adds r4, r0 - ldr r5, =0x00000de2 - adds r1, r5 - adds r1, r4 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x24] - adds r0, r6, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - movs r2, 0 - cmp r0, 0x1 - bne _081A6878 - movs r2, 0x1 -_081A6878: - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - mov r1, r9 - ldr r0, [r1] - adds r0, r7 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081A68B4 - movs r4, 0x1 - str r4, [sp, 0x28] - b _081A68B8 - .pool -_081A68B4: - movs r5, 0 - str r5, [sp, 0x28] -_081A68B8: - adds r0, r2, 0 - ldr r1, [sp, 0x28] - bl sub_81A6F70 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x2C] - movs r0, 0 - mov r10, r0 - mov r8, r0 - ldr r1, [sp, 0x3C] - str r1, [sp, 0x40] - mov r2, sp - str r2, [sp, 0x44] - lsls r4, r0, 1 - str r4, [sp, 0x30] - ldr r5, [sp, 0x38] - adds r5, r4 - str r5, [sp, 0x34] -_081A68DE: - ldr r0, [sp, 0x2C] - cmp r8, r0 - bge _081A68EC - ldr r0, [sp, 0x28] - ldr r1, [sp, 0x24] - movs r2, 0x1 - b _081A68F2 -_081A68EC: - ldr r0, [sp, 0x28] - ldr r1, [sp, 0x24] - movs r2, 0 -_081A68F2: - bl sub_81A6EF0 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - lsls r2, r7, 4 - adds r4, r2, r1 - ldrh r1, [r4] - mov r9, r2 - cmp r1, 0xC9 - beq _081A69E2 - movs r3, 0 - mov r2, r8 - adds r6, r3, r2 - cmp r3, r6 - bge _081A6950 - ldr r5, [sp, 0x34] - ldrh r0, [r5] - cmp r0, r7 - beq _081A6950 - mov r12, r4 - adds r2, r1, 0 - lsls r4, r3, 1 - ldr r1, [sp, 0x30] - add r1, sp - str r6, [sp, 0x48] -_081A6928: - ldrh r0, [r1] - cmp r0, r2 - bne _081A693A - mov r0, r10 - cmp r0, 0 - bne _081A6950 - mov r5, r12 - ldrh r5, [r5] - mov r10, r5 -_081A693A: - adds r4, 0x2 - adds r1, 0x2 - adds r3, 0x1 - ldr r0, [sp, 0x48] - cmp r3, r0 - bge _081A6950 - ldr r5, [sp, 0x38] - adds r0, r5, r4 - ldrh r0, [r0] - cmp r0, r7 - bne _081A6928 -_081A6950: - cmp r3, r6 - bne _081A69E2 - movs r3, 0 - cmp r3, r6 - bge _081A699C - ldr r0, =gBattleFrontierHeldItems - mov r12, r0 - ldr r1, [sp, 0x30] - ldr r2, [sp, 0x3C] - adds r5, r1, r2 -_081A6964: - ldrh r4, [r5] - cmp r4, 0 - beq _081A6994 - ldr r1, =gUnknown_0203BC8C - ldr r0, [r1] - mov r2, r9 - adds r1, r2, r0 - ldrb r0, [r1, 0xA] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - cmp r4, r0 - bne _081A6994 - ldrh r0, [r1] - cmp r0, r10 - bne _081A699C - movs r4, 0 - mov r10, r4 - b _081A699C - .pool -_081A6994: - adds r5, 0x2 - adds r3, 0x1 - cmp r3, r6 - blt _081A6964 -_081A699C: - cmp r3, r6 - bne _081A69E2 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r5, r8 - lsls r3, r5, 1 - adds r0, r3, r5 - lsls r0, 2 - adds r1, r0 - movs r0, 0xE7 - lsls r0, 4 - adds r1, r0 - strh r7, [r1] - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - add r1, r9 - ldrh r0, [r1] - ldr r4, [sp, 0x44] - strh r0, [r4] - ldr r2, =gBattleFrontierHeldItems - ldrb r0, [r1, 0xA] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - ldr r5, [sp, 0x40] - strh r0, [r5] - ldr r0, [sp, 0x38] - adds r3, r0, r3 - strh r7, [r3] - adds r5, 0x2 - str r5, [sp, 0x40] - adds r4, 0x2 - str r4, [sp, 0x44] - movs r1, 0x1 - add r8, r1 -_081A69E2: - mov r2, r8 - cmp r2, 0x6 - beq _081A69EA - b _081A68DE -_081A69EA: - add sp, 0x4C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A67EC - - thumb_func_start sub_81A6A08 -sub_81A6A08: @ 81A6A08 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - movs r4, 0 - add r5, sp, 0x14 - ldr r7, =gScriptResult - movs r1, 0 -_081A6A1E: - mov r2, sp - adds r0, r2, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x11 - bls _081A6A1E - movs r4, 0 - ldr r0, =gUnknown_03006298 - mov r8, r0 - ldr r0, =gUnknown_0203BC8C - ldr r6, [r0] - ldr r1, =gBaseStats - mov r12, r1 -_081A6A3C: - lsls r0, r4, 1 - add r0, r8 - ldrh r0, [r0] - lsls r0, 4 - adds r0, r6 - ldrh r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r2, r12 - adds r3, r0, r2 - ldrb r2, [r3, 0x6] - mov r0, sp - adds r1, r0, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldrb r1, [r3, 0x7] - cmp r2, r1 - beq _081A6A70 - ldrb r0, [r3, 0x7] - mov r2, sp - adds r1, r2, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081A6A70: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A6A3C - movs r0, 0 - strb r0, [r5] - strb r0, [r5, 0x1] - movs r4, 0x1 - adds r3, r5, 0 -_081A6A84: - ldrb r0, [r3] - add r0, sp - mov r2, sp - adds r1, r2, r4 - ldrb r2, [r0] - ldrb r0, [r1] - cmp r2, r0 - bcs _081A6AAC - strb r4, [r5] - b _081A6AB2 - .pool -_081A6AAC: - cmp r2, r0 - bne _081A6AB2 - strb r4, [r3, 0x1] -_081A6AB2: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x11 - bls _081A6A84 - ldrb r1, [r5] - mov r4, sp - adds r0, r4, r1 - ldrb r2, [r0] - cmp r2, 0 - beq _081A6ADA - ldrb r3, [r5, 0x1] - adds r0, r4, r3 - ldrb r0, [r0] - cmp r2, r0 - bhi _081A6AD6 - cmp r1, r3 - bne _081A6ADA -_081A6AD6: - strh r1, [r7] - b _081A6ADE -_081A6ADA: - movs r0, 0x12 - strh r0, [r7] -_081A6ADE: - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A6A08 - - thumb_func_start sub_81A6AEC -sub_81A6AEC: @ 81A6AEC - push {r4-r7,lr} - sub sp, 0x8 - movs r7, 0 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - movs r4, 0 - movs r1, 0 -_081A6AFC: - mov r2, sp - adds r0, r2, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081A6AFC - movs r4, 0 -_081A6B0E: - ldr r1, =gUnknown_03006298 - lsls r0, r4, 1 - adds r0, r1 - ldrh r6, [r0] - movs r5, 0 -_081A6B18: - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - lsls r0, r6, 4 - adds r0, r1 - lsls r1, r5, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r0, [r0] - bl sub_81A6BA4 - lsls r0, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _081A6B18 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A6B0E - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - movs r4, 0x1 - adds r5, r1, 0 - ldr r3, =gBattleFactoryStyleRequiredMoveCounts - adds r2, r5, 0 -_081A6B5C: - mov r1, sp - adds r0, r1, r4 - subs r1, r4, 0x1 - adds r1, r3 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcc _081A6B74 - strh r4, [r2] - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_081A6B74: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081A6B5C - cmp r7, 0x2 - bls _081A6B86 - movs r0, 0x8 - strh r0, [r5] -_081A6B86: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A6AEC - - thumb_func_start sub_81A6BA4 -sub_81A6BA4: @ 81A6BA4 - push {r4-r6,lr} - lsls r0, 16 - lsrs r5, r0, 16 - movs r2, 0 - ldr r6, =gBattleFactoryStyleMoveListPointers -_081A6BAE: - movs r3, 0 - lsls r0, r2, 2 - adds r0, r6 - ldr r1, [r0] - ldrh r0, [r1] - adds r4, r2, 0x1 - cmp r0, 0 - beq _081A6BE4 - lsls r0, r4, 24 - lsrs r2, r0, 24 -_081A6BC2: - lsls r0, r3, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r5 - bne _081A6BD4 - adds r0, r2, 0 - b _081A6BEE - .pool -_081A6BD4: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _081A6BC2 -_081A6BE4: - lsls r0, r4, 24 - lsrs r2, r0, 24 - cmp r2, 0x6 - bls _081A6BAE - movs r0, 0 -_081A6BEE: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81A6BA4 - - thumb_func_start sub_81A6BF4 -sub_81A6BF4: @ 81A6BF4 - push {lr} - movs r2, 0 - ldr r1, =gMapHeader - ldr r3, =0xfffffea5 - adds r0, r3, 0 - ldrh r1, [r1, 0x12] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _081A6C0C - movs r2, 0x1 -_081A6C0C: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A6BF4 - - thumb_func_start sub_81A6C1C -sub_81A6C1C: @ 81A6C1C - push {r4,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _081A6C48 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - b _081A6C4C - .pool -_081A6C48: - ldr r1, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons -_081A6C4C: - str r0, [r1] - movs r4, 0 -_081A6C50: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r2, r1 - movs r1, 0xE7 - lsls r1, 4 - adds r2, r1 - ldrh r2, [r2] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r2, 4 - adds r2, r1 - ldrb r2, [r2, 0xA] - lsls r2, 1 - ldr r1, =gBattleFrontierHeldItems - adds r2, r1 - movs r1, 0xC - bl SetMonData - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A6C50 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A6C1C - - thumb_func_start sub_81A6CA8 -sub_81A6CA8: @ 81A6CA8 - push {lr} - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - negs r2, r1 - orrs r2, r1 - lsrs r2, 31 - lsrs r1, r0, 24 - cmp r1, 0x8 - bls _081A6CBE - movs r1, 0x7 -_081A6CBE: - ldr r0, =gUnknown_08612184 - lsls r1, 1 - adds r1, r2, r1 - adds r1, r0 - ldrb r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A6CA8 - - thumb_func_start sub_81A6CD0 -sub_81A6CD0: @ 81A6CD0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - str r0, [sp, 0x2C] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - ldr r1, [r4] - ldr r3, [sp, 0x2C] - lsls r2, r3, 1 - lsrs r0, 22 - adds r2, r0 - ldr r7, =0x00000de2 - adds r1, r7 - adds r1, r2 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r1, r0, 24 - str r1, [sp, 0x30] - movs r2, 0x80 - lsls r2, 18 - adds r0, r2 - lsrs r0, 24 - movs r1, 0 - bl sub_81A6CA8 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x24] - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x20] - movs r3, 0 - mov r9, r3 - ldr r1, [r4] - ldrb r4, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r4, r0 - str r4, [sp, 0x28] -_081A6D4C: - ldr r0, [sp, 0x2C] - ldr r1, [sp, 0x30] - movs r2, 0 - bl sub_81A6EF0 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r7, =gUnknown_0203BC8C - ldr r1, [r7] - lsls r0, r5, 4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xC9 - bne _081A6D6A - b _081A6EB8 -_081A6D6A: - ldr r0, [sp, 0x20] - cmp r0, 0x32 - bne _081A6D78 - ldr r0, =0x00000351 - cmp r5, r0 - bls _081A6D78 - b _081A6EB8 -_081A6D78: - movs r2, 0 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - movs r3, 0xE7 - lsls r3, 4 - adds r0, r3 - ldrh r0, [r0] - cmp r5, r0 - beq _081A6DA2 - adds r4, r1, 0 - movs r1, 0 -_081A6D8E: - adds r1, 0xC - adds r2, 0x1 - cmp r2, 0x5 - bgt _081A6DA2 - ldr r0, [r4] - adds r0, r1 - adds r0, r3 - ldrh r0, [r0] - cmp r5, r0 - bne _081A6D8E -_081A6DA2: - cmp r2, 0x6 - beq _081A6DA8 - b _081A6EB8 -_081A6DA8: - movs r4, 0 - cmp r4, r9 - bge _081A6DDC - add r2, sp, 0xC - ldr r7, =gUnknown_0203BC8C - ldr r0, [r7] - lsls r1, r5, 4 - adds r0, r1, r0 - ldrh r2, [r2] - adds r7, r1, 0 - ldrh r0, [r0] - cmp r2, r0 - beq _081A6DDC - ldr r6, =gUnknown_0203BC8C - adds r3, r7, 0 - add r2, sp, 0xC -_081A6DC8: - adds r2, 0x2 - adds r4, 0x1 - cmp r4, r9 - bge _081A6DDC - ldr r0, [r6] - adds r0, r3, r0 - ldrh r1, [r2] - ldrh r0, [r0] - cmp r1, r0 - bne _081A6DC8 -_081A6DDC: - cmp r4, r9 - bne _081A6EB8 - movs r4, 0 - cmp r4, r9 - bge _081A6E0C - ldr r7, =gBattleFrontierHeldItems - ldr r6, =gUnknown_0203BC8C - add r2, sp, 0x14 - lsls r3, r5, 4 -_081A6DEE: - ldrh r1, [r2] - cmp r1, 0 - beq _081A6E04 - ldr r0, [r6] - adds r0, r3, r0 - ldrb r0, [r0, 0xA] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - cmp r1, r0 - beq _081A6E0C -_081A6E04: - adds r2, 0x2 - adds r4, 0x1 - cmp r4, r9 - blt _081A6DEE -_081A6E0C: - cmp r4, r9 - bne _081A6EB8 - mov r0, r9 - lsls r2, r0, 1 - mov r1, sp - adds r1, r2 - adds r1, 0xC - ldr r3, =gUnknown_0203BC8C - ldr r4, [r3] - lsls r5, 4 - mov r8, r5 - add r4, r8 - ldrh r0, [r4] - strh r0, [r1] - add r1, sp, 0x14 - adds r1, r2 - ldr r2, =gBattleFrontierHeldItems - ldrb r0, [r4, 0xA] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - movs r0, 0x64 - mov r5, r9 - muls r5, r0 - ldr r6, =gEnemyParty - adds r0, r5, r6 - ldrh r1, [r4] - ldr r7, [sp, 0x20] - lsls r2, r7, 24 - ldrb r3, [r4, 0xC] - ldr r7, [sp, 0x24] - str r7, [sp] - ldrb r4, [r4, 0xB] - str r4, [sp, 0x4] - ldr r4, [sp, 0x28] - str r4, [sp, 0x8] - lsrs r2, 24 - bl sub_8068634 - add r0, sp, 0x1C - movs r7, 0 - strb r7, [r0] - movs r4, 0 - mov r7, r8 - mov r10, r0 - movs r0, 0x1 - add r0, r9 - mov r8, r0 -_081A6E6E: - ldr r1, =gUnknown_0203BC8C - ldr r0, [r1] - adds r0, r7, r0 - lsls r1, r4, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r1, [r0] - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r5, r6 - bl sub_81A7024 - adds r4, 0x1 - cmp r4, 0x3 - ble _081A6E6E - movs r0, 0x64 - mov r4, r9 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - mov r2, r10 - bl SetMonData - ldr r2, =gUnknown_0203BC8C - ldr r0, [r2] - adds r0, r7, r0 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - mov r9, r8 -_081A6EB8: - mov r3, r9 - cmp r3, 0x3 - beq _081A6EC0 - b _081A6D4C -_081A6EC0: - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A6CD0 - - thumb_func_start sub_81A6EF0 -sub_81A6EF0: @ 81A6EF0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, 24 - lsrs r2, 24 - movs r4, 0x8 - negs r1, r0 - orrs r1, r0 - asrs r1, 31 - ands r1, r4 - adds r4, r1, 0 - cmp r3, 0x6 - bhi _081A6F2C - cmp r2, 0 - beq _081A6F20 - ldr r2, =gUnknown_08612194 - adds r1, r3 - adds r1, 0x1 - b _081A6F38 - .pool -_081A6F20: - ldr r2, =gUnknown_08612194 - adds r1, r3 - b _081A6F38 - .pool -_081A6F2C: - adds r1, r3, 0 - cmp r1, 0x7 - beq _081A6F34 - movs r1, 0x7 -_081A6F34: - ldr r2, =gUnknown_08612194 - adds r1, r4, r1 -_081A6F38: - lsls r1, 2 - adds r0, r2, 0x2 - adds r0, r1, r0 - adds r1, r2 - ldrh r0, [r0] - ldrh r4, [r1] - subs r0, r4 - adds r0, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r4, r0, r4 - lsls r4, 16 - lsrs r0, r4, 16 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A6EF0 - - thumb_func_start sub_81A6F70 -sub_81A6F70: @ 81A6F70 - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000df2 - adds r2, r0 - adds r2, r1 - ldrb r1, [r2] - movs r0, 0 - cmp r1, 0xE - bls _081A6FA8 - movs r0, 0x1 - cmp r1, 0x15 - bls _081A6FA8 - movs r0, 0x2 - cmp r1, 0x1C - bls _081A6FA8 - movs r0, 0x3 - cmp r1, 0x23 - bls _081A6FA8 - movs r0, 0x5 - cmp r1, 0x2A - bhi _081A6FA8 - movs r0, 0x4 -_081A6FA8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A6F70 - - thumb_func_start sub_81A6FB4 -sub_81A6FB4: @ 81A6FB4 - push {r4,r5,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - cmp r4, 0x2 - beq _081A6FF8 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r1, [r5] - lsls r2, r4, 1 - lsrs r0, 14 - adds r2, r0 - ldr r0, =0x00000de2 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =gUnknown_02038BCA - ldrh r1, [r0] - ldr r0, =0x000003fe - cmp r1, r0 - beq _081A7018 - cmp r2, 0x1 - bgt _081A7014 -_081A6FF8: - movs r0, 0 - b _081A701E - .pool -_081A7014: - cmp r2, 0x3 - ble _081A701C -_081A7018: - movs r0, 0x7 - b _081A701E -_081A701C: - movs r0, 0x1 -_081A701E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A6FB4 - - thumb_func_start sub_81A7024 -sub_81A7024: @ 81A7024 - push {lr} - lsls r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsrs r1, 16 - cmp r1, 0xD8 - bne _081A7034 - movs r1, 0xDA -_081A7034: - bl sub_80691F4 - pop {r0} - bx r0 - thumb_func_end sub_81A7024 - - thumb_func_start sub_81A703C -sub_81A703C: @ 81A703C - push {lr} - ldr r1, =gUnknown_086125F8 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A703C - - thumb_func_start sub_81A705C -sub_81A705C: @ 81A705C - push {lr} - bl sub_81A79EC - ldr r1, =gUnknown_0300128C - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A705C - - thumb_func_start sub_81A7070 -sub_81A7070: @ 81A7070 - push {r4-r7,lr} - ldr r0, =0x00004010 - movs r1, 0x1C - bl VarSet - ldr r0, =0x00004011 - movs r1, 0xE2 - bl VarSet - movs r4, 0x1 - movs r6, 0 - movs r5, 0 - movs r7, 0 - ldr r0, =gUnknown_0300128C - ldrb r0, [r0] - cmp r0, 0x8 - bhi _081A7132 - lsls r0, 2 - ldr r1, =_081A70AC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A70AC: - .4byte _081A70D0 - .4byte _081A70DA - .4byte _081A70DE - .4byte _081A70E8 - .4byte _081A70FC - .4byte _081A70D6 - .4byte _081A7100 - .4byte _081A7108 - .4byte _081A710E -_081A70D0: - movs r0, 0 - bl sub_81A82A4 -_081A70D6: - movs r4, 0 - b _081A711A -_081A70DA: - movs r5, 0x1C - b _081A711A -_081A70DE: - bl sub_81A7B58 - lsls r0, 24 - lsrs r5, r0, 24 - b _081A711A -_081A70E8: - movs r5, 0x30 - ldr r0, =gUnknown_0300128D - ldrb r0, [r0] - movs r7, 0xE1 - cmp r0, 0x1 - bne _081A7118 - movs r7, 0xE2 - b _081A7118 - .pool -_081A70FC: - movs r5, 0x30 - b _081A711A -_081A7100: - movs r0, 0x1 - bl sub_81A82A4 - b _081A7114 -_081A7108: - bl sub_81A8374 - b _081A70D6 -_081A710E: - movs r0, 0x5 - bl sub_81A5030 -_081A7114: - movs r7, 0x1C - movs r4, 0 -_081A7118: - movs r6, 0x1 -_081A711A: - cmp r4, 0x1 - bne _081A7126 - ldr r0, =0x00004010 - adds r1, r5, 0 - bl VarSet -_081A7126: - cmp r6, 0x1 - bne _081A7132 - ldr r0, =0x00004011 - adds r1, r7, 0 - bl VarSet -_081A7132: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7070 - - thumb_func_start sub_81A7140 -sub_81A7140: @ 81A7140 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r2, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - adds r3, r1, 0 - cmp r0, 0x4 - bhi _081A723A - lsls r0, 2 - ldr r1, =_081A7174 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A7174: - .4byte _081A7188 - .4byte _081A71A0 - .4byte _081A71C4 - .4byte _081A71E8 - .4byte _081A720C -_081A7188: - ldr r0, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000e02 - adds r1, r3 - ldrh r1, [r1] - strh r1, [r0] - b _081A723A - .pool -_081A71A0: - ldr r2, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000ca9 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r3, =0x00000e04 - adds r1, r3 - adds r1, r0 - ldrh r0, [r1] - b _081A7238 - .pool -_081A71C4: - ldr r2, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000ca9 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r3, =0x00000e08 - adds r1, r3 - adds r1, r0 - ldrh r0, [r1] - b _081A7238 - .pool -_081A71E8: - ldr r2, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000ca9 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r3, =0x00000e0c - adds r1, r3 - adds r1, r0 - ldrh r0, [r1] - b _081A7238 - .pool -_081A720C: - cmp r2, 0 - beq _081A7228 - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 4 - b _081A7236 - .pool -_081A7228: - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r3, =0x00000cdc - adds r0, r3 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 3 -_081A7236: - ands r0, r1 -_081A7238: - strh r0, [r2] -_081A723A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7140 - - thumb_func_start sub_81A7248 -sub_81A7248: @ 81A7248 - push {r4,r5,lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r3, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - adds r2, r1, 0 - cmp r0, 0x4 - bls _081A7264 - b _081A73AA -_081A7264: - lsls r0, 2 - ldr r1, =_081A7280 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A7280: - .4byte _081A7294 - .4byte _081A72AC - .4byte _081A72D8 - .4byte _081A7314 - .4byte _081A7344 -_081A7294: - ldr r0, [r2] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r5, =0x00000e02 - adds r0, r5 - strh r1, [r0] - b _081A73AA - .pool -_081A72AC: - ldr r0, =gSpecialVar_0x8006 - ldrh r3, [r0] - ldr r0, =0x0000270f - cmp r3, r0 - bls _081A72B8 - b _081A73AA -_081A72B8: - ldr r0, [r2] - ldr r2, =0x00000ca9 - adds r1, r0, r2 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - ldr r5, =0x00000e04 - b _081A732C - .pool -_081A72D8: - ldr r0, =gSpecialVar_0x8006 - ldrh r4, [r0] - adds r3, r4, 0 - ldr r0, =0x0000270f - cmp r3, r0 - bhi _081A73AA - ldr r1, [r2] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r2, r0, 30 - lsrs r0, r2, 29 - ldr r5, =0x00000e08 - adds r1, r5 - adds r0, r1, r0 - ldrh r0, [r0] - cmp r0, r3 - bcs _081A73AA - lsrs r0, r2, 29 - adds r0, r1, r0 - strh r4, [r0] - b _081A73AA - .pool -_081A7314: - ldr r0, =gSpecialVar_0x8006 - ldrh r3, [r0] - ldr r0, =0x0000270f - cmp r3, r0 - bhi _081A73AA - ldr r0, [r2] - ldr r2, =0x00000ca9 - adds r1, r0, r2 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - ldr r5, =0x00000e0c -_081A732C: - adds r0, r5 - adds r0, r1 - strh r3, [r0] - b _081A73AA - .pool -_081A7344: - cmp r3, 0 - beq _081A737C - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A7368 - ldr r0, [r2] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 4 - orrs r1, r2 - b _081A73A8 - .pool -_081A7368: - ldr r0, [r2] - ldr r2, =0x00000cdc - adds r0, r2 - ldr r1, [r0] - ldr r2, =0xfffff7ff - b _081A73A6 - .pool -_081A737C: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A739C - ldr r0, [r2] - ldr r5, =0x00000cdc - adds r0, r5 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 3 - orrs r1, r2 - b _081A73A8 - .pool -_081A739C: - ldr r0, [r2] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r1, [r0] - ldr r2, =0xfffffbff -_081A73A6: - ands r1, r2 -_081A73A8: - str r1, [r0] -_081A73AA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7248 - - thumb_func_start sub_81A73B8 -sub_81A73B8: @ 81A73B8 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xE - bls _081A73DC - ldr r1, =gScriptResult - movs r0, 0x1 - b _081A73E0 - .pool -_081A73DC: - ldr r1, =gScriptResult - movs r0, 0 -_081A73E0: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A73B8 - - thumb_func_start sub_81A73EC -sub_81A73EC: @ 81A73EC - ldr r0, =gScriptResult - ldr r1, =gUnknown_0300128C - ldrb r1, [r1] - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81A73EC - - thumb_func_start sub_81A7400 -sub_81A7400: @ 81A7400 - ldr r1, =gUnknown_0300128E - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81A7400 - - thumb_func_start sub_81A740C -sub_81A740C: @ 81A740C - ldr r1, =gUnknown_0300128E - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81A740C - - thumb_func_start sub_81A7418 -sub_81A7418: @ 81A7418 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl save_serialize_map - movs r0, 0x1 - bl TrySavingData - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7418 - - thumb_func_start nullsub_76 -nullsub_76: @ 81A7460 - bx lr - thumb_func_end nullsub_76 - - thumb_func_start nullsub_124 -nullsub_124: @ 81A7464 - bx lr - thumb_func_end nullsub_124 - - thumb_func_start sub_81A7468 -sub_81A7468: @ 81A7468 - push {lr} - ldr r0, =gUnknown_03001290 - ldr r0, [r0] - cmp r0, 0x20 - beq _081A748E - cmp r0, 0x20 - bhi _081A7484 - cmp r0, 0x7 - beq _081A74BC - cmp r0, 0x10 - beq _081A7498 - b _081A74C2 - .pool -_081A7484: - cmp r0, 0x40 - beq _081A74B0 - cmp r0, 0x80 - beq _081A74A4 - b _081A74C2 -_081A748E: - ldr r1, =gScriptResult - movs r0, 0 - b _081A74C0 - .pool -_081A7498: - ldr r1, =gScriptResult - movs r0, 0x1 - b _081A74C0 - .pool -_081A74A4: - ldr r1, =gScriptResult - movs r0, 0x2 - b _081A74C0 - .pool -_081A74B0: - ldr r1, =gScriptResult - movs r0, 0x3 - b _081A74C0 - .pool -_081A74BC: - ldr r1, =gScriptResult - movs r0, 0x4 -_081A74C0: - strh r0, [r1] -_081A74C2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7468 - - thumb_func_start sub_81A74CC -sub_81A74CC: @ 81A74CC - ldr r0, =gScriptResult - ldr r1, =gUnknown_0300128D - ldrb r1, [r1] - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81A74CC - - thumb_func_start sub_81A74E0 -sub_81A74E0: @ 81A74E0 - push {r4,lr} - bl Random - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x1 - ands r4, r0 - adds r4, 0x1 - adds r0, r4, 0 - bl sub_81A7F38 - ldr r0, =gScriptResult - strh r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A74E0 - - thumb_func_start sub_81A7508 -sub_81A7508: @ 81A7508 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0x4 - bhi _081A7538 - ldr r1, =gUnknown_0861231C - ldr r0, =gUnknown_03001294 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x2] - b _081A7560 - .pool -_081A7538: - cmp r0, 0xA - bhi _081A7554 - ldr r1, =gUnknown_0861231C - ldr r0, =gUnknown_03001294 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x3] - b _081A7560 - .pool -_081A7554: - ldr r1, =gUnknown_0861231C - ldr r0, =gUnknown_03001294 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x4] -_081A7560: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_086123E4 - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7508 - - thumb_func_start sub_81A7580 -sub_81A7580: @ 81A7580 - push {lr} - ldr r0, =sub_81A7EE4 - movs r1, 0x2 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7580 - - thumb_func_start sub_81A7594 -sub_81A7594: @ 81A7594 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r4, 0 - movs r1, 0 -_081A759E: - mov r2, sp - adds r0, r2, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081A759E - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - lsls r2, r0, 16 - mov r1, sp - strb r0, [r1] - mov r0, sp - lsrs r2, 24 - strb r2, [r0, 0x1] - adds r0, r5, 0 - movs r1, 0x39 - mov r2, sp - bl SetMonData - adds r0, r5, 0 - movs r1, 0x15 - bl GetMonData - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 -_081A75DA: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - adds r2, r4, 0 - bl CalcPPWithPPUps - mov r1, sp - strb r0, [r1] - adds r1, r4, 0 - adds r1, 0x11 - adds r0, r5, 0 - mov r2, sp - bl SetMonData - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081A75DA - mov r0, sp - movs r1, 0 - strb r1, [r0] - strb r1, [r0, 0x1] - strb r1, [r0, 0x2] - strb r1, [r0, 0x3] - adds r0, r5, 0 - movs r1, 0x37 - mov r2, sp - bl SetMonData - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81A7594 - - thumb_func_start sub_81A7628 -sub_81A7628: @ 81A7628 - push {r4,lr} - adds r4, r1, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - cmp r4, 0x20 - beq _081A7652 - cmp r4, 0x20 - bhi _081A7648 - cmp r4, 0x7 - beq _081A7664 - cmp r4, 0x10 - beq _081A7658 - b _081A7674 -_081A7648: - cmp r4, 0x40 - beq _081A765E - cmp r4, 0x80 - beq _081A766E - b _081A7674 -_081A7652: - cmp r0, 0x28 - bne _081A7674 - b _081A7672 -_081A7658: - cmp r0, 0x29 - bne _081A7674 - b _081A7672 -_081A765E: - cmp r0, 0x7 - bne _081A7674 - b _081A7672 -_081A7664: - cmp r0, 0xF - beq _081A7672 - cmp r0, 0x48 - bne _081A7674 - b _081A7672 -_081A766E: - cmp r0, 0x11 - bne _081A7674 -_081A7672: - movs r1, 0x1 -_081A7674: - adds r0, r1, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81A7628 - - thumb_func_start sub_81A767C -sub_81A767C: @ 81A767C - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r3, 0 - cmp r1, 0x20 - beq _081A76C4 - cmp r1, 0x20 - bhi _081A7696 - cmp r1, 0x7 - beq _081A771C - cmp r1, 0x10 - beq _081A7704 - b _081A771C -_081A7696: - cmp r1, 0x40 - beq _081A76E0 - cmp r1, 0x80 - bne _081A771C - ldr r1, =gBaseStats - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x6] - cmp r2, 0x8 - beq _081A771A - cmp r2, 0x3 - beq _081A771A - ldrb r0, [r0, 0x7] - cmp r0, 0x8 - beq _081A771A - cmp r0, 0x3 - bne _081A771C - b _081A771A - .pool -_081A76C4: - ldr r0, =gBaseStats - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, 0xF - beq _081A771A - ldrb r0, [r1, 0x7] - cmp r0, 0xF - bne _081A771C - b _081A771A - .pool -_081A76E0: - ldr r1, =gBaseStats - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x6] - cmp r2, 0x4 - beq _081A771A - cmp r2, 0xD - beq _081A771A - ldrb r0, [r0, 0x7] - cmp r0, 0x4 - beq _081A771A - cmp r0, 0xD - bne _081A771C - b _081A771A - .pool -_081A7704: - ldr r0, =gBaseStats - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, 0xA - beq _081A771A - ldrb r0, [r1, 0x7] - cmp r0, 0xA - bne _081A771C -_081A771A: - movs r3, 0x1 -_081A771C: - adds r0, r3, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A767C - - thumb_func_start sub_81A7728 -sub_81A7728: @ 81A7728 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r6, 0 -_081A7736: - mov r1, sp - adds r0, r1, r6 - strb r6, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _081A7736 - movs r4, 0 - mov r8, r4 -_081A774A: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r6, r0, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - adds r2, r1, r6 - ldrb r3, [r2] - adds r1, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x9 - bls _081A774A - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r4, =0x00000cb2 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x1 - mov r10, r1 - cmp r0, 0x4 - bls _081A77A8 - movs r4, 0x3 - mov r10, r4 - cmp r0, 0x9 - bhi _081A77A8 - movs r0, 0x2 - mov r10, r0 -_081A77A8: - movs r1, 0 - str r1, [sp, 0x4] - ldr r7, =gUnknown_03001290 -_081A77AE: - movs r4, 0 - mov r9, r4 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x22 - bhi _081A77DC - movs r0, 0x80 - b _081A77FC - .pool -_081A77DC: - cmp r0, 0x3B - bhi _081A77E4 - movs r0, 0x20 - b _081A77FC -_081A77E4: - cmp r0, 0x4F - bhi _081A77EC - movs r0, 0x40 - b _081A77FC -_081A77EC: - cmp r1, 0x59 - bhi _081A77FA - movs r0, 0x7 - b _081A77FC -_081A77F4: - movs r0, 0x1 - mov r9, r0 - b _081A786E -_081A77FA: - movs r0, 0x10 -_081A77FC: - str r0, [r7] - ldr r0, =gUnknown_03001290 - ldr r0, [r0] - ldr r1, [sp, 0x4] - cmp r1, r0 - beq _081A7874 - str r0, [sp, 0x4] - movs r4, 0 - mov r8, r4 - movs r6, 0 -_081A7810: - mov r1, sp - adds r0, r1, r6 - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A7860 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081A7860 - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r1, [r7] - adds r0, r4, 0 - bl sub_81A767C - lsls r0, 24 - cmp r0, 0 - beq _081A77F4 -_081A7860: - cmp r8, r10 - beq _081A786E - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _081A7810 -_081A786E: - mov r4, r8 - cmp r4, 0 - beq _081A78CC -_081A7874: - mov r0, r9 - cmp r0, 0 - beq _081A77AE - ldr r0, =gUnknown_03001290 - ldr r0, [r0] - cmp r0, 0x20 - beq _081A7898 - cmp r0, 0x20 - bhi _081A78D0 - cmp r0, 0x7 - beq _081A78D0 - cmp r0, 0x10 - beq _081A78A4 - b _081A78D0 - .pool -_081A7898: - ldr r1, =gUnknown_0300128D - movs r0, 0x1 - b _081A78D4 - .pool -_081A78A4: - bl Random - lsls r0, 16 - lsrs r1, r0, 16 - movs r2, 0x1 - ands r1, r2 - cmp r1, 0 - beq _081A78C0 - ldr r0, =gUnknown_0300128D - strb r2, [r0] - b _081A78D6 - .pool -_081A78C0: - ldr r0, =gUnknown_0300128D - strb r1, [r0] - b _081A78D6 - .pool -_081A78CC: - movs r0, 0 - b _081A7956 -_081A78D0: - ldr r1, =gUnknown_0300128D - movs r0, 0 -_081A78D4: - strb r0, [r1] -_081A78D6: - movs r1, 0 - mov r8, r1 - movs r6, 0 -_081A78DC: - mov r4, sp - adds r0, r4, r6 - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A7946 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081A7946 - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r7, =gUnknown_03001290 - ldr r1, [r7] - adds r0, r5, 0 - bl sub_81A7628 - lsls r0, 24 - cmp r0, 0 - bne _081A7946 - ldr r1, [r7] - adds r0, r4, 0 - bl sub_81A767C - lsls r0, 24 - cmp r0, 0 - bne _081A7946 - adds r0, r5, 0 - movs r1, 0x37 - adds r2, r7, 0 - bl SetMonData -_081A7946: - cmp r8, r10 - beq _081A7954 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _081A78DC -_081A7954: - movs r0, 0x1 -_081A7956: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A7728 - - thumb_func_start sub_81A7974 -sub_81A7974: @ 81A7974 - push {r4-r7,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - movs r7, 0x1 - cmp r0, 0x4 - bls _081A798E - movs r7, 0x3 - cmp r0, 0x9 - bhi _081A798E - movs r7, 0x2 -_081A798E: - movs r6, 0 - movs r5, 0 - b _081A79A2 - .pool -_081A799C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_081A79A2: - cmp r5, 0x2 - bhi _081A79D8 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A79D4 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081A79D4 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_081A79D4: - cmp r6, r7 - bne _081A799C -_081A79D8: - cmp r6, 0 - beq _081A79E4 - movs r0, 0x1 - b _081A79E6 - .pool -_081A79E4: - movs r0, 0 -_081A79E6: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A7974 - - thumb_func_start sub_81A79EC -sub_81A79EC: @ 81A79EC - push {r4-r6,lr} - sub sp, 0x8 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - movs r4, 0xE1 - lsls r4, 4 - adds r0, r4 - ldrb r2, [r0] - movs r3, 0x78 - ands r3, r2 - adds r5, r1, 0 - cmp r3, 0x40 - bne _081A7A10 - lsls r0, r2, 25 - lsrs r0, 28 - b _081A7B48 - .pool -_081A7A10: - ldr r0, =gSpecialVar_0x8007 - lsls r1, r2, 29 - ldrh r0, [r0] - lsrs r1, 29 - cmp r0, r1 - bne _081A7A34 - cmp r3, 0x18 - bne _081A7A24 - bl sub_81A7728 -_081A7A24: - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 28 - b _081A7B48 - .pool -_081A7A34: - movs r2, 0 - ldr r3, =gUnknown_0861266C - movs r1, 0 -_081A7A3A: - mov r4, sp - adds r0, r4, r2 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081A7A3A - movs r4, 0x8 - ldr r0, [r5] - movs r6, 0xE1 - lsls r6, 4 - adds r0, r6 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 28 - adds r0, r3 - ldrb r1, [r0] - movs r2, 0 - adds r5, r3, 0 - movs r3, 0x1 -_081A7A64: - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, r1 - bne _081A7A78 - mov r6, sp - adds r0, r6, r2 - strb r3, [r0] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7A78: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081A7A64 - mov r0, sp - ldrb r0, [r0, 0x7] - cmp r0, 0x1 - beq _081A7AA0 - bl sub_81A8554 - lsls r0, 24 - cmp r0, 0 - bne _081A7AA0 - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x7] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7AA0: - mov r0, sp - ldrb r0, [r0, 0x3] - cmp r0, 0x1 - beq _081A7ABE - bl sub_81A7974 - lsls r0, 24 - cmp r0, 0 - bne _081A7ABE - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x3] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7ABE: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xE1 - lsls r1, 4 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081A7AFA - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - beq _081A7AE6 - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x1] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7AE6: - mov r0, sp - ldrb r0, [r0, 0x4] - cmp r0, 0x1 - beq _081A7AFA - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x4] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7AFA: - adds r0, r4, 0 - bl AllocZeroed - adds r5, r0, 0 - movs r3, 0 - movs r2, 0 -_081A7B06: - mov r6, sp - adds r0, r6, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _081A7B1C - adds r1, r3, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r1, r5, r1 - strb r2, [r1] -_081A7B1C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081A7B06 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - adds r0, r5, r0 - ldrb r4, [r0] - adds r0, r5, 0 - bl Free - cmp r4, 0x3 - bne _081A7B46 - bl sub_81A7728 -_081A7B46: - adds r0, r4, 0 -_081A7B48: - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A79EC - - thumb_func_start sub_81A7B58 -sub_81A7B58: @ 81A7B58 - push {r4,lr} - ldr r4, =gUnknown_03001294 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - bl __umodsi3 - strb r0, [r4] - ldr r1, =gUnknown_0861231C - ldrb r0, [r4] - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A7B58 - - thumb_func_start sub_81A7B84 -sub_81A7B84: @ 81A7B84 - ldr r0, =gUnknown_0300128E - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81A7B84 - - thumb_func_start sub_81A7B90 -sub_81A7B90: @ 81A7B90 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl sub_81A7D00 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - ldr r4, =0x00000ca9 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 30 - ldr r1, =gUnknown_08612314 - lsrs r0, 28 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x4] - ldr r0, =gEnemyParty - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r0, r5, 16 - lsrs r0, 16 - bl sub_81A890C - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r7] - adds r0, r4 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081A7C1C - bl sub_8165CB4 - adds r7, r0, 0 - cmp r7, 0x3B - ble _081A7C08 - lsls r0, r6, 2 - ldr r1, [sp, 0x4] - adds r0, r1 - ldr r1, [r0] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - subs r7, r0 - cmp r7, 0x3B - bgt _081A7C32 -_081A7C08: - movs r7, 0x3C - b _081A7C32 - .pool -_081A7C1C: - lsls r0, r6, 2 - ldr r2, [sp, 0x4] - adds r0, r2 - ldr r1, [r0] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x2] - movs r0, 0x32 - subs r7, r0, r1 -_081A7C32: - mov r0, r8 - cmp r0, 0x1 - bne _081A7C4A - lsls r0, r7, 24 - lsrs r0, 24 - bl sub_81A88B0 - lsls r0, 24 - cmp r0, 0 - bne _081A7C4A - movs r0, 0 - b _081A7CE2 -_081A7C4A: - ldr r0, =gEnemyParty - ldr r1, =gBaseStats - mov r8, r1 - lsls r6, 2 - mov r9, r6 - ldr r2, [sp, 0x4] - add r2, r9 - mov r10, r2 - ldr r1, [r2] - lsls r6, r5, 1 - adds r4, r6, r5 - lsls r4, 2 - adds r1, r4, r1 - ldrh r2, [r1] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x13] - movs r1, 0xCA - lsls r1, 1 - muls r2, r1 - lsls r1, r7, 2 - ldr r3, =gExperienceTables - adds r1, r3 - adds r2, r1 - movs r1, 0x19 - bl SetMonData - mov r1, r10 - ldr r0, [r1] - adds r4, r0 - ldrh r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x17] - mov r7, r9 - cmp r0, 0 - beq _081A7CA8 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 -_081A7CA8: - str r0, [sp] - ldr r0, =gEnemyParty - movs r1, 0x2E - mov r2, sp - bl SetMonData - movs r4, 0 - adds r0, r6, r5 - lsls r6, r0, 2 -_081A7CBA: - ldr r2, [sp, 0x4] - adds r0, r7, r2 - ldr r0, [r0] - adds r0, r6, r0 - lsls r1, r4, 1 - adds r0, 0x4 - adds r0, r1 - ldrh r1, [r0] - lsls r2, r4, 24 - lsrs r2, 24 - ldr r0, =gEnemyParty - bl sub_80691F4 - adds r4, 0x1 - cmp r4, 0x3 - ble _081A7CBA - ldr r0, =gEnemyParty - bl pokemon_calc_effective_stats - movs r0, 0x1 -_081A7CE2: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A7B90 - - thumb_func_start sub_81A7D00 -sub_81A7D00: @ 81A7D00 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000e04 - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - adds r2, r1, 0 - movs r0, 0x8C - lsls r0, 1 - cmp r1, r0 - bhi _081A7D34 - movs r1, 0 - b _081A7D4C - .pool -_081A7D34: - movs r0, 0x8C - lsls r0, 2 - cmp r1, r0 - bhi _081A7D40 - movs r1, 0x1 - b _081A7D4C -_081A7D40: - movs r0, 0xD2 - lsls r0, 2 - movs r1, 0x3 - cmp r2, r0 - bhi _081A7D4C - movs r1, 0x2 -_081A7D4C: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_81A7D00 - - thumb_func_start sub_81A7D54 -sub_81A7D54: @ 81A7D54 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_08612688 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081A7D66: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _081A7D66 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7D54 - - thumb_func_start sub_81A7D8C -sub_81A7D8C: @ 81A7D8C - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _081A7DA4 - subs r0, r1, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - cmp r0, 0 - bne _081A7DC8 -_081A7DA4: - ldrh r0, [r4, 0xA] - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x10] - ldrh r1, [r4, 0x16] - adds r0, r1 - strh r0, [r4, 0x16] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _081A7DBC - movs r0, 0x10 - strh r0, [r4, 0x16] -_081A7DBC: - movs r0, 0x1 - negs r0, r0 - ldrb r1, [r4, 0x16] - ldr r2, =0x00002d6b - bl BlendPalettes -_081A7DC8: - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0xF - ble _081A7DDA - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xC] - strh r0, [r4, 0x14] -_081A7DDA: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A7D8C - - thumb_func_start sub_81A7DE8 -sub_81A7DE8: @ 81A7DE8 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _081A7E00 - subs r0, r1, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - cmp r0, 0 - bne _081A7E22 -_081A7E00: - ldrh r0, [r4, 0xC] - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x16] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0x16] - lsls r0, 16 - cmp r0, 0 - bge _081A7E16 - movs r0, 0 - strh r0, [r4, 0x16] -_081A7E16: - movs r0, 0x1 - negs r0, r0 - ldrb r1, [r4, 0x16] - ldr r2, =0x00002d6b - bl BlendPalettes -_081A7E22: - movs r0, 0x16 - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _081A7E56 - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _081A7E50 - ldr r0, =sub_81A7D54 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - b _081A7E56 - .pool -_081A7E50: - ldrh r0, [r4, 0xA] - strh r0, [r4, 0x14] - strh r1, [r4, 0x8] -_081A7E56: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81A7DE8 - - thumb_func_start sub_81A7E60 -sub_81A7E60: @ 81A7E60 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - mov r8, r0 - adds r4, r1, 0 - adds r5, r2, 0 - adds r6, r3, 0 - ldr r3, [sp, 0x18] - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - lsls r3, 16 - lsrs r3, 16 - ldr r0, =sub_81A7D54 - movs r1, 0x3 - str r3, [sp] - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - mov r0, r8 - strh r0, [r1, 0xA] - strh r4, [r1, 0xC] - strh r5, [r1, 0xE] - strh r6, [r1, 0x10] - ldr r3, [sp] - strh r3, [r1, 0x12] - strh r0, [r1, 0x14] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7E60 - - thumb_func_start sub_81A7EC4 -sub_81A7EC4: @ 81A7EC4 - push {lr} - ldr r0, =sub_81A7D54 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081A7EDC - movs r0, 0 - b _081A7EDE - .pool -_081A7EDC: - movs r0, 0x1 -_081A7EDE: - pop {r1} - bx r1 - thumb_func_end sub_81A7EC4 - - thumb_func_start sub_81A7EE4 -sub_81A7EE4: @ 81A7EE4 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0x8] - movs r3, 0x8 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _081A7F1C - adds r0, r2, 0x1 - strh r0, [r1, 0x8] - movs r0, 0x2 - str r0, [sp] - movs r0, 0 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x2 - bl sub_81A7E60 - b _081A7F30 - .pool -_081A7F1C: - bl sub_81A7EC4 - lsls r0, 24 - cmp r0, 0 - beq _081A7F30 - bl script_env_2_enable_and_set_ctx_running - adds r0, r4, 0 - bl DestroyTask -_081A7F30: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A7EE4 - - thumb_func_start sub_81A7F38 -sub_81A7F38: @ 81A7F38 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - cmp r0, 0 - bne _081A7F50 - b _081A807A -_081A7F50: - movs r0, 0 - mov r8, r0 -_081A7F54: - mov r0, sp - add r0, r8 - mov r1, r8 - strb r1, [r0] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x2 - bls _081A7F54 - movs r5, 0 -_081A7F6C: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - mov r2, sp - add r2, r8 - ldrb r3, [r2] - mov r0, sp - adds r1, r0, r4 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _081A7F6C - movs r1, 0 - mov r8, r1 -_081A7FB0: - movs r0, 0 - mov r10, r0 - mov r4, sp - add r4, r8 - ldrb r1, [r4] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r7, 0 - movs r1, 0x3A - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - str r4, [sp, 0x8] - cmp r5, r6 - bcc _081A8044 - adds r0, r7, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - beq _081A7FFC - movs r0, 0x1 - mov r10, r0 - b _081A8048 - .pool -_081A7FFC: - adds r0, r7, 0 - movs r1, 0x15 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r4, 0 - b _081A8014 -_081A800E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A8014: - cmp r4, 0x3 - bhi _081A8048 - adds r1, r4, 0 - adds r1, 0xD - adds r0, r7, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r1, r9 - adds r2, r4, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r6, r0, 24 - adds r1, r4, 0 - adds r1, 0x11 - adds r0, r7, 0 - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r6 - bcs _081A800E -_081A8044: - movs r1, 0x1 - mov r10, r1 -_081A8048: - mov r0, r10 - cmp r0, 0x1 - bne _081A806C - ldr r0, [sp, 0x8] - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_81A7594 - ldr r0, [sp, 0x4] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - cmp r0, 0 - beq _081A807A -_081A806C: - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x2 - bls _081A7FB0 -_081A807A: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7F38 - - thumb_func_start sub_81A8090 -sub_81A8090: @ 81A8090 - push {r4,lr} - ldr r4, =gScriptResult - bl InBattlePike - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8090 - - thumb_func_start InBattlePike -InBattlePike: @ 81A80A8 - push {lr} - movs r2, 0 - ldr r0, =gMapHeader - ldrh r1, [r0, 0x12] - ldr r3, =0xfffffea1 - adds r0, r1, r3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _081A80CA - movs r0, 0xB3 - lsls r0, 1 - cmp r1, r0 - beq _081A80CA - adds r0, 0x1 - cmp r1, r0 - bne _081A80CC -_081A80CA: - movs r2, 0x1 -_081A80CC: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end InBattlePike - - thumb_func_start sub_81A80DC -sub_81A80DC: @ 81A80DC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =gScriptResult - movs r0, 0 - strh r0, [r4] - movs r0, 0x1 - bl sub_81A8590 - lsls r0, 24 - cmp r0, 0 - beq _081A8138 - movs r0, 0x1 - strh r0, [r4] - bl Random - ldr r5, =gSaveBlock2Ptr - ldr r4, [r5] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - movs r3, 0xE1 - lsls r3, 4 - adds r4, r3 - movs r1, 0x7 - ands r1, r0 - ldrb r2, [r4] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4] - ldr r2, [r5] - adds r2, r3 - ldrb r1, [r2] - movs r0, 0x79 - negs r0, r0 - ands r0, r1 - movs r1, 0x40 - b _081A8248 - .pool -_081A8138: - bl Random - ldr r7, =gSaveBlock2Ptr - ldr r4, [r7] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - movs r3, 0xE1 - lsls r3, 4 - adds r4, r3 - movs r1, 0x7 - ands r1, r0 - ldrb r2, [r4] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4] - ldr r0, [r7] - adds r0, r3 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - movs r6, 0x8 - cmp r0, 0 - beq _081A8172 - movs r6, 0x6 -_081A8172: - adds r0, r6, 0 - bl AllocZeroed - adds r5, r0, 0 - movs r2, 0 - movs r3, 0 - cmp r2, r6 - bcs _081A81BE - adds r4, r7, 0 -_081A8184: - ldr r0, [r4] - movs r1, 0xE1 - lsls r1, 4 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081A81B0 - cmp r2, 0x1 - beq _081A81B4 - cmp r2, 0x4 - beq _081A81B4 - adds r1, r3, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r1, r5, r1 - strb r2, [r1] - b _081A81B4 - .pool -_081A81B0: - adds r0, r5, r2 - strb r2, [r0] -_081A81B4: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r6 - bcc _081A8184 -_081A81BE: - bl Random - ldr r7, =gSaveBlock2Ptr - ldr r4, [r7] - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - adds r0, r5, r0 - ldrb r0, [r0] - movs r6, 0xE1 - lsls r6, 4 - adds r4, r6 - movs r1, 0xF - ands r1, r0 - lsls r1, 3 - ldrb r2, [r4] - movs r0, 0x79 - negs r0, r0 - mov r8, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4] - adds r0, r5, 0 - bl Free - ldr r0, [r7] - adds r0, r6 - ldrb r1, [r0] - movs r0, 0x78 - ands r0, r1 - cmp r0, 0x18 - bne _081A821C - bl sub_81A7974 - lsls r0, 24 - cmp r0, 0 - bne _081A821C - ldr r2, [r7] - adds r2, r6 - ldrb r1, [r2] - mov r0, r8 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2] -_081A821C: - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - movs r4, 0xE1 - lsls r4, 4 - adds r0, r4 - ldrb r1, [r0] - movs r0, 0x78 - ands r0, r1 - cmp r0, 0x38 - bne _081A824C - bl sub_81A8554 - lsls r0, 24 - cmp r0, 0 - bne _081A824C - ldr r2, [r5] - adds r2, r4 - ldrb r1, [r2] - movs r0, 0x79 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 -_081A8248: - orrs r0, r1 - strb r0, [r2] -_081A824C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A80DC - - thumb_func_start sub_81A825C -sub_81A825C: @ 81A825C - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r2, 0xE1 - lsls r2, 4 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - lsrs r0, 29 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A825C - - thumb_func_start sub_81A827C -sub_81A827C: @ 81A827C - ldr r2, =gScriptResult - ldr r1, =gUnknown_0861266C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r3, 0xE1 - lsls r3, 4 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 28 - adds r0, r1 - ldrb r0, [r0] - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_81A827C - - thumb_func_start sub_81A82A4 -sub_81A82A4: @ 81A82A4 - push {r4-r7,lr} - lsls r0, 24 - movs r7, 0x6 - cmp r0, 0 - bne _081A82B0 - movs r7, 0x1 -_081A82B0: - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000e04 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0xE - bl __udivsi3 - lsls r0, 16 - lsrs r6, r0, 16 - adds r5, r4, 0 -_081A82D2: - lsls r0, r6, 24 - lsrs r0, 24 - adds r1, r7, 0 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r3, 0 - ldr r1, [r5] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r0, [r0] - subs r2, r0, 0x1 - cmp r3, r2 - bge _081A831A - ldr r0, =0x00000cb4 - adds r1, r0 - b _081A8314 - .pool -_081A830C: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, r2 - bge _081A831A -_081A8314: - ldrh r0, [r1] - cmp r0, r4 - bne _081A830C -_081A831A: - ldr r0, [r5] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - subs r0, 0x1 - cmp r3, r0 - bne _081A82D2 - ldr r5, =gUnknown_02038BCA - strh r4, [r5] - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - ldrh r0, [r5] - movs r1, 0 - bl sub_8162614 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0x00000cb2 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0xD - bhi _081A8356 - subs r0, 0x1 - lsls r0, 1 - ldr r2, =0x00000cb4 - adds r1, r2 - adds r1, r0 - ldrh r0, [r5] - strh r0, [r1] -_081A8356: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A82A4 - - thumb_func_start sub_81A8374 -sub_81A8374: @ 81A8374 - push {r4-r7,lr} - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000e04 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0xE - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - lsls r7, r5, 24 - adds r6, r4, 0 -_081A83A0: - lsls r0, r5, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r3, 0 - ldr r1, [r6] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r0, [r0] - subs r2, r0, 0x1 - cmp r3, r2 - bge _081A83EE - ldr r0, =0x00000cb4 - adds r1, r0 - b _081A83E8 - .pool -_081A83E0: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, r2 - bge _081A83EE -_081A83E8: - ldrh r0, [r1] - cmp r0, r4 - bne _081A83E0 -_081A83EE: - ldr r0, [r6] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - subs r0, 0x1 - cmp r3, r0 - bne _081A83A0 - ldr r5, =gUnknown_02038BCA - strh r4, [r5] - ldrh r0, [r5] - movs r1, 0 - bl sub_8162614 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r0, =0x00000cb2 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0xE - bhi _081A8424 - subs r0, 0x1 - lsls r0, 1 - ldr r2, =0x00000cb4 - adds r1, r2 - adds r1, r0 - ldrh r0, [r5] - strh r0, [r1] -_081A8424: - adds r5, r3, 0 -_081A8426: - lsrs r0, r7, 24 - movs r1, 0x1 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r3, 0 - ldr r1, [r5] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r3, r0 - bge _081A8466 - adds r2, 0x2 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, r4 - beq _081A8466 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - subs r2, 0x2 - adds r0, r1, r2 - ldrh r2, [r0] - ldr r0, =0x00000cb4 - adds r1, r0 -_081A8458: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, r2 - bge _081A8466 - ldrh r0, [r1] - cmp r0, r4 - bne _081A8458 -_081A8466: - ldr r0, [r5] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r3, r0 - bne _081A8426 - ldr r5, =gUnknown_02038BCC - strh r4, [r5] - ldrh r0, [r5] - movs r1, 0x1 - bl sub_8162614 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0x00000cb2 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0xD - bhi _081A849A - subs r0, 0x2 - lsls r0, 1 - ldr r2, =0x00000cb4 - adds r1, r2 - adds r1, r0 - ldrh r0, [r5] - strh r0, [r1] -_081A849A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8374 - - thumb_func_start sub_81A84B4 -sub_81A84B4: @ 81A84B4 - push {r4,r5,lr} - movs r2, 0 - ldr r5, =gSaveBlock2Ptr - ldr r4, =0x00000cb4 - ldr r0, =0x0000ffff - adds r3, r0, 0 -_081A84C0: - ldr r1, [r5] - lsls r0, r2, 1 - adds r1, r4 - adds r1, r0 - ldrh r0, [r1] - orrs r0, r3 - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xD - bls _081A84C0 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A84B4 - - thumb_func_start sub_81A84EC -sub_81A84EC: @ 81A84EC - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - bne _081A8524 - ldr r3, =gUnknown_02038BCA - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _081A8542 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString - b _081A8542 - .pool -_081A8524: - cmp r0, 0x1 - bne _081A8542 - ldr r3, =gUnknown_02038BCC - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _081A8542 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString -_081A8542: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A84EC - - thumb_func_start sub_81A8554 -sub_81A8554: @ 81A8554 - push {r4-r6,lr} - ldr r5, =gPlayerParty - movs r6, 0 - movs r4, 0 -_081A855C: - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081A856E - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_081A856E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, 0x64 - cmp r4, 0x2 - bls _081A855C - cmp r6, 0x1 - bhi _081A8588 - movs r0, 0x1 - b _081A858A - .pool -_081A8588: - movs r0, 0 -_081A858A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81A8554 - - thumb_func_start sub_81A8590 -sub_81A8590: @ 81A8590 - push {r4-r6,lr} - lsls r0, 24 - movs r6, 0 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - ldr r3, =0x00000ca9 - adds r1, r2, r3 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - ldr r3, =0x00000e04 - adds r2, r3 - adds r2, r1 - lsrs r4, r0, 24 - ldrh r2, [r2] - adds r0, r4, r2 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x5 - bl sub_81A3B30 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - blt _081A85F0 - cmp r2, 0x1 - bgt _081A85F0 - ldr r1, =gUnknown_086125DC - adds r0, r2, 0 - adds r0, 0x14 - adds r0, r1 - ldrb r0, [r0] - ldrb r1, [r1, 0x17] - subs r0, r1 - cmp r4, r0 - bne _081A8634 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - b _081A8634 - .pool -_081A85F0: - ldr r5, =gUnknown_086125DC - movs r0, 0x5 - lsls r3, r0, 2 - adds r0, r3, r5 - ldrb r1, [r0] - adds r0, r5, 0x3 - adds r0, r3, r0 - ldrb r2, [r0] - subs r1, r2 - cmp r4, r1 - bne _081A8610 - movs r6, 0x3 - b _081A8634 - .pool -_081A8610: - adds r0, r5, 0x1 - adds r0, r3, r0 - ldrb r1, [r0] - subs r0, r1, r2 - cmp r4, r0 - beq _081A8632 - cmp r4, r1 - bls _081A8634 - subs r0, r4, r1 - adds r0, r2 - adds r1, r5, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - bl __modsi3 - cmp r0, 0 - bne _081A8634 -_081A8632: - movs r6, 0x4 -_081A8634: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81A8590 - - thumb_func_start sub_81A863C -sub_81A863C: @ 81A863C - push {r4,lr} - ldr r4, =gScriptResult - movs r0, 0 - bl sub_81A8590 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A863C - - thumb_func_start sub_81A8658 -sub_81A8658: @ 81A8658 - push {r4,lr} - ldr r3, =gUnknown_08612675 - ldr r2, =gSpecialVar_0x8007 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xE1 - lsls r1, 4 - adds r0, r1 - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 29 - lsls r0, r1, 1 - adds r0, r1 - ldrh r2, [r2] - adds r0, r2 - adds r0, r3 - ldrb r4, [r0] - adds r0, r4, 0 - bl sub_81A7F38 - ldr r0, =gScriptResult - strh r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8658 - - thumb_func_start sub_81A869C -sub_81A869C: @ 81A869C - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8005 - ldrb r1, [r0] - movs r0, 0xE1 - lsls r0, 4 - adds r2, r0 - lsls r1, 7 - ldrb r3, [r2] - movs r0, 0x7F - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_81A869C - - thumb_func_start sub_81A86C0 -sub_81A86C0: @ 81A86C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - movs r0, 0 - mov r10, r0 -_081A86D4: - movs r0, 0 - mov r9, r0 - movs r0, 0x64 - mov r1, r10 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r7, 0 - movs r1, 0x3A - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, r5 - bcc _081A8762 - adds r0, r7, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A8762 - adds r0, r7, 0 - movs r1, 0x15 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r6, 0 - b _081A8732 - .pool -_081A872C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_081A8732: - cmp r6, 0x3 - bhi _081A8766 - adds r1, r6, 0 - adds r1, 0xD - adds r0, r7, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - adds r2, r6, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r5, r0, 24 - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r7, 0 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r5 - bcs _081A872C -_081A8762: - movs r0, 0x1 - mov r9, r0 -_081A8766: - mov r0, r9 - cmp r0, 0x1 - bne _081A8778 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - b _081A8786 - .pool -_081A8778: - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0x2 - bls _081A86D4 -_081A8786: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A86C0 - - thumb_func_start sub_81A8794 -sub_81A8794: @ 81A8794 - push {r4-r7,lr} - movs r5, 0 - ldr r7, =gSaveBlock1Ptr - ldr r6, =gSaveBlock2Ptr -_081A879C: - ldr r0, [r6] - lsls r4, r5, 1 - ldr r1, =0x00000caa - adds r0, r1 - adds r0, r4 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - movs r2, 0xEA - lsls r2, 1 - adds r1, r2 - ldr r0, [r7] - adds r0, r1 - movs r1, 0xC - bl GetMonData - ldr r1, [r6] - ldr r2, =0x00000e12 - adds r1, r2 - adds r1, r4 - strh r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _081A879C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8794 - - thumb_func_start sub_81A87E8 -sub_81A87E8: @ 81A87E8 - push {r4,lr} - movs r4, 0 -_081A87EC: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r3, r4, 1 - ldr r1, =0x00000caa - adds r0, r2, r1 - adds r0, r3 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gUnknown_02024488 - adds r0, r1 - ldr r1, =0x00000e12 - adds r3, r1 - adds r2, r3 - movs r1, 0xC - bl SetMonData - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A87EC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A87E8 - - thumb_func_start sub_81A8830 -sub_81A8830: @ 81A8830 - push {r4-r6,lr} - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x00000ca8 - adds r1, r0 - movs r4, 0 - strb r4, [r1] - ldr r1, [r3] - ldr r6, =0x00000cb2 - adds r0, r1, r6 - strh r4, [r0] - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r3, [r3] - ldr r0, =0x00000cdc - adds r2, r3, r0 - ldr r1, =gUnknown_08612690 - lsls r0, r5, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _081A887C - lsls r1, r5, 1 - ldr r2, =0x00000e04 - adds r0, r3, r2 - adds r0, r1 - strh r4, [r0] -_081A887C: - ldr r0, =gUnknown_02038BCA - strh r4, [r0] - ldr r1, =gBattleOutcome - movs r0, 0 - strb r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8830 - - thumb_func_start sub_81A88B0 -sub_81A88B0: @ 81A88B0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0x6 - bl GetMonData - cmp r0, 0 - bne _081A8904 - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x33 - beq _081A88D6 - cmp r0, 0x16 - bne _081A8904 -_081A88D6: - adds r0, r4, 0 - movs r1, 0x38 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _081A8904 - subs r0, 0x5 - cmp r5, r0 - bgt _081A8904 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081A8904 - movs r0, 0 - b _081A8906 - .pool -_081A8904: - movs r0, 0x1 -_081A8906: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A88B0 - - thumb_func_start sub_81A890C -sub_81A890C: @ 81A890C - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x0000017b - cmp r2, r0 - bne _081A8920 - movs r1, 0 - b _081A892A - .pool -_081A8920: - ldr r0, =0x00000149 - movs r1, 0x2 - cmp r2, r0 - bne _081A892A - movs r1, 0x1 -_081A892A: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A890C - - thumb_func_start sub_81A8934 -@ void sub_81A8934(u8) -sub_81A8934: @ 81A8934 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CE50 - ldr r0, [r4] - cmp r0, 0 - bne _081A894A - movs r0, 0x44 - bl AllocZeroed - str r0, [r4] -_081A894A: - ldr r0, [r4] - adds r0, 0x41 - strb r5, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8934 - - thumb_func_start sub_81A895C -sub_81A895C: @ 81A895C - push {r4,lr} - ldr r4, =gUnknown_0203CE50 - ldr r0, [r4] - cmp r0, 0 - beq _081A896E - bl Free - movs r0, 0 - str r0, [r4] -_081A896E: - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gMapObjects - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A895C - - thumb_func_start sub_81A89A0 -sub_81A89A0: @ 81A89A0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r1, r0 - mov r9, r1 - movs r3, 0 - mov r10, r3 - mov r8, r3 -_081A89C4: - mov r0, r8 - lsls r4, r0, 1 - adds r1, r4, r0 - lsls r1, 3 - add r1, r9 - ldrh r0, [r1, 0x4] - adds r0, 0x7 - ldrh r1, [r1, 0x6] - adds r1, 0x7 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =gUnknown_0203CE50 - ldr r0, [r0] - adds r0, 0x41 - ldrb r0, [r0] - movs r2, 0xA6 - lsls r2, 2 - cmp r0, 0 - bne _081A89F8 - subs r2, 0x48 -_081A89F8: - ldr r0, =0x0000024f - cmp r1, r0 - bls _081A8AD4 - subs r1, r2 - adds r0, r1, 0 - cmp r1, 0 - bge _081A8A08 - adds r0, r1, 0x7 -_081A8A08: - asrs r2, r0, 3 - lsls r0, r2, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _081A8AD4 - ldr r3, [sp] - cmp r0, r3 - bne _081A8AD4 - lsls r0, r2, 3 - subs r0, r1, r0 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bhi _081A8AD4 - movs r1, 0 - movs r2, 0 - cmp r5, 0x1 - beq _081A8A58 - cmp r5, 0x1 - bgt _081A8A44 - cmp r5, 0 - beq _081A8A4E - b _081A8AD4 - .pool -_081A8A44: - cmp r5, 0x2 - beq _081A8A64 - cmp r5, 0x3 - beq _081A8A70 - b _081A8AD4 -_081A8A4E: - ldr r7, =gUnknown_08612698 - movs r1, 0x1 - b _081A8A74 - .pool -_081A8A58: - ldr r7, =gUnknown_0861269C - movs r2, 0x1 - b _081A8A74 - .pool -_081A8A64: - ldr r7, =gUnknown_086126A0 - movs r1, 0xFF - b _081A8A74 - .pool -_081A8A70: - ldr r7, =gUnknown_086126A4 - movs r2, 0xFF -_081A8A74: - mov r3, r8 - adds r0, r4, r3 - lsls r0, 3 - mov r3, r9 - adds r4, r0, r3 - lsls r0, r1, 24 - asrs r0, 24 - ldrh r1, [r4, 0x4] - adds r0, r1 - strh r0, [r4, 0x4] - lsls r0, r2, 24 - asrs r0, 24 - ldrh r3, [r4, 0x6] - adds r0, r3 - strh r0, [r4, 0x6] - ldrb r0, [r4] - ldr r6, =gSaveBlock1Ptr - ldr r2, [r6] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _081A8ACC - mov r0, r8 - adds r1, r5, 0 - bl sub_81A8D60 - ldrb r4, [r4] - mov r10, r4 - mov r0, r10 - ldr r2, [r6] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - adds r3, r7, 0 - bl exec_movement - b _081A8AD4 - .pool -_081A8ACC: - mov r0, r8 - adds r1, r5, 0 - bl sub_81A8D94 -_081A8AD4: - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x3F - bhi _081A8AE4 - b _081A89C4 -_081A8AE4: - mov r0, r10 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A89A0 - - thumb_func_start sub_81A8AF8 -sub_81A8AF8: @ 81A8AF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r1, =gUnknown_0203CE50 - ldr r2, [r1] - cmp r2, 0 - bne _081A8B0C - b _081A8D4A -_081A8B0C: - adds r0, r2, 0 - adds r0, 0x41 - ldrb r0, [r0] - movs r3, 0xA6 - lsls r3, 2 - mov r10, r3 - cmp r0, 0 - bne _081A8B22 - movs r0, 0x94 - lsls r0, 2 - mov r10, r0 -_081A8B22: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r3, 0xC7 - lsls r3, 4 - adds r7, r0, r3 - movs r0, 0 - mov r9, r0 - adds r0, r2, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r9, r0 - bcc _081A8B3C - b _081A8D4A -_081A8B3C: - mov r8, r1 -_081A8B3E: - mov r1, r8 - ldr r0, [r1] - mov r2, r9 - lsls r4, r2, 2 - adds r0, r4 - ldrb r0, [r0, 0x1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - adds r1, r7 - ldrh r0, [r1, 0x4] - adds r0, 0x7 - ldrh r1, [r1, 0x6] - adds r1, 0x7 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r0, 16 - mov r3, r10 - subs r1, r0, r3 - adds r0, r1, 0 - cmp r1, 0 - bge _081A8B76 - adds r0, r1, 0x7 -_081A8B76: - asrs r0, 3 - lsls r0, 3 - subs r0, r1, r0 - lsls r0, 24 - lsrs r0, 24 - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldrb r1, [r1] - subs r0, r1 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - blt _081A8B96 - cmp r1, 0x3 - bne _081A8BAC -_081A8B96: - movs r0, 0x3 - negs r0, r0 - movs r6, 0 - cmp r1, r0 - bne _081A8BB4 - b _081A8BB2 - .pool -_081A8BAC: - movs r6, 0x2 - cmp r1, 0 - ble _081A8BB4 -_081A8BB2: - movs r6, 0x1 -_081A8BB4: - ldr r5, =gUnknown_0203CE50 - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - ldrb r0, [r0] - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x10 - bne _081A8BDC - b _081A8D32 -_081A8BDC: - ldr r0, =gMapObjects - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x18] - lsls r0, 28 - lsrs r0, 28 - adds r1, r0, 0 - cmp r6, 0 - bne _081A8C9C - cmp r0, 0x2 - beq _081A8C60 - cmp r0, 0x2 - bgt _081A8C0C - cmp r0, 0x1 - beq _081A8C30 - b _081A8D32 - .pool -_081A8C0C: - cmp r0, 0x3 - beq _081A8C48 - cmp r0, 0x4 - beq _081A8C16 - b _081A8D32 -_081A8C16: - ldr r3, =gUnknown_086126AE - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x7 - b _081A8C72 - .pool -_081A8C30: - ldr r3, =gUnknown_086126A8 - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0xA - b _081A8C72 - .pool -_081A8C48: - ldr r3, =gUnknown_086126AA - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x8 - b _081A8C72 - .pool -_081A8C60: - ldr r3, =gUnknown_086126AC - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x9 -_081A8C72: - strb r1, [r0, 0x9] - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - ldrb r0, [r0] - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl exec_movement - b _081A8D32 - .pool -_081A8C9C: - cmp r6, 0x1 - bne _081A8D32 - cmp r0, 0x2 - beq _081A8D00 - cmp r0, 0x2 - bgt _081A8CAE - cmp r0, 0x1 - beq _081A8CD0 - b _081A8D32 -_081A8CAE: - cmp r1, 0x3 - beq _081A8CE8 - cmp r1, 0x4 - bne _081A8D32 - ldr r3, =gUnknown_086126AA - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x8 - b _081A8D12 - .pool -_081A8CD0: - ldr r3, =gUnknown_086126AC - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x9 - b _081A8D12 - .pool -_081A8CE8: - ldr r3, =gUnknown_086126AE - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x7 - b _081A8D12 - .pool -_081A8D00: - ldr r3, =gUnknown_086126A8 - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0xA -_081A8D12: - strb r1, [r0, 0x9] - mov r2, r8 - ldr r0, [r2] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - ldrb r0, [r0] - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl exec_movement -_081A8D32: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r3, r8 - ldr r0, [r3] - adds r0, 0x40 - ldrb r0, [r0] - cmp r9, r0 - bcs _081A8D4A - b _081A8B3E -_081A8D4A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8AF8 - - thumb_func_start sub_81A8D60 -sub_81A8D60: @ 81A8D60 - push {r4,lr} - ldr r4, =gUnknown_0203CE50 - ldr r3, [r4] - adds r2, r3, 0 - adds r2, 0x40 - ldrb r2, [r2] - lsls r2, 2 - adds r3, r2 - strb r0, [r3, 0x1] - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x40 - ldrb r0, [r0] - lsls r0, 2 - adds r2, r0 - strb r1, [r2] - ldr r1, [r4] - adds r1, 0x40 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8D60 - - thumb_func_start sub_81A8D94 -sub_81A8D94: @ 81A8D94 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r5, r0, r1 - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 3 - adds r1, r5 - ldrh r0, [r1, 0x4] - adds r0, 0x7 - ldrh r1, [r1, 0x6] - adds r1, 0x7 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =gUnknown_0203CE50 - ldr r0, [r0] - adds r0, 0x41 - ldrb r0, [r0] - movs r1, 0xA6 - lsls r1, 2 - cmp r0, 0 - bne _081A8DDA - subs r1, 0x48 -_081A8DDA: - subs r1, r2, r1 - adds r0, r1, 0 - cmp r1, 0 - bge _081A8DE4 - adds r0, r1, 0x7 -_081A8DE4: - asrs r0, 3 - lsls r0, 3 - subs r0, r1, r0 - lsls r0, 24 - lsrs r0, 24 - subs r0, r6 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - blt _081A8DFC - cmp r1, 0x3 - bne _081A8E08 -_081A8DFC: - movs r2, 0 - b _081A8E1A - .pool -_081A8E08: - cmp r1, 0 - bgt _081A8E14 - movs r0, 0x3 - negs r0, r0 - cmp r1, r0 - bne _081A8E18 -_081A8E14: - movs r2, 0x1 - b _081A8E1A -_081A8E18: - movs r2, 0x2 -_081A8E1A: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r5 - ldrb r0, [r1, 0x9] - adds r3, r0, 0 - cmp r2, 0 - bne _081A8E4C - cmp r0, 0x8 - beq _081A8E72 - cmp r0, 0x8 - bgt _081A8E38 - cmp r0, 0x7 - beq _081A8E48 - b _081A8E76 -_081A8E38: - cmp r0, 0x9 - beq _081A8E44 - cmp r0, 0xA - bne _081A8E76 - movs r0, 0x7 - b _081A8E74 -_081A8E44: - movs r0, 0x8 - b _081A8E74 -_081A8E48: - movs r0, 0x9 - b _081A8E74 -_081A8E4C: - cmp r2, 0x1 - bne _081A8E76 - cmp r0, 0x8 - beq _081A8E6A - cmp r0, 0x8 - bgt _081A8E5E - cmp r0, 0x7 - beq _081A8E72 - b _081A8E76 -_081A8E5E: - cmp r3, 0x9 - beq _081A8E6E - cmp r3, 0xA - bne _081A8E76 - movs r0, 0x8 - b _081A8E74 -_081A8E6A: - movs r0, 0x9 - b _081A8E74 -_081A8E6E: - movs r0, 0x7 - b _081A8E74 -_081A8E72: - movs r0, 0xA -_081A8E74: - strb r0, [r1, 0x9] -_081A8E76: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81A8D94 - - thumb_func_start sub_81A8E7C -sub_81A8E7C: @ 81A8E7C - push {lr} - ldr r1, =gUnknown_08613EE0 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8E7C - - thumb_func_start sub_81A8E9C -sub_81A8E9C: @ 81A8E9C - push {r4-r6,lr} - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r4, =0x00000ca9 - adds r0, r1, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x00000ca8 - adds r1, r0 - movs r2, 0 - strb r2, [r1] - ldr r1, [r3] - ldr r6, =0x00000cb2 - adds r0, r1, r6 - strh r2, [r0] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - cmp r5, 0 - beq _081A8EF0 - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 6 - b _081A8EFC - .pool -_081A8EF0: - ldr r0, [r3] - ldr r6, =0x00000cdc - adds r0, r6 - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 5 -_081A8EFC: - ands r2, r0 - cmp r2, 0 - bne _081A8F14 - ldr r0, [r3] - lsls r1, r5, 1 - ldr r3, =0x00000e1a - adds r0, r3 - adds r0, r1 - strh r2, [r0] - adds r0, r5, 0 - bl sub_81AAA7C -_081A8F14: - bl sub_81C4EEC - ldr r0, =gUnknown_02038BCA - movs r1, 0 - strh r1, [r0] - ldr r0, =gBattleOutcome - strb r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8E9C - - thumb_func_start sub_81A8F38 -sub_81A8F38: @ 81A8F38 - push {r4,lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - adds r3, r1, 0 - cmp r0, 0x6 - bls _081A8F54 - b _081A903A -_081A8F54: - lsls r0, 2 - ldr r1, =_081A8F70 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A8F70: - .4byte _081A8F8C - .4byte _081A8F9C - .4byte _081A8FB4 - .4byte _081A8FE4 - .4byte _081A8FF8 - .4byte _081A9010 - .4byte _081A9028 -_081A8F8C: - ldr r0, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000e18 - b _081A8FFE - .pool -_081A8F9C: - ldr r2, =gScriptResult - ldr r0, [r3] - lsls r1, r4, 1 - ldr r3, =0x00000e1a - adds r0, r3 - adds r0, r1 - ldrh r0, [r0] - b _081A9038 - .pool -_081A8FB4: - cmp r4, 0 - beq _081A8FCC - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - b _081A9030 - .pool -_081A8FCC: - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r3, =0x00000cdc - adds r0, r3 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - b _081A9036 - .pool -_081A8FE4: - ldr r0, =gScriptResult - ldr r1, [r3] - ldr r2, =0x00000e1a - adds r1, r2 - b _081A9000 - .pool -_081A8FF8: - ldr r0, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000e1c -_081A8FFE: - adds r1, r3 -_081A9000: - ldrh r1, [r1] - strh r1, [r0] - b _081A903A - .pool -_081A9010: - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - b _081A9036 - .pool -_081A9028: - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r3, =0x00000cdc - adds r0, r3 -_081A9030: - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 -_081A9036: - ands r0, r1 -_081A9038: - strh r0, [r2] -_081A903A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8F38 - - thumb_func_start sub_81A9048 -sub_81A9048: @ 81A9048 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r1, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _081A9098 - cmp r0, 0x1 - bgt _081A9078 - cmp r0, 0 - beq _081A9082 - b _081A9126 - .pool -_081A9078: - cmp r0, 0x2 - beq _081A90B0 - cmp r0, 0x7 - beq _081A911C - b _081A9126 -_081A9082: - ldr r0, =gSpecialVar_0x8006 - ldrh r1, [r0] - ldr r3, =0x00000e18 - adds r0, r2, r3 - strh r1, [r0] - b _081A9126 - .pool -_081A9098: - lsls r1, 1 - ldr r3, =0x00000e1a - adds r0, r2, r3 - adds r0, r1 - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - strh r1, [r0] - b _081A9126 - .pool -_081A90B0: - cmp r1, 0 - beq _081A90E4 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A90D0 - ldr r1, =0x00000cdc - adds r0, r2, r1 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 6 - b _081A90F6 - .pool -_081A90D0: - ldr r3, =0x00000cdc - adds r0, r2, r3 - ldr r1, [r0] - ldr r2, =0xffffdfff - b _081A910C - .pool -_081A90E4: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A9104 - ldr r1, =0x00000cdc - adds r0, r2, r1 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 5 -_081A90F6: - orrs r1, r2 - str r1, [r0] - b _081A9126 - .pool -_081A9104: - ldr r3, =0x00000cdc - adds r0, r2, r3 - ldr r1, [r0] - ldr r2, =0xffffefff -_081A910C: - ands r1, r2 - str r1, [r0] - b _081A9126 - .pool -_081A911C: - ldr r0, =gSpecialVar_0x8006 - ldrh r1, [r0] - ldr r3, =0x00000e2a - adds r0, r2, r3 - strb r1, [r0] -_081A9126: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9048 - - thumb_func_start sub_81A9134 -sub_81A9134: @ 81A9134 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl save_serialize_map - movs r0, 0x1 - bl TrySavingData - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9134 - - thumb_func_start sub_81A917C -sub_81A917C: @ 81A917C - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0x29 - bls _081A91CC - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_08613F34 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =0x00000e18 - adds r4, r1 - b _081A91EA - .pool -_081A91CC: - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_08613F28 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r2, =0x00000e18 - adds r4, r2 -_081A91EA: - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A917C - - thumb_func_start sub_81A91FC -sub_81A91FC: @ 81A91FC - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000e18 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081A9244 - ldr r0, [r4] - ldr r1, =0x00000e18 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000e18 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081A924A - .pool -_081A9244: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081A924A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A91FC - - thumb_func_start sub_81A9254 -sub_81A9254: @ 81A9254 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =gSaveBlock2Ptr -_081A925A: - bl Random - ldr r1, [r5] - lsls r2, r4, 1 - ldr r3, =0x00000e22 - adds r1, r3 - adds r1, r2 - strh r0, [r1] - adds r4, 0x1 - cmp r4, 0x3 - ble _081A925A - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e2a - adds r0, r1 - movs r1, 0 - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9254 - - thumb_func_start CalculateBattlePyramidItemBallItemId -CalculateBattlePyramidItemBallItemId: @ 81A9290 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - mov r10, r0 - adds r2, 0x9 - adds r0, r1, r2 - ldrh r0, [r0] - str r0, [sp] - mov r2, r10 - lsls r0, r2, 1 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r0, 0x13 - bls _081A92DE - movs r0, 0x13 - mov r8, r0 -_081A92DE: - bl sub_81AA9E4 - lsls r0, 24 - ldr r1, =gScriptLastTalked - ldrh r4, [r1] - ldr r1, =gUnknown_08613650 - lsrs r0, 20 - adds r0, r1 - ldrb r0, [r0, 0x1] - subs r4, r0 - subs r7, r4, 0x1 - ldr r1, [r5] - lsrs r0, r7, 31 - adds r0, r7, r0 - asrs r0, 1 - lsls r0, 1 - ldr r2, =0x00000e22 - adds r1, r2 - adds r1, r0 - ldrh r6, [r1] - adds r0, r6, 0 - bl SeedRng2 - movs r5, 0 - mov r0, r8 - lsls r0, 2 - mov r9, r0 - cmp r5, r4 - bge _081A9332 -_081A9318: - bl Random2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r6, r0, 16 - adds r5, 0x1 - adds r0, r7, 0x1 - cmp r5, r0 - blt _081A9318 -_081A9332: - ldr r0, =gUnknown_08613B3A - ldr r1, [sp] - adds r0, r1, r0 - ldrb r5, [r0] - ldr r1, =gUnknown_08613ABC - ldr r3, =gSpecialVar_0x8000 - ldr r4, =gSpecialVar_0x8001 - cmp r5, 0x3E - bhi _081A935E - lsls r2, r5, 1 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r6, r0 - blt _081A935E - adds r0, r2, r1 -_081A9350: - adds r0, 0x2 - adds r5, 0x1 - cmp r5, 0x3E - bhi _081A935E - ldrb r2, [r0] - cmp r6, r2 - bge _081A9350 -_081A935E: - mov r0, r10 - cmp r0, 0 - beq _081A9394 - ldr r2, =gUnknown_0861392C - b _081A9396 - .pool -_081A9394: - ldr r2, =gUnknown_0861379C -_081A9396: - lsls r0, r5, 1 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - mov r1, r9 - add r1, r8 - lsls r1, 2 - adds r0, r1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r3] - movs r0, 0x1 - strh r0, [r4] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end CalculateBattlePyramidItemBallItemId - - thumb_func_start sub_81A93C8 -sub_81A93C8: @ 81A93C8 - push {r4,r5,lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r3, r0, r1 - movs r2, 0 - ldr r4, =gScriptLastTalked - b _081A93F4 - .pool -_081A93E4: - adds r2, 0x1 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 3 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0 - beq _081A940A -_081A93F4: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r3 - ldrb r0, [r1] - ldrh r5, [r4] - cmp r0, r5 - bne _081A93E4 - ldr r0, =0x00007fff - strh r0, [r1, 0x4] - strh r0, [r1, 0x6] -_081A940A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A93C8 - - thumb_func_start sub_81A9414 -sub_81A9414: @ 81A9414 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - bx lr - .pool - thumb_func_end sub_81A9414 - - thumb_func_start sub_81A9424 -sub_81A9424: @ 81A9424 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - movs r0, 0 - mov r9, r0 - movs r7, 0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r1, r0 - mov r8, r1 - ldr r2, =gMapObjects - ldr r0, =gUnknown_03005DF0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x8] - bl sub_81A9AA8 - lsls r0, 16 - lsrs r5, r0, 16 - movs r6, 0 - ldr r2, =gUnknown_08613C1C - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r5 - adds r0, r1 - ldrb r1, [r2] - ldrb r0, [r0] - cmp r1, r0 - bne _081A9488 - ldrb r2, [r2, 0x1] - mov r9, r2 - b _081A94AE - .pool -_081A9488: - adds r6, 0x1 - cmp r6, 0x31 - bhi _081A94AE - ldr r4, =gUnknown_08613C1C - lsls r3, r6, 1 - adds r2, r3, r4 - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r5 - adds r0, r1 - ldrb r1, [r2] - ldrb r0, [r0] - cmp r1, r0 - bne _081A9488 - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - mov r9, r0 -_081A94AE: - ldr r3, =gUnknown_08613ED8 - ldr r2, =gMapObjects - ldr r0, =gUnknown_03005DF0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x8] - subs r0, 0x1 - adds r0, r3 - ldrb r0, [r0] - str r0, [sp] - movs r6, 0 - mov r3, r9 - lsls r3, 2 - mov r9, r3 -_081A94D0: - ldr r0, [sp] - cmp r0, 0x8 - bls _081A94D8 - b _081A95E8 -_081A94D8: - lsls r0, 2 - ldr r1, =_081A94FC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A94FC: - .4byte _081A9520 - .4byte _081A9530 - .4byte _081A9572 - .4byte _081A95B4 - .4byte _081A95BA - .4byte _081A95C0 - .4byte _081A95C6 - .4byte _081A95D2 - .4byte _081A95DE -_081A9520: - mov r0, sp - movs r1, 0x8 - movs r2, 0 - bl sub_81A9998 - lsls r0, 24 - lsrs r7, r0, 24 - b _081A95EE -_081A9530: - movs r6, 0 - ldr r2, =0x7fff0000 - mov r4, r8 - adds r4, 0x4 - mov r5, r8 - b _081A9560 - .pool -_081A9540: - ldrb r0, [r5, 0x1] - cmp r0, 0x3B - bne _081A955A - movs r1, 0 - ldrsh r0, [r4, r1] - asrs r1, r2, 16 - cmp r0, r1 - beq _081A955A - movs r3, 0x2 - ldrsh r0, [r4, r3] - cmp r0, r1 - beq _081A955A - adds r7, 0x1 -_081A955A: - adds r4, 0x18 - adds r5, 0x18 - adds r6, 0x1 -_081A9560: - str r2, [sp, 0x4] - bl sub_81AAA40 - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x4] - cmp r6, r0 - blt _081A9540 - b _081A95EE -_081A9572: - bl sub_81AA9E4 - lsls r0, 24 - ldr r1, =gUnknown_08613650 - lsrs r0, 20 - adds r0, r1 - ldrb r7, [r0, 0x1] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e2a - adds r0, r1 - ldrb r2, [r0] - ldr r1, =gBitTable - movs r6, 0x7 -_081A958E: - ldr r0, [r1] - ands r0, r2 - cmp r0, 0 - beq _081A9598 - subs r7, 0x1 -_081A9598: - adds r1, 0x4 - subs r6, 0x1 - cmp r6, 0 - bge _081A958E - b _081A95EE - .pool -_081A95B4: - mov r0, sp - movs r1, 0x8 - b _081A95D6 -_081A95BA: - mov r0, sp - movs r1, 0x8 - b _081A95CA -_081A95C0: - mov r0, sp - movs r1, 0x10 - b _081A95D6 -_081A95C6: - mov r0, sp - movs r1, 0x10 -_081A95CA: - movs r2, 0x1 - bl sub_81A9998 - b _081A95E8 -_081A95D2: - mov r0, sp - movs r1, 0x18 -_081A95D6: - movs r2, 0x2 - bl sub_81A9998 - b _081A95E8 -_081A95DE: - mov r0, sp - movs r1, 0x18 - movs r2, 0x1 - bl sub_81A9998 -_081A95E8: - cmp r6, 0 - bne _081A95EE - b _081A94D0 -_081A95EE: - ldr r1, =gUnknown_08613EC0 - add r1, r9 - ldr r0, [sp] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r0, r7, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9424 - - thumb_func_start sub_81A9618 -sub_81A9618: @ 81A9618 - push {r4,r5,lr} - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r2, r0, 29 - ldr r4, =0x00000e1a - adds r1, r4 - adds r1, r2 - ldrh r3, [r1] - ldr r0, =0x000003e6 - cmp r3, r0 - bhi _081A963A - adds r0, r3, 0x1 - strh r0, [r1] -_081A963A: - ldr r0, [r5] - adds r1, r0, r4 - adds r1, r2 - ldr r3, =0x00000e1e - adds r0, r3 - adds r0, r2 - ldrh r1, [r1] - ldrh r2, [r0] - cmp r1, r2 - bls _081A9650 - strh r1, [r0] -_081A9650: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9618 - - thumb_func_start sub_81A966C -sub_81A966C: @ 81A966C - push {r4,lr} - ldr r4, =gScriptResult - bl InBattlePyramid - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A966C - - thumb_func_start sub_81A9684 -sub_81A9684: @ 81A9684 - push {r4,lr} - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A9698 - cmp r0, 0x1 - beq _081A96B4 - b _081A9754 - .pool -_081A9698: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000e68 - adds r0, r2 - strb r1, [r0] - b _081A9754 - .pool -_081A96B4: - ldr r4, =gScriptResult - ldrh r0, [r4] - cmp r0, 0x1 - beq _081A9710 - cmp r0, 0x1 - bgt _081A9754 - cmp r0, 0 - bne _081A9754 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081A9754 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e68 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x77 - bls _081A96F4 - movs r0, 0x78 - strb r0, [r1] - b _081A96FC - .pool -_081A96F4: - ldr r0, =gSpecialVar_0x8007 - ldrh r0, [r0] - bl PlaySE -_081A96FC: - ldr r1, =gScriptResult - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081A9754 - .pool -_081A9710: - ldr r1, =gSpecialVar_0x8005 - ldrh r0, [r1] - cmp r0, 0 - beq _081A9750 - subs r0, 0x1 - strh r0, [r1] - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r2, =0x00000e68 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r3] - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x78 - bls _081A973E - movs r0, 0x78 - strb r0, [r1] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081A973E: - bl door_upload_tiles - b _081A9754 - .pool -_081A9750: - movs r0, 0x2 - strh r0, [r4] -_081A9754: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A9684 - - thumb_func_start sub_81A975C -sub_81A975C: @ 81A975C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r1, 0 - mov r0, sp - strh r1, [r0] - movs r5, 0 - movs r0, 0x64 - mov r9, r0 - ldr r1, =gPlayerParty - mov r8, r1 -_081A9776: - movs r4, 0 - adds r7, r5, 0x1 - mov r6, r9 - muls r6, r5 -_081A977E: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000caa - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _081A97A2 - subs r0, 0x1 - cmp r0, r5 - bne _081A97A2 - mov r1, r8 - adds r0, r6, r1 - movs r1, 0xC - mov r2, sp - bl SetMonData -_081A97A2: - adds r4, 0x1 - cmp r4, 0x3 - ble _081A977E - adds r5, r7, 0 - cmp r5, 0x5 - ble _081A9776 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A975C - - thumb_func_start sub_81A97C8 -sub_81A97C8: @ 81A97C8 - push {lr} - ldr r0, =sub_81A97DC - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A97C8 - - thumb_func_start sub_81A97DC -sub_81A97DC: @ 81A97DC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081A980C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 5 - ldr r1, =gUnknown_08D856C8 - adds r0, r1 - ldr r1, =gPlttBufferUnfaded + 0xC0 - movs r2, 0x10 - bl CpuSet - adds r0, r4, 0 - bl DestroyTask -_081A980C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A97DC - - thumb_func_start sub_81A9828 -sub_81A9828: @ 81A9828 - push {lr} - bl sub_809FDD4 - pop {r0} - bx r0 - thumb_func_end sub_81A9828 - - thumb_func_start sub_81A9834 -sub_81A9834: @ 81A9834 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - movs r0, 0 - str r0, [sp] -_081A9844: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, [sp] - lsls r1, r2, 1 - ldr r5, =0x00000caa - adds r0, r5 - adds r0, r1 - ldrh r0, [r0] - subs r5, r0, 0x1 - movs r0, 0 - str r0, [sp, 0x4] - movs r2, 0x64 - adds r1, r5, 0 - muls r1, r2 - str r1, [sp, 0x8] - movs r0, 0x8E - lsls r0, 2 - adds r6, r1, r0 - movs r1, 0 - str r1, [sp, 0x10] -_081A986C: - ldr r2, =gSaveBlock1Ptr - ldr r0, [r2] - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - ldr r3, =gPlayerParty - ldr r1, [sp, 0x10] - adds r0, r1, r3 - movs r1, 0xB - movs r2, 0 - str r3, [sp, 0x14] - bl GetMonData - ldr r3, [sp, 0x14] - cmp r4, r0 - bne _081A993C - movs r6, 0 - adds r2, r5, 0x1 - str r2, [sp, 0xC] - movs r1, 0x64 - adds r0, r5, 0 - muls r0, r1 - movs r5, 0x8E - lsls r5, 2 - adds r5, r0 - mov r9, r5 - ldr r7, [sp, 0x4] - muls r7, r1 - mov r10, r3 -_081A98AC: - movs r5, 0 - adds r0, r6, 0x1 - mov r8, r0 - b _081A98C6 - .pool -_081A98C4: - adds r5, 0x1 -_081A98C6: - cmp r5, 0x3 - bgt _081A98EE - ldr r1, =gSaveBlock1Ptr - ldr r0, [r1] - add r0, r9 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - adds r1, r6, 0 - adds r1, 0xD - mov r2, r10 - adds r0, r7, r2 - movs r2, 0 - bl GetMonData - cmp r4, r0 - bne _081A98C4 -_081A98EE: - cmp r5, 0x4 - bne _081A9900 - lsls r2, r6, 24 - lsrs r2, 24 - mov r5, r10 - adds r0, r7, r5 - movs r1, 0xA6 - bl sub_80691F4 -_081A9900: - mov r6, r8 - cmp r6, 0x3 - ble _081A98AC - ldr r1, =gSaveBlock1Ptr - ldr r0, [r1] - ldr r2, [sp, 0x8] - adds r0, r2 - movs r5, 0x8E - lsls r5, 2 - adds r0, r5 - ldr r1, =gPlayerParty - ldr r2, [sp, 0x10] - adds r1, r2, r1 - movs r2, 0x64 - bl memcpy - ldr r0, =gUnknown_0203CEF8 - ldr r5, [sp, 0x4] - adds r0, r5, r0 - mov r1, sp - ldrb r1, [r1, 0xC] - strb r1, [r0] - b _081A994C - .pool -_081A993C: - ldr r2, [sp, 0x10] - adds r2, 0x64 - str r2, [sp, 0x10] - ldr r0, [sp, 0x4] - adds r0, 0x1 - str r0, [sp, 0x4] - cmp r0, 0x2 - ble _081A986C -_081A994C: - ldr r1, [sp] - adds r1, 0x1 - str r1, [sp] - cmp r1, 0x2 - bgt _081A9958 - b _081A9844 -_081A9958: - movs r2, 0 - str r2, [sp] - ldr r4, =gSaveBlock2Ptr - ldr r3, =0x00000caa - ldr r2, =gUnknown_0203CEF8 -_081A9962: - ldr r1, [r4] - ldr r5, [sp] - lsls r0, r5, 1 - adds r1, r3 - adds r1, r0 - adds r0, r5, r2 - ldrb r0, [r0] - strh r0, [r1] - adds r5, 0x1 - str r5, [sp] - cmp r5, 0x2 - ble _081A9962 - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9834 - - thumb_func_start sub_81A9998 -sub_81A9998: @ 81A9998 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - movs r4, 0 - ldr r0, =gUnknown_03005DC0 - ldr r5, [r0, 0x8] - ldr r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, 0xE - adds r5, r0 - movs r3, 0 - ldr r0, =0x000003ff - mov r8, r0 - ldr r1, =0x0000028e - mov r12, r1 - ldr r0, =gMapObjects - mov r9, r0 -_081A99CC: - movs r2, 0 -_081A99CE: - lsls r0, r2, 1 - adds r0, r5 - ldrh r1, [r0] - mov r0, r8 - ands r0, r1 - cmp r0, r12 - bne _081A9A8A - adds r2, 0x7 - ldr r0, =gUnknown_03005DF0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r9 - movs r5, 0xC - ldrsh r1, [r0, r5] - subs r2, r1 - adds r1, r3, 0x7 - movs r3, 0xE - ldrsh r0, [r0, r3] - subs r3, r1, r0 - cmp r2, r6 - bge _081A9A0E - negs r0, r6 - cmp r2, r0 - ble _081A9A0E - cmp r3, r6 - bge _081A9A0E - cmp r3, r0 - ble _081A9A0E - cmp r7, 0 - bne _081A9A84 -_081A9A0E: - cmp r2, 0 - ble _081A9A34 - cmp r3, 0 - ble _081A9A34 - movs r4, 0x3 - cmp r2, r3 - blt _081A9A7C - movs r4, 0x2 - b _081A9A7C - .pool -_081A9A34: - cmp r2, 0 - bge _081A9A46 - cmp r3, 0 - bge _081A9A46 - movs r4, 0x1 - cmp r2, r3 - ble _081A9A7C - movs r4, 0 - b _081A9A7C -_081A9A46: - cmp r2, 0 - bne _081A9A54 - movs r4, 0 - cmp r3, 0 - ble _081A9A7C - movs r4, 0x3 - b _081A9A7C -_081A9A54: - cmp r3, 0 - bne _081A9A62 - movs r4, 0x1 - cmp r2, 0 - ble _081A9A7C - movs r4, 0x2 - b _081A9A7C -_081A9A62: - cmp r2, 0 - bge _081A9A72 - adds r0, r2, r3 - movs r4, 0x1 - cmp r0, 0 - ble _081A9A7C - movs r4, 0x3 - b _081A9A7C -_081A9A72: - adds r0, r2, r3 - mvns r0, r0 - asrs r4, r0, 31 - movs r0, 0x2 - ands r4, r0 -_081A9A7C: - movs r0, 0 - mov r5, r10 - str r0, [r5] - b _081A9A98 -_081A9A84: - mov r0, r10 - str r7, [r0] - b _081A9A98 -_081A9A8A: - adds r2, 0x1 - cmp r2, 0x1F - ble _081A99CE - adds r5, 0x5E - adds r3, 0x1 - cmp r3, 0x1F - ble _081A99CC -_081A9A98: - adds r0, r4, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A9998 - - thumb_func_start sub_81A9AA8 -sub_81A9AA8: @ 81A9AA8 - lsls r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - adds r1, r0 - ldr r0, =0x00000cb2 - adds r1, r0 - ldrh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A9AA8 - - thumb_func_start GetBattlePyramidTrainerFlag -GetBattlePyramidTrainerFlag: @ 81A9AC4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - ldr r1, =0x00000e2a - adds r2, r1 - ldr r4, =gBitTable - ldr r3, =gMapObjects - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r1, 0x8] - subs r0, 0x1 - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ldrb r1, [r2] - ands r0, r1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetBattlePyramidTrainerFlag - - thumb_func_start sub_81A9B04 -sub_81A9B04: @ 81A9B04 - push {lr} - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - bl sub_81A9B44 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _081A9B2E - movs r0, 0x1 - bl sub_80B47E0 - ldr r1, =gUnknown_03005DF0 - strb r0, [r1] - ldr r0, =gUnknown_02038BCC - ldrh r0, [r0] - bl sub_81A9B44 -_081A9B2E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9B04 - - thumb_func_start sub_81A9B44 -sub_81A9B44: @ 81A9B44 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r5, r0, 16 - movs r3, 0 - ldr r0, =gMapObjects - mov r12, r0 - ldr r6, =gUnknown_03005DF0 - ldr r1, =gSaveBlock1Ptr - mov r10, r1 - ldr r7, =gSaveBlock2Ptr - mov r9, r7 - ldr r0, =0x00000cb4 - mov r8, r0 - ldr r4, =gBitTable -_081A9B68: - mov r1, r9 - ldr r2, [r1] - lsls r0, r3, 1 - mov r7, r8 - adds r1, r2, r7 - adds r1, r0 - ldrh r0, [r1] - cmp r0, r5 - bne _081A9B86 - ldr r1, =0x00000e2a - adds r0, r2, r1 - ldr r1, [r4] - ldrb r2, [r0] - orrs r1, r2 - strb r1, [r0] -_081A9B86: - adds r4, 0x4 - adds r3, 0x1 - cmp r3, 0x7 - ble _081A9B68 - ldrb r1, [r6] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r12 - movs r3, 0x2 - strb r3, [r0, 0x6] - mov r7, r10 - ldr r2, [r7] - ldr r0, =gScriptLastTalked - ldrh r1, [r0] - subs r1, 0x1 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r2, r0 - ldr r1, =0x00000c79 - adds r2, r1 - strb r3, [r2] - ldrb r1, [r6] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x10] - strh r1, [r0, 0xC] - ldrb r1, [r6] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x12] - strh r1, [r0, 0xE] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9B44 - - thumb_func_start sub_81A9C04 -sub_81A9C04: @ 81A9C04 - push {r4-r6,lr} - sub sp, 0x14 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - lsls r0, r5, 1 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x13 - bls _081A9C3A - movs r0, 0x13 -_081A9C3A: - cmp r5, 0 - beq _081A9C54 - ldr r1, =gBattlePyramidOpenLevelWildMonPointers - b _081A9C56 - .pool -_081A9C54: - ldr r1, =gBattlePyramidLevel50WildMonPointers -_081A9C56: - lsls r0, 2 - adds r0, r1 - ldr r6, [r0] - ldr r4, =gEnemyParty - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - subs r0, 0x1 - str r0, [sp, 0x10] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r2, r6, r2 - adds r0, r4, 0 - movs r1, 0xB - bl SetMonData - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r0] - mov r0, sp - bl GetSpeciesName - adds r0, r4, 0 - movs r1, 0x2 - mov r2, sp - bl SetMonData - cmp r5, 0 - beq _081A9CD4 - bl sub_8165C40 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x2] - subs r5, r0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xB - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x5 - adds r5, r0 - b _081A9CF6 - .pool -_081A9CD4: - bl Random - ldr r2, [sp, 0x10] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r6 - ldrb r4, [r1, 0x2] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xB - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x5 - adds r5, r4, r0 -_081A9CF6: - ldr r4, =gEnemyParty - ldr r2, =gBaseStats - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - adds r2, r1, 0 - muls r2, r0 - lsls r0, r5, 2 - ldr r1, =gExperienceTables - adds r0, r1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x19 - bl SetMonData - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0, 0x3] - cmp r1, 0 - blt _081A9D4C - cmp r1, 0x1 - bgt _081A9D4C - adds r2, r0, 0x3 - b _081A9D7C - .pool -_081A9D4C: - ldr r2, =gBaseStats - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x17] - cmp r0, 0 - beq _081A9D90 - ldr r4, =gEnemyParty - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - movs r1, 0x1 - ands r1, r0 - str r1, [sp, 0xC] - add r2, sp, 0xC -_081A9D7C: - adds r0, r4, 0 - movs r1, 0x2E - bl SetMonData - b _081A9D9C - .pool -_081A9D90: - str r0, [sp, 0xC] - ldr r0, =gEnemyParty - add r2, sp, 0xC - movs r1, 0x2E - bl SetMonData -_081A9D9C: - movs r0, 0 - str r0, [sp, 0xC] - movs r2, 0 - lsls r4, r5, 1 -_081A9DA4: - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - lsls r1, r2, 1 - adds r0, 0x4 - adds r0, r1 - ldrh r1, [r0] - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gEnemyParty - bl sub_80691F4 - ldr r0, [sp, 0xC] - adds r0, 0x1 - str r0, [sp, 0xC] - adds r2, r0, 0 - cmp r2, 0x3 - ble _081A9DA4 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e1a - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0x8B - bls _081A9E0C - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x11 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, 0xF - str r0, [sp, 0x10] - movs r0, 0 - str r0, [sp, 0xC] -_081A9DF6: - adds r1, r0, 0 - adds r1, 0x27 - ldr r0, =gEnemyParty - add r2, sp, 0x10 - bl SetMonData - ldr r0, [sp, 0xC] - adds r0, 0x1 - str r0, [sp, 0xC] - cmp r0, 0x5 - ble _081A9DF6 -_081A9E0C: - ldr r0, =gEnemyParty - bl pokemon_calc_effective_stats - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9C04 - - thumb_func_start sub_81A9E28 -sub_81A9E28: @ 81A9E28 - push {lr} - bl sub_81AA9E4 - lsls r0, 24 - ldr r1, =gUnknown_08613650 - lsrs r0, 20 - adds r0, r1 - ldrb r0, [r0, 0x4] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A9E28 - - thumb_func_start InBattlePyramid -InBattlePyramid: @ 81A9E40 - push {lr} - ldr r0, =gMapHeader - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _081A9E58 - movs r0, 0x1 - b _081A9E66 - .pool -_081A9E58: - movs r0, 0xBD - lsls r0, 1 - cmp r1, r0 - beq _081A9E64 - movs r0, 0 - b _081A9E66 -_081A9E64: - movs r0, 0x2 -_081A9E66: - pop {r1} - bx r1 - thumb_func_end InBattlePyramid - - thumb_func_start sub_81A9E6C -sub_81A9E6C: @ 81A9E6C - push {lr} - movs r2, 0 - ldr r0, =gMapHeader - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - beq _081A9E80 - adds r0, 0x11 - cmp r1, r0 - bne _081A9E82 -_081A9E80: - movs r2, 0x1 -_081A9E82: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A9E6C - - thumb_func_start sub_81A9E90 -sub_81A9E90: @ 81A9E90 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _081A9EB8 - bl sub_81A9834 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca8 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r0, =0x0000400e - movs r1, 0 - bl VarSet - bl copy_player_party_from_sav1 -_081A9EB8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9E90 - - thumb_func_start sub_81A9EC8 -sub_81A9EC8: @ 81A9EC8 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _081A9ED8 - bl DoSoftReset -_081A9ED8: - pop {r0} - bx r0 - thumb_func_end sub_81A9EC8 - - thumb_func_start sub_81A9EDC -sub_81A9EDC: @ 81A9EDC - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gUnknown_0203BC88 - movs r1, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9EDC - - thumb_func_start sub_81A9EFC -sub_81A9EFC: @ 81A9EFC - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gUnknown_0203BC88 - movs r1, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0x18 - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9EFC - - thumb_func_start sub_81A9F1C -sub_81A9F1C: @ 81A9F1C - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gUnknown_0203BC88 - movs r1, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0x24 - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9F1C - - thumb_func_start sub_81A9F3C -sub_81A9F3C: @ 81A9F3C - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - movs r4, 0 - ldr r3, =gTrainerClassNameIndices - ldr r1, =gUnknown_0203BC88 - ldr r2, [r1] - movs r1, 0x34 - muls r0, r1 - adds r0, r2 - ldrb r0, [r0] - adds r0, r3 - ldrb r2, [r0] - ldr r1, =gUnknown_08613B44 -_081A9F58: - ldrb r0, [r1] - cmp r0, r2 - bne _081A9F70 - ldrb r0, [r1, 0x1] - b _081A9F7A - .pool -_081A9F70: - adds r1, 0x4 - adds r4, 0x1 - cmp r4, 0x35 - bls _081A9F58 - movs r0, 0 -_081A9F7A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81A9F3C - - thumb_func_start sub_81A9F80 -sub_81A9F80: @ 81A9F80 - push {lr} - ldr r0, =gUnknown_08252C88 - bl script_env_1_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9F80 - - thumb_func_start sub_81A9F90 -sub_81A9F90: @ 81A9F90 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r1, =0x00000ca9 - adds r0, r4, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 29 - ldr r2, =0x00000e1a - adds r0, r4, r2 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x00000cb2 - adds r4, r1 - ldrh r1, [r4] - cmp r1, 0x7 - bne _081AA020 - adds r0, 0x1 - lsls r7, r0, 24 - lsls r1, 24 - mov r8, r1 -_081A9FCC: - lsrs r0, r7, 24 - mov r2, r8 - lsrs r1, r2, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - cmp r2, r5 - bge _081AA004 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r4, =0x00000cb4 - adds r0, r4 - ldrh r0, [r0] - cmp r0, r3 - beq _081AA004 - adds r6, r1, 0 -_081A9FF0: - adds r2, 0x1 - cmp r2, r5 - bge _081AA004 - ldr r0, [r6] - lsls r1, r2, 1 - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r3 - bne _081A9FF0 -_081AA004: - cmp r2, r5 - bne _081A9FCC - b _081AA062 - .pool -_081AA020: - lsls r1, 24 - mov r8, r1 - lsls r7, r0, 24 -_081AA026: - lsrs r0, r7, 24 - mov r2, r8 - lsrs r1, r2, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - cmp r2, r5 - bge _081AA05E - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r4, =0x00000cb4 - adds r0, r4 - ldrh r0, [r0] - cmp r0, r3 - beq _081AA05E - adds r6, r1, 0 -_081AA04A: - adds r2, 0x1 - cmp r2, r5 - bge _081AA05E - ldr r0, [r6] - lsls r1, r2, 1 - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r3 - bne _081AA04A -_081AA05E: - cmp r2, r5 - bne _081AA026 -_081AA062: - adds r0, r3, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A9F90 - - thumb_func_start sub_81AA078 -sub_81AA078: @ 81AA078 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - str r0, [sp, 0x4] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x8] - movs r0, 0x10 - bl AllocZeroed - str r0, [sp, 0xC] - bl sub_81AA96C - mov r4, sp - adds r4, 0x1 - mov r0, sp - adds r1, r4, 0 - bl sub_81AA33C - movs r7, 0 -_081AA0A6: - ldr r1, [sp, 0xC] - adds r0, r1, r7 - ldrb r0, [r0] - ldr r2, =0x00000169 - adds r0, r2 - lsls r0, 2 - ldr r1, =gUnknown_08481DD4 - adds r0, r1 - ldr r6, [r0] - ldr r2, [r6, 0xC] - mov r10, r2 - ldr r0, [sp, 0x4] - ldr r1, =gUnknown_03005DC0 - str r0, [r1, 0x8] - ldr r0, [r6] - lsls r0, 2 - adds r2, r0, 0 - adds r2, 0xF - str r2, [r1] - ldr r0, [r6, 0x4] - lsls r0, 2 - adds r0, 0xE - str r0, [r1, 0x4] - ldr r0, [sp, 0x4] - mov r9, r0 - adds r1, r7, 0 - cmp r7, 0 - bge _081AA0E0 - adds r1, r7, 0x3 -_081AA0E0: - asrs r1, 2 - ldr r4, [r6, 0x4] - adds r0, r1, 0 - muls r0, r4 - adds r0, 0x7 - muls r2, r0 - lsls r1, 2 - subs r1, r7, r1 - ldr r3, [r6] - adds r0, r1, 0 - muls r0, r3 - adds r0, 0x7 - adds r2, r0 - lsls r2, 1 - add r9, r2 - movs r1, 0 - mov r8, r1 - adds r2, r7, 0x1 - str r2, [sp, 0x10] - cmp r8, r4 - bge _081AA1B6 -_081AA10A: - movs r0, 0 - mov r12, r0 - mov r1, r8 - adds r1, 0x1 - str r1, [sp, 0x14] - cmp r12, r3 - bge _081AA1A2 - ldr r2, =gSaveBlock1Ptr - str r2, [sp, 0x18] - mov r4, r9 - mov r5, r10 -_081AA120: - ldrh r1, [r5] - ldr r0, =0x000003ff - ands r0, r1 - ldr r2, =0x0000028e - cmp r0, r2 - bne _081AA194 - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r7, r0 - beq _081AA194 - mov r0, sp - ldrb r0, [r0] - cmp r7, r0 - bne _081AA164 - ldr r1, [sp, 0x8] - cmp r1, 0 - bne _081AA164 - ldr r2, [sp, 0x18] - ldr r3, [r2] - adds r2, r7, 0 - cmp r7, 0 - bge _081AA14E - adds r2, r7, 0x3 -_081AA14E: - asrs r2, 2 - lsls r1, r2, 2 - subs r1, r7, r1 - ldr r0, [r6] - muls r0, r1 - add r0, r12 - strh r0, [r3] - ldr r0, [r6, 0x4] - muls r0, r2 - add r0, r8 - strh r0, [r3, 0x2] -_081AA164: - ldrh r0, [r5] - movs r1, 0xFC - lsls r1, 8 - ands r1, r0 - ldr r2, =0x0000028d - adds r0, r2, 0 - orrs r1, r0 - strh r1, [r4] - ldr r3, [r6] - b _081AA196 - .pool -_081AA194: - strh r1, [r4] -_081AA196: - adds r4, 0x2 - adds r5, 0x2 - movs r0, 0x1 - add r12, r0 - cmp r12, r3 - blt _081AA120 -_081AA1A2: - lsls r0, r3, 3 - adds r0, 0x1E - add r9, r0 - lsls r0, r3, 1 - add r10, r0 - ldr r1, [sp, 0x14] - mov r8, r1 - ldr r0, [r6, 0x4] - cmp r8, r0 - blt _081AA10A -_081AA1B6: - ldr r7, [sp, 0x10] - cmp r7, 0xF - bgt _081AA1BE - b _081AA0A6 -_081AA1BE: - bl mapheader_run_script_with_tag_x1 - ldr r0, [sp, 0xC] - bl Free - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81AA078 - - thumb_func_start sub_81AA1D8 -sub_81AA1D8: @ 81AA1D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r5, 0 - mov r6, sp - adds r6, 0x1 - add r0, sp, 0x4 - mov r8, r0 - ldr r4, =gSaveBlock2Ptr - ldr r3, =0x00000cb4 - ldr r0, =0x0000ffff - adds r2, r0, 0 -_081AA1F2: - ldr r0, [r4] - lsls r1, r5, 1 - adds r0, r3 - adds r0, r1 - ldrh r1, [r0] - orrs r1, r2 - strh r1, [r0] - adds r5, 0x1 - cmp r5, 0x7 - ble _081AA1F2 - bl sub_81AA9E4 - lsls r0, 24 - lsrs r7, r0, 24 - mov r0, sp - adds r1, r6, 0 - bl sub_81AA33C - movs r0, 0 - str r0, [sp, 0x4] - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - movs r0, 0xC7 - lsls r0, 4 - adds r1, r0 - ldr r2, =0x05000180 - mov r0, r8 - bl CpuSet - movs r5, 0 -_081AA22E: - cmp r5, 0 - bne _081AA254 - ldr r1, =gUnknown_08613650 - lsls r0, r7, 4 - adds r0, r1 - ldrb r0, [r0, 0x3] - b _081AA25C - .pool -_081AA254: - ldr r1, =gUnknown_08613650 - lsls r0, r7, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] -_081AA25C: - cmp r0, 0x4 - bhi _081AA2E4 - lsls r0, 2 - ldr r1, =_081AA274 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AA274: - .4byte _081AA288 - .4byte _081AA292 - .4byte _081AA2A2 - .4byte _081AA2B0 - .4byte _081AA2CC -_081AA288: - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_81AA398 - b _081AA2E4 -_081AA292: - lsls r0, r5, 24 - lsrs r4, r0, 24 - mov r0, sp - ldrb r1, [r0] - adds r0, r4, 0 - bl sub_81AA4D8 - b _081AA2BE -_081AA2A2: - lsls r0, r5, 24 - lsrs r4, r0, 24 - ldrb r1, [r6] - adds r0, r4, 0 - bl sub_81AA4D8 - b _081AA2BE -_081AA2B0: - lsls r0, r5, 24 - lsrs r4, r0, 24 - mov r0, sp - ldrb r1, [r0] - adds r0, r4, 0 - bl sub_81AA648 -_081AA2BE: - lsls r0, 24 - cmp r0, 0 - beq _081AA2E4 - adds r0, r4, 0 - bl sub_81AA398 - b _081AA2E4 -_081AA2CC: - lsls r0, r5, 24 - lsrs r4, r0, 24 - ldrb r1, [r6] - adds r0, r4, 0 - bl sub_81AA648 - lsls r0, 24 - cmp r0, 0 - beq _081AA2E4 - adds r0, r4, 0 - bl sub_81AA398 -_081AA2E4: - adds r5, 0x1 - cmp r5, 0x1 - ble _081AA22E - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81AA1D8 - - thumb_func_start sub_81AA2F8 -sub_81AA2F8: @ 81AA2F8 - push {r4,r5,lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r5, =gUnknown_08252C4F - ldr r4, =gUnknown_08252C6A - movs r2, 0xC8 - lsls r2, 4 - adds r1, r0, r2 - movs r3, 0xC7 - lsls r3, 4 - adds r2, r0, r3 - movs r3, 0x3F -_081AA310: - ldrb r0, [r2, 0x1] - cmp r0, 0x3B - beq _081AA328 - str r5, [r1] - b _081AA32A - .pool -_081AA328: - str r4, [r1] -_081AA32A: - adds r1, 0x18 - adds r2, 0x18 - subs r3, 0x1 - cmp r3, 0 - bge _081AA310 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81AA2F8 - - thumb_func_start sub_81AA33C -sub_81AA33C: @ 81AA33C - push {r4-r7,lr} - adds r4, r0, 0 - adds r6, r1, 0 - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r2, =0x00000e28 - adds r0, r1, r2 - ldrh r2, [r0] - movs r3, 0xF - ands r2, r3 - strb r2, [r4] - ldr r7, =0x00000e22 - adds r1, r7 - ldrh r0, [r1] - ands r0, r3 - strb r0, [r6] - cmp r2, r0 - bne _081AA386 - ldr r1, [r5] - ldr r2, =0x00000e28 - adds r0, r1, r2 - ldrh r2, [r0] - adds r3, r2, 0x1 - adds r0, r3, 0 - asrs r0, 4 - lsls r0, 4 - subs r0, r3, r0 - strb r0, [r4] - adds r0, r1, r7 - ldrh r1, [r0] - adds r2, r1, 0 - adds r2, 0xF - adds r0, r2, 0 - asrs r0, 4 - lsls r0, 4 - subs r0, r2, r0 - strb r0, [r6] -_081AA386: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AA33C - - thumb_func_start sub_81AA398 -sub_81AA398: @ 81AA398 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r5, 0 - bl sub_81AA9E4 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0x10 - bl AllocZeroed - str r0, [sp, 0x8] - bl sub_81AA96C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e26 - adds r0, r1 - ldrh r4, [r0] - movs r0, 0xF - ands r4, r0 - ldr r0, [sp] - cmp r0, 0 - bne _081AA3F0 - ldr r1, =gUnknown_08613650 - lsls r0, r6, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - mov r10, r0 - movs r1, 0 - str r1, [sp, 0x4] - b _081AA3FE - .pool -_081AA3F0: - ldr r1, =gUnknown_08613650 - lsls r0, r6, 4 - adds r0, r1 - ldrb r1, [r0] - mov r10, r1 - ldrb r0, [r0, 0x1] - str r0, [sp, 0x4] -_081AA3FE: - movs r0, 0 - mov r8, r0 - cmp r8, r10 - bge _081AA4C0 -_081AA406: - movs r1, 0x1 - add r1, r8 - mov r9, r1 - b _081AA42E - .pool -_081AA414: - lsls r2, r4, 24 - lsrs r2, 24 - ldr r3, [sp, 0x4] - add r3, r8 - lsls r3, 24 - lsrs r3, 24 - ldr r0, [sp] - ldr r1, [sp, 0x8] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA4B6 -_081AA42E: - ldr r0, =gBitTable - mov r12, r0 - ldr r6, =gSaveBlock2Ptr - ldr r7, =0x00000e28 - movs r3, 0x2 - lsls r0, r4, 2 - mov r1, r12 - adds r2, r0, r1 -_081AA43E: - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _081AA464 - ldr r0, [r6] - adds r0, r7 - ldrh r1, [r0] - ldr r0, [r2] - ands r0, r1 - cmp r0, 0 - bne _081AA474 - b _081AA472 - .pool -_081AA464: - ldr r0, [r6] - adds r0, r7 - ldrh r1, [r0] - ldr r0, [r2] - ands r0, r1 - cmp r0, 0 - beq _081AA474 -_081AA472: - orrs r5, r3 -_081AA474: - adds r2, 0x4 - adds r4, 0x1 - cmp r4, 0xF - ble _081AA480 - mov r2, r12 - movs r4, 0 -_081AA480: - ldr r0, [r6] - ldr r1, =0x00000e26 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0xF - ands r1, r0 - cmp r4, r1 - bne _081AA4A6 - movs r1, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _081AA4A4 - movs r0, 0x6 - orrs r5, r0 - b _081AA4A6 - .pool -_081AA4A4: - orrs r5, r1 -_081AA4A6: - adds r0, r5, 0 - ands r0, r3 - cmp r0, 0 - beq _081AA43E - movs r0, 0x4 - ands r0, r5 - cmp r0, 0 - beq _081AA414 -_081AA4B6: - movs r0, 0x1 - ands r5, r0 - mov r8, r9 - cmp r8, r10 - blt _081AA406 -_081AA4C0: - ldr r0, [sp, 0x8] - bl Free - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81AA398 - - thumb_func_start sub_81AA4D8 -sub_81AA4D8: @ 81AA4D8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r6, 0 - movs r7, 0 - movs r0, 0 - str r0, [sp, 0xC] - bl sub_81AA9E4 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x10 - bl AllocZeroed - str r0, [sp, 0x14] - bl sub_81AA96C - ldr r1, [sp] - cmp r1, 0 - bne _081AA524 - ldr r1, =gUnknown_08613650 - lsls r0, r4, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - str r0, [sp, 0x10] - movs r0, 0 - b _081AA530 - .pool -_081AA524: - ldr r1, =gUnknown_08613650 - lsls r0, r4, 4 - adds r0, r1 - ldrb r2, [r0] - str r2, [sp, 0x10] - ldrb r0, [r0, 0x1] -_081AA530: - movs r3, 0 - str r3, [sp, 0x8] - ldr r1, [sp, 0x10] - asrs r1, 31 - str r1, [sp, 0x18] - ldr r2, [sp, 0x10] - cmp r3, r2 - bge _081AA622 - str r0, [sp, 0x1C] - adds r3, r0, 0 - lsls r3, 24 - mov r9, r3 -_081AA548: - cmp r7, 0 - bne _081AA56E - mov r0, r9 - lsrs r3, r0, 24 - ldr r0, [sp] - ldr r1, [sp, 0x14] - ldr r2, [sp, 0x4] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA568 - movs r7, 0x1 - b _081AA56E - .pool -_081AA568: - ldr r1, [sp, 0xC] - adds r1, 0x1 - str r1, [sp, 0xC] -_081AA56E: - movs r0, 0x1 - ands r0, r7 - cmp r0, 0 - beq _081AA600 - ldr r2, =gUnknown_08613F46 - mov r8, r2 - ldr r3, [sp, 0x4] - lsls r4, r3, 2 - adds r0, r6, r4 - add r0, r8 - ldrb r2, [r0] - mov r0, r9 - lsrs r3, r0, 24 - ldr r0, [sp] - ldr r1, [sp, 0x14] - bl sub_81AA760 - lsls r0, 24 - ldr r1, [sp, 0x1C] - mov r10, r1 - adds r5, r4, 0 - cmp r0, 0 - beq _081AA5E8 - ldr r4, [sp, 0xC] - adds r4, 0x1 - b _081AA5C2 - .pool -_081AA5A8: - adds r0, r6, r5 - adds r0, r2 - ldrb r2, [r0] - mov r0, r10 - lsls r3, r0, 24 - lsrs r3, 24 - ldr r0, [sp] - ldr r1, [sp, 0x14] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA5E0 -_081AA5C2: - adds r6, 0x1 - ldr r0, =gUnknown_08613F46 - adds r1, r6, r5 - adds r1, r0 - ldrb r1, [r1] - adds r2, r0, 0 - cmp r1, 0xFF - beq _081AA5D6 - cmp r6, 0x3 - ble _081AA5D8 -_081AA5D6: - movs r6, 0 -_081AA5D8: - adds r7, 0x2 - asrs r0, r7, 1 - cmp r0, 0x4 - bne _081AA5A8 -_081AA5E0: - str r4, [sp, 0xC] - b _081AA600 - .pool -_081AA5E8: - adds r6, 0x1 - adds r0, r6, r4 - add r0, r8 - ldrb r0, [r0] - cmp r0, 0xFF - beq _081AA5F8 - cmp r6, 0x3 - ble _081AA5FA -_081AA5F8: - movs r6, 0 -_081AA5FA: - ldr r1, [sp, 0xC] - adds r1, 0x1 - str r1, [sp, 0xC] -_081AA600: - asrs r0, r7, 1 - cmp r0, 0x4 - beq _081AA622 - movs r0, 0x1 - ands r7, r0 - ldr r2, [sp, 0x1C] - adds r2, 0x1 - str r2, [sp, 0x1C] - movs r3, 0x80 - lsls r3, 17 - add r9, r3 - ldr r0, [sp, 0x8] - adds r0, 0x1 - str r0, [sp, 0x8] - ldr r1, [sp, 0x10] - cmp r0, r1 - blt _081AA548 -_081AA622: - movs r1, 0 - ldr r2, [sp, 0x10] - ldr r3, [sp, 0x18] - subs r0, r2, r3 - asrs r0, 1 - ldr r2, [sp, 0xC] - cmp r0, r2 - ble _081AA634 - movs r1, 0x1 -_081AA634: - adds r0, r1, 0 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AA4D8 - - thumb_func_start sub_81AA648 -sub_81AA648: @ 81AA648 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r6, r1, 24 - movs r4, 0 - movs r7, 0 - movs r0, 0 - mov r8, r0 - bl sub_81AA9E4 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x10 - bl AllocZeroed - str r0, [sp, 0x8] - bl sub_81AA96C - ldr r1, [sp] - cmp r1, 0 - bne _081AA694 - ldr r1, =gUnknown_08613650 - lsls r0, r5, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - mov r10, r0 - movs r0, 0 - b _081AA6A0 - .pool -_081AA694: - ldr r1, =gUnknown_08613650 - lsls r0, r5, 4 - adds r0, r1 - ldrb r2, [r0] - mov r10, r2 - ldrb r0, [r0, 0x1] -_081AA6A0: - movs r3, 0 - str r3, [sp, 0x4] - mov r1, r10 - asrs r1, 31 - str r1, [sp, 0xC] - cmp r3, r10 - bge _081AA73E - ldr r2, =gUnknown_08613F46 - mov r9, r2 - lsls r5, r6, 2 - lsls r6, r0, 24 -_081AA6B6: - adds r0, r4, r5 - add r0, r9 - ldrb r2, [r0] - lsrs r3, r6, 24 - ldr r0, [sp] - ldr r1, [sp, 0x8] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA714 - adds r7, 0x1 - b _081AA6EE - .pool -_081AA6D8: - adds r0, r4, r5 - adds r0, r1 - ldrb r2, [r0] - lsrs r3, r6, 24 - ldr r0, [sp] - ldr r1, [sp, 0x8] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA728 -_081AA6EE: - adds r4, 0x1 - adds r0, r4, r5 - add r0, r9 - ldrb r0, [r0] - ldr r1, =gUnknown_08613F46 - cmp r0, 0xFF - beq _081AA700 - cmp r4, 0x3 - ble _081AA702 -_081AA700: - movs r4, 0 -_081AA702: - movs r3, 0x1 - add r8, r3 - mov r0, r8 - cmp r0, 0x4 - bne _081AA6D8 - b _081AA728 - .pool -_081AA714: - adds r4, 0x1 - adds r0, r4, r5 - add r0, r9 - ldrb r0, [r0] - cmp r0, 0xFF - beq _081AA724 - cmp r4, 0x3 - ble _081AA726 -_081AA724: - movs r4, 0 -_081AA726: - adds r7, 0x1 -_081AA728: - mov r1, r8 - cmp r1, 0x4 - beq _081AA73E - movs r2, 0x80 - lsls r2, 17 - adds r6, r2 - ldr r3, [sp, 0x4] - adds r3, 0x1 - str r3, [sp, 0x4] - cmp r3, r10 - blt _081AA6B6 -_081AA73E: - movs r1, 0 - mov r2, r10 - ldr r3, [sp, 0xC] - subs r0, r2, r3 - asrs r0, 1 - cmp r0, r7 - ble _081AA74E - movs r1, 0x1 -_081AA74E: - adds r0, r1, 0 - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AA648 - - thumb_func_start sub_81AA760 -sub_81AA760: @ 81AA760 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r10, r1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r7, r3, 24 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e22 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AA7D0 - movs r6, 0x7 -_081AA792: - movs r4, 0x7 - lsls r5, r6, 24 -_081AA796: - lsls r1, r4, 24 - lsrs r1, 24 - mov r0, r8 - str r0, [sp] - str r7, [sp, 0x4] - mov r0, r9 - lsrs r2, r5, 24 - mov r3, r10 - bl sub_81AA810 - lsls r0, 24 - cmp r0, 0 - beq _081AA7CC - subs r4, 0x1 - cmp r4, 0 - bge _081AA796 - subs r6, 0x1 - movs r1, 0x1 - negs r1, r1 - cmp r6, r1 - bgt _081AA792 - b _081AA7FC - .pool -_081AA7CC: - movs r0, 0 - b _081AA7FE -_081AA7D0: - movs r6, 0 -_081AA7D2: - movs r4, 0 - lsls r5, r6, 24 -_081AA7D6: - lsls r1, r4, 24 - lsrs r1, 24 - mov r0, r8 - str r0, [sp] - str r7, [sp, 0x4] - mov r0, r9 - lsrs r2, r5, 24 - mov r3, r10 - bl sub_81AA810 - lsls r0, 24 - cmp r0, 0 - beq _081AA7CC - adds r4, 0x1 - cmp r4, 0x7 - ble _081AA7D6 - adds r6, 0x1 - cmp r6, 0x7 - ble _081AA7D2 -_081AA7FC: - movs r0, 0x1 -_081AA7FE: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AA760 - - thumb_func_start sub_81AA810 -sub_81AA810: @ 81AA810 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - ldr r4, [sp, 0x34] - ldr r5, [sp, 0x38] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - lsls r5, 24 - lsrs r6, r5, 24 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r1, r0, r1 - str r1, [sp, 0x8] - add r3, r10 - ldrb r1, [r3] - adds r1, 0x2C - movs r0, 0x19 - bl get_mapheader_by_bank_and_number - adds r5, r0, 0 - movs r7, 0 - ldr r1, [r5, 0x4] - ldrb r2, [r1] - cmp r7, r2 - bge _081AA95A - movs r0, 0x3 - ands r0, r4 - lsls r0, 3 - str r0, [sp, 0xC] -_081AA868: - ldr r1, [r1, 0x4] - lsls r2, r7, 1 - adds r0, r2, r7 - lsls r0, 3 - adds r3, r0, r1 - movs r4, 0x4 - ldrsh r0, [r3, r4] - ldr r1, [r5, 0x4] - mov r12, r1 - mov r9, r2 - ldr r2, [sp, 0x4] - cmp r0, r2 - bne _081AA950 - movs r4, 0x6 - ldrsh r0, [r3, r4] - cmp r0, r8 - bne _081AA950 - ldr r0, [sp] - cmp r0, 0 - bne _081AA896 - ldrb r0, [r3, 0x1] - cmp r0, 0x3B - bne _081AA8A2 -_081AA896: - ldr r1, [sp] - cmp r1, 0x1 - bne _081AA950 - ldrb r0, [r3, 0x1] - cmp r0, 0x3B - bne _081AA950 -_081AA8A2: - movs r3, 0 - ldr r2, [r5, 0x4] - mov r12, r2 - cmp r3, r6 - bge _081AA8DC - ldr r4, [sp, 0x4] - ldr r0, [sp, 0xC] - adds r4, r0 - str r4, [sp, 0x10] - mov r1, r10 - lsrs r0, r1, 2 - lsls r0, 3 - mov r2, r8 - adds r1, r2, r0 - ldr r2, [sp, 0x8] - adds r2, 0x4 -_081AA8C2: - movs r4, 0 - ldrsh r0, [r2, r4] - ldr r4, [sp, 0x10] - cmp r0, r4 - bne _081AA8D4 - movs r4, 0x2 - ldrsh r0, [r2, r4] - cmp r0, r1 - beq _081AA8DC -_081AA8D4: - adds r2, 0x18 - adds r3, 0x1 - cmp r3, r6 - blt _081AA8C2 -_081AA8DC: - cmp r3, r6 - bne _081AA950 - lsls r0, r6, 1 - mov r8, r0 - adds r0, r6 - lsls r0, 3 - ldr r1, [sp, 0x8] - adds r5, r0, r1 - mov r3, r12 - ldr r2, [r3, 0x4] - mov r4, r9 - adds r1, r4, r7 - lsls r1, 3 - adds r0, r5, 0 - adds r1, r2 - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldrh r0, [r5, 0x4] - ldr r1, [sp, 0xC] - adds r0, r1 - strh r0, [r5, 0x4] - mov r2, r10 - lsrs r0, r2, 2 - lsls r0, 3 - ldrh r3, [r5, 0x6] - adds r0, r3 - strh r0, [r5, 0x6] - adds r0, r6, 0x1 - strb r0, [r5] - ldrb r0, [r5, 0x1] - cmp r0, 0x3B - beq _081AA940 - adds r0, r6, 0 - bl sub_81A9F90 - lsls r0, 16 - lsrs r7, r0, 16 - adds r4, r7, 0 - adds r0, r4, 0 - bl sub_81627A4 - strb r0, [r5, 0x1] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb4 - adds r0, r1 - add r0, r8 - strh r4, [r0] -_081AA940: - movs r0, 0 - b _081AA95C - .pool -_081AA950: - adds r7, 0x1 - mov r1, r12 - ldrb r2, [r1] - cmp r7, r2 - blt _081AA868 -_081AA95A: - movs r0, 0x1 -_081AA95C: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AA810 - - thumb_func_start sub_81AA96C -sub_81AA96C: @ 81AA96C - push {r4-r7,lr} - adds r6, r0, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e22 - adds r1, r0, r2 - ldrh r4, [r1] - ldr r1, =0x00000e24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - orrs r4, r0 - bl sub_81AA9E4 - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - ldr r2, =gUnknown_08613655 - mov r12, r2 - movs r7, 0x7 -_081AA994: - adds r2, r6, r3 - adds r0, r4, 0 - ands r0, r7 - lsls r1, r5, 4 - adds r0, r1 - add r0, r12 - ldrb r0, [r0] - strb r0, [r2] - asrs r4, 3 - cmp r3, 0x7 - bne _081AA9C0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000e26 - adds r0, r1, r2 - ldrh r4, [r0] - ldr r0, =0x00000e28 - adds r1, r0 - ldrh r0, [r1] - lsls r0, 16 - orrs r4, r0 - asrs r4, 8 -_081AA9C0: - adds r3, 0x1 - cmp r3, 0xF - ble _081AA994 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AA96C - - thumb_func_start sub_81AA9E4 -sub_81AA9E4: @ 81AA9E4 - push {r4,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r1, =0x00000e28 - adds r0, r4, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x00000cb2 - adds r4, r0 - ldrh r0, [r4] - ldr r1, =gUnknown_08613794 - adds r0, r1 - ldrb r2, [r0] - cmp r2, 0x21 - bhi _081AAA38 - ldr r1, =gUnknown_08613750 - lsls r0, r2, 1 - adds r0, r1 -_081AAA10: - ldrb r1, [r0] - cmp r3, r1 - bge _081AAA30 - ldrb r0, [r0, 0x1] - b _081AAA3A - .pool -_081AAA30: - adds r0, 0x2 - adds r2, 0x1 - cmp r2, 0x21 - bls _081AAA10 -_081AAA38: - movs r0, 0 -_081AAA3A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81AA9E4 - - thumb_func_start sub_81AAA40 -sub_81AAA40: @ 81AAA40 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r2, r0, r1 - movs r1, 0 - movs r3, 0xC7 - lsls r3, 4 - adds r0, r3 - b _081AAA6E - .pool -_081AAA5C: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bhi _081AAA74 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r2 -_081AAA6E: - ldrb r0, [r0] - cmp r0, 0 - bne _081AAA5C -_081AAA74: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_81AAA40 - - thumb_func_start sub_81AAA7C -sub_81AAA7C: @ 81AAA7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - ldr r1, =gSaveBlock2Ptr - mov r8, r1 - lsls r1, r0, 2 - adds r1, r0 - movs r0, 0 - mov r12, r0 - lsls r4, r1, 1 - ldr r7, =0x00000e2c - movs r6, 0 - ldr r5, =0x00000e54 - lsls r2, r1, 2 -_081AAA9E: - mov r1, r8 - ldr r0, [r1] - adds r1, r0, r7 - adds r1, r2 - strh r6, [r1] - adds r1, r3, r4 - adds r0, r5 - adds r0, r1 - mov r1, r12 - strb r1, [r0] - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x9 - ble _081AAA9E - movs r0, 0x15 - movs r1, 0x1 - bl AddPyramidBagItem - movs r0, 0x22 - movs r1, 0x1 - bl AddPyramidBagItem - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAA7C - - thumb_func_start CalculateBattlePyramidPickupItemId -CalculateBattlePyramidPickupItemId: @ 81AAAE0 - push {r4-r6,lr} - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r6, r0, 30 - lsls r0, r6, 1 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x13 - ble _081AAB0A - movs r4, 0x13 -_081AAB0A: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0 - ldr r3, =gUnknown_08613F86 - ldrb r0, [r3] - lsls r5, r4, 2 - cmp r0, r2 - bgt _081AAB36 -_081AAB28: - adds r1, 0x1 - cmp r1, 0x9 - bhi _081AAB3A - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - ble _081AAB28 -_081AAB36: - cmp r1, 0x9 - bls _081AAB3C -_081AAB3A: - movs r1, 0x9 -_081AAB3C: - cmp r6, 0 - bne _081AAB58 - ldr r2, =gUnknown_0861379C - b _081AAB5A - .pool -_081AAB58: - ldr r2, =gUnknown_0861392C -_081AAB5A: - lsls r1, 1 - adds r0, r5, r4 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end CalculateBattlePyramidPickupItemId - - thumb_func_start ResetBagScrollPositions -ResetBagScrollPositions: @ 81AAB70 - push {r4,lr} - ldr r4, =gUnknown_0203CE58 - movs r0, 0 - strb r0, [r4, 0x5] - adds r0, r4, 0 - adds r0, 0x8 - movs r1, 0 - movs r2, 0xA - bl memset - adds r4, 0x12 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0xA - bl memset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ResetBagScrollPositions - - thumb_func_start CB2_BagMenuFromStartMenu -@ void CB2_BagMenuFromStartMenu() -CB2_BagMenuFromStartMenu: @ 81AAB9C - push {lr} - ldr r2, =sub_8086194 - movs r0, 0 - movs r1, 0x5 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end CB2_BagMenuFromStartMenu - - thumb_func_start sub_81AABB0 -sub_81AABB0: @ 81AABB0 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _081AABCC - ldr r2, =sub_8059D50 - movs r0, 0x1 - movs r1, 0x5 - bl GoToBagMenu - b _081AABD4 - .pool -_081AABCC: - ldr r1, =sub_8059D50 - movs r0, 0x1 - bl sub_81C4F98 -_081AABD4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AABB0 - - thumb_func_start CB2_ChooseBerry -CB2_ChooseBerry: @ 81AABDC - push {lr} - ldr r2, =sub_80861B0 - movs r0, 0x4 - movs r1, 0x3 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end CB2_ChooseBerry - - thumb_func_start sub_81AABF0 -sub_81AABF0: @ 81AABF0 - push {lr} - adds r2, r0, 0 - movs r0, 0x5 - movs r1, 0x3 - bl GoToBagMenu - pop {r0} - bx r0 - thumb_func_end sub_81AABF0 - - thumb_func_start CB2_GoToSellMenu -@ void CB2_GoToSellMenu() -CB2_GoToSellMenu: @ 81AAC00 - push {lr} - ldr r2, =CB2_ExitSellMenu - movs r0, 0x3 - movs r1, 0x5 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end CB2_GoToSellMenu - - thumb_func_start sub_81AAC14 -sub_81AAC14: @ 81AAC14 - push {lr} - ldr r2, =sub_816B31C - movs r0, 0x6 - movs r1, 0x5 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAC14 - - thumb_func_start sub_81AAC28 -sub_81AAC28: @ 81AAC28 - push {lr} - ldr r2, =bag_menu_leave_maybe_3 - movs r0, 0x9 - movs r1, 0x5 - bl GoToBagMenu - ldr r0, =gSpecialVar_0x8005 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAC28 - - thumb_func_start sub_81AAC50 -sub_81AAC50: @ 81AAC50 - push {lr} - ldr r2, =bag_menu_leave_maybe_2 - movs r0, 0x7 - movs r1, 0x5 - bl GoToBagMenu - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAC50 - - thumb_func_start sub_81AAC70 -sub_81AAC70: @ 81AAC70 - push {lr} - ldr r2, =bag_menu_leave_maybe - movs r0, 0x8 - movs r1, 0x5 - bl GoToBagMenu - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAC70 - - thumb_func_start GoToBagMenu -@ void GoToBagMenu(u8 bagMenuType, u8 pocketId, void ( *postExitMenuMainCallback2)()) -GoToBagMenu: @ 81AAC90 - push {r4-r7,lr} - adds r4, r2, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r6, =gUnknown_0203CE54 - ldr r0, =0x00000c48 - bl AllocZeroed - str r0, [r6] - cmp r0, 0 - bne _081AACBC - adds r0, r4, 0 - bl SetMainCallback2 - b _081AAD3A - .pool -_081AACBC: - ldr r0, =gUnknown_0203CE58 - cmp r5, 0xC - beq _081AACC4 - strb r5, [r0, 0x4] -_081AACC4: - cmp r4, 0 - beq _081AACCA - str r4, [r0] -_081AACCA: - cmp r7, 0x4 - bhi _081AACD0 - strb r7, [r0, 0x5] -_081AACD0: - ldrb r0, [r0, 0x4] - subs r0, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081AACF0 - ldr r2, [r6] - ldr r0, =0x0000081b - adds r2, r0 - ldrb r1, [r2] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_081AACF0: - ldr r0, [r6] - movs r1, 0 - str r1, [r0] - ldr r1, =0x0000081a - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x0000081e - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x0000081f - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x00000804 - adds r0, r1 - movs r1, 0xFF - movs r2, 0xC - bl memset - ldr r0, [r6] - movs r1, 0x81 - lsls r1, 4 - adds r0, r1 - movs r1, 0xFF - movs r2, 0xA - bl memset - ldr r0, =CB2_Bag - bl SetMainCallback2 -_081AAD3A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end GoToBagMenu - - thumb_func_start c2_bag_3 -c2_bag_3: @ 81AAD5C - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl do_scheduled_bg_tilemap_copies_to_vram - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end c2_bag_3 - - thumb_func_start vblank_cb_bag_menu -vblank_cb_bag_menu: @ 81AAD78 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end vblank_cb_bag_menu - - thumb_func_start CB2_Bag -CB2_Bag: @ 81AAD8C - push {lr} -_081AAD8E: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AADB2 - bl setup_bag_menu - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AADB2 - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AAD8E -_081AADB2: - pop {r0} - bx r0 - thumb_func_end CB2_Bag - - thumb_func_start setup_bag_menu -setup_bag_menu: @ 81AADB8 - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x14 - bls _081AADCE - b _081AB02C -_081AADCE: - lsls r0, 2 - ldr r1, =_081AADE0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AADE0: - .4byte _081AAE34 - .4byte _081AAE3E - .4byte _081AAE50 - .4byte _081AAE56 - .4byte _081AAE78 - .4byte _081AAE7E - .4byte _081AAE86 - .4byte _081AAEA4 - .4byte _081AAECC - .4byte _081AAEDA - .4byte _081AAEEC - .4byte _081AAEFA - .4byte _081AAF0C - .4byte _081AAF1C - .4byte _081AAF54 - .4byte _081AAFA0 - .4byte _081AAFBC - .4byte _081AAFC2 - .4byte _081AAFD8 - .4byte _081AAFDE - .4byte _081AAFF8 -_081AAE34: - bl SetVBlankHBlankCallbacksToNull - bl clear_scheduled_bg_copies_to_vram - b _081AB012 -_081AAE3E: - bl remove_some_task - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAE50: - bl FreeAllSpritePalettes - b _081AB012 -_081AAE56: - bl ResetPaletteFade - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAE78: - bl ResetSpriteData - b _081AB012 -_081AAE7E: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _081AB01A -_081AAE86: - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - bne _081AAE94 - bl ResetTasks -_081AAE94: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAEA4: - bl bag_menu_init_bgs - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000834 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAECC: - bl load_bag_menu_graphics - lsls r0, 24 - cmp r0, 0 - bne _081AAED8 - b _081AB044 -_081AAED8: - b _081AB012 -_081AAEDA: - bl setup_bag_menu_textboxes - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAEEC: - bl sub_81ABA6C - bl sub_81ABAC4 - bl sub_81ABAE0 - b _081AB012 -_081AAEFA: - bl allocate_bag_item_list_buffers - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAF0C: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - bl load_bag_item_list_buffers - b _081AB012 - .pool -_081AAF1C: - ldr r1, =gUnknown_085E91FC - ldr r4, =gUnknown_0203CE58 - ldrb r0, [r4, 0x5] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - bl bag_menu_print_pocket_names - movs r0, 0 - bl bag_menu_copy_pocket_name_to_window - ldrb r0, [r4, 0x5] - movs r1, 0x1 - bl bag_menu_draw_pocket_indicator_square - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAF54: - ldr r4, =gUnknown_0203CE58 - ldrb r0, [r4, 0x4] - bl sub_81AB1F0 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_03006310 - ldrb r2, [r4, 0x5] - lsls r2, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r1, r2, r1 - ldrh r1, [r1] - adds r4, 0x8 - adds r2, r4 - ldrh r2, [r2] - bl ListMenuInit - ldr r2, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - strh r0, [r1, 0x8] - strh r2, [r1, 0xE] - strh r2, [r1, 0x18] - b _081AB012 - .pool -_081AAFA0: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - bl AddBagVisualObject - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAFBC: - bl sub_80D4FAC - b _081AB012 -_081AAFC2: - bl bag_menu_add_pocket_scroll_arrow_indicators_maybe - bl bag_menu_add_list_scroll_arrow_indicators_maybe - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAFD8: - bl bag_menu_prepare_tmhm_move_window - b _081AB012 -_081AAFDE: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAFF8: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r2, =gPaletteFade - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] -_081AB012: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_081AB01A: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081AB044 - .pool -_081AB02C: - ldr r0, =vblank_cb_bag_menu - bl SetVBlankCallback - ldr r0, =c2_bag_3 - bl SetMainCallback2 - movs r0, 0x1 - b _081AB046 - .pool -_081AB044: - movs r0, 0 -_081AB046: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end setup_bag_menu - - thumb_func_start bag_menu_init_bgs -bag_menu_init_bgs: @ 81AB050 - push {r4,lr} - bl sub_8121DA0 - ldr r4, =gUnknown_0203CE54 - ldr r0, [r4] - adds r0, 0x4 - movs r2, 0x80 - lsls r2, 4 - movs r1, 0 - bl memset - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08613F90 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r1, [r4] - adds r1, 0x4 - movs r0, 0x2 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_init_bgs - - thumb_func_start load_bag_menu_graphics -load_bag_menu_graphics: @ 81AB0BC - push {r4,lr} - sub sp, 0x4 - ldr r4, =gUnknown_0203CE54 - ldr r0, [r4] - ldr r1, =0x00000834 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x4 - bls _081AB0D2 - b _081AB1CC -_081AB0D2: - lsls r0, 2 - ldr r1, =_081AB0E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AB0E8: - .4byte _081AB0FC - .4byte _081AB118 - .4byte _081AB13C - .4byte _081AB174 - .4byte _081AB1A8 -_081AB0FC: - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08D9A620 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _081AB1AE - .pool -_081AB118: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AB1E4 - ldr r0, =gUnknown_08D9A88C - ldr r4, =gUnknown_0203CE54 - ldr r1, [r4] - adds r1, 0x4 - bl LZDecompressWram - ldr r1, [r4] - b _081AB1B2 - .pool -_081AB13C: - bl IsWallysBag - lsls r0, 24 - cmp r0, 0 - bne _081AB164 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _081AB164 - ldr r0, =gUnknown_08D9A5D4 - movs r1, 0 - movs r2, 0x40 - bl LoadCompressedPalette - b _081AB1AE - .pool -_081AB164: - ldr r0, =gUnknown_08D9A588 - movs r1, 0 - movs r2, 0x40 - bl LoadCompressedPalette - b _081AB1AE - .pool -_081AB174: - bl IsWallysBag - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AB18A - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _081AB19C -_081AB18A: - ldr r0, =gUnknown_0857FB34 - bl LoadCompressedObjectPic - b _081AB1AE - .pool -_081AB19C: - ldr r0, =gUnknown_0857FB3C - bl LoadCompressedObjectPic - b _081AB1AE - .pool -_081AB1A8: - ldr r0, =gUnknown_0857FB44 - bl LoadCompressedObjectPalette -_081AB1AE: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] -_081AB1B2: - ldr r0, =0x00000834 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081AB1E4 - .pool -_081AB1CC: - bl sub_8122328 - ldr r0, [r4] - ldr r1, =0x00000834 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - movs r0, 0x1 - b _081AB1E6 - .pool -_081AB1E4: - movs r0, 0 -_081AB1E6: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end load_bag_menu_graphics - - thumb_func_start sub_81AB1F0 -sub_81AB1F0: @ 81AB1F0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA - bne _081AB204 - ldr r0, =Task_WallyTutorialBagMenu - b _081AB206 - .pool -_081AB204: - ldr r0, =Task_BagMenu -_081AB206: - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81AB1F0 - - thumb_func_start allocate_bag_item_list_buffers -allocate_bag_item_list_buffers: @ 81AB218 - push {r4,lr} - ldr r4, =gUnknown_0203CE74 - movs r0, 0x82 - lsls r0, 2 - bl Alloc - str r0, [r4] - ldr r4, =gUnknown_0203CE78 - movs r0, 0xC3 - lsls r0, 3 - bl Alloc - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end allocate_bag_item_list_buffers - - thumb_func_start load_bag_item_list_buffers -@ void load_bag_item_list_buffers(int pocket_id) -load_bag_item_list_buffers: @ 81AB240 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, r7, 3 - ldr r0, =gBagPockets - adds r1, r0 - mov r8, r1 - ldr r0, =gUnknown_0203CE54 - ldr r2, [r0] - ldr r1, =0x0000081b - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081AB2FC - movs r6, 0 - ldr r3, =0x00000829 - adds r0, r2, r3 - adds r0, r7 - ldrb r0, [r0] - subs r0, 0x1 - cmp r6, r0 - bge _081AB2B6 - ldr r5, =gUnknown_0203CE78 -_081AB276: - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - ldr r0, [r5] - adds r0, r4 - mov r1, r8 - ldr r2, [r1] - lsls r1, r6, 2 - adds r1, r2 - ldrh r1, [r1] - bl get_name - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - lsls r1, r6, 3 - adds r1, r0 - ldr r0, [r5] - adds r0, r4 - str r0, [r1] - str r6, [r1, 0x4] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r3, =0x00000829 - adds r0, r3 - adds r0, r7 - ldrb r0, [r0] - subs r0, 0x1 - cmp r6, r0 - blt _081AB276 -_081AB2B6: - ldr r5, =gUnknown_0203CE78 - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - ldr r0, [r5] - adds r0, r4 - ldr r1, =gUnknown_085E8DB4 - bl StringCopy - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - lsls r1, r6, 3 - adds r1, r0 - ldr r0, [r5] - adds r0, r4 - str r0, [r1] - movs r0, 0x2 - negs r0, r0 - str r0, [r1, 0x4] - b _081AB34A - .pool -_081AB2FC: - movs r6, 0 - ldr r4, =0x00000829 - adds r0, r2, r4 - adds r0, r7 - ldrb r0, [r0] - cmp r6, r0 - bcs _081AB34A - ldr r5, =gUnknown_0203CE78 -_081AB30C: - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - ldr r0, [r5] - adds r0, r4 - mov r1, r8 - ldr r2, [r1] - lsls r1, r6, 2 - adds r1, r2 - ldrh r1, [r1] - bl get_name - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - lsls r1, r6, 3 - adds r1, r0 - ldr r0, [r5] - adds r0, r4 - str r0, [r1] - str r6, [r1, 0x4] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r3, =0x00000829 - adds r0, r3 - adds r0, r7 - ldrb r0, [r0] - cmp r6, r0 - bcc _081AB30C -_081AB34A: - ldr r2, =gUnknown_03006310 - adds r1, r2, 0 - ldr r0, =gUnknown_08613F9C - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - ldr r4, =0x00000829 - adds r0, r1, r4 - adds r0, r7 - ldrb r0, [r0] - strh r0, [r2, 0xC] - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - str r0, [r2] - ldr r5, =0x0000082e - adds r1, r5 - adds r1, r7 - ldrb r0, [r1] - strh r0, [r2, 0xE] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end load_bag_item_list_buffers - - thumb_func_start get_name -@ void get_name(char *dest, int name_id) -get_name: @ 81AB39C - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x2 - beq _081AB3C0 - cmp r0, 0x3 - beq _081AB420 - adds r0, r5, 0 - adds r1, r6, 0 - bl CopyItemName - b _081AB43E - .pool -_081AB3C0: - ldr r4, =gStringVar2 - adds r0, r5, 0 - bl ItemIdToBattleMoveId - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0xA9 - lsls r0, 1 - cmp r5, r0 - bls _081AB408 - ldr r0, =gStringVar1 - ldr r2, =0xfffffeae - adds r1, r5, r2 - movs r2, 0x2 - movs r3, 0x1 - bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_085E921A - b _081AB438 - .pool -_081AB408: - ldr r0, =gStringVar1 - ldr r2, =0xfffffee0 - adds r1, r5, r2 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - b _081AB436 - .pool -_081AB420: - ldr r0, =gStringVar1 - adds r1, r5, 0 - subs r1, 0x84 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r1, =gStringVar2 - adds r0, r5, 0 - bl CopyItemName -_081AB436: - ldr r1, =gUnknown_085E9210 -_081AB438: - adds r0, r6, 0 - bl StringExpandPlaceholders -_081AB43E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end get_name - - thumb_func_start bag_menu_change_item_callback -bag_menu_change_item_callback: @ 81AB450 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _081AB466 - movs r0, 0x5 - bl PlaySE - bl ShakeBagVisual -_081AB466: - ldr r4, =gUnknown_0203CE54 - ldr r1, [r4] - ldr r2, =0x0000081a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081AB50C - adds r2, 0x1 - adds r0, r1, r2 - ldrb r1, [r0] - lsls r1, 26 - lsrs r1, 30 - movs r0, 0x1 - eors r0, r1 - bl RemoveBagItemIconObject - movs r0, 0x2 - negs r0, r0 - cmp r6, r0 - beq _081AB4C8 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r6, 16 - lsrs r1, 16 - bl BagGetItemIdByPocketPosition - lsls r0, 16 - lsrs r0, 16 - ldr r1, [r4] - ldr r2, =0x0000081b - adds r1, r2 - ldrb r1, [r1] - lsls r1, 26 - lsrs r1, 30 - bl AddBagItemIconObject - b _081AB4DA - .pool -_081AB4C8: - ldr r0, =0x0000ffff - ldr r1, [r4] - ldr r2, =0x0000081b - adds r1, r2 - ldrb r1, [r1] - lsls r1, 26 - lsrs r1, 30 - bl AddBagItemIconObject -_081AB4DA: - ldr r5, =gUnknown_0203CE54 - ldr r2, [r5] - ldr r4, =0x0000081b - adds r2, r4 - ldrb r3, [r2] - lsls r0, r3, 26 - lsrs r0, 30 - movs r1, 0x1 - eors r1, r0 - lsls r1, 4 - movs r0, 0x31 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _081AB50C - adds r0, r6, 0 - bl bag_menu_print_description_box_text -_081AB50C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_change_item_callback - - thumb_func_start sub_81AB520 -@ void sub_81AB520(u8 rbox_id, int item_index_in_pocket, int a3) -sub_81AB520: @ 81AB520 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r2, 24 - lsrs r7, r2, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - bne _081AB540 - b _081AB696 -_081AB540: - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x0000081a - adds r0, r1 - ldrb r1, [r0] - cmp r1, 0xFF - beq _081AB570 - lsls r0, r4, 24 - lsrs r0, 24 - cmp r1, r0 - bne _081AB568 - adds r0, r7, 0 - movs r1, 0x2 - bl bag_menu_print_cursor - b _081AB570 - .pool -_081AB568: - adds r0, r7, 0 - movs r1, 0xFF - bl bag_menu_print_cursor -_081AB570: - ldr r5, =gUnknown_0203CE58 - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 16 - lsrs r4, 16 - adds r1, r4, 0 - bl BagGetItemIdByPocketPosition - lsls r0, 16 - lsrs r6, r0, 16 - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl BagGetQuantityByPocketPosition - lsls r0, 16 - lsrs r4, r0, 16 - mov r9, r4 - ldr r1, =0xfffffead - adds r0, r6, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7 - bhi _081AB5BE - ldr r1, =gUnknown_08DC6378 - subs r3, r7, 0x1 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x10 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0x8 - bl BlitBitmapToWindow -_081AB5BE: - ldrb r0, [r5, 0x5] - cmp r0, 0x3 - bne _081AB610 - ldr r0, =gStringVar1 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x77 - bl GetStringRightAlignXOffset - lsls r3, r0, 24 - lsrs r3, 24 - str r7, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0xFF - str r0, [sp, 0xC] - str r1, [sp, 0x10] - b _081AB652 - .pool -_081AB610: - cmp r0, 0x4 - beq _081AB66C - adds r0, r6, 0 - bl itemid_is_unique - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081AB66C - ldr r0, =gStringVar1 - mov r1, r9 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x77 - bl GetStringRightAlignXOffset - lsls r3, r0, 24 - lsrs r3, 24 - str r7, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0xFF - str r0, [sp, 0xC] - str r5, [sp, 0x10] -_081AB652: - mov r0, r8 - movs r1, 0x7 - adds r2, r4, 0 - bl bag_menu_print - b _081AB696 - .pool -_081AB66C: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00000496 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _081AB696 - cmp r0, r6 - bne _081AB696 - ldr r1, =gUnknown_086140A4 - subs r3, r7, 0x1 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x18 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0x60 - bl BlitBitmapToWindow -_081AB696: - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AB520 - - thumb_func_start bag_menu_print_description_box_text -@ void bag_menu_print_description_box_text(int a1) -bag_menu_print_description_box_text: @ 81AB6B0 - push {r4,lr} - sub sp, 0x14 - adds r1, r0, 0 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _081AB6E0 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - bl BagGetItemIdByPocketPosition - lsls r0, 16 - lsrs r0, 16 - bl ItemId_GetDescription - adds r4, r0, 0 - b _081AB6FC - .pool -_081AB6E0: - ldr r0, =gStringVar1 - ldr r2, =gUnknown_085E9180 - ldr r1, =gUnknown_0203CE58 - ldrb r1, [r1, 0x4] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E91C0 - adds r0, r4, 0 - bl StringExpandPlaceholders -_081AB6FC: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_description_box_text - - thumb_func_start bag_menu_print_cursor_ -bag_menu_print_cursor_: @ 81AB73C - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - bl ListMenuGetYCoordForPrintingArrowCursor - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl bag_menu_print_cursor - pop {r4} - pop {r0} - bx r0 - thumb_func_end bag_menu_print_cursor_ - - thumb_func_start bag_menu_print_cursor -bag_menu_print_cursor: @ 81AB75C - push {r4,r5,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0xFF - bne _081AB798 - movs r0, 0x1 - movs r1, 0 - bl GetMenuCursorDimensionByFont - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - str r4, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - adds r3, r5, 0 - bl FillWindowPixelRect - b _081AB7AE -_081AB798: - ldr r2, =gUnknown_085E8D60 - str r5, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x1 - movs r3, 0 - bl bag_menu_print -_081AB7AE: - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_cursor - - thumb_func_start bag_menu_add_pocket_scroll_arrow_indicators_maybe -bag_menu_add_pocket_scroll_arrow_indicators_maybe: @ 81AB7BC - push {r4-r6,lr} - sub sp, 0x10 - ldr r5, =gUnknown_0203CE54 - ldr r4, [r5] - ldr r1, =0x0000081e - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081AB80A - ldr r2, =gUnknown_0203CE58 - ldrb r3, [r2, 0x5] - ldr r6, =0x00000829 - adds r0, r4, r6 - adds r0, r3 - ldrb r1, [r0] - adds r6, 0x5 - adds r0, r4, r6 - adds r0, r3 - ldrb r0, [r0] - subs r1, r0 - str r1, [sp] - movs r0, 0x6E - str r0, [sp, 0x4] - str r0, [sp, 0x8] - ldrb r0, [r2, 0x5] - lsls r0, 1 - adds r2, 0x12 - adds r0, r2 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0xAC - movs r2, 0xC - movs r3, 0x94 - bl AddScrollIndicatorArrowPairParametrized - ldr r1, [r5] - ldr r2, =0x0000081e - adds r1, r2 - strb r0, [r1] -_081AB80A: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_add_pocket_scroll_arrow_indicators_maybe - - thumb_func_start sub_81AB824 -sub_81AB824: @ 81AB824 - push {r4,lr} - ldr r4, =gUnknown_0203CE54 - ldr r0, [r4] - ldr r2, =0x0000081e - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081AB842 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r1, =0x0000081e - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_081AB842: - bl sub_81AB89C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AB824 - - thumb_func_start bag_menu_add_list_scroll_arrow_indicators_maybe -bag_menu_add_list_scroll_arrow_indicators_maybe: @ 81AB854 - push {r4,lr} - ldr r4, =gUnknown_0203CE54 - ldr r2, [r4] - ldr r1, =0x0000081b - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - beq _081AB882 - ldr r1, =0x0000081f - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081AB882 - ldr r0, =gUnknown_08614094 - ldr r1, =gUnknown_0203CE5E - bl AddScrollIndicatorArrowPair - ldr r1, [r4] - ldr r2, =0x0000081f - adds r1, r2 - strb r0, [r1] -_081AB882: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_add_list_scroll_arrow_indicators_maybe - - thumb_func_start sub_81AB89C -sub_81AB89C: @ 81AB89C - push {r4,lr} - ldr r4, =gUnknown_0203CE54 - ldr r0, [r4] - ldr r2, =0x0000081f - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081AB8BA - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r1, =0x0000081f - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_081AB8BA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AB89C - - thumb_func_start free_bag_item_list_buffers -free_bag_item_list_buffers: @ 81AB8C8 - push {lr} - ldr r0, =gUnknown_0203CE78 - ldr r0, [r0] - bl Free - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - bl Free - pop {r0} - bx r0 - .pool - thumb_func_end free_bag_item_list_buffers - - thumb_func_start unknown_ItemMenu_Confirm -unknown_ItemMenu_Confirm: @ 81AB8F8 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_close_bag_menu_2 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_ItemMenu_Confirm - - thumb_func_start task_close_bag_menu_2 -task_close_bag_menu_2: @ 81AB930 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r2, r0, r1 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081AB9A0 - ldrb r0, [r2] - ldr r4, =gUnknown_0203CE58 - ldrb r2, [r4, 0x5] - lsls r2, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r1, r2, r1 - adds r3, r4, 0 - adds r3, 0x8 - adds r2, r3 - bl sub_81AE6C8 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r0, [r0] - cmp r0, 0 - beq _081AB984 - bl SetMainCallback2 - b _081AB98A - .pool -_081AB984: - ldr r0, [r4] - bl SetMainCallback2 -_081AB98A: - bl sub_81AB824 - bl ResetSpriteData - bl FreeAllSpritePalettes - bl free_bag_item_list_buffers - adds r0, r5, 0 - bl DestroyTask -_081AB9A0: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_close_bag_menu_2 - - thumb_func_start sub_81AB9A8 -sub_81AB9A8: @ 81AB9A8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, r5, 3 - ldr r0, =gBagPockets - adds r4, r1, r0 - cmp r5, 0x3 - bgt _081AB9C8 - cmp r5, 0x2 - blt _081AB9C8 - adds r0, r4, 0 - bl sub_80D6FB4 - b _081AB9CE - .pool -_081AB9C8: - adds r0, r4, 0 - bl sub_80D6F64 -_081AB9CE: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - ldr r6, =0x00000829 - adds r1, r6 - adds r1, r5 - movs r2, 0 - strb r2, [r1] - adds r3, r0, 0 - ldrb r0, [r4, 0x4] - cmp r2, r0 - bcs _081ABA12 - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _081ABA12 - adds r7, r3, 0 -_081AB9EE: - ldr r0, [r7] - adds r0, r6 - adds r0, r5 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldrb r1, [r4, 0x4] - cmp r2, r1 - bcs _081ABA12 - ldr r0, [r4] - lsls r1, r2, 2 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - bne _081AB9EE -_081ABA12: - ldr r2, [r3] - ldr r1, =0x0000081b - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081ABA2E - ldr r0, =0x00000829 - adds r1, r2, r0 - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081ABA2E: - ldr r1, [r3] - ldr r2, =0x00000829 - adds r0, r1, r2 - adds r0, r5 - ldrb r2, [r0] - cmp r2, 0x8 - bls _081ABA58 - ldr r3, =0x0000082e - adds r0, r1, r3 - adds r0, r5 - movs r1, 0x8 - strb r1, [r0] - b _081ABA60 - .pool -_081ABA58: - ldr r3, =0x0000082e - adds r0, r1, r3 - adds r0, r5 - strb r2, [r0] -_081ABA60: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AB9A8 - - thumb_func_start sub_81ABA6C -sub_81ABA6C: @ 81ABA6C - push {r4,lr} - movs r4, 0 -_081ABA70: - adds r0, r4, 0 - bl sub_81AB9A8 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _081ABA70 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81ABA6C - - thumb_func_start sub_81ABA88 -sub_81ABA88: @ 81ABA88 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - ldr r2, =gUnknown_0203CE6A - adds r4, r1, r2 - subs r2, 0xA - adds r1, r2 - ldr r2, =gUnknown_0203CE54 - ldr r3, [r2] - ldr r5, =0x0000082e - adds r2, r3, r5 - adds r2, r0 - ldrb r2, [r2] - subs r5, 0x5 - adds r3, r5 - adds r3, r0 - ldrb r3, [r3] - adds r0, r4, 0 - bl sub_812225C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ABA88 - - thumb_func_start sub_81ABAC4 -sub_81ABAC4: @ 81ABAC4 - push {r4,lr} - movs r4, 0 -_081ABAC8: - adds r0, r4, 0 - bl sub_81ABA88 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _081ABAC8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81ABAC4 - - thumb_func_start sub_81ABAE0 -sub_81ABAE0: @ 81ABAE0 - push {r4-r7,lr} - sub sp, 0x4 - movs r5, 0 - ldr r6, =gUnknown_0203CE6A - adds r7, r6, 0 - subs r7, 0xA -_081ABAEC: - lsls r1, r5, 1 - adds r0, r1, r6 - adds r1, r7 - ldr r2, =gUnknown_0203CE54 - ldr r3, [r2] - ldr r4, =0x0000082e - adds r2, r3, r4 - adds r2, r5 - ldrb r2, [r2] - subs r4, 0x5 - adds r3, r4 - adds r3, r5 - ldrb r3, [r3] - movs r4, 0x8 - str r4, [sp] - bl sub_8122298 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _081ABAEC - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ABAE0 - - thumb_func_start sub_81ABB2C -sub_81ABB2C: @ 81ABB2C - lsls r0, 24 - ldr r1, =gUnknown_0203CE58 - lsrs r0, 23 - adds r2, r1, 0 - adds r2, 0x12 - adds r2, r0, r2 - adds r1, 0x8 - adds r0, r1 - ldrb r0, [r0] - ldrb r2, [r2] - adds r0, r2 - lsls r0, 24 - lsrs r0, 24 - bx lr - .pool - thumb_func_end sub_81ABB2C - - thumb_func_start DisplayItemMessage -@ void DisplayItemMessage(u8 taskId, u8 fontId, u8 *str, void ( *callback)(u8 taskId)) -DisplayItemMessage: @ 81ABB4C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x10 - adds r5, r0, 0 - adds r6, r1, 0 - mov r8, r2 - mov r9, r3 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - movs r0, 0x4 - bl AddItemMessageWindow - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x14] - movs r1, 0x11 - bl FillWindowPixelBuffer - bl sav2_get_text_speed - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r4, 0x14] - str r6, [sp] - str r0, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - adds r0, r5, 0 - movs r2, 0xA - movs r3, 0xD - bl DisplayMessageAndContinueTask - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DisplayItemMessage - - thumb_func_start bag_menu_inits_lists_menu -bag_menu_inits_lists_menu: @ 81ABBBC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r5, r6, 2 - adds r5, r6 - lsls r5, 3 - ldr r0, =gTasks + 0x8 - adds r5, r0 - ldr r7, =gUnknown_0203CE58 - ldrb r4, [r7, 0x5] - lsls r4, 1 - movs r0, 0x12 - adds r0, r7 - mov r8, r0 - add r8, r4 - adds r0, r7, 0 - adds r0, 0x8 - adds r4, r0 - movs r0, 0x4 - bl bag_menu_RemoveBagItem_message_window - ldrb r0, [r5] - mov r1, r8 - adds r2, r4, 0 - bl sub_81AE6C8 - ldrb r0, [r7, 0x5] - bl sub_81AB9A8 - ldrb r0, [r7, 0x5] - bl sub_81ABA88 - ldrb r0, [r7, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - mov r2, r8 - ldrh r1, [r2] - ldrh r2, [r4] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl set_callback3_to_bag - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_inits_lists_menu - - thumb_func_start sub_81ABC3C -sub_81ABC3C: @ 81ABC3C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl bag_menu_add_window - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_81ABC54 - pop {r0} - bx r0 - thumb_func_end sub_81ABC3C - - thumb_func_start sub_81ABC54 -sub_81ABC54: @ 81ABC54 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - movs r3, 0x2 - cmp r0, 0x3 - bne _081ABC6C - movs r3, 0x3 -_081ABC6C: - ldr r0, =gStringVar1 - lsls r1, 16 - asrs r1, 16 - movs r2, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x28 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x2 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl Print - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ABC54 - - thumb_func_start sub_81ABCC0 -sub_81ABCC0: @ 81ABCC0 - push {r4-r7,lr} - sub sp, 0xC - adds r4, r0, 0 - adds r7, r2, 0 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - movs r3, 0x2 - cmp r0, 0x3 - bne _081ABCD4 - movs r3, 0x3 -_081ABCD4: - ldr r0, =gStringVar1 - movs r2, 0x2 - bl ConvertIntToDecimalStringN - ldr r6, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r6, 0 - bl StringExpandPlaceholders - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r6, 0 - movs r3, 0 - bl Print - str r5, [sp] - adds r0, r4, 0 - movs r1, 0x26 - movs r2, 0x1 - adds r3, r7, 0 - bl PrintMoneyAmount - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ABCC0 - - thumb_func_start Task_BagMenu -Task_BagMenu: @ 81ABD28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - str r0, [sp] - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - ldr r5, =gUnknown_0203CE58 - ldrb r0, [r5, 0x5] - lsls r0, 1 - adds r1, r5, 0 - adds r1, 0x12 - adds r7, r0, r1 - subs r1, 0xA - adds r0, r1 - mov r8, r0 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ABD66 - b _081ABEB2 -_081ABD66: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081ABD74 - b _081ABEB2 -_081ABD74: - bl GetSwitchBagPocketDirection - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081ABDB8 - cmp r0, 0x2 - beq _081ABDC0 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - cmp r0, 0 - beq _081ABE10 - bl sub_81AC2C0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081ABDA4 - b _081ABEB2 -_081ABDA4: - b _081ABDCC - .pool -_081ABDB8: - movs r1, 0x1 - negs r1, r1 - mov r0, r9 - b _081ABDC4 -_081ABDC0: - mov r0, r9 - movs r1, 0x1 -_081ABDC4: - movs r2, 0 - bl SwitchBagPocket - b _081ABEB2 -_081ABDCC: - ldrb r0, [r6] - adds r1, r7, 0 - mov r2, r8 - bl get_coro_args_x18_x1A - ldrh r2, [r7] - mov r3, r8 - ldrh r0, [r3] - adds r2, r0 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =gUnknown_0203CE58 - ldr r3, =0x00000829 - adds r0, r3 - ldrb r1, [r1, 0x5] - adds r0, r1 - ldrb r0, [r0] - subs r0, 0x1 - cmp r2, r0 - beq _081ABEB2 - movs r0, 0x5 - bl PlaySE - mov r0, r9 - bl bag_menu_swap_items - b _081ABEB2 - .pool -_081ABE10: - ldrb r0, [r6] - bl ListMenuHandleInput - adds r4, r0, 0 - ldrb r0, [r6] - adds r1, r7, 0 - mov r2, r8 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081ABE32 - adds r0, 0x1 - cmp r4, r0 - bne _081ABE68 - b _081ABEB2 -_081ABE32: - ldrb r0, [r5, 0x4] - cmp r0, 0x5 - bne _081ABE40 - movs r0, 0x20 - bl PlaySE - b _081ABEB2 -_081ABE40: - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CE7C - mov r1, r10 - strh r1, [r0] - ldr r0, =gTasks + 0x8 - subs r0, 0x8 - ldr r3, [sp] - adds r0, r3, r0 - ldr r1, =unknown_ItemMenu_Confirm - str r1, [r0] - b _081ABEB2 - .pool -_081ABE68: - movs r0, 0x5 - bl PlaySE - bl sub_81AB824 - ldrb r0, [r6] - movs r1, 0x2 - bl bag_menu_print_cursor_ - strh r4, [r6, 0x2] - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 16 - lsrs r4, 16 - adds r1, r4, 0 - bl BagGetQuantityByPocketPosition - strh r0, [r6, 0x4] - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl BagGetItemIdByPocketPosition - ldr r1, =gUnknown_0203CE7C - strh r0, [r1] - ldr r1, =gUnknown_08614054 - ldrb r0, [r5, 0x4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - mov r0, r9 - bl _call_via_r1 -_081ABEB2: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end Task_BagMenu - - thumb_func_start set_callback3_to_bag -set_callback3_to_bag: @ 81ABECC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl bag_menu_add_pocket_scroll_arrow_indicators_maybe - bl bag_menu_add_list_scroll_arrow_indicators_maybe - movs r0, 0x3 - bl ClearWindowTilemap - movs r0, 0x4 - bl ClearWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =Task_BagMenu - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end set_callback3_to_bag - - thumb_func_start GetSwitchBagPocketDirection -GetSwitchBagPocketDirection: @ 81ABF10 - push {lr} - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x0000081b - adds r0, r1 - ldrb r1, [r0] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _081ABF6A - bl GetLRKeysState - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081ABF3C - cmp r2, 0x1 - bne _081ABF54 -_081ABF3C: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - b _081ABF6C - .pool -_081ABF54: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081ABF60 - cmp r2, 0x2 - bne _081ABF6A -_081ABF60: - movs r0, 0x5 - bl PlaySE - movs r0, 0x2 - b _081ABF6C -_081ABF6A: - movs r0, 0 -_081ABF6C: - pop {r1} - bx r1 - thumb_func_end GetSwitchBagPocketDirection - - thumb_func_start ChangeBagPocketId -@ void ChangeBagPocketId(u8 *bagPocketId, u8 deltaBagPocketId) -ChangeBagPocketId: @ 81ABF70 - push {r4,lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - asrs r1, 24 - cmp r1, 0x1 - bne _081ABF88 - ldrb r0, [r2] - cmp r0, 0x4 - bne _081ABF88 - movs r0, 0 - b _081ABFA0 -_081ABF88: - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - ldrb r3, [r2] - cmp r0, r1 - bne _081ABF9E - cmp r3, 0 - bne _081ABF9E - movs r0, 0x4 - b _081ABFA0 -_081ABF9E: - adds r0, r3, r4 -_081ABFA0: - strb r0, [r2] - pop {r4} - pop {r0} - bx r0 - thumb_func_end ChangeBagPocketId - - thumb_func_start SwitchBagPocket -@ void SwitchBagPocket(u8 taskId, u16 deltaBagPocketId, u16 a3) -SwitchBagPocket: @ 81ABFA8 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 16 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r0, 0 - strh r0, [r4, 0x1A] - strh r0, [r4, 0x18] - strh r5, [r4, 0x16] - cmp r2, 0 - bne _081AC026 - movs r0, 0 - bl ClearWindowTilemap - movs r0, 0x1 - bl ClearWindowTilemap - ldrb r0, [r4] - ldr r3, =gUnknown_0203CE58 - ldrb r2, [r3, 0x5] - lsls r2, 1 - adds r1, r3, 0 - adds r1, 0x12 - adds r1, r2, r1 - adds r3, 0x8 - adds r2, r3 - bl sub_81AE6C8 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r3, =gSprites - ldr r0, =gUnknown_0203CE54 - ldr r2, [r0] - ldr r1, =0x0000081b - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 26 - lsrs r1, 30 - movs r0, 0x1 - eors r0, r1 - adds r2, r0 - ldr r0, =0x00000806 - adds r2, r0 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - bl sub_81AB824 -_081AC026: - ldr r4, =gUnknown_0203CE58 - ldrb r1, [r4, 0x5] - add r0, sp, 0x8 - strb r1, [r0] - lsls r1, r5, 24 - asrs r1, 24 - bl ChangeBagPocketId - lsls r0, r5, 16 - asrs r1, r0, 16 - adds r5, r0, 0 - cmp r1, 0x1 - bne _081AC07C - ldr r2, =gUnknown_085E91FC - ldrb r0, [r4, 0x5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - add r1, sp, 0x8 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl bag_menu_print_pocket_names - movs r0, 0 - bl bag_menu_copy_pocket_name_to_window - b _081AC09A - .pool -_081AC07C: - ldr r2, =gUnknown_085E91FC - add r0, sp, 0x8 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ldrb r1, [r4, 0x5] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl bag_menu_print_pocket_names - movs r0, 0x8 - bl bag_menu_copy_pocket_name_to_window -_081AC09A: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - movs r1, 0 - bl bag_menu_draw_pocket_indicator_square - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x1 - bl bag_menu_draw_pocket_indicator_square - movs r0, 0xF - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - movs r0, 0x2 - movs r1, 0xB - movs r2, 0xE - movs r3, 0x2 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x1 - bl SetBagVisualPocketId - movs r0, 0x1 - bl RemoveBagObject - asrs r0, r5, 16 - bl AddSwitchPocketRotatingBallObject - ldr r1, =sub_81AC10C - ldr r2, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r2 - ldr r2, [r0] - adds r0, r6, 0 - bl SetTaskFuncWithFollowupFunc - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end SwitchBagPocket - - thumb_func_start sub_81AC10C -sub_81AC10C: @ 81AC10C - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - bne _081AC184 - bl IsWallysBag - lsls r0, 24 - cmp r0, 0 - bne _081AC184 - bl GetSwitchBagPocketDirection - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AC148 - cmp r0, 0x2 - beq _081AC164 - b _081AC184 - .pool -_081AC148: - ldr r0, =gUnknown_0203CE5D - movs r1, 0x16 - ldrsb r1, [r6, r1] - bl ChangeBagPocketId - adds r0, r7, 0 - bl SwitchTaskToFollowupFunc - movs r1, 0x1 - negs r1, r1 - adds r0, r7, 0 - b _081AC178 - .pool -_081AC164: - ldr r0, =gUnknown_0203CE5D - movs r1, 0x16 - ldrsb r1, [r6, r1] - bl ChangeBagPocketId - adds r0, r7, 0 - bl SwitchTaskToFollowupFunc - adds r0, r7, 0 - movs r1, 0x1 -_081AC178: - movs r2, 0x1 - bl SwitchBagPocket - b _081AC22E - .pool -_081AC184: - movs r1, 0x1A - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _081AC192 - cmp r0, 0x1 - beq _081AC1DC - b _081AC22E -_081AC192: - ldrb r0, [r6, 0x18] - bl sub_81AC23C - ldrh r0, [r6, 0x18] - adds r1, r0, 0x1 - strh r1, [r6, 0x18] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081AC1CC - movs r2, 0x16 - ldrsh r0, [r6, r2] - cmp r0, 0x1 - bne _081AC1BC - lsls r0, r1, 16 - asrs r0, 17 - lsls r0, 24 - lsrs r0, 24 - bl bag_menu_copy_pocket_name_to_window - b _081AC1CC -_081AC1BC: - lsls r1, 16 - asrs r1, 17 - movs r0, 0x8 - subs r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl bag_menu_copy_pocket_name_to_window -_081AC1CC: - movs r1, 0x18 - ldrsh r0, [r6, r1] - cmp r0, 0x10 - bne _081AC22E - ldrh r0, [r6, 0x1A] - adds r0, 0x1 - strh r0, [r6, 0x1A] - b _081AC22E -_081AC1DC: - ldr r4, =gUnknown_0203CE5D - movs r1, 0x16 - ldrsb r1, [r6, r1] - adds r0, r4, 0 - bl ChangeBagPocketId - subs r5, r4, 0x5 - ldrb r0, [r5, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - ldrb r2, [r5, 0x5] - lsls r2, 1 - adds r1, r4, 0 - adds r1, 0xD - adds r1, r2, r1 - ldrh r1, [r1] - adds r4, 0x3 - adds r2, r4 - ldrh r2, [r2] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6] - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - bl bag_menu_add_pocket_scroll_arrow_indicators_maybe - bl bag_menu_add_list_scroll_arrow_indicators_maybe - adds r0, r7, 0 - bl SwitchTaskToFollowupFunc -_081AC22E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AC10C - - thumb_func_start sub_81AC23C -sub_81AC23C: @ 81AC23C - push {lr} - sub sp, 0x8 - adds r3, r0, 0 - lsls r3, 24 - movs r0, 0x80 - lsls r0, 18 - adds r3, r0 - lsrs r3, 24 - movs r0, 0xF - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x2 - movs r1, 0x11 - movs r2, 0xE - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_81AC23C - - thumb_func_start bag_menu_draw_pocket_indicator_square -@ void bag_menu_draw_pocket_indicator_square(char x, int is_current_bag) -bag_menu_draw_pocket_indicator_square: @ 81AC26C - push {lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - cmp r1, 0 - bne _081AC298 - ldr r1, =0x00001017 - adds r2, r0, 0x5 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x2 - movs r3, 0x3 - bl FillBgTilemapBufferRect_Palette0 - b _081AC2AE - .pool -_081AC298: - ldr r1, =0x0000102b - adds r2, r0, 0x5 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x2 - movs r3, 0x3 - bl FillBgTilemapBufferRect_Palette0 -_081AC2AE: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_draw_pocket_indicator_square - - thumb_func_start sub_81AC2C0 -sub_81AC2C0: @ 81AC2C0 - push {lr} - ldr r1, =gUnknown_0203CE58 - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - bhi _081AC2E0 - ldrb r0, [r1, 0x5] - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _081AC2E0 - movs r0, 0x1 - b _081AC2E2 - .pool -_081AC2E0: - movs r0, 0 -_081AC2E2: - pop {r1} - bx r1 - thumb_func_end sub_81AC2C0 - - thumb_func_start bag_menu_swap_items -bag_menu_swap_items: @ 81AC2E8 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - mov r9, r0 - adds r6, r4, r0 - ldrb r0, [r6] - movs r1, 0x10 - movs r2, 0x1 - bl sub_81AF15C - ldr r3, =gUnknown_0203CE58 - ldrb r0, [r3, 0x5] - lsls r0, 1 - adds r2, r3, 0 - adds r2, 0x12 - adds r2, r0, r2 - adds r1, r3, 0 - adds r1, 0x8 - adds r0, r1 - ldrh r1, [r0] - ldrh r2, [r2] - adds r1, r2 - strh r1, [r6, 0x2] - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r2, =0x0000081a - adds r0, r2 - movs r5, 0 - strb r1, [r0] - ldrb r0, [r3, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x2] - bl BagGetItemIdByPocketPosition - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar4 - mov r8, r0 - ldr r1, =gUnknown_085E8DFE - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - str r5, [sp, 0xC] - str r5, [sp, 0x10] - movs r1, 0x1 - mov r2, r8 - movs r3, 0x3 - bl bag_menu_print - ldrb r0, [r6, 0x2] - bl sub_80D4FEC - bl sub_81AB89C - ldrb r0, [r6] - movs r1, 0x2 - bl bag_menu_print_cursor_ - movs r2, 0x8 - negs r2, r2 - add r9, r2 - add r4, r9 - ldr r0, =sub_81AC3C0 - str r0, [r4] - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_swap_items - - thumb_func_start sub_81AC3C0 -@ void sub_81AC3C0(u8 taskId) -sub_81AC3C0: @ 81AC3C0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AC48E - ldr r0, =gMain - mov r8, r0 - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081AC418 - movs r0, 0x5 - bl PlaySE - ldrb r0, [r4] - ldr r3, =gUnknown_0203CE58 - ldrb r2, [r3, 0x5] - lsls r2, 1 - adds r1, r3, 0 - adds r1, 0x12 - adds r1, r2, r1 - adds r3, 0x8 - adds r2, r3 - bl get_coro_args_x18_x1A - b _081AC472 - .pool -_081AC418: - ldrb r0, [r4] - bl ListMenuHandleInput - adds r7, r0, 0 - ldrb r0, [r4] - ldr r5, =gUnknown_0203CE58 - ldrb r2, [r5, 0x5] - lsls r2, 1 - adds r1, r5, 0 - adds r1, 0x12 - adds r1, r2, r1 - adds r4, r5, 0 - adds r4, 0x8 - adds r2, r4 - bl get_coro_args_x18_x1A - movs r0, 0 - bl sub_80D4FC8 - ldrb r0, [r5, 0x5] - lsls r0, 1 - adds r0, r4 - ldrb r0, [r0] - bl sub_80D4FEC - movs r0, 0x2 - negs r0, r0 - cmp r7, r0 - beq _081AC460 - adds r0, 0x1 - cmp r7, r0 - bne _081AC482 - b _081AC48E - .pool -_081AC460: - movs r0, 0x5 - bl PlaySE - mov r0, r8 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AC47A -_081AC472: - adds r0, r6, 0 - bl sub_81AC498 - b _081AC48E -_081AC47A: - adds r0, r6, 0 - bl sub_81AC590 - b _081AC48E -_081AC482: - movs r0, 0x5 - bl PlaySE - adds r0, r6, 0 - bl sub_81AC498 -_081AC48E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81AC3C0 - - thumb_func_start sub_81AC498 -sub_81AC498: @ 81AC498 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - mov r10, r0 - ldr r0, =gTasks + 0x8 - add r0, r10 - mov r9, r0 - ldr r5, =gUnknown_0203CE58 - ldrb r6, [r5, 0x5] - lsls r1, r6, 1 - adds r0, r5, 0 - adds r0, 0x12 - adds r0, r1 - mov r8, r0 - ldr r2, =gUnknown_0203CE60 - adds r7, r1, r2 - ldrh r0, [r7] - mov r1, r8 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - mov r0, r9 - movs r1, 0x2 - ldrsh r2, [r0, r1] - cmp r2, r4 - beq _081AC4E2 - subs r0, r4, 0x1 - cmp r2, r0 - bne _081AC4F8 -_081AC4E2: - adds r0, r3, 0 - bl sub_81AC590 - b _081AC566 - .pool -_081AC4F8: - ldr r1, =gBagPockets - lsls r0, r6, 3 - adds r0, r1 - ldr r0, [r0] - adds r1, r2, 0 - adds r2, r4, 0 - bl sub_80D702C - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r2, =0x0000081a - adds r0, r2 - movs r1, 0xFF - strb r1, [r0] - mov r1, r9 - ldrb r0, [r1] - mov r1, r8 - adds r2, r7, 0 - bl sub_81AE6C8 - mov r2, r9 - movs r1, 0x2 - ldrsh r0, [r2, r1] - cmp r0, r4 - bge _081AC538 - ldrb r1, [r5, 0x5] - lsls r1, 1 - ldr r2, =gUnknown_0203CE60 - adds r1, r2 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] -_081AC538: - ldrb r0, [r5, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - mov r2, r8 - ldrh r1, [r2] - ldrh r2, [r7] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - mov r1, r9 - strh r0, [r1] - movs r0, 0x1 - bl sub_80D4FC8 - bl bag_menu_add_list_scroll_arrow_indicators_maybe - ldr r0, =gTasks + 0x8 - subs r0, 0x8 - add r0, r10 - ldr r1, =Task_BagMenu - str r1, [r0] -_081AC566: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AC498 - - thumb_func_start sub_81AC590 -sub_81AC590: @ 81AC590 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - mov r9, r1 - ldr r0, =gTasks + 0x8 - mov r10, r0 - mov r7, r9 - add r7, r10 - ldr r4, =gUnknown_0203CE58 - ldrb r0, [r4, 0x5] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r6, r0, r1 - movs r1, 0x8 - adds r1, r4 - mov r8, r1 - adds r5, r0, r1 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x0000081a - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrb r0, [r7] - adds r1, r6, 0 - adds r2, r5, 0 - bl sub_81AE6C8 - movs r0, 0x2 - ldrsh r2, [r7, r0] - ldrh r0, [r6] - ldrh r1, [r5] - adds r0, r1 - cmp r2, r0 - bge _081AC5F2 - ldrb r1, [r4, 0x5] - lsls r1, 1 - add r1, r8 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] -_081AC5F2: - ldrb r0, [r4, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - ldrh r1, [r6] - ldrh r2, [r5] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7] - movs r0, 0x1 - bl sub_80D4FC8 - bl bag_menu_add_list_scroll_arrow_indicators_maybe - mov r0, r10 - subs r0, 0x8 - add r0, r9 - ldr r1, =Task_BagMenu - str r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AC590 - - thumb_func_start sub_81AC644 -sub_81AC644: @ 81AC644 - push {r4,r5,lr} - sub sp, 0x14 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x4] - subs r0, 0x1 - cmp r0, 0x9 - bls _081AC654 - b _081AC82C -_081AC654: - lsls r0, 2 - ldr r1, =_081AC668 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AC668: - .4byte _081AC690 - .4byte _081AC82C - .4byte _081AC82C - .4byte _081AC82C - .4byte _081AC6E8 - .4byte _081AC82C - .4byte _081AC76C - .4byte _081AC7CC - .4byte _081AC70C - .4byte _081AC690 -_081AC690: - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl ItemId_GetBattleUsage - lsls r0, 24 - cmp r0, 0 - beq _081AC6C4 - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614042 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC6C4: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC6E8: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614047 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - b _081ACA10 - .pool -_081AC70C: - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AC748 - ldrh r0, [r4] - cmp r0, 0xAF - beq _081AC748 - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_0861404B - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC748: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC76C: - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AC7A8 - ldrh r0, [r4] - cmp r0, 0xAF - beq _081AC7A8 - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_0861404D - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC7A8: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC7CC: - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AC808 - ldrh r0, [r4] - cmp r0, 0xAF - beq _081AC808 - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_0861404F - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC808: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC82C: - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AC840 - bl InUnionRoom - cmp r0, 0x1 - bne _081AC8A4 -_081AC840: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - beq _081AC856 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl sub_8122148 - lsls r0, 24 - cmp r0, 0 - bne _081AC880 -_081AC856: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC880: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614044 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC8A4: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - bls _081AC8AE - b _081ACA12 -_081AC8AE: - lsls r0, 2 - ldr r1, =_081AC8C0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AC8C0: - .4byte _081AC8D4 - .4byte _081AC9B4 - .4byte _081AC9D8 - .4byte _081AC9FC - .4byte _081AC92C -_081AC8D4: - ldr r4, =gUnknown_0203CE54 - ldr r1, [r4] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r3, =0x00000824 - adds r0, r1, r3 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - strb r0, [r1] - ldr r0, [r4] - adds r0, r3 - ldr r1, =gUnknown_0861402C - movs r2, 0x4 - bl memcpy - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AC90A - b _081ACA12 -_081AC90A: - ldr r0, [r4] - ldr r1, =0x00000824 - adds r0, r1 - movs r1, 0x6 - strb r1, [r0] - b _081ACA12 - .pool -_081AC92C: - ldr r4, =gUnknown_0203CE54 - ldr r1, [r4] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r5, =0x00000824 - adds r0, r1, r5 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - strb r0, [r1] - ldr r0, [r4] - adds r0, r5 - ldr r1, =gUnknown_08614030 - movs r2, 0x4 - bl memcpy - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00000496 - adds r0, r1 - ldr r2, =gUnknown_0203CE7C - ldrh r0, [r0] - ldrh r1, [r2] - cmp r0, r1 - bne _081AC96C - ldr r0, [r4] - ldr r1, =0x00000825 - adds r0, r1 - movs r1, 0x8 - strb r1, [r0] -_081AC96C: - ldrh r1, [r2] - ldr r0, =0x00000103 - cmp r1, r0 - beq _081AC97A - adds r0, 0xD - cmp r1, r0 - bne _081ACA12 -_081AC97A: - movs r0, 0x6 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _081ACA12 - ldr r0, [r4] - adds r0, r5 - movs r1, 0x7 - strb r1, [r0] - b _081ACA12 - .pool -_081AC9B4: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614034 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - b _081ACA10 - .pool -_081AC9D8: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614038 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - b _081ACA10 - .pool -_081AC9FC: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_0861403C - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x6 -_081ACA10: - strb r0, [r1] -_081ACA12: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x2 - bne _081ACA50 - movs r0, 0x1 - bl ClearWindowTilemap - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl PrintTMHMMoveData - movs r0, 0x3 - bl PutWindowTilemap - movs r0, 0x4 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - b _081ACA86 - .pool -_081ACA50: - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DBE - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print -_081ACA86: - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000828 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081ACAB0 - movs r0, 0 - b _081ACAB6 - .pool -_081ACAB0: - cmp r0, 0x2 - bne _081ACAC4 - movs r0, 0x1 -_081ACAB6: - bl bag_menu_add_window - lsls r0, 24 - lsrs r0, 24 - bl sub_81ACAF8 - b _081ACAEE -_081ACAC4: - cmp r0, 0x4 - bne _081ACADC - movs r0, 0x2 - bl bag_menu_add_window - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - movs r2, 0x2 - bl sub_81ACB54 - b _081ACAEE -_081ACADC: - movs r0, 0x3 - bl bag_menu_add_window - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - movs r2, 0x3 - bl sub_81ACB54 -_081ACAEE: - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81AC644 - - thumb_func_start sub_81ACAF8 -sub_81ACAF8: @ 81ACAF8 - push {r4-r6,lr} - sub sp, 0x14 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - ldr r6, =gUnknown_0203CE54 - ldr r1, [r6] - ldr r5, =0x00000828 - adds r0, r1, r5 - ldrb r0, [r0] - str r0, [sp, 0x8] - ldr r0, =gUnknown_08613FB4 - str r0, [sp, 0xC] - movs r0, 0x82 - lsls r0, 4 - adds r1, r0 - ldr r0, [r1] - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x7 - movs r2, 0x8 - movs r3, 0x1 - bl AddItemMenuActionTextPrinters - ldr r0, [r6] - adds r0, r5 - ldrb r1, [r0] - adds r0, r4, 0 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ACAF8 - - thumb_func_start sub_81ACB54 -sub_81ACB54: @ 81ACB54 - push {r4-r6,lr} - sub sp, 0x14 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0x38 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - ldr r0, =gUnknown_08613FB4 - str r0, [sp, 0xC] - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - movs r1, 0x82 - lsls r1, 4 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x7 - movs r2, 0x8 - movs r3, 0x1 - bl sub_8198DBC - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x38 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_8199944 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ACB54 - - thumb_func_start unknown_item_menu_type -unknown_item_menu_type: @ 81ACBB0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_81AC644 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000828 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - bhi _081ACBE8 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =Task_HandleInBattleItemMenuInput - b _081ACBF4 - .pool -_081ACBE8: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =Task_HandleOutOfBattleItemMenuInput -_081ACBF4: - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_item_menu_type - - thumb_func_start Task_HandleInBattleItemMenuInput -Task_HandleInBattleItemMenuInput: @ 81ACC04 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081ACC6A - bl ProcessMenuInputNoWrapAround - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081ACC6A - adds r0, 0x1 - cmp r4, r0 - bne _081ACC44 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_08613FB4 - ldr r1, [r0, 0x24] - adds r0, r5, 0 - bl _call_via_r1 - b _081ACC6A - .pool -_081ACC44: - movs r0, 0x5 - bl PlaySE - ldr r1, =gUnknown_08613FB4 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - movs r2, 0x82 - lsls r2, 4 - adds r0, r2 - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 -_081ACC6A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end Task_HandleInBattleItemMenuInput - - thumb_func_start Task_HandleOutOfBattleItemMenuInput -Task_HandleOutOfBattleItemMenuInput: @ 81ACC78 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ACC8C - b _081ACDF0 -_081ACC8C: - bl GetMenuCursorPos - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gMain - ldrh r1, [r5, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081ACCD4 - lsls r0, r4, 24 - asrs r0, 24 - cmp r0, 0 - bgt _081ACCAA - b _081ACDF0 -_081ACCAA: - subs r0, 0x2 - lsls r0, 24 - asrs r0, 24 - bl sub_81ACDFC - lsls r0, 24 - cmp r0, 0 - bne _081ACCBC - b _081ACDF0 -_081ACCBC: - movs r0, 0x5 - bl PlaySE - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - bl sub_8199134 - b _081ACDF0 - .pool -_081ACCD4: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081ACD1C - lsls r0, r4, 24 - asrs r1, r0, 24 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r2, =0x00000828 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x2 - cmp r1, r0 - blt _081ACCF2 - b _081ACDF0 -_081ACCF2: - adds r0, r1, 0x2 - lsls r0, 24 - asrs r0, 24 - bl sub_81ACDFC - lsls r0, 24 - cmp r0, 0 - beq _081ACDF0 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - movs r1, 0x1 - bl sub_8199134 - b _081ACDF0 - .pool -_081ACD1C: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081ACD30 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ACD58 -_081ACD30: - lsls r0, r4, 24 - asrs r1, r0, 24 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081ACDF0 - subs r0, r1, 0x1 - lsls r0, 24 - asrs r0, 24 - bl sub_81ACDFC - lsls r0, 24 - cmp r0, 0 - beq _081ACDF0 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _081ACD92 -_081ACD58: - ldrh r1, [r5, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081ACD6E - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081ACD9A -_081ACD6E: - lsls r0, r4, 24 - asrs r1, r0, 24 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081ACDF0 - adds r0, r1, 0x1 - lsls r0, 24 - asrs r0, 24 - bl sub_81ACDFC - lsls r0, 24 - cmp r0, 0 - beq _081ACDF0 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_081ACD92: - movs r1, 0 - bl sub_8199134 - b _081ACDF0 -_081ACD9A: - ldrh r1, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081ACDD8 - movs r0, 0x5 - bl PlaySE - ldr r2, =gUnknown_08613FB4 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - lsls r1, r4, 24 - asrs r1, 24 - movs r3, 0x82 - lsls r3, 4 - adds r0, r3 - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 3 - adds r2, 0x4 - adds r0, r2 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 - b _081ACDF0 - .pool -_081ACDD8: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081ACDF0 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_08613FB4 - ldr r1, [r0, 0x24] - adds r0, r6, 0 - bl _call_via_r1 -_081ACDF0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end Task_HandleOutOfBattleItemMenuInput - - thumb_func_start sub_81ACDFC -sub_81ACDFC: @ 81ACDFC - push {lr} - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - blt _081ACE30 - ldr r0, =gUnknown_0203CE54 - ldr r2, [r0] - ldr r3, =0x00000828 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r1, r0 - bgt _081ACE30 - movs r3, 0x82 - lsls r3, 4 - adds r0, r2, r3 - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xE - beq _081ACE30 - movs r0, 0x1 - b _081ACE32 - .pool -_081ACE30: - movs r0, 0 -_081ACE32: - pop {r1} - bx r1 - thumb_func_end sub_81ACDFC - - thumb_func_start bag_menu_remove_some_window -bag_menu_remove_some_window: @ 81ACE38 - push {lr} - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000828 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081ACE58 - movs r0, 0 - bl bag_menu_remove_window - b _081ACE76 - .pool -_081ACE58: - cmp r0, 0x2 - bne _081ACE64 - movs r0, 0x1 - bl bag_menu_remove_window - b _081ACE76 -_081ACE64: - cmp r0, 0x4 - bne _081ACE70 - movs r0, 0x2 - bl bag_menu_remove_window - b _081ACE76 -_081ACE70: - movs r0, 0x3 - bl bag_menu_remove_window -_081ACE76: - pop {r0} - bx r0 - thumb_func_end bag_menu_remove_some_window - - thumb_func_start ItemMenu_UseOutOfBattle -@ void ItemMenu_UseOutOfBattle(u8 taskId) -ItemMenu_UseOutOfBattle: @ 81ACE7C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gUnknown_0203CE7C - ldrh r0, [r5] - bl ItemId_GetFieldFunc - cmp r0, 0 - beq _081ACEEE - bl bag_menu_remove_some_window - bl calc_player_party_count - lsls r0, 24 - cmp r0, 0 - bne _081ACEB8 - ldrh r0, [r5] - bl ItemId_GetType - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ACEB8 - adds r0, r4, 0 - bl bag_menu_print_there_is_no_pokemon - b _081ACEEE - .pool -_081ACEB8: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x3 - beq _081ACEE8 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl ItemId_GetFieldFunc - adds r1, r0, 0 - adds r0, r4, 0 - bl _call_via_r1 - b _081ACEEE - .pool -_081ACEE8: - adds r0, r4, 0 - bl sub_80FDD10 -_081ACEEE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end ItemMenu_UseOutOfBattle - - thumb_func_start ItemMenu_Toss -ItemMenu_Toss: @ 81ACEF4 - push {r4-r7,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r6, r0, 3 - ldr r7, =gTasks + 0x8 - adds r4, r6, r7 - bl bag_menu_remove_some_window - movs r0, 0x1 - strh r0, [r4, 0x10] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _081ACF24 - adds r0, r5, 0 - bl BagMenuConfirmToss - b _081ACF6A - .pool -_081ACF24: - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8EE0 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - movs r0, 0x7 - bl sub_81ABC3C - adds r0, r7, 0 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =Task_ChooseHowManyToToss - str r1, [r0] -_081ACF6A: - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_Toss - - thumb_func_start BagMenuConfirmToss -BagMenuConfirmToss: @ 81ACF88 - push {r4,r5,lr} - sub sp, 0x14 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar2 - movs r2, 0x10 - ldrsh r1, [r4, r2] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8F0E - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - ldr r2, =gUnknown_08614084 - adds r0, r5, 0 - movs r1, 0x5 - bl bag_menu_yes_no - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end BagMenuConfirmToss - - thumb_func_start BagMenuCancelToss -BagMenuCancelToss: @ 81AD010 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - movs r1, 0x2 - ldrsh r0, [r4, r1] - bl bag_menu_print_description_box_text - ldrb r0, [r4] - movs r1, 0 - bl bag_menu_print_cursor_ - adds r0, r5, 0 - bl set_callback3_to_bag - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end BagMenuCancelToss - - thumb_func_start Task_ChooseHowManyToToss -Task_ChooseHowManyToToss: @ 81AD044 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0x10 - ldrh r1, [r4, 0x4] - bl AdjustQuantityAccordingToDPadInput - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AD088 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000817 - adds r0, r1 - ldrb r0, [r0] - movs r2, 0x10 - ldrsh r1, [r4, r2] - bl sub_81ABC54 - b _081AD0C6 - .pool -_081AD088: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AD0AC - movs r0, 0x5 - bl PlaySE - movs r0, 0x7 - bl bag_menu_remove_window - adds r0, r5, 0 - bl BagMenuConfirmToss - b _081AD0C6 - .pool -_081AD0AC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081AD0C6 - movs r0, 0x5 - bl PlaySE - movs r0, 0x7 - bl bag_menu_remove_window - adds r0, r6, 0 - bl BagMenuCancelToss -_081AD0C6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end Task_ChooseHowManyToToss - - thumb_func_start BagMenuActuallyToss -BagMenuActuallyToss: @ 81AD0CC - push {r4-r6,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =gTasks + 0x8 - adds r6, r4, r5 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar2 - movs r2, 0x10 - ldrsh r1, [r6, r2] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r6, =gStringVar4 - ldr r1, =gUnknown_085E8EF9 - adds r0, r6, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r6, 0 - movs r3, 0x3 - bl bag_menu_print - subs r5, 0x8 - adds r4, r5 - ldr r0, =Task_ActuallyToss - str r0, [r4] - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end BagMenuActuallyToss - - thumb_func_start Task_ActuallyToss -Task_ActuallyToss: @ 81AD150 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r4, =gUnknown_0203CE58 - ldrb r0, [r4, 0x5] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r1, r0 - mov r8, r1 - adds r1, r4, 0 - adds r1, 0x8 - adds r7, r0, r1 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081AD1CE - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldrh r1, [r5, 0x10] - bl RemoveBagItem - ldrb r0, [r5] - mov r1, r8 - adds r2, r7, 0 - bl sub_81AE6C8 - ldrb r0, [r4, 0x5] - bl sub_81AB9A8 - ldrb r0, [r4, 0x5] - bl sub_81ABA88 - ldrb r0, [r4, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - mov r2, r8 - ldrh r1, [r2] - ldrh r2, [r7] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl set_callback3_to_bag -_081AD1CE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end Task_ActuallyToss - - thumb_func_start ItemMenu_Register -ItemMenu_Register: @ 81AD1EC - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - ldr r0, =gUnknown_0203CE58 - ldrb r1, [r0, 0x5] - lsls r1, 1 - adds r2, r0, 0 - adds r2, 0x12 - adds r6, r1, r2 - adds r0, 0x8 - adds r5, r1, r0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00000496 - adds r1, r0, r2 - ldr r0, =gUnknown_0203CE7C - ldrh r2, [r0] - ldrh r0, [r1] - cmp r0, r2 - bne _081AD238 - movs r0, 0 - strh r0, [r1] - b _081AD23A - .pool -_081AD238: - strh r2, [r1] -_081AD23A: - ldrb r0, [r7] - adds r1, r6, 0 - adds r2, r5, 0 - bl sub_81AE6C8 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - ldrh r1, [r6] - ldrh r2, [r5] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r4, 0 - bl ItemMenu_Cancel - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_Register - - thumb_func_start ItemMenu_Give -ItemMenu_Give: @ 81AD278 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - bl bag_menu_remove_some_window - ldr r5, =gUnknown_0203CE7C - ldrh r0, [r5] - bl itemid_80BF6D8_mail_related - lsls r0, 24 - cmp r0, 0 - bne _081AD2AC - ldr r2, =gUnknown_085E8DCE - ldr r3, =sub_81AD350 - adds r0, r4, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _081AD2EA - .pool -_081AD2AC: - ldrh r0, [r5] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AD2E4 - bl calc_player_party_count - lsls r0, 24 - cmp r0, 0 - bne _081AD2CA - adds r0, r4, 0 - bl bag_menu_print_there_is_no_pokemon - b _081AD2EA -_081AD2CA: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - ldr r0, =sub_81B7F60 - str r0, [r1] - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - b _081AD2EA - .pool -_081AD2E4: - adds r0, r6, 0 - bl bag_menu_print_cant_be_held_msg -_081AD2EA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end ItemMenu_Give - - thumb_func_start bag_menu_print_there_is_no_pokemon -bag_menu_print_there_is_no_pokemon: @ 81AD2F0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085E8DE9 - ldr r3, =sub_81AD350 - movs r1, 0x1 - bl DisplayItemMessage - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_there_is_no_pokemon - - thumb_func_start bag_menu_print_cant_be_held_msg -bag_menu_print_cant_be_held_msg: @ 81AD30C - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r5, =gStringVar4 - ldr r1, =gUnknown_085E8E11 - adds r0, r5, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD350 - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl DisplayItemMessage - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_cant_be_held_msg - - thumb_func_start sub_81AD350 -sub_81AD350: @ 81AD350 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AD36E - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl bag_menu_inits_lists_menu -_081AD36E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD350 - - thumb_func_start ItemMenu_CheckTag -ItemMenu_CheckTag: @ 81AD378 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CE54 - ldr r2, [r1] - ldr r1, =sub_8177C14 - str r1, [r2] - bl unknown_ItemMenu_Confirm - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_CheckTag - - thumb_func_start ItemMenu_Cancel -ItemMenu_Cancel: @ 81AD398 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - bl bag_menu_remove_some_window - movs r1, 0x2 - ldrsh r0, [r4, r1] - bl bag_menu_print_description_box_text - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - ldrb r0, [r4] - movs r1, 0 - bl bag_menu_print_cursor_ - adds r0, r5, 0 - bl set_callback3_to_bag - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_Cancel - - thumb_func_start ItemMenu_UseInBattle -ItemMenu_UseInBattle: @ 81AD3DC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl ItemId_GetBattleFunc - cmp r0, 0 - beq _081AD400 - bl bag_menu_remove_some_window - ldrh r0, [r4] - bl ItemId_GetBattleFunc - adds r1, r0, 0 - adds r0, r5, 0 - bl _call_via_r1 -_081AD400: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_UseInBattle - - thumb_func_start bag_menu_mail_related -bag_menu_mail_related: @ 81AD40C - push {lr} - movs r0, 0xC - movs r1, 0x5 - movs r2, 0 - bl GoToBagMenu - pop {r0} - bx r0 - thumb_func_end bag_menu_mail_related - - thumb_func_start item_menu_type_2 -item_menu_type_2: @ 81AD41C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl itemid_80BF6D8_mail_related - lsls r0, 24 - cmp r0, 0 - bne _081AD44C - ldr r2, =gUnknown_085E8DCE - ldr r3, =sub_81AD350 - adds r0, r5, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _081AD4AE - .pool -_081AD44C: - ldrh r0, [r4] - bl sub_8122148 - lsls r0, 24 - cmp r0, 0 - bne _081AD488 - ldrh r0, [r4] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8E27 - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD350 - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - b _081AD4AE - .pool -_081AD488: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - beq _081AD4A8 - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AD4A8 - adds r0, r5, 0 - bl unknown_ItemMenu_Confirm - b _081AD4AE - .pool -_081AD4A8: - adds r0, r5, 0 - bl bag_menu_print_cant_be_held_msg -_081AD4AE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end item_menu_type_2 - - thumb_func_start item_menu_type_b -item_menu_type_b: @ 81AD4B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gUnknown_0203CE7C - ldrh r0, [r5] - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AD4E4 - ldr r2, =gUnknown_085E8DCE - ldr r3, =sub_81AD350 - adds r0, r4, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _081AD51A - .pool -_081AD4E4: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - beq _081AD514 - ldrh r0, [r5] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AD514 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =unknown_ItemMenu_Confirm - str r0, [r1] - b _081AD51A - .pool -_081AD514: - adds r0, r4, 0 - bl bag_menu_print_cant_be_held_msg -_081AD51A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end item_menu_type_b - - thumb_func_start UseRegisteredKeyItemOnField -@ bool8 UseRegisteredKeyItemOnField() -UseRegisteredKeyItemOnField: @ 81AD520 - push {r4-r7,lr} - bl InUnionRoom - cmp r0, 0x1 - beq _081AD54C - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _081AD54C - bl InBattlePike - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - bne _081AD54C - bl in_multi_battle_room_with_var_condition - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AD550 -_081AD54C: - movs r0, 0 - b _081AD5D2 -_081AD550: - bl HideMapNamePopUpWindow - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY_ScreenOff - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - ldr r5, =0x00000496 - adds r1, r0, r5 - ldrh r0, [r1] - cmp r0, 0 - beq _081AD5CA - movs r1, 0x1 - bl CheckBagHasItem - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bne _081AD5C4 - bl script_env_2_enable - bl player_bitmagic - bl sub_808B864 - bl sub_808BCF4 - ldr r2, =gUnknown_0203CE7C - ldr r0, [r4] - adds r0, r5 - ldrh r1, [r0] - strh r1, [r2] - ldrh r0, [r0] - bl ItemId_GetFieldFunc - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r6, [r1, 0xE] - b _081AD5D0 - .pool -_081AD5C4: - ldr r0, [r4] - adds r0, r5 - strh r7, [r0] -_081AD5CA: - ldr r0, =gUnknown_082736B3 - bl script_env_1_execute_new_script -_081AD5D0: - movs r0, 0x1 -_081AD5D2: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end UseRegisteredKeyItemOnField - - thumb_func_start display_sell_item_ask_str -@ void display_sell_item_ask_str(int a1) -display_sell_item_ask_str: @ 81AD5DC - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r6, =gUnknown_0203CE7C - ldrh r0, [r6] - bl itemid_get_market_price - lsls r0, 16 - cmp r0, 0 - bne _081AD634 - ldrh r0, [r6] - ldr r1, =gStringVar2 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E960F - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =bag_menu_inits_lists_menu - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - b _081AD66A - .pool -_081AD634: - movs r0, 0x1 - strh r0, [r4, 0x10] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _081AD64C - bl bag_menu_add_money_window - adds r0, r5, 0 - bl sub_81AD680 - b _081AD66A -_081AD64C: - ldrh r0, [r6] - ldr r1, =gStringVar2 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E962F - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD730 - adds r0, r7, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage -_081AD66A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end display_sell_item_ask_str - - thumb_func_start sub_81AD680 -sub_81AD680: @ 81AD680 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldr r6, =gStringVar1 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - movs r2, 0x10 - ldrsh r1, [r4, r2] - muls r1, r0 - adds r0, r6, 0 - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9654 - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD6E4 - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD680 - - thumb_func_start sub_81AD6E4 -sub_81AD6E4: @ 81AD6E4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_0861408C - movs r1, 0x6 - bl bag_menu_yes_no - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD6E4 - - thumb_func_start sub_81AD6FC -sub_81AD6FC: @ 81AD6FC - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - bl bag_menu_remove_money_window - movs r0, 0x4 - bl bag_menu_RemoveBagItem_message_window - ldrb r0, [r4] - movs r1, 0 - bl bag_menu_print_cursor_ - adds r0, r5, 0 - bl set_callback3_to_bag - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD6FC - - thumb_func_start sub_81AD730 -sub_81AD730: @ 81AD730 - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r6, =gTasks + 0x8 - adds r0, r4, r6 - mov r8, r0 - movs r0, 0x8 - bl bag_menu_add_window - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - mov r2, r8 - movs r3, 0x10 - ldrsh r1, [r2, r3] - adds r2, r0, 0 - muls r2, r1 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81ABCC0 - bl bag_menu_add_money_window - subs r6, 0x8 - adds r4, r6 - ldr r0, =sub_81AD794 - str r0, [r4] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD730 - - thumb_func_start sub_81AD794 -sub_81AD794: @ 81AD794 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - adds r0, r6, 0 - adds r0, 0x10 - ldrh r1, [r6, 0x4] - bl AdjustQuantityAccordingToDPadInput - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AD7F4 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000818 - adds r0, r1 - ldrb r4, [r0] - movs r2, 0x10 - ldrsh r5, [r6, r2] - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - movs r2, 0x10 - ldrsh r1, [r6, r2] - adds r2, r0, 0 - muls r2, r1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81ABCC0 - b _081AD844 - .pool -_081AD7F4: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AD818 - movs r0, 0x5 - bl PlaySE - movs r0, 0x8 - bl bag_menu_remove_window - adds r0, r4, 0 - bl sub_81AD680 - b _081AD844 - .pool -_081AD818: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081AD844 - movs r0, 0x5 - bl PlaySE - ldrb r0, [r6] - movs r1, 0 - bl bag_menu_print_cursor_ - bl bag_menu_remove_money_window - movs r0, 0x8 - bl bag_menu_remove_window - movs r0, 0x4 - bl bag_menu_RemoveBagItem_message_window - adds r0, r5, 0 - bl set_callback3_to_bag -_081AD844: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81AD794 - - thumb_func_start sub_81AD84C -sub_81AD84C: @ 81AD84C - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldr r6, =gUnknown_0203CE7C - ldrh r0, [r6] - ldr r1, =gStringVar2 - bl CopyItemName - ldr r0, =gStringVar1 - mov r8, r0 - ldrh r0, [r6] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - movs r2, 0x10 - ldrsh r1, [r4, r2] - muls r1, r0 - mov r0, r8 - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9677 - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD8C8 - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD84C - - thumb_func_start sub_81AD8C8 -sub_81AD8C8: @ 81AD8C8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - lsls r6, r0, 2 - adds r6, r0 - lsls r6, 3 - ldr r0, =gTasks + 0x8 - adds r0, r6 - mov r10, r0 - ldr r7, =gUnknown_0203CE58 - ldrb r5, [r7, 0x5] - lsls r5, 1 - movs r1, 0x12 - adds r1, r7 - mov r9, r1 - add r9, r5 - adds r0, r7, 0 - adds r0, 0x8 - adds r5, r0 - movs r0, 0x5F - bl PlaySE - ldr r2, =gUnknown_0203CE7C - mov r8, r2 - ldrh r0, [r2] - mov r3, r10 - ldrh r1, [r3, 0x10] - bl RemoveBagItem - ldr r0, =gSaveBlock1Ptr - ldr r4, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r4, r1 - mov r2, r8 - ldrh r0, [r2] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - mov r3, r10 - movs r2, 0x10 - ldrsh r1, [r3, r2] - muls r1, r0 - adds r0, r4, 0 - bl add_money - mov r3, r10 - ldrb r0, [r3] - mov r1, r9 - adds r2, r5, 0 - bl sub_81AE6C8 - ldrb r0, [r7, 0x5] - bl sub_81AB9A8 - ldrb r0, [r7, 0x5] - bl sub_81ABA88 - ldrb r0, [r7, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - mov r2, r9 - ldrh r1, [r2] - ldrh r2, [r5] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - mov r3, r10 - strh r0, [r3] - movs r1, 0x2 - bl bag_menu_print_cursor_ - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000819 - adds r0, r1 - ldrb r4, [r0] - ldr r2, =gSaveBlock1Ptr - ldr r0, [r2] - movs r3, 0x92 - lsls r3, 3 - adds r0, r3 - bl DecryptMoney - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - bl PrintMoneyAmountInMoneyBox - ldr r0, =gTasks + 0x8 - subs r0, 0x8 - adds r6, r0 - ldr r0, =sub_81AD9C0 - str r0, [r6] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD8C8 - - thumb_func_start sub_81AD9C0 -sub_81AD9C0: @ 81AD9C0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081AD9E2 - movs r0, 0x5 - bl PlaySE - bl bag_menu_remove_money_window - adds r0, r4, 0 - bl bag_menu_inits_lists_menu -_081AD9E2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD9C0 - - thumb_func_start display_deposit_item_ask_str -display_deposit_item_ask_str: @ 81AD9EC - push {r4-r6,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r5, r0, 3 - ldr r6, =gTasks + 0x8 - adds r1, r5, r6 - movs r0, 0x1 - strh r0, [r1, 0x10] - movs r3, 0x4 - ldrsh r0, [r1, r3] - cmp r0, 0x1 - bne _081ADA18 - adds r0, r2, 0 - bl sub_81ADB14 - b _081ADA5E - .pool -_081ADA18: - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8E42 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - movs r0, 0x7 - bl sub_81ABC3C - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =sub_81ADA7C - str r1, [r0] -_081ADA5E: - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end display_deposit_item_ask_str - - thumb_func_start sub_81ADA7C -sub_81ADA7C: @ 81ADA7C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - adds r0, r5, 0 - adds r0, 0x10 - ldrh r1, [r5, 0x4] - bl AdjustQuantityAccordingToDPadInput - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ADAC0 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000817 - adds r0, r1 - ldrb r0, [r0] - movs r2, 0x10 - ldrsh r1, [r5, r2] - bl sub_81ABC54 - b _081ADB0E - .pool -_081ADAC0: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081ADAE4 - movs r0, 0x5 - bl PlaySE - movs r0, 0x7 - bl bag_menu_remove_window - adds r0, r4, 0 - bl sub_81ADB14 - b _081ADB0E - .pool -_081ADAE4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081ADB0E - movs r0, 0x5 - bl PlaySE - movs r1, 0x2 - ldrsh r0, [r5, r1] - bl bag_menu_print_description_box_text - ldrb r0, [r5] - movs r1, 0 - bl bag_menu_print_cursor_ - movs r0, 0x7 - bl bag_menu_remove_window - adds r0, r6, 0 - bl set_callback3_to_bag -_081ADB0E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81ADA7C - - thumb_func_start sub_81ADB14 -sub_81ADB14: @ 81ADB14 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r7, r1, 3 - ldr r0, =gTasks + 0x8 - mov r9, r0 - adds r2, r7, 0 - add r2, r9 - mov r8, r2 - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _081ADB6C - ldr r2, =gUnknown_085E8E8E - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - b _081ADBE2 - .pool -_081ADB6C: - ldrh r0, [r4] - mov r3, r8 - ldrh r1, [r3, 0x10] - bl sub_80D6D70 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bne _081ADBD4 - ldrh r0, [r4] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar2 - mov r2, r8 - movs r3, 0x10 - ldrsh r1, [r2, r3] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8E5A - adds r0, r4, 0 - bl StringExpandPlaceholders - str r6, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - str r5, [sp, 0xC] - str r5, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - mov r0, r9 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =Task_ActuallyToss - b _081ADBF2 - .pool -_081ADBD4: - ldr r2, =gUnknown_085E8E6E - movs r0, 0x1 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - str r5, [sp, 0xC] - str r5, [sp, 0x10] -_081ADBE2: - movs r1, 0x1 - movs r3, 0x3 - bl bag_menu_print - mov r0, r9 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =sub_81ADC0C -_081ADBF2: - str r1, [r0] - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ADB14 - - thumb_func_start sub_81ADC0C -sub_81ADC0C: @ 81ADC0C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081ADC44 - movs r0, 0x5 - bl PlaySE - movs r1, 0x2 - ldrsh r0, [r5, r1] - bl bag_menu_print_description_box_text - ldrb r0, [r5] - movs r1, 0 - bl bag_menu_print_cursor_ - adds r0, r4, 0 - bl set_callback3_to_bag -_081ADC44: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ADC0C - - thumb_func_start IsWallysBag -@ bool8 IsWallysBag() -IsWallysBag: @ 81ADC54 - push {lr} - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x4] - cmp r0, 0xA - beq _081ADC68 - movs r0, 0 - b _081ADC6A - .pool -_081ADC68: - movs r0, 0x1 -_081ADC6A: - pop {r1} - bx r1 - thumb_func_end IsWallysBag - - thumb_func_start PrepareBagForWallyTutorial -@ void PrepareBagForWallyTutorial() -PrepareBagForWallyTutorial: @ 81ADC70 - push {r4-r6,lr} - ldr r4, =gUnknown_0203CE80 - movs r0, 0xD0 - bl AllocZeroed - str r0, [r4] - ldr r5, =gSaveBlock1Ptr - ldr r1, [r5] - movs r2, 0xAC - lsls r2, 3 - adds r1, r2 - movs r2, 0x78 - bl memcpy - ldr r0, [r4] - ldr r1, [r5] - movs r2, 0xCA - lsls r2, 3 - adds r1, r2 - adds r0, 0x78 - movs r2, 0x40 - bl memcpy - ldr r0, [r4] - ldr r2, =gUnknown_0203CE58 - ldrb r1, [r2, 0x5] - adds r0, 0xCE - strh r1, [r0] - movs r6, 0 - adds r5, r2, 0 - adds r5, 0x8 -_081ADCAE: - ldr r2, [r4] - lsls r3, r6, 1 - adds r0, r2, 0 - adds r0, 0xB8 - adds r0, r3 - ldrh r1, [r5] - strh r1, [r0] - adds r2, 0xC2 - adds r2, r3 - ldrh r0, [r5, 0xA] - strh r0, [r2] - adds r5, 0x2 - adds r6, 0x1 - cmp r6, 0x4 - bls _081ADCAE - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - movs r1, 0xAC - lsls r1, 3 - adds r0, r1 - movs r1, 0x1E - bl ClearItemSlots - ldr r0, [r4] - movs r2, 0xCA - lsls r2, 3 - adds r0, r2 - movs r1, 0x10 - bl ClearItemSlots - bl ResetBagScrollPositions - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end PrepareBagForWallyTutorial - - thumb_func_start RestoreBagAfterWallyTutorial -@ void RestoreBagAfterWallyTutorial() -RestoreBagAfterWallyTutorial: @ 81ADD00 - push {r4-r6,lr} - ldr r5, =gSaveBlock1Ptr - ldr r0, [r5] - movs r1, 0xAC - lsls r1, 3 - adds r0, r1 - ldr r4, =gUnknown_0203CE80 - ldr r1, [r4] - movs r2, 0x78 - bl memcpy - ldr r0, [r5] - movs r1, 0xCA - lsls r1, 3 - adds r0, r1 - ldr r1, [r4] - adds r1, 0x78 - movs r2, 0x40 - bl memcpy - ldr r1, =gUnknown_0203CE58 - ldr r0, [r4] - adds r0, 0xCE - ldrh r0, [r0] - strb r0, [r1, 0x5] - movs r5, 0 - adds r6, r4, 0 - adds r3, r1, 0 - adds r3, 0x8 -_081ADD3A: - lsls r2, r5, 1 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0xB8 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r3] - adds r1, 0xC2 - adds r1, r2 - ldrh r0, [r1] - strh r0, [r3, 0xA] - adds r3, 0x2 - adds r5, 0x1 - cmp r5, 0x4 - bls _081ADD3A - ldr r0, [r6] - bl Free - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end RestoreBagAfterWallyTutorial - - thumb_func_start DoWallyTutorialBagMenu -@ void DoWallyTutorialBagMenu() -DoWallyTutorialBagMenu: @ 81ADD70 - push {lr} - bl PrepareBagForWallyTutorial - movs r0, 0xD - movs r1, 0x1 - bl AddBagItem - movs r0, 0x4 - movs r1, 0x1 - bl AddBagItem - ldr r2, =sub_8059D50 - movs r0, 0xA - movs r1, 0 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end DoWallyTutorialBagMenu - - thumb_func_start Task_WallyTutorialBagMenu -@ void Task_WallyTutorialBagMenu(u8 taskId) -Task_WallyTutorialBagMenu: @ 81ADD98 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081ADE32 - movs r0, 0x10 - ldrsh r1, [r4, r0] - cmp r1, 0xCC - beq _081ADDEC - cmp r1, 0xCC - bgt _081ADDD0 - cmp r1, 0x66 - beq _081ADDDA - b _081ADE2C - .pool -_081ADDD0: - movs r0, 0x99 - lsls r0, 1 - cmp r1, r0 - beq _081ADE0C - b _081ADE2C -_081ADDDA: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0 - bl SwitchBagPocket - b _081ADE2C -_081ADDEC: - movs r0, 0x5 - bl PlaySE - ldrb r0, [r4] - movs r1, 0x2 - bl bag_menu_print_cursor_ - ldr r1, =gUnknown_0203CE7C - movs r0, 0x4 - strh r0, [r1] - adds r0, r5, 0 - bl sub_81AC644 - b _081ADE2C - .pool -_081ADE0C: - movs r0, 0x5 - bl PlaySE - bl bag_menu_remove_some_window - ldrb r0, [r4] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - bl RestoreBagAfterWallyTutorial - adds r0, r5, 0 - bl unknown_ItemMenu_Confirm - b _081ADE32 -_081ADE2C: - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] -_081ADE32: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end Task_WallyTutorialBagMenu - - thumb_func_start unknown_ItemMenu_Show -unknown_ItemMenu_Show: @ 81ADE38 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gSpecialVar_0x8005 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - bl bag_menu_remove_some_window - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_ItemMenu_Show - - thumb_func_start bag_menu_leave_maybe_3 -bag_menu_leave_maybe_3: @ 81ADE6C - push {lr} - ldr r0, =gUnknown_03005DAC - ldr r1, =sub_819FA50 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_leave_maybe_3 - - thumb_func_start unknown_ItemMenu_Give2 -unknown_ItemMenu_Give2: @ 81ADE8C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - movs r1, 0x1 - bl RemoveBagItem - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - bl bag_menu_remove_some_window - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_ItemMenu_Give2 - - thumb_func_start bag_menu_leave_maybe_2 -bag_menu_leave_maybe_2: @ 81ADEBC - push {lr} - ldr r0, =gUnknown_03005DAC - ldr r1, =sub_818DEF4 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_leave_maybe_2 - - thumb_func_start unknown_ItemMenu_Confirm2 -unknown_ItemMenu_Confirm2: @ 81ADEDC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - bl bag_menu_remove_some_window - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_ItemMenu_Confirm2 - - thumb_func_start bag_menu_leave_maybe -bag_menu_leave_maybe: @ 81ADF00 - push {lr} - ldr r0, =gUnknown_03005DAC - ldr r1, =sub_818E564 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_leave_maybe - - thumb_func_start bag_menu_print_pocket_names -bag_menu_print_pocket_names: @ 81ADF20 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x1C - adds r4, r0, 0 - mov r8, r1 - movs r0, 0 - movs r1, 0 - str r0, [sp, 0x14] - str r1, [sp, 0x18] - ldr r1, =0x00ffffff - ldr r0, [sp, 0x14] - ands r0, r1 - movs r1, 0x80 - lsls r1, 21 - orrs r0, r1 - str r0, [sp, 0x14] - ldr r1, =0xffffff00 - ldr r0, [sp, 0x18] - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - str r0, [sp, 0x18] - add r0, sp, 0x14 - bl AddWindow - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x40 - bl GetStringCenterAlignXOffset - lsls r3, r0, 24 - lsrs r3, 24 - movs r7, 0x1 - str r7, [sp] - movs r5, 0 - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0xFF - mov r9, r0 - str r0, [sp, 0xC] - str r7, [sp, 0x10] - adds r0, r6, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl bag_menu_print - mov r2, r8 - cmp r2, 0 - beq _081ADFBA - movs r0, 0x1 - mov r1, r8 - movs r2, 0x40 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - adds r3, 0x40 - lsls r3, 24 - lsrs r3, 24 - str r7, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - str r7, [sp, 0x10] - adds r0, r6, 0 - movs r1, 0x1 - mov r2, r8 - bl bag_menu_print -_081ADFBA: - adds r0, r6, 0 - movs r1, 0x7 - bl GetWindowAttribute - ldr r1, =gUnknown_0203CE54 - ldr r1, [r1] - ldr r2, =0x00000844 - adds r1, r2 - ldr r2, =0x04000100 - bl CpuSet - adds r0, r6, 0 - bl RemoveWindow - add sp, 0x1C - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_pocket_names - - thumb_func_start bag_menu_copy_pocket_name_to_window -bag_menu_copy_pocket_name_to_window: @ 81ADFF8 - push {r4-r7,lr} - adds r7, r0, 0 - cmp r7, 0x8 - bls _081AE002 - movs r7, 0x8 -_081AE002: - ldr r0, =gUnknown_0203CE54 - ldr r4, [r0] - ldr r0, =0x00000844 - adds r4, r0 - movs r0, 0x2 - movs r1, 0x7 - bl GetWindowAttribute - adds r5, r0, 0 - lsls r0, r7, 5 - adds r0, r4, r0 - ldr r6, =0x04000040 - adds r1, r5, 0 - adds r2, r6, 0 - bl CpuSet - adds r0, r7, 0 - adds r0, 0x10 - lsls r0, 5 - adds r4, r0 - movs r0, 0x80 - lsls r0, 1 - adds r5, r0 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl CpuSet - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_copy_pocket_name_to_window - - thumb_func_start setup_bag_menu_textboxes -setup_bag_menu_textboxes: @ 81AE054 - push {r4,lr} - ldr r0, =gUnknown_08614174 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0x1 - movs r2, 0xE0 - bl sub_809882C - movs r0, 0 - movs r1, 0xA - movs r2, 0xD0 - bl copy_textbox_border_tile_patterns_to_vram - movs r0, 0xC0 - movs r1, 0x1 - bl sub_819A2BC - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - movs r4, 0 -_081AE088: - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081AE088 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end setup_bag_menu_textboxes - - thumb_func_start bag_menu_print -bag_menu_print: @ 81AE0BC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - mov r9, r3 - ldr r3, [sp, 0x30] - ldr r4, [sp, 0x34] - ldr r6, [sp, 0x38] - ldr r5, [sp, 0x3C] - mov r8, r5 - ldr r5, [sp, 0x40] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r7, r9 - lsls r7, 24 - lsrs r7, 24 - mov r9, r7 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - str r4, [sp] - str r6, [sp, 0x4] - lsls r4, r5, 1 - adds r4, r5 - ldr r5, =gUnknown_08614164 - adds r4, r5 - str r4, [sp, 0x8] - mov r4, r8 - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0xC] - str r2, [sp, 0x10] - mov r2, r9 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print - - thumb_func_start sub_81AE124 -sub_81AE124: @ 81AE124 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CE54 - ldr r1, [r1] - movs r2, 0x81 - lsls r2, 4 - adds r1, r2 - adds r1, r0 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end sub_81AE124 - - thumb_func_start bag_menu_add_window -bag_menu_add_window: @ 81AE13C - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203CE54 - movs r3, 0x81 - lsls r3, 4 - adds r1, r2, r3 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081AE172 - lsls r0, r2, 3 - ldr r1, =gUnknown_086141AC - adds r0, r1 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - movs r2, 0x1 - movs r3, 0xE - bl SetWindowBorderStyle - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram -_081AE172: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end bag_menu_add_window - - thumb_func_start bag_menu_remove_window -bag_menu_remove_window: @ 81AE184 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CE54 - movs r2, 0x81 - lsls r2, 4 - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081AE1B8 - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0xFF - strb r0, [r4] -_081AE1B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_remove_window - - thumb_func_start AddItemMessageWindow -@ u8 AddItemMessageWindow(u8 a1) -AddItemMessageWindow: @ 81AE1C4 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203CE54 - movs r3, 0x81 - lsls r3, 4 - adds r1, r2, r3 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081AE1E8 - lsls r0, r2, 3 - ldr r1, =gUnknown_086141AC - adds r0, r1 - bl AddWindow - strb r0, [r4] -_081AE1E8: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end AddItemMessageWindow - - thumb_func_start bag_menu_RemoveBagItem_message_window -bag_menu_RemoveBagItem_message_window: @ 81AE1F8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CE54 - movs r2, 0x81 - lsls r2, 4 - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081AE22C - movs r1, 0 - bl sub_8197DF8 - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0xFF - strb r0, [r4] -_081AE22C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_RemoveBagItem_message_window - - thumb_func_start bag_menu_yes_no -bag_menu_yes_no: @ 81AE238 - push {lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 21 - ldr r3, =gUnknown_086141AC - adds r1, r3 - movs r3, 0x2 - str r3, [sp] - movs r3, 0x1 - str r3, [sp, 0x4] - movs r3, 0xE - str r3, [sp, 0x8] - str r2, [sp, 0xC] - movs r2, 0x1 - movs r3, 0 - bl CreateYesNoMenuWithCallbacks - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_yes_no - - thumb_func_start bag_menu_add_money_window -bag_menu_add_money_window: @ 81AE268 - push {r4,lr} - movs r0, 0x9 - bl bag_menu_add_window - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - bl DecryptMoney - adds r3, r0, 0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0xE - bl set_window_border_style_and_print_money_box - movs r0, 0x13 - movs r1, 0xB - bl AddMoneyLabelObject - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_add_money_window - - thumb_func_start bag_menu_remove_money_window -bag_menu_remove_money_window: @ 81AE2A4 - push {lr} - movs r0, 0x9 - bl bag_menu_remove_window - bl RemoveMoneyLabelObject - pop {r0} - bx r0 - thumb_func_end bag_menu_remove_money_window - - thumb_func_start bag_menu_prepare_tmhm_move_window -bag_menu_prepare_tmhm_move_window: @ 81AE2B4 - push {lr} - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x3 - movs r1, 0x13 - movs r2, 0 - movs r3, 0 - bl blit_move_info_icon - movs r0, 0x3 - movs r1, 0x14 - movs r2, 0 - movs r3, 0xC - bl blit_move_info_icon - movs r0, 0x3 - movs r1, 0x15 - movs r2, 0 - movs r3, 0x18 - bl blit_move_info_icon - movs r0, 0x3 - movs r1, 0x16 - movs r2, 0 - movs r3, 0x24 - bl blit_move_info_icon - movs r0, 0x3 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end bag_menu_prepare_tmhm_move_window - - thumb_func_start PrintTMHMMoveData -PrintTMHMMoveData: @ 81AE2FC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x4 - movs r1, 0 - bl FillWindowPixelBuffer - cmp r4, 0 - bne _081AE354 - movs r4, 0 - movs r5, 0 -_081AE31A: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 26 - lsrs r0, 24 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0xFF - str r0, [sp, 0xC] - movs r0, 0x4 - str r0, [sp, 0x10] - movs r1, 0x1 - ldr r2, =gUnknown_085E8D45 - movs r3, 0x7 - bl bag_menu_print - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081AE31A - movs r0, 0x4 - movs r1, 0x2 - bl CopyWindowToVram - b _081AE440 - .pool -_081AE354: - adds r0, r4, 0 - bl ItemIdToBattleMoveId - lsls r0, 16 - lsrs r7, r0, 16 - ldr r1, =gBattleMoves - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 2 - adds r5, r0, r1 - ldrb r1, [r5, 0x2] - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x4 - movs r2, 0 - movs r3, 0 - bl blit_move_info_icon - ldrb r0, [r5, 0x1] - cmp r0, 0x1 - bhi _081AE38C - ldr r2, =gUnknown_085E8D45 - b _081AE39C - .pool -_081AE38C: - ldr r4, =gStringVar1 - ldrb r1, [r5, 0x1] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r2, r4, 0 -_081AE39C: - movs r0, 0xC - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0xFF - str r0, [sp, 0xC] - movs r0, 0x4 - str r0, [sp, 0x10] - movs r1, 0x1 - movs r3, 0x7 - bl bag_menu_print - ldr r2, =gBattleMoves - lsls r1, r7, 1 - adds r0, r1, r7 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x3] - adds r6, r1, 0 - cmp r0, 0 - bne _081AE3D8 - ldr r2, =gUnknown_085E8D45 - b _081AE3E8 - .pool -_081AE3D8: - ldr r4, =gStringVar1 - ldrb r1, [r2, 0x3] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r2, r4, 0 -_081AE3E8: - movs r0, 0x18 - str r0, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0xFF - mov r8, r0 - str r0, [sp, 0xC] - movs r0, 0x4 - mov r9, r0 - str r0, [sp, 0x10] - movs r1, 0x1 - movs r3, 0x7 - bl bag_menu_print - ldr r5, =gStringVar1 - ldr r1, =gBattleMoves - adds r0, r6, r7 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x4] - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - movs r0, 0x24 - str r0, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - mov r0, r8 - str r0, [sp, 0xC] - mov r0, r9 - str r0, [sp, 0x10] - movs r0, 0x4 - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0x7 - bl bag_menu_print - movs r0, 0x4 - movs r1, 0x2 - bl CopyWindowToVram -_081AE440: - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end PrintTMHMMoveData - - thumb_func_start ListMenuDummyTask -@ void ListMenuDummyTask(u8 taskId) -ListMenuDummyTask: @ 81AE458 - bx lr - thumb_func_end ListMenuDummyTask - - thumb_func_start DoMysteryGiftListMenu -@ int DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, int a3, int a4, int a5) -DoMysteryGiftListMenu: @ 81AE45C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r12, r0 - str r1, [sp] - ldr r0, [sp, 0x28] - lsls r2, 24 - lsrs r6, r2, 24 - mov r10, r6 - lsls r3, 16 - lsrs r7, r3, 16 - str r7, [sp, 0x4] - lsls r0, 16 - mov r8, r0 - lsrs r0, 16 - mov r9, r0 - ldr r5, =gUnknown_0203CE84 - ldrb r4, [r5, 0x4] - cmp r4, 0x1 - beq _081AE4F4 - cmp r4, 0x1 - ble _081AE492 - cmp r4, 0x2 - beq _081AE558 -_081AE492: - mov r0, r12 - bl AddWindow - strb r0, [r5, 0x5] - cmp r6, 0x1 - beq _081AE4B0 - cmp r6, 0x2 - bne _081AE4C0 - ldrb r0, [r5, 0x5] - mov r1, r9 - lsls r2, r1, 24 - lsrs r2, 24 - adds r1, r7, 0 - bl sub_809882C -_081AE4B0: - ldrb r0, [r5, 0x5] - mov r3, r8 - lsrs r2, r3, 20 - lsls r2, 24 - lsrs r2, 24 - ldr r1, [sp, 0x4] - bl sub_8098858 -_081AE4C0: - ldr r0, =gUnknown_03006310 - adds r2, r0, 0 - ldr r1, [sp] - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldr r4, =gUnknown_0203CE84 - ldrb r1, [r4, 0x5] - strb r1, [r0, 0x10] - movs r1, 0 - movs r2, 0 - bl ListMenuInit - strb r0, [r4, 0x6] - ldrb r0, [r4, 0x5] - movs r1, 0x1 - bl CopyWindowToVram - movs r0, 0x1 - strb r0, [r4, 0x4] - b _081AE570 - .pool -_081AE4F4: - ldrb r0, [r5, 0x6] - bl ListMenuHandleInput - str r0, [r5] - ldr r1, =gMain - ldrh r0, [r1, 0x2E] - ands r4, r0 - cmp r4, 0 - beq _081AE50A - movs r0, 0x2 - strb r0, [r5, 0x4] -_081AE50A: - ldrh r1, [r1, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081AE51E - movs r0, 0x2 - negs r0, r0 - str r0, [r5] - movs r0, 0x2 - strb r0, [r5, 0x4] -_081AE51E: - ldrb r0, [r5, 0x4] - cmp r0, 0x2 - bne _081AE570 - cmp r6, 0 - bne _081AE534 - ldrb r0, [r5, 0x5] - bl ClearWindowTilemap - b _081AE546 - .pool -_081AE534: - mov r4, r10 - cmp r4, 0 - blt _081AE546 - cmp r4, 0x2 - bgt _081AE546 - ldrb r0, [r5, 0x5] - movs r1, 0 - bl sub_819746C -_081AE546: - ldr r0, =gUnknown_0203CE84 - ldrb r0, [r0, 0x5] - movs r1, 0x1 - bl CopyWindowToVram - b _081AE570 - .pool -_081AE558: - ldrb r0, [r5, 0x6] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r5, 0x5] - bl RemoveWindow - movs r0, 0 - strb r0, [r5, 0x4] - ldr r0, [r5] - b _081AE574 -_081AE570: - movs r0, 0x1 - negs r0, r0 -_081AE574: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end DoMysteryGiftListMenu - - thumb_func_start ListMenuInit -@ u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow) -ListMenuInit: @ 81AE584 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - bl ListMenuInitInternal - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5, 0x10] - bl PutWindowTilemap - ldrb r0, [r5, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end ListMenuInit - - thumb_func_start Unused_ListMenuInit2 -@ u8 Unused_ListMenuInit2(struct ListMenuTemplate *listMenuTemplate, int a2, u16 scrollOffset, u16 selectedRow) -Unused_ListMenuInit2: @ 81AE5B0 - push {r4-r7,lr} - sub sp, 0x8 - adds r6, r0, 0 - adds r4, r1, 0 - adds r1, r2, 0 - adds r2, r3, 0 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - bl ListMenuInitInternal - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r4, 0x4] - cmp r0, 0xFF - beq _081AE5F0 - adds r5, r4, 0 -_081AE5D4: - ldrb r0, [r6, 0x10] - ldrb r1, [r5] - ldrb r2, [r5, 0x1] - ldrb r3, [r5, 0x2] - ldrb r4, [r5, 0x3] - str r4, [sp] - ldrb r4, [r5, 0x4] - str r4, [sp, 0x4] - bl PutWindowRectTilemapOverridePalette - adds r5, 0x8 - ldrb r0, [r5, 0x4] - cmp r0, 0xFF - bne _081AE5D4 -_081AE5F0: - ldrb r0, [r6, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r7, 0 - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end Unused_ListMenuInit2 - - thumb_func_start ListMenuHandleInput -@ int ListMenuHandleInput(u8 taskId) -ListMenuHandleInput: @ 81AE604 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r3, r1, r0 - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AE638 - ldrh r0, [r3, 0x18] - ldrh r1, [r3, 0x1A] - adds r0, r1 - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - b _081AE6C2 - .pool -_081AE638: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081AE646 - movs r0, 0x2 - negs r0, r0 - b _081AE6C2 -_081AE646: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081AE65A - adds r0, r3, 0 - movs r1, 0x1 - movs r2, 0x1 - movs r3, 0 - b _081AE6BA -_081AE65A: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081AE66A - adds r0, r3, 0 - movs r1, 0x1 - movs r2, 0x1 - b _081AE6B8 -_081AE66A: - ldrb r0, [r3, 0x16] - lsrs r0, 6 - cmp r0, 0x1 - beq _081AE680 - cmp r0, 0x1 - ble _081AE67A - cmp r0, 0x2 - beq _081AE68C -_081AE67A: - movs r2, 0 - movs r0, 0 - b _081AE6A0 -_081AE680: - movs r0, 0x20 - ands r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0x10 - b _081AE69A -_081AE68C: - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0x80 - lsls r0, 1 -_081AE69A: - ands r0, r1 - lsls r0, 16 - lsrs r0, 16 -_081AE6A0: - cmp r2, 0 - beq _081AE6AE - ldrb r2, [r3, 0xE] - adds r0, r3, 0 - movs r1, 0x1 - movs r3, 0 - b _081AE6BA -_081AE6AE: - cmp r0, 0 - beq _081AE6BE - ldrb r2, [r3, 0xE] - adds r0, r3, 0 - movs r1, 0x1 -_081AE6B8: - movs r3, 0x1 -_081AE6BA: - bl ListMenuChangeSelection -_081AE6BE: - movs r0, 0x1 - negs r0, r0 -_081AE6C2: - pop {r1} - bx r1 - thumb_func_end ListMenuHandleInput - - thumb_func_start sub_81AE6C8 -sub_81AE6C8: @ 81AE6C8 - push {r4,lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r1, r0, r1 - cmp r3, 0 - beq _081AE6E4 - ldrh r0, [r1, 0x18] - strh r0, [r3] -_081AE6E4: - cmp r2, 0 - beq _081AE6EC - ldrh r0, [r1, 0x1A] - strh r0, [r2] -_081AE6EC: - ldrb r0, [r1, 0x1E] - cmp r0, 0xFF - beq _081AE6FC - ldrb r1, [r1, 0x17] - lsrs r1, 6 - subs r1, 0x2 - bl ListMenuRemoveCursorObject -_081AE6FC: - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE6C8 - - thumb_func_start sub_81AE70C -sub_81AE70C: @ 81AE70C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldrb r0, [r4, 0x10] - ldrb r2, [r4, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - bl FillWindowPixelBuffer - ldrh r1, [r4, 0x18] - ldrh r3, [r4, 0xE] - adds r0, r4, 0 - movs r2, 0 - bl ListMenuPrintEntries - adds r0, r4, 0 - bl ListMenuDrawCursor - ldrb r0, [r4, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE70C - - thumb_func_start sub_81AE750 -sub_81AE750: @ 81AE750 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - lsrs r1, 20 - ldrb r6, [r4, 0x14] - movs r5, 0xF - adds r0, r5, 0 - ands r0, r6 - orrs r0, r1 - strb r0, [r4, 0x14] - ands r2, r5 - ldrb r1, [r4, 0x15] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - orrs r0, r2 - lsrs r3, 20 - ands r0, r5 - orrs r0, r3 - strb r0, [r4, 0x15] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE750 - - thumb_func_start sub_81AE794 -sub_81AE794: @ 81AE794 - push {r4,r5,lr} - adds r3, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldrb r0, [r4, 0x10] - movs r1, 0x1 - adds r2, r3, 0 - bl SetWindowAttribute - ldrb r0, [r4, 0x10] - movs r1, 0x2 - adds r2, r5, 0 - bl SetWindowAttribute - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE794 - - thumb_func_start sub_81AE7D0 -sub_81AE7D0: @ 81AE7D0 - push {r4-r7,lr} - sub sp, 0x20 - mov r12, r2 - ldr r5, [sp, 0x34] - lsls r3, 16 - lsrs r3, 16 - adds r4, r3, 0 - mov r3, sp - ldm r0!, {r2,r6,r7} - stm r3!, {r2,r6,r7} - ldm r0!, {r2,r6,r7} - stm r3!, {r2,r6,r7} - mov r0, sp - movs r3, 0 - strh r1, [r0, 0x18] - mov r1, r12 - strh r1, [r0, 0x1A] - strb r3, [r0, 0x1C] - strb r3, [r0, 0x1D] - cmp r4, 0x40 - bne _081AE804 - movs r1, 0 - movs r2, 0x1 - movs r3, 0 - bl ListMenuChangeSelection -_081AE804: - cmp r4, 0x80 - bne _081AE814 - mov r0, sp - movs r1, 0 - movs r2, 0x1 - movs r3, 0x1 - bl ListMenuChangeSelection -_081AE814: - cmp r5, 0 - beq _081AE81E - mov r0, sp - ldrh r0, [r0, 0x18] - strh r0, [r5] -_081AE81E: - ldr r2, [sp, 0x38] - cmp r2, 0 - beq _081AE82A - mov r0, sp - ldrh r0, [r0, 0x1A] - strh r0, [r2] -_081AE82A: - movs r0, 0x1 - negs r0, r0 - add sp, 0x20 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AE7D0 - - thumb_func_start sub_81AE838 -sub_81AE838: @ 81AE838 - push {lr} - adds r2, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r1, r0 - cmp r2, 0 - beq _081AE856 - ldrh r0, [r1, 0x1A] - ldrh r1, [r1, 0x18] - adds r0, r1 - strh r0, [r2] -_081AE856: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE838 - - thumb_func_start get_coro_args_x18_x1A -get_coro_args_x18_x1A: @ 81AE860 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r1, r0 - cmp r3, 0 - beq _081AE87A - ldrh r0, [r1, 0x18] - strh r0, [r3] -_081AE87A: - cmp r2, 0 - beq _081AE882 - ldrh r0, [r1, 0x1A] - strh r0, [r2] -_081AE882: - pop {r0} - bx r0 - .pool - thumb_func_end get_coro_args_x18_x1A - - thumb_func_start ListMenuGetYCoordForPrintingArrowCursor -@ u8 ListMenuGetYCoordForPrintingArrowCursor(u8 taskId) -ListMenuGetYCoordForPrintingArrowCursor: @ 81AE88C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldrb r0, [r4, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - ldrb r1, [r4, 0x16] - lsls r1, 26 - lsrs r1, 29 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x1A] - adds r2, r1, 0 - muls r2, r0 - adds r1, r2, 0 - ldrb r0, [r4, 0x14] - lsls r0, 28 - lsrs r0, 28 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuGetYCoordForPrintingArrowCursor - - thumb_func_start ListMenuInitInternal -@ u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow) -ListMenuInitInternal: @ 81AE8D4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - ldr r0, =ListMenuDummyTask - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - adds r0, r7, 0 - ldm r4!, {r1-r3} - stm r0!, {r1-r3} - ldm r4!, {r1-r3} - stm r0!, {r1-r3} - movs r1, 0 - strh r5, [r7, 0x18] - strh r6, [r7, 0x1A] - strb r1, [r7, 0x1C] - strb r1, [r7, 0x1D] - movs r0, 0xFF - strb r0, [r7, 0x1E] - strb r1, [r7, 0x1F] - ldr r3, =gUnknown_03006300 - ldrb r1, [r7, 0x14] - movs r5, 0xF - lsrs r1, 4 - ldrb r4, [r3] - movs r2, 0x10 - negs r2, r2 - adds r0, r2, 0 - ands r0, r4 - orrs r0, r1 - strb r0, [r3] - ldrb r1, [r7, 0x15] - lsls r1, 28 - lsrs r1, 24 - ands r0, r5 - orrs r0, r1 - strb r0, [r3] - ldrb r0, [r7, 0x15] - lsrs r0, 4 - ands r5, r0 - ldrb r0, [r3, 0x1] - ands r2, r0 - orrs r2, r5 - strb r2, [r3, 0x1] - ldrb r1, [r7, 0x16] - lsls r1, 29 - lsrs r1, 17 - ldr r0, [r3] - ldr r2, =0xfffc0fff - ands r0, r2 - orrs r0, r1 - str r0, [r3] - ldrb r0, [r7, 0x17] - lsls r0, 26 - lsrs r0, 26 - strb r0, [r3, 0x3] - ldrh r0, [r7, 0xC] - ldrh r1, [r7, 0xE] - cmp r0, r1 - bcs _081AE96C - strh r0, [r7, 0xE] -_081AE96C: - ldrb r0, [r7, 0x10] - ldrb r2, [r7, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - bl FillWindowPixelBuffer - ldrh r1, [r7, 0x18] - ldrh r3, [r7, 0xE] - adds r0, r7, 0 - movs r2, 0 - bl ListMenuPrintEntries - adds r0, r7, 0 - bl ListMenuDrawCursor - adds r0, r7, 0 - movs r1, 0x1 - bl ListMenuCallSelectionChangedCallback - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuInitInternal - - thumb_func_start ListMenuPrint -@ void ListMenuPrint(struct ListMenu *listMenu, u8 *str, u8 x, u8 y) -ListMenuPrint: @ 81AE9B4 - push {r4-r7,lr} - sub sp, 0x18 - adds r4, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r12, r3 - ldr r5, =gUnknown_03006300 - ldrb r1, [r5, 0x3] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _081AEA20 - add r1, sp, 0x14 - ldr r2, [r5] - lsls r0, r2, 24 - lsrs r0, 28 - movs r3, 0 - strb r0, [r1] - lsls r0, r2, 28 - lsrs r0, 28 - strb r0, [r1, 0x1] - lsls r0, r2, 20 - lsrs r0, 28 - strb r0, [r1, 0x2] - ldrb r0, [r4, 0x10] - lsls r1, r2, 1 - lsrs r1, 25 - lsls r2, 14 - lsrs r2, 26 - str r2, [sp] - str r3, [sp, 0x4] - add r2, sp, 0x14 - str r2, [sp, 0x8] - movs r2, 0x1 - negs r2, r2 - str r2, [sp, 0xC] - str r6, [sp, 0x10] - adds r2, r7, 0 - mov r3, r12 - bl AddTextPrinterParametrized2 - ldrb r1, [r5, 0x3] - movs r0, 0x7F - ands r0, r1 - strb r0, [r5, 0x3] - b _081AEA5E - .pool -_081AEA20: - add r2, sp, 0x14 - ldrb r1, [r4, 0x15] - lsls r0, r1, 28 - lsrs r0, 28 - strb r0, [r2] - ldrb r0, [r4, 0x14] - lsrs r0, 4 - strb r0, [r2, 0x1] - adds r0, r2, 0 - lsls r1, 24 - lsrs r1, 28 - strb r1, [r0, 0x2] - ldrb r0, [r4, 0x10] - ldrb r1, [r4, 0x17] - lsls r1, 26 - lsrs r1, 26 - ldrb r2, [r4, 0x16] - lsls r2, 29 - lsrs r2, 29 - str r2, [sp] - str r3, [sp, 0x4] - add r2, sp, 0x14 - str r2, [sp, 0x8] - movs r2, 0x1 - negs r2, r2 - str r2, [sp, 0xC] - str r6, [sp, 0x10] - adds r2, r7, 0 - mov r3, r12 - bl AddTextPrinterParametrized2 -_081AEA5E: - add sp, 0x18 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuPrint - - thumb_func_start ListMenuPrintEntries -@ void ListMenuPrintEntries(struct ListMenu *listMenu, u16 startIndex, u16 yOffset, u16 count) -ListMenuPrintEntries: @ 81AEA68 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp] - lsls r3, 16 - lsrs r3, 16 - mov r10, r3 - ldrb r0, [r4, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - ldrb r1, [r4, 0x16] - lsls r1, 26 - lsrs r1, 29 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r0, 0 - mov r8, r0 - cmp r8, r10 - bge _081AEB10 -_081AEAAA: - ldr r0, [r4] - mov r2, r9 - lsls r1, r2, 3 - adds r0, r1, r0 - ldr r2, [r0, 0x4] - movs r0, 0x3 - negs r0, r0 - adds r5, r1, 0 - cmp r2, r0 - beq _081AEAC2 - ldrb r6, [r4, 0x12] - b _081AEAC4 -_081AEAC2: - ldrb r6, [r4, 0x11] -_081AEAC4: - ldr r0, [sp] - add r0, r8 - ldr r2, [sp, 0x4] - adds r1, r0, 0 - muls r1, r2 - ldrb r0, [r4, 0x14] - lsls r0, 28 - lsrs r0, 28 - adds r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r7, r2, 0 - ldr r3, [r4, 0x8] - cmp r3, 0 - beq _081AEAEE - ldrb r0, [r4, 0x10] - ldr r1, [r4] - adds r1, r5, r1 - ldr r1, [r1, 0x4] - bl _call_via_r3 -_081AEAEE: - ldr r0, [r4] - adds r0, r5, r0 - ldr r1, [r0] - adds r0, r4, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl ListMenuPrint - mov r0, r9 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r0, 0x1 - add r8, r0 - cmp r8, r10 - blt _081AEAAA -_081AEB10: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuPrintEntries - - thumb_func_start ListMenuDrawCursor -@ void ListMenuDrawCursor(struct ListMenu *listMenu) -ListMenuDrawCursor: @ 81AEB20 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - ldrb r0, [r6, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - ldrb r1, [r6, 0x16] - lsls r1, 26 - lsrs r1, 29 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r6, 0x13] - mov r8, r1 - ldrh r1, [r6, 0x1A] - muls r1, r0 - ldrb r0, [r6, 0x14] - lsls r0, 28 - lsrs r0, 28 - adds r0, r1 - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r6, 0x17] - lsrs r0, 6 - cmp r0, 0x1 - beq _081AEC0C - cmp r0, 0x1 - bgt _081AEB66 - cmp r0, 0 - beq _081AEB70 - b _081AEC0C -_081AEB66: - cmp r0, 0x2 - beq _081AEB84 - cmp r0, 0x3 - beq _081AEBCC - b _081AEC0C -_081AEB70: - ldr r1, =gUnknown_085E8D60 - adds r0, r6, 0 - mov r2, r8 - adds r3, r7, 0 - bl ListMenuPrint - b _081AEC0C - .pool -_081AEB84: - ldrb r0, [r6, 0x1E] - cmp r0, 0xFF - bne _081AEB94 - adds r0, r6, 0 - movs r1, 0 - bl ListMenuAddCursorObject - strb r0, [r6, 0x1E] -_081AEB94: - ldrb r5, [r6, 0x1E] - ldrb r0, [r6, 0x10] - movs r1, 0x1 - bl GetWindowAttribute - adds r4, r0, 0 - lsls r4, 19 - ldr r0, =0xffff0000 - adds r4, r0 - lsrs r4, 16 - ldrb r0, [r6, 0x10] - movs r1, 0x2 - bl GetWindowAttribute - adds r2, r0, 0 - lsls r2, 3 - adds r2, r7 - subs r2, 0x1 - lsls r2, 16 - lsrs r2, 16 - adds r0, r5, 0 - adds r1, r4, 0 - movs r3, 0 - bl ListMenuUpdateCursorObject - b _081AEC0C - .pool -_081AEBCC: - ldrb r0, [r6, 0x1E] - cmp r0, 0xFF - bne _081AEBDC - adds r0, r6, 0 - movs r1, 0x1 - bl ListMenuAddCursorObject - strb r0, [r6, 0x1E] -_081AEBDC: - ldrb r5, [r6, 0x1E] - ldrb r0, [r6, 0x10] - movs r1, 0x1 - bl GetWindowAttribute - adds r4, r0, 0 - lsls r4, 3 - add r4, r8 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r6, 0x10] - movs r1, 0x2 - bl GetWindowAttribute - adds r2, r0, 0 - lsls r2, 3 - adds r2, r7 - lsls r2, 16 - lsrs r2, 16 - adds r0, r5, 0 - adds r1, r4, 0 - movs r3, 0x1 - bl ListMenuUpdateCursorObject -_081AEC0C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuDrawCursor - - thumb_func_start ListMenuAddCursorObject -ListMenuAddCursorObject: @ 81AEC18 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - adds r5, r1, 0 - mov r1, sp - movs r0, 0 - strb r0, [r1] - movs r0, 0xA0 - strb r0, [r1, 0x1] - ldrb r0, [r4, 0x10] - movs r1, 0x3 - bl GetWindowAttribute - mov r1, sp - lsls r0, 3 - adds r0, 0x2 - strh r0, [r1, 0x2] - ldrb r0, [r4, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - mov r1, sp - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x2 - strh r0, [r1, 0x4] - movs r0, 0x80 - lsls r0, 7 - strh r0, [r1, 0x6] - ldr r0, =0x0000ffff - strh r0, [r1, 0x8] - movs r0, 0xF - strb r0, [r1, 0xA] - mov r0, sp - adds r1, r5, 0 - bl ListMenuAddCursorObjectInternal - lsls r0, 24 - lsrs r0, 24 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuAddCursorObject - - thumb_func_start ListMenuErasePrintedCursor -ListMenuErasePrintedCursor: @ 81AEC78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r7, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - ldrb r1, [r7, 0x17] - lsrs r0, r1, 6 - cmp r0, 0 - bne _081AECF4 - lsls r0, r1, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - adds r4, r0, 0 - ldrb r0, [r7, 0x16] - lsls r0, 26 - lsrs r0, 29 - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r7, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0 - bl GetMenuCursorDimensionByFont - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldrb r0, [r7, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - ldrb r6, [r7, 0x10] - ldrb r2, [r7, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - ldrb r2, [r7, 0x13] - mov r3, r8 - muls r3, r4 - adds r4, r3, 0 - ldrb r3, [r7, 0x14] - lsls r3, 28 - lsrs r3, 28 - adds r3, r4 - lsls r3, 16 - lsrs r3, 16 - str r5, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - bl FillWindowPixelRect -_081AECF4: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuErasePrintedCursor - - thumb_func_start ListMenuUpdateSelectedRowIndexAndScrollOffset -@ u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(int, bool8 movingDown) -ListMenuUpdateSelectedRowIndexAndScrollOffset: @ 81AED00 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - ldrh r3, [r4, 0x1A] - ldrh r5, [r4, 0x18] - cmp r1, 0 - bne _081AED74 - ldrh r0, [r4, 0xE] - cmp r0, 0x1 - bne _081AED18 - movs r2, 0 - b _081AED2A -_081AED18: - ldrh r0, [r4, 0xE] - lsrs r2, r0, 1 - movs r1, 0x1 - ands r1, r0 - adds r2, r1 - subs r0, r2 - subs r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 -_081AED2A: - cmp r5, 0 - bne _081AED50 - cmp r3, 0 - beq _081AEDB6 - ldr r1, [r4] - movs r2, 0x3 - negs r2, r2 -_081AED38: - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r5, r3 - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - cmp r0, r2 - bne _081AEDBA - cmp r3, 0 - bne _081AED38 - b _081AEDB6 -_081AED50: - cmp r3, r2 - bls _081AED70 - ldr r1, [r4] - movs r6, 0x3 - negs r6, r6 -_081AED5A: - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r5, r3 - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - cmp r0, r6 - bne _081AEDBA - cmp r3, r2 - bhi _081AED5A -_081AED70: - subs r0, r5, 0x1 - b _081AEDE2 -_081AED74: - ldrh r0, [r4, 0xE] - cmp r0, 0x1 - bne _081AED7E - movs r2, 0 - b _081AED88 -_081AED7E: - ldrh r0, [r4, 0xE] - lsrs r2, r0, 1 - movs r1, 0x1 - ands r1, r0 - adds r2, r1 -_081AED88: - adds r1, r0, 0 - ldrh r0, [r4, 0xC] - subs r0, r1 - cmp r5, r0 - bne _081AEDC0 - subs r0, r1, 0x1 - cmp r3, r0 - bge _081AEDB6 - ldr r2, [r4] - movs r6, 0x3 - negs r6, r6 - adds r1, r0, 0 -_081AEDA0: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r5, r3 - lsls r0, 3 - adds r0, r2 - ldr r0, [r0, 0x4] - cmp r0, r6 - bne _081AEDBA - cmp r3, r1 - blt _081AEDA0 -_081AEDB6: - movs r0, 0 - b _081AEDE8 -_081AEDBA: - strh r3, [r4, 0x1A] - movs r0, 0x1 - b _081AEDE8 -_081AEDC0: - cmp r3, r2 - bcs _081AEDE0 - ldr r1, [r4] - movs r6, 0x3 - negs r6, r6 -_081AEDCA: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r5, r3 - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - cmp r0, r6 - bne _081AEDBA - cmp r3, r2 - bcc _081AEDCA -_081AEDE0: - adds r0, r5, 0x1 -_081AEDE2: - strh r2, [r4, 0x1A] - strh r0, [r4, 0x18] - movs r0, 0x2 -_081AEDE8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end ListMenuUpdateSelectedRowIndexAndScrollOffset - - thumb_func_start ListMenuScroll -@ void ListMenuScroll(struct ListMenu *listMenu, int a2, bool8 movingDown) -ListMenuScroll: @ 81AEDF0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r6, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - adds r7, r5, 0 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldrh r0, [r6, 0xE] - cmp r5, r0 - bcc _081AEE2A - ldrb r0, [r6, 0x10] - ldrb r2, [r6, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - bl FillWindowPixelBuffer - ldrh r1, [r6, 0x18] - ldrh r3, [r6, 0xE] - adds r0, r6, 0 - movs r2, 0 - bl ListMenuPrintEntries - b _081AEF1A -_081AEE2A: - ldrb r0, [r6, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - ldrb r1, [r6, 0x16] - lsls r1, 26 - lsrs r1, 29 - adds r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - mov r1, r8 - cmp r1, 0 - bne _081AEEBC - ldrb r0, [r6, 0x10] - adds r2, r5, 0 - muls r2, r4 - lsls r2, 24 - lsrs r2, 24 - ldrb r1, [r6, 0x15] - lsls r1, 28 - lsrs r3, r1, 4 - orrs r3, r1 - lsrs r3, 24 - movs r1, 0x1 - bl ScrollWindow - ldrh r1, [r6, 0x18] - adds r0, r6, 0 - movs r2, 0 - adds r3, r5, 0 - bl ListMenuPrintEntries - ldrh r0, [r6, 0xE] - adds r1, r0, 0 - muls r1, r4 - adds r0, r1, 0 - ldrb r4, [r6, 0x14] - lsls r4, 28 - lsrs r4, 28 - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r6, 0x10] - movs r1, 0x3 - bl GetWindowAttribute - adds r5, r0, 0 - lsls r5, 19 - lsrs r5, 16 - ldrb r0, [r6, 0x10] - movs r1, 0x4 - bl GetWindowAttribute - lsls r0, 3 - subs r0, r4 - lsls r0, 16 - lsrs r0, 16 - ldrb r3, [r6, 0x10] - ldrb r2, [r6, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - str r5, [sp] - str r0, [sp, 0x4] - adds r0, r3, 0 - movs r2, 0 - adds r3, r4, 0 - bl FillWindowPixelRect - b _081AEF1A -_081AEEBC: - ldrb r0, [r6, 0x10] - adds r2, r7, 0 - muls r2, r4 - lsls r2, 24 - lsrs r2, 24 - ldrb r1, [r6, 0x15] - lsls r1, 28 - lsrs r3, r1, 4 - orrs r3, r1 - lsrs r3, 24 - movs r1, 0 - bl ScrollWindow - ldrh r2, [r6, 0xE] - subs r2, r7 - ldrh r1, [r6, 0x18] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - adds r0, r6, 0 - adds r3, r7, 0 - bl ListMenuPrintEntries - ldrb r0, [r6, 0x10] - movs r1, 0x3 - bl GetWindowAttribute - lsls r0, 19 - lsrs r0, 16 - ldrb r3, [r6, 0x10] - ldrb r2, [r6, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - str r0, [sp] - ldrb r0, [r6, 0x14] - lsls r0, 28 - lsrs r0, 28 - str r0, [sp, 0x4] - adds r0, r3, 0 - movs r2, 0 - movs r3, 0 - bl FillWindowPixelRect -_081AEF1A: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuScroll - - thumb_func_start ListMenuChangeSelection -@ bool8 ListMenuChangeSelection(struct ListMenu *listMenu, bool8 updateCursorAndCallCallback, u8 count, bool8 movingDown) -ListMenuChangeSelection: @ 81AEF28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - ldrh r0, [r4, 0x1A] - mov r10, r0 - movs r7, 0 - movs r5, 0 - movs r0, 0 - cmp r7, r8 - bcs _081AEF90 -_081AEF56: - adds r6, r0, 0x1 - b _081AEF76 -_081AEF5A: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r4, 0x18] - ldrh r1, [r4, 0x1A] - adds r0, r1 - ldr r1, [r4] - lsls r0, 3 - adds r0, r1 - ldr r1, [r0, 0x4] - movs r0, 0x3 - negs r0, r0 - cmp r1, r0 - bne _081AEF88 -_081AEF76: - adds r0, r4, 0 - mov r1, r9 - bl ListMenuUpdateSelectedRowIndexAndScrollOffset - lsls r0, 24 - lsrs r0, 24 - orrs r5, r0 - cmp r0, 0x2 - beq _081AEF5A -_081AEF88: - lsls r0, r6, 24 - lsrs r0, 24 - cmp r0, r8 - bcc _081AEF56 -_081AEF90: - ldr r0, [sp] - cmp r0, 0 - beq _081AEFEE - cmp r5, 0x1 - beq _081AEFA6 - cmp r5, 0x1 - ble _081AEFA2 - cmp r5, 0x3 - ble _081AEFC6 -_081AEFA2: - movs r0, 0x1 - b _081AEFF0 -_081AEFA6: - adds r0, r4, 0 - mov r1, r10 - bl ListMenuErasePrintedCursor - adds r0, r4, 0 - bl ListMenuDrawCursor - adds r0, r4, 0 - movs r1, 0 - bl ListMenuCallSelectionChangedCallback - ldrb r0, [r4, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - b _081AEFEE -_081AEFC6: - adds r0, r4, 0 - mov r1, r10 - bl ListMenuErasePrintedCursor - adds r0, r4, 0 - adds r1, r7, 0 - mov r2, r9 - bl ListMenuScroll - adds r0, r4, 0 - bl ListMenuDrawCursor - adds r0, r4, 0 - movs r1, 0 - bl ListMenuCallSelectionChangedCallback - ldrb r0, [r4, 0x10] - movs r1, 0x2 - bl CopyWindowToVram -_081AEFEE: - movs r0, 0 -_081AEFF0: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end ListMenuChangeSelection - - thumb_func_start ListMenuCallSelectionChangedCallback -@ void ListMenuCallSelectionChangedCallback(struct ListMenu *listMenu, u8 a2) -ListMenuCallSelectionChangedCallback: @ 81AF000 - push {r4,lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r3, [r2, 0x4] - cmp r3, 0 - beq _081AF022 - ldrh r0, [r2, 0x18] - ldrh r1, [r2, 0x1A] - adds r0, r1 - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - adds r1, r4, 0 - bl _call_via_r3 -_081AF022: - pop {r4} - pop {r0} - bx r0 - thumb_func_end ListMenuCallSelectionChangedCallback - - thumb_func_start sub_81AF028 -sub_81AF028: @ 81AF028 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r6, =gUnknown_03006300 - movs r5, 0xF - ands r0, r5 - ldrb r3, [r6] - mov r8, r3 - movs r4, 0x10 - negs r4, r4 - adds r3, r4, 0 - mov r7, r8 - ands r3, r7 - orrs r3, r0 - lsrs r1, 20 - ands r3, r5 - orrs r3, r1 - strb r3, [r6] - ands r2, r5 - ldrb r0, [r6, 0x1] - ands r4, r0 - orrs r4, r2 - strb r4, [r6, 0x1] - ldrb r0, [r6, 0x3] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r6, 0x3] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AF028 - - thumb_func_start sub_81AF078 -sub_81AF078: @ 81AF078 - push {lr} - lsls r1, 24 - cmp r1, 0 - bne _081AF086 - movs r0, 0x5 - bl PlaySE -_081AF086: - pop {r0} - bx r0 - thumb_func_end sub_81AF078 - - thumb_func_start sub_81AF08C -sub_81AF08C: @ 81AF08C - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r2, r1, r0 - cmp r3, 0x10 - bhi _081AF154 - lsls r0, r3, 2 - ldr r1, =_081AF0B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AF0B8: - .4byte _081AF0FC - .4byte _081AF0FC - .4byte _081AF100 - .4byte _081AF104 - .4byte _081AF108 - .4byte _081AF10C - .4byte _081AF110 - .4byte _081AF114 - .4byte _081AF118 - .4byte _081AF11C - .4byte _081AF122 - .4byte _081AF12A - .4byte _081AF130 - .4byte _081AF138 - .4byte _081AF140 - .4byte _081AF146 - .4byte _081AF14E -_081AF0FC: - ldr r0, [r2, 0x4] - b _081AF158 -_081AF100: - ldrh r0, [r2, 0xC] - b _081AF158 -_081AF104: - ldrh r0, [r2, 0xE] - b _081AF158 -_081AF108: - ldrb r0, [r2, 0x10] - b _081AF158 -_081AF10C: - ldrb r0, [r2, 0x11] - b _081AF158 -_081AF110: - ldrb r0, [r2, 0x12] - b _081AF158 -_081AF114: - ldrb r0, [r2, 0x13] - b _081AF158 -_081AF118: - ldrb r0, [r2, 0x14] - b _081AF124 -_081AF11C: - ldrb r0, [r2, 0x14] - lsrs r0, 4 - b _081AF158 -_081AF122: - ldrb r0, [r2, 0x15] -_081AF124: - lsls r0, 28 - lsrs r0, 28 - b _081AF158 -_081AF12A: - ldrb r0, [r2, 0x15] - lsrs r0, 4 - b _081AF158 -_081AF130: - ldrb r0, [r2, 0x16] - lsls r0, 29 - lsrs r0, 29 - b _081AF158 -_081AF138: - ldrb r0, [r2, 0x16] - lsls r0, 26 - lsrs r0, 29 - b _081AF158 -_081AF140: - ldrb r0, [r2, 0x16] - lsrs r0, 6 - b _081AF158 -_081AF146: - ldrb r0, [r2, 0x17] - lsls r0, 26 - lsrs r0, 26 - b _081AF158 -_081AF14E: - ldrb r0, [r2, 0x17] - lsrs r0, 6 - b _081AF158 -_081AF154: - movs r0, 0x1 - negs r0, r0 -_081AF158: - pop {r1} - bx r1 - thumb_func_end sub_81AF08C - - thumb_func_start sub_81AF15C -sub_81AF15C: @ 81AF15C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r3, r1, r0 - cmp r4, 0x10 - bhi _081AF25C - lsls r0, r4, 2 - ldr r1, =_081AF188 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AF188: - .4byte _081AF1CC - .4byte _081AF1CC - .4byte _081AF1D0 - .4byte _081AF1D4 - .4byte _081AF1D8 - .4byte _081AF1DC - .4byte _081AF1E0 - .4byte _081AF1E4 - .4byte _081AF1E8 - .4byte _081AF1F4 - .4byte _081AF202 - .4byte _081AF20E - .4byte _081AF21C - .4byte _081AF228 - .4byte _081AF236 - .4byte _081AF244 - .4byte _081AF250 -_081AF1CC: - str r2, [r3, 0x4] - b _081AF25C -_081AF1D0: - strh r2, [r3, 0xC] - b _081AF25C -_081AF1D4: - strh r2, [r3, 0xE] - b _081AF25C -_081AF1D8: - strb r2, [r3, 0x10] - b _081AF25C -_081AF1DC: - strb r2, [r3, 0x11] - b _081AF25C -_081AF1E0: - strb r2, [r3, 0x12] - b _081AF25C -_081AF1E4: - strb r2, [r3, 0x13] - b _081AF25C -_081AF1E8: - movs r0, 0xF - ands r2, r0 - ldrb r1, [r3, 0x14] - movs r0, 0x10 - negs r0, r0 - b _081AF1FA -_081AF1F4: - lsls r2, 4 - ldrb r1, [r3, 0x14] - movs r0, 0xF -_081AF1FA: - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x14] - b _081AF25C -_081AF202: - movs r0, 0xF - ands r2, r0 - ldrb r1, [r3, 0x15] - movs r0, 0x10 - negs r0, r0 - b _081AF214 -_081AF20E: - lsls r2, 4 - ldrb r1, [r3, 0x15] - movs r0, 0xF -_081AF214: - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x15] - b _081AF25C -_081AF21C: - movs r0, 0x7 - ands r2, r0 - ldrb r1, [r3, 0x16] - movs r0, 0x8 - negs r0, r0 - b _081AF23C -_081AF228: - movs r0, 0x7 - ands r2, r0 - lsls r2, 3 - ldrb r1, [r3, 0x16] - movs r0, 0x39 - negs r0, r0 - b _081AF23C -_081AF236: - lsls r2, 6 - ldrb r1, [r3, 0x16] - movs r0, 0x3F -_081AF23C: - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x16] - b _081AF25C -_081AF244: - movs r0, 0x3F - ands r2, r0 - ldrb r1, [r3, 0x17] - movs r0, 0x40 - negs r0, r0 - b _081AF256 -_081AF250: - lsls r2, 6 - ldrb r1, [r3, 0x17] - movs r0, 0x3F -_081AF256: - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x17] -_081AF25C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81AF15C - - thumb_func_start sub_81AF264 -sub_81AF264: @ 81AF264 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081AF276 - cmp r0, 0x1 - beq _081AF28A - b _081AF2E4 -_081AF276: - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartSpriteAnim - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _081AF2E4 -_081AF28A: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081AF29A - cmp r0, 0x1 - beq _081AF2C0 - ldrh r2, [r4, 0x38] - b _081AF2DE -_081AF29A: - movs r0, 0x34 - ldrsh r3, [r4, r0] - ldr r1, =gSineTable - ldrh r2, [r4, 0x38] - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - muls r0, r3 - cmp r0, 0 - bge _081AF2B4 - adds r0, 0xFF -_081AF2B4: - asrs r0, 8 - strh r0, [r4, 0x24] - b _081AF2DE - .pool -_081AF2C0: - movs r0, 0x34 - ldrsh r3, [r4, r0] - ldr r1, =gSineTable - ldrh r2, [r4, 0x38] - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - muls r0, r3 - cmp r0, 0 - bge _081AF2DA - adds r0, 0xFF -_081AF2DA: - asrs r0, 8 - strh r0, [r4, 0x26] -_081AF2DE: - ldrh r0, [r4, 0x36] - adds r0, r2, r0 - strh r0, [r4, 0x38] -_081AF2E4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AF264 - - thumb_func_start AddScrollIndicatorArrowObject -AddScrollIndicatorArrowObject: @ 81AF2F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - adds r6, r0, 0 - ldr r5, [sp, 0x30] - lsls r6, 24 - lsrs r6, 24 - mov r8, r6 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r5, 16 - lsrs r5, 16 - mov r12, r5 - mov r4, sp - ldr r0, =gUnknown_08614244 - ldm r0!, {r5-r7} - stm r4!, {r5-r7} - ldm r0!, {r5-r7} - stm r4!, {r5-r7} - mov r0, sp - movs r4, 0 - strh r3, [r0] - mov r3, r12 - strh r3, [r0, 0x2] - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSprites - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r3, r1 - adds r5, r3, 0 - adds r5, 0x3E - ldrb r1, [r5] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r5] - strh r4, [r3, 0x2E] - ldr r1, =gUnknown_086141FC - mov r5, r8 - lsls r6, r5, 2 - adds r6, r1 - ldrb r2, [r6] - lsls r1, r2, 28 - lsrs r1, 28 - strh r1, [r3, 0x30] - lsrs r2, 4 - strh r2, [r3, 0x32] - ldrb r1, [r6, 0x1] - strh r1, [r3, 0x34] - ldrh r1, [r6, 0x2] - strh r1, [r3, 0x36] - strh r4, [r3, 0x38] - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddScrollIndicatorArrowObject - - thumb_func_start AddScrollIndicatorArrowPair -AddScrollIndicatorArrowPair: @ 81AF380 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - adds r6, r0, 0 - mov r9, r1 - ldr r0, =gUnknown_086142C8 - str r0, [sp, 0x4] - ldr r5, =0xffff0000 - ldr r0, [sp, 0x8] - ands r0, r5 - movs r1, 0x80 - lsls r1, 1 - orrs r0, r1 - ldrh r1, [r6, 0xA] - lsls r1, 16 - ldr r4, =0x0000ffff - ands r0, r4 - orrs r0, r1 - str r0, [sp, 0x8] - add r0, sp, 0x4 - bl LoadCompressedObjectPic - ldrh r2, [r6, 0xC] - cmp r2, r4 - bne _081AF3DC - ldr r0, =gUnknown_086142A8 - ldrb r1, [r6, 0xE] - lsls r1, 20 - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl LoadPalette - b _081AF3EE - .pool -_081AF3DC: - ldr r0, =gUnknown_086142A8 - str r0, [sp, 0xC] - add r0, sp, 0xC - ldr r1, [r0, 0x4] - ands r1, r5 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadSpritePalette -_081AF3EE: - ldr r0, =Task_ScrollIndicatorArrowPair - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - movs r0, 0 - strb r0, [r7] - mov r0, r9 - str r0, [r7, 0x4] - ldrh r0, [r6, 0x6] - strh r0, [r7, 0x8] - ldrh r0, [r6, 0x8] - strh r0, [r7, 0xA] - ldrh r0, [r6, 0xA] - strh r0, [r7, 0xE] - ldrh r0, [r6, 0xC] - strh r0, [r7, 0x10] - ldrb r0, [r6] - ldrb r1, [r6, 0x1] - ldrb r2, [r6, 0x2] - ldrh r3, [r6, 0xA] - ldrh r4, [r6, 0xC] - str r4, [sp] - bl AddScrollIndicatorArrowObject - strb r0, [r7, 0xC] - ldrb r0, [r6, 0x3] - ldrb r1, [r6, 0x4] - ldrb r2, [r6, 0x5] - ldrh r3, [r6, 0xA] - ldrh r4, [r6, 0xC] - str r4, [sp] - bl AddScrollIndicatorArrowObject - strb r0, [r7, 0xD] - ldrh r1, [r6, 0xC] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081AF47C - ldr r5, =gSprites - ldrb r0, [r7, 0xC] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r3, [r6, 0xE] - lsls r3, 4 - ldrb r4, [r1, 0x5] - movs r2, 0xF - adds r0, r2, 0 - ands r0, r4 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r1, [r7, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r6, 0xE] - lsls r1, 4 - ldrb r3, [r0, 0x5] - ands r2, r3 - orrs r2, r1 - strb r2, [r0, 0x5] -_081AF47C: - mov r0, r8 - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddScrollIndicatorArrowPair - - thumb_func_start AddScrollIndicatorArrowPairParametrized -AddScrollIndicatorArrowPairParametrized: @ 81AF4A0 - push {r4,lr} - adds r4, r1, 0 - subs r0, 0x2 - cmp r0, 0x1 - bhi _081AF4C4 - ldr r0, =gUnknown_0203CE8C - movs r1, 0x2 - strb r1, [r0] - strb r4, [r0, 0x1] - strb r2, [r0, 0x2] - movs r1, 0x3 - strb r1, [r0, 0x3] - strb r4, [r0, 0x4] - strb r3, [r0, 0x5] - b _081AF4D6 - .pool -_081AF4C4: - ldr r0, =gUnknown_0203CE8C - movs r1, 0 - strb r1, [r0] - strb r2, [r0, 0x1] - strb r4, [r0, 0x2] - movs r1, 0x1 - strb r1, [r0, 0x3] - strb r3, [r0, 0x4] - strb r4, [r0, 0x5] -_081AF4D6: - adds r2, r0, 0 - movs r1, 0 - movs r0, 0 - strh r0, [r2, 0x6] - ldr r0, [sp, 0x8] - strh r0, [r2, 0x8] - ldr r0, [sp, 0xC] - strh r0, [r2, 0xA] - ldr r0, [sp, 0x10] - strh r0, [r2, 0xC] - strb r1, [r2, 0xE] - adds r0, r2, 0 - ldr r1, [sp, 0x14] - bl AddScrollIndicatorArrowPair - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end AddScrollIndicatorArrowPairParametrized - - thumb_func_start Task_ScrollIndicatorArrowPair -Task_ScrollIndicatorArrowPair: @ 81AF504 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - ldr r0, [r4, 0x4] - ldrh r5, [r0] - ldrh r0, [r4, 0x8] - cmp r5, r0 - bne _081AF548 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _081AF548 - ldr r3, =gSprites - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081AF55E - .pool -_081AF548: - ldr r3, =gSprites - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081AF55E: - strb r1, [r0] - ldrh r0, [r4, 0xA] - cmp r5, r0 - bne _081AF580 - ldrb r1, [r4, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081AF594 - .pool -_081AF580: - ldrb r1, [r4, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081AF594: - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end Task_ScrollIndicatorArrowPair - - thumb_func_start Task_ScrollIndicatorArrowPairOnMainMenu -Task_ScrollIndicatorArrowPairOnMainMenu: @ 81AF59C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081AF5E8 - ldr r3, =gSprites - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrb r1, [r4, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081AF612 - .pool -_081AF5E8: - ldr r3, =gSprites - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r4, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081AF612: - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Task_ScrollIndicatorArrowPairOnMainMenu - - thumb_func_start RemoveScrollIndicatorArrowPair -RemoveScrollIndicatorArrowPair: @ 81AF620 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldrh r0, [r5, 0xE] - ldr r4, =0x0000ffff - cmp r0, r4 - beq _081AF63E - bl FreeSpriteTilesByTag -_081AF63E: - ldrh r0, [r5, 0x10] - cmp r0, r4 - beq _081AF648 - bl FreeSpritePaletteByTag -_081AF648: - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl DestroySprite - ldrb r1, [r5, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - adds r0, r6, 0 - bl DestroyTask - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveScrollIndicatorArrowPair - - thumb_func_start ListMenuAddCursorObjectInternal -ListMenuAddCursorObjectInternal: @ 81AF680 - push {lr} - cmp r1, 0 - beq _081AF68A - cmp r1, 0x1 - beq _081AF690 -_081AF68A: - bl ListMenuAddRedOutlineCursorObject - b _081AF694 -_081AF690: - bl ListMenuAddRedArrowCursorObject -_081AF694: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end ListMenuAddCursorObjectInternal - - thumb_func_start ListMenuUpdateCursorObject -@ void ListMenuUpdateCursorObject(u8 taskId, u16 x, u16 y, u32 a4) -ListMenuUpdateCursorObject: @ 81AF69C - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - cmp r3, 0 - beq _081AF6B4 - cmp r3, 0x1 - beq _081AF6BA - b _081AF6BE -_081AF6B4: - bl ListMenuUpdateRedOutlineCursorObject - b _081AF6BE -_081AF6BA: - bl ListMenuUpdateRedArrowCursorObject -_081AF6BE: - pop {r0} - bx r0 - thumb_func_end ListMenuUpdateCursorObject - - thumb_func_start ListMenuRemoveCursorObject -ListMenuRemoveCursorObject: @ 81AF6C4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r1, 0 - beq _081AF6D4 - cmp r1, 0x1 - beq _081AF6DA - b _081AF6DE -_081AF6D4: - bl ListMenuRemoveRedOutlineCursorObject - b _081AF6DE -_081AF6DA: - bl ListMenuRemoveRedArrowCursorObject -_081AF6DE: - pop {r0} - bx r0 - thumb_func_end ListMenuRemoveCursorObject - - thumb_func_start Task_RedOutlineCursor -Task_RedOutlineCursor: @ 81AF6E4 - bx lr - thumb_func_end Task_RedOutlineCursor - - thumb_func_start ListMenuGetRedOutlineCursorSpriteCount -ListMenuGetRedOutlineCursorSpriteCount: @ 81AF6E8 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - movs r3, 0x4 - cmp r0, 0x10 - bls _081AF708 - movs r2, 0x8 - subs r0, 0x8 - cmp r2, r0 - bge _081AF708 -_081AF700: - adds r3, 0x2 - adds r2, 0x8 - cmp r2, r0 - blt _081AF700 -_081AF708: - cmp r1, 0x10 - bls _081AF71C - movs r2, 0x8 - subs r1, 0x8 - cmp r2, r1 - bge _081AF71C -_081AF714: - adds r3, 0x2 - adds r2, 0x8 - cmp r2, r1 - blt _081AF714 -_081AF71C: - lsls r0, r3, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end ListMenuGetRedOutlineCursorSpriteCount - - thumb_func_start ListMenuSetUpRedOutlineCursorSpriteOamTable -ListMenuSetUpRedOutlineCursorSpriteOamTable: @ 81AF724 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r3, r2, 0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - ldr r0, =gUnknown_0861425C - ldr r0, [r0] - str r0, [r3] - movs r1, 0x88 - strb r1, [r3] - strb r1, [r3, 0x1] - ldr r0, =gUnknown_08614260 - ldr r0, [r0] - str r0, [r3, 0x4] - mov r2, r8 - adds r2, 0x80 - strb r2, [r3, 0x4] - strb r1, [r3, 0x5] - ldr r0, =gUnknown_08614274 - ldr r0, [r0] - str r0, [r3, 0x8] - strb r1, [r3, 0x8] - mov r4, r9 - adds r4, 0x80 - strb r4, [r3, 0x9] - ldr r0, =gUnknown_08614278 - ldr r0, [r0] - str r0, [r3, 0xC] - strb r2, [r3, 0xC] - strb r4, [r3, 0xD] - movs r0, 0x4 - mov r12, r0 - mov r2, r8 - cmp r2, 0x10 - bls _081AF7B8 - movs r2, 0x8 - mov r5, r8 - subs r5, 0x8 - cmp r2, r5 - bge _081AF7B8 - ldr r0, =gUnknown_08614264 - ldr r0, [r0] - str r0, [sp] - ldr r0, =gUnknown_08614270 - ldr r6, [r0] - adds r1, r3, 0 - adds r1, 0x10 - movs r7, 0x88 - mov r10, r7 -_081AF796: - ldr r0, [sp] - str r0, [r1] - adds r0, r2, 0 - subs r0, 0x78 - strb r0, [r1] - mov r7, r10 - strb r7, [r1, 0x1] - adds r1, 0x4 - str r6, [r1] - strb r0, [r1] - strb r4, [r1, 0x1] - adds r1, 0x4 - movs r0, 0x2 - add r12, r0 - adds r2, 0x8 - cmp r2, r5 - blt _081AF796 -_081AF7B8: - mov r2, r9 - cmp r2, 0x10 - bls _081AF7F6 - movs r1, 0x8 - mov r4, r9 - subs r4, 0x8 - cmp r1, r4 - bge _081AF7F6 - ldr r0, =gUnknown_08614268 - ldr r6, [r0] - ldr r0, =gUnknown_0861426C - ldr r5, [r0] - mov r7, r12 - lsls r0, r7, 2 - adds r2, r0, r3 - movs r7, 0x88 - mov r3, r8 - adds r3, 0x80 -_081AF7DC: - str r6, [r2] - strb r7, [r2] - adds r0, r1, 0 - subs r0, 0x78 - strb r0, [r2, 0x1] - adds r2, 0x4 - str r5, [r2] - strb r3, [r2] - strb r0, [r2, 0x1] - adds r2, 0x4 - adds r1, 0x8 - cmp r1, r4 - blt _081AF7DC -_081AF7F6: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuSetUpRedOutlineCursorSpriteOamTable - - thumb_func_start ListMenuAddRedOutlineCursorObject -ListMenuAddRedOutlineCursorObject: @ 81AF828 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x28 - adds r6, r0, 0 - ldr r0, =gUnknown_08614338 - str r0, [sp, 0x18] - ldr r5, =0xffff0000 - add r0, sp, 0x18 - ldr r1, [r0, 0x4] - ands r1, r5 - movs r2, 0x80 - lsls r2, 1 - orrs r1, r2 - ldrh r2, [r6, 0x6] - lsls r2, 16 - ldr r3, =0x0000ffff - ands r1, r3 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadCompressedObjectPic - ldrh r2, [r6, 0x8] - ldr r7, =0x0000ffff - cmp r2, r7 - bne _081AF884 - ldr r0, =gUnknown_086142A8 - ldrb r1, [r6, 0xA] - lsls r1, 20 - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl LoadPalette - b _081AF896 - .pool -_081AF884: - ldr r0, =gUnknown_086142A8 - str r0, [sp, 0x20] - add r0, sp, 0x20 - ldr r1, [r0, 0x4] - ands r1, r5 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadSpritePalette -_081AF896: - ldr r0, =Task_RedOutlineCursor - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldrh r0, [r6, 0x6] - movs r3, 0 - mov r8, r3 - strh r0, [r5, 0xE] - ldrh r0, [r6, 0x8] - strh r0, [r5, 0x10] - ldrh r0, [r6, 0x2] - ldrh r1, [r6, 0x4] - bl ListMenuGetRedOutlineCursorSpriteCount - strb r0, [r5] - ldrb r0, [r5] - lsls r0, 2 - bl Alloc - adds r2, r0, 0 - str r2, [r5, 0x8] - str r2, [r5, 0x4] - ldrh r0, [r6, 0x2] - ldrh r1, [r6, 0x4] - bl ListMenuSetUpRedOutlineCursorSpriteOamTable - mov r1, sp - ldr r0, =gDummySpriteTemplate - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - mov r1, sp - ldrh r0, [r6, 0x6] - strh r0, [r1] - ldrh r0, [r6, 0x8] - strh r0, [r1, 0x2] - ldrb r1, [r6] - adds r1, 0x78 - ldrb r2, [r6, 0x1] - adds r2, 0x78 - mov r0, sp - movs r3, 0 - bl CreateSprite - strb r0, [r5, 0xC] - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r7, =gSprites - adds r0, r7 - adds r1, r5, 0 - bl SetSubspriteTables - ldrb r0, [r5, 0xC] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r0, 0x43 - mov r1, r8 - strb r1, [r0] - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r0, 0x42 - ldrb r2, [r0] - movs r1, 0x40 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrh r1, [r6, 0x8] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081AF96E - ldrb r0, [r5, 0xC] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r6, 0xA] - lsls r2, 4 - ldrb r3, [r1, 0x5] - movs r0, 0xF - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] -_081AF96E: - adds r0, r4, 0 - add sp, 0x28 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuAddRedOutlineCursorObject - - thumb_func_start ListMenuUpdateRedOutlineCursorObject -@ void ListMenuUpdateRedOutlineCursorObject(u8 taskId, u16 x, u16 y) -ListMenuUpdateRedOutlineCursorObject: @ 81AF994 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - lsls r3, r0, 2 - adds r3, r0 - lsls r3, 3 - ldr r0, =gTasks + 0x8 - adds r3, r0 - ldr r5, =gSprites - ldrb r4, [r3, 0xC] - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - adds r1, 0x78 - strh r1, [r0, 0x20] - ldrb r1, [r3, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r2, 0x78 - strh r2, [r0, 0x22] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuUpdateRedOutlineCursorObject - - thumb_func_start ListMenuRemoveRedOutlineCursorObject -ListMenuRemoveRedOutlineCursorObject: @ 81AF9D8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r0, [r4, 0x8] - bl Free - ldrh r0, [r4, 0xE] - ldr r6, =0x0000ffff - cmp r0, r6 - beq _081AF9FC - bl FreeSpriteTilesByTag -_081AF9FC: - ldrh r0, [r4, 0x10] - cmp r0, r6 - beq _081AFA06 - bl FreeSpritePaletteByTag -_081AFA06: - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r5, 0 - bl DestroyTask - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuRemoveRedOutlineCursorObject - - thumb_func_start ObjectCB_RedArrowCursor -ObjectCB_RedArrowCursor: @ 81AFA30 - push {lr} - adds r2, r0, 0 - ldr r1, =gSineTable - ldrh r3, [r2, 0x2E] - lsls r0, r3, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _081AFA48 - adds r0, 0x3F -_081AFA48: - asrs r0, 6 - strh r0, [r2, 0x24] - adds r0, r3, 0 - adds r0, 0x8 - strh r0, [r2, 0x2E] - pop {r0} - bx r0 - .pool - thumb_func_end ObjectCB_RedArrowCursor - - thumb_func_start Task_RedArrowCursor -Task_RedArrowCursor: @ 81AFA5C - bx lr - thumb_func_end Task_RedArrowCursor - - thumb_func_start ListMenuAddRedArrowCursorObject -ListMenuAddRedArrowCursorObject: @ 81AFA60 - push {r4-r7,lr} - sub sp, 0x28 - adds r5, r0, 0 - ldr r0, =gUnknown_08614378 - str r0, [sp, 0x18] - ldr r6, =0xffff0000 - add r0, sp, 0x18 - ldr r1, [r0, 0x4] - ands r1, r6 - movs r2, 0x80 - orrs r1, r2 - ldrh r2, [r5, 0x6] - lsls r2, 16 - ldr r4, =0x0000ffff - ands r1, r4 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadCompressedObjectPic - ldrh r2, [r5, 0x8] - cmp r2, r4 - bne _081AFAB4 - ldr r0, =gUnknown_086142A8 - ldrb r1, [r5, 0xA] - lsls r1, 20 - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl LoadPalette - b _081AFAC6 - .pool -_081AFAB4: - ldr r0, =gUnknown_086142A8 - str r0, [sp, 0x20] - add r0, sp, 0x20 - ldr r1, [r0, 0x4] - ands r1, r6 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadSpritePalette -_081AFAC6: - ldr r0, =Task_RedArrowCursor - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x2] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x4] - mov r1, sp - ldr r0, =gUnknown_08614290 - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - mov r1, sp - ldrh r0, [r5, 0x6] - strh r0, [r1] - ldrh r0, [r5, 0x8] - strh r0, [r1, 0x2] - ldrb r1, [r5] - ldrb r2, [r5, 0x1] - mov r0, sp - movs r3, 0 - bl CreateSprite - strb r0, [r4] - ldr r3, =gSprites - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r2, 0x8 - strh r2, [r0, 0x24] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x26] - ldrh r1, [r5, 0x8] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081AFB46 - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r5, 0xA] - lsls r2, 4 - ldrb r3, [r1, 0x5] - movs r0, 0xF - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] -_081AFB46: - adds r0, r6, 0 - add sp, 0x28 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuAddRedArrowCursorObject - - thumb_func_start ListMenuUpdateRedArrowCursorObject -@ void ListMenuUpdateRedArrowCursorObject(u8 taskId, u16 x, u16 y) -ListMenuUpdateRedArrowCursorObject: @ 81AFB68 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r3, r0, 2 - adds r3, r0 - lsls r3, 3 - ldr r0, =gTasks + 0x8 - adds r3, r0 - ldr r5, =gSprites - ldrb r4, [r3] - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - strh r1, [r0, 0x20] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuUpdateRedArrowCursorObject - - thumb_func_start ListMenuRemoveRedArrowCursorObject -ListMenuRemoveRedArrowCursorObject: @ 81AFBA0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4, 0x2] - ldr r6, =0x0000ffff - cmp r0, r6 - beq _081AFBBE - bl FreeSpriteTilesByTag -_081AFBBE: - ldrh r0, [r4, 0x4] - cmp r0, r6 - beq _081AFBC8 - bl FreeSpritePaletteByTag -_081AFBC8: - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r5, 0 - bl DestroyTask - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuRemoveRedArrowCursorObject - - thumb_func_start sub_81AFBF0 -sub_81AFBF0: @ 81AFBF0 - push {lr} - ldr r1, =gUnknown_0203CE9C - movs r2, 0 - adds r0, r1, 0 - adds r0, 0x1C -_081AFBFA: - str r2, [r0] - subs r0, 0x4 - cmp r0, r1 - bge _081AFBFA - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AFBF0 - - thumb_func_start sub_81AFC0C -sub_81AFC0C: @ 81AFC0C - push {lr} - adds r2, r1, 0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x7 - bhi _081AFC20 - ldr r1, =gUnknown_0203CE9C - lsls r0, 2 - adds r0, r1 - str r2, [r0] -_081AFC20: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AFC0C - - thumb_func_start sub_81AFC28 -sub_81AFC28: @ 81AFC28 - push {r4,r5,lr} - adds r2, r0, 0 - adds r4, r1, 0 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - beq _081AFC68 - ldr r5, =gUnknown_0203CE9C -_081AFC38: - cmp r1, 0xF7 - beq _081AFC48 - strb r1, [r2] - adds r4, 0x1 - adds r2, 0x1 - b _081AFC60 - .pool -_081AFC48: - adds r4, 0x1 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - cmp r1, 0 - beq _081AFC5E - adds r0, r2, 0 - bl StringCopy - adds r2, r0, 0 -_081AFC5E: - adds r4, 0x1 -_081AFC60: - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _081AFC38 -_081AFC68: - movs r0, 0xFF - strb r0, [r2] - adds r0, r2, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81AFC28 - - thumb_func_start sub_81AFC74 -sub_81AFC74: @ 81AFC74 - lsls r0, 24 - ldr r1, =gUnknown_0203CE9C - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - bx lr - .pool - thumb_func_end sub_81AFC74 - - thumb_func_start sav1_are_mapnumbers_in_given_list -sav1_are_mapnumbers_in_given_list: @ 81AFC84 - push {r4,lr} - adds r2, r0, 0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - lsls r1, 8 - ldrb r0, [r0, 0x5] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 - lsls r0, 16 - lsrs r3, r0, 16 - ldrh r0, [r2] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _081AFCC4 - adds r4, r1, 0 - adds r1, r2, 0 -_081AFCAA: - ldrh r0, [r1] - cmp r0, r3 - bne _081AFCBC - movs r0, 0x1 - b _081AFCC6 - .pool -_081AFCBC: - adds r1, 0x2 - ldrh r0, [r1] - cmp r0, r4 - bne _081AFCAA -_081AFCC4: - movs r0, 0 -_081AFCC6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sav1_are_mapnumbers_in_given_list - - thumb_func_start sav1_is_in_pokecenter -sav1_is_in_pokecenter: @ 81AFCCC - push {lr} - ldr r0, =gUnknown_086143BC - bl sav1_are_mapnumbers_in_given_list - pop {r1} - bx r1 - .pool - thumb_func_end sav1_is_in_pokecenter - - thumb_func_start sub_81AFCDC -sub_81AFCDC: @ 81AFCDC - push {lr} - ldr r0, =gUnknown_0861440A - bl sav1_are_mapnumbers_in_given_list - pop {r1} - bx r1 - .pool - thumb_func_end sub_81AFCDC - - thumb_func_start sub_81AFCEC -sub_81AFCEC: @ 81AFCEC - push {lr} - ldr r0, =gUnknown_0861440E - bl sav1_are_mapnumbers_in_given_list - pop {r1} - bx r1 - .pool - thumb_func_end sub_81AFCEC - - thumb_func_start sav2_set_x9_bit3_when_sav1_in_pokecenter -sav2_set_x9_bit3_when_sav1_in_pokecenter: @ 81AFCFC - push {lr} - bl sav1_is_in_pokecenter - cmp r0, 0 - bne _081AFD18 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0xFD - ands r0, r1 - b _081AFD22 - .pool -_081AFD18: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0x2 - orrs r0, r1 -_081AFD22: - strb r0, [r2, 0x9] - pop {r0} - bx r0 - .pool - thumb_func_end sav2_set_x9_bit3_when_sav1_in_pokecenter - - thumb_func_start sub_81AFD2C -sub_81AFD2C: @ 81AFD2C - push {lr} - bl sub_81AFCDC - cmp r0, 0 - bne _081AFD48 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0xFB - ands r0, r1 - b _081AFD52 - .pool -_081AFD48: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0x4 - orrs r0, r1 -_081AFD52: - strb r0, [r2, 0x9] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AFD2C - - thumb_func_start sub_81AFD5C -sub_81AFD5C: @ 81AFD5C - push {lr} - bl sub_81AFCEC - cmp r0, 0 - bne _081AFD78 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0xF7 - ands r0, r1 - b _081AFD82 - .pool -_081AFD78: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0x8 - orrs r0, r1 -_081AFD82: - strb r0, [r2, 0x9] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AFD5C - - thumb_func_start sav2_set_x9_depending_on_sav1_map -sav2_set_x9_depending_on_sav1_map: @ 81AFD8C - push {lr} - bl sav2_set_x9_bit3_when_sav1_in_pokecenter - bl sub_81AFD2C - bl sub_81AFD5C - pop {r0} - bx r0 - thumb_func_end sav2_set_x9_depending_on_sav1_map - - thumb_func_start sub_81AFDA0 -sub_81AFDA0: @ 81AFDA0 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r2, 0xA8 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 8 - orrs r0, r1 - movs r1, 0x1 - orrs r0, r1 - movs r1, 0x2 - orrs r0, r1 - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x10 - orrs r0, r1 - movs r1, 0x20 - orrs r0, r1 - movs r1, 0x8 - orrs r0, r1 - str r0, [r2] - bx lr - .pool - thumb_func_end sub_81AFDA0 - - thumb_func_start sub_81AFDD0 -sub_81AFDD0: @ 81AFDD0 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0x80 - orrs r0, r1 - strb r0, [r2, 0x9] - bx lr - .pool - thumb_func_end sub_81AFDD0 - - thumb_func_start AllocItemIconTemporaryBuffers -@ bool8 AllocItemIconTemporaryBuffers() -AllocItemIconTemporaryBuffers: @ 81AFDE4 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CEBC - movs r0, 0x90 - lsls r0, 1 - bl Alloc - str r0, [r5] - cmp r0, 0 - beq _081AFE1A - ldr r4, =gUnknown_0203CEC0 - movs r0, 0x80 - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - cmp r0, 0 - beq _081AFE14 - movs r0, 0x1 - b _081AFE1C - .pool -_081AFE14: - ldr r0, [r5] - bl Free -_081AFE1A: - movs r0, 0 -_081AFE1C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end AllocItemIconTemporaryBuffers - - thumb_func_start FreeItemIconTemporaryBuffers -@ void FreeItemIconTemporaryBuffers() -FreeItemIconTemporaryBuffers: @ 81AFE24 - push {lr} - ldr r0, =gUnknown_0203CEBC - ldr r0, [r0] - bl Free - ldr r0, =gUnknown_0203CEC0 - ldr r0, [r0] - bl Free - pop {r0} - bx r0 - .pool - thumb_func_end FreeItemIconTemporaryBuffers - - thumb_func_start CopyItemIconPicTo4x4Buffer -@ void CopyItemIconPicTo4x4Buffer(void *src, void *dest) -CopyItemIconPicTo4x4Buffer: @ 81AFE44 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - movs r4, 0 -_081AFE4C: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 5 - adds r0, r6, r0 - lsls r1, r4, 7 - adds r1, r5, r1 - movs r2, 0x30 - bl CpuSet - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081AFE4C - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end CopyItemIconPicTo4x4Buffer - - thumb_func_start AddItemIconObject -@ u8 AddItemIconObject(u16 tilesTag, u16 paletteTag, u16 itemId) -AddItemIconObject: @ 81AFE70 - push {r4-r7,lr} - sub sp, 0x10 - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 16 - lsrs r5, r2, 16 - bl AllocItemIconTemporaryBuffers - lsls r0, 24 - cmp r0, 0 - beq _081AFF28 - adds r0, r5, 0 - movs r1, 0 - bl GetItemIconPicOrPalette - ldr r4, =gUnknown_0203CEBC - ldr r1, [r4] - bl LZDecompressWram - ldr r0, [r4] - ldr r4, =gUnknown_0203CEC0 - ldr r1, [r4] - bl CopyItemIconPicTo4x4Buffer - ldr r0, [r4] - str r0, [sp] - ldr r4, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r4 - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - lsls r2, r7, 16 - ldr r1, =0x0000ffff - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - mov r0, sp - bl LoadSpriteSheet - adds r0, r5, 0 - movs r1, 0x1 - bl GetItemIconPicOrPalette - str r0, [sp, 0x8] - add r0, sp, 0x8 - ldr r1, [r0, 0x4] - ands r1, r4 - orrs r1, r6 - str r1, [r0, 0x4] - bl LoadCompressedObjectPalette - movs r0, 0x18 - bl Alloc - adds r5, r0, 0 - ldr r0, =gUnknown_08614FF4 - adds r1, r5, 0 - movs r2, 0xC - bl CpuSet - strh r7, [r5] - strh r6, [r5, 0x2] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl CreateSprite - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl FreeItemIconTemporaryBuffers - adds r0, r5, 0 - bl Free - adds r0, r4, 0 - b _081AFF2A - .pool -_081AFF28: - movs r0, 0x40 -_081AFF2A: - add sp, 0x10 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end AddItemIconObject - - thumb_func_start AddItemIconObjectWithCustomObjectTemplate -@ u8 AddItemIconObjectWithCustomObjectTemplate(struct objtemplate *objectTemplate, u16 tilesTag, u16 paletteTag, u16 itemId) -AddItemIconObjectWithCustomObjectTemplate: @ 81AFF34 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - mov r8, r0 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r6, r2, 16 - lsls r3, 16 - lsrs r5, r3, 16 - bl AllocItemIconTemporaryBuffers - lsls r0, 24 - cmp r0, 0 - beq _081AFFEC - adds r0, r5, 0 - movs r1, 0 - bl GetItemIconPicOrPalette - ldr r4, =gUnknown_0203CEBC - ldr r1, [r4] - bl LZDecompressWram - ldr r0, [r4] - ldr r4, =gUnknown_0203CEC0 - ldr r1, [r4] - bl CopyItemIconPicTo4x4Buffer - ldr r0, [r4] - str r0, [sp] - ldr r4, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r4 - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - lsls r2, r7, 16 - ldr r1, =0x0000ffff - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - mov r0, sp - bl LoadSpriteSheet - adds r0, r5, 0 - movs r1, 0x1 - bl GetItemIconPicOrPalette - str r0, [sp, 0x8] - add r0, sp, 0x8 - ldr r1, [r0, 0x4] - ands r1, r4 - orrs r1, r6 - str r1, [r0, 0x4] - bl LoadCompressedObjectPalette - movs r0, 0x18 - bl Alloc - adds r5, r0, 0 - mov r0, r8 - adds r1, r5, 0 - movs r2, 0xC - bl CpuSet - strh r7, [r5] - strh r6, [r5, 0x2] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl CreateSprite - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl FreeItemIconTemporaryBuffers - adds r0, r5, 0 - bl Free - adds r0, r4, 0 - b _081AFFEE - .pool -_081AFFEC: - movs r0, 0x40 -_081AFFEE: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end AddItemIconObjectWithCustomObjectTemplate - - thumb_func_start GetItemIconPicOrPalette -@ u32 GetItemIconPicOrPalette(u16 itemId, u8 which) -GetItemIconPicOrPalette: @ 81AFFFC - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x0000ffff - cmp r3, r0 - bne _081B0018 - ldr r3, =0x00000179 - b _081B0022 - .pool -_081B0018: - movs r0, 0xBC - lsls r0, 1 - cmp r3, r0 - bls _081B0022 - movs r3, 0 -_081B0022: - ldr r2, =gItemIconTable - lsls r0, r1, 2 - lsls r1, r3, 3 - adds r0, r1 - adds r0, r2 - ldr r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end GetItemIconPicOrPalette - - thumb_func_start sub_81B0038 -sub_81B0038: @ 81B0038 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, [sp, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - lsls r4, 24 - lsrs r6, r4, 24 - bl reset_brm - ldr r0, =gUnknown_0203CEC4 - mov r10, r0 - movs r0, 0x8E - lsls r0, 2 - bl Alloc - adds r5, r0, 0 - mov r1, r10 - str r5, [r1] - cmp r5, 0 - bne _081B0088 - ldr r0, [sp, 0x2C] - bl SetMainCallback2 - b _081B0194 - .pool -_081B0088: - ldr r3, =gUnknown_0203CEC8 - movs r1, 0xF - mov r4, r8 - ands r1, r4 - ldrb r2, [r3, 0x8] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x8] - ldr r0, [sp, 0x2C] - str r0, [r3] - movs r4, 0 - strb r7, [r3, 0xB] - lsls r2, r6, 2 - ldrh r1, [r5, 0xA] - movs r0, 0x3 - ands r0, r1 - orrs r0, r2 - strh r0, [r5, 0xA] - ldr r0, [sp, 0x28] - str r0, [r5] - str r4, [r5, 0x4] - ldrb r1, [r5, 0x8] - movs r0, 0xF - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x8] - mov r1, r10 - ldr r2, [r1] - ldrh r0, [r2, 0x8] - movs r4, 0xFE - lsls r4, 3 - adds r1, r4, 0 - orrs r0, r1 - strh r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r1, 0xFE - lsls r1, 10 - orrs r0, r1 - str r0, [r2, 0x8] - adds r6, r3, 0 - mov r5, r8 - cmp r5, 0x4 - bne _081B00F0 - ldrb r0, [r2, 0x8] - movs r1, 0x1 - orrs r0, r1 - b _081B00F8 - .pool -_081B00F0: - ldrb r1, [r2, 0x8] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 -_081B00F8: - strb r0, [r2, 0x8] - mov r0, r9 - cmp r0, 0xFF - beq _081B0114 - movs r0, 0x3 - mov r1, r9 - ands r0, r1 - lsls r0, 4 - ldrb r2, [r6, 0x8] - movs r1, 0x31 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r6, 0x8] -_081B0114: - movs r2, 0 - ldr r5, =gUnknown_0203CEC4 - movs r4, 0x86 - lsls r4, 2 - movs r3, 0 -_081B011E: - ldr r0, [r5] - lsls r1, r2, 1 - adds r0, r4 - adds r0, r1 - strh r3, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0xF - bls _081B011E - movs r2, 0 - ldr r4, =gUnknown_0203CEC4 - movs r3, 0xFF -_081B0138: - ldr r0, [r4] - adds r0, 0xC - adds r0, r2 - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x2 - bls _081B0138 - ldr r4, [sp] - cmp r4, 0 - bne _081B015C - strb r4, [r6, 0x9] - b _081B017E - .pool -_081B015C: - adds r1, r6, 0 - movs r0, 0x9 - ldrsb r0, [r1, r0] - cmp r0, 0x5 - bgt _081B017A - adds r1, r0, 0 - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - bne _081B017E -_081B017A: - movs r0, 0 - strb r0, [r6, 0x9] -_081B017E: - ldr r2, =gTextFlags - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl calc_player_party_count - ldr r0, =c2_811EBD0 - bl SetMainCallback2 -_081B0194: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0038 - - thumb_func_start sub_81B01B0 -sub_81B01B0: @ 81B01B0 - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl do_scheduled_bg_tilemap_copies_to_vram - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_81B01B0 - - thumb_func_start sub_81B01CC -sub_81B01CC: @ 81B01CC - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_81B01CC - - thumb_func_start c2_811EBD0 -c2_811EBD0: @ 81B01E0 - push {lr} -_081B01E2: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B0206 - bl sub_81B020C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B0206 - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B01E2 -_081B0206: - pop {r0} - bx r0 - thumb_func_end c2_811EBD0 - - thumb_func_start sub_81B020C -sub_81B020C: @ 81B020C - push {r4,lr} - sub sp, 0x4 - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x16 - bls _081B0222 - b _081B0498 -_081B0222: - lsls r0, 2 - ldr r1, =_081B0234 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B0234: - .4byte _081B0290 - .4byte _081B02AC - .4byte _081B02B2 - .4byte _081B02D4 - .4byte _081B02DA - .4byte _081B02EC - .4byte _081B02FE - .4byte _081B0310 - .4byte _081B0338 - .4byte _081B0354 - .4byte _081B0368 - .4byte _081B038C - .4byte _081B03A0 - .4byte _081B03A6 - .4byte _081B03B8 - .4byte _081B03BE - .4byte _081B03E0 - .4byte _081B0400 - .4byte _081B0414 - .4byte _081B0428 - .4byte _081B0430 - .4byte _081B044C - .4byte _081B0474 -_081B0290: - bl SetVBlankHBlankCallbacksToNull - bl sub_8121DA0 - bl clear_scheduled_bg_copies_to_vram - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B02AC: - bl remove_some_task - b _081B0484 -_081B02B2: - bl ResetPaletteFade - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B02D4: - bl ResetSpriteData - b _081B0484 -_081B02DA: - bl FreeAllSpritePalettes - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B02EC: - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - beq _081B02F8 - b _081B0484 -_081B02F8: - bl ResetTasks - b _081B0484 -_081B02FE: - bl sub_81B209C - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0310: - bl sub_81B0550 - lsls r0, 24 - cmp r0, 0 - bne _081B0322 - bl sub_81B04BC - movs r0, 0x1 - b _081B04B2 -_081B0322: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081B0484 - .pool -_081B0338: - bl sub_81B05C8 - lsls r0, 24 - cmp r0, 0 - bne _081B0344 - b _081B04B0 -_081B0344: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0354: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - lsls r0, 26 - lsrs r0, 30 - bl sub_81B239C - b _081B0484 - .pool -_081B0368: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - lsls r0, 26 - lsrs r0, 30 - bl sub_81B0740 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081B0484 - .pool -_081B038C: - bl sub_81B5D30 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B03A0: - bl sub_81B6040 - b _081B0484 -_081B03A6: - bl sub_81B6160 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B03B8: - bl sub_80D2F04 - b _081B0484 -_081B03BE: - bl party_menu_add_per_mon_objects - lsls r0, 24 - cmp r0, 0 - bne _081B03CA - b _081B04B0 -_081B03CA: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081B0484 - .pool -_081B03E0: - bl sub_81B0DA0 - lsls r0, 24 - cmp r0, 0 - beq _081B04B0 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081B0484 - .pool -_081B0400: - bl sub_81B0F28 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0414: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - lsrs r0, 31 - bl sub_81B2428 - b _081B0484 - .pool -_081B0428: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _081B048C -_081B0430: - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - ldr r0, [r0] - movs r1, 0 - bl CreateTask - ldr r0, [r4] - ldrh r0, [r0, 0xA] - lsrs r0, 2 - bl display_pokemon_menu_message - b _081B0484 - .pool -_081B044C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - ldr r2, =gPaletteFade - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0474: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade -_081B0484: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_081B048C: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081B04B0 - .pool -_081B0498: - ldr r0, =sub_81B01CC - bl SetVBlankCallback - ldr r0, =sub_81B01B0 - bl SetMainCallback2 - movs r0, 0x1 - b _081B04B2 - .pool -_081B04B0: - movs r0, 0 -_081B04B2: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B020C - - thumb_func_start sub_81B04BC -sub_81B04BC: @ 81B04BC - push {lr} - sub sp, 0x4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_81B04F8 - movs r1, 0 - bl CreateTask - ldr r0, =sub_81B01CC - bl SetVBlankCallback - ldr r0, =sub_81B01B0 - bl SetMainCallback2 - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B04BC - - thumb_func_start sub_81B04F8 -sub_81B04F8: @ 81B04F8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B051C - ldr r0, =gUnknown_0203CEC8 - ldr r0, [r0] - bl SetMainCallback2 - bl sub_81B06F4 - adds r0, r4, 0 - bl DestroyTask -_081B051C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B04F8 - - thumb_func_start reset_brm -reset_brm: @ 81B052C - ldr r0, =gUnknown_0203CEC4 - movs r1, 0 - str r1, [r0] - ldr r0, =gUnknown_0203CEE4 - str r1, [r0] - ldr r0, =gUnknown_0203CEDC - str r1, [r0] - ldr r0, =gUnknown_0203CEE0 - str r1, [r0] - bx lr - .pool - thumb_func_end reset_brm - - thumb_func_start sub_81B0550 -sub_81B0550: @ 81B0550 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CEE4 - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - cmp r0, 0 - beq _081B05C0 - movs r1, 0 - adds r2, r4, 0 - bl memset - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_086156B8 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r1, [r5] - movs r0, 0x1 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x1 - b _081B05C2 - .pool -_081B05C0: - movs r0, 0 -_081B05C2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81B0550 - - thumb_func_start sub_81B05C8 -sub_81B05C8: @ 81B05C8 - push {r4,lr} - sub sp, 0x4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x7 - bhi _081B06B0 - lsls r0, 2 - ldr r1, =_081B05F0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B05F0: - .4byte _081B0610 - .4byte _081B0638 - .4byte _081B0658 - .4byte _081B0684 - .4byte _081B0688 - .4byte _081B068C - .4byte _081B0690 - .4byte _081B0694 -_081B0610: - ldr r4, =gUnknown_0203CEE0 - ldr r0, =gUnknown_08D967EC - mov r1, sp - bl malloc_and_decompress - adds r1, r0, 0 - str r1, [r4] - ldr r2, [sp] - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTiles - b _081B069A - .pool -_081B0638: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081B06B4 - ldr r0, =gUnknown_08D96BA0 - ldr r1, =gUnknown_0203CEE4 - ldr r1, [r1] - bl LZDecompressWram - b _081B069A - .pool -_081B0658: - ldr r0, =gUnknown_08D96AB4 - movs r2, 0xB0 - lsls r2, 1 - movs r1, 0 - bl LoadCompressedPalette - ldr r0, =gPlttBufferUnfaded - ldr r4, =gUnknown_0203CEC4 - ldr r1, [r4] - adds r1, 0x18 - movs r2, 0xB0 - bl CpuSet - ldr r1, [r4] - b _081B069E - .pool -_081B0684: - movs r0, 0x4 - b _081B0696 -_081B0688: - movs r0, 0x5 - b _081B0696 -_081B068C: - movs r0, 0x6 - b _081B0696 -_081B0690: - movs r0, 0x7 - b _081B0696 -_081B0694: - movs r0, 0x8 -_081B0696: - bl sub_81B06C0 -_081B069A: - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] -_081B069E: - movs r0, 0x86 - lsls r0, 2 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081B06B4 - .pool -_081B06B0: - movs r0, 0x1 - b _081B06B6 -_081B06B4: - movs r0, 0 -_081B06B6: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B05C8 - - thumb_func_start sub_81B06C0 -sub_81B06C0: @ 81B06C0 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 28 - ldr r5, =gPlttBufferUnfaded + 0x60 - lsrs r4, 23 - adds r1, r5, 0 - subs r1, 0x60 - adds r1, r4, r1 - adds r0, r5, 0 - movs r2, 0x10 - bl CpuSet - ldr r0, =gPlttBufferFaded - adds r4, r0 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x10 - bl CpuSet - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B06C0 - - thumb_func_start sub_81B06F4 -sub_81B06F4: @ 81B06F4 - push {lr} - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - cmp r0, 0 - beq _081B0702 - bl Free -_081B0702: - ldr r0, =gUnknown_0203CEE4 - ldr r0, [r0] - cmp r0, 0 - beq _081B070E - bl Free -_081B070E: - ldr r0, =gUnknown_0203CEE0 - ldr r0, [r0] - cmp r0, 0 - beq _081B071A - bl Free -_081B071A: - ldr r0, =gUnknown_0203CEDC - ldr r0, [r0] - cmp r0, 0 - beq _081B0726 - bl Free -_081B0726: - bl FreeAllWindowBuffers - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B06F4 - - thumb_func_start sub_81B0740 -sub_81B0740: @ 81B0740 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203CEDC - movs r0, 0x60 - bl Alloc - str r0, [r4] - movs r5, 0 - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 4 - mov r8, r0 - movs r6, 0xFF - mov r9, r4 -_081B0764: - ldr r2, [r4] - lsls r3, r5, 4 - adds r2, r3, r2 - ldr r0, =gUnknown_086156E4 - mov r12, r0 - str r0, [r2] - lsls r0, r5, 3 - ldr r1, =gUnknown_08615704 - adds r0, r1 - add r0, r8 - str r0, [r2, 0x4] - strb r5, [r2, 0x8] - ldr r1, [r4] - adds r1, r3, r1 - ldrb r0, [r1, 0x9] - orrs r0, r6 - strb r0, [r1, 0x9] - ldr r1, [r4] - adds r1, r3, r1 - ldrb r0, [r1, 0xA] - orrs r0, r6 - strb r0, [r1, 0xA] - ldr r1, [r4] - adds r1, r3, r1 - ldrb r0, [r1, 0xB] - orrs r0, r6 - strb r0, [r1, 0xB] - ldr r0, [r4] - adds r3, r0 - ldrb r0, [r3, 0xC] - orrs r0, r6 - strb r0, [r3, 0xC] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _081B0764 - mov r1, r9 - ldr r0, [r1] - mov r1, r12 - subs r1, 0x20 - str r1, [r0] - cmp r7, 0x3 - bne _081B07CC - str r1, [r0, 0x30] - b _081B07D2 - .pool -_081B07CC: - cmp r7, 0 - beq _081B07D2 - str r1, [r0, 0x10] -_081B07D2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B0740 - - thumb_func_start sub_81B07E0 -sub_81B07E0: @ 81B07E0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B085C - cmp r5, 0x2 - bls _081B085C - adds r0, r5, 0 - bl sub_81B0CEC - ldr r0, =gUnknown_02022FF8 - subs r1, r5, 0x3 - lsls r1, 5 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - bne _081B0828 - ldr r0, =gUnknown_0203CEDC - lsls r4, r5, 4 - ldr r0, [r0] - adds r0, r4 - movs r1, 0x40 - bl sub_81B2748 - b _081B0836 - .pool -_081B0828: - ldr r0, =gUnknown_0203CEDC - lsls r4, r5, 4 - ldr r0, [r0] - adds r0, r4 - movs r1, 0x8 - bl sub_81B2748 -_081B0836: - adds r5, r4, 0 - ldr r4, =gUnknown_0203CEDC - ldr r0, [r4] - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r4] - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - b _081B093E - .pool -_081B085C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - bne _081B089C - ldr r4, =gUnknown_0203CEDC - ldr r0, [r4] - lsls r5, 4 - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - bl sub_81B2720 - ldr r0, [r4] - adds r0, r5 - movs r1, 0x40 - bl sub_81B2748 - ldr r0, [r4] - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - movs r1, 0x2 - bl CopyWindowToVram - b _081B092C - .pool -_081B089C: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - movs r1, 0xF - ands r1, r0 - cmp r1, 0x7 - bne _081B08B4 - adds r0, r5, 0 - bl sub_81B0B60 - b _081B08F6 - .pool -_081B08B4: - cmp r1, 0x2 - bne _081B08C0 - adds r0, r5, 0 - bl sub_81B0B08 - b _081B08F6 -_081B08C0: - cmp r1, 0x4 - bne _081B08CC - adds r0, r5, 0 - bl sub_81B0A9C - b _081B08F6 -_081B08CC: - cmp r1, 0xB - bne _081B08D8 - adds r0, r5, 0 - bl sub_81B0B98 - b _081B08F6 -_081B08D8: - cmp r1, 0xC - bne _081B08E4 - adds r0, r5, 0 - bl sub_81B0BC4 - b _081B08F6 -_081B08E4: - adds r0, r5, 0 - bl sub_81B0BFC - lsls r0, 24 - cmp r0, 0 - bne _081B08F6 - adds r0, r5, 0 - bl sub_81B0948 -_081B08F6: - ldr r2, =gUnknown_0203CEC8 - ldrb r1, [r2, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B0910 - adds r0, r5, 0 - movs r1, 0 - bl sub_81B0FCC - b _081B092A - .pool -_081B0910: - movs r0, 0x9 - ldrsb r0, [r2, r0] - cmp r0, r5 - bne _081B0922 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81B0FCC - b _081B092A -_081B0922: - adds r0, r5, 0 - movs r1, 0 - bl sub_81B0FCC -_081B092A: - lsls r5, 4 -_081B092C: - ldr r0, =gUnknown_0203CEDC - ldr r0, [r0] - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram -_081B093E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B07E0 - - thumb_func_start sub_81B0948 -sub_81B0948: @ 81B0948 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x64 - adds r1, r4, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x2D - bl GetMonData - adds r2, r0, 0 - cmp r2, 0 - beq _081B09A0 - ldr r6, =gUnknown_0203CEDC - ldr r0, [r6] - lsls r5, r4, 4 - adds r0, r5, r0 - ldr r2, [r0] - ldrb r0, [r0, 0x8] - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - ldr r4, [r2] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl _call_via_r4 - ldr r1, [r6] - adds r1, r5 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2A70 - b _081B0A02 - .pool -_081B09A0: - ldr r5, =gUnknown_0203CEDC - ldr r0, [r5] - lsls r4, 4 - adds r0, r4, r0 - ldr r1, [r0] - ldrb r0, [r0, 0x8] - str r2, [sp] - str r2, [sp, 0x4] - ldr r6, [r1] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl _call_via_r6 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2A70 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2AC8 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2B8C - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2CD4 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2D74 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - bl sub_81B2E28 -_081B0A02: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0948 - - thumb_func_start sub_81B0A10 -sub_81B0A10: @ 81B0A10 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r1, 0x64 - adds r2, r0, 0 - muls r2, r1 - ldr r1, =gPlayerParty - adds r6, r2, r1 - ldr r7, =gUnknown_0203CEDC - ldr r1, [r7] - lsls r5, r0, 4 - adds r1, r5, r1 - ldr r2, [r1] - ldrb r0, [r1, 0x8] - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - ldr r4, [r2] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl _call_via_r4 - ldr r1, [r7] - adds r1, r5 - adds r0, r6, 0 - movs r2, 0 - bl sub_81B2A70 - adds r0, r6, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081B0A7C - ldr r1, [r7] - adds r1, r5 - adds r0, r6, 0 - movs r2, 0 - bl sub_81B2AC8 - ldr r1, [r7] - adds r1, r5 - adds r0, r6, 0 - movs r2, 0 - bl sub_81B2B8C -_081B0A7C: - ldr r1, [r7] - adds r1, r5 - mov r0, r8 - movs r2, 0 - bl sub_81B2FA8 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0A10 - - thumb_func_start sub_81B0A9C -sub_81B0A9C: @ 81B0A9C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r6, =gUnknown_0203CEF8 - bl sub_81B85AC - lsls r0, 24 - cmp r0, 0 - bne _081B0AD6 - adds r0, r5, 0 - movs r1, 0x7 - bl sub_81B0A10 - b _081B0B02 - .pool -_081B0AC8: - adds r1, r4, 0x2 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_81B0A10 - b _081B0B02 -_081B0AD6: - movs r4, 0 - b _081B0AEE -_081B0ADA: - adds r1, r6, r4 - ldrb r0, [r1] - cmp r0, 0 - beq _081B0AE8 - subs r0, 0x1 - cmp r0, r5 - beq _081B0AC8 -_081B0AE8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081B0AEE: - bl sub_81B8830 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _081B0ADA - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81B0A10 -_081B0B02: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B0A9C - - thumb_func_start sub_81B0B08 -sub_81B0B08: @ 81B0B08 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_80DAE0C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _081B0B5A - lsls r0, 2 - ldr r1, =_081B0B34 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B0B34: - .4byte _081B0B48 - .4byte _081B0B52 - .4byte _081B0B52 - .4byte _081B0B48 - .4byte _081B0B48 -_081B0B48: - adds r0, r4, 0 - movs r1, 0x7 - bl sub_81B0A10 - b _081B0B5A -_081B0B52: - adds r0, r4, 0 - movs r1, 0x6 - bl sub_81B0A10 -_081B0B5A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0B08 - - thumb_func_start sub_81B0B60 -sub_81B0B60: @ 81B0B60 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_806E25C - lsls r0, 24 - cmp r0, 0 - bne _081B0B88 - adds r0, r4, 0 - movs r1, 0x9 - bl sub_81B0A10 - b _081B0B90 - .pool -_081B0B88: - adds r0, r4, 0 - movs r1, 0x8 - bl sub_81B0A10 -_081B0B90: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0B60 - - thumb_func_start sub_81B0B98 -sub_81B0B98: @ 81B0B98 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_81B218C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B0BB6 - adds r0, r4, 0 - movs r1, 0x6 - bl sub_81B0A10 - b _081B0BBE -_081B0BB6: - adds r0, r4, 0 - movs r1, 0x7 - bl sub_81B0A10 -_081B0BBE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0B98 - - thumb_func_start sub_81B0BC4 -sub_81B0BC4: @ 81B0BC4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - beq _081B0BEC - adds r0, r4, 0 - movs r1, 0xB - bl sub_81B0A10 - b _081B0BF4 - .pool -_081B0BEC: - adds r0, r4, 0 - movs r1, 0xC - bl sub_81B0A10 -_081B0BF4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0BC4 - - thumb_func_start sub_81B0BFC -sub_81B0BFC: @ 81B0BFC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r6, r1, r0 - ldr r0, =gUnknown_0203CE7C - ldrh r4, [r0] - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0xC - bne _081B0C40 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gSpecialVar_0x8005 - ldrb r2, [r0] - adds r0, r5, 0 - movs r1, 0 - bl sub_81B0C94 - b _081B0C8A - .pool -_081B0C40: - cmp r0, 0x3 - bne _081B0C56 - adds r0, r4, 0 - bl CheckIfItemIsTMHMOrEvolutionStone - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B0C5A - cmp r0, 0x2 - beq _081B0C66 -_081B0C56: - movs r0, 0 - b _081B0C8C -_081B0C5A: - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B0C94 - b _081B0C8A -_081B0C66: - adds r0, r6, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081B0C82 - adds r0, r6, 0 - movs r1, 0x3 - adds r2, r4, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - cmp r0, 0 - bne _081B0C56 -_081B0C82: - adds r0, r5, 0 - movs r1, 0 - bl sub_81B0A10 -_081B0C8A: - movs r0, 0x1 -_081B0C8C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81B0BFC - - thumb_func_start sub_81B0C94 -sub_81B0C94: @ 81B0C94 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x64 - muls r0, r4 - ldr r3, =gPlayerParty - adds r0, r3 - bl sub_81B22D8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _081B0CD2 - cmp r0, 0x2 - bgt _081B0CC4 - cmp r0, 0x1 - beq _081B0CC8 - b _081B0CDC - .pool -_081B0CC4: - cmp r0, 0x3 - bne _081B0CDC -_081B0CC8: - adds r0, r4, 0 - movs r1, 0x9 - bl sub_81B0A10 - b _081B0CE4 -_081B0CD2: - adds r0, r4, 0 - movs r1, 0xA - bl sub_81B0A10 - b _081B0CE4 -_081B0CDC: - adds r0, r4, 0 - movs r1, 0x8 - bl sub_81B0A10 -_081B0CE4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0C94 - - thumb_func_start sub_81B0CEC -sub_81B0CEC: @ 81B0CEC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CEDC - lsls r2, r0, 4 - ldr r1, [r1] - adds r6, r1, r2 - subs r0, 0x3 - lsls r0, 24 - ldr r5, =gUnknown_02022FF8 - lsrs r0, 19 - mov r8, r0 - adds r7, r0, r5 - ldrh r0, [r7] - cmp r0, 0 - bne _081B0D24 - ldrb r0, [r6, 0x8] - bl sub_81B2720 - b _081B0D8E - .pool -_081B0D24: - ldr r2, [r6] - ldrb r0, [r6, 0x8] - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - ldr r4, [r2] - movs r2, 0 - movs r3, 0 - bl _call_via_r4 - ldr r4, =gStringVar1 - adds r5, 0x4 - add r5, r8 - adds r0, r4, 0 - adds r1, r5, 0 - bl StringCopy - adds r0, r4, 0 - bl StringGetEnd10 - adds r0, r4, 0 - bl sub_81DB52C - ldrb r0, [r6, 0x8] - ldr r3, [r6] - adds r3, 0x4 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B2A3C - ldrb r0, [r7, 0xF] - adds r1, r6, 0 - bl sub_81B2B40 - ldrb r0, [r7, 0x1C] - ldrh r1, [r7] - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_81B2BF4 - ldrh r0, [r7, 0x10] - adds r1, r6, 0 - bl sub_81B2D3C - ldrh r0, [r7, 0x12] - adds r1, r6, 0 - bl sub_81B2DDC - ldrh r0, [r7, 0x10] - ldrh r1, [r7, 0x12] - adds r2, r6, 0 - bl sub_81B2E64 -_081B0D8E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0CEC - - thumb_func_start sub_81B0DA0 -sub_81B0DA0: @ 81B0DA0 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CEC4 - ldr r0, [r5] - movs r4, 0x86 - lsls r4, 2 - adds r0, r4 - ldrb r0, [r0] - bl sub_81B07E0 - ldr r1, [r5] - adds r1, r4 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - beq _081B0DCC - movs r0, 0 - b _081B0DCE - .pool -_081B0DCC: - movs r0, 0x1 -_081B0DCE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81B0DA0 - - thumb_func_start sub_81B0DD4 -sub_81B0DD4: @ 81B0DD4 - lsls r0, 16 - ldr r1, =gUnknown_0203CEE0 - lsrs r0, 11 - ldr r1, [r1] - adds r1, r0 - adds r0, r1, 0 - bx lr - .pool - thumb_func_end sub_81B0DD4 - - thumb_func_start party_menu_add_per_mon_objects_internal -party_menu_add_per_mon_objects_internal: @ 81B0DE8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B0E98 - cmp r7, 0x2 - bls _081B0E98 - subs r0, r7, 0x3 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =gUnknown_02022FF8 - mov r9, r0 - mov r2, r10 - lsls r2, 5 - mov r8, r2 - mov r6, r8 - add r6, r9 - ldrh r0, [r6] - cmp r0, 0 - beq _081B0EDC - mov r1, r9 - adds r1, 0x18 - add r1, r8 - ldr r1, [r1] - ldr r4, =gUnknown_0203CEDC - lsls r5, r7, 4 - ldr r2, [r4] - adds r2, r5 - movs r3, 0 - str r3, [sp] - bl party_menu_link_mon_icon_anim - ldrh r0, [r6] - ldrh r1, [r6, 0x2] - ldr r2, [r4] - adds r2, r5 - bl party_menu_link_mon_held_item_object - ldrh r0, [r6] - ldr r1, [r4] - adds r1, r5 - bl party_menu_link_mon_pokeball_object - ldrh r0, [r6, 0x10] - cmp r0, 0 - bne _081B0E68 - movs r3, 0x7 - b _081B0E78 - .pool -_081B0E68: - mov r0, r9 - adds r0, 0x14 - add r0, r8 - ldr r0, [r0] - bl pokemon_ailments_get_primary - lsls r0, 24 - lsrs r3, r0, 24 -_081B0E78: - ldr r1, =gUnknown_02022FF8 - mov r2, r10 - lsls r0, r2, 5 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gUnknown_0203CEDC - ldr r2, [r1] - adds r2, r5 - adds r1, r3, 0 - bl party_menu_link_mon_status_condition_object - b _081B0EDC - .pool -_081B0E98: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B0EDC - ldr r4, =gUnknown_0203CEDC - lsls r5, r7, 4 - ldr r1, [r4] - adds r1, r5 - adds r0, r6, 0 - adds r2, r7, 0 - bl party_menu_icon_anim - ldr r1, [r4] - adds r1, r5 - adds r0, r6, 0 - bl party_menu_held_item_object - ldr r1, [r4] - adds r1, r5 - adds r0, r6, 0 - bl party_menu_pokeball_object - ldr r1, [r4] - adds r1, r5 - adds r0, r6, 0 - bl party_menu_status_condition_object -_081B0EDC: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_add_per_mon_objects_internal - - thumb_func_start party_menu_add_per_mon_objects -party_menu_add_per_mon_objects: @ 81B0EF4 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CEC4 - ldr r0, [r5] - movs r4, 0x86 - lsls r4, 2 - adds r0, r4 - ldrb r0, [r0] - bl party_menu_add_per_mon_objects_internal - ldr r1, [r5] - adds r1, r4 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - beq _081B0F20 - movs r0, 0 - b _081B0F22 - .pool -_081B0F20: - movs r0, 0x1 -_081B0F22: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end party_menu_add_per_mon_objects - - thumb_func_start sub_81B0F28 -sub_81B0F28: @ 81B0F28 - push {r4,lr} - sub sp, 0xC - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B0F54 - movs r0, 0x7 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r1, 0xE - movs r2, 0x17 - movs r3, 0x11 - bl FillBgTilemapBufferRect - b _081B0FBC - .pool -_081B0F54: - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B0F94 - movs r0, 0xBF - movs r1, 0x88 - bl sub_81B5F74 - ldr r3, [r4] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x7F - ands r0, r1 - lsls r0, 4 - ldrh r2, [r3, 0x8] - ldr r1, =0xfffff80f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x8] - bl sub_81B120C - movs r0, 0xBF - movs r1, 0x98 - bl sub_81B5F74 - b _081B0F9C - .pool -_081B0F94: - movs r0, 0xC6 - movs r1, 0x94 - bl sub_81B5F34 -_081B0F9C: - ldr r3, [r4] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x7F - ands r0, r1 - lsls r0, 11 - ldr r1, [r3, 0x8] - ldr r2, =0xfffc07ff - ands r1, r2 - orrs r1, r0 - str r1, [r3, 0x8] - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - movs r1, 0x1 - bl sub_81B0FCC -_081B0FBC: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0F28 - - thumb_func_start sub_81B0FCC -sub_81B0FCC: @ 81B0FCC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - cmp r7, 0x6 - beq _081B1038 - cmp r7, 0x7 - beq _081B1074 - movs r0, 0x64 - muls r0, r7 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B10E8 - ldr r6, =gUnknown_0203CEDC - lsls r5, r7, 4 - ldr r4, [r6] - adds r4, r5 - adds r0, r7, 0 - mov r1, r8 - bl sub_81B10F8 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B2748 - ldr r0, [r6] - adds r0, r5, r0 - ldrb r0, [r0, 0x9] - mov r1, r8 - bl sub_81B5B6C - ldr r0, [r6] - adds r5, r0 - ldrb r0, [r5, 0xB] - mov r1, r8 - bl sub_81B5F98 - b _081B10E8 - .pool -_081B1038: - mov r0, r8 - cmp r0, 0 - bne _081B1052 - movs r0, 0x2 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r1, 0x17 - movs r2, 0x10 - movs r3, 0x7 - bl sub_8199C30 - b _081B1064 -_081B1052: - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x17 - movs r2, 0x10 - movs r3, 0x7 - bl sub_8199C30 -_081B1064: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrh r0, [r0, 0x8] - lsls r0, 21 - b _081B10DA - .pool -_081B1074: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - bne _081B10A6 - mov r0, r8 - cmp r0, 0 - bne _081B1098 - movs r0, 0x2 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r1, 0x17 - movs r2, 0x11 - b _081B10B8 - .pool -_081B1098: - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x17 - movs r2, 0x11 - b _081B10B8 -_081B10A6: - mov r0, r8 - cmp r0, 0 - bne _081B10C0 - movs r0, 0x2 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r1, 0x17 - movs r2, 0x12 -_081B10B8: - movs r3, 0x7 - bl sub_8199C30 - b _081B10D2 -_081B10C0: - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x17 - movs r2, 0x12 - movs r3, 0x7 - bl sub_8199C30 -_081B10D2: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldr r0, [r0, 0x8] - lsls r0, 14 -_081B10DA: - lsrs r0, 25 - mov r1, r8 - bl sub_81B5F98 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram -_081B10E8: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0FCC - - thumb_func_start sub_81B10F8 -sub_81B10F8: @ 81B10F8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r4, 0 - cmp r1, 0x1 - bne _081B110A - movs r4, 0x1 -_081B110A: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B1120 - movs r0, 0x2 - orrs r4, r0 -_081B1120: - adds r0, r5, 0 - bl sub_81B118C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B1136 - movs r0, 0x8 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_081B1136: - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0xB] - adds r2, r0, 0 - cmp r1, 0x9 - bne _081B1148 - movs r0, 0x10 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_081B1148: - cmp r1, 0x8 - bne _081B1164 - movs r0, 0x9 - ldrsb r0, [r2, r0] - cmp r5, r0 - beq _081B115C - movs r0, 0xA - ldrsb r0, [r2, r0] - cmp r5, r0 - bne _081B1164 -_081B115C: - movs r0, 0x4 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_081B1164: - ldrb r0, [r2, 0xB] - cmp r0, 0xA - bne _081B117A - movs r0, 0x9 - ldrsb r0, [r2, r0] - cmp r5, r0 - bne _081B117A - movs r0, 0x20 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_081B117A: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B10F8 - - thumb_func_start sub_81B118C -sub_81B118C: @ 81B118C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0x20 - bne _081B11B4 - cmp r2, 0x1 - beq _081B11AA - cmp r2, 0x4 - beq _081B11AA - cmp r2, 0x5 - bne _081B11B4 -_081B11AA: - movs r0, 0x1 - b _081B11F8 - .pool -_081B11B4: - cmp r2, 0x2 - bhi _081B11F6 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _081B11F6 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B11F6 - adds r0, r2, 0 - bl sub_81B8F38 - ldr r1, =gBattleStruct - ldr r1, [r1] - movs r2, 0xA8 - lsls r2, 2 - adds r1, r2 - ldrb r1, [r1] - lsls r0, 24 - lsrs r0, 24 - asrs r1, r0 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - bne _081B11F8 -_081B11F6: - movs r0, 0 -_081B11F8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B118C - - thumb_func_start sub_81B120C -sub_81B120C: @ 81B120C - push {r4-r6,lr} - sub sp, 0xC - ldr r1, =gUnknown_086157C4 - movs r6, 0x7 - str r6, [sp] - movs r5, 0x2 - str r5, [sp, 0x4] - movs r4, 0x11 - str r4, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x17 - movs r3, 0x10 - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r1, =gUnknown_086157E0 - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x17 - movs r3, 0x12 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B120C - - thumb_func_start sub_81B1250 -sub_81B1250: @ 81B1250 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x49 - ands r0, r1 - cmp r0, 0x49 - bne _081B1280 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B1280 - movs r0, 0x1 - b _081B1282 - .pool -_081B1280: - movs r0, 0 -_081B1282: - pop {r1} - bx r1 - thumb_func_end sub_81B1250 - - thumb_func_start sub_81B1288 -sub_81B1288: @ 81B1288 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - movs r0, 0x64 - bl Alloc - adds r5, r0, 0 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x64 - bl memcpy - adds r0, r6, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - adds r0, r5, 0 - bl Free - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B1288 - - thumb_func_start sub_81B12C0 -sub_81B12C0: @ 81B12C0 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =c3_0811FAB4 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B12C0 - - thumb_func_start c3_0811FAB4 -c3_0811FAB4: @ 81B12F8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B134C - ldr r4, =gUnknown_0203CEC8 - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _081B131A - bl sub_81B9080 -_081B131A: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldr r0, [r0, 0x4] - cmp r0, 0 - beq _081B1338 - bl SetMainCallback2 - b _081B133E - .pool -_081B1338: - ldr r0, [r4] - bl SetMainCallback2 -_081B133E: - bl ResetSpriteData - bl sub_81B06F4 - adds r0, r5, 0 - bl DestroyTask -_081B134C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end c3_0811FAB4 - - thumb_func_start brm_get_pokemon_selection -brm_get_pokemon_selection: @ 81B1354 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - bx lr - .pool - thumb_func_end brm_get_pokemon_selection - - thumb_func_start sub_81B1360 -sub_81B1360: @ 81B1360 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r0, 28 - bx lr - .pool - thumb_func_end sub_81B1360 - - thumb_func_start sub_81B1370 -sub_81B1370: @ 81B1370 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B13E0 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B13E0 - bl sub_81B13EC - adds r4, r0, 0 - bl sub_81B1760 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - beq _081B13C0 - cmp r0, 0x2 - bgt _081B13B0 - cmp r0, 0x1 - beq _081B13B6 - b _081B13E0 - .pool -_081B13B0: - cmp r0, 0x8 - beq _081B13CA - b _081B13E0 -_081B13B6: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B140C - b _081B13E0 -_081B13C0: - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81B15D0 - b _081B13E0 -_081B13CA: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B13E0 - movs r0, 0x5 - bl PlaySE - bl sub_81B4F88 -_081B13E0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1370 - - thumb_func_start sub_81B13EC -sub_81B13EC: @ 81B13EC - push {lr} - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0xB] - cmp r1, 0x8 - beq _081B13FA - cmp r1, 0xA - bne _081B1404 -_081B13FA: - adds r0, 0xA - b _081B1406 - .pool -_081B1404: - adds r0, 0x9 -_081B1406: - pop {r1} - bx r1 - thumb_func_end sub_81B13EC - - thumb_func_start sub_81B140C -sub_81B140C: @ 81B140C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x6 - bne _081B142C - ldr r0, =gUnknown_0203CEC8 - ldr r1, [r0, 0x4] - adds r0, r5, 0 - bl _call_via_r1 - b _081B159E - .pool -_081B142C: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - subs r0, 0x3 - cmp r0, 0xA - bls _081B1438 - b _081B1592 -_081B1438: - lsls r0, 2 - ldr r1, =_081B144C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B144C: - .4byte _081B149C - .4byte _081B1592 - .4byte _081B1538 - .4byte _081B1538 - .4byte _081B1510 - .4byte _081B1560 - .4byte _081B1592 - .4byte _081B1478 - .4byte _081B156E - .4byte _081B14E8 - .4byte _081B157C -_081B1478: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - bne _081B1486 - b _081B159E -_081B1486: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81615A8 - b _081B159E - .pool -_081B149C: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - bne _081B14AA - b _081B159E -_081B14AA: - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - ldr r2, =gUnknown_0203CEC4 - cmp r0, 0x1 - bne _081B14BE - ldr r1, [r2] - ldr r0, =sub_81B9140 - str r0, [r1, 0x4] -_081B14BE: - ldr r0, [r2] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gUnknown_03006328 - ldr r1, =sub_81B6794 - ldr r2, [r0] - adds r0, r5, 0 - bl _call_via_r2 - b _081B159E - .pool -_081B14E8: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - beq _081B159E - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81B7E4C - b _081B159E - .pool -_081B1510: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - beq _081B159E - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81B8474 - b _081B159E - .pool -_081B1538: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - beq _081B159E - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81B7FAC - b _081B159E - .pool -_081B1560: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81B3938 - b _081B159E -_081B156E: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81B12C0 - b _081B159E -_081B157C: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - beq _081B159E - ldrb r1, [r4] - adds r0, r5, 0 - bl sub_81B21AC - b _081B159E -_081B1592: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81B36FC -_081B159E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B140C - - thumb_func_start sub_81B15A4 -sub_81B15A4: @ 81B15A4 - push {lr} - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2D - bl GetMonData - cmp r0, 0x1 - beq _081B15C4 - movs r0, 0x1 - b _081B15CC - .pool -_081B15C4: - movs r0, 0x20 - bl PlaySE - movs r0, 0 -_081B15CC: - pop {r1} - bx r1 - thumb_func_end sub_81B15A4 - - thumb_func_start sub_81B15D0 -sub_81B15D0: @ 81B15D0 - push {r4,r5,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x8 - beq _081B1602 - cmp r0, 0x8 - bgt _081B15F0 - cmp r0, 0x1 - beq _081B15FA - b _081B161E - .pool -_081B15F0: - cmp r0, 0xA - beq _081B1602 - cmp r0, 0xD - beq _081B1610 - b _081B161E -_081B15FA: - movs r0, 0x20 - bl PlaySE - b _081B1652 -_081B1602: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B407C - b _081B1652 -_081B1610: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B2210 - b _081B1652 -_081B161E: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B1660 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B1652 - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - bne _081B1642 - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x7 - strh r0, [r1] -_081B1642: - ldr r0, =gUnknown_0203CEE8 - movs r1, 0 - strb r1, [r0] - movs r0, 0x7 - strb r0, [r5] - adds r0, r4, 0 - bl sub_81B12C0 -_081B1652: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B15D0 - - thumb_func_start sub_81B1660 -sub_81B1660: @ 81B1660 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - movs r1, 0xF - ands r1, r0 - cmp r1, 0x2 - bne _081B1680 - ldr r5, =gUnknown_085EA110 - b _081B168A - .pool -_081B1680: - cmp r1, 0x4 - bne _081B168A - bl sub_81B88BC - adds r5, r0, 0 -_081B168A: - cmp r5, 0 - beq _081B16CC - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - ldr r4, =gStringVar4 - adds r0, r4, 0 - adds r1, r5, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B16D4 - str r1, [r0] - movs r0, 0x1 - b _081B16CE - .pool -_081B16CC: - movs r0, 0 -_081B16CE: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81B1660 - - thumb_func_start sub_81B16D4 -sub_81B16D4: @ 81B16D4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B16F8 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1708 - str r0, [r1] -_081B16F8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B16D4 - - thumb_func_start sub_81B1708 -sub_81B1708: @ 81B1708 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B172E - cmp r1, 0 - bgt _081B1728 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B174C - b _081B1758 -_081B1728: - cmp r1, 0x1 - beq _081B1752 - b _081B1758 -_081B172E: - ldr r0, =gUnknown_0203CEE8 - strb r1, [r0] - ldr r1, =gUnknown_0203CEC8 - movs r0, 0x7 - strb r0, [r1, 0x9] - bl sub_81B8558 - adds r0, r4, 0 - bl sub_81B12C0 - b _081B1758 - .pool -_081B174C: - movs r0, 0x5 - bl PlaySE -_081B1752: - adds r0, r4, 0 - bl sub_81B1C1C -_081B1758: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B1708 - - thumb_func_start sub_81B1760 -sub_81B1760: @ 81B1760 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gMain - ldrh r1, [r0, 0x30] - adds r3, r0, 0 - cmp r1, 0x20 - beq _081B178E - cmp r1, 0x20 - bgt _081B177C - cmp r1, 0x10 - beq _081B1792 - b _081B1796 - .pool -_081B177C: - cmp r1, 0x40 - beq _081B1786 - cmp r1, 0x80 - beq _081B178A - b _081B1796 -_081B1786: - movs r1, 0xFF - b _081B17B2 -_081B178A: - movs r1, 0x1 - b _081B17B2 -_081B178E: - movs r1, 0xFE - b _081B17B2 -_081B1792: - movs r1, 0x2 - b _081B17B2 -_081B1796: - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B17AA - cmp r0, 0x2 - beq _081B17AE - movs r1, 0 - b _081B17B0 -_081B17AA: - movs r1, 0xFF - b _081B17B0 -_081B17AE: - movs r1, 0x1 -_081B17B0: - ldr r3, =gMain -_081B17B2: - ldrh r2, [r3, 0x2E] - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _081B17C4 - movs r0, 0x8 - b _081B17F0 - .pool -_081B17C4: - lsls r0, r1, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B17D6 - adds r0, r4, 0 - bl sub_81B17F8 - movs r0, 0 - b _081B17F0 -_081B17D6: - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _081B17EA - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x7 - bne _081B17EA - movs r0, 0x2 - b _081B17F0 -_081B17EA: - ldrh r1, [r3, 0x2E] - movs r0, 0x3 - ands r0, r1 -_081B17F0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B1760 - - thumb_func_start sub_81B17F8 -sub_81B17F8: @ 81B17F8 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldrb r4, [r5] - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - lsls r0, 26 - lsrs r0, 30 - cmp r0, 0 - bne _081B1820 - lsls r1, 24 - asrs r1, 24 - adds r0, r5, 0 - bl sub_81B1854 - b _081B182A - .pool -_081B1820: - lsls r1, 24 - asrs r1, 24 - adds r0, r5, 0 - bl sub_81B195C -_081B182A: - movs r1, 0 - ldrsb r1, [r5, r1] - lsls r4, 24 - asrs r0, r4, 24 - cmp r1, r0 - beq _081B184C - movs r0, 0x5 - bl PlaySE - lsrs r0, r4, 24 - movs r1, 0 - bl sub_81B0FCC - ldrb r0, [r5] - movs r1, 0x1 - bl sub_81B0FCC -_081B184C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B17F8 - - thumb_func_start sub_81B1854 -sub_81B1854: @ 81B1854 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B187A - cmp r1, r0 - bgt _081B1870 - subs r0, 0x1 - cmp r1, r0 - beq _081B1924 - b _081B1952 -_081B1870: - cmp r1, 0x1 - beq _081B18C0 - cmp r1, 0x2 - beq _081B18F8 - b _081B1952 -_081B187A: - ldrb r0, [r4] - movs r1, 0 - ldrsb r1, [r4, r1] - cmp r1, 0 - bne _081B1888 - movs r0, 0x7 - b _081B1950 -_081B1888: - cmp r1, 0x6 - bne _081B1898 - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - subs r0, 0x1 - b _081B1950 - .pool -_081B1898: - cmp r1, 0x7 - bne _081B18BC - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B18B0 - movs r0, 0x6 - b _081B1950 - .pool -_081B18B0: - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - subs r0, 0x1 - b _081B1950 - .pool -_081B18BC: - subs r0, 0x1 - b _081B1950 -_081B18C0: - ldrb r2, [r4] - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x7 - beq _081B194E - movs r1, 0 - ldrsb r1, [r4, r1] - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _081B18F4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B18F0 - movs r0, 0x6 - b _081B1950 - .pool -_081B18F0: - movs r0, 0x7 - b _081B1950 -_081B18F4: - adds r0, r2, 0x1 - b _081B1950 -_081B18F8: - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - cmp r0, 0x1 - beq _081B1952 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _081B1952 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0 - bne _081B1950 - movs r0, 0x1 - b _081B1950 - .pool -_081B1924: - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - beq _081B1952 - cmp r0, 0x6 - beq _081B1952 - cmp r0, 0x7 - beq _081B1952 - ldr r0, =gUnknown_0203CEC4 - ldr r3, [r0] - movs r1, 0 - ldrsb r1, [r4, r1] - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3, 0x8] - movs r0, 0xF - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x8] -_081B194E: - movs r0, 0 -_081B1950: - strb r0, [r4] -_081B1952: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1854 - - thumb_func_start sub_81B195C -sub_81B195C: @ 81B195C - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r2, r1, 24 - asrs r5, r1, 24 - movs r6, 0x1 - negs r6, r6 - cmp r5, r6 - beq _081B1988 - cmp r5, r6 - bgt _081B197E - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - bne _081B197C - b _081B1A9C -_081B197C: - b _081B1AF4 -_081B197E: - cmp r5, 0x1 - beq _081B19E4 - cmp r5, 0x2 - beq _081B1A24 - b _081B1AF4 -_081B1988: - ldrb r1, [r4] - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _081B1996 - movs r0, 0x7 - b _081B1AF2 -_081B1996: - cmp r0, 0x6 - bne _081B19A8 - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - subs r0, 0x1 - b _081B1AF2 - .pool -_081B19A8: - cmp r0, 0x7 - bne _081B19C4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B19C0 - movs r0, 0x6 - b _081B1AF2 - .pool -_081B19C0: - subs r0, r1, 0x1 - strb r0, [r4] -_081B19C4: - movs r0, 0 - ldrsb r0, [r4, r0] - lsls r1, r2, 24 - asrs r1, 24 - bl sub_81B1B00 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _081B19E0 - b _081B1AF4 -_081B19E0: - strb r2, [r4] - b _081B1AF4 -_081B19E4: - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x6 - bne _081B19F0 - movs r0, 0x7 - b _081B1AF2 -_081B19F0: - cmp r0, 0x7 - bne _081B19F8 - movs r0, 0 - b _081B1AF2 -_081B19F8: - movs r0, 0 - ldrsb r0, [r4, r0] - movs r1, 0x1 - bl sub_81B1B00 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, r6 - bne _081B19E0 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B1A20 - movs r0, 0x6 - b _081B1AF2 - .pool -_081B1A20: - movs r0, 0x7 - b _081B1AF2 -_081B1A24: - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _081B1A5C - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r6, r0, 29 - cmp r6, 0x3 - bne _081B1A54 - ldr r0, =gUnknown_02024618 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B1AF4 - strb r6, [r4] - b _081B1AF4 - .pool -_081B1A54: - ldr r0, =gUnknown_020245B4 - b _081B1A70 - .pool -_081B1A5C: - cmp r0, 0x1 - bne _081B1AF4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r5, r0, 29 - cmp r5, 0x5 - bne _081B1A88 - ldr r0, =gUnknown_020246E0 -_081B1A70: - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B1AF4 - strb r5, [r4] - b _081B1AF4 - .pool -_081B1A88: - ldr r0, =gUnknown_0202467C - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B1AF4 - movs r0, 0x4 - b _081B1AF2 - .pool -_081B1A9C: - ldrb r1, [r4] - subs r0, r1, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B1ACC - ldr r0, =gUnknown_0203CEC4 - ldr r3, [r0] - movs r1, 0 - ldrsb r1, [r4, r1] - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3, 0x8] - movs r0, 0xF - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x8] - movs r0, 0 - b _081B1AF2 - .pool -_081B1ACC: - subs r0, r1, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B1AF4 - ldr r0, =gUnknown_0203CEC4 - ldr r3, [r0] - movs r1, 0 - ldrsb r1, [r4, r1] - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3, 0x8] - movs r0, 0xF - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x8] - movs r0, 0x1 -_081B1AF2: - strb r0, [r4] -_081B1AF4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B195C - - thumb_func_start sub_81B1B00 -sub_81B1B00: @ 81B1B00 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - asrs r6, r1, 24 -_081B1B0A: - lsls r0, r5, 24 - asrs r0, 24 - adds r0, r6 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, r5, 24 - lsrs r0, r1, 24 - cmp r0, 0x5 - bhi _081B1B38 - asrs r4, r1, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B1B0A - adds r0, r4, 0 - b _081B1B3C - .pool -_081B1B38: - movs r0, 0x1 - negs r0, r0 -_081B1B3C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81B1B00 - - thumb_func_start GetMonNickname -@ u8 *GetMonNickname(struct pokemon *mon, u8 *dest) -GetMonNickname: @ 81B1B44 - push {r4,lr} - adds r4, r1, 0 - movs r1, 0x2 - adds r2, r4, 0 - bl GetMonData - adds r0, r4, 0 - bl StringGetEnd10 - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetMonNickname - - thumb_func_start sub_81B1B5C -sub_81B1B5C: @ 81B1B5C - push {r4,lr} - lsls r4, r1, 24 - lsrs r4, 24 - bl sub_81B3300 - ldr r0, =sub_81B1B8C - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B1B5C - - thumb_func_start sub_81B1B8C -sub_81B1B8C: @ 81B1B8C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - movs r0, 0x6 - bl sub_8121F20 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _081B1BC8 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _081B1BC2 - movs r0, 0x6 - movs r1, 0 - bl sub_8198070 - movs r0, 0x6 - bl ClearWindowTilemap -_081B1BC2: - adds r0, r5, 0 - bl DestroyTask -_081B1BC8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1B8C - - thumb_func_start sub_81B1BD4 -sub_81B1BD4: @ 81B1BD4 - push {lr} - ldr r0, =sub_81B1B8C - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B1BD4 - - thumb_func_start sub_81B1BE8 -sub_81B1BE8: @ 81B1BE8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B1C0E - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 - str r0, [r1] -_081B1C0E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1BE8 - - thumb_func_start sub_81B1C1C -sub_81B1C1C: @ 81B1C1C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B1C74 - movs r0, 0x6 - movs r1, 0 - bl sub_8198070 - movs r0, 0x6 - bl ClearWindowTilemap - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B1C60 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1BE8 - b _081B1C72 - .pool -_081B1C60: - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 -_081B1C72: - str r0, [r1] -_081B1C74: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1C1C - - thumb_func_start sub_81B1C84 -sub_81B1C84: @ 81B1C84 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E991B - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1C84 - - thumb_func_start sub_81B1CD0 -sub_81B1CD0: @ 81B1CD0 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E999D - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1CD0 - - thumb_func_start sub_81B1D1C -sub_81B1D1C: @ 81B1D1C - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E993A - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1D1C - - thumb_func_start sub_81B1D68 -sub_81B1D68: @ 81B1D68 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gStringVar1 - bl CopyItemName - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E99DB - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1D68 - - thumb_func_start sub_81B1DB8 -sub_81B1DB8: @ 81B1DB8 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - lsls r5, r1, 16 - lsrs r4, r5, 16 - adds r7, r4, 0 - adds r0, r4, 0 - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B1DE2 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_80D4420 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081B1DF6 -_081B1DE2: - mov r0, sp - strb r7, [r0] - mov r1, sp - lsrs r0, r5, 24 - strb r0, [r1, 0x1] - adds r0, r6, 0 - movs r1, 0xC - mov r2, sp - bl SetMonData -_081B1DF6: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B1DB8 - - thumb_func_start sub_81B1E00 -sub_81B1E00: @ 81B1E00 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r1, sp - strh r0, [r1] - cmp r0, 0 - bne _081B1E1C - movs r0, 0 - b _081B1E3E -_081B1E1C: - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - cmp r0, 0 - beq _081B1E3C - movs r1, 0 - mov r0, sp - strh r1, [r0] - adds r0, r4, 0 - movs r1, 0xC - mov r2, sp - bl SetMonData - movs r0, 0x2 - b _081B1E3E -_081B1E3C: - movs r0, 0x1 -_081B1E3E: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B1E00 - - thumb_func_start pokemon_item_not_removed -pokemon_item_not_removed: @ 81B1E48 - push {lr} - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9A69 - bl StringExpandPlaceholders - pop {r0} - bx r0 - .pool - thumb_func_end pokemon_item_not_removed - - thumb_func_start sub_81B1E60 -sub_81B1E60: @ 81B1E60 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - ldrh r0, [r7, 0x4] - ldrh r1, [r7] - adds r0, r1 - strh r0, [r7] - ldrh r0, [r7, 0x6] - subs r0, 0x1 - strh r0, [r7, 0x6] - movs r2, 0x8 - ldrsh r0, [r7, r2] - movs r5, 0x64 - muls r0, r5 - ldr r4, =gPlayerParty - adds r0, r4 - movs r1, 0x39 - adds r2, r7, 0 - bl SetMonData - movs r3, 0x8 - ldrsh r2, [r7, r3] - adds r0, r2, 0 - muls r0, r5 - adds r0, r4 - ldr r6, =gUnknown_0203CEDC - lsls r2, 4 - ldr r1, [r6] - adds r1, r2 - movs r2, 0x1 - bl sub_81B2CD4 - movs r0, 0x8 - ldrsh r2, [r7, r0] - adds r0, r2, 0 - muls r0, r5 - adds r0, r4 - lsls r2, 4 - ldr r1, [r6] - adds r1, r2 - bl sub_81B2E28 - movs r1, 0x6 - ldrsh r0, [r7, r1] - cmp r0, 0 - beq _081B1EDC - movs r2, 0 - ldrsh r1, [r7, r2] - cmp r1, 0 - beq _081B1EDC - movs r3, 0x2 - ldrsh r0, [r7, r3] - cmp r1, r0 - bne _081B1EFE -_081B1EDC: - movs r0, 0 - ldrsh r1, [r7, r0] - movs r2, 0xA - ldrsh r0, [r7, r2] - cmp r1, r0 - ble _081B1EF8 - ldr r0, =gStringVar2 - movs r3, 0xA - ldrsh r2, [r7, r3] - subs r1, r2 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN -_081B1EF8: - mov r0, r8 - bl SwitchTaskToFollowupFunc -_081B1EFE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1E60 - - thumb_func_start sub_81B1F18 -sub_81B1F18: @ 81B1F18 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r0 - mov r9, r1 - adds r5, r2, 0 - mov r10, r3 - ldr r7, [sp, 0x20] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r5, 24 - lsrs r5, 24 - mov r0, r10 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - movs r0, 0x64 - mov r6, r9 - muls r6, r0 - ldr r0, =gPlayerParty - adds r6, r0 - mov r0, r8 - lsls r4, r0, 2 - add r4, r8 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - adds r0, r6, 0 - movs r1, 0x39 - bl GetMonData - strh r0, [r4] - adds r0, r6, 0 - movs r1, 0x3A - bl GetMonData - strh r0, [r4, 0x2] - lsls r5, 24 - asrs r5, 24 - strh r5, [r4, 0x4] - mov r0, r10 - strh r0, [r4, 0x6] - mov r0, r9 - strh r0, [r4, 0x8] - ldrh r0, [r4] - strh r0, [r4, 0xA] - ldr r1, =sub_81B1E60 - mov r0, r8 - adds r2, r7, 0 - bl SetTaskFuncWithFollowupFunc - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1F18 - - thumb_func_start sub_81B1FA8 -sub_81B1FA8: @ 81B1FA8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r3, r0, r1 - cmp r5, 0x5 - bhi _081B200A - lsls r0, r5, 2 - ldr r1, =_081B1FD4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B1FD4: - .4byte _081B1FEC - .4byte _081B1FF2 - .4byte _081B1FF6 - .4byte _081B1FFA - .4byte _081B1FFE - .4byte _081B2002 -_081B1FEC: - strh r2, [r3] - strh r2, [r3, 0xA] - b _081B200A -_081B1FF2: - strh r2, [r3, 0x2] - b _081B200A -_081B1FF6: - strh r2, [r3, 0x4] - b _081B200A -_081B1FFA: - strh r2, [r3, 0x6] - b _081B200A -_081B1FFE: - strh r2, [r3, 0x8] - b _081B200A -_081B2002: - ldr r1, =sub_81B1E60 - adds r0, r4, 0 - bl SetTaskFuncWithFollowupFunc -_081B200A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1FA8 - - thumb_func_start pokemon_ailments_get_primary -pokemon_ailments_get_primary: @ 81B2014 - push {lr} - adds r1, r0, 0 - movs r0, 0x88 - ands r0, r1 - cmp r0, 0 - beq _081B2024 - movs r0, 0x1 - b _081B2056 -_081B2024: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081B2030 - movs r0, 0x2 - b _081B2056 -_081B2030: - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _081B203C - movs r0, 0x3 - b _081B2056 -_081B203C: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081B2048 - movs r0, 0x4 - b _081B2056 -_081B2048: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081B2054 - movs r0, 0 - b _081B2056 -_081B2054: - movs r0, 0x5 -_081B2056: - pop {r1} - bx r1 - thumb_func_end pokemon_ailments_get_primary - - thumb_func_start sub_81B205C -@ u8 sub_81B205C(struct pokemon *mon, int a2, void *a3) -sub_81B205C: @ 81B205C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B206E - movs r0, 0x7 - b _081B2096 -_081B206E: - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _081B2096 - adds r0, r4, 0 - movs r1, 0 - bl sub_806DD7C - lsls r0, 24 - cmp r0, 0 - bne _081B2094 - movs r0, 0 - b _081B2096 -_081B2094: - movs r0, 0x6 -_081B2096: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B205C - - thumb_func_start sub_81B209C -sub_81B209C: @ 81B209C - push {r4,r5,lr} - ldr r2, =gUnknown_0203CEC8 - ldrb r1, [r2, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xB - bne _081B2126 - adds r5, r2, 0 - adds r5, 0xE - movs r0, 0 - strh r0, [r2, 0xE] - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - bne _081B20FC - movs r4, 0 - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - cmp r4, r0 - bcs _081B2126 -_081B20C4: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_81B2134 - lsls r0, 16 - lsrs r0, 16 - lsls r0, r4 - ldrh r1, [r5] - adds r0, r1 - strh r0, [r5] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - cmp r4, r0 - bcc _081B20C4 - b _081B2126 - .pool -_081B20FC: - movs r4, 0 - b _081B211E -_081B2100: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_81B2164 - lsls r0, 16 - lsrs r0, 16 - lsls r0, r4 - ldrh r1, [r5] - adds r0, r1 - strh r0, [r5] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081B211E: - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - cmp r4, r0 - bcc _081B2100 -_081B2126: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B209C - - thumb_func_start sub_81B2134 -sub_81B2134: @ 81B2134 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0x1 - beq _081B215A - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl sub_802C908 - cmp r0, 0 - beq _081B215A - movs r0, 0x1 - b _081B215C -_081B215A: - movs r0, 0 -_081B215C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B2134 - - thumb_func_start sub_81B2164 -sub_81B2164: @ 81B2164 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0x1 - beq _081B2182 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0x55 - bne _081B2182 - movs r0, 0x1 - b _081B2184 -_081B2182: - movs r0, 0 -_081B2184: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B2164 - - thumb_func_start sub_81B218C -sub_81B218C: @ 81B218C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CEC8 - movs r2, 0xE - ldrsh r1, [r1, r2] - asrs r1, r0 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - bne _081B21A4 - movs r0, 0 -_081B21A4: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B218C - - thumb_func_start sub_81B21AC -sub_81B21AC: @ 81B21AC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - adds r0, r5, 0 - bl sub_81B218C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B21DC - movs r0, 0x5 - bl PlaySE - ldr r0, =gSpecialVar_0x8004 - strh r5, [r0] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B21FE - .pool -_081B21DC: - movs r0, 0x20 - bl PlaySE - ldr r0, =gUnknown_085EA0EE - movs r1, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B21FE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B21AC - - thumb_func_start sub_81B2210 -sub_81B2210: @ 81B2210 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085EA110 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B2248 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2210 - - thumb_func_start sub_81B2248 -sub_81B2248: @ 81B2248 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B226C - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B227C - str r0, [r1] -_081B226C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2248 - - thumb_func_start sub_81B227C -sub_81B227C: @ 81B227C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B22A2 - cmp r1, 0 - bgt _081B229C - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B22B4 - b _081B22C8 -_081B229C: - cmp r1, 0x1 - beq _081B22BA - b _081B22C8 -_081B22A2: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x7 - strh r0, [r1] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B22C8 - .pool -_081B22B4: - movs r0, 0x5 - bl PlaySE -_081B22BA: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1C1C - str r0, [r1] -_081B22C8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B227C - - thumb_func_start sub_81B22D8 -sub_81B22D8: @ 81B22D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r7, r4, 0 - lsls r2, 24 - lsrs r6, r2, 24 - mov r8, r6 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _081B22FA - movs r0, 0x3 - b _081B2356 -_081B22FA: - movs r0, 0x90 - lsls r0, 1 - cmp r4, r0 - bls _081B231C - adds r1, r4, 0 - subs r1, 0x21 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_806E00C - cmp r0, 0 - beq _081B2334 - adds r0, r7, 0 - bl ItemIdToBattleMoveId - b _081B233E -_081B231C: - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl sub_81B2370 - lsls r0, 24 - cmp r0, 0 - bne _081B2338 -_081B2334: - movs r0, 0x1 - b _081B2356 -_081B2338: - mov r0, r8 - bl sub_81B2360 -_081B233E: - lsls r0, 16 - lsrs r1, r0, 16 - adds r0, r5, 0 - bl pokemon_has_move - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B2354 - movs r0, 0 - b _081B2356 -_081B2354: - movs r0, 0x2 -_081B2356: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81B22D8 - - thumb_func_start sub_81B2360 -sub_81B2360: @ 81B2360 - lsls r0, 24 - ldr r1, =gUnknown_0861500C - lsrs r0, 23 - adds r0, r1 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end sub_81B2360 - - thumb_func_start sub_81B2370 -sub_81B2370: @ 81B2370 - push {lr} - lsls r0, 16 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_08615048 - lsrs r0, 14 - adds r0, r2 - movs r2, 0x1 - lsls r2, r1 - ldr r0, [r0] - ands r0, r2 - cmp r0, 0 - bne _081B2394 - movs r0, 0 - b _081B2396 - .pool -_081B2394: - movs r0, 0x1 -_081B2396: - pop {r1} - bx r1 - thumb_func_end sub_81B2370 - - thumb_func_start sub_81B239C -sub_81B239C: @ 81B239C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - beq _081B23C4 - cmp r0, 0x1 - bgt _081B23B2 - cmp r0, 0 - beq _081B23B8 - b _081B23DC -_081B23B2: - cmp r1, 0x2 - beq _081B23D0 - b _081B23DC -_081B23B8: - ldr r0, =gUnknown_08615810 - bl InitWindows - b _081B23E2 - .pool -_081B23C4: - ldr r0, =gUnknown_08615850 - bl InitWindows - b _081B23E2 - .pool -_081B23D0: - ldr r0, =gUnknown_08615890 - bl InitWindows - b _081B23E2 - .pool -_081B23DC: - ldr r0, =gUnknown_086158D0 - bl InitWindows -_081B23E2: - bl DeactivateAllTextPrinters - movs r4, 0 -_081B23E8: - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081B23E8 - movs r0, 0 - movs r1, 0x4F - movs r2, 0xD0 - bl sub_809882C - bl sub_8098C64 - movs r1, 0xE0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B239C - - thumb_func_start sub_81B2428 -sub_81B2428: @ 81B2428 - push {r4-r6,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B243E - b _081B2554 -_081B243E: - cmp r2, 0x1 - bne _081B24B4 - ldr r0, =gUnknown_08615918 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_085E8CE3 - movs r0, 0 - adds r1, r5, 0 - movs r2, 0x30 - bl GetStringCenterAlignXOffset - lsls r0, 24 - lsrs r2, r0, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - ldr r0, =gUnknown_086157FC - str r0, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - str r5, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, =gUnknown_08615910 - bl AddWindow - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - b _081B24C0 - .pool -_081B24B4: - ldr r0, =gUnknown_08615908 - bl AddWindow - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0x3 -_081B24C0: - adds r0, r5, 0 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xA - beq _081B2514 - ldr r4, =gUnknown_085E8CF0 - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x30 - bl GetStringCenterAlignXOffset - lsls r0, 24 - lsrs r2, r0, 24 - adds r2, r6 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_086157FC - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0 - movs r3, 0x1 - bl box_print - b _081B2540 - .pool -_081B2514: - ldr r4, =gUnknown_085E8CF7 - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x30 - bl GetStringCenterAlignXOffset - lsls r0, 24 - lsrs r2, r0, 24 - adds r2, r6 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_086157FC - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0 - movs r3, 0x1 - bl box_print -_081B2540: - adds r0, r5, 0 - bl PutWindowTilemap - adds r0, r5, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram -_081B2554: - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2428 - - thumb_func_start sub_81B2564 -sub_81B2564: @ 81B2564 - lsls r0, 24 - ldr r1, =gUnknown_0203CEC4 - lsrs r0, 23 - adds r0, 0x18 - ldr r1, [r1] - adds r1, r0 - adds r0, r1, 0 - bx lr - .pool - thumb_func_end sub_81B2564 - - thumb_func_start sub_81B2578 -sub_81B2578: @ 81B2578 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - str r1, [sp, 0xC] - ldr r1, [sp, 0x4C] - ldr r4, [sp, 0x50] - ldr r5, [sp, 0x54] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x18] - lsls r4, 24 - lsrs r6, r4, 24 - lsls r5, 24 - lsrs r5, 24 - mov r10, r5 - mov r0, r10 - muls r0, r6 - lsls r0, 5 - bl AllocZeroed - mov r9, r0 - cmp r0, 0 - beq _081B2646 - movs r5, 0 - ldr r0, [sp, 0x14] - lsls r0, 19 - str r0, [sp, 0x1C] - ldr r1, [sp, 0x18] - lsls r1, 19 - str r1, [sp, 0x20] - lsls r2, r6, 19 - str r2, [sp, 0x24] - mov r0, r10 - lsls r0, 19 - str r0, [sp, 0x28] - cmp r5, r10 - bcs _081B2624 -_081B25DA: - movs r4, 0 - adds r1, r5, 0x1 - mov r8, r1 - cmp r4, r6 - bcs _081B261A - ldr r2, [sp, 0x18] - adds r0, r2, r5 - ldr r2, [sp, 0x10] - adds r1, r0, 0 - muls r1, r2 - adds r7, r1, 0 -_081B25F0: - ldr r1, [sp, 0x14] - adds r0, r1, r4 - adds r0, r7 - ldr r2, [sp, 0xC] - adds r0, r2, r0 - ldrb r0, [r0] - bl sub_81B0DD4 - adds r1, r5, 0 - muls r1, r6 - adds r1, r4 - lsls r1, 5 - add r1, r9 - movs r2, 0x10 - bl CpuSet - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _081B25F0 -_081B261A: - mov r1, r8 - lsls r0, r1, 24 - lsrs r5, r0, 24 - cmp r5, r10 - bcc _081B25DA -_081B2624: - ldr r0, [sp, 0x1C] - lsrs r2, r0, 16 - ldr r1, [sp, 0x20] - lsrs r3, r1, 16 - ldr r1, [sp, 0x24] - lsrs r0, r1, 16 - str r0, [sp] - ldr r1, [sp, 0x28] - lsrs r0, r1, 16 - str r0, [sp, 0x4] - ldr r0, [sp, 0x8] - mov r1, r9 - bl BlitBitmapToWindow - mov r0, r9 - bl Free -_081B2646: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2578 - - thumb_func_start sub_81B2658 -sub_81B2658: @ 81B2658 - push {r4-r6,lr} - sub sp, 0xC - ldr r4, [sp, 0x1C] - ldr r5, [sp, 0x20] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - cmp r3, 0 - bne _081B2684 - cmp r4, 0 - bne _081B2684 - movs r3, 0xA - movs r4, 0x7 -_081B2684: - cmp r5, 0 - bne _081B26A0 - ldr r1, =gUnknown_08615988 - str r2, [sp] - str r3, [sp, 0x4] - str r4, [sp, 0x8] - movs r2, 0xA - adds r3, r6, 0 - bl sub_81B2578 - b _081B26B0 - .pool -_081B26A0: - ldr r1, =gUnknown_086159CE - str r2, [sp] - str r3, [sp, 0x4] - str r4, [sp, 0x8] - movs r2, 0xA - adds r3, r6, 0 - bl sub_81B2578 -_081B26B0: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2658 - - thumb_func_start sub_81B26BC -sub_81B26BC: @ 81B26BC - push {r4-r6,lr} - sub sp, 0xC - ldr r4, [sp, 0x1C] - ldr r5, [sp, 0x20] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - cmp r3, 0 - bne _081B26E8 - cmp r4, 0 - bne _081B26E8 - movs r3, 0x12 - movs r4, 0x3 -_081B26E8: - cmp r5, 0 - bne _081B2704 - ldr r1, =gUnknown_08615A14 - str r2, [sp] - str r3, [sp, 0x4] - str r4, [sp, 0x8] - movs r2, 0x12 - adds r3, r6, 0 - bl sub_81B2578 - b _081B2714 - .pool -_081B2704: - ldr r1, =gUnknown_08615A4A - str r2, [sp] - str r3, [sp, 0x4] - str r4, [sp, 0x8] - movs r2, 0x12 - adds r3, r6, 0 - bl sub_81B2578 -_081B2714: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B26BC - - thumb_func_start sub_81B2720 -sub_81B2720: @ 81B2720 - push {lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08615A80 - movs r2, 0 - str r2, [sp] - movs r2, 0x12 - str r2, [sp, 0x4] - movs r2, 0x3 - str r2, [sp, 0x8] - movs r2, 0x12 - movs r3, 0 - bl sub_81B2578 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2720 - - thumb_func_start sub_81B2748 -sub_81B2748: @ 81B2748 - push {r4-r7,lr} - lsls r1, 24 - lsrs r4, r1, 24 - adds r5, r4, 0 - ldrb r0, [r0, 0x8] - movs r1, 0x5 - bl GetWindowAttribute - lsls r0, 28 - lsrs r6, r0, 24 - adds r7, r6, 0 - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - beq _081B277C - ldr r5, =gUnknown_08615AF1 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AC0 - b _081B297E - .pool -_081B277C: - movs r0, 0x20 - ands r0, r4 - cmp r0, 0 - beq _081B27D8 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081B2794 - ldr r5, =gUnknown_08615ADF - b _081B2942 - .pool -_081B2794: - ldr r5, =gUnknown_08615ADF - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AEE - b _081B2976 - .pool -_081B27D8: - movs r0, 0x10 - ands r0, r4 - cmp r0, 0 - beq _081B2824 - ldr r5, =gUnknown_08615ADF - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AEE - b _081B2976 - .pool -_081B2824: - movs r0, 0x4 - ands r0, r4 - cmp r0, 0 - beq _081B2880 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081B283C - ldr r5, =gUnknown_08615ADF - b _081B2942 - .pool -_081B283C: - ldr r5, =gUnknown_08615ADF - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AEE - b _081B2976 - .pool -_081B2880: - movs r0, 0x2 - ands r0, r4 - cmp r0, 0 - beq _081B28DC - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081B2898 - ldr r5, =gUnknown_08615ADC - b _081B2942 - .pool -_081B2898: - ldr r5, =gUnknown_08615AD3 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AE8 - b _081B2976 - .pool -_081B28DC: - movs r0, 0x8 - ands r0, r4 - cmp r0, 0 - beq _081B2938 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081B28F4 - ldr r5, =gUnknown_08615AD9 - b _081B2942 - .pool -_081B28F4: - ldr r5, =gUnknown_08615AD0 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AE5 - b _081B2976 - .pool -_081B2938: - movs r0, 0x1 - ands r5, r0 - cmp r5, 0 - beq _081B29BC - ldr r5, =gUnknown_08615AD6 -_081B2942: - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AEB -_081B2976: - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABD -_081B297E: - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - b _081B2A24 - .pool -_081B29BC: - ldr r5, =gUnknown_08615ACD - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AE2 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABD - ldrb r1, [r4] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette -_081B2A24: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2748 - - thumb_func_start sub_81B2A3C -sub_81B2A3C: @ 81B2A3C - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - ldrb r5, [r3] - ldrb r3, [r3, 0x1] - lsls r4, r2, 1 - adds r4, r2 - ldr r2, =gUnknown_086157FC - adds r4, r2 - str r4, [sp] - movs r2, 0 - str r2, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0 - adds r2, r5, 0 - bl box_print - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2A3C - - thumb_func_start sub_81B2A70 -sub_81B2A70: @ 81B2A70 - push {r4-r7,lr} - sub sp, 0x14 - adds r7, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2AC0 - cmp r4, 0x1 - bne _081B2AAA - ldr r5, [r6] - ldrb r0, [r6, 0x8] - ldrb r1, [r5, 0x4] - lsrs r1, 3 - ldrb r2, [r5, 0x5] - lsrs r2, 3 - ldrb r3, [r5, 0x6] - lsrs r3, 3 - ldrb r4, [r5, 0x7] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2AAA: - adds r0, r7, 0 - add r1, sp, 0x8 - bl GetMonNickname - ldrb r0, [r6, 0x8] - ldr r3, [r6] - adds r3, 0x4 - add r1, sp, 0x8 - movs r2, 0 - bl sub_81B2A3C -_081B2AC0: - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2A70 - - thumb_func_start sub_81B2AC8 -sub_81B2AC8: @ 81B2AC8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r6, r0, 0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - mov r8, r4 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2B34 - adds r0, r6, 0 - bl sub_81B205C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081B2AF6 - cmp r0, 0x6 - bne _081B2B34 -_081B2AF6: - cmp r4, 0 - beq _081B2B1C - ldr r5, [r7] - ldrb r0, [r7, 0x8] - ldrb r1, [r5, 0x8] - lsrs r1, 3 - ldrb r2, [r5, 0x9] - lsrs r2, 3 - adds r2, 0x1 - ldrb r3, [r5, 0xA] - lsrs r3, 3 - ldrb r4, [r5, 0xB] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2B1C: - mov r0, r8 - cmp r0, 0x2 - beq _081B2B34 - adds r0, r6, 0 - movs r1, 0x38 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - adds r1, r7, 0 - bl sub_81B2B40 -_081B2B34: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2AC8 - - thumb_func_start sub_81B2B40 -sub_81B2B40: @ 81B2B40 - push {r4-r6,lr} - adds r2, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r5, =gStringVar2 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar1 - ldr r1, =gUnknown_085E8D4D - adds r0, r4, 0 - bl StringCopy - adds r0, r4, 0 - adds r1, r5, 0 - bl StringAppend - ldrb r0, [r6, 0x8] - ldr r3, [r6] - adds r3, 0x8 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B2A3C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2B40 - - thumb_func_start sub_81B2B8C -sub_81B2B8C: @ 81B2B8C - push {r4-r7,lr} - sub sp, 0x14 - adds r6, r0, 0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0x1 - bne _081B2BBE - ldr r5, [r7] - ldrb r0, [r7, 0x8] - ldrb r1, [r5, 0xC] - lsrs r1, 3 - ldrb r2, [r5, 0xD] - lsrs r2, 3 - adds r2, 0x1 - ldrb r3, [r5, 0xE] - lsrs r3, 3 - ldrb r4, [r5, 0xF] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2BBE: - adds r0, r6, 0 - add r1, sp, 0x8 - bl GetMonNickname - adds r0, r6, 0 - bl pokemon_get_gender - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - movs r1, 0xB - bl GetMonData - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - add r2, sp, 0x8 - adds r3, r7, 0 - bl sub_81B2BF4 - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2B8C - - thumb_func_start sub_81B2BF4 -sub_81B2BF4: @ 81B2BF4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r2 - adds r7, r3, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r5, r4, 0 - ldrb r0, [r7, 0x8] - movs r1, 0x5 - bl GetWindowAttribute - lsls r0, 28 - lsrs r6, r0, 24 - cmp r4, 0 - beq _081B2CBA - cmp r4, 0x20 - beq _081B2C24 - cmp r4, 0x1D - bne _081B2C38 -_081B2C24: - movs r0, 0xB - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - mov r0, r9 - bl StringCompare - cmp r0, 0 - beq _081B2CBA -_081B2C38: - mov r0, r8 - cmp r0, 0 - beq _081B2C48 - cmp r0, 0xFE - beq _081B2C88 - b _081B2CBA - .pool -_081B2C48: - ldr r5, =gUnknown_08615AC3 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AB6 - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r7, 0x8] - ldr r1, =gUnknown_085E8D49 - ldr r3, [r7] - adds r3, 0xC - movs r2, 0x2 - bl sub_81B2A3C - b _081B2CBA - .pool -_081B2C88: - ldr r5, =gUnknown_08615AC5 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AB6 - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r7, 0x8] - ldr r1, =gUnknown_085E8D4B - ldr r3, [r7] - adds r3, 0xC - movs r2, 0x2 - bl sub_81B2A3C -_081B2CBA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2BF4 - - thumb_func_start sub_81B2CD4 -sub_81B2CD4: @ 81B2CD4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r7, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - mov r8, r4 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2D2E - cmp r4, 0 - beq _081B2D16 - ldr r5, [r6] - ldrb r0, [r6, 0x8] - ldrb r1, [r5, 0x10] - lsrs r1, 3 - ldrb r2, [r5, 0x11] - lsrs r2, 3 - adds r2, 0x1 - ldrb r3, [r5, 0x12] - lsrs r3, 3 - ldrb r4, [r5, 0x13] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2D16: - mov r0, r8 - cmp r0, 0x2 - beq _081B2D2E - adds r0, r7, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl sub_81B2D3C -_081B2D2E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2CD4 - - thumb_func_start sub_81B2D3C -sub_81B2D3C: @ 81B2D3C - push {r4,r5,lr} - adds r2, r0, 0 - adds r4, r1, 0 - lsls r2, 16 - lsrs r2, 16 - ldr r5, =gStringVar1 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - movs r1, 0xBA - strb r1, [r0] - movs r1, 0xFF - strb r1, [r0, 0x1] - ldrb r0, [r4, 0x8] - ldr r3, [r4] - adds r3, 0x10 - adds r1, r5, 0 - movs r2, 0 - bl sub_81B2A3C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2D3C - - thumb_func_start sub_81B2D74 -sub_81B2D74: @ 81B2D74 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r7, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - mov r8, r4 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2DD0 - cmp r4, 0 - beq _081B2DB8 - ldr r5, [r6] - ldrb r0, [r6, 0x8] - ldrb r1, [r5, 0x14] - lsrs r1, 3 - adds r1, 0x1 - ldrb r2, [r5, 0x15] - lsrs r2, 3 - adds r2, 0x1 - ldrb r3, [r5, 0x16] - lsrs r3, 3 - ldrb r4, [r5, 0x17] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2DB8: - mov r0, r8 - cmp r0, 0x2 - beq _081B2DD0 - adds r0, r7, 0 - movs r1, 0x3A - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl sub_81B2DDC -_081B2DD0: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2D74 - - thumb_func_start sub_81B2DDC -sub_81B2DDC: @ 81B2DDC - push {r4-r6,lr} - adds r2, r0, 0 - adds r6, r1, 0 - lsls r2, 16 - lsrs r2, 16 - ldr r5, =gStringVar2 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar1 - ldr r1, =gUnknown_085E8D3E - adds r0, r4, 0 - bl StringCopy - adds r0, r4, 0 - adds r1, r5, 0 - bl StringAppend - ldrb r0, [r6, 0x8] - ldr r3, [r6] - adds r3, 0x14 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B2A3C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2DDC - - thumb_func_start sub_81B2E28 -sub_81B2E28: @ 81B2E28 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2E5C - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - adds r2, r6, 0 - bl sub_81B2E64 -_081B2E5C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B2E28 - - thumb_func_start sub_81B2E64 -sub_81B2E64: @ 81B2E64 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r6, r2, 0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - ldrb r0, [r6, 0x8] - movs r1, 0x5 - bl GetWindowAttribute - lsls r0, 28 - lsrs r7, r0, 24 - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - bl sub_8075060 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _081B2EB0 - cmp r0, 0x2 - blt _081B2EE0 - cmp r0, 0x4 - bgt _081B2EE0 - ldr r5, =gUnknown_08615AC7 - b _081B2EB2 - .pool -_081B2EB0: - ldr r5, =gUnknown_08615AC9 -_081B2EB2: - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AB8 - ldrb r1, [r4] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - b _081B2F04 - .pool -_081B2EE0: - ldr r5, =gUnknown_08615ACB - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AB8 - ldrb r1, [r4] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette -_081B2F04: - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - ldr r2, [r6] - ldrb r2, [r2, 0x1A] - bl sub_8075034 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r6, 0x8] - ldr r4, =gUnknown_08615AB8 - ldrb r1, [r4, 0x1] - ldr r3, [r6] - ldrb r2, [r3, 0x18] - ldrb r3, [r3, 0x19] - str r5, [sp] - movs r7, 0x1 - str r7, [sp, 0x4] - bl FillWindowPixelRect - ldrb r0, [r6, 0x8] - ldrb r1, [r4] - ldr r3, [r6] - ldrb r2, [r3, 0x18] - ldrb r3, [r3, 0x19] - adds r3, 0x1 - str r5, [sp] - movs r4, 0x2 - str r4, [sp, 0x4] - bl FillWindowPixelRect - ldr r1, [r6] - ldrb r0, [r1, 0x1A] - cmp r5, r0 - beq _081B2F88 - ldrb r0, [r6, 0x8] - ldrb r2, [r1, 0x18] - adds r2, r5 - ldrb r3, [r1, 0x19] - ldrb r1, [r1, 0x1A] - subs r1, r5 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - str r7, [sp, 0x4] - movs r1, 0xD - bl FillWindowPixelRect - ldrb r0, [r6, 0x8] - ldr r1, [r6] - ldrb r2, [r1, 0x18] - adds r2, r5 - ldrb r3, [r1, 0x19] - adds r3, 0x1 - ldrb r1, [r1, 0x1A] - subs r1, r5 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - str r4, [sp, 0x4] - movs r1, 0x2 - bl FillWindowPixelRect -_081B2F88: - ldrb r0, [r6, 0x8] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2E64 - - thumb_func_start sub_81B2FA8 -sub_81B2FA8: @ 81B2FA8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r6, r1, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r2, 24 - lsrs r7, r2, 24 - cmp r7, 0 - beq _081B2FF2 - ldr r5, [r6] - ldrb r1, [r5, 0x1C] - movs r4, 0x7 - adds r0, r1, 0 - ands r0, r4 - ldrb r2, [r5, 0x1E] - adds r0, r2 - adds r3, r0, 0x7 - asrs r3, 3 - ldrb r2, [r5, 0x1D] - adds r0, r2, 0 - ands r0, r4 - ldrb r4, [r5, 0x1F] - adds r0, r4 - adds r4, r0, 0x7 - ldrb r0, [r6, 0x8] - lsrs r1, 3 - lsrs r2, 3 - lsrs r4, 3 - str r4, [sp] - movs r4, 0x1 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2FF2: - cmp r7, 0x2 - beq _081B3018 - ldrb r0, [r6, 0x8] - ldr r1, [r6] - ldrb r2, [r1, 0x1C] - ldrb r3, [r1, 0x1D] - ldr r1, =gUnknown_086157FC - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - ldr r4, =gUnknown_08615B60 - mov r5, r8 - lsls r1, r5, 2 - adds r1, r4 - ldr r1, [r1] - str r1, [sp, 0x8] - movs r1, 0x1 - bl box_print -_081B3018: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2FA8 - - thumb_func_start sub_81B302C -sub_81B302C: @ 81B302C - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081B304C - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram -_081B304C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B302C - - thumb_func_start display_pokemon_menu_message -display_pokemon_menu_message: @ 81B3054 - push {r4-r6,lr} - sub sp, 0xC - adds r6, r0, 0 - ldr r0, =gUnknown_0203CEC4 - ldr r4, [r0] - adds r5, r4, 0 - adds r5, 0xD - ldrb r0, [r4, 0xD] - cmp r0, 0xFF - beq _081B306E - adds r0, r5, 0 - bl sub_81B302C -_081B306E: - cmp r6, 0x7F - beq _081B313C - adds r0, r6, 0 - subs r0, 0x15 - cmp r0, 0x5 - bhi _081B30D4 - lsls r0, 2 - ldr r1, =_081B308C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B308C: - .4byte _081B30A4 - .4byte _081B30BC - .4byte _081B30BC - .4byte _081B30AC - .4byte _081B30B4 - .4byte _081B30C4 -_081B30A4: - ldr r0, =gUnknown_08615928 - b _081B30C6 - .pool -_081B30AC: - ldr r0, =gUnknown_08615930 - b _081B30C6 - .pool -_081B30B4: - ldr r0, =gUnknown_08615938 - b _081B30C6 - .pool -_081B30BC: - ldr r0, =gUnknown_08615940 - b _081B30C6 - .pool -_081B30C4: - ldr r0, =gUnknown_08615948 -_081B30C6: - bl AddWindow - strb r0, [r5] - b _081B30DC - .pool -_081B30D4: - ldr r0, =gUnknown_08615920 - bl AddWindow - strb r0, [r4, 0xD] -_081B30DC: - cmp r6, 0 - bne _081B3104 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B30F8 - movs r6, 0x2 - b _081B3104 - .pool -_081B30F8: - bl sub_81B314C - lsls r0, 24 - cmp r0, 0 - bne _081B3104 - movs r6, 0x1 -_081B3104: - ldrb r0, [r5] - movs r1, 0 - movs r2, 0x4F - movs r3, 0xD - bl SetWindowBorderStyle - ldr r4, =gStringVar4 - ldr r1, =gUnknown_08615AF4 - lsls r0, r6, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl StringExpandPlaceholders - ldrb r0, [r5] - movs r1, 0x1 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram -_081B313C: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end display_pokemon_menu_message - - thumb_func_start sub_81B314C -sub_81B314C: @ 81B314C - push {r4-r7,lr} - ldr r7, =gPlayerParty - movs r6, 0 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x1 - bne _081B3168 -_081B315A: - movs r0, 0x1 - b _081B31AA - .pool -_081B3168: - movs r5, 0 -_081B316A: - movs r0, 0x64 - muls r0, r5 - adds r4, r7, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B319A - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B3194 - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _081B319A -_081B3194: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_081B319A: - cmp r6, 0x1 - bhi _081B315A - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _081B316A - movs r0, 0 -_081B31AA: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81B314C - - thumb_func_start sub_81B31B0 -sub_81B31B0: @ 81B31B0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x1C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - beq _081B320C - cmp r4, 0x1 - bgt _081B31CC - cmp r4, 0 - beq _081B31D2 - b _081B321C -_081B31CC: - cmp r4, 0x2 - beq _081B3214 - b _081B321C -_081B31D2: - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldrb r0, [r1, 0x17] - lsls r0, 1 - movs r3, 0x13 - subs r3, r0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0xA - str r0, [sp] - ldrb r0, [r1, 0x17] - lsls r0, 25 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r0, 0xE - str r0, [sp, 0x8] - ldr r0, =0x000002e9 - str r0, [sp, 0xC] - add r0, sp, 0x14 - movs r1, 0x2 - movs r2, 0x13 - bl rbox_template_set - b _081B3226 - .pool -_081B320C: - ldr r0, =gUnknown_08615950 - b _081B321E - .pool -_081B3214: - ldr r0, =gUnknown_08615958 - b _081B321E - .pool -_081B321C: - ldr r0, =gUnknown_08615960 -_081B321E: - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x14] - str r1, [sp, 0x18] -_081B3226: - add r0, sp, 0x14 - bl AddWindow - ldr r6, =gUnknown_0203CEC4 - ldr r1, [r6] - strb r0, [r1, 0xC] - ldr r0, [r6] - ldrb r0, [r0, 0xC] - movs r1, 0 - movs r2, 0x4F - movs r3, 0xD - bl SetWindowBorderStyle - cmp r4, 0x3 - bne _081B3250 - ldr r0, [r6] - b _081B32E2 - .pool -_081B3250: - movs r0, 0x1 - movs r1, 0 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r0, 0x1 - movs r1, 0x2 - bl GetFontAttribute - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r0, [r6] - ldrb r0, [r0, 0x17] - cmp r5, r0 - bcs _081B32CA - adds r7, r6, 0 - movs r6, 0 -_081B327A: - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0xF - adds r4, r0, r5 - ldrb r0, [r4] - movs r2, 0x3 - cmp r0, 0x12 - bls _081B328C - movs r2, 0x4 -_081B328C: - ldrb r0, [r1, 0xC] - lsls r3, r5, 4 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - mov r1, r8 - str r1, [sp] - str r6, [sp, 0x4] - lsls r1, r2, 1 - adds r1, r2 - ldr r2, =gUnknown_086157FC - adds r1, r2 - str r1, [sp, 0x8] - str r6, [sp, 0xC] - ldr r2, =gUnknown_08615C08 - ldrb r1, [r4] - lsls r1, 3 - adds r1, r2 - ldr r1, [r1] - str r1, [sp, 0x10] - movs r1, 0x1 - mov r2, r9 - bl AddTextPrinterParametrized2 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r7] - ldrb r0, [r0, 0x17] - cmp r5, r0 - bcc _081B327A -_081B32CA: - ldr r4, =gUnknown_0203CEC4 - ldr r1, [r4] - ldrb r0, [r1, 0xC] - ldrb r1, [r1, 0x17] - movs r2, 0 - movs r3, 0x1 - bl InitMenuInUpperLeftCorner - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, [r4] -_081B32E2: - ldrb r0, [r0, 0xC] - add sp, 0x1C - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B31B0 - - thumb_func_start sub_81B3300 -sub_81B3300: @ 81B3300 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - movs r0, 0x6 - movs r1, 0 - movs r2, 0x4F - movs r3, 0xD - bl SetWindowBorderStyle - ldr r2, =gTextFlags - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - bl sav2_get_text_speed - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0x6 - movs r1, 0x1 - adds r2, r4, 0 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3300 - - thumb_func_start sub_81B334C -sub_81B334C: @ 81B334C - push {lr} - ldr r0, =gUnknown_08615968 - movs r1, 0x4F - movs r2, 0xD - movs r3, 0 - bl CreateYesNoMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B334C - - thumb_func_start sub_81B3364 -sub_81B3364: @ 81B3364 - push {r4,lr} - ldr r0, =gUnknown_08615970 - bl AddWindow - ldr r4, =gUnknown_0203CEC4 - ldr r1, [r4] - strb r0, [r1, 0xC] - ldr r0, [r4] - ldrb r0, [r0, 0xC] - movs r1, 0 - movs r2, 0x4F - movs r3, 0xD - bl SetWindowBorderStyle - ldr r0, [r4] - ldrb r0, [r0, 0xC] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B3364 - - thumb_func_start sub_81B3394 -sub_81B3394: @ 81B3394 - push {r4,lr} - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - ldrb r0, [r0, 0xC] - bl ClearWindowTilemap - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3394 - - thumb_func_start sub_81B33B4 -sub_81B33B4: @ 81B33B4 - push {r4,lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0 - bne _081B33C8 - bl sub_81B3414 - b _081B3400 -_081B33C8: - ldr r4, =gUnknown_0203CEC4 - ldr r1, [r4] - ldr r0, =gUnknown_08615D70 - adds r0, r2, r0 - ldrb r0, [r0] - strb r0, [r1, 0x17] - movs r3, 0 - ldr r0, [r4] - ldrb r0, [r0, 0x17] - cmp r3, r0 - bcs _081B3400 - ldr r1, =gUnknown_08615D38 - lsls r0, r2, 2 - adds r2, r0, r1 -_081B33E4: - ldr r1, [r4] - adds r1, 0xF - adds r1, r3 - ldr r0, [r2] - adds r0, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, [r4] - ldrb r0, [r0, 0x17] - cmp r3, r0 - bcc _081B33E4 -_081B3400: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B33B4 - - thumb_func_start sub_81B3414 -sub_81B3414: @ 81B3414 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r9, r0 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - ldr r2, =gUnknown_0203CEC4 - ldr r1, [r2] - movs r0, 0 - strb r0, [r1, 0x17] - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0 - bl append_byte - movs r7, 0 - ldr r0, =gUnknown_08615D7E - ldrh r0, [r0] - str r0, [sp] -_081B3446: - movs r4, 0 - adds r0, r7, 0x1 - mov r8, r0 - ldr r1, [sp] - cmp r1, 0xE - beq _081B34A0 - movs r0, 0x64 - mov r6, r10 - muls r6, r0 - ldr r5, =gUnknown_08615D7E -_081B345A: - mov r1, r9 - adds r0, r1, r6 - adds r1, r7, 0 - adds r1, 0xD - bl GetMonData - lsls r1, r4, 1 - adds r1, r5 - ldrh r1, [r1] - cmp r0, r1 - bne _081B3490 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - adds r2, r4, 0 - adds r2, 0x13 - lsls r2, 24 - lsrs r2, 24 - bl append_byte - b _081B34A0 - .pool -_081B3490: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 1 - adds r0, r5 - ldrh r0, [r0] - cmp r0, 0xE - bne _081B345A -_081B34A0: - mov r1, r8 - lsls r0, r1, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _081B3446 - bl InBattlePike - lsls r0, 24 - cmp r0, 0 - bne _081B3518 - mov r0, r9 - adds r0, 0x64 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B34D2 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0x1 - bl append_byte -_081B34D2: - movs r0, 0x64 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - add r0, r9 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B3508 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0x6 - bl append_byte - b _081B3518 - .pool -_081B3508: - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0x3 - bl append_byte -_081B3518: - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0x2 - bl append_byte - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3414 - - thumb_func_start sub_81B353C -sub_81B353C: @ 81B353C - push {r4,lr} - adds r4, r0, 0 - ldr r1, =gUnknown_0203CEC8 - ldrb r0, [r1, 0x8] - lsls r0, 28 - lsrs r0, 28 - adds r2, r1, 0 - cmp r0, 0xC - bhi _081B35FE - lsls r0, 2 - ldr r1, =_081B3560 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B3560: - .4byte _081B3594 - .4byte _081B35B0 - .4byte _081B35FE - .4byte _081B35FE - .4byte _081B35BC - .4byte _081B35FE - .4byte _081B35DC - .4byte _081B35FE - .4byte _081B35EE - .4byte _081B35F2 - .4byte _081B35F6 - .4byte _081B35FE - .4byte _081B35FA -_081B3594: - bl in_multi_battle_room_with_var_condition - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B35AC - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _081B35FE -_081B35AC: - movs r1, 0x1 - b _081B3600 -_081B35B0: - adds r0, r4, 0 - bl sub_81B8A2C - lsls r0, 24 - lsrs r1, r0, 24 - b _081B3600 -_081B35BC: - movs r0, 0x9 - ldrsb r0, [r2, r0] - bl sub_81B856C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081B35D4 - cmp r0, 0x1 - beq _081B35D8 - movs r1, 0x7 - b _081B3600 -_081B35D4: - movs r1, 0x4 - b _081B3600 -_081B35D8: - movs r1, 0x5 - b _081B3600 -_081B35DC: - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - movs r1, 0x6 - cmp r0, 0 - beq _081B3600 - movs r1, 0x7 - b _081B3600 -_081B35EE: - movs r1, 0xA - b _081B3600 -_081B35F2: - movs r1, 0xB - b _081B3600 -_081B35F6: - movs r1, 0xC - b _081B3600 -_081B35FA: - movs r1, 0xD - b _081B3600 -_081B35FE: - movs r1, 0 -_081B3600: - adds r0, r1, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B353C - - thumb_func_start sub_81B3608 -sub_81B3608: @ 81B3608 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r4, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r0, r1 - ldr r7, =gPlayerParty - adds r5, r0, r7 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xC - beq _081B3674 - ldrb r4, [r4, 0x9] - adds r0, r5, 0 - bl sub_81B353C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r7, 0 - adds r1, r4, 0 - bl sub_81B33B4 - movs r0, 0 - bl sub_81B31B0 - movs r0, 0x15 - bl display_pokemon_menu_message - b _081B36EA - .pool -_081B3674: - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0 - bne _081B36C0 - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9980 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - str r1, [r0] - movs r0, 0 - b _081B36EC - .pool -_081B36C0: - ldrb r4, [r4, 0x9] - adds r0, r5, 0 - bl sub_81B353C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r7, 0 - adds r1, r4, 0 - bl sub_81B33B4 - movs r0, 0x1 - bl sub_81B31B0 - ldr r1, =gStringVar2 - adds r0, r6, 0 - bl CopyItemName - movs r0, 0x1A - bl display_pokemon_menu_message -_081B36EA: - movs r0, 0x1 -_081B36EC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B3608 - - thumb_func_start sub_81B36FC -sub_81B36FC: @ 81B36FC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_81B3608 - lsls r0, 24 - cmp r0, 0 - beq _081B3720 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0xFF - strh r1, [r0, 0x8] - ldr r1, =sub_81B3730 - str r1, [r0] -_081B3720: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B36FC - - thumb_func_start sub_81B3730 -sub_81B3730: @ 81B3730 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B37EE - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B37EE - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x17] - cmp r0, 0x3 - bhi _081B3774 - bl ProcessMenuInputNoWrapAround_other - b _081B3778 - .pool -_081B3774: - bl ProcessMenuInput_other -_081B3778: - lsls r0, 24 - lsrs r4, r0, 24 - bl GetMenuCursorPos - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - lsls r0, r4, 24 - asrs r5, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - beq _081B37EE - adds r0, 0x1 - cmp r5, r0 - bne _081B37CC - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xE - bl sub_81B302C - ldr r2, =gUnknown_08615C08 - ldr r0, [r4] - ldrb r1, [r0, 0x17] - adds r0, r1 - ldrb r0, [r0, 0xE] - lsls r0, 3 - adds r2, 0x4 - adds r0, r2 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 - b _081B37EE - .pool -_081B37CC: - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xE - bl sub_81B302C - ldr r1, =gUnknown_08615C08 - ldr r0, [r4] - adds r0, 0xF - adds r0, r5 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 -_081B37EE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3730 - - thumb_func_start sub_81B37FC -sub_81B37FC: @ 81B37FC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B3828 - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B37FC - - thumb_func_start sub_81B3828 -sub_81B3828: @ 81B3828 - push {r4,lr} - sub sp, 0x4 - ldr r4, =gUnknown_0203CEC8 - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _081B3868 - bl pokemon_change_order - ldr r1, =gPlayerParty - ldrb r2, [r4, 0x9] - ldr r0, =gPlayerPartyCount - ldrb r3, [r0] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =sub_81B3894 - str r0, [sp] - movs r0, 0x1 - bl sub_81BF8EC - b _081B3880 - .pool -_081B3868: - ldr r1, =gPlayerParty - ldrb r2, [r4, 0x9] - ldr r0, =gPlayerPartyCount - ldrb r3, [r0] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =sub_81B3894 - str r0, [sp] - movs r0, 0 - bl sub_81BF8EC -_081B3880: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3828 - - thumb_func_start sub_81B3894 -sub_81B3894: @ 81B3894 - push {lr} - sub sp, 0xC - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r3, =gUnknown_0203CEC8 - ldr r0, =gUnknown_0203CF20 - ldrb r0, [r0] - strb r0, [r3, 0x9] - ldrb r0, [r3, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r3, 0xB] - movs r1, 0x15 - str r1, [sp] - ldr r1, =sub_81B36FC - str r1, [sp, 0x4] - ldr r1, [r3] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3894 - - thumb_func_start brm_switch -brm_switch: @ 81B38DC - push {r4-r6,lr} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0x5 - bl PlaySE - ldr r5, =gUnknown_0203CEC8 - movs r0, 0x8 - strb r0, [r5, 0xB] - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - movs r0, 0x3 - bl display_pokemon_menu_message - ldrb r0, [r5, 0x9] - movs r1, 0x1 - bl sub_81B0FCC - ldrb r0, [r5, 0x9] - strb r0, [r5, 0xA] - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1370 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end brm_switch - - thumb_func_start sub_81B3938 -sub_81B3938: @ 81B3938 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - ldr r3, =gUnknown_0203CEC8 - movs r1, 0xA - ldrsb r1, [r3, r1] - movs r0, 0x9 - ldrsb r0, [r3, r0] - cmp r1, r0 - bne _081B3968 - adds r0, r7, 0 - bl sub_81B407C - b _081B3ABA - .pool -_081B3968: - add r2, sp, 0x8 - movs r0, 0x9 - ldrsb r0, [r3, r0] - ldr r1, =gUnknown_0203CEDC - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - movs r4, 0 - strb r0, [r2] - adds r0, r2, 0 - ldrb r0, [r0] - movs r1, 0x1 - bl GetWindowAttribute - strh r0, [r6] - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x2 - bl GetWindowAttribute - strh r0, [r6, 0x2] - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x3 - bl GetWindowAttribute - strh r0, [r6, 0x4] - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x4 - bl GetWindowAttribute - strh r0, [r6, 0x6] - strh r4, [r6, 0x10] - movs r1, 0x4 - ldrsh r0, [r6, r1] - cmp r0, 0xA - bne _081B39C4 - movs r2, 0x1 - negs r2, r2 - adds r0, r2, 0 - b _081B39C6 - .pool -_081B39C4: - movs r0, 0x1 -_081B39C6: - strh r0, [r6, 0x14] - add r2, sp, 0x8 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xA] - lsls r0, 24 - asrs r0, 24 - ldr r1, =gUnknown_0203CEDC - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - movs r4, 0 - strb r0, [r2, 0x1] - adds r0, r2, 0 - ldrb r0, [r0, 0x1] - movs r1, 0x1 - bl GetWindowAttribute - strh r0, [r6, 0x8] - add r0, sp, 0x8 - ldrb r0, [r0, 0x1] - movs r1, 0x2 - bl GetWindowAttribute - strh r0, [r6, 0xA] - add r0, sp, 0x8 - ldrb r0, [r0, 0x1] - movs r1, 0x3 - bl GetWindowAttribute - strh r0, [r6, 0xC] - add r0, sp, 0x8 - ldrb r0, [r0, 0x1] - movs r1, 0x4 - bl GetWindowAttribute - strh r0, [r6, 0xE] - strh r4, [r6, 0x12] - movs r1, 0xC - ldrsh r0, [r6, r1] - cmp r0, 0xA - bne _081B3A2C - movs r2, 0x1 - negs r2, r2 - adds r0, r2, 0 - b _081B3A2E - .pool -_081B3A2C: - movs r0, 0x1 -_081B3A2E: - strh r0, [r6, 0x16] - ldr r4, =gUnknown_0203CEF0 - movs r0, 0x4 - ldrsh r1, [r6, r0] - movs r2, 0x6 - ldrsh r0, [r6, r2] - lsls r0, 1 - muls r0, r1 - bl Alloc - str r0, [r4] - ldr r5, =gUnknown_0203CEF4 - movs r0, 0xC - ldrsh r1, [r6, r0] - movs r2, 0xE - ldrsh r0, [r6, r2] - lsls r0, 1 - muls r0, r1 - bl Alloc - str r0, [r5] - ldr r1, [r4] - ldrb r2, [r6] - ldrb r3, [r6, 0x2] - ldrb r0, [r6, 0x4] - str r0, [sp] - ldrb r0, [r6, 0x6] - str r0, [sp, 0x4] - movs r0, 0 - bl sub_8199CBC - ldr r1, [r5] - ldrb r2, [r6, 0x8] - ldrb r3, [r6, 0xA] - ldrb r0, [r6, 0xC] - str r0, [sp] - ldrb r0, [r6, 0xE] - str r0, [sp, 0x4] - movs r0, 0 - bl sub_8199CBC - add r0, sp, 0x8 - ldrb r0, [r0] - bl ClearWindowTilemap - add r0, sp, 0x8 - ldrb r0, [r0, 0x1] - bl ClearWindowTilemap - ldr r4, =gUnknown_0203CEC8 - movs r0, 0x9 - strb r0, [r4, 0xB] - ldrb r0, [r4, 0x9] - movs r1, 0x1 - bl sub_81B0FCC - ldrb r0, [r4, 0xA] - movs r1, 0x1 - bl sub_81B0FCC - adds r0, r7, 0 - bl sub_81B3CC0 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B3D48 - str r1, [r0] -_081B3ABA: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3938 - - thumb_func_start sub_81B3AD8 -sub_81B3AD8: @ 81B3AD8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r2, 0 - mov r12, r3 - ldr r7, [sp, 0x18] - lsls r0, 16 - lsrs r3, r0, 16 - adds r5, r3, 0 - lsls r1, 16 - lsrs r2, r1, 16 - mov r8, r2 - lsls r0, r3, 16 - asrs r1, r0, 16 - lsls r0, r2, 16 - asrs r0, 16 - adds r4, r1, r0 - cmp r4, 0 - blt _081B3B02 - cmp r1, 0x1F - ble _081B3B06 -_081B3B02: - movs r0, 0 - b _081B3B34 -_081B3B06: - cmp r1, 0 - bge _081B3B1A - negs r0, r1 - strb r0, [r6] - movs r0, 0 - mov r1, r12 - strb r0, [r1] - adds r0, r2, r3 - strb r0, [r7] - b _081B3B32 -_081B3B1A: - movs r0, 0 - strb r0, [r6] - mov r0, r12 - strb r5, [r0] - cmp r4, 0x1F - ble _081B3B2E - movs r0, 0x20 - subs r0, r5 - strb r0, [r7] - b _081B3B32 -_081B3B2E: - mov r1, r8 - strb r1, [r7] -_081B3B32: - movs r0, 0x1 -_081B3B34: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81B3AD8 - - thumb_func_start sub_81B3B40 -sub_81B3B40: @ 81B3B40 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - str r0, [sp, 0x28] - ldr r0, [sp, 0x54] - ldr r4, [sp, 0x58] - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - lsls r3, 16 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r4, 16 - lsrs r4, 16 - str r4, [sp, 0x30] - lsls r1, 16 - asrs r7, r1, 16 - lsrs r0, r3, 16 - str r0, [sp, 0x2C] - asrs r3, 16 - mov r8, r3 - mov r5, sp - adds r5, 0x25 - mov r6, sp - adds r6, 0x26 - str r6, [sp] - adds r0, r7, 0 - mov r1, r8 - add r2, sp, 0x24 - adds r3, r5, 0 - bl sub_81B3AD8 - lsls r0, 24 - cmp r0, 0 - beq _081B3BFA - ldrb r2, [r5] - mov r1, r9 - lsls r0, r1, 24 - lsrs r0, 24 - mov r9, r0 - ldrb r0, [r6] - str r0, [sp] - mov r1, r10 - lsls r0, r1, 24 - lsrs r4, r0, 24 - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - mov r3, r9 - bl FillBgTilemapBufferRect_Palette0 - ldr r1, [sp, 0x30] - lsls r0, r1, 16 - asrs r0, 16 - adds r0, r7, r0 - lsls r0, 16 - asrs r0, 16 - str r6, [sp] - mov r1, r8 - add r2, sp, 0x24 - adds r3, r5, 0 - bl sub_81B3AD8 - lsls r0, 24 - cmp r0, 0 - beq _081B3BFA - add r0, sp, 0x24 - ldrb r2, [r0] - ldr r1, [sp, 0x2C] - lsls r0, r1, 24 - lsrs r0, 24 - str r0, [sp] - str r4, [sp, 0x4] - ldrb r0, [r5] - str r0, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - ldrb r0, [r6] - str r0, [sp, 0x10] - str r4, [sp, 0x14] - movs r0, 0x11 - str r0, [sp, 0x18] - movs r0, 0 - str r0, [sp, 0x1C] - str r0, [sp, 0x20] - ldr r1, [sp, 0x28] - movs r3, 0 - bl CopyRectToBgTilemapBufferRect -_081B3BFA: - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B3B40 - - thumb_func_start sub_81B3C0C -sub_81B3C0C: @ 81B3C0C - push {r4,lr} - ldr r4, =gSprites - ldrb r2, [r0, 0xB] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - adds r3, r4 - lsls r1, 16 - asrs r1, 13 - ldrh r2, [r3, 0x24] - adds r2, r1 - strh r2, [r3, 0x24] - ldrb r3, [r0, 0xA] - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r4 - ldrh r3, [r2, 0x24] - adds r3, r1 - strh r3, [r2, 0x24] - ldrb r3, [r0, 0x9] - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r4 - ldrh r3, [r2, 0x24] - adds r3, r1 - strh r3, [r2, 0x24] - ldrb r2, [r0, 0xC] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrh r2, [r0, 0x24] - adds r2, r1 - strh r2, [r0, 0x24] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3C0C - - thumb_func_start sub_81B3C60 -sub_81B3C60: @ 81B3C60 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081B3C8E - ldr r2, =gUnknown_0203CEDC - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - lsls r1, 4 - ldr r0, [r2] - adds r0, r1 - movs r2, 0x14 - ldrsh r1, [r4, r2] - bl sub_81B3C0C -_081B3C8E: - movs r1, 0x16 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081B3CAC - ldr r2, =gUnknown_0203CEDC - ldr r0, =gUnknown_0203CEC8 - movs r1, 0xA - ldrsb r1, [r0, r1] - lsls r1, 4 - ldr r0, [r2] - adds r0, r1 - movs r2, 0x16 - ldrsh r1, [r4, r2] - bl sub_81B3C0C -_081B3CAC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3C60 - - thumb_func_start sub_81B3CC0 -sub_81B3CC0: @ 81B3CC0 - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r5, r1, r0 - movs r1, 0x14 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _081B3D00 - ldr r0, =gUnknown_0203CEF0 - ldr r0, [r0] - ldrh r1, [r5, 0x10] - ldrh r2, [r5] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - movs r3, 0x2 - ldrsh r2, [r5, r3] - movs r4, 0x4 - ldrsh r3, [r5, r4] - movs r6, 0x6 - ldrsh r4, [r5, r6] - str r4, [sp] - movs r6, 0x14 - ldrsh r4, [r5, r6] - str r4, [sp, 0x4] - bl sub_81B3B40 -_081B3D00: - movs r1, 0x16 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _081B3D2E - ldr r0, =gUnknown_0203CEF4 - ldr r0, [r0] - ldrh r1, [r5, 0x12] - ldrh r2, [r5, 0x8] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - movs r3, 0xA - ldrsh r2, [r5, r3] - movs r4, 0xC - ldrsh r3, [r5, r4] - movs r6, 0xE - ldrsh r4, [r5, r6] - str r4, [sp] - movs r6, 0x16 - ldrsh r4, [r5, r6] - str r4, [sp, 0x4] - bl sub_81B3B40 -_081B3D2E: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3CC0 - - thumb_func_start sub_81B3D48 -sub_81B3D48: @ 81B3D48 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r7, r0, 3 - ldr r0, =gTasks + 0x8 - mov r8, r0 - adds r6, r7, r0 - adds r0, r4, 0 - bl sub_81B3CC0 - adds r0, r4, 0 - bl sub_81B3C60 - ldrh r1, [r6, 0x14] - ldrh r2, [r6, 0x10] - adds r1, r2 - strh r1, [r6, 0x10] - ldrh r0, [r6, 0x16] - ldrh r3, [r6, 0x12] - adds r0, r3 - strh r0, [r6, 0x12] - add r2, sp, 0x8 - ldrh r0, [r6] - adds r0, r1 - strh r0, [r2] - adds r1, r2, 0 - ldrh r0, [r6, 0x12] - ldrh r3, [r6, 0x8] - adds r2, r0, r3 - strh r2, [r1, 0x2] - adds r0, r1, 0 - ldrh r0, [r0] - cmp r0, 0x21 - bls _081B3E3A - lsls r0, r2, 16 - lsrs r0, 16 - cmp r0, 0x21 - bls _081B3E3A - movs r1, 0x14 - ldrsh r0, [r6, r1] - negs r0, r0 - strh r0, [r6, 0x14] - movs r2, 0x16 - ldrsh r0, [r6, r2] - negs r0, r0 - strh r0, [r6, 0x16] - bl swap_pokemon_and_oams - ldr r4, =gUnknown_0203CEC8 - ldrb r0, [r4, 0x9] - bl sub_81B0948 - ldrb r0, [r4, 0xA] - bl sub_81B0948 - movs r0, 0x9 - ldrsb r0, [r4, r0] - ldr r5, =gUnknown_0203CEDC - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0xA - ldrsb r0, [r4, r0] - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - ldr r0, =gUnknown_0203CEF0 - ldr r1, [r0] - ldrb r2, [r6] - ldrb r3, [r6, 0x2] - ldrb r0, [r6, 0x4] - str r0, [sp] - ldrb r0, [r6, 0x6] - str r0, [sp, 0x4] - movs r0, 0 - bl sub_8199CBC - ldr r0, =gUnknown_0203CEF4 - ldr r1, [r0] - ldrb r2, [r6, 0x8] - ldrb r3, [r6, 0xA] - ldrb r0, [r6, 0xC] - str r0, [sp] - ldrb r0, [r6, 0xE] - str r0, [sp, 0x4] - movs r0, 0 - bl sub_8199CBC - movs r0, 0x9 - ldrsb r0, [r4, r0] - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl ClearWindowTilemap - movs r0, 0xA - ldrsb r0, [r4, r0] - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl ClearWindowTilemap - mov r0, r8 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =sub_81B3E60 - str r1, [r0] -_081B3E3A: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3D48 - - thumb_func_start sub_81B3E60 -sub_81B3E60: @ 81B3E60 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - adds r0, r6, 0 - bl sub_81B3CC0 - adds r0, r6, 0 - bl sub_81B3C60 - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081B3EE4 - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _081B3EE4 - ldr r5, =gUnknown_0203CEC8 - movs r0, 0x9 - ldrsb r0, [r5, r0] - ldr r4, =gUnknown_0203CEDC - ldr r1, [r4] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0xA - ldrsb r0, [r5, r0] - ldr r1, [r4] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gUnknown_0203CEF0 - ldr r0, [r0] - bl Free - ldr r0, =gUnknown_0203CEF4 - ldr r0, [r0] - bl Free - adds r0, r6, 0 - bl sub_81B407C - b _081B3F08 - .pool -_081B3EE4: - ldrh r1, [r4, 0x14] - ldrh r0, [r4, 0x10] - adds r1, r0 - strh r1, [r4, 0x10] - ldrh r0, [r4, 0x16] - ldrh r2, [r4, 0x12] - adds r0, r2 - strh r0, [r4, 0x12] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0 - bne _081B3EFE - strh r1, [r4, 0x14] -_081B3EFE: - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081B3F08 - strh r0, [r4, 0x16] -_081B3F08: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B3E60 - - thumb_func_start oamt_swap_pos -oamt_swap_pos: @ 81B3F10 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - ldrb r3, [r0] - ldrb r2, [r1] - strb r2, [r0] - strb r3, [r1] - ldr r5, =gSprites - ldrb r2, [r0] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - adds r3, r5 - ldrh r6, [r3, 0x20] - ldrh r2, [r3, 0x22] - mov r8, r2 - ldrh r2, [r3, 0x24] - mov r9, r2 - ldrh r2, [r3, 0x26] - mov r10, r2 - ldrb r4, [r1] - lsls r2, r4, 4 - adds r2, r4 - lsls r2, 2 - adds r2, r5 - ldrh r2, [r2, 0x20] - strh r2, [r3, 0x20] - ldrb r2, [r0] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - adds r3, r5 - ldrb r4, [r1] - lsls r2, r4, 4 - adds r2, r4 - lsls r2, 2 - adds r2, r5 - ldrh r2, [r2, 0x22] - strh r2, [r3, 0x22] - ldrb r2, [r0] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - adds r3, r5 - ldrb r4, [r1] - lsls r2, r4, 4 - adds r2, r4 - lsls r2, 2 - adds r2, r5 - ldrh r2, [r2, 0x24] - strh r2, [r3, 0x24] - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r5 - ldrb r3, [r1] - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r0, r5 - ldrh r0, [r0, 0x26] - strh r0, [r2, 0x26] - ldrb r2, [r1] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x20] - ldrb r2, [r1] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - mov r2, r8 - strh r2, [r0, 0x22] - ldrb r2, [r1] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - mov r2, r9 - strh r2, [r0, 0x24] - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r10 - strh r1, [r0, 0x26] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end oamt_swap_pos - - thumb_func_start swap_pokemon_and_oams -swap_pokemon_and_oams: @ 81B3FDC - push {r4-r6,lr} - sub sp, 0x8 - ldr r1, =gUnknown_0203CEDC - ldr r2, =gUnknown_0203CEC8 - movs r3, 0x9 - ldrsb r3, [r2, r3] - lsls r0, r3, 4 - ldr r1, [r1] - adds r0, r1, r0 - str r0, [sp] - ldrb r2, [r2, 0xA] - lsls r2, 24 - asrs r2, 24 - lsls r0, r2, 4 - adds r0, r1, r0 - str r0, [sp, 0x4] - movs r1, 0x64 - adds r4, r3, 0 - muls r4, r1 - ldr r0, =gPlayerParty - adds r4, r0 - adds r5, r2, 0 - muls r5, r1 - adds r5, r0 - movs r0, 0x64 - bl Alloc - adds r6, r0, 0 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x64 - bl memcpy - adds r0, r6, 0 - bl Free - ldr r0, [sp] - adds r0, 0xB - ldr r1, [sp, 0x4] - adds r1, 0xB - bl oamt_swap_pos - ldr r0, [sp] - adds r0, 0xA - ldr r1, [sp, 0x4] - adds r1, 0xA - bl oamt_swap_pos - ldr r0, [sp] - adds r0, 0x9 - ldr r1, [sp, 0x4] - adds r1, 0x9 - bl oamt_swap_pos - ldr r0, [sp] - adds r0, 0xC - ldr r1, [sp, 0x4] - adds r1, 0xC - bl oamt_swap_pos - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end swap_pokemon_and_oams - - thumb_func_start sub_81B407C -sub_81B407C: @ 81B407C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - ldr r4, =gUnknown_0203CEC8 - movs r0, 0 - strb r0, [r4, 0xB] - ldrb r0, [r4, 0x9] - movs r1, 0 - bl sub_81B0FCC - ldrb r0, [r4, 0xA] - strb r0, [r4, 0x9] - ldrb r0, [r4, 0xA] - movs r1, 0x1 - bl sub_81B0FCC - movs r0, 0 - bl display_pokemon_menu_message - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1370 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B407C - - thumb_func_start brm_cancel_1 -brm_cancel_1: @ 81B40D4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x6 - bne _081B4110 - movs r0, 0xF - bl display_pokemon_menu_message - b _081B4116 - .pool -_081B4110: - movs r0, 0 - bl display_pokemon_menu_message -_081B4116: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end brm_cancel_1 - - thumb_func_start sub_81B4134 -sub_81B4134: @ 81B4134 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gPlayerParty - ldr r1, =gUnknown_0203CEC8 - ldrb r1, [r1, 0x9] - movs r2, 0x8 - bl sub_81B33B4 - movs r0, 0x1 - bl sub_81B31B0 - movs r0, 0x18 - bl display_pokemon_menu_message - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xFF - strh r1, [r0, 0x8] - ldr r1, =sub_81B3730 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4134 - - thumb_func_start sub_81B4198 -sub_81B4198: @ 81B4198 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B41C4 - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4198 - - thumb_func_start sub_81B41C4 -sub_81B41C4: @ 81B41C4 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _081B41E0 - ldr r2, =c2_8123744 - movs r0, 0x2 - movs r1, 0x5 - bl GoToBagMenu - b _081B41E8 - .pool -_081B41E0: - ldr r1, =c2_8123744 - movs r0, 0x2 - bl sub_81C4F98 -_081B41E8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B41C4 - - thumb_func_start c2_8123744 -c2_8123744: @ 81B41F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r6, =gUnknown_0203CE7C - ldrh r0, [r6] - cmp r0, 0 - bne _081B4224 - ldr r3, =gUnknown_0203CEC8 - ldrb r0, [r3, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r3, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B36FC - str r1, [sp, 0x4] - ldr r1, [r3] - b _081B425A - .pool -_081B4224: - ldr r4, =gUnknown_0203CEFC - ldr r5, =gUnknown_0203CEC8 - movs r0, 0x9 - ldrsb r0, [r5, r0] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r7, =gPlayerParty - adds r0, r7 - movs r1, 0xC - bl GetMonData - strh r0, [r4] - lsls r0, 16 - cmp r0, 0 - beq _081B4278 - ldrb r0, [r5, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r5, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B4350 - str r1, [sp, 0x4] - ldr r1, [r5] -_081B425A: - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 - b _081B42C0 - .pool -_081B4278: - ldrh r0, [r6] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B42A4 - ldrh r0, [r6] - movs r1, 0x1 - bl RemoveBagItem - movs r0, 0x9 - ldrsb r0, [r5, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - ldrh r1, [r6] - bl sub_81B1DB8 - bl sub_81B452C - b _081B42C0 -_081B42A4: - ldrb r0, [r5, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r5, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B42D0 - str r1, [sp, 0x4] - ldr r1, [r5] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 -_081B42C0: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c2_8123744 - - thumb_func_start sub_81B42D0 -sub_81B42D0: @ 81B42D0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B432C - ldr r0, =gUnknown_0203CE7C - ldrh r4, [r0] - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B1C84 - mov r1, r8 - movs r0, 0x9 - ldrsb r0, [r1, r0] - muls r0, r6 - adds r0, r5 - adds r1, r4, 0 - bl sub_81B1DB8 - adds r0, r4, 0 - movs r1, 0x1 - bl RemoveBagItem - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - str r1, [r0] -_081B432C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B42D0 - - thumb_func_start sub_81B4350 -sub_81B4350: @ 81B4350 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B4388 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gUnknown_0203CEFC - ldrh r1, [r1] - movs r2, 0x1 - bl sub_81B1D1C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B43A8 - str r1, [r0] -_081B4388: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4350 - - thumb_func_start sub_81B43A8 -sub_81B43A8: @ 81B43A8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B43CC - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B43DC - str r0, [r1] -_081B43CC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B43A8 - - thumb_func_start sub_81B43DC -sub_81B43DC: @ 81B43DC - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B4402 - cmp r1, 0 - bgt _081B43FC - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B44D8 - b _081B44EC -_081B43FC: - cmp r1, 0x1 - beq _081B44DE - b _081B44EC -_081B4402: - ldr r5, =gUnknown_0203CE7C - ldrh r0, [r5] - movs r1, 0x1 - bl RemoveBagItem - ldr r6, =gUnknown_0203CEFC - ldrh r0, [r6] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - cmp r0, 0 - bne _081B4458 - ldrh r0, [r5] - movs r1, 0x1 - bl AddBagItem - ldrh r0, [r6] - bl pokemon_item_not_removed - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] - b _081B44EC - .pool -_081B4458: - ldrh r0, [r5] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B4498 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldrh r1, [r5] - bl sub_81B1DB8 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B44FC - str r1, [r0] - b _081B44EC - .pool -_081B4498: - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldrh r1, [r5] - bl sub_81B1DB8 - ldrh r0, [r5] - ldrh r1, [r6] - movs r2, 0x1 - bl sub_81B1D68 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - str r1, [r0] - b _081B44EC - .pool -_081B44D8: - movs r0, 0x5 - bl PlaySE -_081B44DE: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1C1C - str r0, [r1] -_081B44EC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B43DC - - thumb_func_start sub_81B44FC -sub_81B44FC: @ 81B44FC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B451C - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B452C - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 -_081B451C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B44FC - - thumb_func_start sub_81B452C -sub_81B452C: @ 81B452C - push {lr} - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x40 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock1Ptr - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x00002be0 - adds r2, r0 - ldr r1, [r1] - adds r1, r2 - ldr r2, =sub_81B4578 - movs r0, 0x4 - movs r3, 0x3 - bl sub_811A20C - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B452C - - thumb_func_start sub_81B4578 -sub_81B4578: @ 81B4578 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =gScriptResult - ldrh r7, [r0] - cmp r7, 0 - bne _081B45F8 - adds r0, r5, 0 - bl sub_80D4680 - ldr r4, =gUnknown_0203CEFC - adds r0, r5, 0 - movs r1, 0xC - adds r2, r4, 0 - bl SetMonData - ldrh r0, [r4] - movs r1, 0x1 - bl RemoveBagItem - mov r0, r8 - movs r1, 0x1 - bl AddBagItem - ldrb r0, [r6, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r6, 0xB] - str r7, [sp] - ldr r1, =sub_81B36FC - str r1, [sp, 0x4] - ldr r1, [r6] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 - b _081B4614 - .pool -_081B45F8: - ldrb r0, [r6, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r6, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B4624 - str r1, [sp, 0x4] - ldr r1, [r6] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 -_081B4614: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4578 - - thumb_func_start sub_81B4624 -sub_81B4624: @ 81B4624 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B468A - ldr r1, =gUnknown_0203CEFC - ldrh r0, [r1] - cmp r0, 0 - bne _081B4670 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gUnknown_0203CE7C - ldrh r1, [r1] - movs r2, 0 - movs r3, 0 - bl sub_81B1C84 - b _081B467C - .pool -_081B4670: - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldrh r1, [r1] - movs r2, 0 - bl sub_81B1D68 -_081B467C: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B469C - str r0, [r1] -_081B468A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4624 - - thumb_func_start sub_81B469C -sub_81B469C: @ 81B469C - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r6, r1, r0 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B471C - ldr r5, =gUnknown_0203CEDC - movs r0, 0x9 - ldrsb r0, [r4, r0] - lsls r0, 4 - ldr r1, [r5] - adds r1, r0 - adds r0, r6, 0 - bl sub_81B5C94 - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xC - bne _081B4716 - adds r0, r6, 0 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - beq _081B4704 - movs r0, 0x9 - ldrsb r0, [r4, r0] - lsls r0, 4 - ldr r1, [r5] - adds r1, r0 - movs r0, 0xB - movs r2, 0x1 - bl sub_81B2FA8 - b _081B4716 - .pool -_081B4704: - movs r0, 0x9 - ldrsb r0, [r4, r0] - lsls r0, 4 - ldr r1, [r5] - adds r1, r0 - movs r0, 0xC - movs r2, 0x1 - bl sub_81B2FA8 -_081B4716: - adds r0, r7, 0 - bl sub_81B1C1C -_081B471C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B469C - - thumb_func_start sub_81B4724 -sub_81B4724: @ 81B4724 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81B1E00 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081B4788 - cmp r0, 0x1 - beq _081B47AC - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x1 - bl sub_81B1CD0 - b _081B47BA - .pool -_081B4788: - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9980 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - b _081B47B4 - .pool -_081B47AC: - adds r0, r6, 0 - bl pokemon_item_not_removed - ldr r0, =gStringVar4 -_081B47B4: - movs r1, 0x1 - bl sub_81B1B5C -_081B47BA: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gTasks - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B469C - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4724 - - thumb_func_start sub_81B47E0 -sub_81B47E0: @ 81B47E0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - cmp r5, 0 - bne _081B4864 - ldr r1, =gStringVar1 - adds r0, r7, 0 - bl GetMonNickname - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9980 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - b _081B488A - .pool -_081B4864: - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9E00 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B48A8 -_081B488A: - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B47E0 - - thumb_func_start sub_81B48A8 -sub_81B48A8: @ 81B48A8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B48CC - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B48DC - str r0, [r1] -_081B48CC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B48A8 - - thumb_func_start sub_81B48DC -sub_81B48DC: @ 81B48DC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B491A - cmp r1, 0 - bgt _081B4914 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B4964 - b _081B4978 - .pool -_081B4914: - cmp r1, 0x1 - beq _081B496A - b _081B4978 -_081B491A: - adds r0, r4, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9E14 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B4988 - str r1, [r0] - b _081B4978 - .pool -_081B4964: - movs r0, 0x5 - bl PlaySE -_081B496A: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1C1C - str r0, [r1] -_081B4978: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B48DC - - thumb_func_start sub_81B4988 -sub_81B4988: @ 81B4988 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B49EC - movs r1, 0 - mov r0, sp - strh r1, [r0] - adds r0, r5, 0 - movs r1, 0xC - mov r2, sp - bl SetMonData - ldr r4, =gUnknown_0203CEDC - movs r0, 0x9 - ldrsb r0, [r6, r0] - lsls r0, 4 - ldr r1, [r4] - adds r1, r0 - adds r0, r5, 0 - bl sub_81B5C94 - movs r0, 0x9 - ldrsb r0, [r6, r0] - lsls r0, 4 - ldr r1, [r4] - adds r1, r0 - movs r0, 0xC - movs r2, 0x1 - bl sub_81B2FA8 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B49EC: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4988 - - thumb_func_start sub_81B4A08 -sub_81B4A08: @ 81B4A08 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gPlayerParty - ldr r1, =gUnknown_0203CEC8 - ldrb r1, [r1, 0x9] - movs r2, 0x9 - bl sub_81B33B4 - movs r0, 0x2 - bl sub_81B31B0 - movs r0, 0x19 - bl display_pokemon_menu_message - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xFF - strh r1, [r0, 0x8] - ldr r1, =sub_81B3730 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4A08 - - thumb_func_start sub_81B4A6C -sub_81B4A6C: @ 81B4A6C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B4A98 - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4A6C - - thumb_func_start sub_81B4A98 -sub_81B4A98: @ 81B4A98 - push {lr} - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x40 - bl GetMonData - ldr r2, =gSaveBlock1Ptr - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x00002be0 - adds r1, r0 - ldr r0, [r2] - adds r0, r1 - ldr r1, =sub_81B4AE0 - movs r2, 0x1 - bl sub_8121478 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4A98 - - thumb_func_start sub_81B4AE0 -sub_81B4AE0: @ 81B4AE0 - push {lr} - sub sp, 0xC - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r3, =gUnknown_0203CEC8 - ldrb r0, [r3, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r3, 0xB] - movs r1, 0x15 - str r1, [sp] - ldr r1, =sub_81B36FC - str r1, [sp, 0x4] - ldr r1, [r3] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4AE0 - - thumb_func_start brm_take_2 -brm_take_2: @ 81B4B20 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - ldr r5, =gUnknown_0203CEC4 - ldr r0, [r5] - adds r0, 0xD - bl sub_81B302C - ldr r0, [r5] - adds r0, 0xC - bl sub_81B302C - ldr r0, =gUnknown_085E9855 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B4B6C - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end brm_take_2 - - thumb_func_start sub_81B4B6C -sub_81B4B6C: @ 81B4B6C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B4B90 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B4BA0 - str r0, [r1] -_081B4B90: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4B6C - - thumb_func_start sub_81B4BA0 -sub_81B4BA0: @ 81B4BA0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B4BC6 - cmp r1, 0 - bgt _081B4BC0 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B4C30 - b _081B4C4C -_081B4BC0: - cmp r1, 0x1 - beq _081B4C36 - b _081B4C4C -_081B4BC6: - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_80D4700 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081B4C0C - ldr r0, =gUnknown_085E9877 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - b _081B4C4A - .pool -_081B4C0C: - ldr r0, =gUnknown_085E9897 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - b _081B4C4A - .pool -_081B4C30: - movs r0, 0x5 - bl PlaySE -_081B4C36: - ldr r0, =gUnknown_085E98B4 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B4C60 -_081B4C4A: - str r1, [r0] -_081B4C4C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4BA0 - - thumb_func_start sub_81B4C60 -sub_81B4C60: @ 81B4C60 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B4C84 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B4C94 - str r0, [r1] -_081B4C84: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4C60 - - thumb_func_start sub_81B4C94 -sub_81B4C94: @ 81B4C94 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B4CBE - cmp r1, 0 - bgt _081B4CB8 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B4D50 - b _081B4D64 -_081B4CB8: - cmp r1, 0x1 - beq _081B4D56 - b _081B4D64 -_081B4CBE: - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r7, 0x64 - muls r0, r7 - ldr r6, =gPlayerParty - adds r0, r6 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B4D24 - mov r1, r8 - movs r0, 0x9 - ldrsb r0, [r1, r0] - muls r0, r7 - adds r0, r6 - bl sub_80D4680 - ldr r0, =gUnknown_085E99B8 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - str r1, [r0] - b _081B4D64 - .pool -_081B4D24: - adds r0, r4, 0 - bl pokemon_item_not_removed - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] - b _081B4D64 - .pool -_081B4D50: - movs r0, 0x5 - bl PlaySE -_081B4D56: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1C1C - str r0, [r1] -_081B4D64: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4C94 - - thumb_func_start sub_81B4D78 -sub_81B4D78: @ 81B4D78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r5, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r5, r1] - movs r0, 0x64 - muls r0, r1 - ldr r6, =gPlayerParty - adds r7, r0, r6 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldrb r4, [r5, 0x9] - adds r0, r7, 0 - bl sub_81B353C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81B33B4 - ldrb r1, [r5, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xC - beq _081B4DE4 - movs r0, 0 - bl sub_81B31B0 - movs r0, 0x15 - bl display_pokemon_menu_message - b _081B4E02 - .pool -_081B4DE4: - movs r0, 0x1 - bl sub_81B31B0 - adds r0, r7, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gStringVar2 - bl CopyItemName - movs r0, 0x1A - bl display_pokemon_menu_message -_081B4E02: - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0xFF - strh r1, [r0, 0x8] - ldr r1, =sub_81B3730 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4D78 - - thumb_func_start brm_shift_sendout -brm_shift_sendout: @ 81B4E2C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r5, =gUnknown_0203CEC4 - ldr r0, [r5] - adds r0, 0xC - bl sub_81B302C - bl sub_81B8A7C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B4E5C - adds r0, r4, 0 - bl sub_81B12C0 - b _081B4E7A - .pool -_081B4E5C: - ldr r0, [r5] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gStringVar4 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B4E7A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end brm_shift_sendout - - thumb_func_start sub_81B4E8C -sub_81B4E8C: @ 81B4E8C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - bl sub_81B8830 - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - cmp r5, r6 - bcs _081B4F36 - ldr r2, =gUnknown_0203CEC8 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - mov r8, r0 -_081B4EC6: - ldr r0, =gUnknown_0203CEF8 - adds r4, r5, r0 - ldrb r0, [r4] - cmp r0, 0 - bne _081B4F2C - movs r0, 0x5 - str r2, [sp] - bl PlaySE - ldr r2, [sp] - ldrb r0, [r2, 0x9] - adds r0, 0x1 - strb r0, [r4] - adds r0, r5, 0x2 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CEDC - ldrb r2, [r2, 0x9] - lsls r2, 24 - asrs r2, 24 - lsls r2, 4 - ldr r1, [r1] - adds r1, r2 - movs r2, 0x1 - bl sub_81B2FA8 - subs r0, r6, 0x1 - cmp r5, r0 - bne _081B4F04 - bl sub_81B4F88 -_081B4F04: - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =sub_81B1370 - mov r1, r8 - str r0, [r1] - b _081B4F68 - .pool -_081B4F2C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r6 - bcc _081B4EC6 -_081B4F36: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9830 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x20 - bl PlaySE - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B4F68: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4E8C - - thumb_func_start sub_81B4F88 -sub_81B4F88: @ 81B4F88 - push {r4,lr} - ldr r4, =gUnknown_0203CEC8 - ldrb r0, [r4, 0x9] - movs r1, 0 - bl sub_81B0FCC - movs r0, 0x6 - strb r0, [r4, 0x9] - movs r1, 0x1 - bl sub_81B0FCC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4F88 - - thumb_func_start sub_81B4FA8 -sub_81B4FA8: @ 81B4FA8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - bl sub_81B8830 - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - cmp r4, r5 - bcs _081B502A - ldr r6, =gUnknown_0203CEF8 - subs r2, r5, 0x1 - adds r7, r6, 0 - ldr r3, =gUnknown_0203CEC8 -_081B4FE2: - adds r0, r4, r6 - ldrb r1, [r0] - movs r0, 0x9 - ldrsb r0, [r3, r0] - adds r0, 0x1 - cmp r1, r0 - bne _081B5020 - adds r0, r4, 0 - adds r4, r2, 0 - cmp r0, r4 - bge _081B500C - adds r3, r7, 0 -_081B4FFA: - adds r2, r0, r3 - adds r1, r0, 0x1 - adds r0, r1, r3 - ldrb r0, [r0] - strb r0, [r2] - lsls r1, 24 - lsrs r0, r1, 24 - cmp r0, r4 - blt _081B4FFA -_081B500C: - adds r1, r0, r6 - movs r0, 0 - strb r0, [r1] - b _081B502A - .pool -_081B5020: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _081B4FE2 -_081B502A: - ldr r6, =gUnknown_0203CEDC - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - lsls r0, 4 - ldr r1, [r6] - adds r1, r0 - movs r0, 0x1 - movs r2, 0x1 - bl sub_81B2FA8 - movs r4, 0 - subs r5, 0x1 - mov r0, r8 - lsls r7, r0, 2 - cmp r4, r5 - bge _081B5078 -_081B504E: - ldr r0, =gUnknown_0203CEF8 - adds r1, r4, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _081B506E - adds r0, r4, 0x2 - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r1] - lsls r2, 4 - subs r2, 0x10 - ldr r1, [r6] - adds r1, r2 - movs r2, 0x1 - bl sub_81B2FA8 -_081B506E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - blt _081B504E -_081B5078: - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =gTasks - mov r2, r8 - adds r1, r7, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4FA8 - - thumb_func_start sub_81B50AC -sub_81B50AC: @ 81B50AC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B12C0 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B50AC - - thumb_func_start sub_81B50C8 -sub_81B50C8: @ 81B50C8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - mov r9, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r4, =gPlayerParty - adds r0, r4 - movs r1, 0x41 - bl GetMonData - adds r6, r0, 0 - lsls r6, 16 - lsrs r6, 16 - mov r1, r9 - movs r0, 0x9 - ldrsb r0, [r1, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r4 - movs r1, 0xB - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - mov r1, r9 - movs r0, 0x9 - ldrsb r0, [r1, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r4 - movs r1, 0x50 - bl GetMonData - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_800F7DC - ldr r0, [r0] - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_807A8D0 - cmp r0, 0x1 - beq _081B515C - cmp r0, 0x2 - beq _081B5170 - movs r0, 0x5 - bl PlaySE - adds r0, r7, 0 - bl sub_81B12C0 - b _081B51B0 - .pool -_081B515C: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA210 - bl StringExpandPlaceholders - b _081B5178 - .pool -_081B5170: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA234 - bl StringExpandPlaceholders -_081B5178: - movs r0, 0x20 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EA1CA - adds r0, r4, 0 - bl StringAppend - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B51B0: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B50C8 - - thumb_func_start brm_trade_1 -brm_trade_1: @ 81B51D4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r6, 0x64 - muls r0, r6 - ldr r4, =gPlayerParty - adds r0, r4 - movs r1, 0x41 - bl GetMonData - mov r9, r0 - mov r1, r9 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - mov r1, r8 - movs r0, 0x9 - ldrsb r0, [r1, r0] - muls r0, r6 - adds r0, r4 - movs r1, 0xB - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - mov r1, r8 - movs r0, 0x9 - ldrsb r0, [r1, r0] - muls r0, r6 - adds r0, r4 - movs r1, 0x50 - bl GetMonData - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_800F7DC - ldr r0, [r0] - ldr r1, =gUnknown_02022C38 - ldr r1, [r1] - ldr r2, =gUnknown_02022C3C - ldrh r3, [r2] - ldr r2, =gUnknown_02022C3E - ldrb r2, [r2] - str r2, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - mov r2, r9 - bl sub_807A7E0 - cmp r0, 0 - beq _081B52C8 - ldr r5, =gStringVar4 - ldr r1, =gUnknown_08615E0C - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl StringExpandPlaceholders - movs r0, 0x20 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r1, =gUnknown_085EA1CA - adds r0, r5, 0 - bl StringAppend - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] - b _081B52D4 - .pool -_081B52C8: - movs r0, 0x5 - bl PlaySE - adds r0, r7, 0 - bl sub_81B12C0 -_081B52D4: - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end brm_trade_1 - - thumb_func_start sub_81B52E4 -sub_81B52E4: @ 81B52E4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gPlayerParty - ldr r1, =gUnknown_0203CEC8 - ldrb r1, [r1, 0x9] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl sub_807A918 - cmp r0, 0x2 - beq _081B5340 - cmp r0, 0x2 - bgt _081B5328 - cmp r0, 0x1 - beq _081B532E - b _081B5368 - .pool -_081B5328: - cmp r0, 0x3 - beq _081B5354 - b _081B5368 -_081B532E: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA1E8 - bl StringExpandPlaceholders - b _081B53C0 - .pool -_081B5340: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA210 - bl StringExpandPlaceholders - b _081B53C0 - .pool -_081B5354: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA234 - bl StringExpandPlaceholders - b _081B53C0 - .pool -_081B5368: - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EA1CD - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B53FC - b _081B53E4 - .pool -_081B53C0: - movs r0, 0x20 - bl PlaySE - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EA1CA - adds r0, r4, 0 - bl StringAppend - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C -_081B53E4: - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B52E4 - - thumb_func_start sub_81B53FC -sub_81B53FC: @ 81B53FC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B5420 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B5430 - str r0, [r1] -_081B5420: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B53FC - - thumb_func_start sub_81B5430 -sub_81B5430: @ 81B5430 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B5456 - cmp r1, 0 - bgt _081B5450 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B545E - b _081B546A -_081B5450: - cmp r1, 0x1 - beq _081B5464 - b _081B546A -_081B5456: - adds r0, r4, 0 - bl sub_81B12C0 - b _081B546A -_081B545E: - movs r0, 0x5 - bl PlaySE -_081B5464: - adds r0, r4, 0 - bl sub_81B1C1C -_081B546A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B5430 - - thumb_func_start sub_81B5470 -sub_81B5470: @ 81B5470 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - bl GetMenuCursorPos - ldr r5, =gUnknown_0203CEC4 - ldr r1, [r5] - lsls r0, 24 - lsrs r0, 24 - adds r1, 0xF - adds r1, r0 - ldrb r0, [r1] - subs r0, 0x13 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r1, =gUnknown_08615D9C - lsls r0, r4, 3 - adds r7, r0, r1 - ldr r0, [r7] - cmp r0, 0 - bne _081B54A2 - b _081B5664 -_081B54A2: - ldr r0, [r5] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r5] - adds r0, 0xD - bl sub_81B302C - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B54C6 - bl InUnionRoom - cmp r0, 0x1 - bne _081B54E8 -_081B54C6: - adds r0, r4, 0 - subs r0, 0xB - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B54E4 - movs r0, 0xD - bl display_pokemon_menu_message - b _081B5656 - .pool -_081B54E4: - ldrb r0, [r7, 0x4] - b _081B5652 -_081B54E8: - cmp r4, 0x7 - bhi _081B5524 - ldr r1, =0x00000867 - adds r0, r4, r1 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B5524 - ldr r0, =gUnknown_085E97FC - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] - b _081B5664 - .pool -_081B5524: - ldr r1, =gUnknown_08615D9C - lsls r0, r4, 3 - adds r5, r0, r1 - ldr r0, [r5] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B553A - b _081B563C -_081B553A: - subs r0, r4, 0x5 - cmp r0, 0x7 - bhi _081B5624 - lsls r0, 2 - ldr r1, =_081B5554 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B5554: - .4byte _081B5614 - .4byte _081B5624 - .4byte _081B5624 - .4byte _081B557C - .4byte _081B55B8 - .4byte _081B5624 - .4byte _081B5574 - .4byte _081B5574 -_081B5574: - adds r0, r6, 0 - bl sub_8161560 - b _081B5664 -_081B557C: - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - movs r0, 0x1C - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x1D] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - adds r1, r0, 0 - ldr r0, =gStringVar1 - ldrb r1, [r1, 0x14] - bl sub_81245DC - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA196 - b _081B55E8 - .pool -_081B55B8: - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x24 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - adds r1, 0x25 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - adds r1, r0, 0 - ldr r0, =gStringVar1 - ldrb r1, [r1, 0x14] - bl sub_81245DC - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA16B -_081B55E8: - bl StringExpandPlaceholders - adds r0, r6, 0 - bl sub_81B5674 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - strh r4, [r0] - b _081B5664 - .pool -_081B5614: - ldr r1, =gUnknown_0203CEC8 - ldr r0, =sub_8124690 - b _081B5628 - .pool -_081B5624: - ldr r1, =gUnknown_0203CEC8 - ldr r0, =c2_exit_to_overworld_2_switch -_081B5628: - str r0, [r1] - adds r0, r6, 0 - bl sub_81B12C0 - b _081B5664 - .pool -_081B563C: - cmp r4, 0x1 - beq _081B564A - cmp r4, 0x4 - bne _081B5650 - bl sub_81B5864 - b _081B5656 -_081B564A: - bl sub_81B57DC - b _081B5656 -_081B5650: - ldrb r0, [r5, 0x4] -_081B5652: - bl display_pokemon_menu_message -_081B5656: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_brm_cancel_1_on_keypad_a_or_b - str r0, [r1] -_081B5664: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5470 - - thumb_func_start sub_81B5674 -sub_81B5674: @ 81B5674 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gStringVar4 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B56A4 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5674 - - thumb_func_start sub_81B56A4 -sub_81B56A4: @ 81B56A4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B56C8 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B56D8 - str r0, [r1] -_081B56C8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B56A4 - - thumb_func_start sub_81B56D8 -sub_81B56D8: @ 81B56D8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B56FE - cmp r1, 0 - bgt _081B56F8 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B5714 - b _081B572A -_081B56F8: - cmp r1, 0x1 - beq _081B571A - b _081B572A -_081B56FE: - ldr r1, =gUnknown_0203CEC8 - ldr r0, =c2_exit_to_overworld_2_switch - str r0, [r1] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B572A - .pool -_081B5714: - movs r0, 0x5 - bl PlaySE -_081B571A: - ldr r0, =gUnknown_03005DB0 - movs r1, 0 - str r1, [r0] - ldr r0, =gUnknown_0203CEEC - str r1, [r0] - adds r0, r4, 0 - bl sub_81B1C1C -_081B572A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B56D8 - - thumb_func_start hm_add_c3_launch_phase_2 -hm_add_c3_launch_phase_2: @ 81B5738 - push {lr} - bl pal_fill_black - ldr r0, =task_launch_hm_phase_2 - movs r1, 0x8 - bl CreateTask - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end hm_add_c3_launch_phase_2 - - thumb_func_start task_launch_hm_phase_2 -task_launch_hm_phase_2: @ 81B5750 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B577C - bl brm_get_selected_species - ldr r1, =gUnknown_02038C08 - lsls r0, 16 - lsrs r0, 16 - str r0, [r1] - ldr r0, =gUnknown_0203CEEC - ldr r0, [r0] - bl _call_via_r0 - adds r0, r4, 0 - bl DestroyTask -_081B577C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_launch_hm_phase_2 - - thumb_func_start brm_get_selected_species -brm_get_selected_species: @ 81B578C - push {lr} - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end brm_get_selected_species - - thumb_func_start task_brm_cancel_1_on_keypad_a_or_b -task_brm_cancel_1_on_keypad_a_or_b: @ 81B57B4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081B57CE - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B57D4 -_081B57CE: - adds r0, r2, 0 - bl brm_cancel_1 -_081B57D4: - pop {r0} - bx r0 - .pool - thumb_func_end task_brm_cancel_1_on_keypad_a_or_b - - thumb_func_start sub_81B57DC -sub_81B57DC: @ 81B57DC - push {lr} - ldr r0, =0x00000888 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B57F8 - movs r0, 0xC - bl display_pokemon_menu_message - b _081B57FE - .pool -_081B57F8: - movs r0, 0xD - bl display_pokemon_menu_message -_081B57FE: - pop {r0} - bx r0 - thumb_func_end sub_81B57DC - - thumb_func_start hm_surf_run_dp02scr -hm_surf_run_dp02scr: @ 81B5804 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - movs r0, 0x9 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end hm_surf_run_dp02scr - - thumb_func_start sub_81B5820 -sub_81B5820: @ 81B5820 - push {lr} - bl PartyHasMonWithSurf - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B585C - bl IsPlayerFacingSurfableFishableWater - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B585C - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =hm_surf_run_dp02scr - str r0, [r1] - movs r0, 0x1 - b _081B585E - .pool -_081B585C: - movs r0, 0 -_081B585E: - pop {r1} - bx r1 - thumb_func_end sub_81B5820 - - thumb_func_start sub_81B5864 -sub_81B5864: @ 81B5864 - push {lr} - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _081B587A - movs r0, 0x9 - bl display_pokemon_menu_message - b _081B5880 -_081B587A: - movs r0, 0x8 - bl display_pokemon_menu_message -_081B5880: - pop {r0} - bx r0 - thumb_func_end sub_81B5864 - - thumb_func_start sub_81B5884 -sub_81B5884: @ 81B5884 - push {lr} - ldr r0, =gMapHeader - ldrb r0, [r0, 0x17] - bl is_light_level_1_2_3_or_6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B58A0 - movs r0, 0 - b _081B58A2 - .pool -_081B58A0: - movs r0, 0x1 -_081B58A2: - pop {r1} - bx r1 - thumb_func_end sub_81B5884 - - thumb_func_start sub_81B58A8 -sub_81B58A8: @ 81B58A8 - push {lr} - sub sp, 0xC - movs r0, 0 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_8086194 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B58A8 - - thumb_func_start hm2_waterfall -hm2_waterfall: @ 81B58D4 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - movs r0, 0x2B - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end hm2_waterfall - - thumb_func_start hm_prepare_waterfall -hm_prepare_waterfall: @ 81B58F0 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsWaterfall - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B594C - bl IsPlayerSurfingNorth - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B594C - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =hm2_waterfall - str r0, [r1] - movs r0, 0x1 - b _081B594E - .pool -_081B594C: - movs r0, 0 -_081B594E: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end hm_prepare_waterfall - - thumb_func_start sub_81B5958 -sub_81B5958: @ 81B5958 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - movs r0, 0x2C - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5958 - - thumb_func_start sub_81B5974 -sub_81B5974: @ 81B5974 - push {lr} - bl sub_809D1E8 - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1, 0x4] - cmp r0, 0 - bne _081B5990 - movs r0, 0 - b _081B599E - .pool -_081B5990: - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =sub_81B5958 - str r0, [r1] - movs r0, 0x1 -_081B599E: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B5974 - - thumb_func_start party_menu_icon_anim -@ void party_menu_icon_anim(struct pokemon *mon, int a2, int a3) -party_menu_icon_anim: @ 81B59B4 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r7, r1, 0 - adds r4, r2, 0 - movs r6, 0x1 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B59EA - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B59EA - ldr r0, =gUnknown_08616020 - adds r0, r4, r0 - ldrb r1, [r0] - eors r1, r6 - negs r0, r1 - orrs r0, r1 - lsrs r6, r0, 31 -_081B59EA: - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0 - bl GetMonData - adds r1, r0, 0 - str r6, [sp] - adds r0, r4, 0 - adds r2, r7, 0 - movs r3, 0x1 - bl party_menu_link_mon_icon_anim - ldrb r0, [r7, 0x9] - adds r1, r5, 0 - bl sub_81B5B38 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_icon_anim - - thumb_func_start party_menu_link_mon_icon_anim -@ void party_menu_link_mon_icon_anim(u16 speciesId, u32 personality, int a3, char a4, int a5) -party_menu_link_mon_icon_anim: @ 81B5A2C - push {r4-r7,lr} - sub sp, 0xC - adds r6, r1, 0 - adds r4, r2, 0 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r3, 24 - lsrs r7, r3, 24 - cmp r5, 0 - beq _081B5A7A - ldr r1, =sub_80D3014 - ldr r0, [r4, 0x4] - ldrb r2, [r0] - ldrb r3, [r0, 0x1] - movs r0, 0x4 - str r0, [sp] - str r6, [sp, 0x4] - ldr r0, [sp, 0x20] - str r0, [sp, 0x8] - adds r0, r5, 0 - bl sub_80D2CC4 - strb r0, [r4, 0x9] - ldr r2, =gSprites - ldrb r0, [r4, 0x9] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x3 - adds r2, r7, 0 - ands r2, r0 - lsls r2, 2 - ldrb r3, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] -_081B5A7A: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_link_mon_icon_anim - - thumb_func_start sub_81B5A8C -sub_81B5A8C: @ 81B5A8C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - adds r0, r1, 0 - adds r1, r2, 0 - bl sub_8075060 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _081B5AEC - cmp r0, 0x2 - bgt _081B5AB4 - cmp r0, 0x1 - beq _081B5B04 - b _081B5B1C -_081B5AB4: - cmp r0, 0x3 - beq _081B5AD4 - cmp r0, 0x4 - bne _081B5B1C - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0 - bl sub_80D32C8 - b _081B5B2C - .pool -_081B5AD4: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x1 - bl sub_80D32C8 - b _081B5B2C - .pool -_081B5AEC: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x2 - bl sub_80D32C8 - b _081B5B2C - .pool -_081B5B04: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x3 - bl sub_80D32C8 - b _081B5B2C - .pool -_081B5B1C: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x4 - bl sub_80D32C8 -_081B5B2C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5A8C - - thumb_func_start sub_81B5B38 -sub_81B5B38: @ 81B5B38 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - movs r1, 0x39 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - movs r1, 0x3A - bl GetMonData - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B5A8C - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B5B38 - - thumb_func_start sub_81B5B6C -sub_81B5B6C: @ 81B5B6C - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - ldr r5, =gSprites - lsls r0, r4, 4 - adds r0, r4 - lsls r6, r0, 2 - adds r2, r6, r5 - movs r7, 0 - movs r3, 0 - strh r3, [r2, 0x2E] - mov r12, r5 - cmp r1, 0 - bne _081B5BC4 - movs r1, 0x20 - ldrsh r0, [r2, r1] - cmp r0, 0x10 - bne _081B5BA4 - strh r3, [r2, 0x24] - ldr r0, =0x0000fffc - strh r0, [r2, 0x26] - b _081B5BAA - .pool -_081B5BA4: - ldr r0, =0x0000fffc - strh r0, [r2, 0x24] - strh r3, [r2, 0x26] -_081B5BAA: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - mov r1, r12 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_81B5C08 - b _081B5BD0 - .pool -_081B5BC4: - strh r3, [r2, 0x24] - strh r3, [r2, 0x26] - adds r0, r5, 0 - adds r0, 0x1C - adds r0, r6, r0 - ldr r1, =sub_81B5BDC -_081B5BD0: - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5B6C - - thumb_func_start sub_81B5BDC -sub_81B5BDC: @ 81B5BDC - push {r4,lr} - adds r4, r0, 0 - bl sub_80D30DC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081B5C02 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081B5C00 - ldr r0, =0x0000fffd - strh r0, [r4, 0x26] - b _081B5C02 - .pool -_081B5C00: - strh r1, [r4, 0x26] -_081B5C02: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B5BDC - - thumb_func_start sub_81B5C08 -sub_81B5C08: @ 81B5C08 - push {lr} - bl sub_80D30DC - pop {r0} - bx r0 - thumb_func_end sub_81B5C08 - - thumb_func_start party_menu_held_item_object -party_menu_held_item_object: @ 81B5C14 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B5C3C - ldr r0, =gUnknown_08615EC0 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x2] - ldrb r2, [r2, 0x3] - movs r3, 0 - bl CreateSprite - strb r0, [r4, 0xA] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B5C94 -_081B5C3C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_held_item_object - - thumb_func_start party_menu_link_mon_held_item_object -party_menu_link_mon_held_item_object: @ 81B5C48 - push {r4,r5,lr} - adds r4, r2, 0 - lsls r0, 16 - lsls r1, 16 - lsrs r5, r1, 16 - cmp r0, 0 - beq _081B5C84 - ldr r0, =gUnknown_08615EC0 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x2] - ldrb r2, [r2, 0x3] - movs r3, 0 - bl CreateSprite - strb r0, [r4, 0xA] - ldr r2, =gSprites - ldrb r0, [r4, 0xA] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B5CB0 -_081B5C84: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_link_mon_held_item_object - - thumb_func_start sub_81B5C94 -sub_81B5C94: @ 81B5C94 - push {r4,lr} - adds r4, r1, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl sub_81B5CB0 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B5C94 - - thumb_func_start sub_81B5CB0 -sub_81B5CB0: @ 81B5CB0 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _081B5CD8 - ldr r2, =gSprites - ldrb r1, [r4, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081B5D24 - .pool -_081B5CD8: - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B5CFC - ldrb r1, [r4, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x1 - bl StartSpriteAnim - b _081B5D0E - .pool -_081B5CFC: - ldrb r1, [r4, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0 - bl StartSpriteAnim -_081B5D0E: - ldr r2, =gSprites - ldrb r1, [r4, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081B5D24: - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5CB0 - - thumb_func_start sub_81B5D30 -sub_81B5D30: @ 81B5D30 - push {lr} - ldr r0, =gUnknown_08615EB0 - bl LoadSpriteSheet - ldr r0, =gUnknown_08615EB8 - bl LoadSpritePalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5D30 - - thumb_func_start sub_81B5D4C -sub_81B5D4C: @ 81B5D4C - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0 - beq _081B5D60 - cmp r2, 0x1 - beq _081B5DA8 - b _081B5DE4 -_081B5D60: - movs r5, 0 - ldrb r0, [r6] - cmp r5, r0 - bcs _081B5DE4 -_081B5D68: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _081B5D94 - adds r0, r7, r5 - ldrb r4, [r0] - adds r0, r1, 0 - bl itemid_is_mail - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B5DF0 -_081B5D94: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r0, [r6] - cmp r5, r0 - bcc _081B5D68 - b _081B5DE4 - .pool -_081B5DA8: - movs r5, 0 - b _081B5DDE -_081B5DAC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _081B5DD8 - adds r0, r5, r7 - ldrb r4, [r0, 0x6] - adds r0, r1, 0 - bl itemid_is_mail - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B5DF0 -_081B5DD8: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_081B5DDE: - ldrb r0, [r6, 0x1] - cmp r5, r0 - bcc _081B5DAC -_081B5DE4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5D4C - - thumb_func_start sub_81B5DF0 -sub_81B5DF0: @ 81B5DF0 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - adds r6, r0, 0 - mov r9, r1 - lsls r6, 24 - lsrs r6, 24 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =gSprites - mov r8, r0 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - add r0, r8 - adds r0, 0x43 - ldrb r3, [r0] - ldr r0, =gUnknown_08615EC0 - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0xFA - movs r2, 0xAA - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - mov r0, r8 - adds r5, r4, r0 - movs r0, 0x4 - strh r0, [r5, 0x24] - movs r0, 0xA - strh r0, [r5, 0x26] - movs r0, 0x1C - add r8, r0 - add r4, r8 - ldr r0, =sub_81B5E74 - str r0, [r4] - strh r6, [r5, 0x3C] - adds r0, r5, 0 - mov r1, r9 - bl StartSpriteAnim - ldr r1, [r4] - adds r0, r5, 0 - bl _call_via_r1 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5DF0 - - thumb_func_start sub_81B5E74 -sub_81B5E74: @ 81B5E74 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x3C] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gSprites - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r2 - adds r0, r2, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081B5EA8 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _081B5EC6 - .pool -_081B5EA8: - adds r3, r4, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldrh r0, [r2, 0x24] - ldrh r1, [r2, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x26] - ldrh r2, [r2, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] -_081B5EC6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B5E74 - - thumb_func_start party_menu_pokeball_object -party_menu_pokeball_object: @ 81B5ECC - push {r4,lr} - adds r4, r1, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B5EEA - ldr r0, =gUnknown_08615F08 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x6] - ldrb r2, [r2, 0x7] - movs r3, 0x8 - bl CreateSprite - strb r0, [r4, 0xB] -_081B5EEA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_pokeball_object - - thumb_func_start party_menu_link_mon_pokeball_object -party_menu_link_mon_pokeball_object: @ 81B5EF4 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 16 - cmp r0, 0 - beq _081B5F24 - ldr r0, =gUnknown_08615F08 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x6] - ldrb r2, [r2, 0x7] - movs r3, 0x8 - bl CreateSprite - strb r0, [r4, 0xB] - ldr r2, =gSprites - ldrb r0, [r4, 0xB] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] -_081B5F24: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_link_mon_pokeball_object - - thumb_func_start sub_81B5F34 -sub_81B5F34: @ 81B5F34 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 24 - lsrs r3, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08615F08 - adds r1, r3, 0 - movs r3, 0x8 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r3, [r1, 0x5] - movs r2, 0xD - negs r2, r2 - ands r2, r3 - movs r3, 0x8 - orrs r2, r3 - strb r2, [r1, 0x5] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B5F34 - - thumb_func_start sub_81B5F74 -sub_81B5F74: @ 81B5F74 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 24 - lsrs r3, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08615F78 - adds r1, r3, 0 - movs r3, 0x8 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B5F74 - - thumb_func_start sub_81B5F98 -sub_81B5F98: @ 81B5F98 - push {lr} - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r2, =gSprites - adds r0, r2 - bl StartSpriteAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5F98 - - thumb_func_start sub_81B5FBC -sub_81B5FBC: @ 81B5FBC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - cmp r6, 0 - bne _081B6000 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gSprites - mov r8, r0 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAnim - lsls r5, r7, 4 - adds r5, r7 - lsls r5, 2 - add r5, r8 - adds r0, r5, 0 - movs r1, 0x4 - bl StartSpriteAnim - strh r6, [r4, 0x26] - strh r6, [r5, 0x26] - b _081B602C - .pool -_081B6000: - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - ldr r0, =gSprites - mov r8, r0 - add r5, r8 - adds r0, r5, 0 - movs r1, 0x3 - bl StartSpriteAnim - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x5 - bl StartSpriteAnim - ldr r0, =0x0000fffc - strh r0, [r5, 0x26] - movs r0, 0x4 - strh r0, [r4, 0x26] -_081B602C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5FBC - - thumb_func_start sub_81B6040 -sub_81B6040: @ 81B6040 - push {lr} - ldr r0, =gUnknown_08615EF8 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08615F70 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08615F00 - bl LoadCompressedObjectPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6040 - - thumb_func_start party_menu_status_condition_object -party_menu_status_condition_object: @ 81B6064 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B608C - ldr r0, =gUnknown_08616008 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x4] - ldrb r2, [r2, 0x5] - movs r3, 0 - bl CreateSprite - strb r0, [r4, 0xC] - adds r0, r5, 0 - adds r1, r4, 0 - bl party_menu_get_status_condition_and_update_object -_081B608C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_status_condition_object - - thumb_func_start party_menu_link_mon_status_condition_object -party_menu_link_mon_status_condition_object: @ 81B6098 - push {r4,r5,lr} - adds r4, r2, 0 - lsls r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - cmp r0, 0 - beq _081B60D4 - ldr r0, =gUnknown_08616008 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x4] - ldrb r2, [r2, 0x5] - movs r3, 0 - bl CreateSprite - strb r0, [r4, 0xC] - adds r0, r5, 0 - adds r1, r4, 0 - bl party_menu_update_status_condition_object - ldr r2, =gSprites - ldrb r0, [r4, 0xC] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] -_081B60D4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_link_mon_status_condition_object - - thumb_func_start party_menu_get_status_condition_and_update_object -@ void party_menu_get_status_condition_and_update_object(struct pokemon *mon, void *a2, void *a3) -party_menu_get_status_condition_and_update_object: @ 81B60E4 - push {r4,lr} - adds r4, r1, 0 - bl sub_81B205C - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl party_menu_update_status_condition_object - pop {r4} - pop {r0} - bx r0 - thumb_func_end party_menu_get_status_condition_and_update_object - - thumb_func_start party_menu_update_status_condition_object -@ void party_menu_update_status_condition_object(u8 a1, void *a2) -party_menu_update_status_condition_object: @ 81B60FC - push {r4,r5,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _081B610C - cmp r2, 0x6 - bne _081B6128 -_081B610C: - ldr r2, =gSprites - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081B6152 - .pool -_081B6128: - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - subs r1, r2, 0x1 - lsls r1, 24 - lsrs r1, 24 - bl StartSpriteAnim - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081B6152: - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_update_status_condition_object - - thumb_func_start sub_81B6160 -sub_81B6160: @ 81B6160 - push {lr} - ldr r0, =gUnknown_08615FF8 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08616000 - bl LoadCompressedObjectPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6160 - - thumb_func_start sub_81B617C -sub_81B617C: @ 81B617C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r0, =c2_815ABFC - mov r8, r0 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B61BC - movs r7, 0x1 - bl sub_81B8984 - lsls r0, 24 - lsrs r6, r0, 24 - b _081B61C0 - .pool -_081B61B0: - ldr r0, =gUnknown_0203CEC8 - strb r5, [r0, 0x9] - b _081B6204 - .pool -_081B61BC: - movs r7, 0 - movs r6, 0 -_081B61C0: - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl GetItemEffectType - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA - bne _081B621C - ldr r1, =gUnknown_0203CEC8 - movs r0, 0 - strb r0, [r1, 0x9] - movs r5, 0 -_081B61D8: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B61FA - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081B61B0 -_081B61FA: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _081B61D8 -_081B6204: - ldr r0, =sub_81B6280 - movs r1, 0x7F - b _081B6230 - .pool -_081B621C: - ldrh r0, [r4] - bl GetPocketByItemId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x5 - cmp r0, 0x3 - bne _081B622E - movs r1, 0x4 -_081B622E: - ldr r0, =sub_81B1370 -_081B6230: - str r1, [sp] - str r0, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B617C - - thumb_func_start c2_815ABFC -c2_815ABFC: @ 81B6254 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _081B626C - movs r0, 0xC - movs r1, 0x5 - movs r2, 0 - bl GoToBagMenu - b _081B6276 -_081B626C: - ldr r0, =gUnknown_0203CF30 - ldr r1, [r0] - movs r0, 0x4 - bl sub_81C4F98 -_081B6276: - pop {r0} - bx r0 - .pool - thumb_func_end c2_815ABFC - - thumb_func_start sub_81B6280 -sub_81B6280: @ 81B6280 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B62B2 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _081B62A6 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B9140 - str r0, [r1, 0x4] -_081B62A6: - ldr r0, =gUnknown_03006328 - ldr r1, =sub_81B6794 - ldr r2, [r0] - adds r0, r3, 0 - bl _call_via_r2 -_081B62B2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6280 - - thumb_func_start IsHPRecoveryItem -@ bool8 IsHPRecoveryItem(u16 itemId) -IsHPRecoveryItem: @ 81B62D0 - push {lr} - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _081B62EC - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003214 - adds r0, r1 - b _081B62F6 - .pool -_081B62EC: - ldr r1, =gItemEffectInfoPointers - subs r0, 0xD - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] -_081B62F6: - ldrb r1, [r0, 0x4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _081B6308 - movs r0, 0 - b _081B630A - .pool -_081B6308: - movs r0, 0x1 -_081B630A: - pop {r1} - bx r1 - thumb_func_end IsHPRecoveryItem - - thumb_func_start GetMedicineItemEffectMessage -@ void GetMedicineItemEffectMessage(u16 itemId) -GetMedicineItemEffectMessage: @ 81B6310 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl GetItemEffectType - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x3 - cmp r0, 0x12 - bls _081B6326 - b _081B64BC -_081B6326: - lsls r0, 2 - ldr r1, =_081B6334 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B6334: - .4byte _081B6380 - .4byte _081B6394 - .4byte _081B63A8 - .4byte _081B63BC - .4byte _081B63D0 - .4byte _081B63E4 - .4byte _081B63F8 - .4byte _081B64BC - .4byte _081B640C - .4byte _081B6430 - .4byte _081B6420 - .4byte _081B6460 - .4byte _081B6470 - .4byte _081B6450 - .4byte _081B6440 - .4byte _081B64BC - .4byte _081B6494 - .4byte _081B6494 - .4byte _081B64A8 -_081B6380: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9C3E - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B6394: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9C7C - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63A8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9C8A - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63BC: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9CA2 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63D0: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9C5F - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63E4: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9DBE - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63F8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9DE1 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B640C: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9CE0 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B6420: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085E96E3 - b _081B6474 - .pool -_081B6430: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085EA33C - b _081B6474 - .pool -_081B6440: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085EA343 - b _081B6474 - .pool -_081B6450: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085EA35B - b _081B6474 - .pool -_081B6460: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085E96E6 - b _081B6474 - .pool -_081B6470: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085E96EE -_081B6474: - bl StringCopy - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9D25 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B6494: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9CF5 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B64A8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9CB7 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B64BC: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E96F6 - bl StringExpandPlaceholders -_081B64C4: - pop {r0} - bx r0 - .pool - thumb_func_end GetMedicineItemEffectMessage - - thumb_func_start UsingHPEVItemOnShedinja -@ bool8 UsingHPEVItemOnShedinja(struct pokemon *mon, u16 itemId) -UsingHPEVItemOnShedinja: @ 81B64D0 - push {r4,lr} - adds r4, r0, 0 - lsls r0, r1, 16 - lsrs r0, 16 - bl GetItemEffectType - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD - bne _081B64FC - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - ldr r1, =0x0000012f - cmp r0, r1 - bne _081B64FC - movs r0, 0 - b _081B64FE - .pool -_081B64FC: - movs r0, 0x1 -_081B64FE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end UsingHPEVItemOnShedinja - - thumb_func_start IsBlueYellowRedFlute -@ bool8 IsBlueYellowRedFlute(u16 itemId) -IsBlueYellowRedFlute: @ 81B6504 - push {lr} - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x27 - beq _081B6516 - cmp r0, 0x29 - beq _081B6516 - cmp r0, 0x28 - bne _081B651A -_081B6516: - movs r0, 0x1 - b _081B651C -_081B651A: - movs r0, 0 -_081B651C: - pop {r1} - bx r1 - thumb_func_end IsBlueYellowRedFlute - - thumb_func_start ExecuteTableBasedItemEffect__ -@ bool8 ExecuteTableBasedItemEffect__(u8 partyMonIndex, u16 itemId, u8 monMoveIndex) -ExecuteTableBasedItemEffect__: @ 81B6520 - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081B6558 - movs r0, 0x64 - muls r0, r3 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r5, 0 - adds r2, r3, 0 - b _081B6572 - .pool -_081B6558: - movs r0, 0x64 - adds r4, r3, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r3, 0 - bl sub_81B8F38 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 -_081B6572: - adds r3, r6, 0 - bl ExecuteTableBasedItemEffect_ - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end ExecuteTableBasedItemEffect__ - - thumb_func_start ItemUseCB_Medicine -ItemUseCB_Medicine: @ 81B6588 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - str r1, [sp, 0x4] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r0, 0 - mov r10, r0 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - ldr r0, =gUnknown_0203CE7C - ldrh r6, [r0] - adds r0, r5, 0 - adds r1, r6, 0 - bl UsingHPEVItemOnShedinja - lsls r0, 24 - cmp r0, 0 - beq _081B6600 - adds r0, r6, 0 - bl IsHPRecoveryItem - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x1 - bne _081B65EE - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - cmp r10, r0 - bne _081B65EE - movs r1, 0 - mov r8, r1 -_081B65EE: - ldr r4, =gUnknown_0203CEC8 - ldrb r0, [r4, 0x9] - adds r1, r6, 0 - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B6624 -_081B6600: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_085E96F6 - b _081B66F4 - .pool -_081B6624: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - adds r0, r6, 0 - bl IsBlueYellowRedFlute - lsls r0, 24 - cmp r0, 0 - bne _081B6650 - movs r0, 0x1 - bl PlaySE - ldrb r0, [r4, 0xB] - cmp r0, 0xE - beq _081B6656 - adds r0, r6, 0 - movs r1, 0x1 - bl RemoveBagItem - b _081B6656 - .pool -_081B6650: - movs r0, 0x75 - bl PlaySE -_081B6656: - ldr r4, =gUnknown_0203CEDC - ldr r7, =gUnknown_0203CEC8 - movs r0, 0x9 - ldrsb r0, [r7, r0] - lsls r0, 4 - ldr r1, [r4] - adds r1, r0 - adds r0, r5, 0 - bl party_menu_get_status_condition_and_update_object - ldr r2, =gSprites - movs r0, 0x9 - ldrsb r0, [r7, r0] - ldr r1, [r4] - lsls r0, 4 - adds r3, r0, r1 - ldrb r1, [r3, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081B6694 - adds r0, r5, 0 - adds r1, r3, 0 - movs r2, 0x1 - bl sub_81B2AC8 -_081B6694: - mov r2, r8 - cmp r2, 0x1 - bne _081B66E4 - mov r0, r10 - cmp r0, 0 - bne _081B66A8 - ldrb r0, [r7, 0x9] - movs r1, 0x1 - bl sub_81B0FCC -_081B66A8: - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - adds r3, r0, 0 - mov r1, r10 - subs r3, r1 - lsls r3, 16 - asrs r3, 16 - ldrb r1, [r7, 0x9] - ldr r0, =sub_81B672C - str r0, [sp] - mov r0, r9 - movs r2, 0x1 - bl sub_81B1F18 - mov r0, r9 - movs r1, 0 - mov r2, r10 - bl sub_81B1FA8 - b _081B6710 - .pool -_081B66E4: - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - adds r0, r6, 0 - bl GetMedicineItemEffectMessage - ldr r0, =gStringVar4 -_081B66F4: - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - mov r2, r9 - lsls r0, r2, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldr r1, [sp, 0x4] - str r1, [r0] -_081B6710: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseCB_Medicine - - thumb_func_start sub_81B672C -sub_81B672C: @ 81B672C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9C17 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - bl sub_805EAE8 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6794 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B672C - - thumb_func_start sub_81B6794 -sub_81B6794: @ 81B6794 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B67BA - ldr r0, =gUnknown_0203CEE8 - ldrb r1, [r0] - cmp r1, 0 - bne _081B67B4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - str r1, [r0, 0x4] -_081B67B4: - adds r0, r4, 0 - bl sub_81B12C0 -_081B67BA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6794 - - thumb_func_start sub_81B67C8 -sub_81B67C8: @ 81B67C8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - str r1, [sp] - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r4, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - ldr r0, =gUnknown_0203CE7C - ldrh r6, [r0] - adds r0, r6, 0 - bl GetItemEffectType - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r5, 0 - movs r1, 0x20 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x4] - adds r0, r5, 0 - adds r1, r7, 0 - bl sub_81B691C - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - ldrb r0, [r4, 0x9] - adds r1, r6, 0 - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x20 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - adds r0, r5, 0 - adds r1, r7, 0 - bl sub_81B691C - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r4, 0 - bne _081B6850 - ldr r0, [sp, 0x4] - cmp r0, r9 - bne _081B6874 - ldr r1, [sp, 0x8] - cmp r1, r8 - bne _081B6874 -_081B6850: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_085E96F6 - b _081B68E2 - .pool -_081B6874: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0x1 - bl PlaySE - adds r0, r6, 0 - movs r1, 0x1 - bl RemoveBagItem - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r1, =gStringVar2 - adds r0, r7, 0 - bl option_menu_get_string - ldr r2, [sp, 0x4] - cmp r2, r9 - beq _081B68D8 - ldr r0, [sp, 0x8] - cmp r0, r8 - beq _081B68C4 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9D45 - bl StringExpandPlaceholders - b _081B68E0 - .pool -_081B68C4: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9D90 - bl StringExpandPlaceholders - b _081B68E0 - .pool -_081B68D8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9D6D - bl StringExpandPlaceholders -_081B68E0: - ldr r0, =gStringVar4 -_081B68E2: - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - mov r2, r10 - lsls r0, r2, 2 - add r0, r10 - lsls r0, 3 - adds r0, r1 - ldr r1, [sp] - str r1, [r0] - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B67C8 - - thumb_func_start sub_81B691C -sub_81B691C: @ 81B691C - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r1, 0 - subs r0, 0xC - cmp r0, 0x5 - bhi _081B6992 - lsls r0, 2 - ldr r1, =_081B693C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B693C: - .4byte _081B696C - .4byte _081B6954 - .4byte _081B697E - .4byte _081B6984 - .4byte _081B6978 - .4byte _081B6972 -_081B6954: - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - ldr r1, =0x0000012f - cmp r0, r1 - beq _081B6992 - adds r0, r4, 0 - movs r1, 0x1A - b _081B6988 - .pool -_081B696C: - adds r0, r4, 0 - movs r1, 0x1B - b _081B6988 -_081B6972: - adds r0, r4, 0 - movs r1, 0x1C - b _081B6988 -_081B6978: - adds r0, r4, 0 - movs r1, 0x1D - b _081B6988 -_081B697E: - adds r0, r4, 0 - movs r1, 0x1E - b _081B6988 -_081B6984: - adds r0, r4, 0 - movs r1, 0x1F -_081B6988: - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - b _081B6994 -_081B6992: - movs r0, 0 -_081B6994: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B691C - - thumb_func_start option_menu_get_string -option_menu_get_string: @ 81B699C - push {lr} - adds r2, r1, 0 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0xC - cmp r0, 0x5 - bhi _081B6A08 - lsls r0, 2 - ldr r1, =_081B69B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B69B8: - .4byte _081B69D8 - .4byte _081B69D0 - .4byte _081B69F0 - .4byte _081B6A00 - .4byte _081B69E8 - .4byte _081B69E0 -_081B69D0: - ldr r1, =gUnknown_085E96E3 - b _081B69F2 - .pool -_081B69D8: - ldr r1, =gUnknown_085EA33C - b _081B69F2 - .pool -_081B69E0: - ldr r1, =gUnknown_085EA343 - b _081B69F2 - .pool -_081B69E8: - ldr r1, =gUnknown_085EA35B - b _081B69F2 - .pool -_081B69F0: - ldr r1, =gUnknown_085E96E6 -_081B69F2: - adds r0, r2, 0 - bl StringCopy - b _081B6A08 - .pool -_081B6A00: - ldr r1, =gUnknown_085E96EE - adds r0, r2, 0 - bl StringCopy -_081B6A08: - pop {r0} - bx r0 - .pool - thumb_func_end option_menu_get_string - - thumb_func_start sub_81B6A10 -sub_81B6A10: @ 81B6A10 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r7, 0 - movs r0, 0x1 - mov r10, r0 - movs r0, 0x3 - bl sub_81B31B0 - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - movs r0, 0x64 - adds r1, r4, 0 - muls r1, r0 - mov r8, r1 - ldr r0, =gPlayerParty - mov r9, r0 -_081B6A40: - adds r1, r5, 0 - adds r1, 0xD - mov r0, r8 - add r0, r9 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0xD - adds r2, r4, 0 - muls r2, r0 - ldr r0, =gMoveNames - adds r2, r0 - lsls r0, r5, 4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r6, 0 - mov r1, r10 - movs r3, 0x8 - bl Print - cmp r4, 0 - beq _081B6A82 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_081B6A82: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _081B6A40 - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6A10 - - thumb_func_start ether_effect_related_3 -ether_effect_related_3: @ 81B6AB4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl ProcessMenuInput - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _081B6AF0 - adds r0, 0x1 - cmp r1, r0 - bne _081B6AE0 - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B6BB4 - b _081B6AF0 -_081B6AE0: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl ether_effect_related_2 -_081B6AF0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ether_effect_related_3 - - thumb_func_start dp05_ether -dp05_ether: @ 81B6AFC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - cmp r0, 0xAF - bne _081B6B20 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003214 - adds r0, r1 - b _081B6B2A - .pool -_081B6B20: - ldr r1, =gItemEffectInfoPointers - subs r0, 0xD - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] -_081B6B2A: - ldrb r1, [r0, 0x4] - movs r0, 0x10 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081B6B4C - ldr r0, =gUnknown_0203CEC8 - strh r1, [r0, 0xE] - adds r0, r4, 0 - bl ether_effect_related - b _081B6B6E - .pool -_081B6B4C: - movs r0, 0x5 - bl PlaySE - movs r0, 0x16 - bl display_pokemon_menu_message - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - bl sub_81B6A10 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =ether_effect_related_3 - str r1, [r0] -_081B6B6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp05_ether - - thumb_func_start ether_effect_related_2 -ether_effect_related_2: @ 81B6B80 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xC - bl sub_81B302C - bl GetMenuCursorPos - ldr r1, =gUnknown_0203CEC8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0xE] - adds r0, r4, 0 - bl ether_effect_related - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ether_effect_related_2 - - thumb_func_start sub_81B6BB4 -sub_81B6BB4: @ 81B6BB4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_81B1370 - str r0, [r1] - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0 - str r1, [r0, 0x4] - adds r0, 0xC - bl sub_81B302C - movs r0, 0x5 - bl display_pokemon_menu_message - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6BB4 - - thumb_func_start ether_effect_related -ether_effect_related: @ 81B6BEC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - ldr r7, =gUnknown_0203CED6 - ldr r0, =gUnknown_0203CE7C - ldrh r5, [r0] - movs r0, 0xE - negs r0, r0 - adds r0, r7 - mov r8, r0 - ldrb r0, [r0, 0x9] - ldrb r2, [r7] - adds r1, r5, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B6C34 - ldr r0, =gUnknown_0203CEE8 - strb r4, [r0] - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_085E96F6 - b _081B6C7E - .pool -_081B6C34: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - mov r0, r8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - movs r0, 0x1 - bl PlaySE - adds r0, r5, 0 - movs r1, 0x1 - bl RemoveBagItem - movs r0, 0 - ldrsh r1, [r7, r0] - adds r1, 0xD - adds r0, r4, 0 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =gStringVar1 - movs r1, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - adds r0, r5, 0 - bl GetMedicineItemEffectMessage - ldr r0, =gStringVar4 -_081B6C7E: - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6794 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ether_effect_related - - thumb_func_start dp05_pp_up -dp05_pp_up: @ 81B6CC0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - movs r0, 0x17 - bl display_pokemon_menu_message - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - bl sub_81B6A10 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =ether_effect_related_3 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp05_pp_up - - thumb_func_start ItemIdToBattleMoveId -ItemIdToBattleMoveId: @ 81B6CFC - lsls r0, 16 - ldr r1, =0xfedf0000 - adds r0, r1 - ldr r1, =gUnknown_08616040 - lsrs r0, 15 - adds r0, r1 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end ItemIdToBattleMoveId - - thumb_func_start sub_81B6D14 -sub_81B6D14: @ 81B6D14 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0 - ldr r3, =gUnknown_08616040 -_081B6D1E: - adds r0, r1, 0 - adds r0, 0x32 - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _081B6D34 - movs r0, 0x1 - b _081B6D40 - .pool -_081B6D34: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x7 - bls _081B6D1E - movs r0, 0 -_081B6D40: - pop {r1} - bx r1 - thumb_func_end sub_81B6D14 - - thumb_func_start pokemon_has_move -pokemon_has_move: @ 81B6D44 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 -_081B6D4E: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r6, 0 - bl GetMonData - cmp r0, r5 - bne _081B6D60 - movs r0, 0x1 - b _081B6D6C -_081B6D60: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081B6D4E - movs r0, 0 -_081B6D6C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end pokemon_has_move - - thumb_func_start sub_81B6D74 -sub_81B6D74: @ 81B6D74 - push {r4,lr} - adds r1, r0, 0 - ldr r4, =gStringVar4 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6D74 - - thumb_func_start sub_81B6D98 -sub_81B6D98: @ 81B6D98 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6794 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6D98 - - thumb_func_start sub_81B6DC4 -sub_81B6DC4: @ 81B6DC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r7, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - movs r0, 0xE - adds r0, r7 - mov r8, r0 - ldr r0, =gUnknown_0203CE7C - ldrh r4, [r0] - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - adds r0, r4, 0 - bl ItemIdToBattleMoveId - strh r0, [r7, 0xE] - ldr r0, =gStringVar2 - movs r1, 0xE - ldrsh r2, [r7, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - movs r0, 0 - mov r1, r8 - strh r0, [r1, 0x2] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B22D8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B6E70 - cmp r0, 0x2 - beq _081B6E78 - ldrh r1, [r7, 0xE] - adds r0, r5, 0 - bl pokemon_moveset_pad_ - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - beq _081B6E88 - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B6EB4 - str r0, [r1] - b _081B6E9C - .pool -_081B6E70: - ldr r1, =gUnknown_085E9AB4 - b _081B6E7A - .pool -_081B6E78: - ldr r1, =gUnknown_085E9C00 -_081B6E7A: - adds r0, r6, 0 - bl sub_81B6D98 - b _081B6E9C - .pool -_081B6E88: - ldr r0, =gUnknown_085E9AE9 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6FF4 - str r1, [r0] -_081B6E9C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6DC4 - - thumb_func_start sub_81B6EB4 -sub_81B6EB4: @ 81B6EB4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r2, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r6, r2, 0 - adds r6, 0xE - ldr r0, =gUnknown_0203CE7C - ldrh r4, [r0] - movs r1, 0x2 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _081B6EF0 - adds r0, r5, 0 - movs r1, 0x4 - bl happiness_algorithm - movs r0, 0xA9 - lsls r0, 1 - cmp r4, r0 - bhi _081B6EF0 - adds r0, r4, 0 - movs r1, 0x1 - bl RemoveBagItem -_081B6EF0: - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0 - ldrsh r2, [r6, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9AA5 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6F60 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6EB4 - - thumb_func_start sub_81B6F60 -sub_81B6F60: @ 81B6F60 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B6F86 - ldr r0, =0x0000016f - bl PlayFanfare - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6F98 - str r1, [r0] -_081B6F86: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6F60 - - thumb_func_start sub_81B6F98 -sub_81B6F98: @ 81B6F98 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl IsFanfareTaskInactive - lsls r0, 24 - cmp r0, 0 - beq _081B6FEA - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _081B6FC0 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B6FEA -_081B6FC0: - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x10 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - bne _081B6FDC - adds r0, r4, 0 - bl sub_81B77AC - b _081B6FEA - .pool -_081B6FDC: - cmp r0, 0x2 - bne _081B6FE4 - ldr r0, =gScriptResult - strh r2, [r0] -_081B6FE4: - adds r0, r5, 0 - bl sub_81B12C0 -_081B6FEA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6F98 - - thumb_func_start sub_81B6FF4 -sub_81B6FF4: @ 81B6FF4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7018 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B7028 - str r0, [r1] -_081B7018: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6FF4 - - thumb_func_start sub_81B7028 -sub_81B7028: @ 81B7028 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B704E - cmp r1, 0 - bgt _081B7048 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B7074 - b _081B7080 -_081B7048: - cmp r1, 0x1 - beq _081B707A - b _081B7080 -_081B704E: - ldr r0, =gUnknown_085E9B96 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B7088 - str r1, [r0] - b _081B7080 - .pool -_081B7074: - movs r0, 0x5 - bl PlaySE -_081B707A: - adds r0, r4, 0 - bl sub_81B7230 -_081B7080: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B7028 - - thumb_func_start sub_81B7088 -sub_81B7088: @ 81B7088 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B70A8 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B70B8 - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 -_081B70A8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7088 - - thumb_func_start sub_81B70B8 -sub_81B70B8: @ 81B70B8 - push {r4,lr} - sub sp, 0x4 - ldr r0, =gPlayerParty - ldr r4, =gUnknown_0203CEC8 - ldrb r1, [r4, 0x9] - ldr r2, =gPlayerPartyCount - ldrb r2, [r2] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =sub_81B70F0 - ldrh r4, [r4, 0xE] - str r4, [sp] - bl sub_81BFA38 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B70B8 - - thumb_func_start sub_81B70F0 -sub_81B70F0: @ 81B70F0 - push {lr} - sub sp, 0xC - movs r0, 0x7F - str r0, [sp] - ldr r0, =sub_81B711C - str r0, [sp, 0x4] - ldr r0, =gUnknown_0203CEC8 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B70F0 - - thumb_func_start sub_81B711C -sub_81B711C: @ 81B711C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B714E - bl sub_81C1B94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _081B7148 - adds r0, r4, 0 - bl sub_81B7154 - b _081B714E - .pool -_081B7148: - adds r0, r5, 0 - bl sub_81B7230 -_081B714E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B711C - - thumb_func_start sub_81B7154 -sub_81B7154: @ 81B7154 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - adds r5, r1, 0 - muls r5, r0 - ldr r0, =gPlayerParty - adds r5, r0 - bl sub_81C1B94 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r1, 0xD - adds r0, r5, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r0, =gUnknown_085E9BB8 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B71D4 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7154 - - thumb_func_start sub_81B71D4 -sub_81B71D4: @ 81B71D4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7220 - ldr r5, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r5, r1] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - bl sub_81C1B94 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806B9A8 - ldrh r5, [r5, 0xE] - bl sub_81C1B94 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80691F4 - adds r0, r6, 0 - bl sub_81B6EB4 -_081B7220: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B71D4 - - thumb_func_start sub_81B7230 -sub_81B7230: @ 81B7230 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gStringVar2 - ldr r1, =gUnknown_0203CEC8 - movs r3, 0xE - ldrsh r2, [r1, r3] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9B5D - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B7294 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7230 - - thumb_func_start sub_81B7294 -sub_81B7294: @ 81B7294 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B72B8 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B72C8 - str r0, [r1] -_081B72B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7294 - - thumb_func_start sub_81B72C8 -sub_81B72C8: @ 81B72C8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - bl sub_8198C58 - lsls r0, 24 - asrs r5, r0, 24 - cmp r5, 0 - beq _081B7306 - cmp r5, 0 - bgt _081B7300 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - beq _081B738C - b _081B73C2 - .pool -_081B7300: - cmp r5, 0x1 - beq _081B7392 - b _081B73C2 -_081B7306: - ldr r1, =gStringVar1 - adds r0, r4, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0xE - ldrsh r2, [r7, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9B76 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r3, 0x10 - ldrsh r0, [r7, r3] - cmp r0, 0x1 - bne _081B7368 - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B73E4 - str r0, [r1] - b _081B73C2 - .pool -_081B7368: - cmp r0, 0x2 - bne _081B7370 - ldr r0, =gScriptResult - strh r5, [r0] -_081B7370: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B6794 - str r0, [r1] - b _081B73C2 - .pool -_081B738C: - movs r0, 0x5 - bl PlaySE -_081B7392: - ldr r1, =gStringVar1 - adds r0, r4, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - ldr r1, =gUnknown_0203CEC8 - movs r3, 0xE - ldrsh r2, [r1, r3] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r0, =gUnknown_085E9AE9 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6FF4 - str r1, [r0] -_081B73C2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B72C8 - - thumb_func_start sub_81B73E4 -sub_81B73E4: @ 81B73E4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B73FC - adds r0, r4, 0 - bl sub_81B77AC -_081B73FC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B73E4 - - thumb_func_start dp05_rare_candy -dp05_rare_candy: @ 81B7404 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - mov r9, r0 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - ldr r0, =gUnknown_0203CEC4 - ldr r6, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r4, r6, r1 - ldr r2, =gUnknown_0203CE7C - mov r8, r2 - adds r0, r5, 0 - movs r1, 0x38 - bl GetMonData - cmp r0, 0x64 - beq _081B7478 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B79A0 - mov r1, r9 - ldrb r0, [r1, 0x9] - mov r2, r8 - ldrh r1, [r2] - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x89 - lsls r0, 2 - adds r1, r6, r0 - adds r0, r5, 0 - bl sub_81B79A0 - b _081B747A - .pool -_081B7478: - movs r4, 0x1 -_081B747A: - movs r0, 0x5 - bl PlaySE - cmp r4, 0 - beq _081B74B4 - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - ldr r0, =gUnknown_085E96F6 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - mov r1, r10 - b _081B7516 - .pool -_081B74B4: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0 - bl PlayFanfareByFanfareNum - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - adds r1, r5, 0 - bl sub_81B754C - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - movs r1, 0x1 - bl RemoveBagItem - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r4, =gStringVar2 - adds r0, r5, 0 - movs r1, 0x38 - bl GetMonData - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9D0A - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B75D4 -_081B7516: - str r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp05_rare_candy - - thumb_func_start sub_81B754C -sub_81B754C: @ 81B754C - push {r4-r7,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r6, =gUnknown_0203CEDC - lsls r4, r7, 4 - ldr r1, [r6] - adds r1, r4 - adds r0, r5, 0 - bl party_menu_get_status_condition_and_update_object - ldr r2, =gSprites - ldr r0, [r6] - adds r3, r4, r0 - ldrb r1, [r3, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081B7588 - adds r0, r5, 0 - adds r1, r3, 0 - movs r2, 0x1 - bl sub_81B2AC8 -_081B7588: - ldr r1, [r6] - adds r1, r4 - adds r0, r5, 0 - movs r2, 0x1 - bl sub_81B2CD4 - ldr r1, [r6] - adds r1, r4 - adds r0, r5, 0 - movs r2, 0x1 - bl sub_81B2D74 - ldr r1, [r6] - adds r1, r4 - adds r0, r5, 0 - bl sub_81B2E28 - ldr r0, [r6] - adds r0, r4, r0 - ldrb r0, [r0, 0x9] - adds r1, r5, 0 - bl sub_81B5B38 - adds r0, r7, 0 - movs r1, 0x1 - bl sub_81B0FCC - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B754C - - thumb_func_start sub_81B75D4 -sub_81B75D4: @ 81B75D4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - bl WaitFanfare - lsls r0, 24 - cmp r0, 0 - beq _081B7620 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7620 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081B7606 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B7620 -_081B7606: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B767C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B7634 - str r0, [r1] -_081B7620: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B75D4 - - thumb_func_start sub_81B7634 -sub_81B7634: @ 81B7634 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081B764E - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B7668 -_081B764E: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B76C8 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B7704 - str r0, [r1] -_081B7668: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7634 - - thumb_func_start sub_81B767C -sub_81B767C: @ 81B767C - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CEC4 - ldr r5, [r0] - movs r0, 0x86 - lsls r0, 2 - adds r4, r5, r0 - bl sub_81B3364 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x18] - ldrh r0, [r4, 0x18] - movs r1, 0x89 - lsls r1, 2 - adds r2, r5, r1 - movs r1, 0x2 - str r1, [sp] - movs r1, 0x3 - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81D3640 - ldrb r0, [r4, 0x18] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B767C - - thumb_func_start sub_81B76C8 -sub_81B76C8: @ 81B76C8 - push {r4,lr} - sub sp, 0x4 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - movs r0, 0x86 - lsls r0, 2 - adds r4, r1, r0 - ldrh r0, [r4, 0x18] - movs r2, 0x89 - lsls r2, 2 - adds r1, r2 - movs r2, 0x3 - str r2, [sp] - movs r2, 0x1 - movs r3, 0x2 - bl sub_81D3784 - ldrb r0, [r4, 0x18] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B76C8 - - thumb_func_start sub_81B7704 -sub_81B7704: @ 81B7704 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0 - bl WaitFanfare - lsls r0, 24 - cmp r0, 0 - beq _081B77A6 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _081B772C - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B77A6 -_081B772C: - bl sub_81B3394 - ldr r4, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x1 - bl sub_8069318 - lsls r0, 16 - lsrs r1, r0, 16 - strh r6, [r4, 0x10] - ldr r0, =0x0000fffe - cmp r1, r0 - beq _081B7788 - cmp r1, r0 - bgt _081B776C - cmp r1, 0 - beq _081B7778 - b _081B77A0 - .pool -_081B776C: - ldr r0, =0x0000ffff - cmp r1, r0 - beq _081B7780 - b _081B77A0 - .pool -_081B7778: - adds r0, r5, 0 - bl sub_81B7810 - b _081B77A6 -_081B7780: - adds r0, r5, 0 - bl sub_81B787C - b _081B77A6 -_081B7788: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B77AC - str r0, [r1] - b _081B77A6 - .pool -_081B77A0: - adds r0, r5, 0 - bl sub_81B7910 -_081B77A6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B7704 - - thumb_func_start sub_81B77AC -sub_81B77AC: @ 81B77AC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0 - bl sub_8069318 - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x0000fffe - cmp r1, r0 - beq _081B780A - cmp r1, r0 - bgt _081B77E8 - cmp r1, 0 - beq _081B77F4 - b _081B7804 - .pool -_081B77E8: - ldr r0, =0x0000ffff - cmp r1, r0 - beq _081B77FC - b _081B7804 - .pool -_081B77F4: - adds r0, r4, 0 - bl sub_81B7810 - b _081B780A -_081B77FC: - adds r0, r4, 0 - bl sub_81B787C - b _081B780A -_081B7804: - adds r0, r4, 0 - bl sub_81B7910 -_081B780A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B77AC - - thumb_func_start sub_81B7810 -sub_81B7810: @ 81B7810 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0 - movs r2, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _081B7860 - bl sub_81B06F4 - ldr r0, =gUnknown_030061E8 - ldr r1, [r6] - str r1, [r0] - ldrb r3, [r6, 0x9] - adds r0, r7, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl sub_813DA40 - adds r0, r5, 0 - bl DestroyTask - b _081B786E - .pool -_081B7860: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B6794 - str r0, [r1] -_081B786E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7810 - - thumb_func_start sub_81B787C -sub_81B787C: @ 81B787C - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r0, =gStringVar2 - ldr r6, =gUnknown_020244E2 - ldrh r2, [r6] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9AE9 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldrh r0, [r6] - mov r1, r8 - strh r0, [r1, 0xE] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6FF4 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B787C - - thumb_func_start sub_81B7910 -sub_81B7910: @ 81B7910 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r6, r0, 0 - adds r5, r1, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0xD - muls r1, r5 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9AA5 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - mov r0, r8 - strh r5, [r0, 0xE] - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6F60 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7910 - - thumb_func_start sub_81B79A0 -sub_81B79A0: @ 81B79A0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r1, 0x3A - bl GetMonData - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x3B - bl GetMonData - strh r0, [r5, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl GetMonData - strh r0, [r5, 0x4] - adds r0, r4, 0 - movs r1, 0x3E - bl GetMonData - strh r0, [r5, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl GetMonData - strh r0, [r5, 0xA] - adds r0, r4, 0 - movs r1, 0x3D - bl GetMonData - strh r0, [r5, 0x6] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B79A0 - - thumb_func_start sub_81B79E8 -sub_81B79E8: @ 81B79E8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CEC4 - ldr r2, [r1] - movs r3, 0x86 - lsls r3, 2 - adds r1, r2, r3 - movs r3, 0 - strh r3, [r1] - ldr r4, =0x0000021a - adds r1, r2, r4 - strh r3, [r1] - ldr r1, =gUnknown_0203CEC8 - ldrb r1, [r1, 0x9] - lsls r1, 24 - asrs r1, 24 - movs r3, 0x87 - lsls r3, 2 - adds r2, r3 - strh r1, [r2] - bl sub_81B7A28 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B79E8 - - thumb_func_start sub_81B7A28 -sub_81B7A28: @ 81B7A28 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - mov r8, r4 - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B7A6E - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r7, r0, 16 - ldrb r0, [r6, 0x9] - ldr r1, =gUnknown_0203CE7C - ldrh r1, [r1] - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B7A94 -_081B7A6E: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_intro_gamefreak - str r0, [r1] - b _081B7B2A - .pool -_081B7A94: - movs r0, 0x1 - bl PlaySE - ldr r4, =gUnknown_0203CEDC - movs r0, 0x9 - ldrsb r0, [r6, r0] - lsls r0, 4 - ldr r1, [r4] - adds r1, r0 - adds r0, r5, 0 - bl party_menu_get_status_condition_and_update_object - ldr r2, =gSprites - movs r0, 0x9 - ldrsb r0, [r6, r0] - ldr r1, [r4] - lsls r0, 4 - adds r3, r0, r1 - ldrb r1, [r3, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081B7AD6 - adds r0, r5, 0 - adds r1, r3, 0 - movs r2, 0x1 - bl sub_81B2AC8 -_081B7AD6: - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - movs r1, 0x87 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl sub_81B0FCC - ldrb r0, [r6, 0x9] - movs r1, 0x1 - bl sub_81B0FCC - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - adds r3, r0, 0 - subs r3, r7 - lsls r3, 16 - asrs r3, 16 - ldrb r1, [r6, 0x9] - ldr r0, =sub_81B7C10 - str r0, [sp] - mov r0, r8 - movs r2, 0x1 - bl sub_81B1F18 - mov r0, r8 - movs r1, 0 - adds r2, r7, 0 - bl sub_81B1FA8 - ldr r0, [r4] - movs r2, 0x86 - lsls r2, 2 - adds r1, r0, r2 - movs r2, 0x1 - strh r2, [r1] - ldr r1, =0x0000021a - adds r0, r1 - strh r2, [r0] -_081B7B2A: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7A28 - - thumb_func_start task_intro_gamefreak -task_intro_gamefreak: @ 81B7B4C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7C0A - ldr r5, =gUnknown_0203CEC4 - ldr r2, [r5] - movs r0, 0x86 - lsls r0, 2 - adds r1, r2, r0 - movs r3, 0 - ldrsh r0, [r1, r3] - ldr r3, =gUnknown_0203CEC8 - cmp r0, 0x1 - bne _081B7B82 - movs r0, 0 - strh r0, [r1] - movs r1, 0x9 - ldrsb r1, [r3, r1] - movs r6, 0x87 - lsls r6, 2 - adds r0, r2, r6 - strh r1, [r0] -_081B7B82: - ldrb r0, [r3, 0x9] - adds r0, 0x1 - strb r0, [r3, 0x9] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x6 - bne _081B7C04 - ldr r0, [r5] - ldr r1, =0x0000021a - adds r0, r1 - movs r2, 0 - ldrsh r1, [r0, r2] - cmp r1, 0 - bne _081B7BC8 - ldr r0, =gUnknown_0203CEE8 - strb r1, [r0] - ldr r0, =gUnknown_085E96F6 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - b _081B7BD8 - .pool -_081B7BC8: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - movs r1, 0x1 - bl RemoveBagItem -_081B7BD8: - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6794 - str r1, [r0] - ldr r1, =gUnknown_0203CEC8 - movs r0, 0 - strb r0, [r1, 0x9] - b _081B7C0A - .pool -_081B7C04: - adds r0, r4, 0 - bl sub_81B7A28 -_081B7C0A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end task_intro_gamefreak - - thumb_func_start sub_81B7C10 -sub_81B7C10: @ 81B7C10 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9C17 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_gamefreak - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7C10 - - thumb_func_start sub_81B7C74 -sub_81B7C74: @ 81B7C74 - push {r4-r6,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r2, =gUnknown_030061E8 - ldr r1, =gUnknown_0203CEC8 - ldr r0, [r1] - str r0, [r2] - ldrb r0, [r1, 0x9] - ldr r4, =gUnknown_0203CE7C - ldrh r1, [r4] - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B7CD8 - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - ldr r0, =gUnknown_085E96F6 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - str r6, [r0] - b _081B7CE4 - .pool -_081B7CD8: - ldrh r0, [r4] - movs r1, 0x1 - bl RemoveBagItem - bl sub_81B06F4 -_081B7CE4: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B7C74 - - thumb_func_start GetItemEffectType -@ u8 GetItemEffectType(u16 itemId) -GetItemEffectType: @ 81B7CEC - push {r4,r5,lr} - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, r1, 0 - subs r2, 0xD - lsls r0, r2, 16 - lsrs r0, 16 - cmp r0, 0xA5 - bls _081B7D00 - b _081B7E40 -_081B7D00: - cmp r1, 0xAF - bne _081B7D18 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003214 - adds r4, r0, r1 - b _081B7D20 - .pool -_081B7D18: - ldr r1, =gItemEffectInfoPointers - lsls r0, r2, 2 - adds r0, r1 - ldr r4, [r0] -_081B7D20: - ldrb r1, [r4] - movs r5, 0x3F - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _081B7D42 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _081B7D42 - ldrb r0, [r4, 0x2] - cmp r0, 0 - bne _081B7D42 - ldrb r3, [r4, 0x3] - movs r0, 0x80 - ands r0, r3 - cmp r0, 0 - beq _081B7D4C -_081B7D42: - movs r0, 0 - b _081B7E46 - .pool -_081B7D4C: - movs r2, 0x40 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081B7D5A - movs r0, 0xA - b _081B7E46 -_081B7D5A: - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _081B7D66 - movs r0, 0x1 - b _081B7E46 -_081B7D66: - adds r2, r5, 0 - ands r2, r3 - cmp r2, 0 - bne _081B7D74 - lsrs r0, r1, 7 - cmp r0, 0 - beq _081B7DB6 -_081B7D74: - cmp r2, 0x20 - bne _081B7D7C - movs r0, 0x4 - b _081B7E46 -_081B7D7C: - cmp r2, 0x10 - bne _081B7D84 - movs r0, 0x3 - b _081B7E46 -_081B7D84: - cmp r2, 0x8 - bne _081B7D8C - movs r0, 0x5 - b _081B7E46 -_081B7D8C: - cmp r2, 0x4 - bne _081B7D94 - movs r0, 0x6 - b _081B7E46 -_081B7D94: - cmp r2, 0x2 - bne _081B7D9C - movs r0, 0x7 - b _081B7E46 -_081B7D9C: - cmp r2, 0x1 - bne _081B7DA4 - movs r0, 0x8 - b _081B7E46 -_081B7DA4: - lsrs r0, r1, 7 - cmp r0, 0 - beq _081B7DB2 - cmp r2, 0 - bne _081B7DB2 - movs r0, 0x9 - b _081B7E46 -_081B7DB2: - movs r0, 0xB - b _081B7E46 -_081B7DB6: - ldrb r1, [r4, 0x4] - movs r0, 0x44 - ands r0, r1 - adds r2, r1, 0 - cmp r0, 0 - beq _081B7DC6 - movs r0, 0x2 - b _081B7E46 -_081B7DC6: - movs r5, 0x2 - adds r0, r5, 0 - ands r0, r2 - cmp r0, 0 - beq _081B7DD4 - movs r0, 0xC - b _081B7E46 -_081B7DD4: - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r2 - cmp r0, 0 - beq _081B7DE2 - movs r0, 0xD - b _081B7E46 -_081B7DE2: - ldrb r1, [r4, 0x5] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _081B7DF0 - movs r0, 0xE - b _081B7E46 -_081B7DF0: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081B7DFC - movs r0, 0xF - b _081B7E46 -_081B7DFC: - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _081B7E08 - movs r0, 0x10 - b _081B7E46 -_081B7E08: - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _081B7E14 - movs r0, 0x11 - b _081B7E46 -_081B7E14: - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _081B7E20 - movs r0, 0x12 - b _081B7E46 -_081B7E20: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _081B7E2C - movs r0, 0x13 - b _081B7E46 -_081B7E2C: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081B7E38 - movs r0, 0x14 - b _081B7E46 -_081B7E38: - movs r0, 0x18 - ands r0, r2 - cmp r0, 0 - bne _081B7E44 -_081B7E40: - movs r0, 0x16 - b _081B7E46 -_081B7E44: - movs r0, 0x15 -_081B7E46: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetItemEffectType - - thumb_func_start sub_81B7E4C -sub_81B7E4C: @ 81B7E4C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B7F1C - ldr r7, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - movs r0, 0xE - adds r0, r7 - mov r8, r0 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r4, =gSpecialVar_0x8005 - ldrb r0, [r4] - bl sub_81B2360 - strh r0, [r7, 0xE] - ldr r0, =gStringVar2 - movs r1, 0xE - ldrsh r2, [r7, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - movs r0, 0x2 - mov r1, r8 - strh r0, [r1, 0x2] - ldrb r2, [r4] - adds r0, r5, 0 - movs r1, 0 - bl sub_81B22D8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7EF0 - cmp r0, 0x2 - beq _081B7EF8 - ldrh r1, [r7, 0xE] - adds r0, r5, 0 - bl pokemon_moveset_pad_ - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - beq _081B7F08 - adds r0, r6, 0 - bl sub_81B6EB4 - b _081B7F1C - .pool -_081B7EF0: - ldr r1, =gUnknown_085E9AB4 - b _081B7EFA - .pool -_081B7EF8: - ldr r1, =gUnknown_085E9C00 -_081B7EFA: - adds r0, r6, 0 - bl sub_81B6D98 - b _081B7F1C - .pool -_081B7F08: - ldr r0, =gUnknown_085E9AE9 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6FF4 - str r1, [r0] -_081B7F1C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7E4C - - thumb_func_start CB2_PartyMenuFromStartMenu -CB2_PartyMenuFromStartMenu: @ 81B7F34 - push {lr} - sub sp, 0xC - movs r0, 0 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_8086194 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end CB2_PartyMenuFromStartMenu - - thumb_func_start sub_81B7F60 -sub_81B7F60: @ 81B7F60 - push {lr} - sub sp, 0xC - bl InBattlePyramid - lsls r0, 24 - ldr r1, =sub_81C4F84 - cmp r0, 0 - bne _081B7F72 - ldr r1, =c2_815ABFC -_081B7F72: - movs r0, 0x6 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x5 - movs r3, 0 - bl sub_81B0038 - ldr r1, =gUnknown_0203CEC8 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - strh r0, [r1, 0xC] - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7F60 - - thumb_func_start sub_81B7FAC -sub_81B7FAC: @ 81B7FAC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - ldr r5, =gUnknown_0203CEFC - ldr r0, =gUnknown_0203CEC8 - mov r9, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r7, =gPlayerParty - adds r0, r7 - movs r1, 0xC - bl GetMonData - strh r0, [r5] - lsls r0, 16 - cmp r0, 0 - bne _081B7FF8 - adds r0, r4, 0 - bl sub_81B8044 - b _081B8030 - .pool -_081B7FF8: - ldrh r0, [r5] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B800C - adds r0, r4, 0 - bl sub_81B83B8 - b _081B8030 -_081B800C: - mov r1, r9 - movs r0, 0x9 - ldrsb r0, [r1, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - ldrh r1, [r5] - movs r2, 0x1 - bl sub_81B1D1C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B82A0 - str r1, [r0] -_081B8030: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7FAC - - thumb_func_start sub_81B8044 -sub_81B8044: @ 81B8044 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gUnknown_0203CEC8 - ldrh r0, [r5, 0xC] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B807C - ldrh r0, [r5, 0xC] - bl sub_81B83F0 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B814C - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B8082 - .pool -_081B807C: - adds r0, r4, 0 - bl sub_81B8088 -_081B8082: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B8044 - - thumb_func_start sub_81B8088 -sub_81B8088: @ 81B8088 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B80E4 - ldr r4, =gUnknown_0203CEC8 - ldrh r5, [r4, 0xC] - movs r0, 0x9 - ldrsb r0, [r4, r0] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r6, =gPlayerParty - adds r0, r6 - adds r1, r5, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81B1C84 - movs r0, 0x9 - ldrsb r0, [r4, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - adds r1, r5, 0 - bl sub_81B1DB8 - adds r0, r5, 0 - bl sub_81B83F0 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B8104 - str r1, [r0] -_081B80E4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8088 - - thumb_func_start sub_81B8104 -sub_81B8104: @ 81B8104 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r4, [r0, 0x9] - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B8138 - lsls r2, r4, 24 - asrs r2, 24 - movs r0, 0x64 - muls r0, r2 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gUnknown_0203CEDC - lsls r2, 4 - ldr r1, [r1] - adds r1, r2 - bl sub_81B5C94 - adds r0, r5, 0 - bl sub_81B12C0 -_081B8138: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8104 - - thumb_func_start sub_81B814C -sub_81B814C: @ 81B814C - push {r4-r6,lr} - ldr r4, =gUnknown_0203CEC8 - movs r0, 0x9 - ldrsb r0, [r4, r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - ldrh r1, [r4, 0xC] - bl sub_81B1DB8 - movs r0, 0x9 - ldrsb r0, [r4, r0] - muls r0, r6 - adds r0, r5 - movs r1, 0x40 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock1Ptr - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x00002be0 - adds r2, r0 - ldr r1, [r1] - adds r1, r2 - ldr r2, =sub_81B81A8 - movs r0, 0x4 - movs r3, 0x3 - bl sub_811A20C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B814C - - thumb_func_start sub_81B81A8 -sub_81B81A8: @ 81B81A8 - push {r4-r7,lr} - sub sp, 0xC - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0 - bne _081B8208 - adds r0, r5, 0 - bl sub_80D4680 - ldr r4, =gUnknown_0203CEFC - adds r0, r5, 0 - movs r1, 0xC - adds r2, r4, 0 - bl SetMonData - ldrh r0, [r4] - movs r1, 0x1 - bl RemoveBagItem - adds r0, r7, 0 - bl sub_81B841C - ldr r0, [r6] - bl SetMainCallback2 - b _081B8224 - .pool -_081B8208: - ldrb r0, [r6, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r6, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B8230 - str r1, [sp, 0x4] - ldr r1, [r6] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 -_081B8224: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B81A8 - - thumb_func_start sub_81B8230 -sub_81B8230: @ 81B8230 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B828A - ldr r1, =gUnknown_0203CEFC - ldrh r0, [r1] - cmp r0, 0 - beq _081B8264 - ldr r0, =gUnknown_0203CEC8 - ldrh r0, [r0, 0xC] - ldrh r1, [r1] - movs r2, 0 - bl sub_81B1D68 - b _081B827C - .pool -_081B8264: - ldr r2, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r2, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldrh r1, [r2, 0xC] - movs r2, 0 - movs r3, 0x1 - bl sub_81B1C84 -_081B827C: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B8104 - str r0, [r1] -_081B828A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8230 - - thumb_func_start sub_81B82A0 -sub_81B82A0: @ 81B82A0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B82C4 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B82D4 - str r0, [r1] -_081B82C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B82A0 - - thumb_func_start sub_81B82D4 -sub_81B82D4: @ 81B82D4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B82FA - cmp r1, 0 - bgt _081B82F4 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B8394 - b _081B83A8 -_081B82F4: - cmp r1, 0x1 - beq _081B839A - b _081B83A8 -_081B82FA: - ldr r7, =gUnknown_0203CEC8 - ldrh r4, [r7, 0xC] - adds r0, r4, 0 - bl sub_81B83F0 - ldr r6, =gUnknown_0203CEFC - ldrh r0, [r6] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - cmp r0, 0 - bne _081B8338 - adds r0, r4, 0 - bl sub_81B841C - ldrh r0, [r6] - bl pokemon_item_not_removed - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81B1B5C - b _081B8378 - .pool -_081B8338: - adds r0, r4, 0 - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B835C - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B814C - str r0, [r1, 0x4] - adds r0, r5, 0 - bl sub_81B12C0 - b _081B83A8 - .pool -_081B835C: - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r4, 0 - bl sub_81B1DB8 - ldrh r1, [r6] - adds r0, r4, 0 - movs r2, 0x1 - bl sub_81B1D68 -_081B8378: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B8104 - str r1, [r0] - b _081B83A8 - .pool -_081B8394: - movs r0, 0x5 - bl PlaySE -_081B839A: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B8104 - str r0, [r1] -_081B83A8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B82D4 - - thumb_func_start sub_81B83B8 -sub_81B83B8: @ 81B83B8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085E98EC - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B8104 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B83B8 - - thumb_func_start sub_81B83F0 -sub_81B83F0: @ 81B83F0 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x6 - bne _081B8410 - lsls r0, r1, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_80D6E48 - b _081B8418 - .pool -_081B8410: - adds r0, r1, 0 - movs r1, 0x1 - bl RemoveBagItem -_081B8418: - pop {r0} - bx r0 - thumb_func_end sub_81B83F0 - - thumb_func_start sub_81B841C -sub_81B841C: @ 81B841C - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x5 - beq _081B8438 - adds r0, r1, 0 - movs r1, 0x1 - bl sub_80D6D70 - b _081B8440 - .pool -_081B8438: - adds r0, r1, 0 - movs r1, 0x1 - bl AddBagItem -_081B8440: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_81B841C - - thumb_func_start sub_81B8448 -sub_81B8448: @ 81B8448 - push {lr} - sub sp, 0xC - movs r0, 0x6 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_816BB28 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x7 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8448 - - thumb_func_start sub_81B8474 -sub_81B8474: @ 81B8474 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_0203BCB8 - ldrh r1, [r0] - adds r1, 0x6 - ldrh r0, [r0, 0x2] - adds r1, r0 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x00002be0 - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - beq _081B84DC - ldr r0, =gUnknown_085E9A08 - movs r1, 0x1 - bl sub_81B1B5C - b _081B84F2 - .pool -_081B84DC: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80D460C - adds r0, r4, 0 - bl sub_80D439C - ldr r0, =gUnknown_085E9A40 - movs r1, 0x1 - bl sub_81B1B5C -_081B84F2: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B8104 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8474 - - thumb_func_start sub_81B8518 -sub_81B8518: @ 81B8518 - push {lr} - sub sp, 0xC - bl sub_81B8558 - movs r0, 0 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =gMain - ldr r0, [r0, 0x8] - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - ldr r1, =gUnknown_0203CEC8 - ldr r0, =sub_81B879C - str r0, [r1, 0x4] - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8518 - - thumb_func_start sub_81B8558 -sub_81B8558: @ 81B8558 - push {lr} - ldr r0, =gUnknown_0203CEF8 - movs r1, 0 - movs r2, 0x4 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8558 - - thumb_func_start sub_81B856C -sub_81B856C: @ 81B856C - push {r4,lr} - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_81B85AC - lsls r0, 24 - cmp r0, 0 - bne _081B858C - movs r0, 0x2 - b _081B85A4 - .pool -_081B858C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 - bl sub_81B8770 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B85A2 - movs r0, 0 - b _081B85A4 -_081B85A2: - movs r0, 0x1 -_081B85A4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B856C - - thumb_func_start sub_81B85AC -sub_81B85AC: @ 81B85AC - push {r4-r6,lr} - adds r5, r0, 0 - movs r6, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081B8608 - adds r0, r5, 0 - movs r1, 0x38 - bl GetMonData - adds r4, r0, 0 - bl sub_81B8888 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bhi _081B8608 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x0000191a - cmp r1, r0 - bne _081B85EA - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - bne _081B8608 -_081B85EA: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - beq _081B864A - cmp r0, 0x9 - bne _081B8618 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B864A -_081B8608: - movs r0, 0 - b _081B864C - .pool -_081B8618: - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r3, =gUnknown_08611C9A - lsls r1, r6, 1 - adds r0, r1, r3 - ldrh r0, [r0] - ldr r2, =0x0000ffff - cmp r0, r2 - beq _081B864A -_081B8632: - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, r4 - beq _081B8608 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, r6, 1 - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _081B8632 -_081B864A: - movs r0, 0x1 -_081B864C: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B85AC - - thumb_func_start sub_81B865C -sub_81B865C: @ 81B865C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - bl sub_81B885C - lsls r0, 24 - lsrs r2, r0, 24 - adds r1, r2, 0 - ldr r3, =gUnknown_0203CEF8 - adds r0, r2, r3 - subs r0, 0x1 - ldrb r0, [r0] - cmp r0, 0 - bne _081B869C - cmp r2, 0x1 - bne _081B8688 - movs r0, 0xE - b _081B8758 - .pool -_081B8688: - ldr r0, =gStringVar1 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalStringN - movs r0, 0x11 - b _081B8758 - .pool -_081B869C: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - movs r1, 0xF8 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B86C0 - b _081B8756 - .pool -_081B86B8: - movs r0, 0x12 - b _081B8758 -_081B86BC: - movs r0, 0x13 - b _081B8758 -_081B86C0: - bl sub_81B8830 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - b _081B8750 -_081B86CE: - ldr r3, =gUnknown_0203CEF8 - adds r4, r3, r5 - ldrb r0, [r4] - movs r1, 0x64 - muls r0, r1 - subs r0, 0x64 - ldr r3, =gPlayerParty - adds r0, r3, r0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - ldrb r0, [r4] - movs r1, 0x64 - muls r0, r1 - subs r0, 0x64 - ldr r3, =gPlayerParty - adds r0, r3, r0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - adds r1, r5, 0x1 - lsls r0, r1, 24 - lsrs r4, r0, 24 - mov r9, r1 - cmp r4, r8 - bcs _081B8748 - movs r7, 0x64 -_081B870E: - ldr r0, =gUnknown_0203CEF8 - adds r5, r0, r4 - ldrb r0, [r5] - muls r0, r7 - subs r0, 0x64 - ldr r1, =gPlayerParty - adds r0, r1, r0 - movs r1, 0xB - bl GetMonData - cmp r10, r0 - beq _081B86B8 - cmp r6, 0 - beq _081B873E - ldrb r0, [r5] - muls r0, r7 - subs r0, 0x64 - ldr r3, =gPlayerParty - adds r0, r3, r0 - movs r1, 0xC - bl GetMonData - cmp r6, r0 - beq _081B86BC -_081B873E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r8 - bcc _081B870E -_081B8748: - mov r1, r9 - lsls r0, r1, 24 - lsrs r5, r0, 24 - mov r0, r8 -_081B8750: - subs r0, 0x1 - cmp r5, r0 - blt _081B86CE -_081B8756: - movs r0, 0xFF -_081B8758: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B865C - - thumb_func_start sub_81B8770 -sub_81B8770: @ 81B8770 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =gUnknown_0203CEF8 -_081B877A: - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081B878C - movs r0, 0x1 - b _081B8798 - .pool -_081B878C: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _081B877A - movs r0, 0 -_081B8798: - pop {r1} - bx r1 - thumb_func_end sub_81B8770 - - thumb_func_start sub_81B879C -sub_81B879C: @ 81B879C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81B865C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xFF - beq _081B87D4 - movs r0, 0x20 - bl PlaySE - adds r0, r4, 0 - bl display_pokemon_menu_message - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B87E8 - str r0, [r1] - b _081B87E0 - .pool -_081B87D4: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81B12C0 -_081B87E0: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B879C - - thumb_func_start sub_81B87E8 -sub_81B87E8: @ 81B87E8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081B8802 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B881C -_081B8802: - movs r0, 0x5 - bl PlaySE - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 - str r0, [r1] -_081B881C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B87E8 - - thumb_func_start sub_81B8830 -sub_81B8830: @ 81B8830 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - beq _081B884C - cmp r0, 0x9 - bne _081B8850 - movs r0, 0x3 - b _081B8854 - .pool -_081B884C: - movs r0, 0x2 - b _081B8854 -_081B8850: - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] -_081B8854: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B8830 - - thumb_func_start sub_81B885C -sub_81B885C: @ 81B885C - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - beq _081B8878 - cmp r0, 0x9 - bne _081B887C - movs r0, 0x1 - b _081B8880 - .pool -_081B8878: - movs r0, 0x2 - b _081B8880 -_081B887C: - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] -_081B8880: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B885C - - thumb_func_start sub_81B8888 -sub_81B8888: @ 81B8888 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - beq _081B88A4 - cmp r0, 0x9 - bne _081B88A8 -_081B889C: - movs r0, 0x64 - b _081B88B2 - .pool -_081B88A4: - movs r0, 0x1E - b _081B88B2 -_081B88A8: - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - cmp r0, 0 - bne _081B889C - movs r0, 0x32 -_081B88B2: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B8888 - - thumb_func_start sub_81B88BC -sub_81B88BC: @ 81B88BC - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xF8 - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B88E0 - ldr r0, =gUnknown_085EA126 - b _081B88FA - .pool -_081B88E0: - cmp r1, 0x1 - bne _081B88F8 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x2 - bne _081B88F8 - ldr r0, =gUnknown_085EA139 - b _081B88FA - .pool -_081B88F8: - ldr r0, =gUnknown_085EA155 -_081B88FA: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B88BC - - thumb_func_start sub_81B8904 -sub_81B8904: @ 81B8904 - push {lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - str r2, [sp] - ldr r2, =sub_81B1370 - str r2, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8904 - - thumb_func_start sub_81B892C -sub_81B892C: @ 81B892C - push {lr} - sub sp, 0xC - movs r0, 0x4 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0xC - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B892C - - thumb_func_start sub_81B8958 -sub_81B8958: @ 81B8958 - push {lr} - sub sp, 0xC - movs r0, 0x1 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - str r0, [sp, 0x8] - movs r0, 0xB - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8958 - - thumb_func_start sub_81B8984 -sub_81B8984: @ 81B8984 - push {lr} - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _081B8994 - movs r0, 0 - b _081B89A6 -_081B8994: - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B89A4 - movs r0, 0x1 - b _081B89A6 -_081B89A4: - movs r0, 0x2 -_081B89A6: - pop {r1} - bx r1 - thumb_func_end sub_81B8984 - - thumb_func_start sub_81B89AC -sub_81B89AC: @ 81B89AC - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81B8984 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_8059D40 - str r0, [sp, 0x8] - movs r0, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl sub_81B0038 - bl nullsub_35 - bl pokemon_change_order - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B89AC - - thumb_func_start sub_81B89F0 -sub_81B89F0: @ 81B89F0 - push {lr} - sub sp, 0xC - bl sub_81B8984 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x5 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =c2_815ABFC - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x3 - movs r3, 0 - bl sub_81B0038 - bl nullsub_35 - bl pokemon_change_order - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B89F0 - - thumb_func_start sub_81B8A2C -sub_81B8A2C: @ 81B8A2C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_02024550 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B8A74 - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081B8A74 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x1 - bne _081B8A5C - movs r0, 0x3 - b _081B8A76 - .pool -_081B8A5C: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - bne _081B8A74 - movs r0, 0x2 - b _081B8A76 - .pool -_081B8A74: - movs r0, 0x7 -_081B8A76: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B8A2C - - thumb_func_start sub_81B8A7C -sub_81B8A7C: @ 81B8A7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B8AC4 - cmp r5, 0x1 - beq _081B8AA2 - cmp r5, 0x4 - beq _081B8AA2 - cmp r5, 0x5 - bne _081B8AC4 -_081B8AA2: - ldr r4, =gStringVar1 - bl sub_806EBF8 - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E97B2 - b _081B8C42 - .pool -_081B8AC4: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B8AF8 - ldr r1, =gStringVar1 - adds r0, r4, 0 - bl GetMonNickname - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E978F - b _081B8C42 - .pool -_081B8AF8: - movs r4, 0 - b _081B8B24 -_081B8AFC: - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _081B8B1E - adds r0, r5, 0 - bl sub_81B8F38 - lsls r0, 24 - ldr r2, =gBattlePartyID - lsls r1, r4, 1 - adds r1, r2 - lsrs r0, 24 - ldrh r1, [r1] - cmp r0, r1 - beq _081B8BFC -_081B8B1E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081B8B24: - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - bcc _081B8AFC - movs r7, 0x64 - adds r0, r5, 0 - muls r0, r7 - ldr r1, =gPlayerParty - mov r8, r1 - adds r6, r0, r1 - adds r0, r6, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _081B8B60 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E97E5 - b _081B8C42 - .pool -_081B8B60: - adds r0, r5, 0 - bl sub_81B8F38 - ldr r1, =gBattleStruct - ldr r1, [r1] - adds r1, 0x8B - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _081B8B94 - ldr r1, =gStringVar1 - adds r0, r6, 0 - bl GetMonNickname - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E976F - b _081B8C42 - .pool -_081B8B94: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x4 - bne _081B8BA8 - bl sub_806E994 - b _081B8C46 - .pool -_081B8BA8: - cmp r0, 0x2 - beq _081B8C20 - adds r0, r5, 0 - bl sub_81B8F38 - ldr r1, =gUnknown_0203CEE9 - strb r0, [r1] - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - ldr r1, =gBattlePartyID - ldr r0, =gUnknown_020244B8 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - bl pokemon_order_func - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B8FB0 - adds r0, r4, 0 - muls r0, r7 - add r0, r8 - adds r1, r6, 0 - bl sub_81B1288 - movs r0, 0x1 - b _081B8C48 - .pool -_081B8BFC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9754 - b _081B8C42 - .pool -_081B8C20: - ldr r0, =gUnknown_020244B8 - ldrb r0, [r0] - ldr r1, =gBattlePartyID - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - bl pokemon_order_func - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - add r0, r8 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9738 -_081B8C42: - bl StringExpandPlaceholders -_081B8C46: - movs r0, 0 -_081B8C48: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B8A7C - - thumb_func_start sub_81B8C68 -sub_81B8C68: @ 81B8C68 - push {r4,lr} - ldr r4, =gUnknown_0203CF00 - bl sub_806D7EC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B8C88 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8C68 - - thumb_func_start sub_81B8C88 -sub_81B8C88: @ 81B8C88 - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B8CBE - cmp r4, 0 - beq _081B8CB0 - movs r0, 0x30 - strb r0, [r6] - movs r0, 0x45 - strb r0, [r6, 0x1] - movs r0, 0x12 - strb r0, [r6, 0x2] - b _081B8D58 -_081B8CB0: - movs r0, 0x3 - strb r0, [r6] - movs r0, 0x12 - strb r0, [r6, 0x1] - movs r0, 0x45 - strb r0, [r6, 0x2] - b _081B8D58 -_081B8CBE: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _081B8CFC - movs r5, 0x1 - movs r0, 0 - bl GetBankByPlayerAI - mov r2, sp - ldr r1, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r0, [r0] - strb r0, [r2] - movs r4, 0 - mov r1, sp -_081B8CE2: - ldrb r0, [r1] - cmp r4, r0 - beq _081B8CF0 - mov r2, sp - adds r0, r2, r5 - strb r4, [r0] - adds r5, 0x1 -_081B8CF0: - adds r4, 0x1 - cmp r4, 0x5 - ble _081B8CE2 - b _081B8D40 - .pool -_081B8CFC: - movs r5, 0x2 - movs r0, 0 - bl GetBankByPlayerAI - mov r1, sp - ldr r4, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrh r0, [r0] - strb r0, [r1] - movs r0, 0x2 - bl GetBankByPlayerAI - mov r1, sp - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrh r0, [r0] - strb r0, [r1, 0x1] - movs r4, 0 -_081B8D26: - ldrb r0, [r1] - cmp r4, r0 - beq _081B8D3A - ldrb r0, [r1, 0x1] - cmp r4, r0 - beq _081B8D3A - mov r2, sp - adds r0, r2, r5 - strb r4, [r0] - adds r5, 0x1 -_081B8D3A: - adds r4, 0x1 - cmp r4, 0x5 - ble _081B8D26 -_081B8D40: - movs r4, 0 - mov r3, sp -_081B8D44: - adds r0, r6, r4 - ldrb r1, [r3] - lsls r1, 4 - ldrb r2, [r3, 0x1] - orrs r1, r2 - strb r1, [r0] - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x2 - ble _081B8D44 -_081B8D58: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8C88 - - thumb_func_start sub_81B8D64 -sub_81B8D64: @ 81B8D64 - push {lr} - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =gBattleStruct - lsls r3, r2, 1 - adds r3, r2 - adds r3, 0x60 - ldr r0, [r0] - adds r0, r3 - bl sub_81B8D88 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8D64 - - thumb_func_start sub_81B8D88 -sub_81B8D88: @ 81B8D88 - push {r4-r7,lr} - sub sp, 0x8 - adds r5, r0, 0 - adds r0, r2, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r0, 24 - lsrs r0, 24 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _081B8DB0 - movs r0, 0 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x2 - b _081B8DBC -_081B8DB0: - movs r0, 0x1 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x3 -_081B8DBC: - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B8DF0 - cmp r7, 0 - beq _081B8DE2 - movs r0, 0x30 - strb r0, [r5] - movs r0, 0x45 - strb r0, [r5, 0x1] - movs r0, 0x12 - strb r0, [r5, 0x2] - b _081B8E72 -_081B8DE2: - movs r0, 0x3 - strb r0, [r5] - movs r0, 0x12 - strb r0, [r5, 0x1] - movs r0, 0x45 - strb r0, [r5, 0x2] - b _081B8E72 -_081B8DF0: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _081B8E28 - movs r3, 0x1 - mov r2, sp - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - strb r0, [r2] - movs r4, 0 - mov r1, sp -_081B8E0C: - ldrb r0, [r1] - cmp r4, r0 - beq _081B8E1A - mov r2, sp - adds r0, r2, r3 - strb r4, [r0] - adds r3, 0x1 -_081B8E1A: - adds r4, 0x1 - cmp r4, 0x5 - ble _081B8E0C - b _081B8E5A - .pool -_081B8E28: - movs r3, 0x2 - mov r1, sp - ldr r2, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1] - lsls r0, r6, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x1] - movs r4, 0 -_081B8E40: - ldrb r0, [r1] - cmp r4, r0 - beq _081B8E54 - ldrb r0, [r1, 0x1] - cmp r4, r0 - beq _081B8E54 - mov r2, sp - adds r0, r2, r3 - strb r4, [r0] - adds r3, 0x1 -_081B8E54: - adds r4, 0x1 - cmp r4, 0x5 - ble _081B8E40 -_081B8E5A: - movs r4, 0 - mov r3, sp -_081B8E5E: - adds r0, r5, r4 - ldrb r1, [r3] - lsls r1, 4 - ldrb r2, [r3, 0x1] - orrs r1, r2 - strb r1, [r0] - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x2 - ble _081B8E5E -_081B8E72: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8D88 - - thumb_func_start sub_81B8E80 -sub_81B8E80: @ 81B8E80 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - movs r7, 0 - bl sub_81B1250 - lsls r0, 24 - cmp r0, 0 - beq _081B8F2E - ldr r0, =gBattleStruct - lsls r1, r4, 1 - adds r1, r4 - adds r1, 0x60 - ldr r0, [r0] - adds r4, r0, r1 - movs r2, 0 - add r6, sp - mov r12, r6 - movs r6, 0xF - mov r3, sp -_081B8EB2: - adds r1, r4, r2 - ldrb r0, [r1] - lsrs r0, 4 - strb r0, [r3] - adds r3, 0x1 - ldrb r1, [r1] - adds r0, r6, 0 - ands r0, r1 - strb r0, [r3] - adds r3, 0x1 - adds r2, 0x1 - cmp r2, 0x2 - ble _081B8EB2 - mov r0, r12 - ldrb r3, [r0] - movs r2, 0 - mov r0, sp - ldrb r0, [r0] - cmp r0, r5 - bne _081B8EE8 - mov r0, sp - ldrb r7, [r0] - strb r3, [r0] - b _081B8EFC - .pool -_081B8EE8: - adds r2, 0x1 - cmp r2, 0x5 - bgt _081B8EFC - mov r0, sp - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, r5 - bne _081B8EE8 - adds r7, r0, 0 - strb r3, [r1] -_081B8EFC: - cmp r2, 0x6 - beq _081B8F2E - mov r0, r12 - strb r7, [r0] - mov r0, sp - ldrb r0, [r0] - lsls r0, 4 - mov r1, sp - ldrb r1, [r1, 0x1] - orrs r0, r1 - strb r0, [r4] - mov r0, sp - ldrb r0, [r0, 0x2] - lsls r0, 4 - mov r1, sp - ldrb r1, [r1, 0x3] - orrs r0, r1 - strb r0, [r4, 0x1] - mov r0, sp - ldrb r0, [r0, 0x4] - lsls r0, 4 - mov r1, sp - ldrb r1, [r1, 0x5] - orrs r0, r1 - strb r0, [r4, 0x2] -_081B8F2E: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B8E80 - - thumb_func_start sub_81B8F38 -sub_81B8F38: @ 81B8F38 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0x1 - ands r1, r2 - lsrs r2, r0, 25 - cmp r1, 0 - beq _081B8F58 - ldr r0, =gUnknown_0203CF00 - adds r0, r2, r0 - ldrb r0, [r0] - movs r1, 0xF - ands r1, r0 - b _081B8F60 - .pool -_081B8F58: - ldr r0, =gUnknown_0203CF00 - adds r0, r2, r0 - ldrb r0, [r0] - lsrs r1, r0, 4 -_081B8F60: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B8F38 - - thumb_func_start sub_81B8F6C -sub_81B8F6C: @ 81B8F6C - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - movs r1, 0x1 - ands r1, r3 - lsrs r3, r0, 25 - cmp r1, 0 - beq _081B8F94 - ldr r0, =gUnknown_0203CF00 - adds r0, r3, r0 - ldrb r2, [r0] - movs r1, 0xF0 - ands r1, r2 - orrs r1, r4 - strb r1, [r0] - b _081B8FA4 - .pool -_081B8F94: - ldr r2, =gUnknown_0203CF00 - adds r2, r3, r2 - ldrb r1, [r2] - movs r0, 0xF - ands r0, r1 - lsls r1, r4, 4 - orrs r0, r1 - strb r0, [r2] -_081B8FA4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8F6C - - thumb_func_start sub_81B8FB0 -sub_81B8FB0: @ 81B8FB0 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - adds r0, r5, 0 - bl sub_81B8F38 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - bl sub_81B8F38 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_81B8F6C - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81B8F6C - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B8FB0 - - thumb_func_start pokemon_order_func -pokemon_order_func: @ 81B8FEC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r3, 0 - movs r2, 0 - ldr r5, =gUnknown_0203CF00 -_081B8FF8: - adds r0, r3, r5 - ldrb r1, [r0] - lsrs r0, r1, 4 - cmp r0, r4 - beq _081B9010 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - movs r0, 0xF - ands r0, r1 - cmp r0, r4 - bne _081B9018 -_081B9010: - adds r0, r2, 0 - b _081B902A - .pool -_081B9018: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _081B8FF8 - movs r0, 0 -_081B902A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end pokemon_order_func - - thumb_func_start pokemon_change_order -pokemon_change_order: @ 81B9030 - push {r4-r6,lr} - movs r4, 0x96 - lsls r4, 2 - adds r0, r4, 0 - bl Alloc - adds r5, r0, 0 - ldr r1, =gPlayerParty - adds r2, r4, 0 - bl memcpy - movs r4, 0 - movs r6, 0x64 -_081B904A: - adds r0, r4, 0 - bl pokemon_order_func - lsls r0, 24 - lsrs r0, 24 - muls r0, r6 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r4, 0 - muls r1, r6 - adds r1, r5 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081B904A - adds r0, r5, 0 - bl Free - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end pokemon_change_order - - thumb_func_start sub_81B9080 -sub_81B9080: @ 81B9080 - push {r4-r6,lr} - movs r4, 0x96 - lsls r4, 2 - adds r0, r4, 0 - bl Alloc - adds r5, r0, 0 - ldr r1, =gPlayerParty - adds r2, r4, 0 - bl memcpy - movs r4, 0 - movs r6, 0x64 -_081B909A: - adds r0, r4, 0 - bl sub_81B8F38 - lsls r0, 24 - lsrs r0, 24 - muls r0, r6 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r4, 0 - muls r1, r6 - adds r1, r5 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081B909A - adds r0, r5, 0 - bl Free - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9080 - - thumb_func_start sub_81B90D0 -sub_81B90D0: @ 81B90D0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r6, 0x1 - movs r7, 0x64 - ldr r0, =gPlayerParty - mov r8, r0 -_081B90DE: - adds r0, r6, 0 - bl sub_81B8F38 - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - mov r1, r8 - adds r5, r0, r1 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B912C - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081B912C - movs r0, 0 - bl sub_81B8F38 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - adds r1, r6, 0 - bl sub_81B8FB0 - adds r0, r4, 0 - muls r0, r7 - add r0, r8 - adds r1, r5, 0 - bl sub_81B1288 - b _081B9136 - .pool -_081B912C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x5 - bls _081B90DE -_081B9136: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B90D0 - - thumb_func_start sub_81B9140 -sub_81B9140: @ 81B9140 - push {lr} - ldr r0, =sub_8059D40 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9140 - - thumb_func_start sub_81B9150 -sub_81B9150: @ 81B9150 - push {lr} - sub sp, 0xC - movs r0, 0x7F - str r0, [sp] - ldr r0, =sub_81B917C - str r0, [sp, 0x4] - ldr r0, =gMain - ldr r0, [r0, 0x8] - str r0, [sp, 0x8] - movs r0, 0x5 - movs r1, 0x3 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9150 - - thumb_func_start sub_81B917C -sub_81B917C: @ 81B917C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gTasks - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r1, 0x80 - lsls r1, 1 - strh r1, [r4, 0x8] - bl sub_81B9294 - movs r1, 0x80 - lsls r1, 9 - movs r0, 0x2 - movs r2, 0 - bl ChangeBgX - ldr r0, =sub_81B91B4 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B917C - - thumb_func_start sub_81B91B4 -sub_81B91B4: @ 81B91B4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r6, r5, 2 - adds r0, r6, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B9220 - ldrh r0, [r4] - subs r0, 0x8 - strh r0, [r4] - adds r0, r5, 0 - bl sub_81B9294 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081B9220 - movs r4, 0x3 - ldr r7, =gUnknown_02022FF8 -_081B91E8: - subs r0, r4, 0x3 - lsls r0, 5 - adds r0, r7 - ldrh r0, [r0] - cmp r0, 0 - beq _081B9204 - ldr r0, =gUnknown_0203CEDC - ldr r1, [r0] - lsls r0, r4, 4 - adds r0, r1 - ldrb r0, [r0, 0x9] - movs r1, 0 - bl sub_81B5B6C -_081B9204: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081B91E8 - movs r0, 0x78 - bl PlaySE - ldr r0, =gTasks - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B9240 - str r0, [r1] -_081B9220: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B91B4 - - thumb_func_start sub_81B9240 -sub_81B9240: @ 81B9240 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - lsls r1, 16 - movs r0, 0x80 - lsls r0, 17 - cmp r1, r0 - bne _081B9266 - adds r0, r2, 0 - bl sub_81B12C0 -_081B9266: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9240 - - thumb_func_start sub_81B9270 -sub_81B9270: @ 81B9270 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 16 - lsrs r3, r1, 16 - cmp r1, 0 - blt _081B928A - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - strh r3, [r0, 0x24] -_081B928A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9270 - - thumb_func_start sub_81B9294 -sub_81B9294: @ 81B9294 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r5, r1, r0 - movs r6, 0x3 - ldr r7, =gUnknown_0203CEDC -_081B92A8: - ldr r0, =gUnknown_02022FF8 - subs r1, r6, 0x3 - lsls r1, 5 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _081B9300 - ldr r0, [r7] - lsls r4, r6, 4 - adds r0, r4, r0 - ldrb r0, [r0, 0x9] - ldrh r1, [r5] - subs r1, 0x8 - lsls r1, 16 - asrs r1, 16 - bl sub_81B9270 - ldr r0, [r7] - adds r0, r4, r0 - ldrb r0, [r0, 0xA] - ldrh r1, [r5] - subs r1, 0x8 - lsls r1, 16 - asrs r1, 16 - bl sub_81B9270 - ldr r0, [r7] - adds r0, r4, r0 - ldrb r0, [r0, 0xB] - ldrh r1, [r5] - subs r1, 0x8 - lsls r1, 16 - asrs r1, 16 - bl sub_81B9270 - ldr r0, [r7] - adds r4, r0 - ldrb r0, [r4, 0xC] - ldrh r1, [r5] - subs r1, 0x8 - lsls r1, 16 - asrs r1, 16 - bl sub_81B9270 -_081B9300: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x5 - bls _081B92A8 - movs r1, 0x80 - lsls r1, 4 - movs r0, 0x2 - movs r2, 0x1 - bl ChangeBgX - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9294 - - thumb_func_start sub_81B9328 -sub_81B9328: @ 81B9328 - push {lr} - sub sp, 0xC - movs r0, 0xF - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9390 - str r0, [sp, 0x8] - movs r0, 0x6 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9328 - - thumb_func_start sub_81B9354 -sub_81B9354: @ 81B9354 - push {lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_03005DB0 - ldr r1, =hm_add_c3_without_phase_2 - str r1, [r2] - movs r1, 0 - str r1, [sp] - ldr r1, =sub_81B1370 - str r1, [sp, 0x4] - ldr r1, =c2_exit_to_overworld_2_switch - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9354 - - thumb_func_start sub_81B9390 -sub_81B9390: @ 81B9390 - push {r4,lr} - ldr r4, =gSpecialVar_0x8004 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - cmp r0, 0x5 - bls _081B93A6 - movs r0, 0xFF - strh r0, [r4] -_081B93A6: - ldr r0, =gUnknown_03005DB0 - ldr r1, =hm_add_c3_without_phase_2 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9390 - - thumb_func_start hm_add_c3_without_phase_2 -hm_add_c3_without_phase_2: @ 81B93C8 - push {lr} - bl pal_fill_black - ldr r0, =task_hm_without_phase_2 - movs r1, 0xA - bl CreateTask - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end hm_add_c3_without_phase_2 - - thumb_func_start task_hm_without_phase_2 -task_hm_without_phase_2: @ 81B93E0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - beq _081B93FE - adds r0, r4, 0 - bl DestroyTask - bl script_env_2_disable - bl script_env_2_enable_and_set_ctx_running -_081B93FE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end task_hm_without_phase_2 - - thumb_func_start sub_81B9404 -sub_81B9404: @ 81B9404 - push {lr} - bl script_env_2_enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81B9424 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9404 - - thumb_func_start sub_81B9424 -sub_81B9424: @ 81B9424 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081B945C - bl overworld_free_bg_tilemaps - str r4, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9470 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81B0038 - adds r0, r5, 0 - bl DestroyTask -_081B945C: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9424 - - thumb_func_start sub_81B9470 -sub_81B9470: @ 81B9470 - push {lr} - bl brm_get_pokemon_selection - ldr r2, =gUnknown_02039F24 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _081B9486 - movs r0, 0xFF - strb r0, [r2] -_081B9486: - ldr r1, =gSpecialVar_0x8004 - ldrb r0, [r2] - strh r0, [r1] - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_without_phase_2 - str r0, [r1] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9470 - - thumb_func_start sub_81B94B0 -sub_81B94B0: @ 81B94B0 - push {lr} - bl script_env_2_enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81B94D0 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B94B0 - - thumb_func_start sub_81B94D0 -sub_81B94D0: @ 81B94D0 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081B9508 - bl overworld_free_bg_tilemaps - str r4, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9390 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81B0038 - adds r0, r5, 0 - bl DestroyTask -_081B9508: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B94D0 - - thumb_func_start sub_81B951C -sub_81B951C: @ 81B951C - push {lr} - bl script_env_2_enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81B953C - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B951C - - thumb_func_start sub_81B953C -sub_81B953C: @ 81B953C - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081B9574 - bl overworld_free_bg_tilemaps - str r4, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9588 - str r0, [sp, 0x8] - movs r0, 0x7 - movs r1, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81B0038 - adds r0, r5, 0 - bl DestroyTask -_081B9574: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B953C - - thumb_func_start sub_81B9588 -sub_81B9588: @ 81B9588 - push {r4,r5,lr} - ldr r5, =gSpecialVar_0x8004 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - cmp r0, 0x5 - bls _081B95A4 - movs r0, 0xFF - strh r0, [r5] - b _081B95BA - .pool -_081B95A4: - ldr r4, =gSpecialVar_0x8005 - ldrh r1, [r5] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_806E25C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] -_081B95BA: - ldr r0, =gUnknown_03005DB0 - ldr r1, =hm_add_c3_without_phase_2 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9588 - - thumb_func_start sub_81B95E0 -sub_81B95E0: @ 81B95E0 - push {r4,r5,lr} - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - movs r4, 0 - adds r5, r1, 0 - b _081B95FA - .pool -_081B95F4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081B95FA: - cmp r4, 0x2 - bhi _081B9614 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - beq _081B95F4 - movs r0, 0x1 - strh r0, [r5] -_081B9614: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B95E0 - - thumb_func_start sub_81B9620 -sub_81B9620: @ 81B9620 - push {lr} - bl script_env_2_enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81B9640 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9620 - - thumb_func_start sub_81B9640 -sub_81B9640: @ 81B9640 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081B9678 - bl overworld_free_bg_tilemaps - str r4, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9390 - str r0, [sp, 0x8] - movs r0, 0xC - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - adds r0, r5, 0 - bl DestroyTask -_081B9678: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9640 - - thumb_func_start sub_81B968C -sub_81B968C: @ 81B968C - push {lr} - sub sp, 0x4 - ldr r1, =gPlayerParty - ldr r0, =gSpecialVar_0x8004 - ldrb r2, [r0] - ldr r0, =gPlayerPartyCount - ldrb r3, [r0] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =c2_exit_to_overworld_2_switch - str r0, [sp] - movs r0, 0x3 - bl sub_81BF8EC - ldr r1, =gUnknown_03005DAC - ldr r0, =sub_80AF168 - str r0, [r1] - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B968C - - thumb_func_start sub_81B96D0 -sub_81B96D0: @ 81B96D0 - push {r4,r5,lr} - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - movs r4, 0 - adds r5, r1, 0 -_081B96DC: - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r4, 0 - adds r1, 0xD - bl GetMonData - cmp r0, 0 - beq _081B96FA - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_081B96FA: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081B96DC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B96D0 - - thumb_func_start sub_81B9718 -sub_81B9718: @ 81B9718 - push {r4,r5,lr} - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - adds r5, r1, 0 - muls r5, r0 - ldr r0, =gPlayerParty - adds r5, r0 - ldr r0, =gSpecialVar_0x8005 - ldrh r1, [r0] - adds r1, 0xD - adds r0, r5, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9718 - - thumb_func_start sub_81B9770 -sub_81B9770: @ 81B9770 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gSpecialVar_0x8004 - mov r8, r0 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - ldr r4, =gSpecialVar_0x8005 - ldrb r2, [r4] - movs r1, 0 - bl sub_80691F4 - mov r1, r8 - ldrh r0, [r1] - muls r0, r6 - adds r0, r5 - ldrb r1, [r4] - bl sub_806B9A8 - ldrh r4, [r4] - cmp r4, 0x2 - bhi _081B97C4 -_081B97A2: - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - lsls r1, r4, 24 - lsrs r1, 24 - adds r4, 0x1 - lsls r2, r4, 24 - lsrs r2, 24 - bl sub_81B97DC - lsls r4, 16 - lsrs r4, 16 - cmp r4, 0x2 - bls _081B97A2 -_081B97C4: - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9770 - - thumb_func_start sub_81B97DC -sub_81B97DC: @ 81B97DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - mov r8, r0 - adds r5, r1, 0 - adds r4, r2, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r0, 0xD - str r0, [sp, 0x8] - mov r0, r8 - ldr r1, [sp, 0x8] - bl GetMonData - mov r1, sp - adds r1, 0x2 - str r1, [sp, 0x14] - strh r0, [r1] - adds r3, r4, 0 - adds r3, 0xD - str r3, [sp, 0xC] - mov r0, r8 - adds r1, r3, 0 - bl GetMonData - mov r1, sp - strh r0, [r1] - adds r7, r5, 0 - adds r7, 0x11 - str r7, [sp, 0x10] - mov r0, r8 - adds r1, r7, 0 - bl GetMonData - mov r1, sp - adds r1, 0x5 - str r1, [sp, 0x18] - strb r0, [r1] - adds r3, r4, 0 - adds r3, 0x11 - str r3, [sp, 0x1C] - mov r0, r8 - adds r1, r3, 0 - bl GetMonData - add r7, sp, 0x4 - mov r10, r7 - strb r0, [r7] - mov r0, r8 - movs r1, 0x15 - bl GetMonData - mov r6, sp - adds r6, 0x6 - strb r0, [r6] - ldr r1, =gUnknown_08329D22 - adds r0, r5, r1 - ldrb r0, [r0] - mov r9, r0 - ldrb r0, [r6] - adds r2, r0, 0 - mov r3, r9 - ands r2, r3 - lsls r5, 1 - asrs r2, r5 - lsls r2, 24 - lsrs r2, 24 - adds r1, r4, r1 - ldrb r3, [r1] - adds r1, r0, 0 - ands r1, r3 - lsls r4, 1 - asrs r1, r4 - lsls r1, 24 - lsrs r1, 24 - mov r7, r9 - bics r0, r7 - strb r0, [r6] - ldrb r0, [r6] - bics r0, r3 - strb r0, [r6] - lsls r2, r4 - lsls r1, r5 - adds r2, r1 - ldrb r0, [r6] - orrs r0, r2 - strb r0, [r6] - mov r0, r8 - ldr r1, [sp, 0x8] - mov r2, sp - bl SetMonData - mov r0, r8 - ldr r1, [sp, 0xC] - ldr r2, [sp, 0x14] - bl SetMonData - mov r0, r8 - ldr r1, [sp, 0x10] - mov r2, r10 - bl SetMonData - mov r0, r8 - ldr r1, [sp, 0x1C] - ldr r2, [sp, 0x18] - bl SetMonData - mov r0, r8 - movs r1, 0x15 - adds r2, r6, 0 - bl SetMonData - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B97DC - - thumb_func_start sub_81B98DC -sub_81B98DC: @ 81B98DC - push {lr} - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2D - bl GetMonData - adds r1, r0, 0 - cmp r1, 0 - beq _081B990C - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - b _081B9910 - .pool -_081B990C: - ldr r0, =gScriptResult - strh r1, [r0] -_081B9910: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B98DC - - thumb_func_start sub_81B9918 -sub_81B9918: @ 81B9918 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - adds r1, 0xD - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r0, 0x39 - bne _081B999C - movs r6, 0 - b _081B9980 - .pool -_081B9958: - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - cmp r6, r0 - beq _081B997E - movs r4, 0 - movs r0, 0x64 - adds r5, r6, 0 - muls r5, r0 - ldr r7, =gPlayerParty -_081B996A: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, r7 - bl GetMonData - cmp r0, 0x39 - beq _081B999C - adds r4, 0x1 - cmp r4, 0x3 - bls _081B996A -_081B997E: - adds r6, 0x1 -_081B9980: - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bcc _081B9958 - mov r0, r8 - bl sub_80D23A8 - cmp r0, 0x1 - beq _081B999C - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] -_081B999C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9918 - - thumb_func_start sub_81B99B4 -sub_81B99B4: @ 81B99B4 - push {lr} - ldr r1, =gUnknown_086160B4 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B99B4 - - thumb_func_start sub_81B99D4 -sub_81B99D4: @ 81B99D4 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r2, 0 - strb r2, [r0] - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B99D4 - - thumb_func_start sub_81B9A28 -sub_81B9A28: @ 81B9A28 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e6a - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81B9A28 - - thumb_func_start sub_81B9A44 -sub_81B9A44: @ 81B9A44 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000e6a - adds r0, r2 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81B9A44 - - thumb_func_start sub_81B9A60 -sub_81B9A60: @ 81B9A60 - push {r4,lr} - ldr r4, =gUnknown_02038BCA - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xFF - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsrs r1, 6 - strh r1, [r4] - ldrh r0, [r4] - movs r1, 0 - bl sub_8162614 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9A60 - - thumb_func_start sub_81B9A90 -sub_81B9A90: @ 81B9A90 - push {lr} - ldr r3, =gUnknown_02038BCA - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _081B9AAC - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString -_081B9AAC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9A90 - - thumb_func_start sub_81B9ABC -sub_81B9ABC: @ 81B9ABC - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9ABC - - thumb_func_start sub_81B9B00 -sub_81B9B00: @ 81B9B00 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r5, =gUnknown_086160D4 - bl Random - ldrh r0, [r5] - ldr r1, =0x00000e6a - adds r4, r1 - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9B00 - - thumb_func_start sub_81B9B28 -sub_81B9B28: @ 81B9B28 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000e6a - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081B9B70 - ldr r0, [r4] - ldr r1, =0x00000e6a - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000e6a - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081B9B76 - .pool -_081B9B70: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081B9B76: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9B28 - - thumb_func_start sub_81B9B80 -sub_81B9B80: @ 81B9B80 - push {lr} - ldr r1, =gUnknown_086160D8 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9B80 - - thumb_func_start sub_81B9BA0 -sub_81B9BA0: @ 81B9BA0 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r2, 0 - strb r2, [r0] - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9BA0 - - thumb_func_start sub_81B9BF4 -sub_81B9BF4: @ 81B9BF4 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e6c - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81B9BF4 - - thumb_func_start sub_81B9C10 -sub_81B9C10: @ 81B9C10 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000e6c - adds r0, r2 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81B9C10 - - thumb_func_start sub_81B9C2C -sub_81B9C2C: @ 81B9C2C - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9C2C - - thumb_func_start sub_81B9C70 -sub_81B9C70: @ 81B9C70 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r5, =gUnknown_086160F4 - bl Random - ldrh r0, [r5] - ldr r1, =0x00000e6c - adds r4, r1 - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9C70 - - thumb_func_start sub_81B9C98 -sub_81B9C98: @ 81B9C98 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000e6c - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081B9CE0 - ldr r0, [r4] - ldr r1, =0x00000e6c - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000e6c - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081B9CE6 - .pool -_081B9CE0: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081B9CE6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9C98 - - thumb_func_start sub_81B9CF0 -sub_81B9CF0: @ 81B9CF0 - push {lr} - ldr r0, =gStringVar1 - ldr r1, =gUnknown_02038BCA - ldrh r1, [r1] - bl sub_8162E20 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9CF0 - - thumb_func_start sub_81B9D08 -sub_81B9D08: @ 81B9D08 - push {lr} - ldr r1, =gUnknown_086160F8 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9D08 - - thumb_func_start sub_81B9D28 -sub_81B9D28: @ 81B9D28 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r2, 0 - strb r2, [r0] - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9D28 - - thumb_func_start sub_81B9D7C -sub_81B9D7C: @ 81B9D7C - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e6e - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81B9D7C - - thumb_func_start sub_81B9D98 -sub_81B9D98: @ 81B9D98 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000e6e - adds r0, r2 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81B9D98 - - thumb_func_start sub_81B9DB4 -sub_81B9DB4: @ 81B9DB4 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9DB4 - - thumb_func_start sub_81B9DF8 -sub_81B9DF8: @ 81B9DF8 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r5, =gUnknown_08616120 - bl Random - ldrh r0, [r5] - ldr r1, =0x00000e6e - adds r4, r1 - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9DF8 - - thumb_func_start sub_81B9E20 -sub_81B9E20: @ 81B9E20 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000e6e - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081B9E68 - ldr r0, [r4] - ldr r1, =0x00000e6e - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000e6e - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081B9E6E - .pool -_081B9E68: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081B9E6E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9E20 - - thumb_func_start sub_81B9E78 -sub_81B9E78: @ 81B9E78 - push {lr} - bl ZeroPlayerPartyMons - bl sub_819A4F8 - pop {r0} - bx r0 - thumb_func_end sub_81B9E78 - - thumb_func_start sub_81B9E88 -sub_81B9E88: @ 81B9E88 - push {lr} - bl sub_819DC00 - pop {r0} - bx r0 - thumb_func_end sub_81B9E88 - - thumb_func_start sub_81B9E94 -sub_81B9E94: @ 81B9E94 - push {lr} - movs r2, 0 - ldr r1, =gMapHeader - ldrb r0, [r1, 0x14] - cmp r0, 0x8 - bne _081B9EB2 - ldr r3, =0xfffffe7f - adds r0, r3, 0 - ldrh r1, [r1, 0x12] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _081B9EB2 - movs r2, 0x1 -_081B9EB2: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B9E94 - - thumb_func_start sub_81B9EC0 -sub_81B9EC0: @ 81B9EC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x3C - ldr r1, =gUnknown_0203BC88 - ldr r0, =gSlateportBattleTentTrainers - str r0, [r1] - add r0, sp, 0xC - mov r9, r0 - mov r1, sp - adds r1, 0x18 - str r1, [sp, 0x2C] - ldr r5, =gUnknown_0203BC8C - ldr r4, =gSlateportBattleTentMons - movs r2, 0 - adds r3, r1, 0 - mov r1, r9 - mov r0, sp - movs r6, 0x5 - mov r8, r6 -_081B9EEC: - strh r2, [r0] - strh r2, [r1] - strh r2, [r3] - adds r3, 0x2 - adds r1, 0x2 - adds r0, 0x2 - movs r7, 0x1 - negs r7, r7 - add r8, r7 - mov r6, r8 - cmp r6, 0 - bge _081B9EEC - str r4, [r5] - movs r7, 0 - mov r10, r7 - movs r0, 0 - mov r8, r0 - ldr r1, [sp, 0x2C] - str r1, [sp, 0x30] - mov r2, sp - str r2, [sp, 0x34] - lsls r6, r0, 1 - str r6, [sp, 0x24] - add r6, r9 - str r6, [sp, 0x28] -_081B9F1E: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x46 - bl __umodsi3 - lsls r0, 16 - lsrs r5, r0, 16 - movs r2, 0 - mov r7, r8 - adds r6, r2, r7 - cmp r2, r6 - bge _081B9F7C - ldr r1, [sp, 0x28] - ldrh r0, [r1] - cmp r0, r5 - beq _081B9F7C - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - lsls r0, r5, 4 - adds r4, r0, r1 - ldrh r7, [r4] - mov r12, r7 - lsls r3, r2, 1 - ldr r1, [sp, 0x24] - add r1, sp - str r6, [sp, 0x38] -_081B9F56: - ldrh r0, [r1] - cmp r0, r12 - bne _081B9F66 - mov r0, r10 - cmp r0, 0 - bne _081B9F7C - ldrh r7, [r4] - mov r10, r7 -_081B9F66: - adds r3, 0x2 - adds r1, 0x2 - adds r2, 0x1 - ldr r0, [sp, 0x38] - cmp r2, r0 - bge _081B9F7C - mov r7, r9 - adds r0, r7, r3 - ldrh r0, [r0] - cmp r0, r5 - bne _081B9F56 -_081B9F7C: - cmp r2, r6 - bne _081BA01C - movs r2, 0 - cmp r2, r6 - bge _081B9FD4 - ldr r0, =gBattleFrontierHeldItems - mov r12, r0 - ldr r7, =gUnknown_0203BC8C - ldr r1, [sp, 0x24] - ldr r0, [sp, 0x2C] - adds r4, r1, r0 -_081B9F92: - ldrh r3, [r4] - cmp r3, 0 - beq _081B9FCC - ldr r1, [r7] - lsls r0, r5, 4 - adds r1, r0, r1 - ldrb r0, [r1, 0xA] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - cmp r3, r0 - bne _081B9FCC - ldrh r0, [r1] - cmp r0, r10 - bne _081B9FD4 - movs r1, 0 - mov r10, r1 - b _081B9FD4 - .pool -_081B9FCC: - adds r4, 0x2 - adds r2, 0x1 - cmp r2, r6 - blt _081B9F92 -_081B9FD4: - cmp r2, r6 - bne _081BA01C - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r2, r8 - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r1, r0 - movs r6, 0xE7 - lsls r6, 4 - adds r1, r6 - strh r5, [r1] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, r5, 4 - adds r1, r0 - ldrh r0, [r1] - ldr r7, [sp, 0x34] - strh r0, [r7] - ldr r2, =gBattleFrontierHeldItems - ldrb r0, [r1, 0xA] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - ldr r1, [sp, 0x30] - strh r0, [r1] - add r3, r9 - strh r5, [r3] - adds r1, 0x2 - str r1, [sp, 0x30] - adds r2, r7, 0 - adds r2, 0x2 - str r2, [sp, 0x34] - movs r6, 0x1 - add r8, r6 -_081BA01C: - mov r7, r8 - cmp r7, 0x6 - beq _081BA024 - b _081B9F1E -_081BA024: - add sp, 0x3C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9EC0 - - thumb_func_start sub_81BA040 -sub_81BA040: @ 81BA040 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - movs r0, 0 - mov r10, r0 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gSlateportBattleTentTrainers - str r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons - str r0, [r1] - ldr r7, =gSaveBlock2Ptr - ldr r1, =0x0000ffff - mov r8, r1 -_081BA062: - mov r2, r10 - lsls r6, r2, 1 -_081BA066: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1E - bl __umodsi3 - lsls r0, 16 - lsrs r3, r0, 16 - movs r5, 0 - ldr r1, [r7] - ldr r4, =0x00000cb2 - adds r0, r1, r4 - ldrh r0, [r0] - cmp r5, r0 - bge _081BA0AA - ldr r2, =0x00000cb4 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, r3 - beq _081BA0AA - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r1, r4 - ldrh r2, [r0] - adds r4, 0x2 - adds r1, r4 -_081BA09C: - adds r1, 0x2 - adds r5, 0x1 - cmp r5, r2 - bge _081BA0AA - ldrh r0, [r1] - cmp r0, r3 - bne _081BA09C -_081BA0AA: - ldr r0, [r7] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - bne _081BA066 - ldr r2, =gUnknown_02038BCA - strh r3, [r2] - ldrh r3, [r2] - ldr r4, =gUnknown_0203BC88 - ldr r1, [r4] - movs r0, 0x34 - muls r0, r3 - adds r0, r1 - ldr r0, [r0, 0x30] - adds r1, r6, r0 - ldrh r0, [r1] - cmp r0, r8 - beq _081BA0DE - ldr r3, =0x0000ffff -_081BA0D2: - adds r1, 0x2 - movs r6, 0x1 - add r10, r6 - ldrh r0, [r1] - cmp r0, r3 - bne _081BA0D2 -_081BA0DE: - mov r0, r10 - cmp r0, 0x8 - bgt _081BA110 - movs r1, 0 - mov r10, r1 - b _081BA062 - .pool -_081BA110: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r6, =0x00000cb2 - adds r3, r1, r6 - ldrh r0, [r3] - cmp r0, 0x1 - bhi _081BA12A - lsls r0, 1 - ldr r3, =0x00000cb4 - adds r1, r3 - adds r1, r0 - ldrh r0, [r2] - strh r0, [r1] -_081BA12A: - ldrh r1, [r2] - ldr r2, [r4] - movs r0, 0x34 - muls r0, r1 - adds r0, r2 - ldr r0, [r0, 0x30] - mov r9, r0 - movs r5, 0 - ldr r7, =gUnknown_03001298 - mov r8, sp -_081BA13E: - bl Random - lsls r0, 16 - lsrs r0, 16 - mov r1, r10 - bl __modsi3 - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - strh r0, [r7] - movs r2, 0 - ldrh r0, [r7] - ldr r4, =gUnknown_0203BC8C - ldr r3, [r4] - lsls r0, 4 - adds r0, r3 - ldr r1, =gSaveBlock2Ptr - ldrh r6, [r0] - ldr r1, [r1] -_081BA166: - movs r4, 0xE7 - lsls r4, 4 - adds r0, r1, r4 - ldrh r0, [r0] - lsls r0, 4 - adds r0, r3 - ldrh r0, [r0] - cmp r6, r0 - beq _081BA180 - adds r1, 0xC - adds r2, 0x1 - cmp r2, 0x5 - ble _081BA166 -_081BA180: - cmp r2, 0x6 - bne _081BA220 - movs r4, 0 - cmp r4, r5 - bge _081BA1B0 - mov r0, sp - ldrh r0, [r0] - cmp r0, r6 - beq _081BA1B0 - ldr r6, =gUnknown_03001298 - ldr r3, =gUnknown_0203BC8C - mov r2, sp -_081BA198: - adds r2, 0x2 - adds r4, 0x1 - cmp r4, r5 - bge _081BA1B0 - ldrh r0, [r6] - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - ldrh r1, [r2] - ldrh r0, [r0] - cmp r1, r0 - bne _081BA198 -_081BA1B0: - cmp r4, r5 - bne _081BA220 - movs r4, 0 - cmp r4, r5 - bge _081BA1E6 - ldr r6, =gBattleFrontierHeldItems - mov r12, r6 - add r3, sp, 0x8 -_081BA1C0: - ldrh r2, [r3] - cmp r2, 0 - beq _081BA1DE - ldr r1, =gUnknown_03001298 - ldrh r0, [r1] - ldr r6, =gUnknown_0203BC8C - ldr r1, [r6] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0xA] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - cmp r2, r0 - beq _081BA1E6 -_081BA1DE: - adds r3, 0x2 - adds r4, 0x1 - cmp r4, r5 - blt _081BA1C0 -_081BA1E6: - cmp r4, r5 - bne _081BA220 - lsls r2, r5, 1 - ldrh r0, [r7] - ldr r1, =gUnknown_0203BC8C - ldr r4, [r1] - lsls r0, 4 - adds r0, r4 - ldrh r0, [r0] - mov r3, r8 - strh r0, [r3] - add r1, sp, 0x8 - adds r1, r2 - ldr r3, =gBattleFrontierHeldItems - ldrh r0, [r7] - lsls r0, 4 - adds r0, r4 - ldrb r0, [r0, 0xA] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r1] - ldr r0, =gUnknown_03006298 - adds r2, r0 - ldrh r0, [r7] - strh r0, [r2] - movs r4, 0x2 - add r8, r4 - adds r5, 0x1 -_081BA220: - cmp r5, 0x3 - bne _081BA13E - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BA040 - - thumb_func_start Font6Func -@ int Font6Func(struct TextPrinter *x) -Font6Func: @ 81BA250 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r6, 0 - adds r4, 0x14 - ldrb r0, [r6, 0x1C] - cmp r0, 0x6 - bls _081BA260 - b _081BA660 -_081BA260: - lsls r0, 2 - ldr r1, =_081BA270 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BA270: - .4byte _081BA28C - .4byte _081BA554 - .4byte _081BA566 - .4byte _081BA590 - .4byte _081BA5C8 - .4byte _081BA63C - .4byte _081BA64E -_081BA28C: - ldr r2, =gMain - ldrh r1, [r2, 0x2C] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081BA2A6 - ldrb r1, [r4] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081BA2A6 - movs r0, 0 - strb r0, [r6, 0x1E] -_081BA2A6: - ldrb r1, [r6, 0x1E] - cmp r1, 0 - beq _081BA2E8 - ldrb r0, [r6, 0x1D] - cmp r0, 0 - beq _081BA2E8 - subs r0, r1, 0x1 - strb r0, [r6, 0x1E] - ldr r0, =gTextFlags - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081BA2C4 - b _081BA50E -_081BA2C4: - ldrh r1, [r2, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081BA2D0 - b _081BA50E -_081BA2D0: - ldrb r0, [r4] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r4] - movs r0, 0 - strb r0, [r6, 0x1E] - b _081BA50E - .pool -_081BA2E8: - ldr r2, =gTextFlags - ldrb r1, [r2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081BA2FC - movs r0, 0x3 - b _081BA2FE - .pool -_081BA2FC: - ldrb r0, [r6, 0x1D] -_081BA2FE: - strb r0, [r6, 0x1E] - ldr r0, [r6] - ldrb r3, [r0] - adds r0, 0x1 - str r0, [r6] - adds r0, r3, 0 - subs r0, 0xF8 - cmp r0, 0x7 - bls _081BA312 - b _081BA52E -_081BA312: - lsls r0, 2 - ldr r1, =_081BA320 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BA320: - .4byte _081BA524 - .4byte _081BA512 - .4byte _081BA504 - .4byte _081BA500 - .4byte _081BA36E - .4byte _081BA368 - .4byte _081BA340 - .4byte _081BA660 -_081BA340: - ldrb r0, [r6, 0x6] - strb r0, [r6, 0x8] - ldrb r1, [r6, 0x5] - ldr r0, =gFonts - ldr r2, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r6, 0xB] - ldrb r0, [r0, 0x5] - adds r1, r0 - ldrb r0, [r6, 0x9] - adds r0, r1 - strb r0, [r6, 0x9] -_081BA35E: - movs r0, 0x2 - b _081BA662 - .pool -_081BA368: - ldr r0, [r6] - adds r0, 0x1 - b _081BA4C4 -_081BA36E: - ldr r0, [r6] - ldrb r3, [r0] - adds r0, 0x1 - str r0, [r6] - subs r0, r3, 0x1 - cmp r0, 0xF - bls _081BA37E - b _081BA52E -_081BA37E: - lsls r0, 2 - ldr r1, =_081BA38C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BA38C: - .4byte _081BA3CC - .4byte _081BA3EE - .4byte _081BA412 - .4byte _081BA42C - .4byte _081BA478 - .4byte _081BA47E - .4byte _081BA35E - .4byte _081BA498 - .4byte _081BA4A8 - .4byte _081BA4BC - .4byte _081BA4C0 - .4byte _081BA4C8 - .4byte _081BA4D2 - .4byte _081BA4DE - .4byte _081BA4EE - .4byte _081BA4C0 -_081BA3CC: - ldr r2, [r6] - ldrb r1, [r2] - lsls r1, 4 - ldrb r3, [r6, 0xC] - movs r0, 0xF - ands r0, r3 - orrs r0, r1 - strb r0, [r6, 0xC] - adds r2, 0x1 - str r2, [r6] - lsls r0, 24 - lsrs r0, 28 - ldrb r2, [r6, 0xD] - lsls r1, r2, 28 - lsrs r1, 28 - lsrs r2, 4 - b _081BA472 -_081BA3EE: - ldr r1, [r6] - ldrb r2, [r1] - movs r0, 0xF - ands r0, r2 - ldrb r3, [r6, 0xD] - movs r2, 0x10 - negs r2, r2 - ands r2, r3 - orrs r2, r0 - strb r2, [r6, 0xD] - adds r1, 0x1 - str r1, [r6] - ldrb r0, [r6, 0xC] - lsrs r0, 4 - lsls r1, r2, 28 - lsrs r1, 28 - lsrs r2, 4 - b _081BA472 -_081BA412: - ldr r1, [r6] - ldrb r0, [r1] - lsls r0, 4 - ldrb r3, [r6, 0xD] - movs r2, 0xF - ands r2, r3 - orrs r2, r0 - strb r2, [r6, 0xD] - adds r1, 0x1 - str r1, [r6] - ldrb r0, [r6, 0xC] - lsrs r0, 4 - b _081BA46A -_081BA42C: - ldr r3, [r6] - ldrb r1, [r3] - lsls r1, 4 - ldrb r4, [r6, 0xC] - movs r2, 0xF - adds r0, r2, 0 - ands r0, r4 - orrs r0, r1 - strb r0, [r6, 0xC] - adds r5, r3, 0x1 - str r5, [r6] - ldrb r3, [r3, 0x1] - adds r1, r2, 0 - ands r1, r3 - ldrb r4, [r6, 0xD] - movs r3, 0x10 - negs r3, r3 - ands r3, r4 - orrs r3, r1 - strb r3, [r6, 0xD] - adds r4, r5, 0x1 - str r4, [r6] - ldrb r1, [r5, 0x1] - lsls r1, 4 - ands r2, r3 - orrs r2, r1 - strb r2, [r6, 0xD] - adds r4, 0x1 - str r4, [r6] - lsls r0, 24 - lsrs r0, 28 -_081BA46A: - lsls r1, r2, 28 - lsrs r1, 28 - lsls r2, 24 - lsrs r2, 28 -_081BA472: - bl GenerateFontHalfRowLookupTable - b _081BA35E -_081BA478: - ldr r0, [r6] - adds r0, 0x1 - b _081BA4C4 -_081BA47E: - ldr r0, [r6] - ldrb r0, [r0] - movs r1, 0xF - ands r1, r0 - ldrb r2, [r4] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4] - ldr r0, [r6] - adds r0, 0x1 - b _081BA4C4 -_081BA498: - ldr r0, [r6] - ldrb r1, [r0] - strb r1, [r6, 0x1E] - adds r0, 0x1 - str r0, [r6] - movs r0, 0x6 - strb r0, [r6, 0x1C] - b _081BA35E -_081BA4A8: - movs r0, 0x1 - strb r0, [r6, 0x1C] - ldrb r1, [r2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081BA50E - movs r0, 0 - strb r0, [r4, 0x2] - b _081BA50E -_081BA4BC: - movs r0, 0x5 - b _081BA64A -_081BA4C0: - ldr r0, [r6] - adds r0, 0x2 -_081BA4C4: - str r0, [r6] - b _081BA35E -_081BA4C8: - ldr r1, [r6] - adds r0, r1, 0x1 - str r0, [r6] - ldrb r3, [r1, 0x1] - b _081BA52E -_081BA4D2: - ldr r1, [r6] - ldrb r0, [r1] - ldrb r2, [r6, 0x6] - adds r0, r2 - strb r0, [r6, 0x8] - b _081BA4E8 -_081BA4DE: - ldr r1, [r6] - ldrb r0, [r1] - ldrb r2, [r6, 0x7] - adds r0, r2 - strb r0, [r6, 0x9] -_081BA4E8: - adds r1, 0x1 - str r1, [r6] - b _081BA35E -_081BA4EE: - ldrb r0, [r6, 0x4] - ldrb r2, [r6, 0xD] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - bl FillWindowPixelBuffer - b _081BA35E -_081BA500: - movs r0, 0x2 - b _081BA506 -_081BA504: - movs r0, 0x3 -_081BA506: - strb r0, [r6, 0x1C] - adds r0, r6, 0 - bl TextPrinterInitDownArrowCounters -_081BA50E: - movs r0, 0x3 - b _081BA662 -_081BA512: - ldr r0, [r6] - ldrb r3, [r0] - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - orrs r3, r1 - adds r0, 0x1 - str r0, [r6] - b _081BA52E -_081BA524: - ldr r0, [r6] - adds r0, 0x1 - str r0, [r6] - movs r0, 0 - b _081BA662 -_081BA52E: - adds r0, r3, 0 - bl DecompressGlyphFont6 - adds r0, r6, 0 - bl CopyGlyphToWindow - ldr r0, =gUnknown_03002F90 - adds r0, 0x80 - ldrb r1, [r6, 0xA] - ldrb r0, [r0] - adds r1, r0 - ldrb r0, [r6, 0x8] - adds r0, r1 - strb r0, [r6, 0x8] - movs r0, 0 - b _081BA662 - .pool -_081BA554: - adds r0, r6, 0 - bl TextPrinterWait - lsls r0, 16 - cmp r0, 0 - beq _081BA50E - movs r0, 0 - strb r0, [r6, 0x1C] - b _081BA50E -_081BA566: - adds r0, r6, 0 - bl TextPrinterWaitWithDownArrow - lsls r0, 16 - cmp r0, 0 - beq _081BA50E - ldrb r0, [r6, 0x4] - ldrb r2, [r6, 0xD] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - bl FillWindowPixelBuffer - ldrb r0, [r6, 0x6] - movs r1, 0 - strb r0, [r6, 0x8] - ldrb r0, [r6, 0x7] - strb r0, [r6, 0x9] - strb r1, [r6, 0x1C] - b _081BA50E -_081BA590: - adds r0, r6, 0 - bl TextPrinterWaitWithDownArrow - lsls r0, 16 - cmp r0, 0 - beq _081BA50E - adds r0, r6, 0 - bl TextPrinterClearDownArrow - ldrb r1, [r6, 0x5] - ldr r0, =gFonts - ldr r2, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r6, 0xB] - ldrb r0, [r0, 0x5] - adds r1, r0 - strb r1, [r6, 0x1F] - ldrb r0, [r6, 0x6] - strb r0, [r6, 0x8] - movs r0, 0x4 - strb r0, [r6, 0x1C] - b _081BA50E - .pool -_081BA5C8: - ldrb r2, [r6, 0x1F] - cmp r2, 0 - beq _081BA638 - ldr r4, =gUnknown_08616124 - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldrb r0, [r0, 0x14] - lsls r1, r0, 29 - lsrs r0, r1, 29 - adds r0, r4 - ldrb r0, [r0] - cmp r2, r0 - bcs _081BA604 - ldrb r0, [r6, 0x4] - ldrb r1, [r6, 0xD] - lsls r1, 28 - lsrs r3, r1, 4 - orrs r3, r1 - lsrs r3, 24 - movs r1, 0 - bl ScrollWindow - movs r0, 0 - strb r0, [r6, 0x1F] - b _081BA62E - .pool -_081BA604: - ldrb r0, [r6, 0x4] - lsrs r1, 29 - adds r1, r4 - ldrb r2, [r1] - ldrb r1, [r6, 0xD] - lsls r1, 28 - lsrs r3, r1, 4 - orrs r3, r1 - lsrs r3, 24 - movs r1, 0 - bl ScrollWindow - ldr r0, [r5] - ldrb r0, [r0, 0x14] - lsls r0, 29 - lsrs r0, 29 - adds r0, r4 - ldrb r1, [r6, 0x1F] - ldrb r0, [r0] - subs r1, r0 - strb r1, [r6, 0x1F] -_081BA62E: - ldrb r0, [r6, 0x4] - movs r1, 0x2 - bl CopyWindowToVram - b _081BA50E -_081BA638: - strb r2, [r6, 0x1C] - b _081BA50E -_081BA63C: - bl IsSEPlaying - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081BA64A - b _081BA50E -_081BA64A: - strb r0, [r6, 0x1C] - b _081BA50E -_081BA64E: - ldrb r0, [r6, 0x1E] - adds r1, r0, 0 - cmp r1, 0 - beq _081BA65C - subs r0, 0x1 - strb r0, [r6, 0x1E] - b _081BA50E -_081BA65C: - strb r1, [r6, 0x1C] - b _081BA50E -_081BA660: - movs r0, 0x1 -_081BA662: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end Font6Func - - thumb_func_start DecompressGlyphFont6 -DecompressGlyphFont6: @ 81BA668 - push {r4,r5,lr} - lsls r0, 16 - lsrs r2, r0, 19 - lsls r2, 9 - movs r1, 0xE0 - lsls r1, 11 - ands r1, r0 - lsrs r1, 11 - ldr r0, =gFont6BrailleGlyphs - adds r1, r0 - adds r5, r2, r1 - ldr r4, =gUnknown_03002F90 - adds r0, r5, 0 - adds r1, r4, 0 - bl DecompressGlyphTile - adds r0, r5, 0 - adds r0, 0x10 - adds r1, r4, 0 - adds r1, 0x20 - bl DecompressGlyphTile - movs r1, 0x80 - lsls r1, 1 - adds r0, r5, r1 - adds r1, r4, 0 - adds r1, 0x40 - bl DecompressGlyphTile - movs r1, 0x88 - lsls r1, 1 - adds r0, r5, r1 - adds r1, r4, 0 - adds r1, 0x60 - bl DecompressGlyphTile - adds r0, r4, 0 - adds r0, 0x80 - movs r1, 0x10 - strb r1, [r0] - adds r0, 0x1 - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DecompressGlyphFont6 - - thumb_func_start GetGlyphWidthFont6 -GetGlyphWidthFont6: @ 81BA6CC - movs r0, 0x10 - bx lr - thumb_func_end GetGlyphWidthFont6 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_818E9AC.s b/asm/rom_818E9AC.s new file mode 100644 index 000000000..8363e1308 --- /dev/null +++ b/asm/rom_818E9AC.s @@ -0,0 +1,83686 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_818E9AC +sub_818E9AC: @ 818E9AC + push {lr} + ldr r1, =gUnknown_0860D090 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E9AC + + thumb_func_start sub_818E9CC +sub_818E9CC: @ 818E9CC + push {r4-r7,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r4] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r6, 0 + strb r6, [r0] + ldr r1, [r4] + adds r2, 0xA + adds r0, r1, r2 + strh r6, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, [r4] + ldr r0, =0x00000cdc + adds r3, r4, r0 + ldr r2, =gUnknown_0860D0EC + lsls r1, r5, 2 + lsls r0, r7, 3 + adds r1, r0 + adds r1, r2 + ldr r0, [r3] + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _0818EA3E + lsls r0, r5, 1 + lsls r1, r7, 2 + adds r0, r1 + ldr r2, =0x00000d0c + adds r1, r4, r2 + adds r1, r0 + strh r6, [r1] +_0818EA3E: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r0, =gTrainerBattleOpponent_A + strh r6, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E9CC + + thumb_func_start sub_818EA84 +sub_818EA84: @ 818EA84 + push {r4-r6,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x9 + bls _0818EAA8 + b _0818ED10 +_0818EAA8: + lsls r0, 2 + ldr r1, =_0818EAC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0818EAC8: + .4byte _0818EAF0 + .4byte _0818EB14 + .4byte _0818EB48 + .4byte _0818EB64 + .4byte _0818EB80 + .4byte _0818EB98 + .4byte _0818EBB4 + .4byte _0818EC40 + .4byte _0818ECD0 + .4byte _0818ECF4 +_0818EAF0: + ldr r3, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r5, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000d0c + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] + b _0818ED10 + .pool +_0818EB14: + ldr r4, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r3, =0x00000cdc + adds r2, r3 + ldr r3, =gUnknown_0860D0EC + lsls r0, r5, 2 + lsls r1, r6, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] + b _0818ED10 + .pool +_0818EB48: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 31 + b _0818ECBE + .pool +_0818EB64: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 30 + b _0818ECBE + .pool +_0818EB80: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + b _0818ECBA + .pool +_0818EB98: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 28 + b _0818ECBE + .pool +_0818EBB4: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0818EC04 + cmp r5, 0 + beq _0818EBE8 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 26 + b _0818ECBE + .pool +_0818EBE8: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 27 + b _0818ECBE + .pool +_0818EC04: + cmp r5, 0 + beq _0818EC24 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + b _0818ECBE + .pool +_0818EC24: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 31 + b _0818ECBE + .pool +_0818EC40: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0818EC90 + cmp r5, 0 + beq _0818EC74 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsrs r0, 7 + strh r0, [r1] + b _0818ED10 + .pool +_0818EC74: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 25 + b _0818ECBE + .pool +_0818EC90: + cmp r5, 0 + beq _0818ECB0 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 28 + b _0818ECBE + .pool +_0818ECB0: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 +_0818ECBA: + ldrb r0, [r0] + lsls r0, 29 +_0818ECBE: + lsrs r0, 31 + strh r0, [r1] + b _0818ED10 + .pool +_0818ECD0: + bl sub_81B8558 + ldr r2, =gUnknown_0203CEF8 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xCB + lsls r1, 4 + adds r0, r1 + ldrh r1, [r0] + strb r1, [r2] + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r2, 0x1] + b _0818ED10 + .pool +_0818ECF4: + ldr r2, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r3, =0x00000d0a + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 1 + adds r3, 0x1 + adds r1, r3 + ldr r3, =0x0000fffd + adds r0, r3 + ldrb r1, [r1] + adds r0, r1 + strh r0, [r2] +_0818ED10: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818EA84 + + thumb_func_start sub_818ED28 +sub_818ED28: @ 818ED28 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x8 + bls _0818ED4C + b _0818F01E +_0818ED4C: + lsls r0, 2 + ldr r1, =_0818ED6C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0818ED6C: + .4byte _0818ED90 + .4byte _0818EDB4 + .4byte _0818EE10 + .4byte _0818EE34 + .4byte _0818EE5C + .4byte _0818EE78 + .4byte _0818EEA0 + .4byte _0818EF50 + .4byte _0818F008 +_0818ED90: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r0, r4, 1 + lsls r1, r5, 2 + adds r0, r1 + ldr r1, =0x00000d0c + adds r2, r1 + adds r2, r0 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + strh r0, [r2] + b _0818F01E + .pool +_0818EDB4: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _0818EDE8 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_0860D0EC + lsls r1, r4, 2 + lsls r0, r5, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + str r0, [r2] + b _0818F01E + .pool +_0818EDE8: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, =0x00000cdc + adds r2, r1 + ldr r3, =gUnknown_0860D0FC + lsls r1, r4, 2 + lsls r0, r5, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 + str r0, [r2] + b _0818F01E + .pool +_0818EE10: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r2, r1 + movs r1, 0x1 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x2 + negs r0, r0 + b _0818EF74 + .pool +_0818EE34: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + b _0818EFF4 + .pool +_0818EE5C: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r3, r1 + b _0818EFE8 + .pool +_0818EE78: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 + b _0818EFF4 + .pool +_0818EEA0: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _0818EF00 + cmp r4, 0 + beq _0818EEDC + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + ands r1, r0 + lsls r1, 5 + ldrb r2, [r3] + movs r0, 0x21 + negs r0, r0 + b _0818EFF4 + .pool +_0818EEDC: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + ands r1, r0 + lsls r1, 4 + ldrb r2, [r3] + movs r0, 0x11 + negs r0, r0 + b _0818EFF4 + .pool +_0818EF00: + cmp r4, 0 + beq _0818EF2C + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + b _0818EFF4 + .pool +_0818EF2C: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r2, r1 + movs r1, 0x1 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x2 + negs r0, r0 + b _0818EF74 + .pool +_0818EF50: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _0818EFB0 + cmp r4, 0 + beq _0818EF8C + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r1, [r0] + ldr r0, =0x00000d08 + adds r2, r0 + lsls r1, 7 + ldrb r3, [r2] + movs r0, 0x7F +_0818EF74: + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _0818F01E + .pool +_0818EF8C: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + ands r1, r0 + lsls r1, 6 + ldrb r2, [r3] + movs r0, 0x41 + negs r0, r0 + b _0818EFF4 + .pool +_0818EFB0: + cmp r4, 0 + beq _0818EFDC + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 + b _0818EFF4 + .pool +_0818EFDC: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 +_0818EFE8: + movs r1, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 +_0818EFF4: + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _0818F01E + .pool +_0818F008: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gUnknown_0203CEF8 + ldrb r1, [r0] + ldrb r0, [r0, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r0, 0xCB + lsls r0, 4 + adds r2, r0 + strh r1, [r2] +_0818F01E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818ED28 + + thumb_func_start sub_818F02C +sub_818F02C: @ 818F02C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x20 + bl AllocZeroed + str r0, [sp, 0x18] + movs r0, 0x18 + bl AllocZeroed + str r0, [sp, 0x1C] + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + adds r0, 0x1 + ldr r3, =0x00000d0a + adds r1, r3 + strb r0, [r1] + ldr r0, =0x000040ce + bl VarGet + ldr r1, [r4] + adds r0, 0x1 + ldr r5, =0x00000d0b + adds r1, r5 + strb r0, [r1] + ldr r2, [r4] + ldr r7, =0x00000d24 + adds r3, r2, r7 + ldrh r0, [r3] + ldr r5, =0x000003ff + adds r1, r5, 0 + orrs r0, r1 + strh r0, [r3] + ldr r3, =0x00000d25 + adds r2, r3 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x19 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + movs r7, 0 + mov r10, r7 + mov r8, r4 + ldr r0, =gBattleScripting + 0x14 + mov r9, r0 + movs r4, 0 +_0818F0BA: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00000caa + adds r0, r2 + adds r0, r4 + ldrh r0, [r0] + movs r3, 0x64 + muls r0, r3 + add r0, r9 + movs r1, 0xB + movs r2, 0 + bl GetMonData + mov r5, r8 + ldr r1, [r5] + ldr r7, =0x00000d64 + adds r1, r7 + adds r1, r4 + strh r0, [r1] + movs r5, 0 + mov r0, r10 + lsls r7, r0, 4 + adds r6, r7, 0 +_0818F0E8: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00000caa + adds r0, r2 + adds r0, r4 + ldrh r0, [r0] + movs r3, 0x64 + muls r0, r3 + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl GetMonData + mov r2, r8 + ldr r1, [r2] + ldr r3, =0x00000efc + adds r1, r3 + adds r1, r6 + strh r0, [r1] + adds r6, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0818F0E8 + movs r5, 0 + ldr r6, =gSaveBlock2Ptr +_0818F11C: + ldr r0, [r6] + ldr r1, =0x00000caa + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + movs r2, 0x64 + muls r0, r2 + add r0, r9 + adds r1, r5, 0 + adds r1, 0x1A + movs r2, 0 + bl GetMonData + ldr r1, [r6] + adds r2, r5, r7 + ldr r3, =0x00000f04 + adds r1, r3 + adds r1, r2 + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x5 + ble _0818F11C + mov r5, r8 + ldr r0, [r5] + ldr r1, =0x00000caa + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + movs r2, 0x64 + muls r0, r2 + add r0, r9 + bl GetNature + ldr r1, [r5] + adds r1, r7 + ldr r3, =0x00000f0a + adds r1, r3 + strb r0, [r1] + adds r4, 0x2 + movs r5, 0x1 + add r10, r5 + mov r7, r10 + cmp r7, 0x2 + ble _0818F0BA + mov r10, r5 + movs r0, 0x4 + str r0, [sp, 0x34] + movs r1, 0x6 + str r1, [sp, 0x38] +_0818F17E: + mov r2, r10 + cmp r2, 0x5 + ble _0818F22C +_0818F184: + bl sub_81A39C4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r5, 0x1 + cmp r5, r10 + bge _0818F1CA + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r7, =0x00000d28 + adds r0, r7 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + adds r2, r3, 0 + cmp r0, r4 + beq _0818F1CA + ldr r3, =0x00000d24 +_0818F1B2: + adds r5, 0x1 + cmp r5, r10 + bge _0818F1CA + ldr r0, [r2] + lsls r1, r5, 2 + adds r0, r1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + bne _0818F1B2 +_0818F1CA: + cmp r5, r10 + bne _0818F184 + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r1, [sp, 0x34] + adds r3, r1 + ldr r2, =0x00000d24 + adds r3, r2 + ldr r5, =0x000003ff + adds r0, r5, 0 + adds r2, r4, 0 + ands r2, r0 + ldrh r0, [r3] + ldr r7, =0xfffffc00 + adds r1, r7, 0 + b _0818F292 + .pool +_0818F22C: + bl sub_81A39C4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r5, 0x1 + cmp r5, r10 + bge _0818F274 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000d28 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + adds r2, r1, 0 + cmp r0, r4 + beq _0818F274 + ldr r3, =0x00000d24 +_0818F25C: + adds r5, 0x1 + cmp r5, r10 + bge _0818F274 + ldr r0, [r2] + lsls r1, r5, 2 + adds r0, r1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + bne _0818F25C +_0818F274: + cmp r5, r10 + bne _0818F22C + ldr r5, =gSaveBlock2Ptr + ldr r3, [r5] + ldr r7, [sp, 0x34] + adds r3, r7 + ldr r0, =0x00000d24 + adds r3, r0 + ldr r1, =0x000003ff + adds r0, r1, 0 + adds r2, r4, 0 + ands r2, r0 + ldrh r0, [r3] + ldr r5, =0xfffffc00 + adds r1, r5, 0 +_0818F292: + ands r0, r1 + orrs r0, r2 + strh r0, [r3] + movs r5, 0 + lsls r4, 16 + str r4, [sp, 0x2C] + ldr r7, [sp, 0x38] + str r7, [sp, 0x20] +_0818F2A2: + lsls r0, r5, 1 + mov r9, r0 + adds r1, r5, 0x1 + str r1, [sp, 0x24] + lsls r2, r5, 2 + str r2, [sp, 0x28] +_0818F2AE: + ldr r3, [sp, 0x2C] + lsrs r0, r3, 16 + bl sub_8163524 + lsls r0, 16 + lsrs r6, r0, 16 + movs r7, 0 + cmp r7, r5 + bge _0818F300 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, [sp, 0x8] + mov r8, r1 + ldr r2, [sp, 0xC] + mov r12, r2 + ldr r3, =0x00000d64 + adds r0, r3 + ldr r1, [sp, 0x20] + adds r4, r1, r0 +_0818F2D4: + ldrh r3, [r4] + cmp r3, r6 + beq _0818F300 + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + lsls r0, r6, 4 + adds r2, r0, r1 + ldrh r0, [r2] + cmp r8, r0 + beq _0818F300 + cmp r12, r0 + beq _0818F300 + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0, 0xA] + ldrb r2, [r2, 0xA] + cmp r0, r2 + beq _0818F300 + adds r4, 0x2 + adds r7, 0x1 + cmp r7, r5 + blt _0818F2D4 +_0818F300: + cmp r7, r5 + bne _0818F2AE + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, [sp, 0x38] + add r1, r9 + ldr r5, =0x00000d64 + adds r0, r5 + adds r0, r1 + strh r6, [r0] + ldr r2, [sp, 0x28] + add r2, sp + adds r2, 0x8 + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + lsls r0, r6, 4 + adds r0, r1 + ldrh r0, [r0] + str r0, [r2] + ldr r5, [sp, 0x24] + cmp r5, 0x2 + ble _0818F2A2 + ldr r2, [r3] + ldr r7, [sp, 0x34] + adds r2, r7 + ldr r0, =0x00000d25 + adds r2, r0 + ldrb r0, [r2] + movs r3, 0x5 + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2] + ldr r5, =gSaveBlock2Ptr + ldr r2, [r5] + adds r2, r7 + ldr r7, =0x00000d25 + adds r2, r7 + ldrb r0, [r2] + subs r3, 0x14 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r5] + ldr r5, [sp, 0x34] + adds r1, r5 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + adds r5, 0x4 + str r5, [sp, 0x34] + ldr r7, [sp, 0x38] + adds r7, 0x6 + str r7, [sp, 0x38] + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0xF + bgt _0818F37C + b _0818F17E +_0818F37C: + movs r7, 0 + ldr r2, [sp, 0x18] + strh r7, [r2] + movs r3, 0 + mov r10, r3 + ldr r6, =gBitTable + ldr r5, =gBaseStats +_0818F38A: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + mov r2, r10 + lsls r1, r2, 1 + ldr r3, =0x00000caa + adds r0, r3 + adds r0, r1 + ldrh r0, [r0] + subs r4, r0, 0x1 + movs r0, 0x64 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x3B + movs r2, 0 + bl GetMonData + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3C + movs r2, 0 + bl GetMonData + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0x3E + movs r2, 0 + bl GetMonData + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3F + movs r2, 0 + bl GetMonData + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0x3D + movs r2, 0 + bl GetMonData + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x6] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + orrs r7, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x7] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + orrs r7, r0 + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0x2 + ble _0818F38A + movs r4, 0 + movs r1, 0x1 + movs r5, 0x1F +_0818F458: + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0818F462 + adds r4, 0x1 +_0818F462: + asrs r7, 1 + subs r5, 0x1 + cmp r5, 0 + bge _0818F458 + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + adds r2, r0, 0 + adds r0, r4, 0 + muls r0, r2 + movs r1, 0x14 + bl __divsi3 + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + movs r5, 0x1 + mov r10, r5 + adds r6, r3, 0 + adds r6, 0x2 + movs r7, 0x2 + str r7, [sp, 0x30] +_0818F494: + movs r7, 0 + strh r7, [r6] + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + mov r2, r10 + lsls r1, r2, 2 + adds r0, r1 + ldr r3, =0x00000d24 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + bl sub_8190168 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r0, [sp, 0x30] + mov r9, r0 +_0818F4BC: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + mov r4, r9 + add r4, r10 + adds r4, r5 + lsls r4, 1 + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r4 + ldrh r1, [r0] + ldr r3, =gUnknown_0203BC8C + ldr r0, [r3] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] + ldrb r3, [r1, 0xB] + ldrb r1, [r1, 0xC] + str r1, [sp] + ldr r1, [sp, 0x1C] + str r1, [sp, 0x4] + ldr r1, [sp, 0x14] + mov r2, r8 + bl sub_818F720 + ldr r2, [sp, 0x1C] + ldr r1, [r2, 0x4] + ldrh r0, [r6] + adds r0, r1 + ldr r1, [r2, 0x8] + adds r0, r1 + ldr r1, [r2, 0x10] + adds r0, r1 + ldr r1, [r2, 0x14] + adds r0, r1 + ldr r1, [r2, 0xC] + adds r0, r1 + ldr r1, [r2] + adds r0, r1 + strh r0, [r6] + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, =0x00000d64 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r3, =gBaseStats + adds r1, r3 + ldrb r0, [r1, 0x6] + lsls r0, 2 + ldr r2, =gBitTable + adds r0, r2 + ldr r0, [r0] + orrs r7, r0 + ldrb r0, [r1, 0x7] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + orrs r7, r0 + adds r5, 0x1 + cmp r5, 0x2 + ble _0818F4BC + movs r4, 0 + movs r1, 0x1 + movs r5, 0x1F +_0818F54C: + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0818F556 + adds r4, 0x1 +_0818F556: + asrs r7, 1 + subs r5, 0x1 + cmp r5, 0 + bge _0818F54C + ldr r3, [sp, 0x14] + adds r0, r4, 0 + muls r0, r3 + movs r1, 0x14 + bl __divsi3 + ldrh r1, [r6] + adds r1, r0 + strh r1, [r6] + adds r6, 0x2 + ldr r5, [sp, 0x30] + adds r5, 0x2 + str r5, [sp, 0x30] + movs r7, 0x1 + add r10, r7 + mov r0, r10 + cmp r0, 0xF + ble _0818F494 + movs r1, 0 + mov r10, r1 + ldr r2, =0x000003ff + mov r8, r2 +_0818F58A: + mov r5, r10 + adds r5, 0x1 + adds r7, r5, 0 + cmp r5, 0xF + bgt _0818F626 + mov r3, r10 + lsls r0, r3, 1 + ldr r1, [sp, 0x18] + adds r6, r0, r1 + lsls r0, r5, 1 + adds r4, r0, r1 +_0818F5A0: + ldrh r1, [r6] + ldrh r0, [r4] + cmp r1, r0 + bcc _0818F5C2 + cmp r1, r0 + bne _0818F61E + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r1, r0 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r2, r0, 22 + lsrs r0, r2, 22 + cmp r0, r8 + bne _0818F602 +_0818F5C2: + mov r0, r10 + adds r1, r5, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 + b _0818F600 + .pool +_0818F600: + b _0818F61E +_0818F602: + mov r3, r10 + lsls r0, r3, 2 + adds r0, r1, r0 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + cmp r0, r2 + bls _0818F61E + mov r0, r10 + adds r1, r5, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 +_0818F61E: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0xF + ble _0818F5A0 +_0818F626: + mov r10, r7 + mov r2, r10 + cmp r2, 0xE + ble _0818F58A + bl sub_81A3610 + lsls r0, 24 + cmp r0, 0 + beq _0818F6EE + movs r3, 0 + mov r10, r3 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r4, =0x00000d24 + adds r1, r4 + ldrh r1, [r1] + lsls r1, 22 + lsrs r1, 22 + ldr r3, =0x000003ff + adds r2, r0, 0 + ldr r6, =gUnknown_0860D3F1 + cmp r1, r3 + beq _0818F674 + adds r5, r2, 0 +_0818F656: + movs r7, 0x1 + add r10, r7 + mov r0, r10 + cmp r0, 0xF + bgt _0818F674 + ldr r0, [r5] + mov r7, r10 + lsls r1, r7, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + bne _0818F656 +_0818F674: + mov r1, r10 + lsls r0, r1, 1 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _0818F6AC + movs r5, 0 + ldr r2, [r2] + ldr r3, =0x00000d24 + adds r2, r3 + ldrh r1, [r2] + ldr r0, =0xfffffc00 + ands r0, r1 + ldr r7, =0x000003fe + adds r1, r7, 0 + b _0818F6BE + .pool +_0818F6AC: + movs r5, 0x1 + ldr r2, [r2] + ldr r0, =0x00000d28 + adds r2, r0 + ldrh r1, [r2] + ldr r0, =0xfffffc00 + ands r0, r1 + ldr r3, =0x000003fe + adds r1, r3, 0 +_0818F6BE: + orrs r0, r1 + strh r0, [r2] + movs r7, 0 + mov r10, r7 + lsls r0, r5, 1 + adds r0, r5 + lsls r4, r0, 1 +_0818F6CC: + mov r1, r10 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_81A4FF0 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r2, =0x00000d64 + adds r1, r2 + adds r1, r4 + strh r0, [r1] + adds r4, 0x2 + movs r3, 0x1 + add r10, r3 + mov r5, r10 + cmp r5, 0x2 + ble _0818F6CC +_0818F6EE: + ldr r0, [sp, 0x18] + bl Free + ldr r0, [sp, 0x1C] + bl Free + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F02C + + thumb_func_start sub_818F720 +sub_818F720: @ 818F720 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r7, r1, 0 + mov r9, r2 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x40] + mov r8, r2 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + movs r1, 0 + adds r4, r5, 0 + movs r3, 0x1 + movs r2, 0x5 +_0818F74C: + adds r0, r4, 0 + ands r0, r3 + cmp r0, 0 + beq _0818F756 + adds r1, 0x1 +_0818F756: + lsrs r4, 1 + subs r2, 0x1 + cmp r2, 0 + bge _0818F74C + movs r0, 0xFF + lsls r0, 1 + bl __divsi3 + lsls r0, 16 + lsrs r3, r0, 16 + lsls r0, r6, 3 + mov r10, r0 + movs r1, 0 + mov r12, r1 + mov r1, sp + movs r2, 0x5 +_0818F776: + mov r0, r12 + str r0, [r1] + adds r0, r5, 0 + ands r0, r4 + cmp r0, 0 + beq _0818F784 + str r3, [r1] +_0818F784: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r1, 0x4 + subs r2, 0x1 + cmp r2, 0 + bge _0818F776 + ldr r0, =0x0000012f + cmp r6, r0 + bne _0818F7A0 + movs r0, 0x1 + b _0818F7CA + .pool +_0818F7A0: + mov r2, r10 + subs r0, r2, r6 + lsls r0, 2 + ldr r1, =gBaseStats + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp] + cmp r0, 0 + bge _0818F7BA + adds r0, 0x3 +_0818F7BA: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r0, r7 + adds r0, 0xA +_0818F7CA: + mov r1, r8 + str r0, [r1] + mov r2, r10 + subs r0, r2, r6 + lsls r0, 2 + ldr r1, =gBaseStats + adds r4, r0, r1 + ldrb r0, [r4, 0x1] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0x4] + cmp r0, 0 + bge _0818F7E8 + adds r0, 0x3 +_0818F7E8: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0x4] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x1 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x4] + ldrb r0, [r4, 0x2] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0x8] + cmp r0, 0 + bge _0818F820 + adds r0, 0x3 +_0818F820: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0x8] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x2 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x8] + ldrb r0, [r4, 0x3] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0xC] + cmp r0, 0 + bge _0818F858 + adds r0, 0x3 +_0818F858: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0xC] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x3 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0xC] + ldrb r0, [r4, 0x4] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0x10] + cmp r0, 0 + bge _0818F890 + adds r0, 0x3 +_0818F890: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0x10] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x4 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x10] + ldrb r0, [r4, 0x5] + lsls r0, 1 + mov r1, r9 + adds r2, r0, r1 + ldr r0, [sp, 0x14] + cmp r0, 0 + bge _0818F8C8 + adds r0, 0x3 +_0818F8C8: + asrs r0, 2 + adds r0, r2, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r2, r8 + str r1, [r2, 0x14] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x5 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x14] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F720 + + thumb_func_start sub_818F904 +sub_818F904: @ 818F904 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r3, r0, 1 + mov r12, r3 + adds r4, r3, r2 + ldrh r5, [r4] + lsls r7, r1, 1 + mov r9, r7 + add r2, r9 + ldrh r3, [r2] + strh r3, [r4] + strh r5, [r2] + ldr r2, =gSaveBlock2Ptr + ldr r5, [r2] + lsls r6, r0, 2 + adds r6, r5, r6 + ldr r3, =0x00000d24 + adds r6, r3 + ldrh r7, [r6] + mov r10, r7 + mov r2, r10 + lsls r2, 22 + mov r8, r2 + lsls r2, r1, 2 + adds r5, r2 + adds r5, r3 + ldrh r4, [r5] + lsls r4, 22 + lsrs r4, 22 + ldr r3, =0xfffffc00 + adds r2, r3, 0 + mov r7, r10 + ands r2, r7 + orrs r2, r4 + strh r2, [r6] + mov r2, r8 + lsrs r2, 22 + mov r8, r2 + ldrh r2, [r5] + ands r3, r2 + mov r7, r8 + orrs r3, r7 + strh r3, [r5] + ldr r2, =gSaveBlock2Ptr + mov r8, r2 + add r12, r0 + add r9, r1 + mov r3, r9 + lsls r4, r3, 1 + mov r7, r12 + lsls r3, r7, 1 + ldr r7, =0x00000d64 + movs r6, 0x2 +_0818F974: + mov r1, r8 + ldr r0, [r1] + adds r0, r7 + adds r2, r0, r3 + ldrh r5, [r2] + adds r0, r4 + ldrh r1, [r0] + strh r1, [r2] + strh r5, [r0] + adds r4, 0x2 + adds r3, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _0818F974 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F904 + + thumb_func_start sub_818F9B0 +sub_818F9B0: @ 818F9B0 + push {lr} + ldr r0, =gStringVar1 + ldr r2, =gUnknown_085CCD20 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r1, r3 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F9B0 + + thumb_func_start sub_818F9E0 +sub_818F9E0: @ 818F9E0 + push {lr} + ldr r0, =gStringVar1 + ldr r2, =gUnknown_085CCD20 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r1, r3 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + ldr r0, =gStringVar2 + ldr r1, =gTrainerBattleOpponent_A + ldrh r1, [r1] + bl sub_8195898 + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F9E0 + + thumb_func_start sub_818FA20 +sub_818FA20: @ 818FA20 + push {r4,r5,lr} + ldr r1, =gUnknown_0203CD70 + movs r0, 0 + str r0, [r1] + ldr r4, =gPlayerParty + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + ldr r5, =gUnknown_0203CD74 + str r0, [r5] + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + ldr r1, [r5] + adds r1, r0 + str r1, [r5] + bl CalculatePlayerPartyCount + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + bl sub_8195358 + lsls r0, 16 + lsrs r0, 16 + bl sub_818FBDC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818FA20 + + thumb_func_start sub_818FA74 +sub_818FA74: @ 818FA74 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + adds r5, r2, 0 + str r3, [sp, 0x14] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x28] + lsls r5, 24 + lsrs r5, 24 + add r0, sp, 0xC + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [sp, 0x28] + bl sub_8190168 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp, 0x2C] + bl sub_8165C40 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x64 + ldr r4, [sp, 0x10] + adds r3, r4, 0 + muls r3, r0 + str r3, [sp, 0x18] + ldr r6, =gEnemyParty + adds r0, r3, r6 + ldr r7, =gSaveBlock2Ptr + ldr r4, [r7] + lsls r5, 1 + ldr r3, [sp, 0x28] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 1 + adds r1, r5, r1 + ldr r6, =0x00000d64 + adds r4, r6 + adds r4, r1 + ldrh r3, [r4] + ldr r7, =gUnknown_0203BC8C + ldr r7, [r7] + mov r8, r7 + lsls r3, 4 + add r3, r8 + ldrh r1, [r3] + ldrb r3, [r3, 0xC] + ldr r6, [sp, 0x2C] + str r6, [sp] + ldrh r4, [r4] + lsls r4, 4 + add r4, r8 + ldrb r4, [r4, 0xB] + str r4, [sp, 0x4] + ldr r7, [sp, 0x14] + str r7, [sp, 0x8] + bl sub_8068634 + add r0, sp, 0xC + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + movs r6, 0 + ldr r2, [sp, 0x18] + str r2, [sp, 0x1C] + mov r10, r5 + ldr r3, =0x00000d64 + mov r9, r3 + ldr r3, =gUnknown_0203BC8C + mov r4, r10 + str r4, [sp, 0x20] +_0818FB18: + ldr r7, =gSaveBlock2Ptr + ldr r1, [r7] + ldr r2, [sp, 0x28] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 1 + mov r8, r0 + mov r5, r10 + add r5, r8 + add r1, r9 + adds r1, r5 + ldrh r0, [r1] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + lsls r4, r6, 1 + adds r0, 0x2 + adds r0, r4 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + mov r12, r2 + ldr r7, [sp, 0x1C] + ldr r2, =gEnemyParty + adds r0, r7, r2 + mov r2, r12 + str r3, [sp, 0x24] + bl SetMonMoveSlot + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + add r0, r9 + adds r0, r5 + ldrh r0, [r0] + ldr r3, [sp, 0x24] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + adds r0, 0x2 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0xDA + bne _0818FB74 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] +_0818FB74: + adds r6, 0x1 + cmp r6, 0x3 + ble _0818FB18 + movs r0, 0x64 + ldr r1, [sp, 0x10] + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0xC + bl SetMonData + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, [sp, 0x20] + add r1, r8 + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818FA74 + + thumb_func_start sub_818FBDC +sub_818FBDC: @ 818FBDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r6, 0 + bl ZeroEnemyPartyMons + mov r0, r8 + bl sub_818FC78 + adds r5, r0, 0 + bl Random + adds r4, r0, 0 + bl Random + lsls r4, 16 + lsrs r7, r4, 16 + lsls r0, 16 + orrs r7, r0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bls _0818FC46 + movs r4, 0 +_0818FC20: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _0818FC3C + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r6, 0 + mov r1, r8 + adds r3, r7, 0 + bl sub_818FA74 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0818FC3C: + asrs r5, 1 + adds r4, 0x1 + cmp r4, 0x2 + ble _0818FC20 + b _0818FC6C +_0818FC46: + movs r4, 0x2 +_0818FC48: + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + beq _0818FC64 + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r6, 0 + mov r1, r8 + adds r3, r7, 0 + bl sub_818FA74 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0818FC64: + lsls r5, 1 + subs r4, 0x1 + cmp r4, 0 + bge _0818FC48 +_0818FC6C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_818FBDC + + thumb_func_start sub_818FC78 +sub_818FC78: @ 818FC78 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl Random + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0818FCA2 + adds r0, r4, 0 + movs r1, 0 + bl sub_818FCBC + cmp r0, 0 + bne _0818FCB6 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_818FDB8 + b _0818FCB6 +_0818FCA2: + adds r0, r5, 0 + movs r1, 0 + bl sub_818FDB8 + cmp r0, 0 + bne _0818FCB6 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_818FCBC +_0818FCB6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_818FC78 + + thumb_func_start sub_818FCBC +sub_818FCBC: @ 818FCBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + movs r0, 0 + mov r9, r0 + mov r1, r8 + lsls r1, 2 + str r1, [sp, 0x18] +_0818FCDE: + mov r2, r9 + lsls r0, r2, 2 + mov r2, sp + adds r1, r2, r0 + movs r0, 0 + str r0, [r1] + movs r7, 0 + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x14] + adds r5, r1, 0 + mov r1, r9 + lsls r1, 1 + str r1, [sp, 0x10] +_0818FCFA: + movs r6, 0 + adds r2, r7, 0x1 + mov r10, r2 +_0818FD00: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, [sp, 0x18] + adds r0, r1, r2 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r2, =0x000003fe + cmp r0, r2 + bne _0818FD3C + mov r1, r9 + lsls r0, r1, 24 + lsls r1, r7, 24 + lsrs r0, 24 + lsrs r1, 24 + bl sub_81A5060 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + b _0818FD60 + .pool +_0818FD3C: + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 1 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r2, =0x00000d64 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + lsls r1, r7, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r4, [r0] +_0818FD60: + movs r0, 0x64 + muls r0, r6 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl sub_818FFC0 + ldr r1, [r5] + adds r1, r0 + str r1, [r5] + adds r6, 0x1 + cmp r6, 0x2 + ble _0818FD00 + mov r7, r10 + cmp r7, 0x3 + ble _0818FCFA + ldr r0, [sp, 0x14] + mov r9, r0 + cmp r0, 0x2 + ble _0818FCDE + mov r0, sp + ldr r1, [sp, 0xC] + bl sub_818FEB4 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818FCBC + + thumb_func_start sub_818FDB8 +sub_818FDB8: @ 818FDB8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + movs r0, 0 + mov r9, r0 + mov r1, r8 + lsls r1, 2 + str r1, [sp, 0x18] +_0818FDDA: + mov r2, r9 + lsls r0, r2, 2 + mov r2, sp + adds r1, r2, r0 + movs r0, 0 + str r0, [r1] + movs r7, 0 + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x14] + adds r5, r1, 0 + mov r1, r9 + lsls r1, 1 + str r1, [sp, 0x10] +_0818FDF6: + movs r6, 0 + adds r2, r7, 0x1 + mov r10, r2 +_0818FDFC: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, [sp, 0x18] + adds r0, r1, r2 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r2, =0x000003fe + cmp r0, r2 + bne _0818FE38 + mov r1, r9 + lsls r0, r1, 24 + lsls r1, r7, 24 + lsrs r0, 24 + lsrs r1, 24 + bl sub_81A5060 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + b _0818FE5C + .pool +_0818FE38: + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 1 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r2, =0x00000d64 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + lsls r1, r7, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r4, [r0] +_0818FE5C: + movs r0, 0x64 + muls r0, r6 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_818FFC0 + ldr r1, [r5] + adds r1, r0 + str r1, [r5] + adds r6, 0x1 + cmp r6, 0x2 + ble _0818FDFC + mov r7, r10 + cmp r7, 0x3 + ble _0818FDF6 + ldr r0, [sp, 0x14] + mov r9, r0 + cmp r0, 0x2 + ble _0818FDDA + mov r0, sp + ldr r1, [sp, 0xC] + bl sub_818FEB4 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818FDB8 + + thumb_func_start sub_818FEB4 +sub_818FEB4: @ 818FEB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + str r0, [sp, 0xC] + movs r3, 0x2 + add r0, sp, 0x8 +_0818FECE: + str r3, [r0] + subs r0, 0x4 + subs r3, 0x1 + cmp r3, 0 + bge _0818FECE + mov r3, r10 + ldr r2, [r3] + ldr r0, [r3, 0x4] + cmp r2, r0 + bne _0818FF20 + ldr r0, [r3, 0x8] + cmp r2, r0 + bne _0818FF20 + cmp r1, 0 + beq _0818FFAA + movs r3, 0 + ldr r4, =gBitTable +_0818FEF0: + str r3, [sp, 0x14] + bl Random + movs r1, 0x3 + ands r1, r0 + ldr r3, [sp, 0x14] + cmp r1, 0x3 + beq _0818FF16 + lsls r0, r1, 2 + adds r0, r4 + ldr r1, [r0] + ldr r0, [sp, 0xC] + ands r0, r1 + cmp r0, 0 + bne _0818FF16 + ldr r0, [sp, 0xC] + orrs r0, r1 + str r0, [sp, 0xC] + adds r3, 0x1 +_0818FF16: + cmp r3, 0x2 + bne _0818FEF0 + b _0818FFAA + .pool +_0818FF20: + movs r3, 0 + mov r9, sp + mov r8, r10 +_0818FF26: + adds r2, r3, 0x1 + cmp r2, 0x2 + bgt _0818FF84 + mov r6, r8 + mov r7, r9 + lsls r0, r2, 2 + mov r1, sp + adds r5, r0, r1 + mov r1, r10 + adds r4, r0, r1 +_0818FF3A: + ldr r0, [r6] + ldr r1, [r4] + cmp r0, r1 + bge _0818FF4E + str r1, [r6] + str r0, [r4] + ldr r1, [r7] + ldr r0, [r5] + str r0, [r7] + str r1, [r5] +_0818FF4E: + ldr r1, [r6] + ldr r0, [r4] + cmp r1, r0 + bne _0818FF7A + str r2, [sp, 0x10] + str r3, [sp, 0x14] + bl Random + movs r1, 0x1 + ands r1, r0 + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x14] + cmp r1, 0 + beq _0818FF7A + ldr r1, [r6] + ldr r0, [r4] + str r0, [r6] + str r1, [r4] + ldr r1, [r7] + ldr r0, [r5] + str r0, [r7] + str r1, [r5] +_0818FF7A: + adds r5, 0x4 + adds r4, 0x4 + adds r2, 0x1 + cmp r2, 0x2 + ble _0818FF3A +_0818FF84: + movs r4, 0x4 + add r9, r4 + add r8, r4 + adds r3, 0x1 + cmp r3, 0x1 + ble _0818FF26 + ldr r2, =gBitTable + mov r1, sp + movs r3, 0x1 +_0818FF96: + ldm r1!, {r0} + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldr r4, [sp, 0xC] + orrs r4, r0 + str r4, [sp, 0xC] + subs r3, 0x1 + cmp r3, 0 + bge _0818FF96 +_0818FFAA: + ldr r0, [sp, 0xC] + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818FEB4 + + thumb_func_start sub_818FFC0 +sub_818FFC0: @ 818FFC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r3, r0, 0 + adds r4, r1, 0 + str r2, [sp] + movs r6, 0 + movs r2, 0x14 + cmp r3, 0 + beq _0818FFF0 + ldr r0, =0x0000ffff + cmp r3, r0 + beq _0818FFF0 + ldr r0, =gBattleMoves + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3, 0x1] + cmp r0, 0 + bne _0818FFFC +_0818FFF0: + movs r0, 0 + b _08190156 + .pool +_0818FFFC: + ldr r1, =gBaseStats + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x6] + mov r10, r1 + ldrb r1, [r0, 0x7] + mov r9, r1 + ldrb r0, [r0, 0x16] + mov r8, r0 + ldrb r3, [r3, 0x2] + str r3, [sp, 0x4] + cmp r0, 0x1A + bne _0819002C + cmp r3, 0x4 + bne _0819002C + ldr r0, [sp] + cmp r0, 0x1 + bne _081900AA + movs r2, 0x8 + b _081900A4 + .pool +_0819002C: + ldr r0, =gUnknown_0831ACE8 + adds r1, r6, r0 + ldrb r0, [r1] + ldr r7, =gUnknown_0831ACE8 + cmp r0, 0xFF + beq _081900A4 + adds r4, r1, 0 +_0819003A: + ldrb r0, [r4] + cmp r0, 0xFE + beq _08190096 + ldrb r0, [r4] + ldr r1, [sp, 0x4] + cmp r0, r1 + bne _08190096 + ldrb r0, [r4, 0x1] + adds r5, r6, 0x1 + cmp r0, r10 + bne _0819006C + adds r1, r6, 0x2 + mov r0, r8 + cmp r0, 0x19 + bne _0819005E + ldrb r0, [r4, 0x2] + cmp r0, 0x28 + bne _0819006C +_0819005E: + adds r0, r1, r7 + ldrb r0, [r0] + muls r0, r2 + movs r1, 0xA + bl __divsi3 + adds r2, r0, 0 +_0819006C: + adds r0, r5, r7 + ldrb r0, [r0] + cmp r0, r9 + bne _08190096 + cmp r10, r9 + beq _08190096 + adds r1, r6, 0x2 + mov r0, r8 + cmp r0, 0x19 + bne _08190088 + adds r0, r1, r7 + ldrb r0, [r0] + cmp r0, 0x28 + bne _08190096 +_08190088: + adds r0, r1, r7 + ldrb r0, [r0] + muls r0, r2 + movs r1, 0xA + bl __divsi3 + adds r2, r0, 0 +_08190096: + adds r4, 0x3 + adds r6, 0x3 + ldr r1, =gUnknown_0831ACE8 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0819003A +_081900A4: + ldr r0, [sp] + cmp r0, 0x1 + beq _081900E0 +_081900AA: + ldr r1, [sp] + cmp r1, 0x1 + bgt _081900BC + cmp r1, 0 + beq _081900C4 + b _08190154 + .pool +_081900BC: + ldr r0, [sp] + cmp r0, 0x2 + beq _08190114 + b _08190154 +_081900C4: + cmp r2, 0xA + beq _08190146 + cmp r2, 0xA + ble _08190146 + cmp r2, 0x28 + beq _0819014A + cmp r2, 0x28 + bgt _081900DA + cmp r2, 0x14 + beq _08190104 + b _08190146 +_081900DA: + cmp r2, 0x50 + bne _08190146 + b _08190100 +_081900E0: + cmp r2, 0xA + beq _08190104 + cmp r2, 0xA + bgt _081900F2 + cmp r2, 0 + beq _08190100 + cmp r2, 0x5 + beq _0819014A + b _08190146 +_081900F2: + cmp r2, 0x28 + beq _08190108 + cmp r2, 0x28 + ble _08190146 + cmp r2, 0x50 + beq _0819010E + b _08190146 +_08190100: + movs r2, 0x8 + b _08190154 +_08190104: + movs r2, 0x2 + b _08190154 +_08190108: + movs r2, 0x2 + negs r2, r2 + b _08190154 +_0819010E: + movs r2, 0x4 + negs r2, r2 + b _08190154 +_08190114: + cmp r2, 0xA + beq _08190146 + cmp r2, 0xA + bgt _08190126 + cmp r2, 0 + beq _0819013A + cmp r2, 0x5 + beq _08190140 + b _08190146 +_08190126: + cmp r2, 0x28 + beq _0819014E + cmp r2, 0x28 + bgt _08190134 + cmp r2, 0x14 + beq _0819014A + b _08190146 +_08190134: + cmp r2, 0x50 + beq _08190152 + b _08190146 +_0819013A: + movs r2, 0x10 + negs r2, r2 + b _08190154 +_08190140: + movs r2, 0x8 + negs r2, r2 + b _08190154 +_08190146: + movs r2, 0 + b _08190154 +_0819014A: + movs r2, 0x4 + b _08190154 +_0819014E: + movs r2, 0xC + b _08190154 +_08190152: + movs r2, 0x14 +_08190154: + adds r0, r2, 0 +_08190156: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818FFC0 + + thumb_func_start sub_8190168 +sub_8190168: @ 8190168 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + cmp r0, 0x63 + bls _0819019A + movs r1, 0x6 + cmp r0, 0x77 + bls _0819019A + movs r1, 0x9 + cmp r0, 0x8B + bls _0819019A + movs r1, 0xC + cmp r0, 0x9F + bls _0819019A + movs r1, 0xF + cmp r0, 0xB3 + bls _0819019A + movs r1, 0x12 + cmp r0, 0xC7 + bls _0819019A + movs r1, 0x1F + cmp r0, 0xDB + bhi _0819019A + movs r1, 0x15 +_0819019A: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_8190168 + + thumb_func_start sub_81901A0 +sub_81901A0: @ 81901A0 + push {r4-r7,lr} + adds r3, r0, 0 + adds r2, r1, 0 + movs r5, 0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r4, =0x00000d24 + adds r1, r4 + ldrh r1, [r1] + lsls r1, 22 + lsrs r1, 22 + mov r12, r0 + ldr r6, =gUnknown_0860D10C + cmp r1, r2 + beq _081901D8 + mov r7, r12 +_081901C0: + adds r5, 0x1 + cmp r5, 0xF + bgt _081901D8 + ldr r0, [r7] + lsls r1, r5, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r2 + bne _081901C0 +_081901D8: + cmp r3, 0 + beq _0819026C + cmp r3, 0x3 + bne _081901FC + lsls r0, r5, 2 + adds r1, r0, 0x3 + adds r1, r6 + ldrb r1, [r1] + adds r4, r1, 0 + adds r4, 0x8 + b _08190206 + .pool +_081901FC: + lsls r0, r5, 2 + adds r1, r3, r0 + adds r1, r6 + ldrb r1, [r1] + adds r4, r1, 0x4 +_08190206: + adds r0, r3, r0 + adds r0, r6 + ldrb r2, [r0] + cmp r2, r4 + bge _08190256 + ldr r1, =gUnknown_0860D14C + adds r0, r2, r1 + ldrb r3, [r0] + adds r6, r1, 0 + cmp r3, r5 + beq _08190234 + mov r1, r12 + ldr r0, [r1] + lsls r1, r3, 2 + adds r0, r1 + ldr r3, =0x00000d25 + adds r0, r3 + b _0819024E + .pool +_08190234: + adds r2, 0x1 + cmp r2, r4 + bge _08190256 + adds r0, r2, r6 + ldrb r1, [r0] + cmp r1, r5 + beq _08190234 + mov r3, r12 + ldr r0, [r3] + lsls r1, 2 + adds r0, r1 + ldr r1, =0x00000d25 + adds r0, r1 +_0819024E: + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08190234 +_08190256: + cmp r2, r4 + beq _08190286 + ldr r0, =gUnknown_0860D14C + adds r0, r2, r0 + ldrb r0, [r0] + b _08190292 + .pool +_0819026C: + mov r3, r12 + ldr r1, [r3] + lsls r0, r5, 2 + adds r0, r6 + ldrb r2, [r0] + lsls r0, r2, 2 + adds r1, r0 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + bge _08190290 +_08190286: + movs r0, 0xFF + b _08190292 + .pool +_08190290: + adds r0, r2, 0 +_08190292: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81901A0 + + thumb_func_start sub_8190298 +sub_8190298: @ 8190298 + push {lr} + bl sub_81902AC + ldr r1, =gTrainerBattleOpponent_A + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190298 + + thumb_func_start sub_81902AC +sub_81902AC: @ 81902AC + push {r4,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r1, =0x00000cb2 + adds r0, r4, r1 + ldrh r0, [r0] + ldr r1, =0x000003ff + bl sub_81901A0 + lsls r0, 2 + adds r4, r0 + ldr r0, =0x00000d24 + adds r4, r0 + ldrh r0, [r4] + lsls r0, 22 + lsrs r0, 22 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81902AC + + thumb_func_start sub_81902E4 +sub_81902E4: @ 81902E4 + push {lr} + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + movs r1, 0 + bl sub_8162614 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81902E4 + + thumb_func_start sub_81902F8 +sub_81902F8: @ 81902F8 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81902F8 + + thumb_func_start sub_819033C +sub_819033C: @ 819033C + push {r4,r5,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r4, [r0] + lsls r4, 30 + lsrs r4, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + ldr r1, [r5] + lsls r4, 1 + lsrs r0, 22 + adds r4, r0 + ldr r3, =0x00000d0c + adds r1, r3 + adds r1, r4 + ldrh r0, [r1] + ldr r2, =0x000003e6 + cmp r0, r2 + bhi _0819036E + adds r0, 0x1 + strh r0, [r1] +_0819036E: + ldr r0, [r5] + ldr r1, =0x00000d1c + adds r0, r1 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, r2 + bhi _08190380 + adds r0, 0x1 + strh r0, [r1] +_08190380: + ldr r0, [r5] + adds r1, r0, r3 + adds r1, r4 + ldr r2, =0x00000d14 + adds r0, r2 + adds r0, r4 + ldrh r1, [r1] + ldrh r2, [r0] + cmp r1, r2 + bls _08190396 + strh r1, [r0] +_08190396: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819033C + + thumb_func_start sub_81903B8 +sub_81903B8: @ 81903B8 + push {r4,r5,lr} + ldr r0, =sub_8190400 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gTasks + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r5, 0 + strh r5, [r4, 0x8] + bl sub_81902AC + lsls r0, 16 + lsrs r0, 16 + bl sub_8195358 + strh r0, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + ldr r0, =sub_8194B54 + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81903B8 + + thumb_func_start sub_8190400 +sub_8190400: @ 8190400 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r10 + lsls r0, 3 + adds r6, r0, r1 + movs r0, 0xA + ldrsh r5, [r6, r0] + movs r2, 0xC + ldrsh r1, [r6, r2] + mov r9, r1 + movs r0, 0xE + ldrsh r7, [r6, r0] + movs r1, 0x8 + ldrsh r4, [r6, r1] + cmp r4, 0x1 + beq _08190508 + cmp r4, 0x1 + bgt _08190440 + cmp r4, 0 + beq _0819044E + b _08190772 + .pool +_08190440: + cmp r4, 0x2 + bne _08190446 + b _08190570 +_08190446: + cmp r4, 0x3 + bne _0819044C + b _08190634 +_0819044C: + b _08190772 +_0819044E: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x1 + bl EnableInterrupts + str r4, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x4 + bl CpuSet + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0860CE84 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_0860CEB4 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r0, =gUnknown_02022E14 + strh r4, [r0] + ldr r0, =gUnknown_02022E16 + strh r4, [r0] + ldr r0, =gUnknown_02022E18 + strh r4, [r0] + ldr r0, =gUnknown_02022E1A + strh r4, [r0] + ldr r0, =gUnknown_02022E20 + strh r4, [r0] + ldr r0, =gUnknown_02022E22 + strh r4, [r0] + mov r2, r9 + cmp r2, 0x2 + bne _081904DC + ldr r0, =gUnknown_02022E1C + strh r4, [r0] + ldr r0, =gUnknown_02022E1E + strh r4, [r0] + b _081904E6 + .pool +_081904DC: + ldr r0, =gUnknown_02022E1C + strh r4, [r0] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] +_081904E6: + ldr r0, =gTasks + mov r2, r10 + lsls r1, r2, 2 + add r1, r10 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08190772 + .pool +_08190508: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x42 + movs r1, 0 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x3F + bl SetGpuReg + bl ResetPaletteFade + bl ResetSpriteData + bl FreeAllSpritePalettes + ldr r1, =gReservedSpritePaletteCount + movs r0, 0x4 + strb r0, [r1] + b _08190602 + .pool +_08190570: + ldr r1, =gUnknown_08D83D50 + movs r5, 0x80 + lsls r5, 6 + movs r7, 0 + str r7, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D84970 + movs r4, 0x1 + str r4, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D84F00 + movs r2, 0x80 + lsls r2, 4 + str r4, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, =gUnknown_0860CF50 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08D85358 + movs r4, 0x80 + lsls r4, 2 + movs r1, 0 + adds r2, r4, 0 + bl LoadCompressedPalette + ldr r0, =gUnknown_08D85444 + movs r1, 0x80 + lsls r1, 1 + adds r2, r4, 0 + bl LoadCompressedPalette + ldr r0, =gUnknown_08D85600 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadCompressedPalette + mov r0, r9 + cmp r0, 0x2 + bne _081905DE + ldr r0, =gUnknown_08D854C8 + movs r1, 0x50 + movs r2, 0x20 + bl LoadCompressedPalette +_081905DE: + str r7, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, =gPlttBufferFaded + ldr r2, =0x05000100 + bl CpuSet + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg +_08190602: + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _08190772 + .pool +_08190634: + ldr r0, =sub_8194B70 + bl SetVBlankCallback + ldr r4, =gUnknown_0203CD78 + movs r0, 0x14 + bl AllocZeroed + str r0, [r4] + movs r6, 0 + lsls r5, 24 + movs r2, 0xFF +_0819064A: + ldr r1, [r4] + adds r1, r6 + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0xF + ble _0819064A + bl sub_80D2F04 + ldr r0, =sub_8190CD4 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + strh r1, [r0, 0xC] + mov r1, r9 + strh r1, [r0, 0xE] + strh r7, [r0, 0x10] + mov r2, r9 + cmp r2, 0x2 + bne _081906A8 + lsrs r1, r5, 24 + movs r0, 0 + bl sub_819314C + ldr r0, =gUnknown_0203CD78 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x10] + b _081906B0 + .pool +_081906A8: + lsrs r1, r5, 24 + movs r0, 0 + bl sub_81924E0 +_081906B0: + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + mov r0, r9 + cmp r0, 0 + beq _0819076C + ldr r5, =gUnknown_0860D068 + adds r0, r5, 0 + movs r1, 0x78 + movs r2, 0x4 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + ldr r1, =gSprites + mov r8, r1 + add r4, r8 + adds r0, r4, 0 + movs r1, 0 + bl StartSpriteAnim + strh r6, [r4, 0x2E] + adds r0, r5, 0 + movs r1, 0x78 + movs r2, 0x9C + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAnim + strh r6, [r4, 0x2E] + ldr r5, =gUnknown_0860D050 + adds r0, r5, 0 + movs r1, 0x6 + movs r2, 0x50 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + mov r2, r8 + adds r4, r0, r2 + adds r0, r4, 0 + movs r1, 0 + bl StartSpriteAnim + strh r6, [r4, 0x2E] + movs r0, 0 + strh r0, [r4, 0x30] + mov r1, r9 + cmp r1, 0x1 + bne _08190746 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08190746: + adds r0, r5, 0 + movs r1, 0xEA + movs r2, 0x50 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAnim + strh r6, [r4, 0x2E] + movs r0, 0x1 + strh r0, [r4, 0x30] +_0819076C: + mov r0, r10 + bl DestroyTask +_08190772: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190400 + + thumb_func_start sub_8190790 +sub_8190790: @ 8190790 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x22] + adds r1, r0, 0x4 + strh r1, [r2, 0x22] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _081907D4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + blt _081907BC + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_081907BC: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _081907F0 + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] + b _081907F0 + .pool +_081907D4: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xBF + ble _081907F0 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_081907F0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190790 + + thumb_func_start sub_81907F8 +sub_81907F8: @ 81907F8 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x22] + subs r1, r0, 0x4 + strh r1, [r2, 0x22] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08190838 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xC0 + bgt _08190820 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_08190820: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _08190858 + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] + b _08190858 + .pool +_08190838: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bgt _08190858 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_08190858: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81907F8 + + thumb_func_start sub_8190860 +sub_8190860: @ 8190860 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + adds r1, r0, 0x4 + strh r1, [r2, 0x20] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _081908A4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + blt _0819088C + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_0819088C: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _081908C0 + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] + b _081908C0 + .pool +_081908A4: + lsls r1, 16 + ldr r0, =0x010f0000 + cmp r1, r0 + ble _081908C0 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_081908C0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190860 + + thumb_func_start sub_81908CC +sub_81908CC: @ 81908CC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + subs r1, r0, 0x4 + strh r1, [r2, 0x20] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08190910 + lsls r1, 16 + movs r0, 0x88 + lsls r0, 17 + cmp r1, r0 + bgt _081908F6 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_081908F6: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08190930 + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] + b _08190930 + .pool +_08190910: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bgt _08190930 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_08190930: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81908CC + + thumb_func_start sub_8190938 +sub_8190938: @ 8190938 + push {lr} + adds r1, r0, 0 + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0819094A + adds r0, r1, 0 + bl sub_80D30DC +_0819094A: + pop {r0} + bx r0 + thumb_func_end sub_8190938 + + thumb_func_start sub_8190950 +sub_8190950: @ 8190950 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08190962 + adds r0, r4, 0 + bl sub_80D30DC +_08190962: + ldrh r0, [r4, 0x22] + adds r1, r0, 0x4 + strh r1, [r4, 0x22] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081909A4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + blt _0819098A + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0819098A: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _081909C0 + ldr r0, =sub_8190938 + str r0, [r4, 0x1C] + b _081909C0 + .pool +_081909A4: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xAF + ble _081909C0 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_081909C0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190950 + + thumb_func_start sub_81909CC +sub_81909CC: @ 81909CC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081909DE + adds r0, r4, 0 + bl sub_80D30DC +_081909DE: + ldrh r0, [r4, 0x22] + subs r1, r0, 0x4 + strh r1, [r4, 0x22] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08190A1C + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xB0 + bgt _08190A02 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190A02: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _08190A3C + ldr r0, =sub_8190938 + str r0, [r4, 0x1C] + b _08190A3C + .pool +_08190A1C: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _08190A3C + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_08190A3C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81909CC + + thumb_func_start sub_8190A48 +sub_8190A48: @ 8190A48 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08190A5A + adds r0, r4, 0 + bl sub_80D30DC +_08190A5A: + ldrh r0, [r4, 0x20] + adds r1, r0, 0x4 + strh r1, [r4, 0x20] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08190A9C + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + blt _08190A82 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190A82: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08190AB8 + ldr r0, =sub_8190938 + str r0, [r4, 0x1C] + b _08190AB8 + .pool +_08190A9C: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _08190AB8 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_08190AB8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190A48 + + thumb_func_start sub_8190AC4 +sub_8190AC4: @ 8190AC4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08190AD6 + adds r0, r4, 0 + bl sub_80D30DC +_08190AD6: + ldrh r0, [r4, 0x20] + subs r1, r0, 0x4 + strh r1, [r4, 0x20] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08190B14 + lsls r1, 16 + movs r0, 0x80 + lsls r0, 17 + cmp r1, r0 + bgt _08190AFC + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190AFC: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08190B34 + ldr r0, =sub_8190938 + str r0, [r4, 0x1C] + b _08190B34 + .pool +_08190B14: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _08190B34 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_08190B34: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190AC4 + + thumb_func_start sub_8190B40 +sub_8190B40: @ 8190B40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r6, [r3, r0] + ldr r2, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r2 + movs r7, 0x10 + ldrsh r1, [r4, r7] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0xA + ldrsh r0, [r0, r1] + ldr r1, =gUnknown_0860D080 + adds r0, r1 + ldrb r0, [r0] + mov r10, r0 + ldr r1, =gSaveBlock2Ptr + ldr r5, [r1] + ldr r7, =0x00000cb2 + adds r0, r5, r7 + ldrh r0, [r0] + mov r12, r0 + movs r7, 0xE + ldrsh r0, [r4, r7] + mov r9, r2 + mov r8, r1 + cmp r0, 0x1 + bne _08190C0C + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08190BFC + mov r2, r10 + lsls r0, r2, 2 + adds r1, r5, r0 + ldr r7, =0x00000d25 + adds r1, r7 + ldrb r2, [r1] + lsls r1, r2, 29 + adds r4, r0, 0 + cmp r1, 0 + bge _08190BB6 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + subs r1, 0x1 + lsls r0, r2, 27 + lsrs r0, 30 + cmp r1, r0 + blt _08190C32 +_08190BB6: + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08190BD4 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + subs r0, 0x1 + cmp r0, r12 + blt _08190C32 +_08190BD4: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + add r0, r9 + movs r7, 0x8 + ldrsh r0, [r0, r7] + b _08190C4C + .pool +_08190BFC: + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _08190C32 + b _08190C48 + .pool +_08190C0C: + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _08190C28 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bls _08190C32 + movs r7, 0x8 + ldrsh r0, [r4, r7] + b _08190C4C + .pool +_08190C28: + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _08190C48 +_08190C32: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _08190C5C + .pool +_08190C48: + movs r1, 0x8 + ldrsh r0, [r4, r1] +_08190C4C: + cmp r0, 0x2 + bne _08190C5C + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08190C5C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8190B40 + + thumb_func_start sub_8190C6C +sub_8190C6C: @ 8190C6C + push {lr} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r1, [r3, r0] + ldr r2, =gTasks + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _08190C9C + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _08190CA6 + b _08190CC0 + .pool +_08190C9C: + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + beq _08190CC0 +_08190CA6: + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x2 + bne _08190CCE + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _08190CCE + .pool +_08190CC0: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190CCE: + pop {r0} + bx r0 + thumb_func_end sub_8190C6C + + thumb_func_start sub_8190CD4 +sub_8190CD4: @ 8190CD4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r3, 0xE + ldrsh r2, [r0, r3] + mov r9, r2 + movs r4, 0x10 + ldrsh r7, [r0, r4] + movs r5, 0x8 + ldrsh r0, [r0, r5] + cmp r0, 0x8 + bls _08190D06 + bl _08192202 +_08190D06: + lsls r0, 2 + ldr r1, =_08190D18 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08190D18: + .4byte _08190D3C + .4byte _08190D7C + .4byte _08190DA8 + .4byte _08190E48 + .4byte _08191FF8 + .4byte _08192038 + .4byte _08192078 + .4byte _081920BC + .4byte _08192106 +_08190D3C: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08190D50 + bl _08192202 +_08190D50: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r1, =gTasks + mov r6, r8 + lsls r0, r6, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + bl _08192202 + .pool +_08190D7C: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08190D8C + bl _08192202 +_08190D8C: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + ldr r2, =gTasks + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x8] + bl _08192202 + .pool +_08190DA8: + mov r0, r8 + bl sub_819221C + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x8 + bgt _08190DBE + cmp r6, 0x1 + bge _08190DF0 + bl _08192202 +_08190DBE: + cmp r6, 0x9 + beq _08190DC6 + bl _08192202 +_08190DC6: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + strh r1, [r0, 0x8] + bl _08192202 + .pool +_08190DF0: + ldr r1, =gTasks + mov r4, r8 + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x12] + movs r5, 0xC + ldrsh r0, [r0, r5] + movs r1, 0 + mov r9, r2 + cmp r0, 0 + beq _08190E0C + movs r1, 0x9 +_08190E0C: + adds r6, r1, 0 + adds r0, r6, 0 + adds r0, 0x9 + cmp r6, r0 + bge _08190E32 + adds r5, r0, 0 +_08190E18: + lsls r4, r6, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r6, 0x1 + cmp r6, r5 + blt _08190E18 +_08190E32: + ldr r0, =gTasks + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x3 + strh r0, [r1, 0x8] + bl _08192202 + .pool +_08190E48: + mov r6, r8 + lsls r1, r6, 2 + adds r0, r1, r6 + lsls r0, 3 + ldr r2, =gTasks + adds r0, r2 + movs r3, 0x12 + ldrsh r6, [r0, r3] + subs r0, r6, 0x1 + mov r9, r1 + cmp r0, 0x7 + bls _08190E64 + bl _08192202 +_08190E64: + lsls r0, 2 + ldr r1, =_08190E78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08190E78: + .4byte _08190E98 + .4byte _08191234 + .4byte _081915CC + .4byte _08191B08 + .4byte _08190E98 + .4byte _08191234 + .4byte _0819187C + .4byte _08191D68 +_08190E98: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08190ED4 + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r0, =gUnknown_02022E18 + strh r1, [r0] + ldr r1, =gUnknown_02022E1A + movs r0, 0xA0 + strh r0, [r1] + b _08190EE6 + .pool +_08190ED4: + ldr r0, =gUnknown_02022E14 + strh r2, [r0] + ldr r1, =gUnknown_02022E16 + movs r0, 0xA0 + strh r0, [r1] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_08190EE6: + cmp r6, 0x1 + bne _08190F9C + ldr r5, =gUnknown_0203CD78 + ldr r0, [r5] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _08190F50 + ldr r0, =gUnknown_02022E1C + strh r1, [r0] + ldr r1, =gUnknown_02022E1E + movs r6, 0xA0 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r4, 0xA + ldrsh r1, [r0, r4] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x10 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + b _08191084 + .pool +_08190F50: + ldr r1, =gUnknown_02022E1C + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E1E + movs r4, 0 + strh r4, [r0] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x10 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + ldr r0, [r5] + strb r4, [r0, 0x10] + b _08191084 + .pool +_08190F9C: + ldr r6, =gUnknown_0203CD78 + ldr r1, [r6] + ldrb r5, [r1, 0x10] + cmp r5, 0 + bne _08190FF8 + ldr r4, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r2, 0xA + ldrsh r0, [r0, r2] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r0, =gUnknown_02022E1C + strh r5, [r0] + ldr r1, =gUnknown_02022E1E + movs r3, 0xA0 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x10 + orrs r0, r1 + ldrb r1, [r2, 0x11] + bl sub_81924E0 + b _08191084 + .pool +_08190FF8: + cmp r5, 0x2 + bne _0819104C + ldr r4, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x10 + orrs r0, r1 + ldrb r1, [r2, 0x12] + bl sub_81924E0 + b _08191084 + .pool +_0819104C: + ldr r1, =gUnknown_02022E1C + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r4, 0xA + ldrsh r0, [r0, r4] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x10 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_08191084: + movs r6, 0 + ldr r5, =gUnknown_0203CD78 + mov r10, r5 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_0819109E: + cmp r6, 0x1 + bgt _0819110C + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191150 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190790 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191150 + .pool +_0819110C: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191150 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190950 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191150: + adds r6, 0x1 + cmp r6, 0x7 + ble _0819109E + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_0819116E: + cmp r6, 0x9 + bgt _081911D4 + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191214 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190790 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191214 + .pool +_081911D4: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191214 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190950 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191214: + adds r6, 0x1 + cmp r6, 0xF + ble _0819116E + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x4 + bl _08191FE8 + .pool +_08191234: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191278 + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r0, =gUnknown_02022E18 + strh r1, [r0] + ldr r1, =gUnknown_02022E1A + ldr r2, =0x0000ff60 + adds r0, r2, 0 + strh r0, [r1] + b _0819128C + .pool +_08191278: + ldr r0, =gUnknown_02022E14 + strh r2, [r0] + ldr r1, =gUnknown_02022E16 + ldr r3, =0x0000ff60 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_0819128C: + cmp r6, 0x2 + bne _0819133C + ldr r5, =gUnknown_0203CD78 + ldr r0, [r5] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _081912F4 + ldr r0, =gUnknown_02022E1C + strh r1, [r0] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r4, 0xA + ldrsh r1, [r0, r4] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x4 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + b _0819141C + .pool +_081912F4: + ldr r0, =gUnknown_02022E1C + movs r4, 0 + strh r4, [r0] + ldr r0, =gUnknown_02022E1E + strh r4, [r0] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x4 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + ldr r0, [r5] + strb r4, [r0, 0x10] + b _0819141C + .pool +_0819133C: + ldr r6, =gUnknown_0203CD78 + ldr r1, [r6] + ldrb r5, [r1, 0x10] + cmp r5, 0 + bne _08191394 + ldr r4, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r2, 0xA + ldrsh r0, [r0, r2] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r0, =gUnknown_02022E1C + strh r5, [r0] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x4 + orrs r0, r1 + ldrb r1, [r2, 0x11] + bl sub_81924E0 + b _0819141C + .pool +_08191394: + cmp r5, 0x2 + bne _081913E4 + ldr r4, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r3, 0xA + ldrsh r0, [r0, r3] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x4 + orrs r0, r1 + ldrb r1, [r2, 0x12] + bl sub_81924E0 + b _0819141C + .pool +_081913E4: + ldr r1, =gUnknown_02022E1C + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0 + strh r0, [r1] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x4 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_0819141C: + movs r6, 0 + ldr r0, =gUnknown_0203CD78 + mov r10, r0 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_08191436: + cmp r6, 0x1 + bgt _081914A4 + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081914E8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_81907F8 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _081914E8 + .pool +_081914A4: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081914E8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_81909CC + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_081914E8: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191436 + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191506: + cmp r6, 0x9 + bgt _0819156C + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081915AC + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81907F8 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _081915AC + .pool +_0819156C: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081915AC + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81909CC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_081915AC: + adds r6, 0x1 + cmp r6, 0xF + ble _08191506 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x5 + bl _08191FE8 + .pool +_081915CC: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _0819160C + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r2, =gUnknown_02022E18 + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _08191622 + .pool +_0819160C: + ldr r1, =gUnknown_02022E14 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E16 + strh r2, [r0] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_08191622: + ldr r0, =gUnknown_0203CD78 + ldr r4, [r0] + ldrb r0, [r4, 0x10] + cmp r0, 0 + bne _08191688 + ldr r1, =gUnknown_02022E1C + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r5, 0xA + ldrsh r1, [r0, r5] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x8 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + b _081916C6 + .pool +_08191688: + ldr r1, =gUnknown_02022E1C + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0 + strh r0, [r1] + ldr r3, =gUnknown_0860D15C + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r5, 0xA + ldrsh r1, [r0, r5] + lsls r1, 2 + subs r1, 0x1 + ldrb r4, [r4, 0x10] + adds r1, r4 + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x8 + orrs r0, r2 + ldrb r1, [r1] + bl sub_819314C +_081916C6: + movs r6, 0 + ldr r0, =gUnknown_0203CD78 + mov r10, r0 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_081916E0: + cmp r6, 0x1 + bgt _08191754 + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191798 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190860 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191798 + .pool +_08191754: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191798 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190A48 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191798: + adds r6, 0x1 + cmp r6, 0x7 + ble _081916E0 + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_081917B6: + cmp r6, 0x9 + bgt _0819181C + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _0819185C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190860 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _0819185C + .pool +_0819181C: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _0819185C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190A48 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_0819185C: + adds r6, 0x1 + cmp r6, 0xF + ble _081917B6 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x6 + b _08191FE8 + .pool +_0819187C: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _081918BC + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r2, =gUnknown_02022E18 + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _081918D2 + .pool +_081918BC: + ldr r1, =gUnknown_02022E14 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E16 + strh r2, [r0] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_081918D2: + ldr r0, =gUnknown_0203CD78 + ldr r2, [r0] + ldrb r0, [r2, 0x10] + cmp r0, 0 + bne _08191924 + ldr r1, =gUnknown_02022E1C + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x8 + orrs r0, r1 + ldrb r1, [r2, 0x11] + bl sub_81924E0 + b _08191958 + .pool +_08191924: + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x8 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_08191958: + movs r6, 0 + ldr r0, =gUnknown_0203CD78 + mov r10, r0 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_08191972: + cmp r6, 0x1 + bgt _081919E0 + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191A24 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190860 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191A24 + .pool +_081919E0: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191A24 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190A48 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191A24: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191972 + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191A42: + cmp r6, 0x9 + bgt _08191AA8 + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191AE8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190860 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191AE8 + .pool +_08191AA8: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191AE8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190A48 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191AE8: + adds r6, 0x1 + cmp r6, 0xF + ble _08191A42 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x6 + b _08191FE8 + .pool +_08191B08: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191B48 + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r2, =gUnknown_02022E18 + movs r6, 0xFF + lsls r6, 8 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _08191B5E + .pool +_08191B48: + ldr r1, =gUnknown_02022E14 + movs r3, 0xFF + lsls r3, 8 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E16 + strh r2, [r0] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_08191B5E: + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _08191B94 + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + b _08191B9E + .pool +_08191B94: + ldr r0, =gUnknown_02022E1C + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E1E + strh r1, [r0] +_08191B9E: + ldr r4, =gUnknown_0860D15C + ldr r5, =gUnknown_0203CD78 + ldr r3, [r5] + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + lsls r1, 2 + subs r1, 0x1 + ldrb r3, [r3, 0x10] + adds r1, r3 + adds r1, r4 + mov r4, r9 + add r4, r8 + lsls r4, 3 + adds r4, r2 + ldrb r2, [r4, 0xC] + movs r0, 0x2 + orrs r0, r2 + ldrb r1, [r1] + bl sub_819314C + movs r6, 0 + ldr r7, =gSprites + mov r12, r6 + mov r10, r5 + adds r5, r7, 0 + adds r5, 0x1C +_08191BDC: + cmp r6, 0x1 + bgt _08191C50 + mov r1, r10 + ldr r0, [r1] + adds r3, r0, r6 + ldrb r0, [r3] + cmp r0, 0xFF + beq _08191C96 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =sub_81908CC + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r4, 0xC] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0x2E] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r12 + strh r2, [r0, 0x30] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r6, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r1, [r0, 0x34] + b _08191C96 + .pool +_08191C50: + mov r3, r10 + ldr r0, [r3] + adds r3, r0, r6 + ldrb r0, [r3] + cmp r0, 0xFF + beq _08191C96 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =sub_8190AC4 + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r4, 0xC] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0x2E] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r6, [r0, 0x32] +_08191C96: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191BDC + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191CB4: + cmp r6, 0x9 + bgt _08191D1C + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191D5C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81908CC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191D5C + .pool +_08191D1C: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191D5C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190AC4 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191D5C: + adds r6, 0x1 + cmp r6, 0xF + ble _08191CB4 + b _08191FDA + .pool +_08191D68: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191DA8 + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r2, =gUnknown_02022E18 + movs r6, 0xFF + lsls r6, 8 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _08191DBE + .pool +_08191DA8: + ldr r1, =gUnknown_02022E14 + movs r3, 0xFF + lsls r3, 8 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E16 + strh r2, [r0] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_08191DBE: + ldr r0, =gUnknown_0203CD78 + ldr r2, [r0] + ldrb r0, [r2, 0x10] + cmp r0, 0x2 + bne _08191E10 + ldr r1, =gUnknown_02022E1C + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x2 + orrs r0, r1 + ldrb r1, [r2, 0x12] + bl sub_81924E0 + b _08191E44 + .pool +_08191E10: + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x2 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_08191E44: + movs r6, 0 + ldr r0, =gUnknown_0203CD78 + mov r10, r0 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_08191E5E: + cmp r6, 0x1 + bgt _08191ECC + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191F10 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_81908CC + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191F10 + .pool +_08191ECC: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191F10 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190AC4 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191F10: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191E5E + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191F2E: + cmp r6, 0x9 + bgt _08191F94 + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191FD4 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81908CC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191FD4 + .pool +_08191F94: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191FD4 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190AC4 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191FD4: + adds r6, 0x1 + cmp r6, 0xF + ble _08191F2E +_08191FDA: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x7 +_08191FE8: + strh r1, [r0, 0x8] + strh r2, [r0, 0x12] + b _08192202 + .pool +_08191FF8: + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + ldr r5, =gTasks + adds r1, r0, r5 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x29 + beq _08192100 + ldr r1, =gUnknown_02022E16 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1A + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + b _081920A4 + .pool +_08192038: + mov r6, r8 + lsls r0, r6, 2 + add r0, r8 + lsls r0, 3 + ldr r2, =gTasks + adds r1, r0, r2 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x29 + beq _08192100 + ldr r1, =gUnknown_02022E16 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1A + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + b _081920E8 + .pool +_08192078: + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r1, r0, r4 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x41 + beq _08192100 + ldr r1, =gUnknown_02022E14 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E18 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1C +_081920A4: + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + b _08192202 + .pool +_081920BC: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + ldr r6, =gTasks + adds r1, r0, r6 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x41 + beq _08192100 + ldr r1, =gUnknown_02022E14 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E18 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1C +_081920E8: + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + b _08192202 + .pool +_08192100: + movs r0, 0x2 + strh r0, [r1, 0x8] + b _08192202 +_08192106: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08192202 + movs r6, 0 + ldr r4, =gUnknown_0203CD78 +_08192116: + cmp r6, 0x1 + bgt _08192134 + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819214E + bl sub_818D8F0 + b _0819214E + .pool +_08192134: + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819214E + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl sub_80D2EF8 +_0819214E: + adds r6, 0x1 + cmp r6, 0x7 + ble _08192116 + movs r6, 0x8 + ldr r4, =gUnknown_0203CD78 +_08192158: + cmp r6, 0x9 + bgt _08192174 + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819218E + bl sub_818D8F0 + b _0819218E + .pool +_08192174: + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819218E + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl sub_80D2EF8 +_0819218E: + adds r6, 0x1 + cmp r6, 0xF + ble _08192158 + bl sub_80D2F9C + ldr r4, =gUnknown_0203CD78 + ldr r0, [r4] + bl Free + movs r5, 0 + str r5, [r4] + bl FreeAllWindowBuffers + mov r0, r9 + cmp r0, 0 + bne _081921C4 + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + b _081921FC + .pool +_081921C4: + ldr r0, =sub_8194220 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + strh r5, [r1, 0xA] + movs r0, 0x3 + strh r0, [r1, 0xC] + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x10] + strh r0, [r1, 0xE] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x14] + strh r0, [r1, 0x10] +_081921FC: + mov r0, r8 + bl DestroyTask +_08192202: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190CD4 + + thumb_func_start sub_819221C +sub_819221C: @ 819221C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r7, 0 + ldr r2, =gTasks + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r2 + mov r12, r0 + movs r1, 0x10 + ldrsh r6, [r0, r1] + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r2 + movs r3, 0xA + ldrsh r5, [r0, r3] + ldr r0, =gUnknown_0860D080 + adds r0, r5, r0 + ldrb r0, [r0] + mov r10, r0 + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + mov r8, r0 + ldr r1, =gMain + ldrh r4, [r1, 0x2E] + movs r0, 0x3 + ands r0, r4 + adds r2, r1, 0 + cmp r0, 0 + beq _0819226E + movs r7, 0x9 +_0819226E: + mov r3, r12 + movs r1, 0xE + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _0819227A + b _081924CC +_0819227A: + cmp r0, 0x1 + beq _08192280 + b _081923B0 +_08192280: + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _081922BA + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _081922BA + cmp r5, 0 + bne _081922B4 + movs r5, 0xF + b _081922B6 + .pool +_081922B4: + subs r5, 0x1 +_081922B6: + movs r7, 0x1 + b _08192360 +_081922BA: + ldrh r1, [r2, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081922E2 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _081922E2 + cmp r5, 0xF + bne _081922DC + movs r5, 0 + b _081922DE + .pool +_081922DC: + adds r5, 0x1 +_081922DE: + movs r7, 0x2 + b _08192360 +_081922E2: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08192304 + ldr r0, =gUnknown_0203CD78 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _08192304 + subs r0, 0x1 + strb r0, [r1, 0x10] + movs r7, 0x3 + b _08192360 + .pool +_08192304: + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08192360 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + mov r3, r10 + lsls r1, r3, 2 + adds r0, r1 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r3, [r0] + lsls r0, r3, 29 + mov r12, r1 + cmp r0, 0 + bge _0819233C + ldr r0, =gUnknown_0203CD78 + ldr r2, [r0] + ldrb r4, [r2, 0x10] + subs r1, r4, 0x1 + lsls r0, r3, 27 + lsrs r0, 30 + cmp r1, r0 + bge _0819233C + adds r0, r4, 0x1 + strb r0, [r2, 0x10] + movs r7, 0x4 +_0819233C: + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + add r0, r12 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08192360 + ldr r0, =gUnknown_0203CD78 + ldr r3, [r0] + ldrb r1, [r3, 0x10] + subs r0, r1, 0x1 + cmp r0, r8 + bge _08192360 + adds r0, r1, 0x1 + strb r0, [r3, 0x10] + movs r7, 0x4 +_08192360: + cmp r7, 0x9 + beq _08192366 + b _081924A0 +_08192366: + ldr r0, =gUnknown_0203CD78 + ldr r3, [r0] + ldrb r0, [r3, 0x10] + cmp r0, 0 + beq _081923A0 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r2, =gTasks + adds r1, r2 + ldr r2, =gUnknown_0860D1A0 + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r0, 1 + lsls r0, 2 + subs r0, 0x1 + ldrb r3, [r3, 0x10] + adds r0, r3 + b _08192482 + .pool +_081923A0: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + b _0819249E + .pool +_081923B0: + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _081923DE + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _081923DE + cmp r5, 0x10 + bne _081923D8 + ldr r0, =gUnknown_0860D19C + add r0, r8 + ldrb r5, [r0] + b _081923DA + .pool +_081923D8: + subs r5, 0x1 +_081923DA: + movs r7, 0x5 + b _08192446 +_081923DE: + ldrh r1, [r2, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819240E + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _0819240E + ldr r0, =gUnknown_0860D19C + add r0, r8 + ldrb r0, [r0] + cmp r5, r0 + bne _08192408 + movs r5, 0x10 + b _0819240A + .pool +_08192408: + adds r5, 0x1 +_0819240A: + movs r7, 0x6 + b _08192446 +_0819240E: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819242C + ldr r0, =gUnknown_0203CD78 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _0819242C + movs r7, 0x7 + subs r0, 0x1 + b _08192444 + .pool +_0819242C: + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08192446 + ldr r0, =gUnknown_0203CD78 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0x1 + bhi _08192446 + movs r7, 0x8 + adds r0, 0x1 +_08192444: + strb r0, [r1, 0x10] +_08192446: + cmp r7, 0x9 + bne _081924A0 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _08192470 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r2, =gTasks + adds r1, r2 + ldr r2, =gUnknown_0860D1C0 + ldrb r0, [r0, 0x11] + b _08192482 + .pool +_08192470: + cmp r1, 0x2 + bne _08192494 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r3, =gTasks + adds r1, r3 + ldr r2, =gUnknown_0860D1C0 + ldrb r0, [r0, 0x12] +_08192482: + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1, 0xA] + b _081924A0 + .pool +_08192494: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + adds r0, r1 +_0819249E: + strh r5, [r0, 0xA] +_081924A0: + cmp r7, 0 + beq _081924CC + cmp r7, 0x9 + beq _081924CC + movs r0, 0x5 + bl PlaySE + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xA] + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0xC] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0xC] +_081924CC: + adds r0, r7, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_819221C + + thumb_func_start sub_81924E0 +sub_81924E0: @ 81924E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x20] + movs r5, 0 + movs r0, 0 + str r0, [sp, 0x28] + movs r1, 0 + str r1, [sp, 0x2C] + movs r2, 0 + str r2, [sp, 0x30] + movs r4, 0 + movs r0, 0x24 + bl AllocZeroed + mov r8, r0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r3, [sp, 0x20] + lsls r0, r3, 2 + adds r0, r1, r0 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + str r0, [sp, 0x24] + movs r0, 0x1 + ldr r3, [sp, 0x1C] + ands r0, r3 + cmp r0, 0 + beq _08192538 + movs r5, 0x8 + movs r4, 0x9 + str r4, [sp, 0x28] + movs r4, 0x2 +_08192538: + movs r0, 0x2 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192548 + movs r3, 0x80 + lsls r3, 1 + str r3, [sp, 0x2C] +_08192548: + movs r0, 0x4 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192556 + movs r3, 0xA0 + str r3, [sp, 0x30] +_08192556: + movs r0, 0x8 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192564 + ldr r3, =0xffffff00 + str r3, [sp, 0x2C] +_08192564: + movs r0, 0x10 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192574 + movs r3, 0xA0 + negs r3, r3 + str r3, [sp, 0x30] +_08192574: + ldr r0, =0x000003ff + ldr r2, [sp, 0x24] + cmp r2, r0 + bne _08192598 + ldrb r0, [r1, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + b _081925B6 + .pool +_08192598: + ldr r0, =0x000003fe + ldr r3, [sp, 0x24] + cmp r3, r0 + bne _081925AC + bl sub_8195910 + b _081925B2 + .pool +_081925AC: + ldr r0, [sp, 0x24] + bl sub_8162AA0 +_081925B2: + lsls r0, 24 + lsrs r0, 24 +_081925B6: + ldr r2, [sp, 0x2C] + adds r2, 0x30 + ldr r3, [sp, 0x30] + adds r3, 0x40 + adds r1, r4, 0 + adds r1, 0xC + str r1, [sp] + ldr r1, =0x0000ffff + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D8AC + ldr r1, =gUnknown_0203CD78 + ldr r1, [r1] + adds r1, r5 + strb r0, [r1] + movs r0, 0x1E + ldr r4, [sp, 0x1C] + ands r0, r4 + cmp r0, 0 + beq _081925FC + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_081925FC: + movs r7, 0 + ldr r0, [sp, 0x20] + lsls r0, 1 + str r0, [sp, 0x3C] + adds r1, r5, 0x2 + ldr r2, [sp, 0x28] + lsls r2, 24 + str r2, [sp, 0x44] + ldr r3, [sp, 0x28] + adds r3, 0x4 + str r3, [sp, 0x40] + ldr r4, [sp, 0x20] + adds r0, r4 + ldr r6, =gUnknown_0203CD78 + ldr r2, =gSprites + mov r10, r2 + adds r4, r1, 0 + lsls r5, r0, 1 + movs r3, 0 + mov r9, r3 +_08192624: + ldr r0, =0x000003ff + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192660 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =gUnknown_0860D340 + adds r1, r7, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x2C] + orrs r2, r3 + b _081926B0 + .pool +_08192660: + ldr r0, =0x000003fe + ldr r3, [sp, 0x24] + cmp r3, r0 + bne _08192690 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000d64 + adds r0, r1 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =gUnknown_0860D340 + adds r1, r7, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x2C] + orrs r2, r3 + b _081926B0 + .pool +_08192690: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d64 + adds r0, r3 + adds r0, r5 + ldrh r1, [r0] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0860D340 + adds r1, r7, r1 + ldrb r2, [r1] + ldr r1, [sp, 0x2C] + orrs r2, r1 +_081926B0: + ldr r1, =gUnknown_0860D343 + adds r1, r7, r1 + ldrb r3, [r1] + ldr r1, [sp, 0x30] + adds r3, r1 + mov r1, r9 + str r1, [sp] + str r1, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + ldr r1, =sub_8190938 + bl sub_80D2CC4 + ldr r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrb r1, [r0, 0x5] + movs r2, 0xD + negs r2, r2 + ands r1, r2 + strb r1, [r0, 0x5] + movs r0, 0x1E + ldr r3, [sp, 0x1C] + ands r0, r3 + cmp r0, 0 + beq _0819270A + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0819270A: + adds r4, 0x1 + adds r5, 0x2 + adds r7, 0x1 + cmp r7, 0x2 + ble _08192624 + add r0, sp, 0xC + movs r2, 0 + movs r3, 0x2 + strb r3, [r0, 0x5] + strb r2, [r0, 0x6] + strb r2, [r0, 0x7] + adds r1, r0, 0 + adds r0, r2, 0 + strb r0, [r1, 0x8] + adds r0, r1, 0 + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r1, 0 + strb r3, [r0, 0xA] + strb r2, [r0, 0xB] + adds r3, r0, 0 + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xE0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + movs r7, 0 + ldr r0, =0x000003ff + ldr r4, [sp, 0x24] + cmp r4, r0 + bne _08192784 + ldr r0, =gTrainerClassNameIndices + adds r0, 0x3C + ldrb r5, [r0] + b _081927A2 + .pool +_08192784: + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192798 + bl sub_8195924 + b _0819279E + .pool +_08192798: + ldr r0, [sp, 0x24] + bl sub_8162BD8 +_0819279E: + lsls r0, 24 + lsrs r5, r0, 24 +_081927A2: + ldr r2, =gTrainerClassNames + movs r0, 0xD + adds r1, r5, 0 + muls r1, r0 + adds r0, r7, r1 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081927CA + ldr r3, =gStringVar1 + adds r0, r1, r2 + adds r2, r7, r0 +_081927BA: + adds r0, r7, r3 + ldrb r1, [r2] + strb r1, [r0] + adds r2, 0x1 + adds r7, 0x1 + ldrb r0, [r2] + cmp r0, 0xFF + bne _081927BA +_081927CA: + ldr r5, =gStringVar1 + adds r1, r7, r5 + movs r0, 0 + strb r0, [r1] + adds r0, r7, 0x1 + adds r0, r5 + movs r1, 0xFF + strb r1, [r0] + ldr r0, =0x000003ff + ldr r2, [sp, 0x24] + cmp r2, r0 + bne _08192800 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r5, 0 + bl StringAppend + b _08192836 + .pool +_08192800: + ldr r0, =0x000003fe + ldr r3, [sp, 0x24] + cmp r3, r0 + bne _08192824 + ldr r4, =gStringVar2 + adds r0, r4, 0 + bl sub_8195938 + adds r0, r5, 0 + adds r1, r4, 0 + bl StringAppend + b _08192836 + .pool +_08192824: + ldr r4, =gStringVar2 + ldr r1, [sp, 0x24] + adds r0, r4, 0 + bl sub_8195898 + adds r0, r5, 0 + adds r1, r4, 0 + bl StringAppend +_08192836: + add r0, sp, 0xC + ldrb r0, [r0, 0x5] + ldr r4, =gStringVar1 + add r1, sp, 0xC + ldrb r3, [r1, 0xA] + adds r1, r4, 0 + movs r2, 0xD0 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0xC + movs r5, 0 + strb r0, [r1, 0x8] + str r4, [sp, 0xC] + adds r0, r1, 0 + add r4, sp, 0x28 + ldrb r4, [r4] + strb r4, [r0, 0x4] + ldr r0, [sp, 0x44] + lsrs r4, r0, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + add r0, sp, 0xC + strb r5, [r0, 0xA] + movs r7, 0 + adds r6, r0, 0 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x20] + adds r0, r1, r2 + lsls r0, 1 + mov r9, r0 + movs r3, 0xB + mov r10, r3 +_0819288A: + ldr r0, =gUnknown_0860D346 + adds r0, r7, r0 + ldrb r0, [r0] + strb r0, [r6, 0x9] + ldr r0, =0x000003ff + ldr r4, [sp, 0x24] + cmp r4, r0 + bne _081928C0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r7, 1 + add r0, r9 + ldr r2, =0x00000d64 + adds r1, r2 + b _081928FA + .pool +_081928C0: + ldr r0, =0x000003fe + ldr r4, [sp, 0x24] + cmp r4, r0 + bne _081928E4 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r7, 1 + add r0, r9 + ldr r2, =0x00000d64 + adds r1, r2 + b _081928FA + .pool +_081928E4: + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + lsls r0, r7, 1 + add r0, r9 + ldr r2, =0x00000d64 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 +_081928FA: + adds r1, r0 + ldrh r0, [r1] + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + ldr r1, =gSpeciesNames + adds r0, r1 + str r0, [sp, 0xC] + adds r0, r7, 0x1 + ldr r4, [sp, 0x28] + adds r0, r4 + movs r1, 0 + strb r0, [r6, 0x4] + cmp r7, 0x1 + bne _08192930 + movs r0, 0x7 + strb r0, [r6, 0x8] + b _08192932 + .pool +_08192930: + strb r1, [r6, 0x8] +_08192932: + adds r5, r7, 0x1 + ldr r0, [sp, 0x28] + adds r4, r5, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + adds r7, r5, 0 + cmp r7, 0x2 + ble _0819288A + ldr r4, [sp, 0x40] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192980 + ldr r0, =gUnknown_0860D1D0 + ldr r0, [r0, 0x40] + b _0819298A + .pool +_08192980: + ldr r0, =gUnknown_0860D1D0 + ldr r2, [sp, 0x20] + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] +_0819298A: + str r0, [sp, 0xC] + add r1, sp, 0xC + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x5] + adds r0, r1, 0 + add r3, sp, 0x40 + ldrb r3, [r3] + strb r3, [r0, 0x4] + strb r2, [r0, 0x8] + movs r1, 0x4 + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0 + bl AddTextPrinter + movs r7, 0 + ldr r3, =gUnknown_0860B358 +_081929AE: + movs r5, 0 + adds r4, r7, 0x1 + str r4, [sp, 0x38] + lsls r0, r7, 1 + str r0, [sp, 0x34] + lsls r2, r7, 4 +_081929BA: + movs r6, 0 + lsls r1, r5, 1 + mov r10, r1 + mov r4, r8 + mov r9, r2 +_081929C4: + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192A00 + lsls r0, r7, 24 + lsls r1, r5, 24 + lsrs r0, 24 + lsrs r1, 24 + str r2, [sp, 0x48] + str r3, [sp, 0x4C] + bl sub_81A5060 + lsls r0, 16 + lsrs r0, 12 + adds r0, r6, r0 + ldr r3, [sp, 0x4C] + adds r0, r3 + ldrh r1, [r4] + ldrb r0, [r0] + adds r1, r0 + strh r1, [r4] + ldr r2, [sp, 0x48] + b _08192A58 + .pool +_08192A00: + ldr r0, =0x000003ff + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192A20 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000efc + adds r0, r1 + add r0, r9 + b _08192A48 + .pool +_08192A20: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + mov r12, r0 + ldr r0, [sp, 0x3C] + ldr r1, [sp, 0x20] + adds r0, r1 + str r0, [sp, 0x50] + lsls r0, 1 + ldr r1, [sp, 0x34] + adds r0, r1, r0 + ldr r1, =0x00000d64 + add r1, r12 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + adds r0, 0x2 + add r0, r10 +_08192A48: + ldrh r0, [r0] + lsls r0, 4 + adds r0, r6, r0 + adds r0, r3 + ldrh r1, [r4] + ldrb r0, [r0] + adds r1, r0 + strh r1, [r4] +_08192A58: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0xF + ble _081929C4 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _081929BA + ldr r7, [sp, 0x38] + cmp r7, 0x2 + ble _081929AE + movs r7, 0 + ldr r2, =gUnknown_0860D214 + mov r9, r2 + ldr r3, =gUnknown_0860C988 + mov r10, r3 +_08192A78: + movs r4, 0 + movs r6, 0 + movs r5, 0 + mov r3, r8 + lsls r0, r7, 4 + mov r1, r10 + adds r2, r0, r1 +_08192A86: + ldrb r0, [r2] + cmp r0, 0 + beq _08192A9E + adds r4, 0x1 + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08192A9E + ldrb r1, [r2] + cmp r0, r1 + blt _08192A9E + adds r6, 0x1 +_08192A9E: + adds r3, 0x2 + adds r2, 0x1 + adds r5, 0x1 + cmp r5, 0xF + ble _08192A86 + cmp r4, r6 + beq _08192AB2 + adds r7, 0x1 + cmp r7, 0x1E + bls _08192A78 +_08192AB2: + lsls r0, r7, 2 + add r0, r9 + ldr r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0xC + movs r1, 0x14 + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + movs r1, 0 + mov r0, r8 + adds r0, 0x22 +_08192AD0: + strh r1, [r0] + subs r0, 0x2 + cmp r0, r8 + bge _08192AD0 + ldr r2, [sp, 0x24] + ldr r3, =0xfffffc02 + adds r0, r2, r3 + cmp r0, 0x1 + bls _08192AE4 + b _08192C24 +_08192AE4: + movs r7, 0 + movs r4, 0 + mov r9, r4 +_08192AEA: + movs r5, 0 + mov r4, r8 + mov r6, r9 +_08192AF0: + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192B24 + lsls r1, r5, 24 + lsrs r1, 24 + lsrs r0, r6, 24 + bl sub_81A50F0 + lsls r0, 24 + lsrs r0, 24 + b _08192B34 + .pool +_08192B24: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r7, 4 + adds r1, r5, r1 + ldr r2, =0x00000f04 + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] +_08192B34: + strh r0, [r4] + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x5 + ble _08192AF0 + mov r3, r8 + ldrh r0, [r3] + ldrh r4, [r3, 0xC] + adds r0, r4 + strh r0, [r3, 0xC] + movs r5, 0 + mov r4, r8 +_08192B4C: + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192B70 + mov r2, r9 + lsrs r0, r2, 24 + bl sub_81A50B0 + lsls r0, 24 + lsrs r2, r0, 24 + b _08192B7E + .pool +_08192B70: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r7, 4 + adds r0, r1 + ldr r3, =0x00000f0a + adds r0, r3 + ldrb r2, [r0] +_08192B7E: + ldr r1, =gNatureStatTable + lsls r0, r2, 2 + adds r0, r2 + adds r0, r5, r0 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _08192BB4 + movs r0, 0x2 + ldrsh r1, [r4, r0] + movs r0, 0x6E + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + b _08192BDC + .pool +_08192BB4: + cmp r0, 0 + bge _08192BD4 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r0, 0x5A + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + b _08192BDC +_08192BD4: + ldrh r0, [r4, 0x2] + ldrh r3, [r4, 0xE] + adds r0, r3 + strh r0, [r4, 0xE] +_08192BDC: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + ble _08192B4C + movs r4, 0x80 + lsls r4, 17 + add r9, r4 + adds r7, 0x1 + cmp r7, 0x2 + bgt _08192BF2 + b _08192AEA +_08192BF2: + movs r5, 0 + mov r1, r8 + movs r7, 0x5 +_08192BF8: + movs r2, 0xC + ldrsh r0, [r1, r2] + adds r5, r0 + adds r1, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192BF8 + movs r6, 0x64 + mov r4, r8 + movs r7, 0x5 +_08192C0C: + movs r3, 0xC + ldrsh r0, [r4, r3] + muls r0, r6 + adds r1, r5, 0 + bl __divsi3 + strh r0, [r4] + adds r4, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192C0C + b _08192D70 +_08192C24: + ldr r4, =gUnknown_0203BC8C + mov r10, r4 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x20] + adds r0, r1, r2 + lsls r0, 1 + mov r9, r0 + movs r7, 0x2 +_08192C34: + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r4, =0x00000d64 + adds r0, r4 + add r0, r9 + ldrh r0, [r0] + mov r2, r10 + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xB] + movs r6, 0 + movs r4, 0 + movs r3, 0x1 + mov r1, r8 + movs r5, 0x5 +_08192C54: + strh r4, [r1] + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08192C60 + adds r6, 0x1 +_08192C60: + asrs r2, 1 + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08192C54 + movs r0, 0xFF + lsls r0, 1 + adds r1, r6, 0 + bl __divsi3 + adds r6, r0, 0 + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r4, =0x00000d64 + adds r0, r4 + add r0, r9 + ldrh r0, [r0] + mov r2, r10 + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xB] + movs r3, 0x1 + mov r1, r8 + movs r5, 0x5 +_08192C92: + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08192C9C + strh r6, [r1] +_08192C9C: + asrs r2, 1 + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08192C92 + mov r3, r8 + ldrh r0, [r3] + ldrh r4, [r3, 0xC] + adds r0, r4 + strh r0, [r3, 0xC] + movs r5, 0 + mov r4, r8 +_08192CB4: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000d64 + adds r0, r2 + add r0, r9 + ldrh r0, [r0] + mov r3, r10 + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xC] + lsls r0, r2, 2 + adds r0, r2 + adds r0, r5, r0 + ldr r1, =gNatureStatTable + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _08192D04 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r0, 0x6E + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + b _08192D2C + .pool +_08192D04: + cmp r0, 0 + bge _08192D24 + movs r3, 0x2 + ldrsh r1, [r4, r3] + movs r0, 0x5A + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + b _08192D2C +_08192D24: + ldrh r0, [r4, 0x2] + ldrh r1, [r4, 0xE] + adds r0, r1 + strh r0, [r4, 0xE] +_08192D2C: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + ble _08192CB4 + movs r2, 0x2 + add r9, r2 + subs r7, 0x1 + cmp r7, 0 + blt _08192D40 + b _08192C34 +_08192D40: + movs r5, 0 + mov r1, r8 + movs r7, 0x5 +_08192D46: + movs r3, 0xC + ldrsh r0, [r1, r3] + adds r5, r0 + adds r1, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192D46 + movs r6, 0x64 + mov r4, r8 + movs r7, 0x5 +_08192D5A: + movs r1, 0xC + ldrsh r0, [r4, r1] + muls r0, r6 + adds r1, r5, 0 + bl __divsi3 + strh r0, [r4] + adds r4, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192D5A +_08192D70: + movs r7, 0 + movs r5, 0 + movs r6, 0 + mov r4, r8 + mov r10, r8 + mov r9, r8 +_08192D7C: + movs r2, 0 + ldrsh r1, [r4, r2] + cmp r1, 0x1D + ble _08192DDE + cmp r7, 0x2 + bne _08192DD4 + mov r3, r8 + movs r0, 0xC + ldrsh r3, [r3, r0] + mov r12, r3 + cmp r12, r1 + bge _08192DC6 + mov r2, r8 + ldrh r2, [r2, 0xE] + add r3, sp, 0x54 + strh r2, [r3] + mov r2, r8 + movs r3, 0xE + ldrsh r0, [r2, r3] + cmp r0, r1 + bge _08192DBA + cmp r12, r0 + bge _08192DB4 + add r0, sp, 0x54 + ldrh r0, [r0] + strh r0, [r2, 0xC] + strh r6, [r2, 0xE] + b _08192DDE +_08192DB4: + mov r1, r8 + strh r6, [r1, 0xE] + b _08192DDE +_08192DBA: + add r2, sp, 0x54 + ldrh r3, [r2] + mov r2, r8 + strh r3, [r2, 0xC] + strh r6, [r2, 0xE] + b _08192DDE +_08192DC6: + mov r3, r8 + movs r2, 0xE + ldrsh r0, [r3, r2] + cmp r0, r1 + bge _08192DDE + strh r6, [r3, 0xE] + b _08192DDE +_08192DD4: + mov r3, r9 + strh r6, [r3, 0xC] + movs r0, 0x2 + add r9, r0 + adds r7, 0x1 +_08192DDE: + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08192E64 + cmp r5, 0x2 + bne _08192E5A + movs r2, 0x18 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + bgt _08192E18 + cmp r0, 0x1 + bne _08192E64 + mov r3, r8 + movs r1, 0x10 + ldrsh r0, [r3, r1] + lsls r0, 1 + add r0, r8 + movs r2, 0x18 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _08192E22 + movs r1, 0x12 + ldrsh r0, [r3, r1] + lsls r0, 1 + add r0, r8 + movs r2, 0x18 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _08192E22 +_08192E18: + mov r3, r8 + ldrh r0, [r3, 0x12] + strh r0, [r3, 0x10] + strh r6, [r3, 0x12] + b _08192E64 +_08192E22: + movs r1, 0x18 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08192E64 + mov r2, r8 + movs r3, 0x10 + ldrsh r0, [r2, r3] + lsls r0, 1 + add r0, r8 + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08192E44 + ldrh r0, [r2, 0x12] + strh r0, [r2, 0x10] + strh r6, [r2, 0x12] + b _08192E64 +_08192E44: + mov r2, r8 + movs r3, 0x12 + ldrsh r0, [r2, r3] + lsls r0, 1 + add r0, r8 + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08192E64 + strh r6, [r2, 0x12] + b _08192E64 +_08192E5A: + mov r2, r10 + strh r6, [r2, 0x10] + movs r3, 0x2 + add r10, r3 + adds r5, 0x1 +_08192E64: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08192D7C + cmp r7, 0x2 + bne _08192E8C + ldr r0, =gUnknown_0860D349 + mov r4, r8 + movs r1, 0xC + ldrsh r2, [r4, r1] + adds r0, r2, r0 + movs r3, 0xE + ldrsh r1, [r4, r3] + subs r1, 0x1 + subs r1, r2 + ldrb r0, [r0] + adds r7, r1, r0 + b _08192ED2 + .pool +_08192E8C: + cmp r7, 0x1 + bne _08192E9C + mov r4, r8 + movs r1, 0xC + ldrsh r0, [r4, r1] + adds r7, r0, 0 + adds r7, 0xF + b _08192ED2 +_08192E9C: + cmp r5, 0x2 + bne _08192EC0 + ldr r0, =gUnknown_0860D349 + mov r3, r8 + movs r4, 0x10 + ldrsh r2, [r3, r4] + adds r0, r2, r0 + movs r4, 0x12 + ldrsh r1, [r3, r4] + subs r1, 0x1 + subs r1, r2 + ldrb r0, [r0] + adds r1, r0 + adds r7, r1, 0 + adds r7, 0x15 + b _08192ED2 + .pool +_08192EC0: + cmp r5, 0x1 + bne _08192ED0 + mov r1, r8 + movs r2, 0x10 + ldrsh r0, [r1, r2] + adds r7, r0, 0 + adds r7, 0x24 + b _08192ED2 +_08192ED0: + movs r7, 0x2A +_08192ED2: + lsls r0, r7, 2 + ldr r3, =gUnknown_0860D294 + adds r0, r3 + ldr r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0xC + movs r1, 0x24 + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + mov r0, r8 + bl Free + add sp, 0x58 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81924E0 + + thumb_func_start sub_8192F08 +sub_8192F08: @ 8192F08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + str r1, [sp] + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + str r0, [sp, 0x4] + mov r8, r0 + ldr r2, =gUnknown_0860D3C4 + lsls r0, r7, 1 + adds r0, r7 + adds r1, r0, r2 + ldrb r6, [r1] + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + adds r0, r6, r0 + adds r3, r2, 0 + cmp r6, r0 + bge _08192FD4 + ldr r5, =gSaveBlock2Ptr + ldr r1, =0x000003ff + mov r10, r1 + ldr r2, =0x000003fe + mov r9, r2 +_08192F42: + ldr r0, =gUnknown_0860D3B4 + adds r0, r6, r0 + ldrb r4, [r0] + ldr r0, [r5] + lsls r1, r4, 2 + adds r0, r1 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08192FBE + ldr r0, [sp] + add r0, r8 + strb r4, [r0] + ldr r2, [r5] + adds r0, r2, r1 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 22 + lsrs r0, r1, 22 + cmp r0, r10 + bne _08192F9C + ldr r0, =gStringVar1 + adds r1, r2, 0 + bl StringCopy + b _08192FB8 + .pool +_08192F9C: + lsrs r0, r1, 22 + cmp r0, r9 + bne _08192FB0 + ldr r0, =gStringVar1 + bl sub_8195938 + b _08192FB8 + .pool +_08192FB0: + lsrs r1, 22 + ldr r0, =gStringVar1 + bl sub_8195898 +_08192FB8: + movs r2, 0x1 + add r8, r2 + ldr r3, =gUnknown_0860D3C4 +_08192FBE: + adds r6, 0x1 + lsls r1, r7, 1 + adds r1, r7 + adds r0, r1, r3 + ldrb r2, [r0] + adds r0, r3, 0x1 + adds r1, r0 + ldrb r0, [r1] + adds r2, r0 + cmp r6, r2 + blt _08192F42 +_08192FD4: + mov r5, r8 + cmp r5, 0x2 + bne _08192FE8 + movs r0, 0 + b _0819313C + .pool +_08192FE8: + mov r12, r3 + lsls r3, r7, 1 + adds r0, r3, r7 + mov r2, r12 + adds r1, r0, r2 + ldrb r6, [r1] + mov r1, r12 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + adds r0, r6, r0 + str r3, [sp, 0x8] + cmp r6, r0 + blt _08193006 + b _08193126 +_08193006: + ldr r5, =gSaveBlock2Ptr + mov r10, r5 + ldr r0, =0x00000d25 + mov r9, r0 +_0819300E: + ldr r0, =gUnknown_0860D3B4 + adds r0, r6, r0 + ldrb r4, [r0] + mov r1, r10 + ldr r0, [r1] + lsls r2, r4, 2 + str r2, [sp, 0xC] + adds r0, r2 + add r0, r9 + ldrb r2, [r0] + lsls r0, r2, 29 + cmp r0, 0 + bge _08193100 + lsls r2, 27 + adds r1, r3, r7 + mov r0, r12 + adds r0, 0x2 + adds r1, r0 + lsrs r2, 30 + ldrb r1, [r1] + cmp r2, r1 + bcc _08193100 + ldr r0, [sp] + add r0, r8 + strb r4, [r0] + movs r5, 0x1 + add r8, r5 + mov r0, r10 + ldr r3, [r0] + ldr r5, [sp, 0xC] + adds r2, r3, r5 + adds r0, r2, 0 + add r0, r9 + ldrb r5, [r0] + mov r12, r5 + mov r0, r12 + lsls r0, 27 + lsrs r0, 30 + cmp r0, r1 + bne _081930BC + lsls r4, 1 + movs r1, 0xEC + lsls r1, 4 + adds r0, r3, r1 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + ldr r0, =gStringVar2 + bl StringCopy + mov r2, r10 + ldr r1, [r2] + ldr r5, [sp, 0xC] + adds r0, r1, r5 + add r0, r9 + ldrb r0, [r0] + lsls r2, r0, 24 + lsrs r0, r2, 29 + lsls r0, 1 + str r0, [sp, 0x4] + movs r0, 0xEC + lsls r0, 4 + adds r1, r0 + adds r1, r4 + ldrh r0, [r1] + cmp r0, 0 + bne _08193100 + lsrs r0, r2, 29 + cmp r0, 0 + bne _08193100 + movs r1, 0x4 + str r1, [sp, 0x4] + b _08193100 + .pool +_081930BC: + ldr r5, =0x00000d24 + adds r0, r2, r5 + ldrh r0, [r0] + lsls r1, r0, 22 + ldr r0, =0xffc00000 + cmp r1, r0 + bne _081930E0 + ldr r0, =gStringVar1 + adds r1, r3, 0 + bl StringCopy + b _08193100 + .pool +_081930E0: + ldr r0, =0xff800000 + cmp r1, r0 + bne _081930F8 + ldr r0, =gStringVar1 + bl sub_8195938 + b _08193100 + .pool +_081930F8: + lsrs r1, 22 + ldr r0, =gStringVar1 + bl sub_8195898 +_08193100: + mov r0, r8 + cmp r0, 0x2 + beq _08193126 + adds r6, 0x1 + ldr r1, =gUnknown_0860D3C4 + mov r12, r1 + ldr r3, [sp, 0x8] + adds r1, r3, r7 + mov r2, r12 + adds r0, r1, r2 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + adds r2, r0 + cmp r6, r2 + bge _08193126 + b _0819300E +_08193126: + cmp r7, 0xE + beq _08193138 + ldr r0, [sp, 0x4] + adds r0, 0x1 + b _0819313C + .pool +_08193138: + ldr r0, [sp, 0x4] + adds r0, 0x2 +_0819313C: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8192F08 + + thumb_func_start sub_819314C +sub_819314C: @ 819314C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x80 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x34] + lsls r1, 24 + lsrs r6, r1, 24 + movs r0, 0 + str r0, [sp, 0x3C] + movs r7, 0 + movs r1, 0 + str r1, [sp, 0x40] + movs r2, 0 + str r2, [sp, 0x44] + mov r9, r2 + movs r0, 0x1 + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _08193186 + movs r7, 0x8 + str r7, [sp, 0x3C] + movs r7, 0x9 + movs r0, 0x2 + mov r9, r0 +_08193186: + movs r0, 0x2 + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _08193196 + movs r2, 0x80 + lsls r2, 1 + str r2, [sp, 0x40] +_08193196: + movs r0, 0x4 + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _081931A4 + movs r0, 0xA0 + str r0, [sp, 0x44] +_081931A4: + movs r0, 0x8 + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _081931B2 + ldr r2, =0xffffff00 + str r2, [sp, 0x40] +_081931B2: + movs r0, 0x10 + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _081931C2 + movs r0, 0xA0 + negs r0, r0 + str r0, [sp, 0x44] +_081931C2: + ldr r4, =gUnknown_0203CD78 + ldr r1, [r4] + adds r1, 0x11 + adds r0, r6, 0 + bl sub_8192F08 + str r0, [sp, 0x38] + movs r5, 0 + mov r1, sp + adds r1, 0x1C + str r1, [sp, 0x48] + mov r2, sp + adds r2, 0x24 + str r2, [sp, 0x4C] + lsls r1, r6, 1 + mov r3, sp + adds r3, 0x2C + str r3, [sp, 0x50] + ldr r0, [sp, 0x40] + adds r0, 0x30 + mov r8, r0 + ldr r2, [sp, 0x44] + adds r2, 0x58 + str r2, [sp, 0x78] + movs r3, 0xC + add r3, r9 + mov r10, r3 + ldr r0, [sp, 0x40] + adds r0, 0xC0 + str r0, [sp, 0x7C] + mov r2, r9 + adds r2, 0xD + str r2, [sp, 0x74] + ldr r3, [sp, 0x3C] + adds r3, 0x1 + mov r9, r3 + ldr r0, [sp, 0x3C] + adds r0, 0x2 + str r0, [sp, 0x54] + ldr r2, [sp, 0x3C] + adds r2, 0x5 + str r2, [sp, 0x5C] + adds r3, r7, 0 + adds r3, 0x8 + str r3, [sp, 0x6C] + adds r0, r7, 0x6 + str r0, [sp, 0x64] + adds r2, r7, 0x7 + str r2, [sp, 0x68] + lsls r3, r6, 2 + str r3, [sp, 0x58] + adds r0, r7, 0x5 + str r0, [sp, 0x60] + ldr r0, [r4] + adds r0, 0x11 + mov r12, r0 + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r0, =gUnknown_0860D3C6 + movs r3, 0 + adds r1, r6 + adds r1, r0 + ldrb r6, [r1] +_08193240: + ldr r1, [sp, 0x48] + adds r2, r3, r1 + mov r7, r12 + adds r0, r7, r5 + ldrb r0, [r0] + str r0, [r2] + ldr r7, [sp, 0x4C] + adds r1, r3, r7 + lsls r0, 2 + adds r0, r4, r0 + ldr r7, =0x00000d24 + adds r0, r7 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + str r0, [r1] + ldr r0, [r2] + lsls r0, 2 + adds r0, r4, r0 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 27 + lsrs r0, 30 + cmp r0, r6 + bhi _0819329C + lsls r0, r1, 29 + cmp r0, 0 + bge _0819329C + ldr r2, [sp, 0x50] + adds r1, r3, r2 + movs r0, 0x1 + b _081932A2 + .pool +_0819329C: + ldr r7, [sp, 0x50] + adds r1, r3, r7 + movs r0, 0 +_081932A2: + str r0, [r1] + adds r3, 0x4 + adds r5, 0x1 + cmp r5, 0x1 + ble _08193240 + ldr r1, [sp, 0x24] + ldr r0, =0x000003ff + cmp r1, r0 + bne _081932D4 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + mov r2, r8 + ldr r3, [sp, 0x78] + mov r1, r10 + str r1, [sp] + b _081932F8 + .pool +_081932D4: + ldr r0, =0x000003fe + cmp r1, r0 + bne _081932E4 + bl sub_8195910 + b _081932EC + .pool +_081932E4: + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_8162AA0 +_081932EC: + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + ldr r3, [sp, 0x78] + mov r7, r10 + str r7, [sp] +_081932F8: + ldr r1, =0x0000ffff + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D8AC + ldr r1, =gUnknown_0203CD78 + ldr r1, [r1] + ldr r2, [sp, 0x3C] + adds r1, r2 + strb r0, [r1] + movs r0, 0x1E + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _08193334 + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldr r7, [sp, 0x3C] + adds r0, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08193334: + ldr r0, [sp, 0x2C] + cmp r0, 0 + beq _0819335A + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldr r1, [sp, 0x3C] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x5] + movs r1, 0xF + ands r1, r2 + movs r2, 0x30 + orrs r1, r2 + strb r1, [r0, 0x5] +_0819335A: + ldr r2, [sp, 0x4C] + ldr r1, [r2, 0x4] + ldr r0, =0x000003ff + cmp r1, r0 + bne _08193388 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + b _081933B0 + .pool +_08193388: + ldr r0, =0x000003fe + cmp r1, r0 + bne _081933A4 + bl sub_8195910 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x7C] + ldr r3, [sp, 0x78] + ldr r1, [sp, 0x74] + str r1, [sp] + b _081933B8 + .pool +_081933A4: + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_8162AA0 + lsls r0, 24 + lsrs r0, 24 +_081933B0: + ldr r2, [sp, 0x7C] + ldr r3, [sp, 0x78] + ldr r7, [sp, 0x74] + str r7, [sp] +_081933B8: + ldr r1, =0x0000ffff + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D8AC + ldr r1, =gUnknown_0203CD78 + ldr r1, [r1] + add r1, r9 + strb r0, [r1] + movs r0, 0x1E + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _081933F0 + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_081933F0: + ldr r2, [sp, 0x50] + ldr r0, [r2, 0x4] + cmp r0, 0 + beq _08193416 + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x5] + movs r1, 0xF + ands r1, r2 + movs r2, 0x30 + orrs r1, r2 + strb r1, [r0, 0x5] +_08193416: + movs r5, 0 + ldr r3, [sp, 0x38] + lsls r3, 2 + str r3, [sp, 0x70] + mov r8, r5 + ldr r6, =gUnknown_0203CD78 + ldr r7, =gSprites + ldr r4, [sp, 0x54] + mov r9, r5 + movs r0, 0x1 + mov r10, r0 +_0819342C: + ldr r1, [sp, 0x24] + ldr r0, =0x000003ff + cmp r1, r0 + bne _08193464 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, [sp, 0x1C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081934B0 + .pool +_08193464: + ldr r0, =0x000003fe + cmp r1, r0 + bne _08193490 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, [sp, 0x1C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081934B0 + .pool +_08193490: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, [sp, 0x1C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r1, [r2] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] +_081934B0: + ldr r1, =gUnknown_0860D3A8 + adds r1, r5, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x40] + orrs r2, r3 + ldr r1, =gUnknown_0860D3AB + adds r1, r5, r1 + ldrb r3, [r1] + ldr r1, [sp, 0x44] + adds r3, r1 + mov r1, r8 + str r1, [sp] + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + ldr r1, =sub_8190938 + bl sub_80D2CC4 + ldr r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r1, [r0, 0x5] + movs r3, 0xD + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0, 0x5] + movs r0, 0x1E + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _08193516 + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08193516: + ldr r0, [sp, 0x2C] + cmp r0, 0 + beq _08193548 + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x30 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r10 + strh r2, [r0, 0x34] +_08193548: + adds r4, 0x1 + movs r3, 0x2 + add r9, r3 + adds r5, 0x1 + cmp r5, 0x2 + bgt _08193556 + b _0819342C +_08193556: + movs r5, 0 + ldr r6, =gUnknown_0203CD78 + ldr r7, =gSprites + mov r8, r7 + ldr r4, [sp, 0x5C] + mov r9, r5 + movs r7, 0 +_08193564: + ldr r0, [sp, 0x4C] + ldr r1, [r0, 0x4] + ldr r0, =0x000003ff + cmp r1, r0 + bne _081935AC + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r3, [sp, 0x48] + ldr r1, [r3, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081935FA + .pool +_081935AC: + ldr r0, =0x000003fe + cmp r1, r0 + bne _081935D8 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, [sp, 0x48] + ldr r1, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081935FA + .pool +_081935D8: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, [sp, 0x48] + ldr r1, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r1, [r2] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] +_081935FA: + ldr r1, =gUnknown_0860D3AE + adds r1, r5, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x40] + orrs r2, r3 + ldr r1, =gUnknown_0860D3B1 + adds r1, r5, r1 + ldrb r3, [r1] + ldr r1, [sp, 0x44] + adds r3, r1 + str r7, [sp] + str r7, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + ldr r1, =sub_8190938 + bl sub_80D2CC4 + ldr r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r1, [r0, 0x5] + movs r3, 0xD + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0, 0x5] + movs r0, 0x1E + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _0819365E + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0819365E: + ldr r2, [sp, 0x50] + ldr r0, [r2, 0x4] + cmp r0, 0 + beq _08193692 + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x30 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x1 + strh r1, [r0, 0x34] +_08193692: + adds r4, 0x1 + movs r3, 0x2 + add r9, r3 + adds r5, 0x1 + cmp r5, 0x2 + bgt _081936A0 + b _08193564 +_081936A0: + add r0, sp, 0xC + movs r5, 0 + strb r5, [r0, 0x6] + adds r1, r0, 0 + movs r0, 0x2 + strb r0, [r1, 0x7] + adds r0, r1, 0 + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + adds r0, r1, 0 + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r1, 0 + strb r5, [r0, 0xA] + strb r5, [r0, 0xB] + adds r3, r0, 0 + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xE0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + ldr r4, =gStringVar4 + ldr r0, =gUnknown_0860D38C + ldr r7, [sp, 0x70] + adds r0, r7, r0 + ldr r1, [r0] + adds r0, r4, 0 + bl StringExpandPlaceholders + str r4, [sp, 0xC] + add r0, sp, 0xC + add r1, sp, 0x6C + ldrb r1, [r1] + strb r1, [r0, 0x4] + adds r1, r0, 0 + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r4, [sp, 0x6C] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + strb r5, [r0, 0x8] + adds r1, r0, 0 + strb r5, [r0, 0x7] + strb r5, [r1, 0x9] + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + ldr r1, [sp, 0x24] + ldr r0, =0x000003ff + cmp r1, r0 + bne _0819375C + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + bl StringCopy + b _0819377E + .pool +_0819375C: + ldr r0, =0x000003fe + cmp r1, r0 + bne _08193774 + ldr r0, =gStringVar1 + bl sub_8195938 + b _0819377E + .pool +_08193774: + ldr r0, =gStringVar1 + lsls r1, 16 + lsrs r1, 16 + bl sub_8195898 +_0819377E: + add r0, sp, 0xC + movs r4, 0x2 + strb r4, [r0, 0x5] + strb r4, [r0, 0xA] + ldr r5, =gStringVar1 + str r5, [sp, 0xC] + add r2, sp, 0x64 + ldrb r2, [r2] + strb r2, [r0, 0x4] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0xC] + add r2, sp, 0xC + ldrb r3, [r2, 0xA] + movs r2, 0x40 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0xC + strb r0, [r1, 0x8] + adds r0, r1, 0 + strb r4, [r0, 0x7] + strb r4, [r1, 0x9] + ldr r4, [sp, 0x64] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + ldr r3, [sp, 0x4C] + ldr r1, [r3, 0x4] + ldr r0, =0x000003ff + cmp r1, r0 + bne _081937E4 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r5, 0 + bl StringCopy + b _08193802 + .pool +_081937E4: + ldr r0, =0x000003fe + cmp r1, r0 + bne _081937F8 + adds r0, r5, 0 + bl sub_8195938 + b _08193802 + .pool +_081937F8: + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_8195898 +_08193802: + ldr r0, =gStringVar1 + str r0, [sp, 0xC] + add r0, sp, 0xC + movs r6, 0 + add r7, sp, 0x68 + ldrb r7, [r7] + strb r7, [r0, 0x4] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0xC] + add r2, sp, 0xC + ldrb r3, [r2, 0xA] + movs r2, 0x40 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0xC + strb r0, [r1, 0x8] + adds r0, r1, 0 + movs r5, 0x2 + strb r5, [r0, 0x7] + strb r5, [r1, 0x9] + ldr r4, [sp, 0x68] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + add r0, sp, 0xC + strb r6, [r0, 0xA] + ldr r0, =gUnknown_0860D350 + ldr r1, [sp, 0x58] + adds r0, r1, r0 + ldr r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0xC + add r2, sp, 0x60 + ldrb r2, [r2] + strb r2, [r0, 0x4] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0xC] + add r2, sp, 0xC + ldrb r3, [r2, 0xA] + movs r2, 0xA0 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0xC + strb r0, [r1, 0x8] + adds r0, r1, 0 + strb r5, [r0, 0x7] + strb r5, [r1, 0x9] + ldr r4, [sp, 0x60] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + add sp, 0x80 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819314C + + thumb_func_start sub_81938A4 +sub_81938A4: @ 81938A4 + push {lr} + ldr r0, =sub_8194220 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + strh r2, [r1, 0xA] + movs r0, 0x2 + strh r0, [r1, 0xC] + strh r2, [r1, 0x10] + ldr r0, =sub_8194B54 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81938A4 + + thumb_func_start sub_81938E0 +sub_81938E0: @ 81938E0 + push {r4,lr} + bl sub_8194D48 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + ldr r1, =0x00000d0a + adds r0, r2, r1 + ldrb r1, [r0] + subs r1, 0x1 + ldr r0, =0x00000ca9 + adds r2, r0 + movs r0, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r4] + ldr r1, =0x00000cb2 + adds r0, r1 + movs r4, 0 + movs r1, 0x3 + strh r1, [r0] + ldr r0, =sub_8194220 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + strh r4, [r1, 0xA] + movs r0, 0x2 + strh r0, [r1, 0xC] + movs r0, 0x1 + strh r0, [r1, 0x10] + ldr r0, =sub_8194B54 + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81938E0 + + thumb_func_start sub_819395C +sub_819395C: @ 819395C + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0xA + ldrsh r7, [r0, r2] + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x7 + bls _0819397E + b _08193BC2 +_0819397E: + lsls r0, 2 + ldr r1, =_08193990 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08193990: + .4byte _081939B0 + .4byte _08193A00 + .4byte _08193A20 + .4byte _08193AA8 + .4byte _08193BC2 + .4byte _08193B20 + .4byte _08193BC2 + .4byte _08193B84 +_081939B0: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _081939C2 + b _08193BC2 +_081939C2: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x1 + bl StartSpriteAnim + b _08193BC2 + .pool +_08193A00: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08193A0E + b _08193BC2 +_08193A0E: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193A20: + adds r0, r5, 0 + bl sub_8193BDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08193A30 + b _08193BC2 +_08193A30: + cmp r0, 0x1 + ble _08193A3C + cmp r0, 0x2 + beq _08193A60 + cmp r0, 0x3 + beq _08193A84 +_08193A3C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x7 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193A60: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193A84: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x5 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193AA8: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _08193ABA + b _08193BC2 +_08193ABA: + bl FreeAllWindowBuffers + bl remove_some_task + ldr r4, =gUnknown_0203CD7C + ldr r0, [r4] + bl Free + str r6, [r4] + ldr r0, =sub_8190400 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =gTasks + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r2 + movs r3, 0 + strh r6, [r1, 0x8] + ldr r0, =gUnknown_0860D080 + adds r0, r7, r0 + ldrb r0, [r0] + strh r0, [r1, 0xA] + movs r0, 0x1 + strh r0, [r1, 0xC] + strh r5, [r1, 0xE] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x4 + strh r1, [r0, 0x8] + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + strb r3, [r0, 0x10] + b _08193BC2 + .pool +_08193B20: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08193BC2 + bl FreeAllWindowBuffers + bl remove_some_task + ldr r4, =gUnknown_0203CD7C + ldr r0, [r4] + bl Free + str r6, [r4] + ldr r0, =sub_8190400 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =gTasks + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r2 + strh r6, [r0, 0x8] + adds r1, r7, 0 + subs r1, 0x10 + strh r1, [r0, 0xA] + movs r1, 0x2 + strh r1, [r0, 0xC] + strh r5, [r0, 0xE] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x6 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193B84: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08193BC2 + bl FreeAllWindowBuffers + bl remove_some_task + ldr r4, =gUnknown_0203CD7C + ldr r0, [r4] + bl Free + str r6, [r4] + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x16] + bl DestroyTask + adds r0, r5, 0 + bl DestroyTask +_08193BC2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819395C + + thumb_func_start sub_8193BDC +sub_8193BDC: @ 8193BDC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x1 + mov r9, r0 + movs r1, 0x4 + mov r8, r1 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA + ldrsh r5, [r0, r1] + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r6, [r0] + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + adds r2, r1, 0 + adds r3, r0, 0 + cmp r2, 0x2 + beq _08193C20 + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _08193C58 + cmp r5, 0x1F + bne _08193C3C +_08193C20: + movs r0, 0x5 + bl PlaySE + movs r0, 0 + mov r9, r0 + b _08193CDE + .pool +_08193C3C: + cmp r5, 0xF + bgt _08193C4C + movs r0, 0x5 + bl PlaySE + movs r1, 0x2 + mov r9, r1 + b _08193CDE +_08193C4C: + movs r0, 0x5 + bl PlaySE + movs r0, 0x3 + mov r9, r0 + b _08193CDE +_08193C58: + cmp r2, 0x40 + bne _08193C78 + ldr r0, =gUnknown_0860CBF1 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193C78 + movs r1, 0 + mov r8, r1 + b _08193CDE + .pool +_08193C78: + ldrh r0, [r3, 0x2E] + cmp r0, 0x80 + bne _08193C9C + ldr r0, =gUnknown_0860CBF1 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193C9C + movs r0, 0x1 + b _08193CDC + .pool +_08193C9C: + ldrh r0, [r3, 0x2E] + cmp r0, 0x20 + bne _08193CC0 + ldr r0, =gUnknown_0860CBF1 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r0, 0x2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193CC0 + movs r1, 0x2 + mov r8, r1 + b _08193CDE + .pool +_08193CC0: + ldrh r0, [r3, 0x2E] + cmp r0, 0x10 + bne _08193CDE + ldr r0, =gUnknown_0860CBF1 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193CDE + movs r0, 0x3 +_08193CDC: + mov r8, r0 +_08193CDE: + mov r1, r8 + cmp r1, 0x4 + beq _08193D26 + movs r0, 0x5 + bl PlaySE + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + movs r1, 0 + bl StartSpriteAnim + ldr r2, =gUnknown_0860CBF1 + lsls r1, r6, 2 + add r1, r8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r5, [r1] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAnim + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xA] +_08193D26: + mov r0, r9 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8193BDC + + thumb_func_start sub_8193D40 +sub_8193D40: @ 8193D40 + push {lr} + ldr r0, =sub_8194220 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + movs r0, 0x1 + strh r0, [r1, 0xA] + movs r0, 0x2 + strh r0, [r1, 0xC] + strh r2, [r1, 0x10] + ldr r0, =sub_8194B54 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8193D40 + + thumb_func_start sub_8193D7C +sub_8193D7C: @ 8193D7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r7, =gSpecialVar_0x8005 + ldrh r0, [r7] + cmp r0, 0x1 + bne _08193E10 + ldr r5, =gTrainerBattleOpponent_A + ldrh r0, [r5] + bl sub_8195358 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + lsls r0, 2 + adds r2, r0 + ldr r6, =0x00000d25 + adds r2, r6 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r5] + bl sub_8195358 + ldr r1, [r4] + lsls r0, 2 + adds r0, r1, r0 + ldr r2, =0x00000cb2 + mov r8, r2 + add r1, r8 + adds r0, r6 + movs r3, 0x3 + ldrb r2, [r1] + ands r2, r3 + lsls r2, 3 + ldrb r3, [r0] + movs r1, 0x19 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0] + ldrh r0, [r5] + bl sub_8195358 + ldr r2, [r4] + lsls r0, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r2, r3 + adds r1, r0 + ldr r0, =gBattleResults + ldrh r0, [r0, 0x22] + strh r0, [r1] + add r2, r8 + ldrh r0, [r2] + cmp r0, 0x2 + bhi _08193EAE + lsls r0, 24 + lsrs r0, 24 + bl sub_8195438 + b _08193EAE + .pool +_08193E10: + ldr r5, =0x000003ff + adds r0, r5, 0 + bl sub_8195358 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + lsls r0, 2 + adds r2, r0 + ldr r6, =0x00000d25 + adds r2, r6 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + adds r0, r5, 0 + bl sub_8195358 + ldr r1, [r4] + lsls r0, 2 + adds r0, r1, r0 + ldr r2, =0x00000cb2 + adds r1, r2 + adds r0, r6 + movs r3, 0x3 + ldrb r2, [r1] + ands r2, r3 + lsls r2, 3 + ldrb r3, [r0] + movs r1, 0x19 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0] + adds r0, r5, 0 + bl sub_8195358 + ldr r1, [r4] + lsls r0, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r3 + adds r1, r0 + ldr r0, =gBattleResults + ldrh r0, [r0, 0x24] + strh r0, [r1] + ldr r0, =gBattleOutcome + ldrb r0, [r0] + cmp r0, 0x9 + beq _08193E78 + ldrh r0, [r7] + cmp r0, 0x9 + bne _08193E92 +_08193E78: + adds r0, r5, 0 + bl sub_8195358 + ldr r2, [r4] + lsls r0, 2 + adds r2, r0 + adds r2, r6 + ldrb r1, [r2] + movs r0, 0x1F + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] +_08193E92: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r4, [r0] + cmp r4, 0x3 + bgt _08193EAE +_08193EA0: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8195438 + adds r4, 0x1 + cmp r4, 0x3 + ble _08193EA0 +_08193EAE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8193D7C + + thumb_func_start sub_8193ED0 +sub_8193ED0: @ 8193ED0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x84 + str r0, [sp, 0x48] + str r1, [sp, 0x4C] + lsls r4, r2, 24 + lsrs r4, 24 + movs r0, 0 + str r0, [sp, 0x54] + movs r1, 0 + str r1, [sp, 0x58] + bl sub_8165C40 + movs r2, 0 + str r2, [sp, 0x50] + add r3, sp, 0x30 + mov r10, r3 + ldr r5, [sp, 0x4C] + lsls r5, 1 + str r5, [sp, 0x70] + subs r4, 0x1 + str r4, [sp, 0x78] +_08193F02: + movs r0, 0 + mov r9, r0 + ldr r1, [sp, 0x50] + lsls r1, 2 + str r1, [sp, 0x74] + ldr r2, [sp, 0x48] + lsls r2, 2 + str r2, [sp, 0x6C] + ldr r3, [sp, 0x50] + adds r3, 0x1 + str r3, [sp, 0x60] +_08193F18: + ldr r4, [sp, 0x74] + add r4, r9 + lsls r0, r4, 2 + mov r5, sp + adds r1, r5, r0 + movs r0, 0 + str r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r1, [sp, 0x6C] + adds r0, r3, r1 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + ldr r1, =0xff800000 + cmp r0, r1 + bne _08193F60 + ldr r3, [sp, 0x50] + lsls r0, r3, 24 + mov r5, r9 + lsls r1, r5, 24 + lsrs r1, 24 + lsrs r0, 24 + bl sub_81A5060 + lsls r1, r4, 1 + add r1, r10 + strh r0, [r1] + b _08193F8C + .pool +_08193F60: + lsls r2, r4, 1 + add r2, r10 + ldr r1, [sp, 0x48] + lsls r0, r1, 1 + adds r0, r1 + ldr r4, [sp, 0x50] + adds r0, r4 + lsls r0, 1 + ldr r5, =0x00000d64 + adds r1, r3, r5 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + mov r3, r9 + lsls r1, r3, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] +_08193F8C: + ldr r0, =gBattleMoves + ldr r1, [sp, 0x74] + add r1, r9 + lsls r1, 1 + add r1, r10 + ldrh r2, [r1] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r6, [r1, 0x1] + cmp r6, 0 + bne _08193FB8 + movs r6, 0x28 + b _08193FD0 + .pool +_08193FB8: + cmp r6, 0x1 + bne _08193FC0 + movs r6, 0x3C + b _08193FD0 +_08193FC0: + adds r1, r2, 0 + cmp r1, 0x78 + beq _08193FCA + cmp r1, 0x99 + bne _08193FD0 +_08193FCA: + lsrs r0, r6, 31 + adds r0, r6, r0 + asrs r6, r0, 1 +_08193FD0: + movs r1, 0 + mov r4, r9 + adds r4, 0x1 + str r4, [sp, 0x64] + ldr r5, [sp, 0x70] + ldr r2, [sp, 0x4C] + adds r0, r5, r2 + lsls r0, 1 + str r0, [sp, 0x5C] +_08193FE2: + lsls r7, r1, 1 + adds r1, 0x1 + str r1, [sp, 0x68] + ldr r3, [sp, 0x5C] + adds r3, r7 + mov r8, r3 +_08193FEE: + bl Random + adds r4, r0, 0 + bl Random + lsls r4, 16 + lsrs r5, r4, 16 + lsls r0, 16 + orrs r5, r0 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r4, =0x00000d64 + adds r0, r4 + add r0, r8 + ldrh r4, [r0] + ldr r3, =gUnknown_0203BC8C + ldr r0, [r3] + lsls r4, 4 + adds r4, r0 + adds r0, r5, 0 + str r2, [sp, 0x7C] + str r3, [sp, 0x80] + bl GetNatureFromPersonality + ldrb r1, [r4, 0xC] + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x7C] + ldr r3, [sp, 0x80] + cmp r1, r0 + bne _08193FEE + ldr r0, [r2] + ldr r2, [sp, 0x5C] + adds r1, r7, r2 + ldr r4, =0x00000d64 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x1 + ands r5, r0 + cmp r5, 0 + beq _08194068 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r5, =gBaseStats + adds r0, r5 + ldrb r2, [r0, 0x17] + b _08194074 + .pool +_08194068: + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r2, =gBaseStats + adds r0, r2 + ldrb r2, [r0, 0x16] +_08194074: + ldr r4, [sp, 0x74] + add r4, r9 + lsls r0, r4, 1 + add r0, r10 + ldrh r0, [r0] + bl ai_rate_move + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x6 + ands r0, r5 + cmp r0, 0x6 + bne _0819409C + lsls r0, r4, 2 + mov r3, sp + adds r1, r3, r0 + b _081940D8 + .pool +_0819409C: + movs r0, 0x29 + ands r0, r5 + cmp r0, 0 + bne _081940DE + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _081940B6 + lsls r0, r4, 2 + mov r5, sp + adds r2, r5, r0 + lsls r1, r6, 1 + b _081940CA +_081940B6: + movs r0, 0x4 + ands r5, r0 + cmp r5, 0 + beq _081940D2 + lsls r0, r4, 2 + mov r1, sp + adds r2, r1, r0 + lsrs r1, r6, 31 + adds r1, r6, r1 + asrs r1, 1 +_081940CA: + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + b _081940DE +_081940D2: + lsls r0, r4, 2 + mov r2, sp + adds r1, r2, r0 +_081940D8: + ldr r0, [r1] + adds r0, r6 + str r0, [r1] +_081940DE: + ldr r1, [sp, 0x68] + cmp r1, 0x2 + bgt _081940E6 + b _08193FE2 +_081940E6: + ldr r2, [sp, 0x74] + add r2, r9 + lsls r0, r2, 2 + add r0, sp + ldr r1, [r0] + ldr r3, [sp, 0x54] + cmp r3, r1 + bge _08194104 + lsls r0, r2, 16 + lsrs r0, 16 + str r0, [sp, 0x58] + lsls r0, r1, 16 + lsrs r0, 16 + str r0, [sp, 0x54] + b _08194122 +_08194104: + ldr r4, [sp, 0x54] + cmp r4, r1 + bne _08194122 + ldr r5, [sp, 0x58] + lsls r0, r5, 1 + add r0, r10 + lsls r1, r2, 1 + add r1, r10 + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + bcs _08194122 + lsls r0, r2, 16 + lsrs r0, 16 + str r0, [sp, 0x58] +_08194122: + ldr r0, [sp, 0x64] + mov r9, r0 + cmp r0, 0x3 + bgt _0819412C + b _08193F18 +_0819412C: + ldr r1, [sp, 0x60] + str r1, [sp, 0x50] + cmp r1, 0x2 + bgt _08194136 + b _08193F02 +_08194136: + ldr r2, [sp, 0x58] + mov r9, r2 + b _08194182 +_0819413C: + movs r3, 0 + mov r9, r3 + movs r1, 0 + mov r4, r10 + mov r3, r10 + mov r2, sp +_08194148: + ldr r0, [r2] + ldr r5, [sp, 0x54] + cmp r5, r0 + bge _0819415A + mov r9, r1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x54] + b _08194170 +_0819415A: + ldr r5, [sp, 0x54] + cmp r5, r0 + bne _08194170 + mov r5, r9 + lsls r0, r5, 1 + adds r0, r4, r0 + ldrh r0, [r0] + ldrh r5, [r3] + cmp r0, r5 + bcs _08194170 + mov r9, r1 +_08194170: + adds r3, 0x2 + adds r2, 0x4 + adds r1, 0x1 + cmp r1, 0xB + ble _08194148 + ldr r0, [sp, 0x50] + ldr r1, [sp, 0x78] + cmp r0, r1 + beq _081941F4 +_08194182: + movs r2, 0 + str r2, [sp, 0x50] + mov r3, r9 + lsls r7, r3, 2 + ldr r4, [sp, 0x78] + cmp r2, r4 + bge _081941CA + lsls r0, r3, 1 + mov r5, r10 + adds r6, r5, r0 + ldr r0, [sp, 0x48] + lsls r5, r0, 24 +_0819419A: + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r2, [sp, 0x50] + lsls r1, r2, 24 + lsrs r1, 24 + lsrs r0, r5, 24 + bl sub_81953E8 + lsls r0, 24 + lsrs r0, 23 + movs r3, 0xEC + lsls r3, 4 + adds r4, r3 + adds r4, r0 + ldrh r0, [r4] + ldrh r4, [r6] + cmp r0, r4 + beq _081941CA + ldr r0, [sp, 0x50] + adds r0, 0x1 + str r0, [sp, 0x50] + ldr r1, [sp, 0x78] + cmp r0, r1 + blt _0819419A +_081941CA: + ldr r2, [sp, 0x50] + ldr r3, [sp, 0x78] + cmp r2, r3 + beq _081941F4 + mov r4, sp + adds r1, r4, r7 + movs r0, 0 + str r0, [r1] + movs r5, 0 + str r5, [sp, 0x54] + mov r9, r5 + mov r2, sp + movs r1, 0xB +_081941E4: + ldm r2!, {r0} + add r9, r0 + subs r1, 0x1 + cmp r1, 0 + bge _081941E4 + mov r0, r9 + cmp r0, 0 + bne _0819413C +_081941F4: + mov r1, r9 + lsls r0, r1, 2 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + bne _08194204 + ldr r2, [sp, 0x58] + mov r9, r2 +_08194204: + mov r3, r9 + lsls r0, r3, 1 + add r0, r10 + ldrh r0, [r0] + add sp, 0x84 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8193ED0 + + thumb_func_start sub_8194220 +sub_8194220: @ 8194220 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r2, 0xA + ldrsh r1, [r0, r2] + mov r10, r1 + movs r3, 0xC + ldrsh r4, [r0, r3] + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x5 + bls _08194250 + b _081948C2 +_08194250: + lsls r0, 2 + ldr r1, =_08194264 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08194264: + .4byte _0819427C + .4byte _0819431C + .4byte _0819438C + .4byte _0819447C + .4byte _081944FC + .4byte _081947C8 +_0819427C: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x3 + bl EnableInterrupts + movs r4, 0 + str r4, [sp, 0x14] + add r0, sp, 0x14 + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + bl CpuSet + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0860CE74 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_0860CE94 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r0, =gUnknown_02022E14 + strh r4, [r0] + ldr r0, =gUnknown_02022E16 + strh r4, [r0] + ldr r0, =gUnknown_02022E18 + strh r4, [r0] + ldr r0, =gUnknown_02022E1A + strh r4, [r0] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r1, 0xB0 + lsls r1, 4 + movs r0, 0x3 + movs r2, 0 + bl ChangeBgY + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + b _0819443C + .pool +_0819431C: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + ldr r1, =0x00005860 + movs r0, 0x40 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0x9F + bl SetGpuReg + ldr r1, =0x00009098 + movs r0, 0x42 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0x9F + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x3F + bl SetGpuReg + bl ResetPaletteFade + bl ResetSpriteData + bl FreeAllSpritePalettes + ldr r1, =gTasks + mov r3, r8 + lsls r0, r3, 2 + b _0819443C + .pool +_0819438C: + ldr r4, =gUnknown_0203CD7C + movs r0, 0x80 + lsls r0, 4 + bl AllocZeroed + adds r1, r0, 0 + str r1, [r4] + ldr r0, =gUnknown_08D83900 + bl LZDecompressWram + ldr r1, [r4] + movs r0, 0x1 + bl SetBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + ldr r1, =gUnknown_08D82F10 + movs r5, 0x80 + lsls r5, 6 + movs r6, 0 + str r6, [sp] + movs r0, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D834FC + str r6, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D83B2C + movs r4, 0x1 + str r4, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D83C3C + str r4, [sp] + movs r0, 0x3 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, =gUnknown_08D85358 + movs r4, 0x80 + lsls r4, 2 + movs r1, 0 + adds r2, r4, 0 + bl LoadCompressedPalette + ldr r0, =gUnknown_08D85444 + movs r1, 0x80 + lsls r1, 1 + adds r2, r4, 0 + bl LoadCompressedPalette + ldr r0, =gUnknown_08D85600 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadCompressedPalette + str r6, [sp, 0x18] + add r0, sp, 0x18 + ldr r1, =gPlttBufferFaded + ldr r2, =0x05000100 + bl CpuSet + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + ldr r1, =gTasks + mov r4, r8 + lsls r0, r4, 2 +_0819443C: + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _081948C2 + .pool +_0819447C: + ldr r0, =gUnknown_0860CF50 + bl LoadCompressedObjectPic + mov r0, r8 + lsls r0, 2 + str r0, [sp, 0x1C] + mov r1, r10 + cmp r1, 0 + bne _081944E8 + movs r5, 0 + ldr r4, =gUnknown_0860D411 +_08194492: + ldrb r1, [r4] + ldrb r2, [r4, 0x1] + ldr r0, =gUnknown_0860CFA8 + movs r3, 0 + bl CreateSprite + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x1E + bls _08194492 + ldr r0, =gTasks + ldr r1, [sp, 0x1C] + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r2, 0x10 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _081944DC + ldr r0, =gUnknown_0860D008 + movs r1, 0xDA + movs r2, 0xC + movs r3, 0 + bl CreateSprite + b _081944E8 + .pool +_081944DC: + ldr r0, =gUnknown_0860CFD8 + movs r1, 0xDA + movs r2, 0xC + movs r3, 0 + bl CreateSprite +_081944E8: + ldr r1, =0x00007f40 + movs r0, 0 + bl SetGpuReg + b _081947A6 + .pool +_081944FC: + add r0, sp, 0x4 + movs r2, 0 + movs r1, 0x2 + strb r1, [r0, 0x5] + ldr r0, =gUnknown_085CCCEE + str r0, [sp, 0x4] + add r0, sp, 0x4 + strb r1, [r0, 0x4] + strb r2, [r0, 0x6] + strb r2, [r0, 0x7] + strb r1, [r0, 0xA] + strb r2, [r0, 0xB] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0x4] + add r2, sp, 0x4 + ldrb r3, [r2, 0xA] + movs r2, 0x70 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0x4 + strb r0, [r1, 0x8] + movs r0, 0x1 + strb r0, [r1, 0x9] + adds r3, r1, 0 + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xE0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + adds r0, r1, 0 + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + mov r3, r8 + lsls r3, 2 + str r3, [sp, 0x1C] + add r4, sp, 0x4 + movs r0, 0xF + mov r9, r0 + movs r1, 0 + str r1, [sp, 0x20] + movs r2, 0 + str r2, [sp, 0x24] + movs r7, 0 + movs r5, 0xF +_0819456C: + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + adds r0, r7 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 22 + lsrs r1, 22 + ldr r0, =gDisplayedStringBattle + bl sub_8195898 + mov r2, r10 + cmp r2, 0x1 + bne _081945C4 + ldr r3, =gSaveBlock2Ptr + ldr r2, [r3] + adds r0, r2, r7 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 29 + cmp r0, 0 + blt _081945DC + ldr r3, =0x00000cb2 + adds r0, r2, r3 + ldrh r1, [r0] + cmp r1, 0x1 + beq _08194634 + ldr r2, [sp, 0x24] + lsrs r0, r2, 24 + subs r1, 0x2 + b _081945EA + .pool +_081945C4: + mov r3, r10 + cmp r3, 0 + bne _08194634 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r0, r2, r7 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 29 + cmp r0, 0 + bge _081945FC +_081945DC: + lsls r1, 27 + lsrs r0, r1, 30 + cmp r0, 0 + beq _08194634 + subs r1, r0, 0x1 + ldr r2, [sp, 0x24] + lsrs r0, r2, 24 +_081945EA: + lsls r1, 24 + lsrs r1, 24 + bl sub_81948EC + b _08194634 + .pool +_081945FC: + ldr r3, =0x00000cb2 + adds r1, r2, r3 + ldrh r0, [r1] + cmp r0, 0 + beq _08194634 + ldr r0, [sp, 0x1C] + add r0, r8 + lsls r0, 3 + ldr r2, =gTasks + adds r0, r2 + movs r3, 0x10 + ldrsh r0, [r0, r3] + cmp r0, 0 + beq _08194624 + ldrh r1, [r1] + b _08194628 + .pool +_08194624: + ldrh r0, [r1] + subs r1, r0, 0x1 +_08194628: + ldr r2, [sp, 0x24] + lsrs r0, r2, 24 + lsls r1, 24 + lsrs r1, 24 + bl sub_81948EC +_08194634: + ldr r0, [sp, 0x1C] + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r1, 0x10 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08194660 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r3, =0x00000cb2 + adds r0, r3 + ldrh r3, [r0] + adds r6, r2, 0 + b _0819466E + .pool +_08194660: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000cb2 + adds r0, r2 + ldrh r0, [r0] + subs r3, r0, 0x1 + adds r6, r1, 0 +_0819466E: + mov r0, r10 + cmp r0, 0x1 + bne _0819468E + ldr r2, [r6] + adds r0, r2, r7 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r1, [r0] + lsls r1, 27 + lsrs r1, 30 + ldr r0, =0x00000cb2 + adds r2, r0 + ldrh r0, [r2] + subs r0, 0x1 + cmp r1, r0 + blt _081946A6 +_0819468E: + mov r1, r10 + cmp r1, 0 + bne _081946FA + ldr r0, [r6] + adds r0, r7 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 30 + cmp r0, r3 + bgt _081946FA +_081946A6: + ldr r0, [r6] + adds r1, r0, r7 + ldr r3, =0x00000d25 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081946FA + ldr r2, =0x00000d24 + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r3, =0x000003ff + cmp r0, r3 + bne _081946F0 + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0x30 + orrs r0, r1 + strb r0, [r4, 0xC] + ldrb r1, [r4, 0xD] + mov r0, r9 + ands r0, r1 + movs r1, 0x40 + b _08194740 + .pool +_081946F0: + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0xB0 + b _08194734 +_081946FA: + ldr r0, [r6] + adds r0, r7 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r2, =0x000003ff + cmp r0, r2 + bne _0819472C + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0x30 + orrs r0, r1 + strb r0, [r4, 0xC] + ldrb r1, [r4, 0xD] + mov r0, r9 + ands r0, r1 + movs r1, 0x40 + b _08194740 + .pool +_0819472C: + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0xE0 +_08194734: + orrs r0, r1 + strb r0, [r4, 0xC] + ldrb r1, [r4, 0xD] + mov r0, r9 + ands r0, r1 + movs r1, 0xD0 +_08194740: + orrs r0, r1 + strb r0, [r4, 0xD] + ldr r0, =gUnknown_0860D3F1 + ldr r3, [sp, 0x20] + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _08194768 + ldrb r0, [r4, 0x5] + ldrb r3, [r4, 0xA] + ldr r1, =gDisplayedStringBattle + movs r2, 0x3D + bl GetStringWidthDifference + b _0819476A + .pool +_08194768: + movs r0, 0x3 +_0819476A: + strb r0, [r4, 0x8] + ldr r0, =gDisplayedStringBattle + str r0, [sp, 0x4] + ldr r0, =gUnknown_0860D3F1 + ldr r1, [sp, 0x20] + adds r0, r1, r0 + ldrb r0, [r0] + strb r0, [r4, 0x4] + ldr r2, =gUnknown_0860D3F2 + adds r0, r1, r2 + ldrb r0, [r0] + strb r0, [r4, 0x9] + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + ldr r3, [sp, 0x20] + adds r3, 0x2 + str r3, [sp, 0x20] + ldr r0, [sp, 0x24] + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + str r0, [sp, 0x24] + adds r7, 0x4 + subs r5, 0x1 + cmp r5, 0 + blt _081947A6 + b _0819456C +_081947A6: + ldr r0, =gTasks + ldr r1, [sp, 0x1C] + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _081948C2 + .pool +_081947C8: + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =sub_8194BEC + bl SetHBlankCallback + ldr r0, =sub_8194CE4 + bl SetVBlankCallback + cmp r4, 0x2 + bne _0819485C + mov r2, r10 + cmp r2, 0 + bne _08194844 + ldr r0, =sub_819395C + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r2 + mov r3, r10 + strh r3, [r1, 0x8] + strh r3, [r1, 0xA] + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x10] + strh r0, [r1, 0x14] + b _08194878 + .pool +_08194844: + ldr r0, =sub_8194950 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + b _0819486C + .pool +_0819485C: + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r3, 0xE + ldrsh r5, [r0, r3] +_0819486C: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] +_08194878: + bl dp12_8087EA4 + ldr r0, =gUnknown_02038C28 + ldr r2, =0x00001f0a + movs r4, 0xF0 + lsls r4, 3 + adds r1, r0, r4 + movs r5, 0x5A +_08194888: + strh r2, [r0] + strh r2, [r1] + adds r1, 0x2 + adds r0, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08194888 + movs r5, 0x5B + ldr r3, =gUnknown_0860CF44 + ldr r0, =gUnknown_02038C28 + ldr r2, =0x00001f09 + ldr r4, =0x00000836 + adds r1, r0, r4 + adds r0, 0xB6 +_081948A4: + strh r2, [r0] + strh r2, [r1] + adds r1, 0x2 + adds r0, 0x2 + adds r5, 0x1 + cmp r5, 0x9F + ble _081948A4 + ldr r0, [r3] + ldr r1, [r3, 0x4] + ldr r2, [r3, 0x8] + bl sub_80BA038 + mov r0, r8 + bl DestroyTask +_081948C2: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194220 + + thumb_func_start sub_81948EC +sub_81948EC: @ 81948EC + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r4, =gUnknown_0860DD10 + lsls r2, r1, 2 + lsls r3, r0, 4 + adds r2, r3 + adds r2, r4 + ldr r3, [r2] + ldr r2, =gUnknown_0860DE10 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _08194938 + movs r7, 0x1 + adds r4, r3, 0 + adds r5, r4, 0x2 + adds r6, r0, 0 +_0819491A: + ldrb r2, [r4] + ldrb r3, [r4, 0x1] + str r7, [sp] + str r7, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + adds r1, r5, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + adds r4, 0x4 + adds r5, 0x4 + subs r6, 0x1 + cmp r6, 0 + bne _0819491A +_08194938: + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81948EC + + thumb_func_start sub_8194950 +sub_8194950: @ 8194950 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bls _08194974 + b _08194B3C +_08194974: + lsls r0, 2 + ldr r1, =_08194988 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08194988: + .4byte _0819499C + .4byte _081949C0 + .4byte _08194AD4 + .4byte _08194AEE + .4byte _08194B24 +_0819499C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + b _08194B3C + .pool +_081949C0: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081949CE + b _08194B3C +_081949CE: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + movs r2, 0 + movs r3, 0x2 + movs r1, 0x2 + strh r1, [r0, 0x8] + movs r1, 0x40 + strh r1, [r0, 0xE] + add r0, sp, 0x4 + strb r3, [r0, 0x5] + strb r2, [r0, 0x6] + strb r2, [r0, 0x7] + strb r3, [r0, 0xA] + strb r2, [r0, 0xB] + adds r3, r0, 0 + ldrb r2, [r3, 0xC] + subs r1, 0x50 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xB0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + movs r7, 0 + ldr r0, =gDisplayedStringBattle + mov r9, r0 + ldr r1, =gSaveBlock2Ptr + mov r8, r1 + adds r4, r2, 0 + ldr r6, =gUnknown_0860D3F1 + movs r5, 0 +_08194A1C: + mov r2, r8 + ldr r0, [r2] + adds r0, r5 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 22 + lsrs r1, 22 + mov r0, r9 + bl sub_8195898 + mov r0, r8 + ldr r2, [r0] + adds r0, r2, r5 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r3, [r0] + lsls r1, r3, 27 + lsrs r1, 30 + ldr r0, =0x00000cb2 + adds r2, r0 + ldrh r0, [r2] + subs r0, 0x1 + cmp r1, r0 + bne _08194A9E + lsls r0, r3, 29 + cmp r0, 0 + bge _08194A9E + ldrb r0, [r6] + cmp r0, 0 + bne _08194A84 + ldrb r0, [r4, 0x5] + ldrb r3, [r4, 0xA] + mov r1, r9 + movs r2, 0x3D + bl GetStringWidthDifference + b _08194A86 + .pool +_08194A84: + movs r0, 0x3 +_08194A86: + strb r0, [r4, 0x8] + mov r1, r9 + str r1, [sp, 0x4] + ldrb r0, [r6] + strb r0, [r4, 0x4] + ldrb r0, [r6, 0x1] + strb r0, [r4, 0x9] + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0 + bl AddTextPrinter +_08194A9E: + mov r2, r8 + ldr r1, [r2] + adds r0, r1, r5 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08194AC4 + subs r2, 0x73 + adds r0, r1, r2 + ldrh r1, [r0] + subs r1, 0x1 + lsls r0, r7, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + bl sub_81948EC +_08194AC4: + adds r6, 0x2 + adds r5, 0x4 + adds r7, 0x1 + cmp r7, 0xF + ble _08194A1C + b _08194B3C + .pool +_08194AD4: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0xE] + subs r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08194B3C + movs r0, 0x3 + strh r0, [r1, 0x8] + b _08194B3C +_08194AEE: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08194B3C + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x4 + strh r1, [r0, 0x8] + b _08194B3C + .pool +_08194B24: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08194B3C + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_08194B3C: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194950 + + thumb_func_start sub_8194B54 +sub_8194B54: @ 8194B54 + push {lr} + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_8194B54 + + thumb_func_start sub_8194B70 +sub_8194B70: @ 8194B70 + push {lr} + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x1 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x2 + bl ChangeBgY + ldr r0, =gUnknown_02022E14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =gUnknown_02022E16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =gUnknown_02022E18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =gUnknown_02022E1A + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, =gUnknown_02022E1C + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + ldr r0, =gUnknown_02022E1E + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194B70 + + thumb_func_start sub_8194BEC +sub_8194BEC: @ 8194BEC + push {lr} + ldr r0, =0x04000006 + ldrh r0, [r0] + adds r1, r0, 0 + cmp r0, 0x29 + bls _08194CC8 + cmp r0, 0x31 + bhi _08194C1C + ldr r1, =0x04000048 + ldr r2, =0x00003b3b + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x989b5558 + b _08194CD4 + .pool +_08194C1C: + cmp r0, 0x39 + bls _08194CC8 + cmp r0, 0x4A + bhi _08194C40 + ldr r1, =0x04000048 + ldr r2, =0x00003b3b + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x90985860 + b _08194CD4 + .pool +_08194C40: + cmp r0, 0x51 + bhi _08194C60 + ldr r1, =0x04000048 + ldr r2, =0x00003b3b + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x989b5558 + b _08194CD4 + .pool +_08194C60: + cmp r0, 0x5E + bls _08194CC8 + cmp r0, 0x66 + bhi _08194C84 + ldr r1, =0x04000048 + ldr r2, =0x00003737 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x989b5558 + b _08194CD4 + .pool +_08194C84: + cmp r0, 0x76 + bhi _08194CA4 + ldr r1, =0x04000048 + ldr r2, =0x00003737 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x90985860 + b _08194CD4 + .pool +_08194CA4: + cmp r0, 0x7E + bls _08194CC8 + cmp r1, 0x86 + bhi _08194CC8 + ldr r1, =0x04000048 + ldr r2, =0x00003737 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x989b5558 + b _08194CD4 + .pool +_08194CC8: + ldr r1, =0x04000048 + ldr r2, =0x00003f3f + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + movs r0, 0 +_08194CD4: + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194BEC + + thumb_func_start sub_8194CE4 +sub_8194CE4: @ 8194CE4 + push {lr} + ldr r0, =gUnknown_02022E14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =gUnknown_02022E16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =gUnknown_02022E18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =gUnknown_02022E1A + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + movs r0, 0x2 + movs r1, 0x80 + movs r2, 0x2 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x1 + bl ChangeBgY + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194CE4 + + thumb_func_start sub_8194D48 +sub_8194D48: @ 8194D48 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8194D48 + + thumb_func_start sub_8194D68 +sub_8194D68: @ 8194D68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r3, 0 +_08194D76: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =gUnknown_0203CEF8 + adds r0, r3, r0 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 1 + ldr r2, =0x00000caa + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + subs r0, 0x1 + mov r10, r0 + movs r6, 0 + adds r0, r3, 0x1 + str r0, [sp] + movs r1, 0x64 + mov r0, r10 + muls r0, r1 + movs r2, 0x8E + lsls r2, 2 + adds r2, r0 + mov r9, r2 + adds r7, r3, 0 + muls r7, r1 +_08194DA8: + movs r5, 0 + adds r0, r6, 0x1 + mov r8, r0 + b _08194DBE + .pool +_08194DBC: + adds r5, 0x1 +_08194DBE: + cmp r5, 0x3 + bgt _08194DEA + ldr r1, =gSaveBlock1Ptr + ldr r0, [r1] + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + str r3, [sp, 0x4] + bl GetMonData + adds r4, r0, 0 + adds r1, r6, 0 + adds r1, 0xD + ldr r2, =gPlayerParty + adds r0, r7, r2 + movs r2, 0 + bl GetMonData + ldr r3, [sp, 0x4] + cmp r4, r0 + bne _08194DBC +_08194DEA: + cmp r5, 0x4 + bne _08194E00 + lsls r2, r6, 24 + lsrs r2, 24 + ldr r1, =gPlayerParty + adds r0, r7, r1 + movs r1, 0xA6 + str r3, [sp, 0x4] + bl SetMonMoveSlot + ldr r3, [sp, 0x4] +_08194E00: + mov r6, r8 + cmp r6, 0x3 + ble _08194DA8 + ldr r2, =gSaveBlock1Ptr + ldr r0, [r2] + movs r2, 0x64 + mov r1, r10 + muls r1, r2 + adds r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r0, r1 + adds r1, r3, 0 + muls r1, r2 + ldr r2, =gPlayerParty + adds r1, r2 + movs r2, 0x64 + bl memcpy + ldr r3, [sp] + cmp r3, 0x1 + ble _08194D76 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194D68 + + thumb_func_start sub_8194E44 +sub_8194E44: @ 8194E44 + push {r4-r7,lr} + sub sp, 0x4 + movs r4, 0 + ldr r7, =gSaveBlock1Ptr + movs r6, 0x64 + movs r5, 0 +_08194E50: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =gUnknown_0203CEF8 + adds r0, r4, r0 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 1 + ldr r2, =0x00000caa + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + subs r0, 0x1 + adds r1, r0, 0 + muls r1, r6 + movs r0, 0x8E + lsls r0, 2 + adds r1, r0 + ldr r0, [r7] + adds r0, r1 + movs r1, 0xC + movs r2, 0 + bl GetMonData + mov r1, sp + strh r0, [r1] + ldr r0, =gPlayerParty + adds r0, r5, r0 + movs r1, 0xC + mov r2, sp + bl SetMonData + adds r5, 0x64 + adds r4, 0x1 + cmp r4, 0x1 + ble _08194E50 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194E44 + + thumb_func_start sub_8194EB4 +sub_8194EB4: @ 8194EB4 + push {lr} + bl sub_80F94E8 + pop {r0} + bx r0 + thumb_func_end sub_8194EB4 + + thumb_func_start sub_8194EC0 +sub_8194EC0: @ 8194EC0 + push {r4,lr} + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + bl sub_8195358 + adds r4, r0, 0 + ldr r0, =0x000003ff + bl sub_8195358 + cmp r4, r0 + ble _08194EE8 + ldr r1, =gScriptResult + movs r0, 0x1 + b _08194EEC + .pool +_08194EE8: + ldr r1, =gScriptResult + movs r0, 0x2 +_08194EEC: + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194EC0 + + thumb_func_start sub_8194EF8 +sub_8194EF8: @ 8194EF8 + push {r4,lr} + bl sub_8194D48 + movs r2, 0 + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _08194F2A + adds r4, r3, 0 + adds r3, r1, 0 +_08194F14: + adds r2, 0x1 + cmp r2, 0xF + bgt _08194F2A + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08194F14 +_08194F2A: + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsls r2, 2 + adds r1, r2 + ldr r2, =0x00000d24 + adds r1, r2 + ldrh r1, [r1] + lsls r1, 22 + lsrs r1, 22 + bl sub_8195898 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194EF8 + + thumb_func_start sub_8194F58 +sub_8194F58: @ 8194F58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + ldr r5, =0x00000d0a + adds r0, r2, r5 + ldrb r1, [r0] + ldr r6, =0x00000d0b + adds r0, r2, r6 + ldrb r0, [r0] + cmn r1, r0 + beq _08194F8C + ldr r1, =0x00000ca8 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08194F8C + b _0819533E +_08194F8C: + movs r0, 0x20 + bl AllocZeroed + str r0, [sp, 0x18] + movs r0, 0x18 + bl AllocZeroed + str r0, [sp, 0x1C] + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r1, r2 + ldrb r2, [r1] + lsls r0, r2, 30 + lsrs r0, 30 + str r0, [sp, 0x14] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0x1 + adds r0, r5 + strb r1, [r0] + ldr r0, [r4] + adds r0, r6 + strb r1, [r0] + movs r3, 0 + mov r10, r3 + movs r4, 0 + str r4, [sp, 0x38] + movs r5, 0 + str r5, [sp, 0x3C] +_08194FCC: + mov r0, r10 + cmp r0, 0x4 + bgt _08194FFC + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + b _08195030 + .pool +_08194FFC: + mov r1, r10 + cmp r1, 0xE + bgt _0819501A + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, 0 + adds r4, 0xA + b _08195030 +_0819501A: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, 0 + adds r4, 0x1E +_08195030: + movs r6, 0 + cmp r6, r10 + bge _08195064 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r3, =0x00000d24 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + beq _08195064 + adds r3, r2, 0 + ldr r2, =0x00000d24 +_0819504C: + adds r6, 0x1 + cmp r6, r10 + bge _08195064 + ldr r0, [r3] + lsls r1, r6, 2 + adds r0, r1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + bne _0819504C +_08195064: + cmp r6, r10 + bne _08194FCC + ldr r5, =gSaveBlock2Ptr + ldr r3, [r5] + ldr r0, [sp, 0x38] + adds r3, r0 + ldr r1, =0x00000d24 + adds r3, r1 + ldr r2, =0x000003ff + adds r0, r2, 0 + adds r2, r4, 0 + ands r2, r0 + ldrh r0, [r3] + ldr r5, =0xfffffc00 + adds r1, r5, 0 + ands r0, r1 + orrs r0, r2 + strh r0, [r3] + movs r6, 0 + lsls r4, 16 + str r4, [sp, 0x30] + ldr r0, [sp, 0x3C] + str r0, [sp, 0x20] +_08195092: + adds r1, r6, 0x1 + str r1, [sp, 0x24] + lsls r2, r6, 2 + str r2, [sp, 0x2C] + lsls r3, r6, 1 + str r3, [sp, 0x28] +_0819509E: + ldr r4, [sp, 0x30] + lsrs r0, r4, 16 + bl sub_8163524 + lsls r0, 16 + lsrs r5, r0, 16 + movs r7, 0 + cmp r7, r6 + bge _081950F4 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gUnknown_0203BC8C + mov r9, r1 + ldr r2, [sp, 0x8] + mov r8, r2 + ldr r3, [sp, 0xC] + mov r12, r3 + ldr r4, =0x00000d64 + adds r0, r4 + ldr r1, [sp, 0x20] + adds r4, r1, r0 +_081950C8: + ldrh r3, [r4] + cmp r3, r5 + beq _081950F4 + mov r2, r9 + ldr r1, [r2] + lsls r0, r5, 4 + adds r2, r0, r1 + ldrh r0, [r2] + cmp r8, r0 + beq _081950F4 + cmp r12, r0 + beq _081950F4 + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0, 0xA] + ldrb r2, [r2, 0xA] + cmp r0, r2 + beq _081950F4 + adds r4, 0x2 + adds r7, 0x1 + cmp r7, r6 + blt _081950C8 +_081950F4: + cmp r7, r6 + bne _0819509E + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r4, [sp, 0x28] + ldr r2, [sp, 0x3C] + adds r1, r4, r2 + ldr r3, =0x00000d64 + adds r0, r3 + adds r0, r1 + strh r5, [r0] + ldr r2, [sp, 0x2C] + add r2, sp + adds r2, 0x8 + ldr r3, =gUnknown_0203BC8C + ldr r1, [r3] + lsls r0, r5, 4 + adds r0, r1 + ldrh r0, [r0] + str r0, [r2] + ldr r6, [sp, 0x24] + cmp r6, 0x2 + ble _08195092 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + ldr r5, [sp, 0x38] + adds r2, r5 + ldr r0, =0x00000d25 + adds r2, r0 + ldrb r0, [r2] + movs r4, 0x5 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + strb r0, [r2] + ldr r5, =gSaveBlock2Ptr + ldr r2, [r5] + ldr r0, [sp, 0x38] + adds r2, r0 + ldr r1, =0x00000d25 + adds r2, r1 + ldrb r0, [r2] + subs r4, 0x14 + adds r1, r4, 0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r5] + ldr r5, [sp, 0x38] + adds r1, r5 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + adds r5, 0x4 + str r5, [sp, 0x38] + ldr r1, [sp, 0x3C] + adds r1, 0x6 + str r1, [sp, 0x3C] + movs r2, 0x1 + add r10, r2 + mov r4, r10 + cmp r4, 0xF + bgt _08195178 + b _08194FCC +_08195178: + movs r5, 0 + mov r10, r5 + ldr r5, [sp, 0x18] + movs r0, 0 + str r0, [sp, 0x34] +_08195182: + movs r7, 0 + strh r7, [r5] + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + mov r2, r10 + lsls r1, r2, 2 + adds r0, r1 + ldr r3, =0x00000d24 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + bl sub_8190168 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r6, 0 + ldr r4, [sp, 0x34] + mov r9, r4 +_081951AA: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + mov r4, r9 + add r4, r10 + adds r4, r6 + lsls r4, 1 + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r4 + ldrh r1, [r0] + ldr r3, =gUnknown_0203BC8C + ldr r0, [r3] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] + ldrb r3, [r1, 0xB] + ldrb r1, [r1, 0xC] + str r1, [sp] + ldr r1, [sp, 0x1C] + str r1, [sp, 0x4] + movs r1, 0x32 + mov r2, r8 + bl sub_818F720 + ldr r2, [sp, 0x1C] + ldr r1, [r2, 0x4] + ldrh r0, [r5] + adds r0, r1 + ldr r1, [r2, 0x8] + adds r0, r1 + ldr r1, [r2, 0x10] + adds r0, r1 + ldr r1, [r2, 0x14] + adds r0, r1 + ldr r1, [r2, 0xC] + adds r0, r1 + ldr r1, [r2] + adds r0, r1 + strh r0, [r5] + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, =0x00000d64 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r3, =gBaseStats + adds r1, r3 + ldrb r0, [r1, 0x6] + lsls r0, 2 + ldr r4, =gBitTable + adds r0, r4 + ldr r0, [r0] + orrs r7, r0 + ldrb r0, [r1, 0x7] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + orrs r7, r0 + adds r6, 0x1 + cmp r6, 0x2 + ble _081951AA + movs r4, 0 + movs r1, 0x1 + movs r6, 0x1F +_0819523A: + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08195244 + adds r4, 0x1 +_08195244: + asrs r7, 1 + subs r6, 0x1 + cmp r6, 0 + bge _0819523A + movs r1, 0x32 + adds r0, r4, 0 + muls r0, r1 + movs r1, 0x14 + bl __divsi3 + ldrh r1, [r5] + adds r1, r0 + strh r1, [r5] + adds r5, 0x2 + ldr r2, [sp, 0x34] + adds r2, 0x2 + str r2, [sp, 0x34] + movs r3, 0x1 + add r10, r3 + mov r4, r10 + cmp r4, 0xF + ble _08195182 + movs r5, 0 + mov r10, r5 + ldr r7, [sp, 0x18] +_08195276: + mov r6, r10 + adds r6, 0x1 + cmp r6, 0xF + bgt _081952F8 + mov r8, r7 + ldr r5, =0x00000d24 + lsls r0, r6, 1 + ldr r1, [sp, 0x18] + adds r4, r0, r1 +_08195288: + mov r2, r8 + ldrh r1, [r2] + ldrh r0, [r4] + cmp r1, r0 + bcs _081952C4 + mov r0, r10 + adds r1, r6, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 + b _081952F0 + .pool +_081952C4: + cmp r1, r0 + bne _081952F0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r3, r10 + lsls r0, r3, 2 + adds r0, r1, r0 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 22 + lsls r0, r6, 2 + adds r1, r0 + adds r1, r5 + ldrh r0, [r1] + lsls r0, 22 + cmp r2, r0 + bls _081952F0 + mov r0, r10 + adds r1, r6, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 +_081952F0: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0xF + ble _08195288 +_081952F8: + adds r7, 0x2 + movs r4, 0x1 + add r10, r4 + mov r5, r10 + cmp r5, 0xE + ble _08195276 + ldr r0, [sp, 0x18] + bl Free + ldr r0, [sp, 0x1C] + bl Free + movs r0, 0 + mov r10, r0 +_08195314: + mov r1, r10 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_8195438 + movs r2, 0x1 + add r10, r2 + mov r3, r10 + cmp r3, 0x3 + ble _08195314 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r4, =0x00000ca9 + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + ldr r5, [sp, 0x14] + orrs r0, r5 + strb r0, [r1] +_0819533E: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194F58 + + thumb_func_start sub_8195358 +sub_8195358: @ 8195358 + push {r4,r5,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + beq _0819538E + adds r5, r4, 0 + adds r4, r1, 0 +_08195376: + adds r2, 0x1 + cmp r2, 0xF + bgt _0819538E + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + bne _08195376 +_0819538E: + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8195358 + + thumb_func_start sub_81953A0 +sub_81953A0: @ 81953A0 + push {r4,r5,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + beq _081953D6 + adds r5, r4, 0 + adds r4, r1, 0 +_081953BE: + adds r2, 0x1 + cmp r2, 0xF + bgt _081953D6 + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + bne _081953BE +_081953D6: + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81953A0 + + thumb_func_start sub_81953E8 +sub_81953E8: @ 81953E8 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_0860D1A0 + ldr r0, =gUnknown_0860D1C0 + adds r0, r4, r0 + ldrb r0, [r0] + lsrs r0, 1 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + bl sub_8192F08 + mov r0, sp + ldrb r0, [r0] + cmp r4, r0 + beq _0819542C + mov r0, sp + ldrb r0, [r0] + b _08195430 + .pool +_0819542C: + mov r0, sp + ldrb r0, [r0, 0x1] +_08195430: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81953E8 + + thumb_func_start sub_8195438 +sub_8195438: @ 8195438 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0xC] + movs r1, 0 + str r1, [sp, 0x10] + movs r5, 0 + movs r1, 0x3 + ldr r0, [sp] + ands r0, r1 + lsls r0, 3 + str r0, [sp, 0x14] +_0819545E: + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + lsls r4, r5, 2 + adds r1, r0, r4 + ldr r3, =0x00000d25 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 29 + adds r2, r5, 0x1 + str r2, [sp, 0x24] + cmp r0, 0 + bge _08195478 + b _08195876 +_08195478: + subs r3, 0x1 + adds r0, r1, r3 + ldrh r0, [r0] + lsls r1, r0, 22 + ldr r0, =0xffc00000 + cmp r1, r0 + bne _08195488 + b _08195876 +_08195488: + str r5, [sp, 0x4] + lsrs r1, 22 + ldr r0, [sp] + bl sub_81901A0 + str r0, [sp, 0x8] + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + adds r0, r3, r4 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + ldr r1, =0xff800000 + cmp r0, r1 + bne _08195504 + ldr r2, [sp, 0x8] + cmp r2, 0xFF + beq _08195504 + lsls r2, 2 + adds r1, r3, r2 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r1, r2 + ldr r2, =0x00000d25 + adds r1, r2 + ldrb r0, [r1] + subs r3, 0x1D + ands r0, r3 + ldr r2, [sp, 0x14] + orrs r0, r2 + strb r0, [r1] + adds r0, r5, 0 + ldr r1, [sp, 0x8] + ldr r2, [sp] + bl sub_8193ED0 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r5, [sp, 0x8] + lsls r2, r5, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r3 + adds r1, r2 + b _08195874 + .pool +_08195504: + ldr r4, =gSaveBlock2Ptr + ldr r3, [r4] + ldr r0, [sp, 0x8] + lsls r2, r0, 2 + adds r0, r3, r2 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + ldr r1, =0xff800000 + str r2, [sp, 0x30] + cmp r0, r1 + bne _0819557C + ldr r2, [sp, 0x4] + cmp r2, 0xFF + beq _0819557C + lsls r2, 2 + adds r1, r3, r2 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + ldr r1, [r4] + adds r1, r2 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl sub_8193ED0 + ldr r1, [r4] + ldr r3, [sp, 0x4] + lsls r2, r3, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r3 + adds r1, r2 + strh r0, [r1] + adds r5, 0x1 + str r5, [sp, 0x24] + b _08195876 + .pool +_0819557C: + adds r5, 0x1 + str r5, [sp, 0x24] + ldr r5, [sp, 0x8] + cmp r5, 0xFF + bne _08195588 + b _08195876 +_08195588: + movs r0, 0 + mov r10, r0 + lsls r1, r5, 1 + str r1, [sp, 0x2C] + ldr r2, [sp, 0x4] + lsls r2, 1 + str r2, [sp, 0x28] + ldr r3, [sp, 0x4] + adds r0, r2, r3 + lsls r0, 1 + mov r9, r0 + adds r0, r1, r5 + lsls r0, 1 + str r0, [sp, 0x18] +_081955A4: + movs r5, 0 + mov r0, r9 + str r0, [sp, 0x38] +_081955AA: + movs r6, 0 + lsls r7, r5, 1 + ldr r4, [sp, 0x18] +_081955B0: + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + ldr r3, =0x00000d64 + adds r1, r3 + ldr r2, [sp, 0x38] + adds r0, r1, r2 + ldrh r0, [r0] + ldr r3, =gUnknown_0203BC8C + mov r8, r3 + ldr r2, [r3] + lsls r0, 4 + adds r0, r2 + adds r0, 0x2 + adds r0, r7 + ldrh r0, [r0] + adds r1, r4 + ldrh r1, [r1] + lsls r1, 4 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + bl sub_818FFC0 + ldr r1, [sp, 0xC] + adds r1, r0 + str r1, [sp, 0xC] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x2 + ble _081955B0 + adds r5, 0x1 + cmp r5, 0x3 + ble _081955AA + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r3, =0x00000d64 + adds r0, r3 + add r0, r9 + ldrh r0, [r0] + mov r5, r8 + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrh r2, [r0] + ldr r0, =gBaseStats + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + ldrb r2, [r1, 0x1] + adds r0, r2 + ldrb r2, [r1, 0x2] + adds r0, r2 + ldrb r2, [r1, 0x3] + adds r0, r2 + ldrb r3, [r1, 0x4] + adds r0, r3 + ldrb r1, [r1, 0x5] + adds r0, r1 + movs r1, 0xA + bl __divsi3 + ldr r5, [sp, 0xC] + adds r5, r0 + str r5, [sp, 0xC] + movs r0, 0x2 + add r9, r0 + movs r1, 0x1 + add r10, r1 + mov r2, r10 + cmp r2, 0x2 + ble _081955A4 + bl Random + movs r1, 0x1F + ands r1, r0 + adds r5, r1 + ldr r3, [sp, 0x4] + adds r5, r3 + str r5, [sp, 0xC] + movs r5, 0 + mov r10, r5 + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x8] + adds r0, r1, r2 + lsls r0, 1 + str r0, [sp, 0x1C] + ldr r5, [sp, 0x28] + adds r0, r5, r3 + lsls r0, 1 + str r0, [sp, 0x20] +_08195668: + movs r5, 0 + mov r0, r10 + lsls r3, r0, 1 + movs r1, 0x1 + add r10, r1 + ldr r2, [sp, 0x1C] + adds r2, r3 + mov r8, r2 +_08195678: + movs r6, 0 + lsls r7, r5, 1 + adds r5, 0x1 + str r5, [sp, 0x3C] + ldr r4, [sp, 0x20] +_08195682: + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r0, =0x00000d64 + adds r1, r0 + mov r2, r8 + adds r0, r1, r2 + ldrh r0, [r0] + ldr r5, =gUnknown_0203BC8C + mov r9, r5 + ldr r2, [r5] + lsls r0, 4 + adds r0, r2 + adds r0, 0x2 + adds r0, r7 + ldrh r0, [r0] + adds r1, r4 + ldrh r1, [r1] + lsls r1, 4 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + str r3, [sp, 0x34] + bl sub_818FFC0 + ldr r1, [sp, 0x10] + adds r1, r0 + str r1, [sp, 0x10] + adds r4, 0x2 + adds r6, 0x1 + ldr r3, [sp, 0x34] + cmp r6, 0x2 + ble _08195682 + ldr r5, [sp, 0x3C] + cmp r5, 0x3 + ble _08195678 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r5, [sp, 0x1C] + adds r1, r3, r5 + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + mov r3, r9 + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrh r2, [r0] + ldr r0, =gBaseStats + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + ldrb r2, [r1, 0x1] + adds r0, r2 + ldrb r5, [r1, 0x2] + adds r0, r5 + ldrb r2, [r1, 0x3] + adds r0, r2 + ldrb r2, [r1, 0x4] + adds r0, r2 + ldrb r1, [r1, 0x5] + adds r0, r1 + movs r1, 0xA + bl __divsi3 + ldr r3, [sp, 0x10] + adds r3, r0 + str r3, [sp, 0x10] + mov r5, r10 + cmp r5, 0x2 + ble _08195668 + bl Random + movs r1, 0x1F + ands r1, r0 + ldr r0, [sp, 0x10] + adds r0, r1 + ldr r1, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x10] + ldr r2, [sp, 0xC] + cmp r2, r0 + ble _08195784 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r5, [sp, 0x30] + adds r1, r5 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, r5 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r5, 0x19 + negs r5, r5 + ands r0, r5 + ldr r2, [sp, 0x14] + orrs r0, r2 + strb r0, [r1] + ldr r0, [sp, 0x4] + ldr r1, [sp, 0x8] + ldr r2, [sp] + bl sub_8193ED0 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + movs r5, 0xEC + lsls r5, 4 + adds r1, r5 + ldr r2, [sp, 0x2C] + adds r1, r2 + b _08195874 + .pool +_08195784: + ldr r3, [sp, 0xC] + ldr r5, [sp, 0x10] + cmp r3, r5 + bge _081957DC + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r3, [sp, 0x4] + lsls r2, r3, 2 + adds r1, r2 + ldr r5, =0x00000d25 + adds r1, r5 + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + adds r1, r2 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl sub_8193ED0 + ldr r1, [r5] + movs r5, 0xEC + lsls r5, 4 + adds r1, r5 + ldr r2, [sp, 0x28] + adds r1, r2 + b _08195874 + .pool +_081957DC: + ldr r3, [sp, 0x4] + ldr r5, [sp, 0x8] + cmp r3, r5 + ble _08195830 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, [sp, 0x30] + adds r1, r2 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r5, 0x4 + orrs r0, r5 + strb r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r1, r2 + adds r1, r3 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x4] + ldr r1, [sp, 0x8] + ldr r2, [sp] + bl sub_8193ED0 + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + movs r2, 0xEC + lsls r2, 4 + adds r1, r2 + ldr r3, [sp, 0x2C] + b _08195872 + .pool +_08195830: + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r0, [sp, 0x4] + lsls r2, r0, 2 + adds r1, r2 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r5, 0x4 + orrs r0, r5 + strb r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r1, r2 + adds r1, r3 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl sub_8193ED0 + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + movs r2, 0xEC + lsls r2, 4 + adds r1, r2 + ldr r3, [sp, 0x28] +_08195872: + adds r1, r3 +_08195874: + strh r0, [r1] +_08195876: + ldr r5, [sp, 0x24] + cmp r5, 0xF + bgt _0819587E + b _0819545E +_0819587E: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195438 + + thumb_func_start sub_8195898 +sub_8195898: @ 8195898 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 + bl sub_8165C40 + ldr r0, =0x000003fe + cmp r5, r0 + bne _081958B8 + adds r0, r6, 0 + bl sub_8195938 + b _08195902 + .pool +_081958B8: + ldr r0, =0x000003ff + cmp r5, r0 + bne _081958DC + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] +_081958C2: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _081958C2 + b _081958FC + .pool +_081958DC: + ldr r0, =0x0000012b + cmp r5, r0 + bhi _081958FC + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + adds r2, r0, 0x4 +_081958EE: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _081958EE +_081958FC: + adds r1, r6, r4 + movs r0, 0xFF + strb r0, [r1] +_08195902: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195898 + + thumb_func_start sub_8195910 +sub_8195910: @ 8195910 + ldr r0, =gTrainers + ldr r1, =0x00007df3 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8195910 + + thumb_func_start sub_8195924 +sub_8195924: @ 8195924 + ldr r0, =gTrainers + ldr r1, =0x00007df1 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8195924 + + thumb_func_start sub_8195938 +sub_8195938: @ 8195938 + push {r4,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r4, =gTrainers + TRAINER_TUCKER * 0x28 + 0x4 @ Tucker's name +_08195940: + adds r0, r3, r2 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x6 + ble _08195940 + adds r1, r3, r2 + movs r0, 0xFF + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195938 + + thumb_func_start sub_8195960 +sub_8195960: @ 8195960 + push {lr} + ldr r1, =gUnknown_0860DE50 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195960 + + thumb_func_start sub_8195980 +sub_8195980: @ 8195980 + push {r4-r7,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r4] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r6, 0 + strb r6, [r0] + ldr r1, [r4] + adds r2, 0xA + adds r0, r1, r2 + strh r6, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, [r4] + ldr r0, =0x00000cdc + adds r3, r4, r0 + ldr r2, =gUnknown_0860DE98 + lsls r1, r5, 2 + lsls r0, r7, 3 + adds r1, r0 + adds r1, r2 + ldr r0, [r3] + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _081959F2 + lsls r0, r5, 1 + lsls r1, r7, 2 + adds r0, r1 + ldr r2, =0x00000dc8 + adds r1, r4, r2 + adds r1, r0 + strh r6, [r1] +_081959F2: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r0, =gTrainerBattleOpponent_A + strh r6, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195980 + + thumb_func_start sub_8195A38 +sub_8195A38: @ 8195A38 + push {r4-r7,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08195A90 + cmp r0, 0x1 + bgt _08195A74 + cmp r0, 0 + beq _08195A7A + b _08195AD0 + .pool +_08195A74: + cmp r0, 0x2 + beq _08195AB0 + b _08195AD0 +_08195A7A: + ldr r0, =gScriptResult + ldr r1, [r5] + ldr r2, =0x00000dc6 + adds r1, r2 + ldrh r1, [r1] + strh r1, [r0] + b _08195AD0 + .pool +_08195A90: + ldr r3, =gScriptResult + ldr r0, [r5] + lsls r1, r7, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000dc8 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] + b _08195AD0 + .pool +_08195AB0: + ldr r4, =gScriptResult + ldr r2, [r5] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_0860DE98 + lsls r0, r7, 2 + lsls r1, r6, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] +_08195AD0: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195A38 + + thumb_func_start sub_8195AE4 +sub_8195AE4: @ 8195AE4 + push {r4-r6,lr} + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08195B3C + cmp r0, 0x1 + bgt _08195B20 + cmp r0, 0 + beq _08195B26 + b _08195BA0 + .pool +_08195B20: + cmp r0, 0x2 + beq _08195B5C + b _08195BA0 +_08195B26: + ldr r0, [r6] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000dc6 + adds r0, r2 + strh r1, [r0] + b _08195BA0 + .pool +_08195B3C: + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + ldr r1, =0x00000dc8 + adds r2, r1 + adds r2, r0 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + strh r0, [r2] + b _08195BA0 + .pool +_08195B5C: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _08195B88 + ldr r2, [r6] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_0860DE98 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + b _08195B9E + .pool +_08195B88: + ldr r2, [r6] + ldr r1, =0x00000cdc + adds r2, r1 + ldr r3, =gUnknown_0860DEA8 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 +_08195B9E: + str r0, [r2] +_08195BA0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195AE4 + + thumb_func_start sub_8195BB0 +sub_8195BB0: @ 8195BB0 + push {r4,lr} + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + ldr r3, =0x00000ca9 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + lsrs r0, 14 + adds r1, r0 + ldr r0, =0x00000dc8 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + cmp r0, 0x31 + bhi _08195C00 + ldr r4, =gScriptResult + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + strh r0, [r4] + b _08195C16 + .pool +_08195C00: + cmp r0, 0x62 + bhi _08195C10 + ldr r1, =gScriptResult + movs r0, 0x3 + b _08195C14 + .pool +_08195C10: + ldr r1, =gScriptResult + movs r0, 0x4 +_08195C14: + strh r0, [r1] +_08195C16: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195BB0 + + thumb_func_start sub_8195C20 +sub_8195C20: @ 8195C20 + push {r4,lr} + ldr r4, =gTrainerBattleOpponent_A + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xFF + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsrs r1, 6 + strh r1, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195C20 + + thumb_func_start sub_8195C50 +sub_8195C50: @ 8195C50 + push {lr} + ldr r3, =gTrainerBattleOpponent_A + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _08195C6C + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString +_08195C6C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195C50 + + thumb_func_start sub_8195C7C +sub_8195C7C: @ 8195C7C + push {r4-r7,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + ldr r4, [r4] + lsls r1, r7, 1 + lsrs r5, r0, 22 + adds r1, r5 + ldr r3, =0x00000dc8 + adds r6, r4, r3 + adds r3, r6, r1 + ldrh r2, [r3] + ldr r0, =0x0000270e + cmp r2, r0 + bhi _08195CCA + adds r2, 0x1 + strh r2, [r3] + movs r3, 0xDD + lsls r3, 4 + adds r0, r4, r3 + adds r1, r0, r1 + adds r0, r5, 0 + ldrh r3, [r1] + cmp r7, r3 + bls _08195CC0 + adds r0, 0x2 +_08195CC0: + adds r0, r6, r0 + ldrh r0, [r0] + cmp r0, 0 + beq _08195CCA + strh r2, [r1] +_08195CCA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195C7C + + thumb_func_start sub_8195CE4 +sub_8195CE4: @ 8195CE4 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195CE4 + + thumb_func_start sub_8195D28 +sub_8195D28: @ 8195D28 + push {r4,r5,lr} + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + ldr r3, =0x00000ca9 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + lsrs r0, 14 + adds r1, r0 + ldr r0, =0x00000dc8 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + cmp r0, 0x29 + bls _08195D88 + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_0860DE84 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =0x00000dc6 + adds r4, r1 + b _08195DA6 + .pool +_08195D88: + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_0860DE78 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r3, =0x00000dc6 + adds r4, r3 +_08195DA6: + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195D28 + + thumb_func_start sub_8195DB8 +sub_8195DB8: @ 8195DB8 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000dc6 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _08195E00 + ldr r0, [r4] + ldr r1, =0x00000dc6 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000dc6 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _08195E06 + .pool +_08195E00: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_08195E06: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195DB8 + + thumb_func_start sub_8195E10 +sub_8195E10: @ 8195E10 + push {lr} + bl RtcCalcLocalTime + ldr r0, =gLocalTime + bl sub_8195E34 + ldr r1, =gUnknown_0203CD80 + adds r0, 0xA + str r0, [r1] + movs r0, 0 + strb r0, [r1, 0x6] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195E10 + + thumb_func_start sub_8195E34 +sub_8195E34: @ 8195E34 + adds r3, r0, 0 + movs r1, 0 + ldrsh r0, [r3, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + movs r2, 0x2 + ldrsb r2, [r3, r2] + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 2 + adds r0, r1 + movs r1, 0x3 + ldrsb r1, [r3, r1] + adds r0, r1 + bx lr + thumb_func_end sub_8195E34 + + thumb_func_start sub_8195E58 +sub_8195E58: @ 8195E58 + push {lr} + bl RtcCalcLocalTime + ldr r0, =gLocalTime + bl sub_8195E34 + adds r1, r0, 0 + ldr r2, =gUnknown_0203CD80 + ldr r0, [r2] + cmp r0, r1 + bhi _08195E74 + subs r0, r1, r0 + cmp r0, 0x9 + bls _08195E84 +_08195E74: + str r1, [r2] + movs r0, 0x1 + b _08195E86 + .pool +_08195E84: + movs r0, 0 +_08195E86: + pop {r1} + bx r1 + thumb_func_end sub_8195E58 + + thumb_func_start sub_8195E8C +sub_8195E8C: @ 8195E8C + push {r4,r5,lr} + movs r5, 0x1 + ldr r4, =gPlayerParty + adds r0, r4, 0 + movs r1, 0x6 + bl GetMonData + cmp r0, 0 + bne _08195EAE + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bne _08195EAE + movs r5, 0x2 +_08195EAE: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r5, 1 + adds r1, r5 + cmp r0, r1 + blt _08195ED0 + movs r0, 0 + b _08195ED2 + .pool +_08195ED0: + movs r0, 0x1 +_08195ED2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8195E8C + + thumb_func_start sub_8195ED8 +sub_8195ED8: @ 8195ED8 + push {r4,lr} + ldr r4, =gMapHeader + ldrb r0, [r4, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + cmp r0, 0 + beq _08195F30 + ldrb r0, [r4, 0x14] + cmp r0, 0x39 + beq _08195F30 + cmp r0, 0xE + bne _08195F0E + movs r0, 0xF9 + lsls r0, 2 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08195F0E + movs r0, 0xDC + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08195F30 +_08195F0E: + ldr r0, =gMapHeader + ldrb r0, [r0, 0x14] + cmp r0, 0x38 + bne _08195F38 + movs r0, 0xCF + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08195F38 + movs r0, 0x8B + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08195F38 +_08195F30: + movs r0, 0 + b _08195F3A + .pool +_08195F38: + movs r0, 0x1 +_08195F3A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8195ED8 + + thumb_func_start sub_8195F40 +sub_8195F40: @ 8195F40 + push {lr} + ldr r1, =gUnknown_0203CD80 + ldrb r0, [r1, 0x6] + adds r0, 0x1 + strb r0, [r1, 0x6] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _08195F5C + movs r0, 0 + b _08195F62 + .pool +_08195F5C: + movs r0, 0 + strb r0, [r1, 0x6] + movs r0, 0x1 +_08195F62: + pop {r1} + bx r1 + thumb_func_end sub_8195F40 + + thumb_func_start sub_8195F68 +sub_8195F68: @ 8195F68 + push {r4,lr} + bl sub_8195FCC + adds r4, r0, 0 + cmp r4, 0 + beq _08195FB8 + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __umodsi3 + bl sub_8195FF8 + ldr r2, =gUnknown_0203CD80 + movs r1, 0 + strh r0, [r2, 0x4] + strb r1, [r2, 0x7] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4E + beq _08195FB8 + ldrh r0, [r2, 0x4] + bl sub_8196844 + adds r4, r0, 0 + bl sub_819672C + ldr r1, =gMapHeader + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x14] + cmp r0, r1 + bne _08195FC4 + adds r0, r4, 0 + bl sub_8196710 + cmp r0, 0 + bne _08195FC4 +_08195FB8: + movs r0, 0 + b _08195FC6 + .pool +_08195FC4: + movs r0, 0x1 +_08195FC6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8195F68 + + thumb_func_start sub_8195FCC +sub_8195FCC: @ 8195FCC + push {r4,r5,lr} + movs r4, 0 + movs r5, 0 +_08195FD2: + movs r1, 0xAE + lsls r1, 1 + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08195FE8 + adds r5, 0x1 +_08195FE8: + adds r4, 0x1 + cmp r4, 0x3F + bls _08195FD2 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8195FCC + + thumb_func_start sub_8195FF8 +sub_8195FF8: @ 8195FF8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + ldr r6, =gUnknown_085500A4 +_08196000: + movs r1, 0xAE + lsls r1, 1 + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08196022 + cmp r5, 0 + bne _08196020 + ldrh r0, [r6] + b _0819602C + .pool +_08196020: + subs r5, 0x1 +_08196022: + adds r6, 0x10 + adds r4, 0x1 + cmp r4, 0x3F + bls _08196000 + movs r0, 0x4E +_0819602C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8195FF8 + + thumb_func_start sub_8196034 +sub_8196034: @ 8196034 + push {lr} + ldr r0, =0x0000012f + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08196078 + bl sub_8195F40 + cmp r0, 0 + beq _08196078 + bl sub_8195E58 + cmp r0, 0 + beq _08196078 + bl sub_8195E8C + cmp r0, 0 + beq _08196078 + bl sub_8195ED8 + cmp r0, 0 + beq _08196078 + bl sub_8195F68 + cmp r0, 0 + beq _08196078 + bl task_prev_quest + movs r0, 0x1 + b _0819607A + .pool +_08196078: + movs r0, 0 +_0819607A: + pop {r1} + bx r1 + thumb_func_end sub_8196034 + + thumb_func_start sub_8196080 +sub_8196080: @ 8196080 + push {lr} + ldr r1, =gUnknown_0203CD80 + movs r0, 0x1 + strb r0, [r1, 0x7] + bl task_prev_quest + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196080 + + thumb_func_start sub_8196094 +sub_8196094: @ 8196094 + push {lr} + ldr r0, =sub_81960E0 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196094 + + thumb_func_start task_prev_quest +task_prev_quest: @ 81960A8 + push {lr} + ldr r0, =gUnknown_0203CD80 + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _081960C2 + bl ScriptContext2_Enable + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 +_081960C2: + ldr r0, =0x00000107 + bl PlaySE + ldr r0, =sub_81960E0 + movs r1, 0x1 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end task_prev_quest + + thumb_func_start sub_81960E0 +sub_81960E0: @ 81960E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r1, =gUnknown_0860EF78 + movs r2, 0 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 + cmp r0, 0 + beq _0819611E + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r1, 0 + strh r1, [r4, 0x2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7 + bls _0819611E + adds r0, r5, 0 + bl DestroyTask +_0819611E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81960E0 + + thumb_func_start sub_819612C +sub_819612C: @ 819612C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldr r0, =gUnknown_0860EF98 + bl AddWindow + strh r0, [r5, 0x4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + bne _0819615C + adds r0, r4, 0 + b _081961E0 + .pool +_0819615C: + ldr r1, =gUnknown_0860EA6C + movs r2, 0x80 + lsls r2, 1 + movs r3, 0x9C + lsls r3, 2 + movs r0, 0 + bl LoadBgTiles + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _08196188 + ldrb r0, [r5, 0x4] + bl RemoveWindow + adds r0, r4, 0 + b _081961E0 + .pool +_08196188: + ldr r1, =gUnknown_0860EB8C + ldr r3, =0x00000279 + movs r0, 0 + str r0, [sp] + movs r2, 0 + bl decompress_and_copy_tile_data_to_vram + cmp r0, 0 + beq _081961D8 + ldrb r0, [r5, 0x4] + movs r1, 0x88 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0860EA4C + movs r1, 0xE0 + movs r2, 0x20 + bl LoadPalette + ldr r0, =gUnknown_0860EB6C + movs r1, 0xF0 + movs r2, 0x20 + bl LoadPalette + ldr r1, =0xffffe000 + movs r0, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + b _081961E6 + .pool +_081961D8: + ldrb r0, [r5, 0x4] + bl RemoveWindow + adds r0, r6, 0 +_081961E0: + bl DestroyTask + movs r0, 0 +_081961E6: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_819612C + + thumb_func_start sub_81961F0 +sub_81961F0: @ 81961F0 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _08196268 + ldrb r0, [r4, 0x4] + bl PutWindowTilemap + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r1, 0x9C + lsls r1, 2 + movs r2, 0xE + bl sub_819645C + ldr r1, =0x0000f279 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0 + movs r2, 0x1 + movs r3, 0xF + bl WriteSequenceToBgTilemapBuffer + ldr r0, =sub_8196694 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + ldrb r0, [r4, 0x4] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + b _0819626A + .pool +_08196268: + movs r0, 0 +_0819626A: + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81961F0 + + thumb_func_start sub_8196274 +sub_8196274: @ 8196274 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _08196298 + movs r0, 0 + b _081962A4 + .pool +_08196298: + movs r1, 0x4 + ldrsh r0, [r4, r1] + ldr r1, =gUnknown_0860EF70 + bl sub_81965D8 + movs r0, 0x1 +_081962A4: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196274 + + thumb_func_start sub_81962B0 +sub_81962B0: @ 81962B0 + push {lr} + movs r1, 0xC0 + lsls r1, 3 + movs r0, 0 + movs r2, 0x1 + bl ChangeBgY + cmp r0, 0 + bge _081962C6 + movs r0, 0 + b _081962D2 +_081962C6: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 +_081962D2: + pop {r1} + bx r1 + thumb_func_end sub_81962B0 + + thumb_func_start sub_81962D8 +sub_81962D8: @ 81962D8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0x4 + ldrsh r0, [r4, r1] + bl sub_8196648 + cmp r0, 0 + bne _08196328 + ldrb r0, [r4, 0x4] + movs r1, 0x88 + bl FillWindowPixelBuffer + ldr r1, =gUnknown_0203CD80 + ldrb r0, [r1, 0x7] + cmp r0, 0 + bne _0819630C + ldrh r0, [r1, 0x4] + ldr r1, =gStringVar4 + bl sub_81967AC +_0819630C: + movs r1, 0x4 + ldrsh r0, [r4, r1] + ldr r1, =gStringVar4 + bl sub_81965D8 + movs r0, 0x1 + b _0819632A + .pool +_08196328: + movs r0, 0 +_0819632A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81962D8 + + thumb_func_start sub_8196330 +sub_8196330: @ 8196330 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0x4 + ldrsh r0, [r4, r1] + bl sub_8196648 + cmp r0, 0 + bne _08196388 + bl IsSEPlaying + lsls r0, 24 + cmp r0, 0 + bne _08196388 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08196388 + ldrb r0, [r4, 0x4] + movs r1, 0x88 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x4] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x84 + lsls r0, 1 + bl PlaySE + movs r0, 0x1 + b _0819638A + .pool +_08196388: + movs r0, 0 +_0819638A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8196330 + + thumb_func_start sub_8196390 +sub_8196390: @ 8196390 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0xC0 + lsls r1, 3 + movs r0, 0 + movs r2, 0x2 + bl ChangeBgY + ldr r1, =0xffffe000 + cmp r0, r1 + ble _081963C0 + movs r0, 0 + b _081963E8 + .pool +_081963C0: + movs r0, 0x1E + str r0, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0xE + bl FillBgTilemapBufferRect_Palette0 + ldrb r0, [r4, 0xA] + bl DestroyTask + ldrb r0, [r4, 0x4] + bl RemoveWindow + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 +_081963E8: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8196390 + + thumb_func_start sub_81963F0 +sub_81963F0: @ 81963F0 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08196454 + bl IsSEPlaying + lsls r0, 24 + cmp r0, 0 + bne _08196454 + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldr r0, =gUnknown_0203CD80 + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _08196446 + bl sub_81973A4 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gMapObjects + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + bl sub_809757C + bl ScriptContext2_Disable +_08196446: + movs r0, 0x1 + b _08196456 + .pool +_08196454: + movs r0, 0 +_08196456: + pop {r1} + bx r1 + thumb_func_end sub_81963F0 + + thumb_func_start sub_819645C +sub_819645C: @ 819645C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r4, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl GetWindowAttribute + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + bl GetWindowAttribute + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x2 + bl GetWindowAttribute + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0x3 + bl GetWindowAttribute + adds r6, r0, 0 + adds r0, r4, 0 + movs r1, 0x4 + bl GetWindowAttribute + str r0, [sp, 0x10] + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r1, 0xA + bl GetBgAttribute + lsls r0, 16 + lsrs r0, 16 + adds r5, r0 + lsls r7, 12 + movs r1, 0xF0 + lsls r1, 8 + adds r0, r1, 0 + ands r7, r0 + adds r1, r7, 0 + orrs r1, r5 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x8] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + ldr r4, [sp, 0xC] + subs r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + movs r3, 0x1 + mov r8, r3 + str r3, [sp] + str r3, [sp, 0x4] + mov r0, r9 + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x1 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x8] + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + lsls r0, r6, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + str r0, [sp] + mov r2, r8 + str r2, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x14] + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x2 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [sp, 0x8] + adds r0, r3, r6 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + mov r0, r8 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x1C] + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x3 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0xC] + lsls r6, r2, 24 + lsrs r6, 24 + mov r3, r8 + str r3, [sp] + ldr r0, [sp, 0x10] + lsls r4, r0, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + mov r0, r9 + mov r2, r10 + adds r3, r6, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x4 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + mov r2, r8 + str r2, [sp] + str r4, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x1C] + adds r3, r6, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x5 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [sp, 0xC] + ldr r2, [sp, 0x10] + adds r0, r3, r2 + lsls r0, 24 + lsrs r4, r0, 24 + mov r3, r8 + str r3, [sp] + str r3, [sp, 0x4] + mov r0, r9 + mov r2, r10 + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x6 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + str r0, [sp] + mov r2, r8 + str r2, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x14] + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r5, 0x7 + orrs r5, r7 + lsls r5, 16 + lsrs r5, 16 + mov r3, r8 + str r3, [sp] + str r3, [sp, 0x4] + mov r0, r9 + adds r1, r5, 0 + ldr r2, [sp, 0x1C] + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819645C + + thumb_func_start sub_81965D8 +sub_81965D8: @ 81965D8 + push {lr} + sub sp, 0x10 + str r1, [sp] + mov r1, sp + movs r3, 0 + strb r0, [r1, 0x4] + mov r0, sp + movs r1, 0x1 + strb r1, [r0, 0x5] + movs r2, 0x20 + strb r2, [r0, 0x6] + strb r1, [r0, 0x7] + strb r2, [r0, 0x8] + strb r1, [r0, 0x9] + strb r3, [r0, 0xA] + strb r3, [r0, 0xB] + mov r3, sp + ldrb r2, [r3, 0xC] + subs r1, 0x11 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + mov r2, sp + movs r3, 0xF + movs r0, 0xA0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + movs r0, 0x8 + orrs r1, r0 + strb r1, [r2, 0xD] + ands r1, r3 + movs r0, 0xE0 + orrs r1, r0 + strb r1, [r2, 0xD] + ldr r2, =gTextFlags + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl sav2_get_text_speed + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + movs r2, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81965D8 + + thumb_func_start sub_8196648 +sub_8196648: @ 8196648 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gMain + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0819666C + ldr r0, =gTextFlags + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08196678 + .pool +_0819666C: + ldr r2, =gTextFlags + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08196678: + bl RunTextPrinters + lsls r0, r4, 24 + lsrs r0, 24 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196648 + + thumb_func_start sub_8196694 +sub_8196694: @ 8196694 + push {lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r2, r1, r0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _081966FC + movs r1, 0 + strh r1, [r2] + ldrh r0, [r2, 0x2] + adds r0, 0x1 + strh r0, [r2, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _081966C8 + strh r1, [r2, 0x2] +_081966C8: + movs r0, 0x2 + ldrsh r1, [r2, r0] + lsls r1, 4 + ldr r0, =0x00000279 + adds r1, r0 + strh r1, [r2, 0x4] + ldr r2, =0xfffff000 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0 + movs r2, 0x1 + movs r3, 0xF + bl WriteSequenceToBgTilemapBuffer + movs r0, 0 + bl CopyBgTilemapBufferToVram +_081966FC: + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196694 + + thumb_func_start sub_8196710 +sub_8196710: @ 8196710 + ldr r1, =gSaveBlock1Ptr + ldr r1, [r1] + ldr r2, =0x000009ca + adds r1, r2 + adds r1, r0 + ldrb r1, [r1] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_8196710 + + thumb_func_start sub_819672C +sub_819672C: @ 819672C + push {lr} + ldr r1, =gUnknown_085500A4 + lsls r0, 4 + adds r0, r1 + ldrh r2, [r0, 0xA] + ldrh r1, [r0, 0xC] + adds r0, r2, 0 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x14] + pop {r1} + bx r1 + .pool + thumb_func_end sub_819672C + + thumb_func_start sub_8196748 +sub_8196748: @ 8196748 + push {r4-r6,lr} + movs r5, 0 + movs r6, 0 + ldr r4, =gUnknown_085500A4 +_08196750: + ldrh r0, [r4] + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _0819675E + adds r6, 0x1 +_0819675E: + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x3F + bls _08196750 + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196748 + + thumb_func_start sub_8196774 +sub_8196774: @ 8196774 + push {r4-r7,lr} + adds r7, r0, 0 + movs r4, 0 + movs r6, 0 + ldr r5, =gUnknown_085500A4 +_0819677E: + ldrh r0, [r5] + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _0819679A + cmp r6, r7 + bne _08196798 + adds r0, r4, 0 + b _081967A4 + .pool +_08196798: + adds r6, 0x1 +_0819679A: + adds r5, 0x10 + adds r4, 0x1 + cmp r4, 0x4D + bls _0819677E + movs r0, 0x4E +_081967A4: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8196774 + + thumb_func_start sub_81967AC +sub_81967AC: @ 81967AC + push {r4-r7,lr} + adds r6, r1, 0 + movs r7, 0 + bl sub_8196844 + adds r5, r0, 0 + ldr r0, =gUnknown_0203CD88 + strh r7, [r0] + adds r0, r5, 0 + bl sub_8196710 + cmp r0, 0 + beq _081967EC + adds r0, r5, 0 + bl sub_819672C + ldr r1, =gMapHeader + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x14] + cmp r0, r1 + bne _081967EC + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8196864 + b _08196830 + .pool +_081967EC: + adds r0, r5, 0 + bl sub_8196D74 + cmp r0, 0 + beq _0819680A + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8196890 + adds r4, r0, 0 + movs r7, 0x1 + adds r0, r5, 0 + bl sub_80B1E94 + b _08196832 +_0819680A: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08196828 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81968BC + b _08196830 +_08196828: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8196910 +_08196830: + adds r4, r0, 0 +_08196832: + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_81969E0 + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81967AC + + thumb_func_start sub_8196844 +sub_8196844: @ 8196844 + push {lr} + adds r3, r0, 0 + movs r2, 0 + ldr r1, =gUnknown_0860DEB8 +_0819684C: + ldrh r0, [r1] + cmp r0, r3 + beq _0819685C + adds r1, 0x14 + adds r2, 0x1 + b _0819684C + .pool +_0819685C: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_8196844 + + thumb_func_start sub_8196864 +sub_8196864: @ 8196864 + ldr r2, =gUnknown_0860DEB8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0xE] + movs r2, 0xFF + lsrs r0, r1, 8 + subs r0, 0x1 + ands r1, r2 + subs r1, 0x1 + ldr r2, =gUnknown_0860EA2C + lsls r0, 2 + adds r0, r2 + lsls r1, 3 + ldr r0, [r0] + adds r0, r1 + bx lr + .pool + thumb_func_end sub_8196864 + + thumb_func_start sub_8196890 +sub_8196890: @ 8196890 + ldr r2, =gUnknown_0860DEB8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0x10] + movs r2, 0xFF + lsrs r0, r1, 8 + subs r0, 0x1 + ands r1, r2 + subs r1, 0x1 + ldr r2, =gUnknown_0860EA2C + lsls r0, 2 + adds r0, r2 + lsls r1, 3 + ldr r0, [r0] + adds r0, r1 + bx lr + .pool + thumb_func_end sub_8196890 + + thumb_func_start sub_81968BC +sub_81968BC: @ 81968BC + push {r4,lr} + adds r4, r0, 0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + ldr r2, =gUnknown_0860DEB8 + lsrs r0, 15 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 2 + adds r0, r1 + adds r2, 0x4 + adds r0, r2 + ldrh r4, [r0] + cmp r4, 0 + bne _081968EC + movs r0, 0 + bl SpriteCallbackDummy +_081968EC: + movs r1, 0xFF + lsrs r0, r4, 8 + subs r0, 0x1 + ands r4, r1 + subs r1, r4, 0x1 + ldr r2, =gUnknown_0860EA20 + lsls r0, 2 + adds r0, r2 + lsls r1, 3 + ldr r0, [r0] + adds r0, r1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81968BC + + thumb_func_start sub_8196910 +sub_8196910: @ 8196910 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081969AC + movs r5, 0 + movs r4, 0 + lsls r7, r6, 2 +_0819692C: + lsls r0, r4, 16 + lsrs r0, 16 + mov r1, sp + bl sub_8196E04 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _08196940 + adds r5, 0x1 +_08196940: + adds r4, 0x1 + cmp r4, 0x6 + ble _0819692C + cmp r5, 0 + beq _081969AC + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + adds r5, r0, 0 + movs r4, 0 + b _08196962 +_0819695E: + subs r5, 0x1 +_08196960: + adds r4, 0x1 +_08196962: + cmp r4, 0x6 + bgt _08196980 + lsls r0, r4, 16 + lsrs r0, 16 + mov r1, sp + bl sub_8196E04 + ldr r1, =gUnknown_0203CD88 + strh r0, [r1, 0x2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _08196960 + cmp r5, 0 + bne _0819695E +_08196980: + ldr r0, =gUnknown_0203CD88 + strh r4, [r0] + ldr r1, =gUnknown_0860DEB8 + adds r0, r7, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0xC] + subs r2, r0, 0x1 + ldr r1, =gUnknown_0860EA34 + ldr r0, [sp] + lsls r0, 2 + adds r0, r1 + lsls r1, r2, 3 + ldr r0, [r0] + adds r0, r1 + b _081969D0 + .pool +_081969AC: + ldr r1, =gUnknown_0860DEB8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrh r2, [r0, 0xA] + lsrs r1, r2, 8 + subs r1, 0x1 + str r1, [sp] + movs r0, 0xFF + ands r0, r2 + subs r2, r0, 0x1 + ldr r0, =gUnknown_0860EA34 + lsls r1, 2 + adds r1, r0 + lsls r2, 3 + ldr r0, [r1] + adds r0, r2 +_081969D0: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196910 + + thumb_func_start sub_81969E0 +sub_81969E0: @ 81969E0 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + adds r1, r4, 0x4 + bl sub_81969FC + ldr r1, [r4] + adds r0, r5, 0 + bl StringExpandPlaceholders + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81969E0 + + thumb_func_start sub_81969FC +sub_81969FC: @ 81969FC + push {r4-r7,lr} + adds r7, r0, 0 + adds r6, r1, 0 + movs r4, 0 + ldr r5, =gUnknown_0860EFA0 +_08196A06: + adds r1, r6, r4 + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0 + blt _08196A1A + adds r1, r0, 0 + ldr r2, [r5] + adds r0, r7, 0 + bl sub_8196A2C +_08196A1A: + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0x2 + ble _08196A06 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81969FC + + thumb_func_start sub_8196A2C +sub_8196A2C: @ 8196A2C + push {lr} + ldr r3, =gUnknown_0860EFAC + lsls r1, 2 + adds r1, r3 + ldr r3, [r1] + adds r1, r2, 0 + bl _call_via_r3 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196A2C + + thumb_func_start sub_8196A44 +sub_8196A44: @ 8196A44 + push {r4-r6,lr} + adds r5, r1, 0 + ldr r2, =gUnknown_0860DEB8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r4, [r1] + movs r2, 0 + ldr r3, =gUnknown_0860EFC4 + adds r6, r3, 0 +_08196A5A: + lsls r1, r2, 3 + ldrh r0, [r3] + cmp r0, r4 + bne _08196A78 + adds r0, r6, 0x4 + adds r0, r1, r0 + ldr r1, [r0] + adds r0, r5, 0 + bl StringCopy + b _08196A90 + .pool +_08196A78: + adds r3, 0x8 + adds r2, 0x1 + cmp r2, 0x5 + bls _08196A5A + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + ldr r0, =gTrainers + 0x4 @ name offset + adds r1, r0 + adds r0, r5, 0 + bl StringCopy +_08196A90: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196A44 + + thumb_func_start sub_8196A9C +sub_8196A9C: @ 8196A9C + push {r4,lr} + adds r4, r1, 0 + bl sub_819672C + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + bl GetMapName + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8196A9C + + thumb_func_start sub_8196AB8 +sub_8196AB8: @ 8196AB8 + push {lr} + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x13 + bgt _08196AD4 + movs r0, 0 + b _08196B4A +_08196AD4: + adds r0, r1, 0 + subs r0, 0x14 + cmp r0, 0x13 + bhi _08196AE0 + movs r0, 0x1 + b _08196B4A +_08196AE0: + adds r0, r1, 0 + subs r0, 0x28 + cmp r0, 0x9 + bhi _08196AEC + movs r0, 0x2 + b _08196B4A +_08196AEC: + adds r0, r1, 0 + subs r0, 0x32 + cmp r0, 0x9 + bhi _08196AF8 + movs r0, 0x3 + b _08196B4A +_08196AF8: + adds r0, r1, 0 + subs r0, 0x3C + cmp r0, 0x9 + bhi _08196B04 + movs r0, 0x4 + b _08196B4A +_08196B04: + adds r0, r1, 0 + subs r0, 0x46 + cmp r0, 0x9 + bhi _08196B10 + movs r0, 0x5 + b _08196B4A +_08196B10: + adds r0, r1, 0 + subs r0, 0x50 + cmp r0, 0x4 + bhi _08196B1C + movs r0, 0x6 + b _08196B4A +_08196B1C: + adds r0, r1, 0 + subs r0, 0x55 + cmp r0, 0x4 + bhi _08196B28 + movs r0, 0x7 + b _08196B4A +_08196B28: + adds r0, r1, 0 + subs r0, 0x5A + cmp r0, 0x3 + bhi _08196B34 + movs r0, 0x8 + b _08196B4A +_08196B34: + adds r0, r1, 0 + subs r0, 0x5E + cmp r0, 0x3 + bhi _08196B40 + movs r0, 0x9 + b _08196B4A +_08196B40: + cmp r1, 0x62 + beq _08196B48 + movs r0, 0xB + b _08196B4A +_08196B48: + movs r0, 0xA +_08196B4A: + pop {r1} + bx r1 + thumb_func_end sub_8196AB8 + + thumb_func_start sub_8196B50 +sub_8196B50: @ 8196B50 + push {lr} + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x3B + bgt _08196B6C + movs r0, 0 + b _08196B92 +_08196B6C: + adds r0, r1, 0 + subs r0, 0x3C + cmp r0, 0x1D + bhi _08196B78 + movs r0, 0x1 + b _08196B92 +_08196B78: + adds r0, r1, 0 + subs r0, 0x5A + cmp r0, 0x4 + bhi _08196B84 + movs r0, 0x2 + b _08196B92 +_08196B84: + adds r0, r1, 0 + subs r0, 0x5F + cmp r0, 0x3 + bls _08196B90 + movs r0, 0x4 + b _08196B92 +_08196B90: + movs r0, 0x3 +_08196B92: + pop {r1} + bx r1 + thumb_func_end sub_8196B50 + + thumb_func_start sub_8196B98 +sub_8196B98: @ 8196B98 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r2, r0, 0 + mov r8, r1 + movs r3, 0 + ldr r0, =gWildMonHeaders + ldrb r1, [r0] + adds r7, r0, 0 + cmp r1, 0xFF + beq _08196C5C + ldr r1, =gUnknown_085500A4 + lsls r0, r2, 4 + adds r2, r0, r1 + ldrh r4, [r2, 0xA] + adds r1, r7, 0 +_08196BBA: + ldrb r0, [r1] + cmp r0, r4 + bne _08196BC8 + ldrb r0, [r1, 0x1] + ldrh r5, [r2, 0xC] + cmp r0, r5 + beq _08196BD2 +_08196BC8: + adds r1, 0x14 + adds r3, 0x1 + ldrb r0, [r1] + cmp r0, 0xFF + bne _08196BBA +_08196BD2: + adds r1, r7, 0 + lsls r0, r3, 2 + adds r0, r3 + lsls r5, r0, 2 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0xFF + beq _08196C5C + movs r6, 0 + adds r0, r1, 0x4 + adds r0, r5, r0 + ldr r4, [r0] + cmp r4, 0 + beq _08196C02 + bl sub_8196AB8 + lsls r0, 24 + mov r2, sp + ldr r1, [r4, 0x4] + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0, 0x2] + strh r0, [r2] + movs r6, 0x1 +_08196C02: + adds r0, r7, 0 + adds r0, 0x8 + adds r0, r5, r0 + ldr r4, [r0] + cmp r4, 0 + beq _08196C26 + bl sub_8196B50 + lsls r0, 24 + lsls r1, r6, 1 + mov r3, sp + adds r2, r3, r1 + ldr r1, [r4, 0x4] + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0, 0x2] + strh r0, [r2] + adds r6, 0x1 +_08196C26: + cmp r6, 0 + beq _08196C5C + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 1 + add r0, sp + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + mov r0, r8 + bl StringCopy + b _08196C62 + .pool +_08196C5C: + movs r0, 0xFF + mov r5, r8 + strb r0, [r5] +_08196C62: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8196B98 + + thumb_func_start sub_8196C70 +sub_8196C70: @ 8196C70 + push {r4-r7,lr} + adds r7, r1, 0 + ldr r2, =gUnknown_0860DEB8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1] + bl sub_80B2250 + lsls r0, 16 + lsrs r0, 16 + ldr r5, =gTrainers + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r0, r5, 0 + adds r0, 0x24 + adds r0, r4, r0 + ldr r6, [r0] + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r4, r5 + adds r1, r4, 0 + adds r1, 0x20 + ldrb r1, [r1] + bl __modsi3 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r4] + cmp r1, 0x1 + beq _08196CD4 + cmp r1, 0x1 + ble _08196CC2 + cmp r1, 0x2 + beq _08196CD0 + cmp r1, 0x3 + beq _08196CD4 +_08196CC2: + lsls r0, 3 + b _08196CD6 + .pool +_08196CD0: + lsls r0, 3 + b _08196CD6 +_08196CD4: + lsls r0, 4 +_08196CD6: + adds r0, r6 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r7, 0 + bl StringCopy + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196C70 + + thumb_func_start sub_8196CF4 +sub_8196CF4: @ 8196CF4 + push {lr} + adds r0, r1, 0 + ldr r2, =gUnknown_0860EFF4 + ldr r1, =gUnknown_0203CD88 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196CF4 + + thumb_func_start sub_8196D14 +sub_8196D14: @ 8196D14 + push {r4-r6,lr} + adds r5, r1, 0 + movs r4, 0 + ldr r0, =gUnknown_0203CD88 + ldrh r1, [r0, 0x2] + adds r6, r0, 0 + cmp r1, 0 + beq _08196D34 +_08196D24: + adds r0, r1, 0 + movs r1, 0xA + bl __divsi3 + adds r1, r0, 0 + adds r4, 0x1 + cmp r1, 0 + bne _08196D24 +_08196D34: + ldrh r1, [r6, 0x2] + lsls r3, r4, 24 + lsrs r3, 24 + adds r0, r5, 0 + movs r2, 0 + bl ConvertIntToDecimalStringN + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196D14 + + thumb_func_start sub_8196D4C +sub_8196D4C: @ 8196D4C + push {r4,r5,lr} + movs r4, 0 + ldr r5, =gUnknown_0860F010 + b _08196D5C + .pool +_08196D58: + adds r5, 0x2 + adds r4, 0x1 +_08196D5C: + cmp r4, 0x7 + bhi _08196D6C + ldrh r0, [r5] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08196D58 +_08196D6C: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8196D4C + + thumb_func_start sub_8196D74 +sub_8196D74: @ 8196D74 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + bl sub_8196D4C + cmp r0, 0x4 + ble _08196DF4 + bl RtcGetLocalDayCount + adds r4, r0, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xA + bl ReadUnalignedWord + adds r6, r0, 0 + ldr r0, =0x0000ffff + ands r6, r0 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00002e6a + adds r0, r1 + ldrh r5, [r0] + bl sub_8196748 + mov r9, r0 + movs r0, 0xD + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0xA + bl __divsi3 + mov r8, r0 + movs r0, 0x9 + bl GetGameStat + eors r4, r5 + eors r5, r0 + adds r4, r5 + eors r4, r6 + adds r0, r4, 0 + mov r1, r8 + bl __modsi3 + cmp r0, r9 + bge _08196DF4 + bl sub_8196774 + cmp r0, r7 + bne _08196DF4 + movs r0, 0x1 + b _08196DF6 + .pool +_08196DF4: + movs r0, 0 +_08196DF6: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8196D74 + + thumb_func_start sub_8196E04 +sub_8196E04: @ 8196E04 + push {r4-r6,lr} + adds r5, r1, 0 + lsls r0, 16 + lsrs r0, 16 + movs r4, 0 + cmp r0, 0x6 + bls _08196E14 + b _08196F7E +_08196E14: + lsls r0, 2 + ldr r1, =_08196E24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08196E24: + .4byte _08196E9C + .4byte _08196E40 + .4byte _08196ED0 + .4byte _08196F38 + .4byte _08196E74 + .4byte _08196F04 + .4byte _08196F60 +_08196E40: + movs r3, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000d14 + adds r0, r1 +_08196E4A: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196E52: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196E5A + ldrh r4, [r1] +_08196E5A: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196E52 + cmp r3, 0x1 + ble _08196E4A + movs r0, 0x3 + b _08196F7C + .pool +_08196E74: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e08 + adds r0, r1 + movs r3, 0x1 +_08196E7E: + ldrh r6, [r0] + cmp r4, r6 + bcs _08196E86 + ldrh r4, [r0] +_08196E86: + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08196E7E + movs r0, 0x4 + b _08196F7C + .pool +_08196E9C: + movs r3, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xCF + lsls r1, 4 + adds r0, r1 +_08196EA8: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196EB0: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196EB8 + ldrh r4, [r1] +_08196EB8: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196EB0 + movs r2, 0x2 + cmp r3, 0x3 + ble _08196EA8 + str r2, [r5] + b _08196F7E + .pool +_08196ED0: + movs r3, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xDD + lsls r1, 4 + adds r0, r1 +_08196EDC: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196EE4: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196EEC + ldrh r4, [r1] +_08196EEC: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196EE4 + movs r2, 0x2 + cmp r3, 0x1 + ble _08196EDC + str r2, [r5] + b _08196F7E + .pool +_08196F04: + movs r3, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000dea + adds r0, r1 +_08196F0E: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196F16: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196F1E + ldrh r4, [r1] +_08196F1E: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196F16 + movs r2, 0x2 + cmp r3, 0x1 + ble _08196F0E + str r2, [r5] + b _08196F7E + .pool +_08196F38: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000dde + adds r0, r1 + movs r3, 0x1 +_08196F42: + ldrh r6, [r0] + cmp r4, r6 + bcs _08196F4A + ldrh r4, [r0] +_08196F4A: + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08196F42 + movs r3, 0x2 + str r3, [r5] + b _08196F7E + .pool +_08196F60: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e1e + adds r0, r1 + movs r3, 0x1 +_08196F6A: + ldrh r6, [r0] + cmp r4, r6 + bcs _08196F72 + ldrh r4, [r0] +_08196F72: + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08196F6A + movs r0, 0x5 +_08196F7C: + str r0, [r5] +_08196F7E: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196E04 + + thumb_func_start sub_8196F90 +sub_8196F90: @ 8196F90 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x9 + bhi _08196F9E + movs r0, 0 + b _0819707A +_08196F9E: + cmp r4, 0x13 + bhi _08196FA6 + movs r0, 0x1 + b _0819707A +_08196FA6: + cmp r4, 0x1D + bhi _08196FAE + movs r0, 0x2 + b _0819707A +_08196FAE: + cmp r4, 0x27 + bhi _08196FB6 + movs r0, 0x3 + b _0819707A +_08196FB6: + cmp r4, 0x31 + bhi _08196FBE + movs r0, 0x4 + b _0819707A +_08196FBE: + cmp r4, 0x3B + bhi _08196FC6 + movs r0, 0x5 + b _0819707A +_08196FC6: + cmp r4, 0x45 + bhi _08196FCE + movs r0, 0x6 + b _0819707A +_08196FCE: + cmp r4, 0x4F + bhi _08196FD6 + movs r0, 0x7 + b _0819707A +_08196FD6: + cmp r4, 0x59 + bhi _08196FDE + movs r0, 0x8 + b _0819707A +_08196FDE: + cmp r4, 0x63 + bhi _08196FE6 + movs r0, 0x9 + b _0819707A +_08196FE6: + cmp r4, 0x6D + bhi _08196FEE + movs r0, 0xA + b _0819707A +_08196FEE: + cmp r4, 0x77 + bhi _08196FF6 + movs r0, 0xB + b _0819707A +_08196FF6: + cmp r4, 0x81 + bhi _08196FFE + movs r0, 0xC + b _0819707A +_08196FFE: + cmp r4, 0x8B + bhi _08197006 + movs r0, 0xD + b _0819707A +_08197006: + cmp r4, 0x95 + bhi _0819700E + movs r0, 0xE + b _0819707A +_0819700E: + cmp r4, 0x9F + bhi _08197016 + movs r0, 0xF + b _0819707A +_08197016: + cmp r4, 0xA9 + bhi _0819701E + movs r0, 0x10 + b _0819707A +_0819701E: + cmp r4, 0xB3 + bhi _08197026 + movs r0, 0x11 + b _0819707A +_08197026: + cmp r4, 0xBD + bhi _0819702E + movs r0, 0x12 + b _0819707A +_0819702E: + cmp r4, 0xC7 + bls _08197078 + movs r0, 0xCD + lsls r0, 1 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _08197050 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08197050: + ldr r0, =0x00000199 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _0819706C + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_0819706C: + cmp r4, 0xC7 + bls _08197078 + movs r0, 0x14 + b _0819707A + .pool +_08197078: + movs r0, 0x13 +_0819707A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8196F90 + + thumb_func_start sub_8197080 +sub_8197080: @ 8197080 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + movs r0, 0xFA + lsls r0, 2 + bl Alloc + adds r7, r0, 0 + cmp r7, 0 + bne _081970A2 + movs r0, 0xFF + mov r1, r8 + strb r0, [r1] + b _0819715C +_081970A2: + movs r0, 0 + bl sub_80C0844 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + bl sub_80C0844 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gStringVar1 + mov r10, r0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r1, =gStringVar2 + mov r9, r1 + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r0, r6, 0 + bl sub_8196F90 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gUnknown_082A5C9C + adds r0, r7, 0 + bl StringCopy + adds r5, r0, 0 + movs r6, 0xFB + strb r6, [r5] + adds r5, 0x1 + ldr r1, =gUnknown_082A5D2C + adds r0, r5, 0 + bl StringCopy + adds r5, r0, 0 + strb r6, [r5] + adds r5, 0x1 + ldr r0, =gUnknown_0860F020 + lsls r4, 2 + adds r4, r0 + ldr r1, [r4] + adds r0, r5, 0 + bl StringCopy + mov r0, r8 + adds r1, r7, 0 + bl StringExpandPlaceholders + adds r5, r0, 0 + bl IsNationalPokedexEnabled + cmp r0, 0 + beq _08197156 + strb r6, [r5] + adds r5, 0x1 + movs r0, 0 + bl pokedex_count + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + bl pokedex_count + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r10 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r1, =gUnknown_082A633D + adds r0, r5, 0 + bl StringExpandPlaceholders +_08197156: + adds r0, r7, 0 + bl Free +_0819715C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197080 + + thumb_func_start sub_8197184 +sub_8197184: @ 8197184 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0860EA6C + movs r2, 0x80 + lsls r2, 1 + lsls r4, 16 + lsrs r4, 16 + adds r3, r4, 0 + bl LoadBgTiles + ldr r0, =gUnknown_0860EA4C + lsls r5, 20 + lsrs r5, 16 + adds r1, r5, 0 + movs r2, 0x20 + bl LoadPalette + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197184 + + thumb_func_start sub_81971C4 +sub_81971C4: @ 81971C4 + push {lr} + bl sub_819645C + pop {r0} + bx r0 + thumb_func_end sub_81971C4 + + thumb_func_start sub_81971D0 +sub_81971D0: @ 81971D0 + push {lr} + ldr r0, =gUnknown_0860F098 + bl InitWindows + ldr r0, =gUnknown_0203CD8C + movs r1, 0xFF + strb r1, [r0] + ldr r0, =gUnknown_0203CD8D + strb r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81971D0 + + thumb_func_start sub_81971F4 +sub_81971F4: @ 81971F4 + push {lr} + bl FreeAllWindowBuffers + pop {r0} + bx r0 + thumb_func_end sub_81971F4 + + thumb_func_start sub_8197200 +sub_8197200: @ 8197200 + push {lr} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + bl DeactivateAllTextPrinters + bl sub_81973A4 + pop {r0} + bx r0 + thumb_func_end sub_8197200 + + thumb_func_start sub_8197224 +sub_8197224: @ 8197224 + push {lr} + bl RunTextPrinters + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8197224 + + thumb_func_start AddTextPrinterParametrized +@ u16 AddTextPrinterParametrized(u8 windowId, u8 fontId, u8 *str, u8 speed, void ( *callback)(u16, struct TextPrinter *), u8 fgColor, u8 bgColor, u8 shadowColor) +AddTextPrinterParametrized: @ 8197238 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + ldr r7, [sp, 0x28] + ldr r4, [sp, 0x2C] + mov r8, r4 + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + str r2, [sp] + mov r2, sp + movs r4, 0 + strb r0, [r2, 0x4] + mov r0, sp + strb r1, [r0, 0x5] + strb r4, [r0, 0x6] + movs r1, 0x1 + strb r1, [r0, 0x7] + strb r4, [r0, 0x8] + strb r1, [r0, 0x9] + strb r4, [r0, 0xA] + strb r4, [r0, 0xB] + mov r4, sp + ldrb r2, [r4, 0xC] + subs r1, 0x11 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4, 0xC] + mov r0, sp + mov r2, r8 + lsls r2, 4 + movs r4, 0xF + strb r2, [r0, 0xC] + mov r2, sp + ands r5, r4 + ldrb r0, [r2, 0xD] + ands r1, r0 + orrs r1, r5 + strb r1, [r2, 0xD] + mov r0, sp + lsrs r6, 20 + ands r1, r4 + orrs r1, r6 + strb r1, [r0, 0xD] + ldr r2, =gTextFlags + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + mov r0, sp + adds r1, r3, 0 + adds r2, r7, 0 + bl AddTextPrinter + lsls r0, 16 + lsrs r0, 16 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end AddTextPrinterParametrized + + thumb_func_start AddTextPrinterForMessage +@ void AddTextPrinterForMessage(u8 allowSkippingDelayWithButtonPress) +AddTextPrinterForMessage: @ 81972C4 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + ldr r3, =gTextFlags + movs r4, 0x1 + ands r0, r4 + ldrb r2, [r3] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r2, =gStringVar4 + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end AddTextPrinterForMessage + + thumb_func_start AddTextPrinterForMessage_2 +@ void AddTextPrinterForMessage_2(u8 allowSkippingDelayWithButtonPress) +AddTextPrinterForMessage_2: @ 8197310 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gTextFlags + movs r4, 0x1 + ands r0, r4 + ldrb r2, [r3] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r2, =gStringVar4 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end AddTextPrinterForMessage_2 + + thumb_func_start AddTextPrinterWithCustomSpeedForMessage +@ void AddTextPrinterWithCustomSpeedForMessage(u8 allowSkippingDelayWithButtonPress, u8 speed) +AddTextPrinterWithCustomSpeedForMessage: @ 819735C + push {r4,r5,lr} + sub sp, 0x10 + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r4, =gTextFlags + movs r5, 0x1 + ands r0, r5 + ldrb r2, [r4] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4] + ldr r2, =gStringVar4 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end AddTextPrinterWithCustomSpeedForMessage + + thumb_func_start sub_81973A4 +sub_81973A4: @ 81973A4 + push {lr} + movs r1, 0x80 + lsls r1, 2 + movs r0, 0 + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + movs r1, 0x85 + lsls r1, 2 + movs r0, 0 + movs r2, 0xE0 + bl sub_809882C + pop {r0} + bx r0 + thumb_func_end sub_81973A4 + + thumb_func_start sub_81973C4 +sub_81973C4: @ 81973C4 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_81975F4 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _081973F2 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_081973F2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81973C4 + + thumb_func_start sub_81973FC +sub_81973FC: @ 81973FC + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_81974A4 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _0819742A + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0819742A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81973FC + + thumb_func_start sub_8197434 +sub_8197434: @ 8197434 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_8197804 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl ClearWindowTilemap + cmp r4, 0x1 + bne _08197462 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197462: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197434 + + thumb_func_start sub_819746C +sub_819746C: @ 819746C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_81977BC + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl ClearWindowTilemap + cmp r4, 0x1 + bne _0819749A + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0819749A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819746C + + thumb_func_start sub_81974A4 +sub_81974A4: @ 81974A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r4, r2, 0 + ldr r2, [sp, 0x3C] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsls r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + movs r3, 0x85 + lsls r3, 2 + lsrs r0, r1, 24 + str r0, [sp, 0xC] + movs r2, 0xFF + lsls r2, 24 + adds r2, r1 + mov r8, r2 + lsrs r2, 24 + lsrs r0, r4, 24 + mov r9, r0 + movs r0, 0xFF + lsls r0, 24 + adds r4, r0 + lsrs r4, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + movs r6, 0xE + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r1, r3, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000215 + ldr r2, [sp, 0x10] + str r2, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0xC] + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000216 + ldr r3, [sp, 0xC] + ldr r2, [sp, 0x10] + adds r0, r3, r2 + lsls r0, 24 + mov r10, r0 + lsrs r2, r0, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + mov r5, r9 + ldr r0, [sp, 0x14] + add r0, r9 + cmp r9, r0 + bge _08197578 + mov r3, r8 + str r3, [sp, 0x18] + movs r6, 0x1 + movs r0, 0xE + mov r8, r0 +_0819753E: + lsls r4, r5, 24 + lsrs r4, 24 + str r6, [sp] + str r6, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + adds r0, r7, 0 + ldr r1, =0x00000217 + ldr r3, [sp, 0x18] + lsrs r2, r3, 24 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + str r6, [sp] + str r6, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r1, =0x00000219 + mov r3, r10 + lsrs r2, r3, 24 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + adds r5, 0x1 + ldr r0, [sp, 0x14] + add r0, r9 + cmp r5, r0 + blt _0819753E +_08197578: + ldr r1, =0x0000021a + ldr r2, [sp, 0xC] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r4, [sp, 0x14] + add r4, r9 + lsls r4, 24 + lsrs r4, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + movs r6, 0xE + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x0000021b + ldr r0, [sp, 0x10] + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0xC] + adds r3, r4, 0 + bl FillBgTilemapBufferRect + movs r1, 0x87 + lsls r1, 2 + ldr r3, [sp, 0xC] + ldr r0, [sp, 0x10] + adds r2, r3, r0 + lsls r2, 24 + lsrs r2, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81974A4 + + thumb_func_start sub_81975F4 +sub_81975F4: @ 81975F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + adds r6, r0, 0 + adds r5, r2, 0 + mov r8, r3 + ldr r2, [sp, 0x44] + lsls r6, 24 + lsrs r6, 24 + lsls r0, r1, 24 + lsls r5, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r1, =0x00000201 + lsrs r2, r0, 24 + str r2, [sp, 0xC] + movs r3, 0xFE + lsls r3, 24 + adds r2, r0, r3 + lsrs r2, 24 + str r2, [sp, 0x14] + lsrs r0, r5, 24 + mov r10, r0 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r3, 0xF + mov r9, r3 + str r3, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x14] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000203 + ldr r0, [sp, 0xC] + subs r0, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + movs r1, 0x81 + lsls r1, 2 + mov r0, r8 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + str r0, [sp] + str r4, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0xC] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000205 + ldr r7, [sp, 0xC] + add r7, r8 + subs r0, r7, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x20] + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r6, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000206 + lsls r2, r7, 24 + lsrs r7, r2, 24 + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + adds r2, r7, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000207 + str r4, [sp] + movs r5, 0x5 + str r5, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x14] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000209 + add r8, r4 + mov r3, r8 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + str r5, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x18] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x0000020a + str r4, [sp] + str r5, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + adds r2, r7, 0 + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a01 + ldr r3, [sp, 0x10] + add r10, r3 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x14] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a03 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x18] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a04 + ldr r0, [sp, 0x1C] + str r0, [sp] + str r4, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0xC] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a05 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x20] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a06 + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + adds r2, r7, 0 + mov r3, r10 + bl FillBgTilemapBufferRect + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81975F4 + + thumb_func_start sub_81977BC +sub_81977BC: @ 81977BC + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFF + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0x80 + lsls r2, 18 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0xE + str r1, [sp, 0x8] + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81977BC + + thumb_func_start sub_8197804 +sub_8197804: @ 8197804 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFD + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0xC0 + lsls r2, 19 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + movs r2, 0x80 + lsls r2, 18 + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0xE + str r1, [sp, 0x8] + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8197804 + + thumb_func_start SetStandardWindowBorderStyle +@ void SetStandardWindowBorderStyle(u8 windowId, bool copyToVram) +SetStandardWindowBorderStyle: @ 8197854 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0x85 + lsls r2, 2 + movs r3, 0xE + bl SetWindowBorderStyle + pop {r0} + bx r0 + thumb_func_end SetStandardWindowBorderStyle + + thumb_func_start sub_819786C +sub_819786C: @ 819786C + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r6, 0x80 + lsls r6, 2 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0xF + bl sub_8197B1C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819786C + + thumb_func_start sub_819789C +sub_819789C: @ 819789C + push {lr} + ldr r0, =gUnknown_0860F074 + movs r1, 0xE0 + movs r2, 0x14 + bl LoadPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_819789C + + thumb_func_start sub_81978B0 +sub_81978B0: @ 81978B0 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =gUnknown_0860F074 + movs r2, 0x14 + bl LoadPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_81978B0 + + thumb_func_start sub_81978C8 +sub_81978C8: @ 81978C8 + ldr r0, =gUnknown_0860F074 + bx lr + .pool + thumb_func_end sub_81978C8 + + thumb_func_start sub_81978D0 +sub_81978D0: @ 81978D0 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _081978DC + movs r1, 0 +_081978DC: + ldr r0, =gUnknown_0860F074 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81978D0 + + thumb_func_start DisplayItemMessageOnField +@ void DisplayItemMessageOnField(u8 taskId, u8 *str, void ( *callback)(u8 taskId)) +DisplayItemMessageOnField: @ 81978EC + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81973A4 + bl sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + str r5, [sp, 0x8] + str r6, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0 + movs r3, 0xF + bl DisplayMessageAndContinueTask + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end DisplayItemMessageOnField + + thumb_func_start sub_8197930 +sub_8197930: @ 8197930 + push {lr} + ldr r0, =gUnknown_0860F0A8 + movs r1, 0x85 + lsls r1, 2 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197930 + + thumb_func_start sub_8197948 +sub_8197948: @ 8197948 + push {lr} + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_0860F0A8 + movs r1, 0x85 + lsls r1, 2 + movs r2, 0xE + bl CreateYesNoMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197948 + + thumb_func_start sub_8197964 +sub_8197964: @ 8197964 + push {lr} + ldr r0, =gTextFlags + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08197988 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x14] + lsls r0, 29 + lsrs r0, 29 + b _0819798A + .pool +_08197988: + movs r0, 0x1 +_0819798A: + pop {r1} + bx r1 + thumb_func_end sub_8197964 + + thumb_func_start sav2_get_text_speed +sav2_get_text_speed: @ 8197990 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x14] + lsls r0, r1, 29 + lsrs r0, 29 + cmp r0, 0x2 + bls _081979AC + movs r0, 0x8 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x14] +_081979AC: + bl sub_8197964 + ldr r1, =gUnknown_0860F094 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sav2_get_text_speed + + thumb_func_start sub_81979C4 +sub_81979C4: @ 81979C4 + push {r4,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r4, =gUnknown_0203CD8C + ldrb r0, [r4] + cmp r0, 0xFF + bne _081979F6 + lsls r0, r1, 25 + movs r1, 0x80 + lsls r1, 18 + adds r0, r1 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + ldr r0, =0x00000139 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x16 + movs r2, 0x1 + movs r3, 0x7 + bl sub_8198AA4 + strb r0, [r4] +_081979F6: + ldrb r0, [r4] + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81979C4 + + thumb_func_start GetStartMenuWindowId +GetStartMenuWindowId: @ 8197A08 + ldr r0, =gUnknown_0203CD8C + ldrb r0, [r0] + bx lr + .pool + thumb_func_end GetStartMenuWindowId + + thumb_func_start remove_start_menu_window_maybe +remove_start_menu_window_maybe: @ 8197A14 + push {r4,lr} + ldr r4, =gUnknown_0203CD8C + ldrb r0, [r4] + cmp r0, 0xFF + beq _08197A26 + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] +_08197A26: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end remove_start_menu_window_maybe + + thumb_func_start sub_8197A30 +sub_8197A30: @ 8197A30 + movs r0, 0x80 + lsls r0, 2 + bx lr + thumb_func_end sub_8197A30 + + thumb_func_start sub_8197A38 +sub_8197A38: @ 8197A38 + movs r0, 0x85 + lsls r0, 2 + bx lr + thumb_func_end sub_8197A38 + + thumb_func_start AddMapNamePopUpWindow +AddMapNamePopUpWindow: @ 8197A40 + push {r4,lr} + sub sp, 0xC + ldr r4, =gUnknown_0203CD8D + ldrb r0, [r4] + cmp r0, 0xFF + bne _08197A66 + movs r0, 0x3 + str r0, [sp] + movs r0, 0xE + str r0, [sp, 0x4] + adds r0, 0xF9 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0xA + bl sub_8198AA4 + strb r0, [r4] +_08197A66: + ldrb r0, [r4] + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end AddMapNamePopUpWindow + + thumb_func_start GetMapNamePopUpWindowId +GetMapNamePopUpWindowId: @ 8197A74 + ldr r0, =gUnknown_0203CD8D + ldrb r0, [r0] + bx lr + .pool + thumb_func_end GetMapNamePopUpWindowId + + thumb_func_start RemoveMapNamePopUpWindow +RemoveMapNamePopUpWindow: @ 8197A80 + push {r4,lr} + ldr r4, =gUnknown_0203CD8D + ldrb r0, [r4] + cmp r0, 0xFF + beq _08197A92 + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] +_08197A92: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveMapNamePopUpWindow + + thumb_func_start AddTextPrinterWithCallbackForMessage +@ void AddTextPrinterWithCallbackForMessage(u8 allowSkippingDelayWithButtonPress, void ( *callback)(u16, struct TextPrinter *)) +AddTextPrinterWithCallbackForMessage: @ 8197A9C + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gTextFlags + movs r4, 0x1 + ands r0, r4 + ldrb r2, [r3] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r2, =gStringVar4 + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end AddTextPrinterWithCallbackForMessage + + thumb_func_start sub_8197AE8 +sub_8197AE8: @ 8197AE8 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + cmp r4, 0x1 + bne _08197B12 + movs r0, 0 + bl CopyBgTilemapBufferToVram +_08197B12: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8197AE8 + + thumb_func_start sub_8197B1C +sub_8197B1C: @ 8197B1C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CD9C + strh r2, [r0] + ldr r0, =gUnknown_0203CD9E + strb r3, [r0] + ldr r1, =sub_8197BB4 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _08197B52 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197B52: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197B1C + + thumb_func_start sub_8197B64 +sub_8197B64: @ 8197B64 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CD9C + strh r2, [r0] + ldr r5, =gUnknown_0203CD9E + adds r0, r6, 0 + movs r1, 0x5 + bl GetWindowAttribute + strb r0, [r5] + ldr r1, =sub_8197BB4 + adds r0, r6, 0 + bl CallWindowFunction + adds r0, r6, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r6, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _08197BA2 + adds r0, r6, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197BA2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197B64 + + thumb_func_start sub_8197BB4 +sub_8197BB4: @ 8197BB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + mov r8, r0 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r2, [sp, 0x44] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, r1, 24 + lsls r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + lsrs r3, r0, 24 + str r3, [sp, 0xC] + movs r3, 0xFE + lsls r3, 24 + adds r2, r0, r3 + lsrs r2, 24 + str r2, [sp, 0x14] + lsrs r0, r5, 24 + mov r9, r0 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + ldr r3, =gUnknown_0203CD9E + mov r10, r3 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r0, =gUnknown_0203CD9C + ldrh r1, [r0] + adds r1, 0x3 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + subs r0, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x4 + lsls r1, 16 + lsrs r1, 16 + subs r0, r6, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + str r0, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0xC] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x5 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + adds r7, r0, r6 + subs r0, r7, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x20] + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x20] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x6 + lsls r1, 16 + lsrs r1, 16 + lsls r2, r7, 24 + lsrs r7, r2, 24 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + movs r5, 0x5 + str r5, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x9 + lsls r1, 16 + lsrs r1, 16 + adds r6, 0x1 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp] + str r5, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0xA + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r5, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r3, =0x00000801 + adds r1, r3, 0 + ldr r0, =gUnknown_0203CD9C + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x10] + add r9, r2 + mov r3, r9 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + bl FillBgTilemapBufferRect + ldr r3, =0x00000803 + adds r1, r3, 0 + ldr r0, =gUnknown_0203CD9C + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r3, =0x00000804 + adds r1, r3, 0 + ldr r0, =gUnknown_0203CD9C + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x1C] + str r2, [sp] + str r4, [sp, 0x4] + mov r3, r10 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0xC] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r0, =0x00000805 + adds r1, r0, 0 + ldr r2, =gUnknown_0203CD9C + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r10 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x20] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r0, =0x00000806 + adds r1, r0, 0 + ldr r2, =gUnknown_0203CD9C + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r10 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + mov r3, r9 + bl FillBgTilemapBufferRect + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197BB4 + + thumb_func_start sub_8197DF8 +sub_8197DF8: @ 8197DF8 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_8197E30 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl ClearWindowTilemap + cmp r4, 0x1 + bne _08197E26 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197E26: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197DF8 + + thumb_func_start sub_8197E30 +sub_8197E30: @ 8197E30 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFD + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0xC0 + lsls r2, 19 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + movs r2, 0x80 + lsls r2, 18 + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + adds r2, r4, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8197E30 + + thumb_func_start SetWindowBorderStyle +@ void SetWindowBorderStyle(u8 windowId, bool copyToVram, s16 tileStart, s8 palette) +SetWindowBorderStyle: @ 8197E80 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CD9C + strh r2, [r0] + ldr r0, =gUnknown_0203CD9E + strb r3, [r0] + ldr r1, =DrawWindowBorder + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _08197EB6 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197EB6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end SetWindowBorderStyle + + thumb_func_start sub_8197EC8 +sub_8197EC8: @ 8197EC8 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CD9C + strh r2, [r0] + ldr r5, =gUnknown_0203CD9E + adds r0, r6, 0 + movs r1, 0x5 + bl GetWindowAttribute + strb r0, [r5] + ldr r1, =DrawWindowBorder + adds r0, r6, 0 + bl CallWindowFunction + adds r0, r6, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r6, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _08197F06 + adds r0, r6, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197F06: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197EC8 + + thumb_func_start DrawWindowBorder +DrawWindowBorder: @ 8197F18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r9, r0 + adds r6, r1, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x38] + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r6, 24 + lsls r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + lsrs r0, r6, 24 + str r0, [sp, 0xC] + movs r2, 0xFF + lsls r2, 24 + adds r6, r2 + lsrs r6, 24 + lsrs r0, r4, 24 + mov r8, r0 + adds r4, r2 + lsrs r4, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + ldr r7, =gUnknown_0203CD9E + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x10] + str r0, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + ldr r2, [sp, 0xC] + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x2 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + ldr r2, [sp, 0x10] + adds r0, r2 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + str r5, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + mov r2, r10 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r0, =gUnknown_0203CD9C + ldrh r1, [r0] + adds r1, 0x3 + lsls r1, 16 + lsrs r1, 16 + str r5, [sp] + ldr r2, [sp, 0x14] + str r2, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + adds r2, r6, 0 + mov r3, r8 + bl FillBgTilemapBufferRect + ldr r0, =gUnknown_0203CD9C + ldrh r1, [r0] + adds r1, 0x5 + lsls r1, 16 + lsrs r1, 16 + str r5, [sp] + ldr r2, [sp, 0x14] + str r2, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + mov r2, r10 + mov r3, r8 + bl FillBgTilemapBufferRect + ldr r0, =gUnknown_0203CD9C + ldrh r1, [r0] + adds r1, 0x6 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x14] + add r8, r2 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + str r5, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + adds r2, r6, 0 + mov r3, r8 + bl FillBgTilemapBufferRect + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x10] + str r0, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + ldr r2, [sp, 0xC] + mov r3, r8 + bl FillBgTilemapBufferRect + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x8 + lsls r1, 16 + lsrs r1, 16 + str r5, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + mov r2, r10 + mov r3, r8 + bl FillBgTilemapBufferRect + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DrawWindowBorder + + thumb_func_start sub_8198070 +sub_8198070: @ 8198070 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_81980A8 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl ClearWindowTilemap + cmp r4, 0x1 + bne _0819809E + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0819809E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198070 + + thumb_func_start sub_81980A8 +sub_81980A8: @ 81980A8 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFF + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0x80 + lsls r2, 18 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + adds r2, r4, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81980A8 + + thumb_func_start sub_81980F0 +sub_81980F0: @ 81980F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r4, [sp, 0x20] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r4, 16 + lsrs r4, 16 + mov r0, sp + movs r1, 0 + movs r2, 0x8 + bl memset + cmp r6, 0x3 + bls _08198126 + movs r1, 0 + mov r0, sp + strb r1, [r0] + b _0819812A +_08198126: + mov r0, sp + strb r6, [r0] +_0819812A: + mov r1, sp + mov r0, r8 + strb r0, [r1, 0x2] + movs r0, 0x2 + strb r0, [r1, 0x4] + movs r0, 0x1E + subs r0, r7 + strb r0, [r1, 0x1] + strb r7, [r1, 0x3] + strb r5, [r1, 0x5] + strh r4, [r1, 0x6] + ldr r4, =gUnknown_0203CDA0 + mov r0, sp + bl AddWindow + strb r0, [r4] + cmp r5, 0xF + bls _08198158 + movs r5, 0xF0 + b _0819815C + .pool +_08198158: + lsls r0, r5, 28 + lsrs r5, r0, 24 +_0819815C: + ldr r0, =gUnknown_0860F0B0 + adds r1, r5, 0 + movs r2, 0x20 + bl LoadPalette + ldr r0, =gUnknown_0203CDA0 + ldrb r0, [r0] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81980F0 + + thumb_func_start sub_8198180 +sub_8198180: @ 8198180 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r5, =gUnknown_0203CDA0 + ldrb r0, [r5] + cmp r0, 0xFF + beq _081981EE + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0xFF + bl FillWindowPixelBuffer + movs r0, 0 + adds r1, r6, 0 + movs r2, 0 + bl GetStringWidth + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5] + movs r1, 0x1 + bl GetWindowAttribute + movs r2, 0xEC + subs r2, r7 + lsls r0, 3 + subs r2, r0 + subs r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r5] + ldr r1, =gUnknown_0860F0D0 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r3, 0x1 + bl box_print + mov r0, r8 + cmp r0, 0 + beq _081981EE + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram +_081981EE: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198180 + + thumb_func_start sub_8198204 +sub_8198204: @ 8198204 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r10, r0 + adds r6, r1, 0 + ldr r0, [sp, 0x38] + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r4, 0 + ldr r0, =gUnknown_0203CDA0 + ldrb r1, [r0] + adds r7, r0, 0 + cmp r1, 0xFF + beq _081982C8 + cmp r2, 0 + beq _08198244 + add r0, sp, 0x14 + strb r4, [r0] + adds r1, r0, 0 + b _0819824A + .pool +_08198244: + add r1, sp, 0x14 + movs r0, 0xF + strb r0, [r1] +_0819824A: + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x2 + strb r0, [r1, 0x2] + adds r5, r7, 0 + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0xFF + bl FillWindowPixelBuffer + cmp r6, 0 + beq _0819829E + movs r0, 0 + adds r1, r6, 0 + movs r2, 0 + bl GetStringWidth + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r0, [r5] + movs r1, 0x1 + bl GetWindowAttribute + movs r2, 0xEC + mov r1, r8 + subs r2, r1 + lsls r0, 3 + subs r2, r0 + subs r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r5] + add r1, sp, 0x14 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r3, 0x1 + bl box_print +_0819829E: + ldrb r0, [r7] + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + add r2, sp, 0x14 + str r2, [sp, 0x8] + str r1, [sp, 0xC] + mov r1, r10 + str r1, [sp, 0x10] + movs r1, 0x1 + movs r2, 0x4 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + mov r2, r9 + cmp r2, 0 + beq _081982C8 + ldrb r0, [r7] + movs r1, 0x3 + bl CopyWindowToVram +_081982C8: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198204 + + thumb_func_start sub_81982D8 +sub_81982D8: @ 81982D8 + push {lr} + ldr r1, =gUnknown_0203CDA0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081982E8 + movs r1, 0x3 + bl CopyWindowToVram +_081982E8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81982D8 + + thumb_func_start sub_81982F0 +sub_81982F0: @ 81982F0 + push {r4,lr} + ldr r4, =gUnknown_0203CDA0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _08198308 + movs r1, 0xFF + bl FillWindowPixelBuffer + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram +_08198308: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81982F0 + + thumb_func_start sub_8198314 +sub_8198314: @ 8198314 + push {r4,lr} + ldr r4, =gUnknown_0203CDA0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _0819833C + movs r1, 0 + bl FillWindowPixelBuffer + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] +_0819833C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198314 + + thumb_func_start sub_8198348 +sub_8198348: @ 8198348 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, [sp, 0x18] + mov r8, r4 + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + ldr r6, [sp, 0x24] + mov r12, r6 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r7, r5, 24 + ldr r5, =gUnknown_0203CD90 + movs r6, 0 + strb r2, [r5] + strb r3, [r5, 0x1] + strb r6, [r5, 0x3] + subs r4, 0x1 + strb r4, [r5, 0x4] + strb r0, [r5, 0x5] + strb r1, [r5, 0x6] + mov r0, r8 + strb r0, [r5, 0x8] + mov r4, r12 + strb r4, [r5, 0xB] + cmp r7, 0 + blt _08198388 + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r7, r0 + ble _08198390 +_08198388: + strb r6, [r5, 0x2] + b _08198392 + .pool +_08198390: + strb r7, [r5, 0x2] +_08198392: + movs r0, 0 + bl MoveMenuCursor + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8198348 + + thumb_func_start sub_81983AC +sub_81983AC: @ 81983AC + push {r4-r6,lr} + sub sp, 0x10 + ldr r4, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r6, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r4, 0 + str r4, [sp, 0xC] + bl sub_8198348 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81983AC + + thumb_func_start sub_81983EC +sub_81983EC: @ 81983EC + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + mov r8, r0 + adds r6, r1, 0 + ldr r4, [sp, 0x28] + ldr r5, [sp, 0x2C] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r6, 24 + lsrs r6, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + movs r1, 0x1 + str r2, [sp, 0xC] + str r3, [sp, 0x10] + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + mov r0, r8 + adds r1, r6, 0 + ldr r2, [sp, 0xC] + ldr r3, [sp, 0x10] + bl sub_81983AC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81983EC + + thumb_func_start RedrawMenuCursor +@ void RedrawMenuCursor(s8 oldPos, s8 newPos) +RedrawMenuCursor: @ 8198448 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + adds r6, r0, 0 + mov r8, r1 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r5, =gUnknown_0203CD90 + ldrb r0, [r5, 0x6] + movs r1, 0 + bl GetMenuCursorDimensionByFont + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5, 0x6] + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r5, 0x5] + mov r9, r1 + ldrb r2, [r5] + ldrb r1, [r5, 0x8] + adds r3, r1, 0 + muls r3, r6 + ldrb r6, [r5, 0x1] + adds r3, r6 + lsls r3, 16 + lsrs r3, 16 + str r4, [sp] + str r0, [sp, 0x4] + mov r0, r9 + movs r1, 0x11 + bl FillWindowPixelRect + ldrb r0, [r5, 0x5] + ldrb r1, [r5, 0x6] + ldr r2, =gUnknown_085EE498 + ldrb r3, [r5] + ldrb r4, [r5, 0x8] + mov r6, r8 + muls r6, r4 + adds r4, r6, 0 + ldrb r5, [r5, 0x1] + adds r4, r5 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + bl PrintTextOnWindow + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end RedrawMenuCursor + + thumb_func_start MoveMenuCursor +@ s8 MoveMenuCursor(s8 cursorDelta) +MoveMenuCursor: @ 81984D8 + push {r4,r5,lr} + ldr r1, =gUnknown_0203CD90 + ldrb r5, [r1, 0x2] + movs r2, 0x2 + ldrsb r2, [r1, r2] + lsls r0, 24 + asrs r3, r0, 24 + adds r2, r3 + movs r0, 0x3 + ldrsb r0, [r1, r0] + adds r4, r1, 0 + cmp r2, r0 + bge _081984FC + ldrb r0, [r4, 0x4] + b _0819850A + .pool +_081984FC: + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r2, r0 + ble _08198508 + ldrb r0, [r4, 0x3] + b _0819850A +_08198508: + adds r0, r3, r5 +_0819850A: + strb r0, [r4, 0x2] + ldrb r1, [r4, 0x2] + adds r0, r5, 0 + bl RedrawMenuCursor + ldrb r0, [r4, 0x2] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end MoveMenuCursor + + thumb_func_start MoveMenuCursorNoWrapAround +@ s8 MoveMenuCursorNoWrapAround(s8 cursorDelta) +MoveMenuCursorNoWrapAround: @ 819851C + push {r4,r5,lr} + ldr r1, =gUnknown_0203CD90 + ldrb r5, [r1, 0x2] + movs r2, 0x2 + ldrsb r2, [r1, r2] + lsls r0, 24 + asrs r3, r0, 24 + adds r2, r3 + movs r0, 0x3 + ldrsb r0, [r1, r0] + adds r4, r1, 0 + cmp r2, r0 + bge _08198540 + ldrb r0, [r4, 0x3] + b _0819854E + .pool +_08198540: + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r2, r0 + ble _0819854C + ldrb r0, [r4, 0x4] + b _0819854E +_0819854C: + adds r0, r3, r5 +_0819854E: + strb r0, [r4, 0x2] + ldrb r1, [r4, 0x2] + adds r0, r5, 0 + bl RedrawMenuCursor + ldrb r0, [r4, 0x2] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end MoveMenuCursorNoWrapAround + + thumb_func_start GetMenuCursorPos +GetMenuCursorPos: @ 8198560 + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + bx lr + .pool + thumb_func_end GetMenuCursorPos + + thumb_func_start ProcessMenuInput +ProcessMenuInput: @ 819856C + push {r4,lr} + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198598 + ldr r4, =gUnknown_0203CD90 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _08198588 + movs r0, 0x5 + bl PlaySE +_08198588: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _081985D2 + .pool +_08198598: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081985A6 + movs r0, 0x1 + negs r0, r0 + b _081985D2 +_081985A6: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081985BA + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _081985CA +_081985BA: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081985CE + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_081985CA: + bl MoveMenuCursor +_081985CE: + movs r0, 0x2 + negs r0, r0 +_081985D2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInput + + thumb_func_start ProcessMenuInputNoWrapAround +@ int ProcessMenuInputNoWrapAround() +ProcessMenuInputNoWrapAround: @ 81985D8 + push {r4-r6,lr} + ldr r4, =gUnknown_0203CD90 + ldrb r5, [r4, 0x2] + adds r6, r5, 0 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198608 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _081985F8 + movs r0, 0x5 + bl PlaySE +_081985F8: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _08198650 + .pool +_08198608: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08198616 + movs r0, 0x1 + negs r0, r0 + b _08198650 +_08198616: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08198630 + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _0819864C + b _08198646 +_08198630: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819864C + movs r0, 0x1 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _0819864C +_08198646: + movs r0, 0x5 + bl PlaySE +_0819864C: + movs r0, 0x2 + negs r0, r0 +_08198650: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInputNoWrapAround + + thumb_func_start ProcessMenuInput_other +ProcessMenuInput_other: @ 8198658 + push {r4,lr} + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198684 + ldr r4, =gUnknown_0203CD90 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _08198674 + movs r0, 0x5 + bl PlaySE +_08198674: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _081986BC + .pool +_08198684: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08198692 + movs r0, 0x1 + negs r0, r0 + b _081986BC +_08198692: + ldrh r0, [r2, 0x30] + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0x40 + bne _081986A8 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _081986B4 +_081986A8: + cmp r1, 0x80 + bne _081986B8 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_081986B4: + bl MoveMenuCursor +_081986B8: + movs r0, 0x2 + negs r0, r0 +_081986BC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInput_other + + thumb_func_start ProcessMenuInputNoWrapAround_other +ProcessMenuInputNoWrapAround_other: @ 81986C4 + push {r4-r6,lr} + ldr r4, =gUnknown_0203CD90 + ldrb r5, [r4, 0x2] + adds r6, r5, 0 + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081986F4 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _081986E4 + movs r0, 0x5 + bl PlaySE +_081986E4: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _0819873A + .pool +_081986F4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08198702 + movs r0, 0x1 + negs r0, r0 + b _0819873A +_08198702: + ldrh r0, [r2, 0x30] + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0x40 + bne _0819871E + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _08198736 + b _08198730 +_0819871E: + cmp r1, 0x80 + bne _08198736 + movs r0, 0x1 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _08198736 +_08198730: + movs r0, 0x5 + bl PlaySE +_08198736: + movs r0, 0x2 + negs r0, r0 +_0819873A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInputNoWrapAround_other + + thumb_func_start PrintTextArray +PrintTextArray: @ 8198740 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 24 + lsrs r7, r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r4, 0 + cmp r4, r5 + bcs _081987A4 +_08198774: + lsls r0, r4, 3 + ldr r1, [sp, 0x34] + adds r0, r1 + ldr r2, [r0] + adds r0, r7, 0 + muls r0, r4 + add r0, r8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + mov r1, r10 + mov r3, r9 + bl PrintTextOnWindow + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08198774 +_081987A4: + adds r0, r6, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end PrintTextArray + + thumb_func_start sub_81987BC +sub_81987BC: @ 81987BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r6, [sp, 0x4C] + ldr r7, [sp, 0x50] + mov r8, r7 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x1C] + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r9, r6 + mov r0, r8 + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _0819883C +_08198804: + lsls r0, r4, 3 + ldr r1, [sp, 0x48] + adds r0, r1 + ldr r2, [r0] + mov r0, r10 + muls r0, r4 + ldr r1, [sp, 0x1C] + adds r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + str r6, [sp, 0x10] + adds r0, r7, 0 + ldr r1, [sp, 0x14] + ldr r3, [sp, 0x18] + bl sub_8199F74 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08198804 +_0819883C: + adds r0, r7, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81987BC + + thumb_func_start sub_8198854 +sub_8198854: @ 8198854 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + mov r8, r0 + adds r6, r1, 0 + adds r4, r2, 0 + adds r5, r3, 0 + ldr r7, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + movs r1, 0 + bl GetFontAttribute + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r7, [sp, 0x8] + mov r0, r8 + adds r1, r6, 0 + movs r3, 0x1 + bl PrintTextArray + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198854 + + thumb_func_start AddItemMenuActionTextPrinters +AddItemMenuActionTextPrinters: @ 81988A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r6, r1, 0 + mov r8, r2 + ldr r1, [sp, 0x38] + mov r9, r1 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r6, 24 + lsrs r6, 24 + mov r4, r8 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r7, r2, 24 + mov r0, sp + ldrb r1, [r0, 0x10] + strb r1, [r0, 0x4] + strb r6, [r0, 0x5] + adds r0, r6, 0 + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r6, 0 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + mov r2, r9 + strb r2, [r0, 0xA] + adds r0, r6, 0 + movs r1, 0x3 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xB] + mov r0, sp + mov r4, r8 + strb r4, [r0, 0x6] + strb r4, [r0, 0x8] + movs r4, 0 + cmp r4, r7 + bcs _0819899E + mov r5, sp +_0819896E: + ldr r1, [sp, 0x48] + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 3 + ldr r2, [sp, 0x44] + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + mov r0, r10 + muls r0, r4 + ldr r1, [sp, 0x14] + adds r0, r1, r0 + strb r0, [r5, 0x7] + strb r0, [r5, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _0819896E +_0819899E: + ldr r0, [sp, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end AddItemMenuActionTextPrinters + + thumb_func_start sub_81989B8 +sub_81989B8: @ 81989B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r9, r0 + adds r4, r1, 0 + adds r6, r2, 0 + mov r8, r3 + ldr r7, [sp, 0x30] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0 + bl GetFontAttribute + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r4, 0 + movs r1, 0x2 + bl GetFontAttribute + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + str r6, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + str r7, [sp, 0xC] + ldr r0, [sp, 0x34] + str r0, [sp, 0x10] + mov r0, r9 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl AddItemMenuActionTextPrinters + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81989B8 + + thumb_func_start SetWindowTemplateFields +@ void SetWindowTemplateFields(WindowTemplate *template, char bg_id, char x, char y, char w, char h, char a7, s16 a8) +SetWindowTemplateFields: @ 8198A24 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, [sp, 0x18] + ldr r5, [sp, 0x1C] + ldr r6, [sp, 0x20] + ldr r7, [sp, 0x24] + mov r8, r7 + strb r1, [r0] + strb r2, [r0, 0x1] + strb r3, [r0, 0x2] + strb r4, [r0, 0x3] + strb r5, [r0, 0x4] + strb r6, [r0, 0x5] + mov r1, r8 + strh r1, [r0, 0x6] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end SetWindowTemplateFields + + thumb_func_start sub_8198A50 +sub_8198A50: @ 8198A50 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x18 + mov r8, r0 + ldr r0, [sp, 0x2C] + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + ldr r6, [sp, 0x38] + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 16 + lsrs r6, 16 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + str r6, [sp, 0xC] + add r0, sp, 0x10 + bl SetWindowTemplateFields + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + mov r2, r8 + str r0, [r2] + str r1, [r2, 0x4] + mov r0, r8 + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r2} + bx r2 + thumb_func_end sub_8198A50 + + thumb_func_start sub_8198AA4 +sub_8198AA4: @ 8198AA4 + push {r4-r6,lr} + sub sp, 0x18 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r0, [sp, 0x28] + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x30] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + str r3, [sp] + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r2, [sp, 0xC] + add r0, sp, 0x10 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl SetWindowTemplateFields + add r0, sp, 0x10 + bl AddWindow + lsls r0, 16 + lsrs r0, 16 + add sp, 0x18 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8198AA4 + + thumb_func_start sub_8198AF8 +sub_8198AF8: @ 8198AF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r6, r1, 0 + mov r8, r2 + mov r9, r3 + ldr r4, [sp, 0x3C] + ldr r5, [sp, 0x40] + ldr r1, [sp, 0x44] + mov r10, r1 + lsls r6, 24 + lsrs r6, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + mov r1, r10 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r7, =gUnknown_0203CD9F + bl AddWindow + strb r0, [r7] + ldrb r0, [r7] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl SetWindowBorderStyle + ldr r0, =gUnknown_085EE491 + str r0, [sp, 0xC] + add r1, sp, 0xC + ldrb r0, [r7] + strb r0, [r1, 0x4] + adds r0, r1, 0 + strb r6, [r0, 0x5] + adds r0, r6, 0 + movs r1, 0 + bl GetFontAttribute + add r1, sp, 0xC + add r0, r8 + strb r0, [r1, 0x6] + adds r0, r1, 0 + mov r1, r9 + strb r1, [r0, 0x7] + adds r1, r0, 0 + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + adds r0, r1, 0 + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r6, 0 + movs r1, 0x5 + bl GetFontAttribute + add r3, sp, 0xC + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r6, 0 + movs r1, 0x6 + bl GetFontAttribute + add r3, sp, 0xC + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x7 + bl GetFontAttribute + add r3, sp, 0xC + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x4 + bl GetFontAttribute + add r1, sp, 0xC + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + adds r0, r6, 0 + movs r1, 0x2 + bl GetFontAttribute + add r1, sp, 0xC + strb r0, [r1, 0xA] + adds r0, r6, 0 + movs r1, 0x3 + bl GetFontAttribute + add r1, sp, 0xC + strb r0, [r1, 0xB] + adds r0, r1, 0 + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r6, 0 + movs r1, 0x1 + bl GetFontAttribute + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r7] + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r1, 0 + adds r1, r6, 0 + mov r2, r8 + mov r3, r9 + bl sub_81983AC + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198AF8 + + thumb_func_start sub_8198C34 +sub_8198C34: @ 8198C34 + push {lr} + sub sp, 0xC + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 24 + lsrs r3, 24 + str r2, [sp] + str r3, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + movs r3, 0x1 + bl sub_8198AF8 + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_8198C34 + + thumb_func_start sub_8198C58 +sub_8198C58: @ 8198C58 + push {r4,lr} + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _08198C6E + bl sub_8198C78 +_08198C6E: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8198C58 + + thumb_func_start sub_8198C78 +sub_8198C78: @ 8198C78 + push {r4,lr} + ldr r4, =gUnknown_0203CD9F + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8198070 + ldrb r0, [r4] + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198C78 + + thumb_func_start sub_8198C94 +sub_8198C94: @ 8198C94 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r6, [sp, 0x48] + ldr r7, [sp, 0x4C] + mov r8, r7 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x18] + lsls r5, 24 + lsrs r5, 24 + str r5, [sp, 0x1C] + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r5, 0 + cmp r5, r9 + bcs _08198D3A +_08198CE0: + movs r4, 0 + adds r1, r5, 0x1 + mov r8, r1 + cmp r4, r6 + bcs _08198D30 + ldr r7, [sp, 0x1C] + adds r0, r7, 0 + muls r0, r5 + ldr r1, [sp, 0x14] + adds r0, r1, r0 + lsls r0, 24 + lsrs r7, r0, 24 +_08198CF8: + adds r0, r5, 0 + muls r0, r6 + adds r0, r4 + lsls r0, 3 + ldr r1, [sp, 0x50] + adds r0, r1 + ldr r2, [r0] + ldr r0, [sp, 0x18] + adds r3, r0, 0 + muls r3, r4 + ldr r1, [sp, 0x10] + adds r3, r1, r3 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r10 + ldr r1, [sp, 0xC] + bl PrintTextOnWindow + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _08198CF8 +_08198D30: + mov r7, r8 + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, r9 + bcc _08198CE0 +_08198D3A: + mov r0, r10 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198C94 + + thumb_func_start sub_8198D54 +sub_8198D54: @ 8198D54 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + mov r9, r0 + mov r8, r1 + adds r4, r2, 0 + adds r5, r3, 0 + ldr r6, [sp, 0x34] + ldr r3, [sp, 0x38] + ldr r7, [sp, 0x3C] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0 + str r3, [sp, 0x14] + bl GetFontAttribute + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + ldr r3, [sp, 0x14] + str r3, [sp, 0xC] + str r7, [sp, 0x10] + mov r0, r9 + mov r1, r8 + movs r3, 0 + bl sub_8198C94 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198D54 + + thumb_func_start sub_8198DBC +sub_8198DBC: @ 8198DBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r6, [sp, 0x48] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x18] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x1C] + lsls r5, 24 + lsrs r5, 24 + mov r8, r5 + lsls r6, 24 + lsrs r6, 24 + mov r10, r6 + mov r0, sp + ldrb r1, [r0, 0x10] + strb r1, [r0, 0x4] + strb r7, [r0, 0x5] + adds r0, r7, 0 + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r7, 0 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + adds r0, r7, 0 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + adds r0, r7, 0 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + adds r0, r7, 0 + movs r1, 0x2 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xA] + adds r0, r7, 0 + movs r1, 0x3 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xB] + movs r6, 0 + cmp r6, r10 + bcs _08198EDE +_08198E7A: + movs r5, 0 + adds r2, r6, 0x1 + mov r9, r2 + cmp r5, r8 + bcs _08198ED4 + mov r4, sp +_08198E86: + mov r0, r8 + muls r0, r6 + adds r0, r5 + ldr r1, [sp, 0x50] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 3 + ldr r2, [sp, 0x4C] + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + ldr r1, [sp, 0x1C] + adds r0, r1, 0 + muls r0, r5 + ldr r2, [sp, 0x14] + adds r0, r2, r0 + strb r0, [r4, 0x6] + adds r0, r7, 0 + movs r1, 0x1 + bl GetFontAttribute + adds r1, r6, 0 + muls r1, r0 + ldr r0, [sp, 0x18] + adds r1, r0, r1 + strb r1, [r4, 0x7] + ldrb r0, [r4, 0x6] + strb r0, [r4, 0x8] + strb r1, [r4, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _08198E86 +_08198ED4: + mov r1, r9 + lsls r0, r1, 24 + lsrs r6, r0, 24 + cmp r6, r10 + bcc _08198E7A +_08198EDE: + ldr r0, [sp, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198DBC + + thumb_func_start sub_8198EF8 +sub_8198EF8: @ 8198EF8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + mov r8, r0 + adds r3, r1, 0 + adds r4, r2, 0 + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + ldr r7, [sp, 0x38] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + adds r0, r3, 0 + movs r1, 0 + str r3, [sp, 0x14] + bl GetFontAttribute + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + str r7, [sp, 0xC] + ldr r0, [sp, 0x3C] + str r0, [sp, 0x10] + mov r0, r8 + ldr r3, [sp, 0x14] + adds r1, r3, 0 + movs r3, 0 + bl sub_8198DBC + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198EF8 + + thumb_func_start sub_8198F58 +sub_8198F58: @ 8198F58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, [sp, 0x20] + mov r12, r4 + ldr r4, [sp, 0x24] + mov r8, r4 + ldr r4, [sp, 0x28] + mov r9, r4 + ldr r4, [sp, 0x2C] + mov r10, r4 + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r7, r5, 24 + ldr r5, =gUnknown_0203CD90 + movs r6, 0 + strb r2, [r5] + strb r3, [r5, 0x1] + strb r6, [r5, 0x3] + subs r4, 0x1 + strb r4, [r5, 0x4] + strb r0, [r5, 0x5] + strb r1, [r5, 0x6] + mov r0, r12 + strb r0, [r5, 0x7] + mov r4, r8 + strb r4, [r5, 0x8] + mov r0, r9 + strb r0, [r5, 0x9] + mov r4, r10 + strb r4, [r5, 0xA] + cmp r7, 0 + blt _08198FAC + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r7, r0 + ble _08198FB4 +_08198FAC: + strb r6, [r5, 0x2] + b _08198FB6 + .pool +_08198FB4: + strb r7, [r5, 0x2] +_08198FB6: + movs r0, 0 + movs r1, 0 + bl sub_8199134 + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8198F58 + + thumb_func_start sub_8198FD4 +sub_8198FD4: @ 8198FD4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x20 + mov r9, r0 + mov r8, r1 + mov r10, r2 + ldr r6, [sp, 0x3C] + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r2, [sp, 0x48] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r2, 24 + lsrs r2, 24 + mov r0, r8 + movs r1, 0x1 + str r2, [sp, 0x18] + str r3, [sp, 0x1C] + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + muls r1, r5 + lsls r1, 24 + lsrs r1, 24 + str r6, [sp] + str r0, [sp, 0x4] + str r4, [sp, 0x8] + str r5, [sp, 0xC] + str r1, [sp, 0x10] + ldr r2, [sp, 0x18] + str r2, [sp, 0x14] + mov r0, r9 + mov r1, r8 + mov r2, r10 + ldr r3, [sp, 0x1C] + bl sub_8198F58 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8198FD4 + + thumb_func_start sub_8199060 +sub_8199060: @ 8199060 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, r1, 24 + lsrs r7, r0, 24 + ldr r5, =gUnknown_0203CD90 + ldrb r0, [r5, 0x6] + movs r1, 0 + bl GetMenuCursorDimensionByFont + mov r9, r0 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + ldrb r0, [r5, 0x6] + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldrb r0, [r5, 0x9] + mov r10, r0 + mov r0, r8 + mov r1, r10 + bl __umodsi3 + ldrb r1, [r5, 0x7] + adds r4, r1, 0 + muls r4, r0 + ldrb r1, [r5] + adds r4, r1 + lsls r4, 24 + lsrs r4, 24 + mov r0, r8 + mov r1, r10 + bl __udivsi3 + ldrb r1, [r5, 0x8] + adds r3, r1, 0 + muls r3, r0 + ldrb r0, [r5, 0x1] + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r5, 0x5] + mov r1, r9 + str r1, [sp] + str r6, [sp, 0x4] + movs r1, 0x11 + adds r2, r4, 0 + bl FillWindowPixelRect + ldrb r6, [r5, 0x9] + adds r0, r7, 0 + adds r1, r6, 0 + bl __umodsi3 + ldrb r1, [r5, 0x7] + adds r4, r1, 0 + muls r4, r0 + ldrb r0, [r5] + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + adds r1, r6, 0 + bl __udivsi3 + ldrb r1, [r5, 0x8] + adds r3, r1, 0 + muls r3, r0 + ldrb r1, [r5, 0x1] + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r5, 0x5] + ldrb r1, [r5, 0x6] + ldr r2, =gUnknown_085EE498 + str r3, [sp] + movs r3, 0 + str r3, [sp, 0x4] + str r3, [sp, 0x8] + adds r3, r4, 0 + bl PrintTextOnWindow + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8199060 + + thumb_func_start sub_8199134 +sub_8199134: @ 8199134 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + ldr r1, =gUnknown_0203CD90 + ldrb r2, [r1, 0x2] + mov r8, r2 + lsls r0, 24 + asrs r6, r0, 24 + adds r5, r1, 0 + cmp r6, 0 + beq _0819918A + movs r7, 0x2 + ldrsb r7, [r5, r7] + ldrb r4, [r5, 0x9] + adds r0, r7, 0 + adds r1, r4, 0 + bl __modsi3 + adds r0, r6 + cmp r0, 0 + bge _08199174 + adds r0, r4, 0 + adds r0, 0xFF + add r0, r8 + b _08199188 + .pool +_08199174: + cmp r0, r4 + blt _08199184 + adds r0, r7, 0 + adds r1, r4, 0 + bl __divsi3 + muls r0, r4 + b _08199188 +_08199184: + mov r1, r8 + adds r0, r6, r1 +_08199188: + strb r0, [r5, 0x2] +_0819918A: + mov r2, r9 + lsls r0, r2, 24 + asrs r6, r0, 24 + cmp r6, 0 + beq _081991CE + movs r0, 0x2 + ldrsb r0, [r5, r0] + ldrb r4, [r5, 0x9] + adds r1, r4, 0 + bl __divsi3 + adds r1, r0, r6 + cmp r1, 0 + bge _081991B2 + ldrb r0, [r5, 0xA] + subs r0, 0x1 + muls r0, r4 + ldrb r1, [r5, 0x2] + adds r0, r1 + b _081991CC +_081991B2: + ldrb r0, [r5, 0xA] + cmp r1, r0 + blt _081991C4 + subs r0, 0x1 + adds r1, r4, 0 + muls r1, r0 + ldrb r0, [r5, 0x2] + subs r0, r1 + b _081991CC +_081991C4: + adds r0, r4, 0 + muls r0, r6 + ldrb r2, [r5, 0x2] + adds r0, r2 +_081991CC: + strb r0, [r5, 0x2] +_081991CE: + movs r1, 0x2 + ldrsb r1, [r5, r1] + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r1, r0 + bgt _081991E4 + ldrb r1, [r5, 0x2] + mov r0, r8 + bl sub_8199060 + b _081991E8 +_081991E4: + mov r0, r8 + strb r0, [r5, 0x2] +_081991E8: + ldrb r0, [r5, 0x2] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8199134 + + thumb_func_start sub_81991F8 +sub_81991F8: @ 81991F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r1, =gUnknown_0203CD90 + ldrb r7, [r1, 0x2] + lsls r0, 24 + asrs r4, r0, 24 + adds r5, r1, 0 + cmp r4, 0 + beq _0819922C + movs r0, 0x2 + ldrsb r0, [r5, r0] + ldrb r6, [r5, 0x9] + adds r1, r6, 0 + bl __modsi3 + adds r0, r4 + cmp r0, 0 + blt _0819922C + cmp r0, r6 + bge _0819922C + adds r0, r4, r7 + strb r0, [r5, 0x2] +_0819922C: + mov r1, r8 + lsls r0, r1, 24 + asrs r4, r0, 24 + cmp r4, 0 + beq _08199258 + movs r0, 0x2 + ldrsb r0, [r5, r0] + ldrb r6, [r5, 0x9] + adds r1, r6, 0 + bl __divsi3 + adds r0, r4 + cmp r0, 0 + blt _08199258 + ldrb r1, [r5, 0xA] + cmp r0, r1 + bge _08199258 + adds r0, r6, 0 + muls r0, r4 + ldrb r1, [r5, 0x2] + adds r0, r1 + strb r0, [r5, 0x2] +_08199258: + movs r1, 0x2 + ldrsb r1, [r5, r1] + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r1, r0 + bgt _08199274 + ldrb r1, [r5, 0x2] + adds r0, r7, 0 + bl sub_8199060 + b _08199276 + .pool +_08199274: + strb r7, [r5, 0x2] +_08199276: + ldrb r0, [r5, 0x2] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81991F8 + + thumb_func_start sub_8199284 +sub_8199284: @ 8199284 + push {r4,lr} + ldr r4, =gMain + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081992AC + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + b _0819932C + .pool +_081992AC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081992BA + movs r0, 0x1 + negs r0, r0 + b _0819932C +_081992BA: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081992D0 + movs r0, 0x5 + bl PlaySE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _08199324 +_081992D0: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081992E4 + movs r0, 0x5 + bl PlaySE + movs r0, 0 + movs r1, 0x1 + b _08199324 +_081992E4: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081992F8 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08199304 +_081992F8: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _08199322 +_08199304: + ldrh r1, [r4, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0819931A + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08199328 +_0819931A: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_08199322: + movs r1, 0 +_08199324: + bl sub_8199134 +_08199328: + movs r0, 0x2 + negs r0, r0 +_0819932C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8199284 + + thumb_func_start sub_8199334 +sub_8199334: @ 8199334 + push {r4-r6,lr} + ldr r5, =gUnknown_0203CD90 + ldrb r4, [r5, 0x2] + ldr r6, =gMain + ldrh r1, [r6, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0819935C + movs r0, 0x5 + bl PlaySE + movs r0, 0x2 + ldrsb r0, [r5, r0] + b _081993D2 + .pool +_0819935C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819936A + movs r0, 0x1 + negs r0, r0 + b _081993D2 +_0819936A: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819937A + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _081993BC +_0819937A: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08199388 + movs r0, 0 + movs r1, 0x1 + b _081993BC +_08199388: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0819939C + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081993A2 +_0819939C: + movs r0, 0x1 + negs r0, r0 + b _081993BA +_081993A2: + ldrh r1, [r6, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081993B8 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081993CE +_081993B8: + movs r0, 0x1 +_081993BA: + movs r1, 0 +_081993BC: + bl sub_81991F8 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _081993CE + movs r0, 0x5 + bl PlaySE +_081993CE: + movs r0, 0x2 + negs r0, r0 +_081993D2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8199334 + + thumb_func_start sub_81993D8 +sub_81993D8: @ 81993D8 + push {r4,r5,lr} + ldr r4, =gMain + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08199400 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + b _0819947C + .pool +_08199400: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819940E + movs r0, 0x1 + negs r0, r0 + b _0819947C +_0819940E: + ldrh r0, [r4, 0x30] + movs r5, 0xF0 + adds r1, r5, 0 + ands r1, r0 + cmp r1, 0x40 + bne _08199428 + movs r0, 0x5 + bl PlaySE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _08199474 +_08199428: + cmp r1, 0x80 + bne _08199438 + movs r0, 0x5 + bl PlaySE + movs r0, 0 + movs r1, 0x1 + b _08199474 +_08199438: + cmp r1, 0x20 + beq _08199448 + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08199454 +_08199448: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _08199472 +_08199454: + ldrh r1, [r4, 0x30] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x10 + beq _0819946A + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08199478 +_0819946A: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_08199472: + movs r1, 0 +_08199474: + bl sub_8199134 +_08199478: + movs r0, 0x2 + negs r0, r0 +_0819947C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81993D8 + + thumb_func_start sub_8199484 +sub_8199484: @ 8199484 + push {r4-r6,lr} + ldr r6, =gUnknown_0203CD90 + ldrb r4, [r6, 0x2] + ldr r5, =gMain + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081994AC + movs r0, 0x5 + bl PlaySE + movs r0, 0x2 + ldrsb r0, [r6, r0] + b _0819951E + .pool +_081994AC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081994BA + movs r0, 0x1 + negs r0, r0 + b _0819951E +_081994BA: + ldrh r0, [r5, 0x30] + movs r6, 0xF0 + adds r1, r6, 0 + ands r1, r0 + cmp r1, 0x40 + bne _081994CE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _08199508 +_081994CE: + cmp r1, 0x80 + bne _081994D8 + movs r0, 0 + movs r1, 0x1 + b _08199508 +_081994D8: + cmp r1, 0x20 + beq _081994E8 + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081994EE +_081994E8: + movs r0, 0x1 + negs r0, r0 + b _08199506 +_081994EE: + ldrh r1, [r5, 0x30] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0x10 + beq _08199504 + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0819951A +_08199504: + movs r0, 0x1 +_08199506: + movs r1, 0 +_08199508: + bl sub_81991F8 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _0819951A + movs r0, 0x5 + bl PlaySE +_0819951A: + movs r0, 0x2 + negs r0, r0 +_0819951E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8199484 + + thumb_func_start InitMenuInUpperLeftCorner +@ int InitMenuInUpperLeftCorner(s8 windowId, s8 numItems, u8 initialCursorPos, bool doNotPlaySoundWhenAPressed) +InitMenuInUpperLeftCorner: @ 8199524 + push {r4-r6,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + ldr r4, =gUnknown_0203CD90 + movs r6, 0 + strb r6, [r4] + movs r2, 0x1 + strb r2, [r4, 0x1] + strb r6, [r4, 0x3] + subs r1, 0x1 + strb r1, [r4, 0x4] + strb r0, [r4, 0x5] + strb r2, [r4, 0x6] + movs r0, 0x10 + strb r0, [r4, 0x8] + strb r3, [r4, 0xB] + cmp r5, 0 + blt _08199554 + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r5, r0 + ble _0819955C +_08199554: + strb r6, [r4, 0x2] + b _0819955E + .pool +_0819955C: + strb r5, [r4, 0x2] +_0819955E: + movs r0, 0 + bl MoveMenuCursor + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end InitMenuInUpperLeftCorner + + thumb_func_start InitMenuInUpperLeftCornerPlaySoundWhenAPressed +InitMenuInUpperLeftCornerPlaySoundWhenAPressed: @ 8199570 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + bl InitMenuInUpperLeftCorner + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end InitMenuInUpperLeftCornerPlaySoundWhenAPressed + + thumb_func_start PrintMenuTable +PrintMenuTable: @ 819958C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + movs r5, 0 + cmp r5, r7 + bcs _081995D0 + movs r6, 0x80 + lsls r6, 17 + adds r4, r2, 0 +_081995AA: + ldr r2, [r4] + lsrs r0, r6, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r8 + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + movs r0, 0x80 + lsls r0, 21 + adds r6, r0 + adds r4, 0x8 + adds r5, 0x1 + cmp r5, r7 + bcc _081995AA +_081995D0: + mov r0, r8 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end PrintMenuTable + + thumb_func_start sub_81995E4 +sub_81995E4: @ 81995E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r2 + mov r8, r3 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + mov r0, sp + movs r1, 0 + mov r10, r1 + strb r6, [r0, 0x4] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x5] + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + movs r0, 0x1 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + mov r1, r10 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + movs r1, 0x8 + strb r1, [r0, 0x6] + strb r1, [r0, 0x8] + movs r4, 0 + cmp r4, r7 + bcs _081996A6 + mov r5, sp +_0819967C: + mov r1, r8 + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 3 + add r0, r9 + ldr r0, [r0] + str r0, [sp] + lsls r0, r4, 4 + adds r0, 0x1 + strb r0, [r5, 0x7] + strb r0, [r5, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _0819967C +_081996A6: + adds r0, r6, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81995E4 + + thumb_func_start CreateYesNoMenu +@ void CreateYesNoMenu(struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos) +CreateYesNoMenu: @ 81996C0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r1, =gUnknown_0203CD9F + mov r8, r1 + bl AddWindow + mov r2, r8 + strb r0, [r2] + ldrb r0, [r2] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl SetWindowBorderStyle + ldr r0, =gUnknown_085EE491 + str r0, [sp] + mov r1, sp + mov r2, r8 + ldrb r0, [r2] + movs r2, 0 + mov r9, r2 + strb r0, [r1, 0x4] + mov r0, sp + movs r2, 0x1 + strb r2, [r0, 0x5] + movs r0, 0x8 + strb r0, [r1, 0x6] + mov r0, sp + strb r2, [r0, 0x7] + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + movs r0, 0x1 + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + movs r0, 0x1 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + mov r1, r9 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + mov r2, r8 + ldrb r0, [r2] + movs r1, 0x2 + adds r2, r6, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end CreateYesNoMenu + + thumb_func_start sub_81997AC +sub_81997AC: @ 81997AC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + movs r7, 0 + cmp r7, r3 + bcs _08199824 +_081997D4: + movs r4, 0 + adds r0, r7, 0x1 + mov r9, r0 + cmp r4, r6 + bcs _0819981C + lsls r0, r7, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0x80 + lsls r5, 20 +_081997EC: + adds r0, r7, 0 + muls r0, r6 + adds r0, r4 + lsls r0, 3 + ldr r1, [sp, 0x34] + adds r0, r1 + ldr r2, [r0] + lsrs r3, r5, 24 + mov r0, r8 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r10 + movs r1, 0x1 + bl PrintTextOnWindow + ldr r1, [sp, 0xC] + lsls r0, r1, 24 + adds r5, r0 + adds r4, 0x1 + cmp r4, r6 + bcc _081997EC +_0819981C: + mov r7, r9 + ldr r4, [sp, 0x10] + cmp r7, r4 + bcc _081997D4 +_08199824: + mov r0, r10 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81997AC + + thumb_func_start sub_819983C +sub_819983C: @ 819983C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + mov r0, sp + movs r6, 0 + ldrb r1, [r0, 0x10] + strb r1, [r0, 0x4] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x5] + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + movs r0, 0x1 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + strb r6, [r0, 0xA] + strb r6, [r0, 0xB] + movs r7, 0 + cmp r7, r10 + bcs _0819992A +_081998D6: + movs r5, 0 + adds r2, r7, 0x1 + mov r9, r2 + cmp r5, r8 + bcs _08199920 + mov r4, sp + lsls r0, r7, 4 + adds r6, r0, 0x1 +_081998E6: + mov r0, r8 + muls r0, r7 + adds r0, r5 + ldr r1, [sp, 0x3C] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 3 + ldr r2, [sp, 0x38] + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + ldr r1, [sp, 0x14] + adds r0, r1, 0 + muls r0, r5 + adds r0, 0x8 + strb r0, [r4, 0x6] + strb r6, [r4, 0x7] + strb r0, [r4, 0x8] + strb r6, [r4, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _081998E6 +_08199920: + mov r2, r9 + lsls r0, r2, 24 + lsrs r7, r0, 24 + cmp r7, r10 + bcc _081998D6 +_0819992A: + ldr r0, [sp, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819983C + + thumb_func_start sub_8199944 +sub_8199944: @ 8199944 + push {r4-r7,lr} + ldr r4, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r7, r4, 24 + ldr r6, =gUnknown_0203CD90 + movs r4, 0 + mov r12, r4 + mov r4, r12 + strb r4, [r6] + movs r5, 0x1 + strb r5, [r6, 0x1] + strb r4, [r6, 0x3] + adds r4, r2, 0 + muls r4, r3 + subs r4, 0x1 + strb r4, [r6, 0x4] + strb r0, [r6, 0x5] + strb r5, [r6, 0x6] + strb r1, [r6, 0x7] + movs r0, 0x10 + strb r0, [r6, 0x8] + strb r2, [r6, 0x9] + strb r3, [r6, 0xA] + cmp r7, 0 + blt _08199986 + movs r0, 0x4 + ldrsb r0, [r6, r0] + cmp r7, r0 + ble _08199990 +_08199986: + mov r0, r12 + strb r0, [r6, 0x2] + b _08199992 + .pool +_08199990: + strb r7, [r6, 0x2] +_08199992: + movs r0, 0 + movs r1, 0 + bl sub_8199134 + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8199944 + + thumb_func_start clear_scheduled_bg_copies_to_vram +@ void clear_scheduled_bg_copies_to_vram() +clear_scheduled_bg_copies_to_vram: @ 81999A8 + push {lr} + ldr r0, =gUnknown_0203CDA4 + movs r1, 0 + movs r2, 0x4 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end clear_scheduled_bg_copies_to_vram + + thumb_func_start schedule_bg_copy_tilemap_to_vram +@ void schedule_bg_copy_tilemap_to_vram(u8 bg_id) +schedule_bg_copy_tilemap_to_vram: @ 81999BC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CDA4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + bx lr + .pool + thumb_func_end schedule_bg_copy_tilemap_to_vram + + thumb_func_start do_scheduled_bg_tilemap_copies_to_vram +@ void do_scheduled_bg_tilemap_copies_to_vram() +do_scheduled_bg_tilemap_copies_to_vram: @ 81999D0 + push {r4,lr} + ldr r4, =gUnknown_0203CDA4 + ldrb r0, [r4] + cmp r0, 0x1 + bne _081999E4 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0 + strb r0, [r4] +_081999E4: + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + bne _081999F4 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0 + strb r0, [r4, 0x1] +_081999F4: + ldrb r0, [r4, 0x2] + cmp r0, 0x1 + bne _08199A04 + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0 + strb r0, [r4, 0x2] +_08199A04: + ldrb r0, [r4, 0x3] + cmp r0, 0x1 + bne _08199A14 + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + movs r0, 0 + strb r0, [r4, 0x3] +_08199A14: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end do_scheduled_bg_tilemap_copies_to_vram + + thumb_func_start reset_temp_tile_data_buffers +@ void reset_temp_tile_data_buffers() +reset_temp_tile_data_buffers: @ 8199A20 + push {lr} + ldr r3, =gUnknown_0203CDA8 + ldr r1, =gUnknown_0203CDAC + movs r2, 0 + adds r0, r1, 0 + adds r0, 0x7C +_08199A2C: + str r2, [r0] + subs r0, 0x4 + cmp r0, r1 + bge _08199A2C + movs r0, 0 + strh r0, [r3] + pop {r0} + bx r0 + .pool + thumb_func_end reset_temp_tile_data_buffers + + thumb_func_start free_temp_tile_data_buffers_if_possible +free_temp_tile_data_buffers_if_possible: @ 8199A44 + push {r4-r6,lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08199A88 + ldr r1, =gUnknown_0203CDA8 + ldrh r0, [r1] + cmp r0, 0 + beq _08199A7C + movs r4, 0 + ldrh r1, [r1] + cmp r4, r1 + bge _08199A76 + ldr r5, =gUnknown_0203CDAC + movs r6, 0 +_08199A64: + ldr r0, [r5] + bl Free + stm r5!, {r6} + adds r4, 0x1 + ldr r0, =gUnknown_0203CDA8 + ldrh r0, [r0] + cmp r4, r0 + blt _08199A64 +_08199A76: + ldr r1, =gUnknown_0203CDA8 + movs r0, 0 + strh r0, [r1] +_08199A7C: + movs r0, 0 + b _08199A8A + .pool +_08199A88: + movs r0, 0x1 +_08199A8A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end free_temp_tile_data_buffers_if_possible + + thumb_func_start decompress_and_copy_tile_data_to_vram +@ int decompress_and_copy_tile_data_to_vram(u8 bg_id, int src, int size, u16 offset, u8 mode) +decompress_and_copy_tile_data_to_vram: @ 8199A90 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + mov r9, r3 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r6, =gUnknown_0203CDA8 + ldrh r0, [r6] + cmp r0, 0x1F + bhi _08199AF8 + adds r0, r4, 0 + add r1, sp, 0x4 + bl malloc_and_decompress + adds r4, r0, 0 + cmp r5, 0 + bne _08199AC8 + ldr r5, [sp, 0x4] +_08199AC8: + cmp r4, 0 + beq _08199AEC + lsls r2, r5, 16 + lsrs r2, 16 + str r7, [sp] + mov r0, r8 + adds r1, r4, 0 + mov r3, r9 + bl copy_decompressed_tile_data_to_vram + ldr r2, =gUnknown_0203CDAC + ldrh r0, [r6] + adds r1, r0, 0x1 + strh r1, [r6] + lsls r0, 16 + lsrs r0, 14 + adds r0, r2 + str r4, [r0] +_08199AEC: + adds r0, r4, 0 + b _08199AFA + .pool +_08199AF8: + movs r0, 0 +_08199AFA: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end decompress_and_copy_tile_data_to_vram + + thumb_func_start copy_decompressed_tile_data_to_vram_autofree +@ void copy_decompressed_tile_data_to_vram_autofree(u8 bg_id, int src, u16 size, u16 offset, u8 mode) +copy_decompressed_tile_data_to_vram_autofree: @ 8199B08 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r5, r2, 0 + ldr r2, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + mov r9, r3 + lsls r2, 24 + lsrs r7, r2, 24 + adds r0, r1, 0 + add r1, sp, 0x4 + bl malloc_and_decompress + adds r6, r0, 0 + cmp r5, 0 + bne _08199B36 + ldr r5, [sp, 0x4] +_08199B36: + cmp r6, 0 + beq _08199B6E + ldr r0, =task_free_buf_after_copying_tile_data_to_vram + movs r1, 0 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, r5, 16 + lsrs r2, 16 + str r7, [sp] + mov r0, r8 + adds r1, r6, 0 + mov r3, r9 + bl copy_decompressed_tile_data_to_vram + ldr r2, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r6, 0 + bl SetWordTaskArg +_08199B6E: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end copy_decompressed_tile_data_to_vram_autofree + + thumb_func_start task_free_buf_after_copying_tile_data_to_vram +@ void task_free_buf_after_copying_tile_data_to_vram(int task_id) +task_free_buf_after_copying_tile_data_to_vram: @ 8199B84 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + bl CheckForSpaceForDma3Request + lsls r0, 16 + cmp r0, 0 + bne _08199BB4 + adds r0, r4, 0 + movs r1, 0x1 + bl GetWordTaskArg + bl Free + adds r0, r4, 0 + bl DestroyTask +_08199BB4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_free_buf_after_copying_tile_data_to_vram + + thumb_func_start malloc_and_decompress +@ void *malloc_and_decompress(void *src, int *size) +malloc_and_decompress: @ 8199BC0 + push {r4,r5,lr} + adds r5, r0, 0 + ldrb r0, [r5, 0x1] + strb r0, [r1] + ldrb r0, [r5, 0x2] + strb r0, [r1, 0x1] + ldrb r0, [r5, 0x3] + strb r0, [r1, 0x2] + movs r0, 0 + strb r0, [r1, 0x3] + ldr r0, [r1] + bl Alloc + adds r4, r0, 0 + cmp r4, 0 + beq _08199BE8 + adds r0, r5, 0 + adds r1, r4, 0 + bl LZ77UnCompWram +_08199BE8: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end malloc_and_decompress + + thumb_func_start copy_decompressed_tile_data_to_vram +@ s16 copy_decompressed_tile_data_to_vram(u8 bg_id, int src, u16 size, u16 offset, u8 mode) +copy_decompressed_tile_data_to_vram: @ 8199BF0 + push {r4,lr} + adds r4, r1, 0 + ldr r1, [sp, 0x8] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + beq _08199C18 + cmp r1, 0x1 + beq _08199C20 + ldr r0, =0x0000ffff + b _08199C2A + .pool +_08199C18: + adds r1, r4, 0 + bl LoadBgTiles + b _08199C26 +_08199C20: + adds r1, r4, 0 + bl LoadBgTilemap +_08199C26: + lsls r0, 16 + lsrs r0, 16 +_08199C2A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end copy_decompressed_tile_data_to_vram + + thumb_func_start sub_8199C30 +sub_8199C30: @ 8199C30 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r2, 0 + ldr r4, [sp, 0x28] + ldr r2, [sp, 0x2C] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x4] + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + bl GetBgTilemapBuffer + mov r8, r0 + adds r0, r5, r4 + cmp r5, r0 + bge _08199CA8 + mov r9, r0 +_08199C6E: + ldr r3, [sp] + ldr r1, [sp, 0x4] + adds r0, r3, r1 + adds r7, r5, 0x1 + cmp r3, r0 + bge _08199CA0 + lsls r6, r5, 5 + ldr r1, =0x00000fff + mov r12, r1 + mov r1, r10 + lsls r5, r1, 12 + adds r4, r0, 0 +_08199C86: + adds r1, r6, r3 + lsls r1, 1 + add r1, r8 + ldrh r2, [r1] + mov r0, r12 + ands r0, r2 + orrs r0, r5 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + blt _08199C86 +_08199CA0: + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, r9 + blt _08199C6E +_08199CA8: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8199C30 + + thumb_func_start sub_8199CBC +sub_8199CBC: @ 8199CBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r1 + ldr r1, [sp, 0x24] + ldr r4, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + lsls r1, 24 + lsrs r5, r1, 24 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + bl GetBgTilemapBuffer + adds r7, r0, 0 + movs r0, 0 + cmp r0, r8 + bcs _08199D2A +_08199CF4: + movs r2, 0 + adds r6, r0, 0x1 + cmp r2, r5 + bcs _08199D22 + adds r4, r0, 0 + muls r4, r5 + ldr r1, [sp] + adds r0, r1 + lsls r3, r0, 5 +_08199D06: + adds r1, r4, r2 + lsls r1, 1 + add r1, r10 + adds r0, r3, r2 + add r0, r9 + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r5 + bcc _08199D06 +_08199D22: + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, r8 + bcc _08199CF4 +_08199D2A: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8199CBC + + thumb_func_start sub_8199D3C +sub_8199D3C: @ 8199D3C + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + ldr r0, [sp, 0x14] + adds r4, r2, 0 + muls r4, r3 + cmp r0, 0x1 + bne _08199D64 + adds r3, r6, 0 + movs r2, 0 + cmp r2, r4 + bge _08199D8C +_08199D54: + adds r1, r3, r2 + ldrb r0, [r1] + adds r0, r5 + strb r0, [r1] + adds r2, 0x1 + cmp r2, r4 + blt _08199D54 + b _08199D8C +_08199D64: + cmp r4, 0 + ble _08199D8C + movs r0, 0xFC + lsls r0, 8 + mov r12, r0 + ldr r0, =0x000003ff + adds r7, r0, 0 + adds r3, r6, 0 + adds r2, r4, 0 +_08199D76: + ldrh r0, [r3] + mov r1, r12 + ands r1, r0 + adds r0, r5 + ands r0, r7 + orrs r1, r0 + strh r1, [r3] + adds r3, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _08199D76 +_08199D8C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8199D3C + + thumb_func_start sub_8199D98 +sub_8199D98: @ 8199D98 + push {lr} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + pop {r0} + bx r0 + thumb_func_end sub_8199D98 + + thumb_func_start sub_8199DF0 +sub_8199DF0: @ 8199DF0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r2 + mov r9, r3 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0x4 + bl GetBgAttribute + lsls r0, 16 + movs r7, 0x40 + cmp r0, 0 + bne _08199E16 + movs r7, 0x20 +_08199E16: + adds r0, r5, 0 + movs r1, 0x1 + bl GetBgAttribute + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0xA + bl GetBgAttribute + lsls r4, 16 + lsrs r4, 2 + lsls r0, 16 + lsrs r0, 16 + add r0, r8 + muls r0, r7 + adds r4, r0 + lsls r0, r6, 24 + lsls r1, r6, 16 + orrs r0, r1 + lsls r1, r6, 8 + orrs r0, r1 + orrs r0, r6 + movs r1, 0xC0 + lsls r1, 19 + adds r4, r1 + mov r2, r9 + muls r2, r7 + lsls r2, 16 + lsrs r2, 16 + adds r1, r4, 0 + movs r3, 0x1 + bl RequestDma3Fill + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8199DF0 + + thumb_func_start box_print +box_print: @ 8199E64 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r1, 0 + ldr r6, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x28] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + str r1, [sp] + mov r1, sp + strb r0, [r1, 0x4] + mov r0, sp + strb r4, [r0, 0x5] + strb r2, [r0, 0x6] + strb r3, [r0, 0x7] + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r4, 0 + movs r1, 0x2 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x3 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xB] + mov r3, sp + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + mov r2, sp + ldrb r0, [r6, 0x1] + lsls r0, 4 + movs r4, 0xF + strb r0, [r2, 0xC] + ldrb r2, [r6] + adds r0, r4, 0 + ands r0, r2 + ldrb r2, [r3, 0xD] + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + mov r2, sp + ldrb r0, [r6, 0x2] + lsls r0, 4 + ands r1, r4 + orrs r1, r0 + strb r1, [r2, 0xD] + mov r0, sp + adds r1, r5, 0 + movs r2, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end box_print + + thumb_func_start AddTextPrinterParametrized2 +@ void AddTextPrinterParametrized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, struct TextColor *color, u8 speed, u8 *str) +AddTextPrinterParametrized2: @ 8199EEC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + adds r5, r1, 0 + ldr r1, [sp, 0x28] + mov r8, r1 + ldr r1, [sp, 0x2C] + mov r9, r1 + ldr r6, [sp, 0x30] + ldr r1, [sp, 0x34] + ldr r4, [sp, 0x38] + str r4, [sp] + mov r4, sp + strb r0, [r4, 0x4] + mov r0, sp + strb r5, [r0, 0x5] + strb r2, [r0, 0x6] + strb r3, [r0, 0x7] + mov r2, sp + ldrb r0, [r0, 0x6] + strb r0, [r2, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r2, 0x9] + mov r0, sp + mov r2, r8 + strb r2, [r0, 0xA] + mov r2, r9 + strb r2, [r0, 0xB] + ldrb r3, [r4, 0xC] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r4, 0xC] + mov r3, sp + ldrb r0, [r6, 0x1] + lsls r0, 4 + movs r5, 0xF + strb r0, [r3, 0xC] + ldrb r3, [r6] + adds r0, r5, 0 + ands r0, r3 + ldrb r3, [r4, 0xD] + ands r2, r3 + orrs r2, r0 + strb r2, [r4, 0xD] + mov r3, sp + ldrb r0, [r6, 0x2] + lsls r0, 4 + ands r2, r5 + orrs r2, r0 + strb r2, [r3, 0xD] + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + movs r2, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end AddTextPrinterParametrized2 + + thumb_func_start sub_8199F74 +sub_8199F74: @ 8199F74 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r6, r1, 0 + ldr r4, [sp, 0x2C] + ldr r1, [sp, 0x30] + mov r8, r1 + ldr r7, [sp, 0x34] + ldr r5, [sp, 0x38] + ldr r1, [sp, 0x3C] + mov r9, r1 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + str r2, [sp] + mov r1, sp + strb r0, [r1, 0x4] + mov r0, sp + strb r6, [r0, 0x5] + strb r3, [r0, 0x6] + strb r4, [r0, 0x7] + strb r3, [r0, 0x8] + strb r4, [r0, 0x9] + strb r5, [r0, 0xA] + mov r1, r9 + strb r1, [r0, 0xB] + mov r2, sp + ldrb r1, [r2, 0xC] + movs r5, 0x10 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2, 0xC] + adds r0, r6, 0 + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r4, 0xF + adds r1, r4, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r6, 0 + movs r1, 0x6 + bl GetFontAttribute + mov r2, sp + adds r1, r4, 0 + ands r1, r0 + ldrb r0, [r2, 0xD] + ands r5, r0 + orrs r5, r1 + strb r5, [r2, 0xD] + adds r0, r6, 0 + movs r1, 0x7 + bl GetFontAttribute + mov r2, sp + lsls r0, 4 + ldrb r1, [r2, 0xD] + ands r4, r1 + orrs r4, r0 + strb r4, [r2, 0xD] + mov r0, sp + mov r1, r8 + adds r2, r7, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8199F74 + + thumb_func_start sub_819A024 +sub_819A024: @ 819A024 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + lsls r2, 16 + lsrs r4, r2, 16 + lsls r3, 16 + lsrs r5, r3, 16 + movs r2, 0 + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldrb r0, [r3] + ldr r6, =gStringVar4 + cmp r0, 0xFF + beq _0819A04C +_0819A042: + adds r2, 0x1 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0819A042 +_0819A04C: + adds r0, r6, 0 + bl StringExpandPlaceholders + lsls r3, r4, 24 + lsrs r3, 24 + lsls r0, r5, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0x1 + adds r2, r6, 0 + bl PrintTextOnWindow + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A024 + + thumb_func_start sub_819A080 +sub_819A080: @ 819A080 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, [sp, 0x48] + ldr r4, [sp, 0x4C] + ldr r1, [sp, 0x50] + ldr r5, [sp, 0x54] + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x8] + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + lsls r4, 16 + lsrs r4, 16 + lsls r1, 16 + lsrs r1, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r2, [sp, 0x4] + ldrh r0, [r2, 0x4] + ldr r2, [sp, 0xC] + subs r0, r2 + ldr r2, [sp, 0x8] + adds r2, r1, r2 + str r2, [sp, 0x10] + cmp r0, r1 + bge _0819A0CC + ldr r1, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x10] +_0819A0CC: + ldr r2, [sp, 0x4] + ldrh r1, [r2, 0x6] + subs r0, r1, r4 + cmp r0, r5 + bge _0819A0DE + adds r0, r3, r1 + subs r0, r4 + str r0, [sp, 0x14] + b _0819A0E2 +_0819A0DE: + adds r5, r3, r5 + str r5, [sp, 0x14] +_0819A0E2: + ldr r0, [sp] + ldrh r1, [r0, 0x4] + movs r2, 0x7 + adds r0, r1, 0 + ands r0, r2 + adds r1, r0 + asrs r1, 3 + str r1, [sp, 0x18] + ldr r0, [sp, 0x4] + ldrh r1, [r0, 0x4] + adds r0, r1, 0 + ands r0, r2 + adds r1, r0 + asrs r1, 3 + str r1, [sp, 0x1C] + mov r12, r3 + mov r8, r4 + ldr r1, [sp, 0x14] + cmp r12, r1 + blt _0819A10C + b _0819A24A +_0819A10C: + ldr r5, [sp, 0x8] + ldr r6, [sp, 0xC] + mov r2, r12 + adds r2, 0x1 + str r2, [sp, 0x20] + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x24] + ldr r1, [sp, 0x10] + cmp r5, r1 + blt _0819A124 + b _0819A23A +_0819A124: + movs r7, 0x1 + movs r2, 0xF0 + mov r10, r2 + movs r0, 0xF + mov r9, r0 +_0819A12E: + asrs r0, r5, 1 + movs r1, 0x3 + ands r0, r1 + ldr r2, [sp] + ldr r1, [r2] + adds r1, r0 + asrs r0, r5, 3 + lsls r0, 5 + adds r1, r0 + mov r2, r12 + asrs r0, r2, 3 + ldr r2, [sp, 0x18] + muls r0, r2 + lsls r0, 5 + adds r1, r0 + mov r2, r12 + lsls r0, r2, 29 + lsrs r0, 27 + adds r3, r1, r0 + asrs r0, r6, 1 + movs r1, 0x3 + ands r0, r1 + ldr r2, [sp, 0x4] + ldr r1, [r2] + adds r1, r0 + asrs r0, r6, 3 + lsls r0, 5 + adds r1, r0 + mov r2, r8 + asrs r0, r2, 3 + ldr r2, [sp, 0x1C] + muls r0, r2 + lsls r0, 5 + adds r1, r0 + mov r2, r8 + lsls r0, r2, 29 + lsrs r0, 27 + adds r4, r1, r0 + adds r0, r4, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1DA + subs r4, 0x1 + adds r0, r6, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1B2 + ldrh r0, [r4] + ldr r2, =0x00000fff + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1A8 + ldrb r1, [r3] + mov r0, r10 + ands r0, r1 + lsls r0, 8 + b _0819A22A + .pool +_0819A1A8: + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + lsls r0, 12 + b _0819A22A +_0819A1B2: + ldrh r0, [r4] + ldr r2, =0x0000f0ff + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1D0 + ldrb r1, [r3] + mov r0, r10 + ands r0, r1 + lsls r0, 4 + b _0819A22A + .pool +_0819A1D0: + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + lsls r0, 8 + b _0819A22A +_0819A1DA: + adds r0, r6, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A206 + ldrh r0, [r4] + ldr r2, =0x0000ff0f + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1FC + ldrb r1, [r3] + mov r0, r10 + b _0819A228 + .pool +_0819A1FC: + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + lsls r0, 4 + b _0819A22A +_0819A206: + ldrh r0, [r4] + ldr r2, =0x0000fff0 + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A224 + ldrb r1, [r3] + mov r0, r10 + ands r0, r1 + lsrs r0, 4 + b _0819A22A + .pool +_0819A224: + ldrb r1, [r3] + mov r0, r9 +_0819A228: + ands r0, r1 +_0819A22A: + orrs r2, r0 + strh r2, [r4] + adds r5, 0x1 + adds r6, 0x1 + ldr r0, [sp, 0x10] + cmp r5, r0 + bge _0819A23A + b _0819A12E +_0819A23A: + ldr r1, [sp, 0x20] + mov r12, r1 + ldr r2, [sp, 0x24] + mov r8, r2 + ldr r0, [sp, 0x14] + cmp r12, r0 + bge _0819A24A + b _0819A10C +_0819A24A: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819A080 + + thumb_func_start sub_819A25C +sub_819A25C: @ 819A25C + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + lsrs r0, 16 + bl sub_80D30B0 + adds r1, r4, 0 + movs r2, 0x20 + bl LoadPalette + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819A25C + + thumb_func_start sub_819A27C +sub_819A27C: @ 819A27C + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r4, r3, 0 + ldr r5, [sp, 0x18] + lsls r6, 24 + lsrs r6, 24 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + movs r2, 0x1 + bl sub_80D2EDC + adds r1, r0, 0 + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r6, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl BlitBitmapToWindow + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819A27C + + thumb_func_start sub_819A2BC +sub_819A2BC: @ 819A2BC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _0819A2DC + cmp r1, 0x1 + ble _0819A2D2 + cmp r1, 0x2 + beq _0819A2E4 +_0819A2D2: + ldr r0, =gUnknown_08DC4318 + b _0819A2E6 + .pool +_0819A2DC: + ldr r0, =gUnknown_08DC4338 + b _0819A2E6 + .pool +_0819A2E4: + ldr r0, =gUnknown_08DC4358 +_0819A2E6: + adds r1, r2, 0 + movs r2, 0x20 + bl LoadPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A2BC + + thumb_func_start blit_move_info_icon +@ void blit_move_info_icon(u8 windowId, u8 a2, u16 x, u16 y) +blit_move_info_icon: @ 819A2F8 + push {r4,r5,lr} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r4, =gUnknown_0860F0D4 + lsrs r1, 22 + adds r1, r4 + ldrh r5, [r1, 0x2] + lsls r5, 5 + ldr r4, =gUnknown_08DC4378 + adds r5, r4 + movs r4, 0x80 + str r4, [sp] + str r4, [sp, 0x4] + str r2, [sp, 0x8] + str r3, [sp, 0xC] + ldrb r2, [r1] + str r2, [sp, 0x10] + ldrb r1, [r1, 0x1] + str r1, [sp, 0x14] + adds r1, r5, 0 + movs r2, 0 + movs r3, 0 + bl BlitBitmapRectToWindow + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end blit_move_info_icon + + thumb_func_start sub_819A344 +sub_819A344: @ 819A344 + push {r4-r7,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r2, 24 + lsrs r2, 24 + adds r5, r1, 0 + movs r1, 0xFC + strb r1, [r5] + adds r5, 0x1 + movs r0, 0x1 + strb r0, [r5] + adds r5, 0x1 + strb r2, [r5] + adds r5, 0x1 + strb r1, [r5] + adds r5, 0x1 + movs r0, 0x3 + strb r0, [r5] + adds r5, 0x1 + adds r2, 0x1 + strb r2, [r5] + adds r5, 0x1 + cmp r3, 0x4 + bhi _0819A43C + lsls r0, r3, 2 + ldr r1, =_0819A384 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819A384: + .4byte _0819A398 + .4byte _0819A3A8 + .4byte _0819A3D6 + .4byte _0819A404 + .4byte _0819A414 +_0819A398: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r5, 0 + bl StringCopy + b _0819A43C + .pool +_0819A3A8: + bl IsNationalPokedexEnabled + cmp r0, 0 + beq _0819A3B8 + movs r0, 0x1 + bl pokedex_count + b _0819A3BE +_0819A3B8: + movs r0, 0x1 + bl sub_80C0844 +_0819A3BE: + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r5, r0, 0 + movs r0, 0xFF + strb r0, [r5] + b _0819A43C +_0819A3D6: + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldrh r1, [r0, 0xE] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r5, r0, 0 + movs r0, 0xF0 + strb r0, [r5] + adds r5, 0x1 + ldr r0, [r4] + ldrb r1, [r0, 0x10] + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + b _0819A43C + .pool +_0819A404: + ldr r0, =gMapHeader + ldrb r1, [r0, 0x14] + adds r0, r5, 0 + bl sub_81245DC + b _0819A43C + .pool +_0819A414: + ldr r4, =0x00000867 + movs r6, 0 + adds r7, r5, 0x1 +_0819A41A: + lsls r0, r4, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0819A42A + adds r6, 0x1 +_0819A42A: + adds r4, 0x1 + ldr r0, =0x0000086e + cmp r4, r0 + ble _0819A41A + adds r0, r6, 0 + subs r0, 0x5F + strb r0, [r5] + movs r0, 0xFF + strb r0, [r7] +_0819A43C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A344 + + thumb_func_start sub_819A44C +sub_819A44C: @ 819A44C + push {r4,r5,lr} + adds r5, r0, 0 + ldrb r4, [r5, 0x5] + lsrs r4, 4 + movs r0, 0x65 + bl IndexOfSpritePaletteTag + lsls r0, 24 + lsls r4, 16 + lsrs r4, 16 + lsrs r0, 24 + cmp r4, r0 + bne _0819A4BA + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0819A4B0 + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _0819A484 + subs r0, r1, 0x1 + strh r0, [r5, 0x2E] + b _0819A4C2 +_0819A484: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _0819A4A6 + adds r0, r5, 0 + movs r1, 0 + bl StartSpriteAnim + movs r0, 0x20 + strh r0, [r5, 0x2E] + b _0819A4C2 +_0819A4A6: + adds r0, r5, 0 + movs r1, 0x1 + bl StartSpriteAnim + b _0819A4C2 +_0819A4B0: + adds r0, r5, 0 + movs r1, 0x1 + bl StartSpriteAnimIfDifferent + b _0819A4C2 +_0819A4BA: + adds r0, r5, 0 + movs r1, 0 + bl StartSpriteAnimIfDifferent +_0819A4C2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819A44C + + thumb_func_start sub_819A4C8 +sub_819A4C8: @ 819A4C8 + push {lr} + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_819A4C8 + + thumb_func_start sub_819A4E4 +sub_819A4E4: @ 819A4E4 + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_819A4E4 + + thumb_func_start sub_819A4F8 +sub_819A4F8: @ 819A4F8 + push {lr} + ldr r0, =gUnknown_0300127C + movs r1, 0 + str r1, [r0] + ldr r0, =sub_819A514 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A4F8 + + thumb_func_start sub_819A514 +sub_819A514: @ 819A514 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, =gMain + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xA + bls _0819A528 + b _0819A98E +_0819A528: + lsls r0, 2 + ldr r1, =_0819A53C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819A53C: + .4byte _0819A568 + .4byte _0819A5C0 + .4byte _0819A69C + .4byte _0819A77C + .4byte _0819A7CC + .4byte _0819A868 + .4byte _0819A8A4 + .4byte _0819A8AC + .4byte _0819A8C4 + .4byte _0819A8DC + .4byte _0819A8FC +_0819A568: + ldr r4, =gUnknown_0203CE3C + ldr r0, [r4] + cmp r0, 0 + beq _0819A578 + bl Free + movs r0, 0 + str r0, [r4] +_0819A578: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x8 + bl CpuSet + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08610428 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r0, =gUnknown_08610434 + bl InitWindows + bl DeactivateAllTextPrinters + b _0819A8E6 + .pool +_0819A5C0: + ldr r5, =gUnknown_0203CE2C + movs r4, 0x88 + lsls r4, 3 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203CE30 + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + ldr r5, =gUnknown_0203CE34 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203CE38 + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x42 + movs r1, 0 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + ldr r1, =gMain + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .pool +_0819A69C: + bl ResetPaletteFade + bl ResetSpriteData + bl ResetTasks + bl FreeAllSpritePalettes + ldr r0, =gUnknown_08DC0754 + ldr r5, =gUnknown_0203CE2C + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 2 + bl CpuSet + ldr r0, =gUnknown_0861033C + ldr r4, =gUnknown_0203CE30 + ldr r1, [r4] + movs r2, 0x30 + bl CpuSet + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 3 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTiles + ldr r1, [r4] + movs r0, 0x3 + movs r2, 0x60 + movs r3, 0 + bl LoadBgTiles + ldr r0, =gUnknown_08DC0B94 + ldr r4, =gUnknown_0203CE34 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 3 + bl CpuSet + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTilemap + ldr r0, =gUnknown_08DC0714 + movs r1, 0 + movs r2, 0x40 + bl LoadPalette + ldr r4, =gUnknown_0861046C + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0x8 + bl LoadPalette + adds r0, r4, 0 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0x1 + bne _0819A738 + ldr r0, =gPlttBufferUnfaded + movs r2, 0xA9 + lsls r2, 2 + adds r1, r2 + ldrh r1, [r1] + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 + strh r1, [r0] +_0819A738: + ldr r0, =gUnknown_0861039C + movs r1, 0x20 + movs r2, 0x4 + bl LoadPalette + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819A8EE + .pool +_0819A77C: + ldr r0, =gUnknown_0203CE38 + ldr r1, [r0] + movs r0, 0x3 + bl SetBgTilemapBuffer + ldr r5, =gUnknown_0861023C + movs r4, 0x8 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0xB + movs r3, 0x4 + bl CopyToBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x4 + bl CopyToBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0x14 + movs r3, 0x4 + bl CopyToBgTilemapBufferRect + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _0819A8E6 + .pool +_0819A7CC: + ldr r0, =gUnknown_086103F4 + bl LoadSpritePalettes + ldr r0, =gUnknown_086103BC + bl LoadSpriteSheets + ldr r0, =gUnknown_086103E4 + bl LoadCompressedObjectPic + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + ldr r0, =sub_819A4E4 + bl SetVBlankCallback + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + movs r1, 0x9A + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + bne _0819A854 + movs r0, 0x58 + movs r1, 0x98 + movs r2, 0x20 + movs r3, 0x60 + bl sub_819C5D0 + movs r0, 0x3 + bl ShowBg + ldr r1, =0x00001248 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _0819A85A + .pool +_0819A854: + movs r0, 0x3 + bl HideBg +_0819A85A: + ldr r1, =gMain + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .pool +_0819A868: + ldr r4, =gUnknown_0300127C + ldr r1, [r4] + ldrb r0, [r1, 0x6] + cmp r0, 0x1 + bne _0819A878 + ldr r0, =gUnknown_0203CF20 + ldrb r0, [r0] + strb r0, [r1, 0x3] +_0819A878: + bl sub_819A9AC + bl sub_819AA18 + ldr r0, [r4] + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + bne _0819A88C + bl sub_819BE34 +_0819A88C: + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819A8EE + .pool +_0819A8A4: + bl sub_819BA64 + movs r0, 0x2 + b _0819A8E2 +_0819A8AC: + bl sub_819BCF8 + movs r0, 0x5 + bl PutWindowTilemap + ldr r1, =gMain + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .pool +_0819A8C4: + bl sub_819B9E8 + movs r0, 0x1 + bl PutWindowTilemap + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819A8EE + .pool +_0819A8DC: + bl sub_819B9B4 + movs r0, 0 +_0819A8E2: + bl PutWindowTilemap +_0819A8E6: + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_0819A8EE: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0819A98E + .pool +_0819A8FC: + ldr r0, =sub_819C69C + movs r1, 0 + bl CreateTask + ldr r2, =gUnknown_0300127C + ldr r1, [r2] + ldr r3, =0x000002a1 + adds r1, r3 + strb r0, [r1] + ldr r3, [r2] + ldrb r5, [r3, 0x6] + cmp r5, 0 + bne _0819A954 + ldr r4, =gTasks + ldr r1, =0x000002a1 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + ldr r0, =sub_819B378 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + b _0819A988 + .pool +_0819A954: + ldr r4, =gTasks + ldr r2, =0x000002a1 + adds r0, r3, r2 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0x8] + ldr r1, =0x000002a2 + adds r0, r3, r1 + strb r2, [r0] + ldr r0, =sub_819B124 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xD + strh r1, [r0, 0x8] +_0819A988: + ldr r0, =sub_819A4C8 + bl SetMainCallback2 +_0819A98E: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A514 + + thumb_func_start sub_819A9AC +sub_819A9AC: @ 819A9AC + push {r4,r5,lr} + ldr r5, =gUnknown_0300127C + ldr r4, [r5] + cmp r4, 0 + bne _0819AA12 + movs r0, 0xAB + lsls r0, 2 + bl AllocZeroed + str r0, [r5] + strb r4, [r0, 0x3] + ldr r1, [r5] + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r0, [r5] + strb r4, [r0, 0x6] + movs r2, 0 + movs r4, 0x6C + movs r3, 0 +_0819A9D2: + ldr r0, [r5] + adds r1, r2, 0 + muls r1, r4 + adds r0, r1 + strb r3, [r0, 0x10] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819A9D2 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _0819AA0C + movs r0, 0 + bl sub_819B484 + b _0819AA12 + .pool +_0819AA0C: + movs r0, 0 + bl sub_819B63C +_0819AA12: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819A9AC + + thumb_func_start sub_819AA18 +sub_819AA18: @ 819AA18 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r4, 0 + mov r8, r4 + ldr r7, =gSprites +_0819AA24: + lsls r1, r4, 3 + adds r1, r4 + lsls r1, 2 + subs r1, r4 + adds r1, 0x20 + lsls r1, 16 + asrs r1, 16 + ldr r0, =gUnknown_086105D8 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r6, =gUnknown_0300127C + ldr r2, [r6] + movs r5, 0x6C + adds r1, r4, 0 + muls r1, r5 + adds r2, r1 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r2, 0xE] + ldrh r1, [r2, 0xE] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r1, r8 + strh r1, [r0, 0x2E] + adds r0, r4, 0 + bl sub_819ADAC + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0819AA24 + ldr r0, [r6] + ldrb r1, [r0, 0x3] + ldr r4, =gSprites + muls r1, r5 + adds r0, r1 + ldrh r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldr r0, =gUnknown_086105F0 + movs r2, 0x20 + ldrsh r1, [r1, r2] + movs r2, 0x58 + movs r3, 0 + bl CreateSprite + ldr r1, [r6] + movs r5, 0 + strb r0, [r1, 0x4] + ldr r0, =gUnknown_08610608 + movs r1, 0xB0 + movs r2, 0x70 + movs r3, 0 + bl CreateSprite + ldr r1, [r6] + strb r0, [r1, 0x1] + ldr r0, =gUnknown_08610620 + movs r1, 0xB0 + movs r2, 0x90 + movs r3, 0 + bl CreateSprite + ldr r1, [r6] + strb r0, [r1, 0x2] + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r5, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r5, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r5, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r5, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AA18 + + thumb_func_start sub_819AB40 +sub_819AB40: @ 819AB40 + push {r4-r6,lr} + movs r4, 0 +_0819AB44: + ldr r6, =gUnknown_0300127C + ldr r1, [r6] + movs r0, 0x6C + muls r0, r4 + adds r1, r0 + ldrh r1, [r1, 0xE] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =gSprites + adds r0, r5 + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0819AB44 + ldr r0, [r6] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AB40 + + thumb_func_start sub_819ABA8 +sub_819ABA8: @ 819ABA8 + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + ble _0819ABC8 + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1, 0x3] + adds r2, r0, 0 + cmp r3, 0x5 + beq _0819ABC4 + adds r0, r3, 0x1 + b _0819ABDE + .pool +_0819ABC4: + movs r0, 0 + b _0819ABDE +_0819ABC8: + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1, 0x3] + adds r2, r0, 0 + cmp r3, 0 + beq _0819ABDC + subs r0, r3, 0x1 + b _0819ABDE + .pool +_0819ABDC: + movs r0, 0x5 +_0819ABDE: + strb r0, [r1, 0x3] + ldr r2, [r2] + ldrb r3, [r2, 0x3] + ldr r4, =gSprites + ldrb r0, [r2, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r0, 0x6C + muls r0, r3 + adds r2, r0 + ldrh r2, [r2, 0xE] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r1, 0x20] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ABA8 + + thumb_func_start sub_819AC10 +sub_819AC10: @ 819AC10 + push {lr} + lsls r0, 24 + cmp r0, 0 + ble _0819AC30 + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0x2 + beq _0819AC2C + adds r0, r3, 0x1 + b _0819AC46 + .pool +_0819AC2C: + movs r0, 0 + b _0819AC46 +_0819AC30: + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0 + beq _0819AC44 + subs r0, r3, 0x1 + b _0819AC46 + .pool +_0819AC44: + movs r0, 0x2 +_0819AC46: + strb r0, [r1] + ldr r3, =gSprites + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AC10 + + thumb_func_start sub_819AC78 +sub_819AC78: @ 819AC78 + push {lr} + lsls r0, 24 + cmp r0, 0 + ble _0819AC98 + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1, 0x7] + adds r2, r0, 0 + cmp r3, 0x1 + beq _0819AC94 + adds r0, r3, 0x1 + b _0819ACAE + .pool +_0819AC94: + movs r0, 0 + b _0819ACAE +_0819AC98: + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1, 0x7] + adds r2, r0, 0 + cmp r3, 0 + beq _0819ACAC + subs r0, r3, 0x1 + b _0819ACAE + .pool +_0819ACAC: + movs r0, 0x1 +_0819ACAE: + strb r0, [r1, 0x7] + ldr r3, =gSprites + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x7] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x7] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AC78 + + thumb_func_start sub_819ACE0 +sub_819ACE0: @ 819ACE0 + push {r4-r6,lr} + ldr r5, =gUnknown_0300127C + ldr r0, [r5] + ldrb r6, [r0, 0x3] + movs r1, 0x6C + adds r4, r6, 0 + muls r4, r1 + adds r0, r4 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _0819AD60 + movs r0, 0x64 + bl IndexOfSpritePaletteTag + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, [r5] + ldrb r0, [r1, 0x5] + cmp r0, 0x3 + bne _0819AD44 + adds r0, r1, r4 + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _0819AD44 + movs r2, 0 + ldrb r0, [r1, 0x10] + cmp r0, 0x2 + beq _0819AD32 + movs r4, 0x6C +_0819AD1A: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bhi _0819AD32 + ldr r0, [r5] + adds r1, r2, 0 + muls r1, r4 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0x2 + bne _0819AD1A +_0819AD32: + cmp r2, 0x6 + beq _0819AD9C + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + movs r0, 0x6C + muls r0, r2 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1, 0x10] +_0819AD44: + ldr r2, =gUnknown_0300127C + ldr r1, [r2] + movs r0, 0x6C + muls r0, r6 + adds r1, r0 + movs r0, 0 + strb r0, [r1, 0x10] + ldr r1, [r2] + ldrb r0, [r1, 0x5] + subs r0, 0x1 + b _0819AD78 + .pool +_0819AD60: + movs r0, 0x65 + bl IndexOfSpritePaletteTag + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r5] + adds r1, r0, r4 + ldrb r0, [r0, 0x5] + strb r0, [r1, 0x10] + ldr r1, [r5] + ldrb r0, [r1, 0x5] + adds r0, 0x1 +_0819AD78: + strb r0, [r1, 0x5] + ldr r2, =gSprites + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + movs r1, 0x6C + muls r1, r6 + adds r0, r1 + ldrh r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] +_0819AD9C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ACE0 + + thumb_func_start sub_819ADAC +sub_819ADAC: @ 819ADAC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + movs r1, 0x6C + muls r1, r4 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _0819ADCC + movs r0, 0x65 + b _0819ADCE + .pool +_0819ADCC: + movs r0, 0x64 +_0819ADCE: + bl IndexOfSpritePaletteTag + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =gSprites + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + movs r1, 0x6C + muls r1, r4 + adds r0, r1 + ldrh r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ADAC + + thumb_func_start sub_819AE08 +sub_819AE08: @ 819AE08 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x7 + beq _0819AE64 + cmp r0, 0x7 + bgt _0819AE30 + cmp r0, 0x6 + beq _0819AE36 + b _0819AF50 + .pool +_0819AE30: + cmp r0, 0x8 + beq _0819AEE8 + b _0819AF50 +_0819AE36: + ldr r1, =gPlttBufferUnfaded + ldr r0, =gPlttBufferFaded + movs r2, 0xE4 + lsls r2, 1 + adds r0, r2 + ldrh r0, [r0] + adds r1, r2 + movs r2, 0 + strh r0, [r1] + movs r0, 0x1 + negs r0, r0 + str r2, [sp] + movs r1, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + movs r0, 0x7 + strh r0, [r6, 0x8] + b _0819AF50 + .pool +_0819AE64: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819AF50 + ldr r4, =gUnknown_0300127C + ldr r0, [r4] + ldr r2, =0x000002a1 + adds r0, r2 + ldrb r0, [r0] + bl DestroyTask + ldr r1, [r4] + movs r3, 0xA6 + lsls r3, 2 + adds r0, r1, r3 + ldr r0, [r0] + movs r2, 0xA8 + lsls r2, 2 + adds r1, r2 + bl sub_819F444 + bl sub_819AB40 + ldr r4, =gUnknown_0203CE2C + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE30 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE34 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE38 + ldr r0, [r4] + bl Free + str r5, [r4] + bl FreeAllWindowBuffers + movs r0, 0x8 + strh r0, [r6, 0x8] + b _0819AF50 + .pool +_0819AEE8: + ldr r4, =gUnknown_0300127C + ldr r1, [r4] + ldr r0, =gPlttBufferUnfaded + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 + ldrh r0, [r0] + adds r3, 0xDC + adds r1, r3 + strh r0, [r1] + adds r0, r2, 0 + bl DestroyTask + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x6] + ldr r0, [r4] + ldrb r6, [r0, 0x3] + ldr r4, =gUnknown_0203CE3C + movs r0, 0x96 + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + movs r4, 0 +_0819AF1A: + ldr r5, =gUnknown_0203CE3C + ldr r1, [r5] + movs r0, 0x64 + muls r0, r4 + adds r0, r1 + ldr r1, =gUnknown_0300127C + ldr r1, [r1] + movs r2, 0x6C + muls r2, r4 + adds r1, r2 + adds r1, 0x14 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0819AF1A + ldr r1, [r5] + ldr r0, =sub_819A514 + str r0, [sp] + movs r0, 0x1 + adds r2, r6, 0 + movs r3, 0x5 + bl sub_81BF8EC +_0819AF50: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AE08 + + thumb_func_start bc_exit_to_overworld +bc_exit_to_overworld: @ 819AF68 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gUnknown_0300127C + ldr r0, [r7] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B00E + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _0819AFA0 + cmp r1, 0x1 + beq _0819AFB8 + b _0819B00E + .pool +_0819AFA0: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819B00E +_0819AFB8: + bl UpdatePaletteFade + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819B00E + bl sub_819B764 + ldr r0, [r7] + ldr r1, =0x000002a1 + adds r0, r1 + ldrb r0, [r0] + bl DestroyTask + bl sub_819AB40 + ldr r4, =gUnknown_0203CE2C + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE34 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE38 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r0, [r7] + bl Free + str r5, [r7] + bl FreeAllWindowBuffers + ldr r0, =sub_80861B0 + bl SetMainCallback2 + adds r0, r6, 0 + bl DestroyTask +_0819B00E: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bc_exit_to_overworld + + thumb_func_start sub_819B02C +sub_819B02C: @ 819B02C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r7, =gUnknown_0300127C + ldr r0, [r7] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B11A + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x5 + beq _0819B084 + cmp r0, 0x5 + bgt _0819B06C + cmp r0, 0x4 + beq _0819B07A + b _0819B11A + .pool +_0819B06C: + cmp r0, 0xA + bne _0819B11A + bl sub_819C4B4 + movs r0, 0x4 + strh r0, [r5, 0x8] + b _0819B11A +_0819B07A: + bl sub_819B8D4 + movs r0, 0x5 + strh r0, [r5, 0x8] + b _0819B11A +_0819B084: + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + mov r8, r0 + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0819B0B8 + movs r0, 0x5 + bl PlaySE + ldr r0, [r7] + ldrb r4, [r0, 0x7] + cmp r4, 0 + bne _0819B0C6 + bl sub_819C568 + strh r4, [r5, 0x8] + ldr r0, =bc_exit_to_overworld + str r0, [r5] + b _0819B11A + .pool +_0819B0B8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819B0EC + movs r0, 0x5 + bl PlaySE +_0819B0C6: + movs r0, 0x4 + bl sub_819B958 + bl sub_819BC9C + ldr r0, [r7] + ldr r1, =0x000002a2 + adds r0, r1 + mov r1, r8 + strb r1, [r0] + strh r6, [r5, 0x8] + ldr r0, =sub_819B378 + str r0, [r5] + b _0819B11A + .pool +_0819B0EC: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819B106 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + bl sub_819AC78 + b _0819B11A +_0819B106: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819B11A + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + bl sub_819AC78 +_0819B11A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819B02C + + thumb_func_start sub_819B124 +sub_819B124: @ 819B124 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x8] + subs r0, 0x2 + lsls r0, 16 + asrs r0, 16 + adds r6, r1, 0 + cmp r0, 0xB + bls _0819B144 + b _0819B36E +_0819B144: + lsls r0, 2 + ldr r1, =_0819B158 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819B158: + .4byte _0819B188 + .4byte _0819B1EC + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B1BC + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B300 + .4byte _0819B35C +_0819B188: + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _0819B1A2 + ldr r2, =0x00000299 + adds r0, r1, r2 + movs r7, 0xA8 + lsls r7, 2 + adds r1, r7 + movs r2, 0 + bl sub_819F2B4 +_0819B1A2: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x9 + b _0819B36C + .pool +_0819B1BC: + ldr r4, =gUnknown_0300127C + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819B1CE + b _0819B36E +_0819B1CE: + bl sub_819B844 + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x6] + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + b _0819B344 + .pool +_0819B1EC: + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r7, 0x1 + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0819B27C + movs r0, 0x5 + bl PlaySE + bl sub_819BC04 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + bne _0819B228 + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldr r2, =0x000002a2 + adds r0, r2 + b _0819B2AC + .pool +_0819B228: + cmp r0, 0x2 + bne _0819B248 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA + strh r1, [r0, 0x8] + ldr r1, =sub_819B02C + str r1, [r0] + b _0819B36E + .pool +_0819B248: + cmp r1, 0x3 + bne _0819B260 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xB + strh r1, [r0, 0x8] + b _0819B2BA + .pool +_0819B260: + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x6 + strh r1, [r0, 0x8] + ldr r1, =sub_819AE08 + str r1, [r0] + b _0819B36E + .pool +_0819B27C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819B2D0 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0300127C + ldr r1, [r4] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r2, 0x8 + adds r1, r2 + movs r2, 0 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819B958 + ldr r0, [r4] + ldr r1, =0x000002a2 + adds r0, r1 +_0819B2AC: + strb r7, [r0] + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x8] +_0819B2BA: + ldr r1, =sub_819B378 + str r1, [r0] + b _0819B36E + .pool +_0819B2D0: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819B2EA + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + bl sub_819AC10 + b _0819B36E +_0819B2EA: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819B36E + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + bl sub_819AC10 + b _0819B36E +_0819B300: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _0819B36E + ldr r4, =gUnknown_0300127C + ldr r2, [r4] + ldrb r0, [r2, 0x6] + cmp r0, 0x1 + bne _0819B338 + ldr r1, =gPlttBufferFaded + movs r7, 0xA9 + lsls r7, 2 + adds r0, r2, r7 + ldrh r0, [r0] + movs r2, 0xE4 + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + ldr r0, =gPlttBufferUnfaded + subs r7, 0xBC + adds r1, r0, r7 + ldrh r1, [r1] + adds r0, r2 + strh r1, [r0] +_0819B338: + ldr r0, [r4] + strb r3, [r0, 0x6] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r6 +_0819B344: + movs r1, 0x3 + strh r1, [r0, 0x8] + b _0819B36E + .pool +_0819B35C: + bl sub_819B844 + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0xC +_0819B36C: + strh r0, [r1, 0x8] +_0819B36E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B124 + + thumb_func_start sub_819B378 +sub_819B378: @ 819B378 + push {r4-r7,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r5, =gUnknown_0300127C + ldr r3, [r5] + movs r7, 0xA8 + lsls r7, 2 + adds r0, r3, r7 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B476 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0819B3DC + cmp r1, 0x1 + bgt _0819B3B4 + cmp r1, 0 + beq _0819B3BA + b _0819B476 + .pool +_0819B3B4: + cmp r1, 0xB + beq _0819B440 + b _0819B476 +_0819B3BA: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0819B476 + movs r0, 0x1 + movs r1, 0x1 + strh r1, [r4, 0x8] + ldr r2, =0x000002a2 + adds r1, r3, r2 + strb r0, [r1] + b _0819B476 + .pool +_0819B3DC: + ldr r2, =gMain + ldrh r0, [r2, 0x2E] + ands r1, r0 + cmp r1, 0 + beq _0819B40C + movs r0, 0x5 + bl PlaySE + ldr r0, [r5] + ldr r1, =0x000002a2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + movs r0, 0x2 + strh r0, [r4, 0x8] + ldr r0, =sub_819B124 + str r0, [r4] + b _0819B476 + .pool +_0819B40C: + ldrh r1, [r2, 0x30] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819B422 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _0819B432 +_0819B422: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0819B476 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_0819B432: + bl sub_819ABA8 + bl sub_819BCF8 + bl sub_819B9E8 + b _0819B476 +_0819B440: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0819B476 + movs r0, 0x5 + bl PlaySE + ldr r1, [r5] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r1, r7 + movs r2, 0 + bl sub_819F3F8 + bl sub_819BA64 + ldr r0, [r5] + ldr r1, =0x000002a2 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + strh r6, [r4, 0x8] +_0819B476: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B378 + + thumb_func_start sub_819B484 +sub_819B484: @ 819B484 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + movs r6, 0 + add r0, sp, 0xC + strb r6, [r0] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r7, =gSaveBlock2Ptr + ldr r2, [r7] + ldr r0, =0x00000ca9 + adds r4, r2, r0 + ldrb r0, [r4] + lsls r0, 30 + lsrs r0, 30 + adds r5, r0, 0 + lsls r0, r5, 1 + lsls r1, r6, 2 + adds r0, r1 + ldr r1, =0x00000de2 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + ldrb r1, [r4] + movs r0, 0x3 + ands r0, r1 + movs r2, 0x32 + str r2, [sp, 0x14] + cmp r0, 0 + beq _0819B4EA + movs r3, 0x64 + str r3, [sp, 0x14] +_0819B4EA: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_81A6F70 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + ldr r1, [r7] + ldrb r0, [r1, 0xA] + mov r9, r0 + ldrb r0, [r1, 0xB] + lsls r0, 8 + mov r2, r9 + orrs r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r2, r0 + mov r9, r2 + movs r3, 0 + mov r8, r3 +_0819B518: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 2 + adds r1, r0 + movs r3, 0xE7 + lsls r3, 4 + adds r1, r3 + ldrh r5, [r1] + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldr r2, [sp, 0x10] + add r2, r8 + movs r3, 0x6C + adds r0, r2, 0 + muls r0, r3 + adds r1, r0 + strh r5, [r1, 0xC] + mov r10, r2 + ldr r0, [sp, 0x1C] + cmp r8, r0 + bcs _0819B570 + ldr r0, [sp, 0x18] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _0819B572 + .pool +_0819B570: + ldr r0, [sp, 0x18] +_0819B572: + movs r1, 0 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0x6C + mov r4, r10 + muls r4, r1 + adds r4, 0xC + ldr r2, =gUnknown_0300127C + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r1, =gUnknown_0203BC8C + ldr r2, [r1] + lsls r5, 4 + adds r2, r5, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + str r6, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + ldr r2, [sp, 0x14] + bl sub_8068634 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] + movs r6, 0 + adds r7, r5, 0 + movs r3, 0x1 + add r8, r3 + ldr r3, =gUnknown_0300127C +_0819B5B8: + ldr r0, [r3] + adds r0, r4 + adds r0, 0x8 + ldr r5, =gUnknown_0203BC8C + ldr r1, [r5] + adds r1, r7, r1 + lsls r2, r6, 1 + adds r1, 0x2 + adds r1, r2 + ldrh r1, [r1] + adds r2, r6, 0 + str r3, [sp, 0x20] + bl sub_81A7024 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x20] + cmp r6, 0x3 + bls _0819B5B8 + movs r0, 0x6C + mov r4, r10 + muls r4, r0 + adds r4, 0xC + ldr r1, =gUnknown_0300127C + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + movs r1, 0x20 + add r2, sp, 0xC + bl SetMonData + ldr r2, =gUnknown_0300127C + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r1, [r5] + adds r1, r7, r1 + ldrb r2, [r1, 0xA] + lsls r2, 1 + ldr r1, =gBattleFrontierHeldItems + adds r2, r1 + movs r1, 0xC + bl SetMonData + mov r3, r8 + lsls r0, r3, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x5 + bhi _0819B620 + b _0819B518 +_0819B620: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B484 + + thumb_func_start sub_819B63C +sub_819B63C: @ 819B63C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + add r0, sp, 0xC + movs r1, 0 + strb r1, [r0] + ldr r2, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons + str r0, [r2] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldrb r3, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r3, r0 + mov r10, r3 + movs r7, 0 + mov r9, r7 +_0819B678: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r2, r9 + lsls r0, r2, 1 + add r0, r9 + lsls r0, 2 + adds r1, r0 + movs r3, 0xE7 + lsls r3, 4 + adds r1, r3 + ldrh r1, [r1] + mov r8, r1 + ldr r7, =gUnknown_0300127C + ldr r0, [r7] + ldr r6, [sp, 0x10] + add r6, r9 + movs r1, 0x6C + adds r4, r6, 0 + muls r4, r1 + adds r1, r0, r4 + mov r2, r8 + strh r2, [r1, 0xC] + adds r4, 0xC + adds r0, r4 + adds r0, 0x8 + ldr r3, =gUnknown_0203BC8C + ldr r2, [r3] + mov r7, r8 + lsls r5, r7, 4 + adds r2, r5, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + movs r7, 0 + str r7, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r10 + str r2, [sp, 0x8] + movs r2, 0x1E + bl sub_8068634 + add r0, sp, 0xC + movs r3, 0 + strb r3, [r0] + movs r0, 0x1 + add r9, r0 +_0819B6D4: + ldr r1, =gUnknown_0300127C + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + ldr r3, =gUnknown_0203BC8C + ldr r2, [r3] + mov r3, r8 + lsls r1, r3, 4 + adds r1, r2 + lsls r2, r7, 1 + adds r1, 0x2 + adds r1, r2 + ldrh r1, [r1] + adds r2, r7, 0 + bl sub_81A7024 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _0819B6D4 + movs r7, 0x6C + adds r4, r6, 0 + muls r4, r7 + adds r4, 0xC + ldr r1, =gUnknown_0300127C + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + movs r1, 0x20 + add r2, sp, 0xC + bl SetMonData + ldr r2, =gUnknown_0300127C + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r3, =gUnknown_0203BC8C + ldr r1, [r3] + adds r1, r5, r1 + ldrb r2, [r1, 0xA] + lsls r2, 1 + ldr r1, =gBattleFrontierHeldItems + adds r2, r1 + movs r1, 0xC + bl SetMonData + mov r7, r9 + lsls r0, r7, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0x5 + bls _0819B678 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B63C + + thumb_func_start sub_819B764 +sub_819B764: @ 819B764 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r7, 0 + ldr r0, =gUnknown_0300127C + mov r10, r0 + ldr r1, =gSaveBlock2Ptr + mov r8, r1 +_0819B778: + movs r2, 0 + adds r0, r7, 0x1 + mov r9, r0 +_0819B77E: + mov r1, r10 + ldr r0, [r1] + movs r1, 0x6C + adds r6, r2, 0 + muls r6, r1 + adds r1, r0, r6 + ldrb r0, [r1, 0x10] + cmp r0, r9 + bne _0819B81C + movs r0, 0x64 + adds r5, r7, 0 + muls r5, r0 + ldr r2, =gPlayerParty + adds r5, r2 + adds r1, 0x14 + adds r0, r5, 0 + movs r2, 0x64 + bl memcpy + mov r0, r8 + ldr r1, [r0] + lsls r4, r7, 1 + adds r4, r7 + lsls r4, 2 + adds r1, r4 + mov r2, r10 + ldr r0, [r2] + adds r0, r6 + ldrh r0, [r0, 0xC] + movs r2, 0xE7 + lsls r2, 4 + adds r1, r2 + strh r0, [r1] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r2, r8 + ldr r1, [r2] + ldr r2, =0x00000e74 + adds r1, r2 + adds r1, r4 + str r0, [r1] + adds r0, r5, 0 + movs r1, 0x2E + movs r2, 0 + bl GetBoxMonData + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, =0x00000e79 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0 + bl GetBoxMonData + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, =0x00000e78 + adds r1, r2 + strb r0, [r1] + b _0819B826 + .pool +_0819B81C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819B77E +_0819B826: + mov r1, r9 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _0819B778 + bl CalculatePlayerPartyCount + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819B764 + + thumb_func_start sub_819B844 +sub_819B844: @ 819B844 + push {r4,r5,lr} + ldr r5, =gUnknown_0300127C + ldr r1, [r5] + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _0819B852 + strb r0, [r1] +_0819B852: + ldr r4, =gSprites + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + bl sub_819BAFC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B844 + + thumb_func_start sub_819B8D4 +sub_819B8D4: @ 819B8D4 + push {r4,r5,lr} + ldr r5, =gUnknown_0300127C + ldr r1, [r5] + movs r0, 0 + strb r0, [r1, 0x7] + ldr r4, =gSprites + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r3, 0x70 + strh r3, [r0, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r3, [r0, 0x22] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + bl sub_819BBA8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B8D4 + + thumb_func_start sub_819B958 +sub_819B958: @ 819B958 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =gSprites + ldr r3, =gUnknown_0300127C + ldr r0, [r3] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r3] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + bl ClearWindowTilemap + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B958 + + thumb_func_start sub_819B9B4 +sub_819B9B4: @ 819B9B4 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EEBB2 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x2 + bl PrintTextOnWindow + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B9B4 + + thumb_func_start sub_819B9E8 +sub_819B9E8: @ 819B9E8 + push {r4,r5,lr} + sub sp, 0xC + ldr r5, =gUnknown_0300127C + ldr r0, [r5] + ldrb r4, [r0, 0x3] + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x6C + muls r0, r4 + ldr r1, [r5] + adds r0, r1 + adds r0, 0x14 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gStringVar4 + movs r1, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08610479 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B9E8 + + thumb_func_start sub_819BA64 +sub_819BA64: @ 819BA64 + push {lr} + sub sp, 0xC + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0x1 + bne _0819BA88 + ldr r2, =gUnknown_085EEBC1 + b _0819BA9C + .pool +_0819BA88: + cmp r0, 0x2 + bne _0819BA94 + ldr r2, =gUnknown_085EEBDB + b _0819BA9C + .pool +_0819BA94: + ldr r2, =gUnknown_085EEC2D + cmp r0, 0x3 + bne _0819BA9C + ldr r2, =gUnknown_085EEBF6 +_0819BA9C: + movs r0, 0x5 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x2 + bl PrintTextOnWindow + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BA64 + + thumb_func_start sub_819BAC8 +sub_819BAC8: @ 819BAC8 + push {lr} + sub sp, 0xC + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EEC50 + movs r0, 0x5 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x2 + bl PrintTextOnWindow + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BAC8 + + thumb_func_start sub_819BAFC +sub_819BAFC: @ 819BAFC + push {r4-r6,lr} + sub sp, 0xC + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r2, [r0, 0x3] + movs r1, 0x6C + muls r1, r2 + adds r0, r1 + ldrb r5, [r0, 0x10] + movs r0, 0x3 + bl PutWindowTilemap + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r4, =gUnknown_08610476 + str r4, [sp] + movs r6, 0 + str r6, [sp, 0x4] + ldr r0, =gUnknown_085EEC15 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl box_print + cmp r5, 0 + beq _0819BB60 + str r4, [sp] + str r6, [sp, 0x4] + ldr r0, =gUnknown_085EEC24 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print + b _0819BB74 + .pool +_0819BB60: + str r4, [sp] + str r5, [sp, 0x4] + ldr r0, =gUnknown_085EEC10 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print +_0819BB74: + ldr r0, =gUnknown_08610476 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085EEC1D + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x21 + bl box_print + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BAFC + + thumb_func_start sub_819BBA8 +sub_819BBA8: @ 819BBA8 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x4 + bl PutWindowTilemap + movs r0, 0x4 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_08610476 + str r5, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EEC49 + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EEC4D + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print + movs r0, 0x4 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BBA8 + + thumb_func_start sub_819BC04 +sub_819BC04: @ 819BC04 + push {lr} + ldr r2, =gUnknown_030062E8 + ldr r1, =gUnknown_0861041C + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_819BC04 + + thumb_func_start sub_819BC30 +sub_819BC30: @ 819BC30 + push {r4,lr} + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r2, [r0, 0x3] + movs r1, 0x6C + muls r1, r2 + adds r0, r1 + ldrb r1, [r0, 0x10] + ldrh r0, [r0, 0xC] + cmp r1, 0 + bne _0819BC60 + bl sub_819C634 + cmp r0, 0 + bne _0819BC60 + bl sub_819BAC8 + movs r0, 0x3 + bl sub_819B958 + movs r0, 0x3 + b _0819BC96 + .pool +_0819BC60: + ldr r4, =gUnknown_0300127C + ldr r1, [r4] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r2, 0x8 + adds r1, r2 + movs r2, 0 + bl sub_819F3F8 + bl sub_819ACE0 + bl sub_819BA64 + movs r0, 0x3 + bl sub_819B958 + ldr r0, [r4] + ldrb r0, [r0, 0x5] + cmp r0, 0x3 + bhi _0819BC94 + movs r0, 0x1 + b _0819BC96 + .pool +_0819BC94: + movs r0, 0x2 +_0819BC96: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_819BC30 + + thumb_func_start sub_819BC9C +sub_819BC9C: @ 819BC9C + push {lr} + bl sub_819C568 + bl sub_819ACE0 + bl sub_819BA64 + movs r0, 0x3 + bl sub_819B958 + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0x3 + bhi _0819BCC4 + movs r0, 0x1 + b _0819BCC6 + .pool +_0819BCC4: + movs r0, 0x2 +_0819BCC6: + pop {r1} + bx r1 + thumb_func_end sub_819BC9C + + thumb_func_start sub_819BCCC +sub_819BCCC: @ 819BCCC + movs r0, 0 + bx lr + thumb_func_end sub_819BCCC + + thumb_func_start sub_819BCD0 +sub_819BCD0: @ 819BCD0 + push {lr} + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r2, 0x8 + adds r1, r2 + movs r2, 0 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819B958 + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_819BCD0 + + thumb_func_start sub_819BCF8 +sub_819BCF8: @ 819BCF8 + push {r4,r5,lr} + sub sp, 0x2C + ldr r5, =gUnknown_0300127C + ldr r0, [r5] + ldrb r4, [r0, 0x3] + cmp r4, 0x5 + bhi _0819BD64 + movs r0, 0x5 + bl PutWindowTilemap + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x6C + muls r0, r4 + ldr r1, [r5] + adds r0, r1 + adds r0, 0x14 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + add r1, sp, 0xC + bl sub_81DB468 + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x76 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x5 + movs r1, 0x1 + add r2, sp, 0xC + bl PrintTextOnWindow + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram +_0819BD64: + add sp, 0x2C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BCF8 + + thumb_func_start sub_819BD70 +sub_819BD70: @ 819BD70 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x10 + ldr r6, =gUnknown_0300127C + ldr r2, [r6] + ldrb r1, [r2, 0x3] + movs r0, 0x6C + adds r4, r1, 0 + muls r4, r0 + adds r4, r2 + adds r4, 0x14 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r5, 0 + mov r2, r8 + movs r3, 0x1 + bl sub_818D7D8 + ldr r1, [r6] + movs r2, 0xA6 + lsls r2, 2 + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r4, =gSprites + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r3, [r0] + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r3, [r0] + ldr r0, [r6] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + strb r3, [r0] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BD70 + + thumb_func_start sub_819BE20 +sub_819BE20: @ 819BE20 + ldr r1, =gUnknown_0300127C + ldr r1, [r1] + movs r2, 0xA8 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_819BE20 + + thumb_func_start sub_819BE34 +sub_819BE34: @ 819BE34 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r0, =gUnknown_08610638 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r6, =gUnknown_0300127C + ldr r1, [r6] + ldr r2, =0x00000299 + mov r10, r2 + add r1, r10 + movs r7, 0 + strb r0, [r1] + ldr r0, [r6] + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + mov r8, r1 + add r0, r8 + movs r1, 0x2 + bl StartSpriteAffineAnim + ldr r2, [r6] + ldrb r1, [r2, 0x3] + movs r0, 0x6C + adds r4, r1, 0 + muls r4, r0 + adds r4, r2 + adds r4, 0x14 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r5, 0 + mov r2, r9 + movs r3, 0x1 + bl sub_818D7D8 + ldr r1, [r6] + movs r2, 0xA6 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r6] + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BE34 + + thumb_func_start sub_819BF2C +sub_819BF2C: @ 819BF2C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r7, 0 + ldr r0, =gUnknown_0300127C + mov r9, r0 +_0819BF3E: + movs r2, 0 + adds r1, r7, 0x1 + mov r10, r1 + lsls r0, r7, 2 + mov r8, r0 +_0819BF48: + mov r0, r9 + ldr r1, [r0] + movs r0, 0x6C + adds r4, r2, 0 + muls r4, r0 + adds r0, r1, r4 + ldrb r0, [r0, 0x10] + cmp r0, r10 + bne _0819C008 + adds r4, r1 + adds r4, 0x14 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + adds r6, r0, 0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + lsls r0, r7, 3 + adds r0, r7 + lsls r0, 19 + movs r2, 0x80 + lsls r2, 13 + adds r0, r2 + asrs r0, 16 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + adds r0, r7, 0 + adds r0, 0xD + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r5, 0 + adds r2, r6, 0 + movs r3, 0x1 + bl sub_818D7D8 + mov r2, r9 + ldr r1, [r2] + add r1, r8 + movs r2, 0xA5 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + mov r1, r9 + ldr r0, [r1] + add r0, r8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r2, =gSprites + adds r0, r2 + adds r0, 0x28 + movs r1, 0 + strb r1, [r0] + mov r2, r9 + ldr r0, [r2] + add r0, r8 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r2, =gSprites + adds r0, r2 + adds r0, 0x29 + movs r1, 0 + strb r1, [r0] + b _0819C012 + .pool +_0819C008: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819BF48 +_0819C012: + mov r2, r10 + lsls r0, r2, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _0819BF3E + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BF2C + + thumb_func_start sub_819C040 +sub_819C040: @ 819C040 + push {r4-r6,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819C0DC + ldr r3, =gSprites + ldr r6, =gUnknown_0300127C + ldr r2, [r6] + ldr r0, =0x00000295 + adds r5, r2, r0 + ldrb r0, [r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + adds r1, 0x3F + ldrb r0, [r1] + lsls r0, 26 + cmp r0, 0 + bge _0819C0DC + ldr r1, =0x0000029d + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0819C0DC + adds r1, r4, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x0000029d + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, =sub_819C1D0 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + ldr r0, =SpriteCallbackDummy + str r0, [r4, 0x1C] +_0819C0DC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C040 + + thumb_func_start sub_819C100 +sub_819C100: @ 819C100 + push {r4-r7,lr} + adds r5, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819C1BA + ldr r6, =gSprites + ldr r4, =gUnknown_0300127C + ldr r2, [r4] + ldr r7, =0x00000295 + adds r0, r2, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0819C1BA + ldr r1, =0x0000029d + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0819C1BA + ldrb r0, [r5, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + ldr r0, [r4] + adds r0, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + ldr r0, [r4] + ldr r1, =0x0000029d + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + adds r0, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl DestroySprite + ldr r0, [r4] + ldr r1, =0x0000029d + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl DestroySprite + adds r0, r5, 0 + bl DestroySprite +_0819C1BA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C100 + + thumb_func_start sub_819C1D0 +sub_819C1D0: @ 819C1D0 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0819C24E + cmp r0, 0x1 + bgt _0819C1F8 + cmp r0, 0 + beq _0819C1FE + b _0819C2BA + .pool +_0819C1F8: + cmp r0, 0x2 + beq _0819C270 + b _0819C2BA +_0819C1FE: + movs r0, 0x10 + strh r0, [r4, 0xE] + movs r0, 0xE0 + strh r0, [r4, 0x38] + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + b _0819C2C6 +_0819C24E: + movs r0, 0x3 + bl ShowBg + ldr r1, =0x00001248 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _0819C2C6 + .pool +_0819C270: + ldrh r0, [r4, 0x12] + subs r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + adds r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _0819C28C + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x5F + ble _0819C29E +_0819C28C: + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits +_0819C29E: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bne _0819C2CC + b _0819C2C6 +_0819C2BA: + adds r0, r2, 0 + bl DestroyTask + bl sub_819BF2C + b _0819C2CC +_0819C2C6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819C2CC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819C1D0 + + thumb_func_start sub_819C2D4 +sub_819C2D4: @ 819C2D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0819C2F6 + b _0819C410 +_0819C2F6: + cmp r0, 0x1 + bne _0819C2FC + b _0819C460 +_0819C2FC: + movs r0, 0x3 + bl HideBg + ldr r4, =gSprites + ldr r0, =gUnknown_0300127C + mov r8, r0 + ldr r0, [r0] + ldr r1, =0x00000299 + mov r12, r1 + add r0, r12 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x5 + negs r3, r3 + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + mov r0, r8 + ldr r2, [r0] + mov r1, r12 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r6, r4, 0 + adds r6, 0x1C + adds r0, r6 + ldr r1, =sub_819C100 + str r1, [r0] + ldr r0, =0x00000295 + mov r9, r0 + add r2, r9 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + mov r1, r8 + ldr r2, [r1] + mov r1, r9 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r1, =SpriteCallbackDummy + mov r10, r1 + str r1, [r0] + ldr r5, =0x0000029d + adds r2, r5 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + mov r0, r8 + ldr r2, [r0] + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r10 + str r1, [r0] + add r2, r12 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAffineAnim + mov r1, r8 + ldr r0, [r1] + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAffineAnim + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAffineAnim + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits + adds r0, r7, 0 + bl DestroyTask + b _0819C4A4 + .pool +_0819C410: + movs r0, 0x10 + strh r0, [r4, 0xE] + movs r0, 0xE0 + strh r0, [r4, 0x38] + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + b _0819C49E +_0819C460: + ldrh r0, [r4, 0x12] + adds r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + subs r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + bgt _0819C47C + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x41 + bgt _0819C484 +_0819C47C: + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] +_0819C484: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bne _0819C4A4 +_0819C49E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819C4A4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819C2D4 + + thumb_func_start sub_819C4B4 +sub_819C4B4: @ 819C4B4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r4, =gUnknown_08610638 + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r6, =gUnknown_0300127C + ldr r1, [r6] + ldr r2, =0x00000299 + mov r8, r2 + add r1, r8 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2C + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r6] + ldr r5, =0x00000295 + adds r1, r5 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0xC4 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r6] + ldr r4, =0x0000029d + adds r1, r4 + strb r0, [r1] + ldr r3, =gSprites + ldr r2, [r6] + add r8, r2 + mov r0, r8 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r1, =sub_819C040 + str r1, [r0] + adds r5, r2, r5 + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r5, =SpriteCallbackDummy + str r5, [r0] + adds r4, r2, r4 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + str r5, [r0] + movs r0, 0xA8 + lsls r0, 2 + adds r2, r0 + movs r0, 0x1 + strb r0, [r2] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C4B4 + + thumb_func_start sub_819C568 +sub_819C568: @ 819C568 + push {r4,lr} + ldr r4, =gUnknown_0300127C + ldr r0, [r4] + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_818D820 + ldr r0, [r4] + movs r1, 0xA6 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_818D820 + ldr r0, [r4] + movs r1, 0xA7 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_818D820 + ldr r0, =sub_819C2D4 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C568 + + thumb_func_start sub_819C5D0 +sub_819C5D0: @ 819C5D0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + mov r8, r3 + lsls r4, 16 + lsrs r4, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r5, 16 + lsrs r5, 16 + mov r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + lsls r4, 24 + lsrs r4, 16 + orrs r4, r6 + movs r0, 0x40 + adds r1, r4, 0 + bl SetGpuReg + lsls r5, 24 + lsrs r5, 16 + mov r0, r8 + orrs r5, r0 + movs r0, 0x44 + adds r1, r5, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819C5D0 + + thumb_func_start sub_819C634 +sub_819C634: @ 819C634 + push {r4-r7,lr} + lsls r0, 16 + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + lsrs r0, 12 + adds r0, r1 + ldrh r6, [r0] + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r5, [r0, 0x5] + movs r3, 0x1 + cmp r3, r5 + bcs _0819C694 + adds r4, r0, 0 + movs r0, 0x6C + mov r12, r0 + adds r7, r2, 0 +_0819C656: + movs r2, 0 +_0819C658: + mov r0, r12 + muls r0, r2 + adds r1, r4, r0 + ldrb r0, [r1, 0x10] + cmp r0, r3 + bne _0819C680 + ldrh r0, [r1, 0xC] + ldr r1, [r7] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r6 + bne _0819C68A + movs r0, 0 + b _0819C696 + .pool +_0819C680: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819C658 +_0819C68A: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r5 + bcc _0819C656 +_0819C694: + movs r0, 0x1 +_0819C696: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_819C634 + + thumb_func_start sub_819C69C +sub_819C69C: @ 819C69C + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r0, 0x8 + ldrsh r2, [r5, r0] + cmp r2, 0x1 + beq _0819C6F8 + cmp r2, 0x1 + bgt _0819C6C4 + cmp r2, 0 + beq _0819C6CA + b _0819C7D8 + .pool +_0819C6C4: + cmp r2, 0x2 + beq _0819C7B4 + b _0819C7D8 +_0819C6CA: + ldr r1, =gUnknown_0300127C + ldr r0, [r1] + ldr r3, =0x000002a7 + adds r0, r3 + strb r2, [r0] + ldr r0, [r1] + adds r3, 0x1 + adds r0, r3 + strb r2, [r0] + ldr r0, [r1] + ldr r1, =0x000002a6 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + strh r1, [r5, 0x8] + b _0819C7D8 + .pool +_0819C6F8: + ldr r0, =gUnknown_0300127C + ldr r3, [r0] + ldr r2, =0x000002a2 + adds r1, r3, r2 + ldrb r1, [r1] + adds r7, r0, 0 + cmp r1, 0 + beq _0819C7D8 + ldr r1, =0x000002a9 + adds r0, r3, r1 + ldrb r4, [r0] + cmp r4, 0 + beq _0819C724 + movs r0, 0x2 + strh r0, [r5, 0x8] + b _0819C7D8 + .pool +_0819C724: + ldr r2, =0x000002a7 + adds r1, r3, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r7] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x6 + bls _0819C764 + strb r4, [r1] + ldr r1, [r7] + subs r2, 0x1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0819C758 + movs r3, 0xAA + lsls r3, 2 + adds r1, r3 + ldrb r0, [r1] + subs r0, 0x1 + b _0819C762 + .pool +_0819C758: + movs r0, 0xAA + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 +_0819C762: + strb r0, [r1] +_0819C764: + movs r0, 0x80 + lsls r0, 7 + ldr r1, [r7] + movs r4, 0xAA + lsls r4, 2 + adds r1, r4 + ldrb r1, [r1] + movs r2, 0 + bl BlendPalettes + ldr r2, [r7] + adds r4, r2, r4 + ldrb r0, [r4] + cmp r0, 0x5 + bls _0819C790 + ldr r3, =0x000002a6 + adds r1, r2, r3 + movs r0, 0 + b _0819C7D6 + .pool +_0819C790: + cmp r0, 0 + bne _0819C7D8 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x8] + ldr r0, =0x000002a6 + adds r1, r2, r0 + movs r0, 0x1 + b _0819C7D6 + .pool +_0819C7B4: + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldr r2, =0x000002a9 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xE + bls _0819C7D4 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + strh r0, [r5, 0x8] + b _0819C7D8 + .pool +_0819C7D4: + adds r0, 0x1 +_0819C7D6: + strb r0, [r1] +_0819C7D8: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819C69C + + thumb_func_start sub_819C7E0 +sub_819C7E0: @ 819C7E0 + push {lr} + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_819C7E0 + + thumb_func_start sub_819C7FC +sub_819C7FC: @ 819C7FC + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_819C7FC + + thumb_func_start sub_819C810 +sub_819C810: @ 819C810 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + ldr r4, =gPlayerParty + ldr r5, =gUnknown_03001284 + ldr r1, [r5] + ldrb r0, [r1, 0x12] + movs r6, 0x64 + muls r0, r6 + adds r0, r4 + ldr r2, =gEnemyParty + mov r9, r2 + ldrb r1, [r1, 0x13] + muls r1, r6 + add r1, r9 + movs r2, 0x64 + bl memcpy + movs r1, 0 + mov r0, sp + strb r1, [r0] + ldr r0, [r5] + ldrb r0, [r0, 0x12] + muls r0, r6 + adds r0, r4 + movs r1, 0x20 + mov r2, sp + bl SetMonData + ldr r3, =gSaveBlock2Ptr + mov r8, r3 + ldr r3, [r3] + ldr r4, [r5] + ldrb r0, [r4, 0x12] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r3, r2 + ldrb r1, [r4, 0x13] + adds r1, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3, r0 + movs r1, 0xE7 + lsls r1, 4 + adds r0, r1 + ldrh r0, [r0] + adds r2, r1 + strh r0, [r2] + ldrb r0, [r4, 0x12] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r3, r2 + ldrb r1, [r4, 0x13] + adds r1, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + ldr r0, =0x00000e78 + adds r3, r0 + ldrb r1, [r3] + adds r2, r0 + strb r1, [r2] + ldr r0, [r5] + ldrb r0, [r0, 0x13] + muls r0, r6 + add r0, r9 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r1, r8 + ldr r2, [r1] + ldr r4, [r5] + ldrb r3, [r4, 0x12] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + ldr r3, =0x00000e74 + adds r2, r3 + adds r2, r1 + str r0, [r2] + ldrb r0, [r4, 0x13] + muls r0, r6 + add r0, r9 + movs r1, 0x2E + movs r2, 0 + bl GetBoxMonData + mov r1, r8 + ldr r2, [r1] + ldr r1, [r5] + ldrb r3, [r1, 0x12] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r2, r1 + ldr r3, =0x00000e79 + adds r2, r3 + strb r0, [r2] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C810 + + thumb_func_start sub_819C90C +sub_819C90C: @ 819C90C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x7 + beq _0819C950 + cmp r0, 0x7 + bgt _0819C934 + cmp r0, 0x6 + beq _0819C93A + b _0819C9F0 + .pool +_0819C934: + cmp r0, 0x8 + beq _0819C9C4 + b _0819C9F0 +_0819C93A: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + movs r0, 0x7 + strh r0, [r6, 0x8] + b _0819C9F0 +_0819C950: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819C9F0 + ldr r4, =gUnknown_03001284 + ldr r0, [r4] + adds r0, 0x21 + ldrb r0, [r0] + bl DestroyTask + ldr r1, [r4] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + bl sub_819F444 + bl sub_819E538 + ldr r4, =gUnknown_0203CE40 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE44 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE48 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE4C + ldr r0, [r4] + bl Free + str r5, [r4] + bl FreeAllWindowBuffers + movs r0, 0x8 + strh r0, [r6, 0x8] + b _0819C9F0 + .pool +_0819C9C4: + adds r0, r2, 0 + bl DestroyTask + ldr r2, =gUnknown_03001284 + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x15] + ldr r2, [r2] + ldr r0, =gPlttBufferUnfaded + movs r1, 0xF4 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2, 0x24] + ldr r1, =gPlayerParty + ldrb r2, [r2, 0x3] + ldr r0, =sub_819DC1C + str r0, [sp] + movs r0, 0 + movs r3, 0x2 + bl sub_81BF8EC +_0819C9F0: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C90C + + thumb_func_start sub_819CA08 +sub_819CA08: @ 819CA08 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gUnknown_03001284 + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CAFE + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0819CA78 + cmp r1, 0x1 + bgt _0819CA44 + cmp r1, 0 + beq _0819CA4E + b _0819CAFE + .pool +_0819CA44: + cmp r1, 0x2 + beq _0819CA8C + cmp r1, 0x3 + beq _0819CAA4 + b _0819CAFE +_0819CA4E: + adds r0, r2, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819CA68 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, =gScriptResult + strh r1, [r0] + b _0819CAFE + .pool +_0819CA68: + movs r0, 0x2 + strh r0, [r4, 0x8] + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + b _0819CAFE + .pool +_0819CA78: + adds r0, r2, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819CA9C + ldrb r0, [r2, 0x3] + strb r0, [r2, 0x13] + bl sub_819C810 + b _0819CA9C +_0819CA8C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade +_0819CA9C: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819CAFE +_0819CAA4: + bl UpdatePaletteFade + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819CAFE + ldr r0, [r7] + adds r0, 0x21 + ldrb r0, [r0] + bl DestroyTask + bl sub_819E538 + ldr r4, =gUnknown_0203CE40 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE44 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE48 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE4C + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r0, [r7] + bl Free + str r5, [r7] + bl FreeAllWindowBuffers + ldr r0, =sub_80861B0 + bl SetMainCallback2 + adds r0, r6, 0 + bl DestroyTask +_0819CAFE: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CA08 + + thumb_func_start sub_819CB1C +sub_819CB1C: @ 819CB1C + push {r4-r7,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r7, =gUnknown_03001284 + ldr r0, [r7] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CBD6 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + beq _0819CB50 + cmp r0, 0x5 + beq _0819CB5A + b _0819CBD6 + .pool +_0819CB50: + bl sub_819E9E0 + movs r0, 0x5 + strh r0, [r4, 0x8] + b _0819CBD6 +_0819CB5A: + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r6, 0x1 + adds r5, r6, 0 + ands r5, r1 + cmp r5, 0 + beq _0819CB86 + movs r0, 0x5 + bl PlaySE + ldr r0, [r7] + ldrb r0, [r0, 0x16] + cmp r0, 0 + bne _0819CB80 + strh r6, [r4, 0xA] + b _0819CB9C + .pool +_0819CB80: + movs r0, 0 + strh r0, [r4, 0xA] + b _0819CB96 +_0819CB86: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819CBA8 + movs r0, 0x5 + bl PlaySE + strh r5, [r4, 0xA] +_0819CB96: + movs r0, 0x4 + bl sub_819EA64 +_0819CB9C: + ldrh r0, [r4, 0x14] + ldrh r1, [r4, 0x16] + lsls r0, 16 + orrs r0, r1 + str r0, [r4] + b _0819CBD6 +_0819CBA8: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819CBC2 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + bl sub_819E758 + b _0819CBD6 +_0819CBC2: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819CBD6 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + bl sub_819E758 +_0819CBD6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819CB1C + + thumb_func_start sub_819CBDC +sub_819CBDC: @ 819CBDC + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r2 + movs r1, 0xA + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819CC04 + movs r0, 0 + strh r0, [r2, 0x8] + ldr r0, =sub_819CA08 + b _0819CC16 + .pool +_0819CC04: + movs r0, 0 + strh r0, [r2, 0x8] + ldr r1, =sub_819CE40 + lsrs r0, r1, 16 + strh r0, [r2, 0x14] + strh r1, [r2, 0x16] + movs r0, 0x1 + strh r0, [r2, 0x12] + ldr r0, =sub_819D770 +_0819CC16: + str r0, [r2] + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CBDC + + thumb_func_start sub_819CC24 +sub_819CC24: @ 819CC24 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _0819CC5A + ldr r0, =gUnknown_085EECBB + bl sub_819EBEC + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x20 + strb r5, [r0] + movs r0, 0x4 + strh r0, [r4, 0x8] + ldr r1, =sub_819CBDC + lsrs r0, r1, 16 + strh r0, [r4, 0x14] + strh r1, [r4, 0x16] + ldr r0, =sub_819CB1C + str r0, [r4] +_0819CC5A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CC24 + + thumb_func_start sub_819CC74 +sub_819CC74: @ 819CC74 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0xA + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819CCB0 + movs r0, 0 + strh r0, [r2, 0x8] + ldr r0, =sub_819CA08 + b _0819CCC2 + .pool +_0819CCB0: + movs r0, 0 + strh r0, [r2, 0x8] + ldr r1, =sub_819CE40 + lsrs r0, r1, 16 + strh r0, [r2, 0x14] + strh r1, [r2, 0x16] + movs r0, 0x1 + strh r0, [r2, 0x12] + ldr r0, =sub_819D770 +_0819CCC2: + str r0, [r2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CC74 + + thumb_func_start sub_819CCD4 +sub_819CCD4: @ 819CCD4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0819CD1A + ldr r4, =gUnknown_03001284 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x2D + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F2B4 + ldr r0, =gUnknown_085EECF0 + bl sub_819EBEC + ldr r0, [r4] + adds r0, 0x20 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x4 + strh r0, [r5, 0x8] + ldr r1, =sub_819CC74 + lsrs r0, r1, 16 + strh r0, [r5, 0x14] + strh r1, [r5, 0x16] + ldr r0, =sub_819CB1C + str r0, [r5] +_0819CD1A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CCD4 + + thumb_func_start sub_819CD34 +sub_819CD34: @ 819CD34 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x3 + beq _0819CDA4 + cmp r0, 0x3 + bgt _0819CD60 + cmp r0, 0x2 + beq _0819CD66 + b _0819CE36 + .pool +_0819CD60: + cmp r0, 0x9 + beq _0819CD88 + b _0819CE36 +_0819CD66: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x15] + cmp r0, 0 + bne _0819CD7C + adds r0, r1, 0 + adds r0, 0x2D + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F2B4 +_0819CD7C: + movs r0, 0x9 + strh r0, [r5, 0x8] + b _0819CE36 + .pool +_0819CD88: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CE36 + bl sub_819E944 + movs r0, 0x3 + strh r0, [r5, 0x8] + b _0819CE36 + .pool +_0819CDA4: + ldr r7, =gUnknown_03001284 + ldr r0, [r7] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CE36 + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + mov r8, r0 + mov r4, r8 + ands r4, r1 + cmp r4, 0 + beq _0819CDD8 + movs r0, 0x5 + bl PlaySE + adds r0, r6, 0 + bl sub_819F0A0 + b _0819CE36 + .pool +_0819CDD8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819CE14 + movs r0, 0x5 + bl PlaySE + ldr r1, [r7] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819EA64 + strh r4, [r5, 0x8] + ldr r1, =sub_819CE40 + lsrs r0, r1, 16 + strh r0, [r5, 0x14] + strh r1, [r5, 0x16] + mov r1, r8 + strh r1, [r5, 0x12] + ldr r0, =sub_819D770 + str r0, [r5] + b _0819CE36 + .pool +_0819CE14: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819CE28 + movs r0, 0x1 + negs r0, r0 + bl sub_819E7C0 + b _0819CE36 +_0819CE28: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819CE36 + movs r0, 0x1 + bl sub_819E7C0 +_0819CE36: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819CD34 + + thumb_func_start sub_819CE40 +sub_819CE40: @ 819CE40 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0819CE64 + cmp r0, 0x1 + beq _0819CE88 + b _0819CF4C + .pool +_0819CE64: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0819CF4C + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + strh r1, [r4, 0x8] + b _0819CF4C + .pool +_0819CE88: + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + adds r5, r1, 0 + ands r5, r0 + cmp r5, 0 + beq _0819CEBC + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0 + strb r1, [r0] + bl sub_819EE08 + bl sub_819EAC0 + adds r0, r6, 0 + bl sub_819F184 + b _0819CF4C + .pool +_0819CEBC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819CEF8 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + strb r5, [r0] + bl sub_819EE08 + bl sub_819EAC0 + ldr r1, =sub_819CC24 + lsrs r0, r1, 16 + strh r0, [r4, 0x14] + strh r1, [r4, 0x16] + strh r5, [r4, 0x8] + strh r5, [r4, 0x12] + ldr r0, =sub_819D588 + str r0, [r4] + b _0819CF4C + .pool +_0819CEF8: + ldrh r1, [r2, 0x30] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819CF0C + movs r0, 0x1 + negs r0, r0 + bl sub_819E694 + b _0819CF2A +_0819CF0C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0819CF1C + movs r0, 0x1 + bl sub_819E694 + b _0819CF2A +_0819CF1C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819CF34 + movs r0, 0x1 + bl sub_819E6E8 +_0819CF2A: + bl sub_819EFA8 + bl sub_819EB4C + b _0819CF4C +_0819CF34: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819CF4C + movs r0, 0x1 + negs r0, r0 + bl sub_819E6E8 + bl sub_819EFA8 + bl sub_819EB4C +_0819CF4C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819CE40 + + thumb_func_start sub_819CF54 +sub_819CF54: @ 819CF54 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r2, [r4, r0] + cmp r2, 0x1 + beq _0819CFA0 + cmp r2, 0x1 + bgt _0819CF7C + cmp r2, 0 + beq _0819CF82 + b _0819D05C + .pool +_0819CF7C: + cmp r2, 0x2 + beq _0819D03C + b _0819D05C +_0819CF82: + ldr r1, =gUnknown_03001284 + ldr r0, [r1] + adds r0, 0x27 + strb r2, [r0] + ldr r0, [r1] + adds r0, 0x28 + strb r2, [r0] + ldr r0, [r1] + adds r0, 0x26 + movs r1, 0x1 + strb r1, [r0] + strh r1, [r4, 0x8] + b _0819D05C + .pool +_0819CFA0: + ldr r1, =gUnknown_03001284 + ldr r2, [r1] + adds r0, r2, 0 + adds r0, 0x22 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0 + beq _0819D05C + adds r0, r2, 0 + adds r0, 0x29 + ldrb r3, [r0] + cmp r3, 0 + beq _0819CFC4 + movs r0, 0x2 + strh r0, [r4, 0x8] + b _0819D05C + .pool +_0819CFC4: + adds r1, r2, 0 + adds r1, 0x27 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x27 + ldrb r0, [r1] + cmp r0, 0x6 + bls _0819CFF8 + strb r3, [r1] + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x26 + ldrb r0, [r0] + cmp r0, 0 + bne _0819CFF0 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + b _0819CFF6 +_0819CFF0: + adds r1, 0x28 + ldrb r0, [r1] + adds r0, 0x1 +_0819CFF6: + strb r0, [r1] +_0819CFF8: + movs r0, 0x80 + lsls r0, 7 + ldr r1, [r6] + adds r1, 0x28 + ldrb r1, [r1] + movs r2, 0 + bl BlendPalettes + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x28 + ldrb r0, [r0] + cmp r0, 0x5 + bls _0819D01C + adds r1, r2, 0 + adds r1, 0x26 + movs r0, 0 + b _0819D05A +_0819D01C: + cmp r0, 0 + bne _0819D05C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x8] + adds r1, r2, 0 + adds r1, 0x26 + movs r0, 0x1 + b _0819D05A + .pool +_0819D03C: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x29 + ldrb r0, [r1] + cmp r0, 0xE + bls _0819D058 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + strh r0, [r4, 0x8] + b _0819D05C + .pool +_0819D058: + adds r0, 0x1 +_0819D05A: + strb r0, [r1] +_0819D05C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819CF54 + + thumb_func_start sub_819D064 +sub_819D064: @ 819D064 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0819D0A4 + cmp r1, 0x1 + bgt _0819D08C + cmp r1, 0 + beq _0819D092 + b _0819D118 + .pool +_0819D08C: + cmp r1, 0x2 + beq _0819D0BC + b _0819D118 +_0819D092: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x27 + strb r1, [r0] + strh r1, [r4, 0x10] + b _0819D0AE + .pool +_0819D0A4: + ldr r0, =gPlttBufferUnfaded+ 0x1E0 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette +_0819D0AE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819D118 + .pool +_0819D0BC: + ldr r2, =gUnknown_03001284 + ldr r0, [r2] + adds r0, 0x28 + ldrb r0, [r0] + cmp r0, 0xF + bls _0819D0D2 + movs r0, 0x1 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819D0D2: + ldr r1, [r2] + adds r1, 0x27 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0x27 + ldrb r0, [r1] + cmp r0, 0x3 + bls _0819D108 + movs r0, 0 + strb r0, [r1] + ldr r1, =gPlttBufferUnfaded + ldr r0, =gPlttBufferFaded + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 + ldrh r0, [r0] + adds r3, 0x20 + adds r1, r3 + strh r0, [r1] + ldr r1, [r2] + adds r1, 0x28 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0819D108: + movs r0, 0x80 + lsls r0, 7 + ldr r1, [r2] + adds r1, 0x28 + ldrb r1, [r1] + movs r2, 0 + bl BlendPalettes +_0819D118: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D064 + + thumb_func_start sub_819D12C +sub_819D12C: @ 819D12C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + ldr r1, =gTasks + lsls r0, 2 + ldr r2, [sp] + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r2, 0x8 + ldrsh r3, [r4, r2] + cmp r3, 0 + beq _0819D15C + cmp r3, 0x1 + beq _0819D168 + b _0819D310 + .pool +_0819D15C: + strh r3, [r4, 0xA] + strh r3, [r4, 0xC] + strh r3, [r4, 0xE] + movs r0, 0x1 + strh r0, [r4, 0x8] + b _0819D310 +_0819D168: + movs r3, 0 + str r3, [sp, 0x4] + movs r1, 0x2 + str r0, [sp, 0x8] + ldr r0, =gTasks + str r0, [sp, 0xC] +_0819D174: + lsls r0, r1, 24 + asrs r4, r0, 24 + mov r9, r0 + cmp r4, 0x2 + beq _0819D1F2 + ldr r2, =gSprites + ldr r3, =gUnknown_03001284 + ldr r0, [r3] + adds r0, 0x5 + mov r8, r0 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r6, r0, r2 + ldrh r1, [r6, 0x20] + mov r12, r1 + mov r7, r12 + ldr r1, [sp, 0x4] + subs r0, r1, r7 + lsls r0, 24 + lsrs r5, r0, 24 + mov r10, r2 + cmp r5, 0x10 + beq _0819D1BE + adds r0, r4, 0x2 + lsls r0, 1 + ldr r2, [sp, 0x8] + adds r0, r2 + ldr r1, =gTasks + adds r1, 0x8 + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _0819D1D8 +_0819D1BE: + lsls r0, r7, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + mov r0, r12 + adds r0, 0xA + strh r0, [r6, 0x20] + b _0819D210 + .pool +_0819D1D8: + cmp r5, 0x10 + bls _0819D210 + adds r0, r4, 0x1 + add r0, r8 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r0, [r0, 0x20] + subs r0, 0x30 + strh r0, [r6, 0x20] + b _0819D210 +_0819D1F2: + ldr r3, =gSprites + ldr r4, =gUnknown_03001284 + ldr r0, [r4] + ldrb r1, [r0, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r2, [r0, 0x20] + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + adds r2, 0xA + strh r2, [r0, 0x20] + mov r10, r3 +_0819D210: + mov r0, r9 + asrs r2, r0, 24 + adds r0, r2, 0x1 + lsls r0, 1 + ldr r1, [sp, 0x8] + adds r0, r1 + ldr r1, =gTasks + adds r1, 0x8 + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _0819D26A + ldr r1, =gUnknown_03001284 + ldr r0, [r1] + adds r0, 0x5 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r3, r10 + adds r1, r0, r3 + movs r0, 0x20 + ldrsh r3, [r1, r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r0, 0x48 + cmp r3, r0 + ble _0819D260 + strh r0, [r1, 0x20] + movs r7, 0x1 + b _0819D26C + .pool +_0819D260: + movs r7, 0 + cmp r3, r0 + bne _0819D26C + movs r7, 0x1 + b _0819D26C +_0819D26A: + movs r7, 0 +_0819D26C: + mov r6, r10 + ldr r5, =gUnknown_03001284 + ldr r2, [r5] + mov r1, r9 + asrs r4, r1, 24 + adds r0, r2, 0x5 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + movs r3, 0x20 + ldrsh r0, [r1, r3] + subs r0, 0x10 + cmp r0, 0xF0 + ble _0819D2F8 + ldrh r0, [r1, 0x20] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldr r0, =0x0000fff0 + strh r0, [r1, 0x20] + ldrb r0, [r2, 0x14] + cmp r0, 0x1 + bne _0819D2C0 + movs r0, 0x65 + bl IndexOfSpritePaletteTag + ldr r1, [r5] + adds r1, 0x5 + adds r1, r4 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r6 + b _0819D2D8 + .pool +_0819D2C0: + movs r0, 0x64 + bl IndexOfSpritePaletteTag + ldr r2, =gUnknown_03001284 + ldr r1, [r2] + adds r1, 0x5 + adds r1, r4 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r10 +_0819D2D8: + lsls r0, 4 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x5] + mov r3, r9 + asrs r0, r3, 23 + adds r0, 0x2 + ldr r1, [sp, 0x8] + adds r0, r1 + ldr r2, [sp, 0xC] + adds r2, 0x8 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0] +_0819D2F8: + movs r0, 0xFF + lsls r0, 24 + add r0, r9 + lsrs r1, r0, 24 + cmp r0, 0 + blt _0819D306 + b _0819D174 +_0819D306: + cmp r7, 0x1 + bne _0819D310 + ldr r0, [sp] + bl DestroyTask +_0819D310: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D12C + + thumb_func_start sub_819D324 +sub_819D324: @ 819D324 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + mov r8, r0 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r2, r0, r1 + ldrb r4, [r2, 0xE] + movs r0, 0xC + ldrsh r5, [r2, r0] + mov r10, r1 + cmp r5, 0x1 + bne _0819D352 + lsls r0, r4, 24 + negs r0, r0 + lsrs r4, r0, 24 +_0819D352: + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0819D368 + cmp r0, 0x1 + bne _0819D360 + b _0819D480 +_0819D360: + b _0819D570 + .pool +_0819D368: + ldr r3, =gSprites + ldr r2, =gUnknown_03001284 + ldr r0, [r2] + ldrb r1, [r0, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x20] + cmp r5, 0 + bne _0819D39C + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xEF + ble _0819D3B2 + movs r1, 0 + movs r0, 0xF0 + b _0819D3B0 + .pool +_0819D39C: + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xA0 + bgt _0819D3B2 + movs r1, 0 + movs r0, 0xA0 +_0819D3B0: + mov r8, r0 +_0819D3B2: + cmp r1, 0x1 + bne _0819D3FC + movs r3, 0 + ldr r7, =gSprites + ldr r6, =gUnknown_03001284 + asrs r5, r2, 24 +_0819D3BE: + movs r4, 0 + adds r2, r3, 0x1 +_0819D3C2: + ldr r1, [r6] + lsls r0, r4, 1 + adds r0, r4 + adds r0, r3, r0 + adds r1, 0x8 + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, r5 + strh r1, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D3C2 + lsls r0, r2, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _0819D3BE + b _0819D570 + .pool +_0819D3FC: + movs r4, 0 + lsls r1, r7, 2 + mov r12, r1 + mov r6, r8 + adds r6, 0x10 + movs r0, 0x30 + add r0, r8 + mov r9, r0 + ldr r5, =gSprites +_0819D40E: + ldr r1, =gUnknown_03001284 + ldr r2, [r1] + lsls r3, r4, 1 + adds r3, r4 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x20] + adds r0, r2, 0 + adds r0, 0x9 + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x20] + adds r2, 0xA + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r9 + strh r1, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D40E + mov r1, r12 + adds r0, r1, r7 + lsls r0, 3 + add r0, r10 + ldrb r1, [r0, 0xA] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + add r0, r10 + movs r1, 0x1 + strh r1, [r0, 0xE] + adds r0, r7, 0 + bl DestroyTask + b _0819D570 + .pool +_0819D480: + ldr r2, =gSprites + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r1, [r0, 0xE] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x20] + cmp r5, 0 + bne _0819D4B4 + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xEF + ble _0819D4CA + movs r1, 0 + movs r0, 0xF0 + b _0819D4C8 + .pool +_0819D4B4: + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xC0 + bgt _0819D4CA + movs r1, 0 + movs r0, 0xC0 +_0819D4C8: + mov r8, r0 +_0819D4CA: + cmp r1, 0x1 + bne _0819D510 + movs r3, 0 + ldr r7, =gSprites + ldr r6, =gUnknown_03001284 + asrs r5, r2, 24 +_0819D4D6: + movs r4, 0 + adds r2, r3, 0x1 +_0819D4DA: + ldr r0, [r6] + lsls r1, r4, 1 + adds r1, r3, r1 + adds r0, 0xE + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, r5 + strh r1, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D4DA + lsls r0, r2, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bls _0819D4D6 + b _0819D570 + .pool +_0819D510: + movs r4, 0 + lsls r1, r7, 2 + mov r12, r1 + mov r6, r8 + adds r6, 0x10 + ldr r5, =gSprites + ldr r0, =gUnknown_03001284 + mov r9, r0 +_0819D520: + mov r1, r9 + ldr r2, [r1] + lsls r3, r4, 1 + adds r0, r2, 0 + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x20] + adds r2, 0xF + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D520 + mov r1, r12 + adds r0, r1, r7 + lsls r0, 3 + add r0, r10 + ldrb r1, [r0, 0xA] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + add r0, r10 + movs r1, 0x1 + strh r1, [r0, 0x10] + adds r0, r7, 0 + bl DestroyTask +_0819D570: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D324 + + thumb_func_start sub_819D588 +sub_819D588: @ 819D588 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + mov r8, r1 + cmp r0, 0x5 + bls _0819D5AA + b _0819D762 +_0819D5AA: + lsls r0, 2 + ldr r1, =_0819D5BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819D5BC: + .4byte _0819D5D4 + .4byte _0819D5F0 + .4byte _0819D60C + .4byte _0819D63C + .4byte _0819D6F0 + .4byte _0819D73A +_0819D5D4: + ldr r0, =gUnknown_08610918 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette + bl sub_819ED34 + movs r0, 0x5 + bl PutWindowTilemap + b _0819D622 + .pool +_0819D5F0: + movs r0, 0x3 + bl sub_819EA64 + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819D762 + .pool +_0819D60C: + movs r0, 0x80 + lsls r0, 7 + ldr r1, =gUnknown_0860F13C + adds r1, 0x4A + ldrh r1, [r1] + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade +_0819D622: + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _0819D762 + .pool +_0819D63C: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _0819D64E + b _0819D762 +_0819D64E: + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0x1 + bne _0819D6B0 + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r1 + strh r6, [r2, 0xE] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xA] + strh r6, [r0, 0x8] + strh r6, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + movs r0, 0x5 + strh r0, [r2, 0xC] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0819D762 + .pool +_0819D6B0: + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, =gTasks + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r3 + movs r1, 0x1 + strh r1, [r2, 0xE] + strh r6, [r2, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + strh r5, [r0, 0xA] + strh r1, [r0, 0x8] + strh r6, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r2, 0x8] + adds r0, 0x2 + strh r0, [r2, 0x8] + b _0819D762 + .pool +_0819D6F0: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r1, r8 + adds r6, r0, r1 + ldrh r0, [r6, 0xC] + movs r2, 0xC + ldrsh r7, [r6, r2] + cmp r7, 0 + bne _0819D734 + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + strh r7, [r6, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + strh r5, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0x8] + strh r7, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _0819D762 + .pool +_0819D734: + subs r0, 0x1 + strh r0, [r6, 0xC] + b _0819D762 +_0819D73A: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r1, r8 + adds r2, r0, r1 + movs r1, 0xE + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819D762 + movs r1, 0x10 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819D762 + ldrh r0, [r2, 0x12] + strh r0, [r2, 0x8] + ldrh r0, [r2, 0x14] + ldrh r1, [r2, 0x16] + lsls r0, 16 + orrs r0, r1 + str r0, [r2] +_0819D762: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819D588 + + thumb_func_start sub_819D770 +sub_819D770: @ 819D770 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gUnknown_03001284 + ldr r0, [r1] + adds r0, 0x30 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x1 + bne _0819D78C + b _0819D9D8 +_0819D78C: + ldr r0, =gTasks + lsls r2, r6, 2 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + movs r4, 0x8 + ldrsh r1, [r1, r4] + mov r8, r0 + adds r5, r2, 0 + cmp r1, 0x8 + bls _0819D7A4 + b _0819D9D8 +_0819D7A4: + lsls r0, r1, 2 + ldr r1, =_0819D7BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819D7BC: + .4byte _0819D7E0 + .4byte _0819D868 + .4byte _0819D8AE + .4byte _0819D8F4 + .4byte _0819D910 + .4byte _0819D928 + .4byte _0819D936 + .4byte _0819D948 + .4byte _0819D9B0 +_0819D7E0: + ldr r0, [r3] + ldrb r7, [r0, 0x14] + cmp r7, 0x1 + bne _0819D828 + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, =gTasks + adds r2, r5, r6 + lsls r2, 3 + adds r2, r3 + movs r1, 0 + strh r1, [r2, 0xE] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + strh r6, [r0, 0xA] + strh r1, [r0, 0x8] + strh r7, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + movs r0, 0xA + strh r0, [r2, 0xC] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0819D9D8 + .pool +_0819D828: + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, =gTasks + adds r2, r5, r6 + lsls r2, 3 + adds r2, r3 + movs r0, 0 + movs r1, 0x1 + strh r1, [r2, 0xE] + strh r0, [r2, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + strh r6, [r0, 0xA] + strh r1, [r0, 0x8] + strh r1, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r2, 0x8] + adds r0, 0x2 + strh r0, [r2, 0x8] + b _0819D9D8 + .pool +_0819D868: + adds r0, r5, r6 + lsls r0, 3 + mov r1, r8 + adds r5, r0, r1 + ldrh r0, [r5, 0xC] + movs r2, 0xC + ldrsh r7, [r5, r2] + cmp r7, 0 + bne _0819D8A8 + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + strh r7, [r5, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + strh r6, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0x8] + strh r1, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0819D9D8 + .pool +_0819D8A8: + subs r0, 0x1 + strh r0, [r5, 0xC] + b _0819D9D8 +_0819D8AE: + adds r0, r5, r6 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0x1 + beq _0819D8C0 + b _0819D9D8 +_0819D8C0: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0819D8CA + b _0819D9D8 +_0819D8CA: + ldr r1, =gPlttBufferFaded + ldr r0, =gUnknown_0860F13C + adds r0, 0x4A + ldrh r0, [r0] + movs r2, 0xE2 + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + bl sub_819ED34 + movs r0, 0x5 + bl PutWindowTilemap + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819D9D8 + .pool +_0819D8F4: + movs r0, 0x80 + lsls r0, 7 + ldr r1, =gUnknown_0860F13C + adds r1, 0x4A + ldrh r1, [r1] + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + b _0819D990 + .pool +_0819D910: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0819D9D8 + movs r0, 0 + bl sub_819EDBC + b _0819D990 + .pool +_0819D928: + movs r0, 0x1 + bl sub_819EDBC + movs r0, 0x3 + bl PutWindowTilemap + b _0819D990 +_0819D936: + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + b _0819D990 +_0819D948: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _0819D964 + ldr r0, =gUnknown_085EEC73 + bl sub_819EBEC + b _0819D96A + .pool +_0819D964: + ldr r0, =gUnknown_085EEC8B + bl sub_819EBEC +_0819D96A: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bhi _0819D98C + ldr r2, =gSprites + ldrb r1, [r1, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] +_0819D98C: + bl sub_819EFA8 +_0819D990: + ldr r0, =gTasks + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819D9D8 + .pool +_0819D9B0: + bl sub_819EEF0 + bl sub_819EADC + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + ldr r1, =gTasks + adds r0, r5, r6 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x12] + strh r1, [r0, 0x8] + ldrh r1, [r0, 0x14] + ldrh r2, [r0, 0x16] + lsls r1, 16 + orrs r1, r2 + str r1, [r0] +_0819D9D8: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D770 + + thumb_func_start sub_819D9EC +sub_819D9EC: @ 819D9EC + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819DA00 + b _0819DBCA +_0819DA00: + ldr r0, =gTasks + lsls r2, r6, 2 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + movs r3, 0x8 + ldrsh r1, [r1, r3] + adds r3, r0, 0 + adds r7, r2, 0 + cmp r1, 0x4 + bls _0819DA18 + b _0819DBCA +_0819DA18: + lsls r0, r1, 2 + ldr r1, =_0819DA30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819DA30: + .4byte _0819DA44 + .4byte _0819DA58 + .4byte _0819DA8C + .4byte _0819DABC + .4byte _0819DBB0 +_0819DA44: + bl sub_819EEF0 + ldr r0, =gTasks + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + b _0819DB96 + .pool +_0819DA58: + bl sub_819EADC + ldr r2, =gSprites + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, =gTasks + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + b _0819DB96 + .pool +_0819DA8C: + ldr r0, =sub_819D12C + movs r1, 0 + bl CreateTask + ldr r2, =gTasks + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_819D064 + str r1, [r0] + b _0819DB90 + .pool +_0819DABC: + ldr r0, =sub_819D12C + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _0819DACA + b _0819DBCA +_0819DACA: + ldr r2, =gTasks + ldr r4, =gUnknown_03001284 + ldr r0, [r4] + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x10 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _0819DBCA + bl sub_819EAC0 + ldr r0, [r4] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _0819DB04 + movs r0, 0x1 + bl sub_819F048 + b _0819DB32 + .pool +_0819DB04: + movs r0, 0 + bl sub_819F048 + movs r2, 0 + ldr r5, =gSprites + movs r3, 0x4 +_0819DB10: + ldr r0, [r4] + adds r0, 0xB + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _0819DB10 +_0819DB32: + ldr r5, =gSprites + ldr r4, =gUnknown_03001284 + ldr r3, [r4] + ldrb r0, [r3, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r0, r3, 0x5 + ldrb r2, [r3, 0x3] + adds r0, r2 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x20] + movs r5, 0 + strh r0, [r1, 0x20] + ldr r2, =gTasks + adds r0, r3, 0 + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_819CF54 + str r1, [r0] + adds r3, 0x27 + strb r5, [r3] + ldr r0, [r4] + adds r0, 0x28 + movs r1, 0x6 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x26 + strb r5, [r0] + ldr r0, [r4] + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x8] +_0819DB90: + adds r1, r7, r6 + lsls r1, 3 + adds r1, r2 +_0819DB96: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819DBCA + .pool +_0819DBB0: + adds r0, r7, r6 + lsls r0, 3 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r2, =sub_819CE40 + lsrs r1, r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x12] + ldr r1, =sub_819D770 + str r1, [r0] +_0819DBCA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D9EC + + thumb_func_start sub_819DBD8 +sub_819DBD8: @ 819DBD8 + push {r4,r5,lr} + ldr r5, =gUnknown_03001284 + ldr r4, [r5] + cmp r4, 0 + bne _0819DBF6 + movs r0, 0x34 + bl AllocZeroed + str r0, [r5] + strb r4, [r0, 0x3] + ldr r0, [r5] + adds r0, 0x30 + strb r4, [r0] + ldr r0, [r5] + strb r4, [r0, 0x15] +_0819DBF6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819DBD8 + + thumb_func_start sub_819DC00 +sub_819DC00: @ 819DC00 + push {lr} + ldr r0, =gUnknown_03001284 + movs r1, 0 + str r1, [r0] + ldr r0, =sub_819DC1C + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_819DC00 + + thumb_func_start sub_819DC1C +sub_819DC1C: @ 819DC1C + push {r4-r6,lr} + sub sp, 0xC + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xF + bls _0819DC32 + b _0819E0AA +_0819DC32: + lsls r0, 2 + ldr r1, =_0819DC44 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819DC44: + .4byte _0819DC84 + .4byte _0819DCD4 + .4byte _0819DDA8 + .4byte _0819DE68 + .4byte _0819DE94 + .4byte _0819DECC + .4byte _0819DEEC + .4byte _0819DF10 + .4byte _0819DF30 + .4byte _0819DF3C + .4byte _0819DF64 + .4byte _0819DF70 + .4byte _0819DF78 + .4byte _0819DF8C + .4byte _0819DFA4 + .4byte _0819E01C +_0819DC84: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x8 + bl CpuSet + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_086108B8 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_086108C8 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DCD4: + ldr r5, =gUnknown_0203CE40 + movs r4, 0x88 + lsls r4, 3 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203CE44 + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + ldr r5, =gUnknown_0203CE48 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203CE4C + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x42 + movs r1, 0 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + b _0819E006 + .pool +_0819DDA8: + bl ResetPaletteFade + bl ResetSpriteData + bl ResetTasks + bl FreeAllSpritePalettes + bl dp13_810BB8C + ldr r0, =gUnknown_08DC0754 + ldr r5, =gUnknown_0203CE40 + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 2 + bl CpuSet + ldr r0, =gUnknown_0861033C + ldr r4, =gUnknown_0203CE44 + ldr r1, [r4] + movs r2, 0x30 + bl CpuSet + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 3 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTiles + ldr r1, [r4] + movs r0, 0x3 + movs r2, 0x60 + movs r3, 0 + bl LoadBgTiles + ldr r0, =gUnknown_08DC0B94 + ldr r4, =gUnknown_0203CE48 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 3 + bl CpuSet + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTilemap + ldr r0, =gUnknown_08DC0714 + movs r1, 0 + movs r2, 0x40 + bl LoadPalette + ldr r4, =gUnknown_08610918 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA + bl LoadPalette + adds r0, r4, 0 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette + ldr r0, =gUnknown_0861039C + movs r1, 0x20 + movs r2, 0x4 + bl LoadPalette + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DE68: + ldr r0, =gUnknown_0203CE4C + ldr r1, [r0] + movs r0, 0x3 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_0861023C + movs r0, 0x8 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x3 + movs r2, 0xB + movs r3, 0x4 + bl CopyToBgTilemapBufferRect + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _0819E006 + .pool +_0819DE94: + ldr r0, =gUnknown_086106B0 + bl LoadSpritePalettes + ldr r0, =gUnknown_08610650 + bl LoadSpriteSheets + ldr r0, =gUnknown_086106A0 + bl LoadCompressedObjectPic + ldr r0, =sub_819C7FC + bl SetVBlankCallback + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DECC: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x15] + cmp r0, 0x1 + bne _0819DEDC + ldr r0, =gUnknown_0203CF20 + ldrb r0, [r0] + strb r0, [r1, 0x3] +_0819DEDC: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _0819E00E + .pool +_0819DEEC: + bl sub_819DBD8 + bl sub_819E0C0 + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0x1 + bne _0819DF02 + bl sub_819F304 +_0819DF02: + movs r0, 0 + bl sub_819F048 + b _0819E006 + .pool +_0819DF10: + ldr r0, =gUnknown_085EEC73 + bl sub_819EBEC + movs r0, 0x2 + bl PutWindowTilemap + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DF30: + bl sub_819EFA8 + movs r0, 0x8 + bl PutWindowTilemap + b _0819E006 +_0819DF3C: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0 + bne _0819DF4A + bl sub_819EB4C +_0819DF4A: + movs r0, 0x1 + bl PutWindowTilemap + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DF64: + bl sub_819EB18 + movs r0, 0 + bl PutWindowTilemap + b _0819E006 +_0819DF70: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _0819E00E +_0819DF78: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0 + beq _0819E006 + bl sub_819EE08 + b _0819E006 + .pool +_0819DF8C: + bl sub_819ED78 + movs r0, 0x3 + bl PutWindowTilemap + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DFA4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0x1 + bne _0819E000 + movs r0, 0x3 + bl ShowBg + ldr r1, =0x00001248 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _0819E006 + .pool +_0819E000: + movs r0, 0x3 + bl HideBg +_0819E006: + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_0819E00E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0819E0AA + .pool +_0819E01C: + ldr r0, =sub_819CF54 + movs r1, 0 + bl CreateTask + ldr r6, =gUnknown_03001284 + ldr r1, [r6] + adds r1, 0x21 + strb r0, [r1] + ldr r0, [r6] + ldrb r5, [r0, 0x15] + cmp r5, 0 + bne _0819E06C + ldr r4, =gTasks + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + ldr r0, =sub_819CE40 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + b _0819E0A4 + .pool +_0819E06C: + bl sub_819EAF8 + ldr r4, =gTasks + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r3, 0 + movs r1, 0x1 + strh r1, [r0, 0x8] + adds r2, 0x22 + strb r3, [r2] + ldr r0, =sub_819CD34 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x8] +_0819E0A4: + ldr r0, =sub_819C7E0 + bl SetMainCallback2 +_0819E0AA: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819DC1C + + thumb_func_start sub_819E0C0 +sub_819E0C0: @ 819E0C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r1, sp + ldr r0, =gUnknown_08610834 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + mov r1, sp + movs r0, 0x65 + strh r0, [r1, 0x2] + movs r6, 0 + ldr r4, =gUnknown_03001284 + movs r7, 0 + ldr r5, =gSprites +_0819E0E6: + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 20 + movs r3, 0x90 + lsls r3, 15 + adds r1, r3 + asrs r1, 16 + mov r0, sp + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r4] + adds r1, 0x5 + adds r1, r6 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x5 + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r7, [r0, 0x2E] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _0819E0E6 + ldr r7, =gUnknown_03001284 + ldr r1, [r7] + adds r0, r1, 0x5 + ldrb r1, [r1, 0x3] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + movs r5, 0x20 + ldrsh r1, [r0, r5] + ldr r0, =gUnknown_0861084C + movs r2, 0x58 + movs r3, 0 + bl CreateSprite + ldr r1, [r7] + movs r4, 0 + strb r0, [r1, 0x4] + ldr r0, =gUnknown_08610864 + movs r1, 0xB0 + movs r2, 0x70 + movs r3, 0 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x1] + ldr r0, =gUnknown_0861087C + movs r1, 0xB0 + movs r2, 0x90 + movs r3, 0 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x2] + ldr r0, [r7] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, =gSprites + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x28 + strb r4, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x29 + strb r4, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x28 + strb r4, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x29 + strb r4, [r0] + ldr r0, [r7] + ldrb r0, [r0, 0x15] + movs r1, 0xC0 + str r1, [sp, 0x18] + cmp r0, 0x1 + bne _0819E1E8 + movs r2, 0xF0 + str r2, [sp, 0x18] +_0819E1E8: + mov r1, sp + ldr r0, =gUnknown_0861084C + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r0, sp + movs r4, 0x68 + mov r10, r4 + mov r5, r10 + strh r5, [r0] + movs r1, 0xF0 + movs r2, 0x78 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x8] + mov r1, sp + ldr r0, =gUnknown_08610864 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + mov r0, sp + movs r1, 0x69 + mov r9, r1 + mov r2, r9 + strh r2, [r0] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4, 0 + movs r2, 0x78 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x9] + movs r5, 0x90 + lsls r5, 1 + mov r0, sp + adds r1, r5, 0 + movs r2, 0x78 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xA] + mov r1, sp + ldr r0, =gUnknown_0861084C + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r0, sp + movs r3, 0x6A + mov r8, r3 + mov r6, r8 + strh r6, [r0] + movs r1, 0xF0 + movs r2, 0x78 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xB] + mov r1, sp + ldr r0, =gUnknown_08610864 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r1, sp + movs r0, 0x6B + strh r0, [r1] + mov r0, sp + adds r1, r4, 0 + movs r2, 0x78 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xC] + mov r0, sp + movs r6, 0x6C + strh r6, [r0] + adds r1, r5, 0 + movs r2, 0x78 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xD] + mov r1, sp + ldr r0, =gUnknown_0861084C + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + mov r4, r10 + strh r4, [r0] + ldr r1, [sp, 0x18] + movs r2, 0x90 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xE] + mov r1, sp + ldr r0, =gUnknown_08610864 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + mov r0, sp + mov r3, r9 + strh r3, [r0] + ldr r4, [sp, 0x18] + adds r4, 0x10 + adds r1, r4, 0 + movs r2, 0x90 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xF] + mov r1, sp + ldr r0, =gUnknown_0861084C + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + mov r5, r8 + strh r5, [r0] + ldr r1, [sp, 0x18] + movs r2, 0x90 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x10] + mov r1, sp + ldr r0, =gUnknown_08610864 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + strh r6, [r0] + adds r1, r4, 0 + movs r2, 0x90 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x11] + movs r6, 0 + ldr r5, =gSprites + adds r4, r7, 0 + movs r7, 0 + movs r0, 0x4 + mov r10, r0 +_0819E330: + ldr r0, [r4] + lsls r3, r6, 1 + adds r2, r3, r6 + adds r0, 0x8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x9 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x9 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xA + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xA + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xF + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xF + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + mov r8, r0 + ldrb r1, [r0] + mov r0, r10 + orrs r1, r0 + mov r0, r8 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + mov r8, r0 + ldrb r1, [r0] + mov r0, r10 + orrs r1, r0 + mov r0, r8 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xA + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + mov r2, r10 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xF + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, =gUnknown_03001284 + mov r8, r3 + ldr r0, =gSprites + mov r9, r0 + cmp r6, 0x1 + bhi _0819E496 + b _0819E330 +_0819E496: + ldr r0, [r3] + ldrb r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x5 + negs r3, r3 + adds r0, r3, 0 + b _0819E4C8 + .pool +_0819E4C8: + ands r0, r2 + strb r0, [r1] + mov r1, r8 + ldr r0, [r1] + ldrb r1, [r0, 0xF] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + mov r2, r8 + ldr r0, [r2] + ldrb r1, [r0, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + mov r4, r8 + ldr r0, [r4] + ldrb r1, [r0, 0x9] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + ldr r0, [r4] + ldrb r1, [r0, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819E0C0 + + thumb_func_start sub_819E538 +sub_819E538: @ 819E538 + push {r4-r7,lr} + movs r5, 0 +_0819E53C: + ldr r6, =gUnknown_03001284 + ldr r0, [r6] + adds r0, 0x5 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl DestroySprite + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0819E53C + ldr r0, [r6] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + movs r5, 0 +_0819E590: + movs r4, 0 + lsls r6, r5, 1 +_0819E594: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r1, r6, r5 + adds r1, r4, r1 + adds r0, 0x8 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0819E594 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _0819E590 + movs r5, 0 +_0819E5C6: + movs r4, 0 + adds r7, r5, 0x1 + lsls r6, r5, 1 +_0819E5CC: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r1, r4, r6 + adds r0, 0xE + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819E5CC + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _0819E5C6 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E538 + + thumb_func_start sub_819E608 +sub_819E608: @ 819E608 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bhi _0819E65C + ldr r4, =gSprites + ldr r5, =gUnknown_03001284 + ldr r0, [r5] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + bl sub_819E8EC + ldr r0, [r5] + ldrb r2, [r0, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + adds r0, 0x5 + adds r0, r6 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r1, 0x20] + b _0819E684 + .pool +_0819E65C: + ldr r2, =gSprites + ldr r3, =gUnknown_03001284 + ldr r0, [r3] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r3] + ldr r1, [r0, 0x18] + lsls r0, r6, 3 + adds r0, r1 + ldrb r0, [r0] + bl sub_819E838 +_0819E684: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E608 + + thumb_func_start sub_819E694 +sub_819E694: @ 819E694 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + lsls r4, 24 + cmp r4, 0 + ble _0819E6C0 + ldr r1, =gUnknown_03001284 + ldr r2, [r1] + ldrb r0, [r2, 0x3] + adds r0, 0x1 + ldrb r3, [r2, 0x17] + cmp r0, r3 + bne _0819E6D8 + movs r0, 0 + b _0819E6D8 + .pool +_0819E6C0: + ldr r0, =gUnknown_03001284 + ldr r2, [r0] + ldrb r3, [r2, 0x3] + adds r1, r0, 0 + cmp r3, 0 + beq _0819E6D4 + subs r0, r3, 0x1 + b _0819E6D8 + .pool +_0819E6D4: + ldrb r0, [r2, 0x17] + subs r0, 0x1 +_0819E6D8: + strb r0, [r2, 0x3] + ldr r0, [r1] + ldrb r0, [r0, 0x3] + bl sub_819E608 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819E694 + + thumb_func_start sub_819E6E8 +sub_819E6E8: @ 819E6E8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + lsls r4, 24 + cmp r4, 0 + ble _0819E728 + ldr r0, =gUnknown_03001284 + ldr r2, [r0] + ldrb r1, [r2, 0x3] + adds r4, r0, 0 + cmp r1, 0x2 + bhi _0819E714 + movs r0, 0x3 + strb r0, [r2, 0x3] + b _0819E74A + .pool +_0819E714: + ldrb r0, [r2, 0x3] + adds r0, 0x1 + ldrb r1, [r2, 0x17] + cmp r0, r1 + beq _0819E722 + strb r0, [r2, 0x3] + b _0819E74A +_0819E722: + movs r0, 0 + strb r0, [r2, 0x3] + b _0819E74A +_0819E728: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1, 0x3] + adds r2, r3, 0 + adds r4, r0, 0 + cmp r2, 0x2 + bls _0819E744 + cmp r2, 0 + beq _0819E744 + subs r0, r3, 0x1 + b _0819E748 + .pool +_0819E744: + ldrb r0, [r1, 0x17] + subs r0, 0x1 +_0819E748: + strb r0, [r1, 0x3] +_0819E74A: + ldr r0, [r4] + ldrb r0, [r0, 0x3] + bl sub_819E608 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819E6E8 + + thumb_func_start sub_819E758 +sub_819E758: @ 819E758 + push {lr} + lsls r0, 24 + cmp r0, 0 + ble _0819E778 + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1, 0x16] + adds r2, r0, 0 + cmp r3, 0x1 + beq _0819E774 + adds r0, r3, 0x1 + b _0819E78E + .pool +_0819E774: + movs r0, 0 + b _0819E78E +_0819E778: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1, 0x16] + adds r2, r0, 0 + cmp r3, 0 + beq _0819E78C + subs r0, r3, 0x1 + b _0819E78E + .pool +_0819E78C: + movs r0, 0x1 +_0819E78E: + strb r0, [r1, 0x16] + ldr r3, =gSprites + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x16] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x16] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E758 + + thumb_func_start sub_819E7C0 +sub_819E7C0: @ 819E7C0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + lsls r4, 24 + cmp r4, 0 + ble _0819E7EC + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0x2 + beq _0819E7E8 + adds r0, r3, 0x1 + b _0819E802 + .pool +_0819E7E8: + movs r0, 0 + b _0819E802 +_0819E7EC: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0 + beq _0819E800 + subs r0, r3, 0x1 + b _0819E802 + .pool +_0819E800: + movs r0, 0x2 +_0819E802: + strb r0, [r1] + ldr r3, =gSprites + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E7C0 + + thumb_func_start sub_819E838 +sub_819E838: @ 819E838 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + movs r0, 0x5 + negs r0, r0 + mov r9, r0 + movs r2, 0x4 + mov r8, r2 + ldr r0, =gSprites + mov r12, r0 + ldr r7, =gUnknown_03001284 +_0819E856: + cmp r6, 0x2 + bne _0819E898 + ldr r5, =gSprites + ldr r3, =gUnknown_03001284 + ldr r0, [r3] + adds r0, 0xB + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r9 + ands r0, r2 + strb r0, [r1] + cmp r4, 0x1 + bhi _0819E8D4 + ldr r0, [r3] + adds r0, 0x10 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + b _0819E8CA + .pool +_0819E898: + cmp r6, 0x3 + bne _0819E8D4 + cmp r4, 0x1 + bhi _0819E8BA + ldr r0, [r7] + adds r0, 0x10 + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r12 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r9 + ands r0, r2 + strb r0, [r1] +_0819E8BA: + ldr r0, [r7] + adds r0, 0xB + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r12 +_0819E8CA: + adds r0, 0x3E + ldrb r1, [r0] + mov r2, r8 + orrs r1, r2 + strb r1, [r0] +_0819E8D4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0819E856 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819E838 + + thumb_func_start sub_819E8EC +sub_819E8EC: @ 819E8EC + push {r4-r6,lr} + movs r2, 0 + ldr r5, =gSprites + ldr r4, =gUnknown_03001284 + adds r6, r5, 0 + movs r3, 0x4 +_0819E8F8: + ldr r0, [r4] + adds r0, 0xB + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + cmp r2, 0x1 + bhi _0819E92C + ldr r0, [r4] + adds r0, 0x10 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] +_0819E92C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _0819E8F8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E8EC + + thumb_func_start sub_819E944 +sub_819E944: @ 819E944 + push {r4,r5,lr} + ldr r0, =gUnknown_03001284 + ldr r3, [r0] + ldrb r1, [r3, 0x15] + adds r5, r0, 0 + cmp r1, 0x1 + bne _0819E95C + movs r0, 0 + strb r0, [r3, 0x15] + b _0819E960 + .pool +_0819E95C: + movs r0, 0 + strb r0, [r3] +_0819E960: + ldr r4, =gSprites + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + bl sub_819EC20 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E944 + + thumb_func_start sub_819E9E0 +sub_819E9E0: @ 819E9E0 + push {r4,r5,lr} + ldr r5, =gUnknown_03001284 + ldr r1, [r5] + movs r0, 0 + strb r0, [r1, 0x16] + ldr r4, =gSprites + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r3, 0x70 + strh r3, [r0, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r3, [r0, 0x22] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + bl sub_819EC94 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E9E0 + + thumb_func_start sub_819EA64 +sub_819EA64: @ 819EA64 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =gSprites + ldr r3, =gUnknown_03001284 + ldr r0, [r3] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r3] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + bl ClearWindowTilemap + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EA64 + + thumb_func_start sub_819EAC0 +sub_819EAC0: @ 819EAC0 + push {lr} + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_819EAC0 + + thumb_func_start sub_819EADC +sub_819EADC: @ 819EADC + push {lr} + movs r0, 0x7 + bl PutWindowTilemap + movs r0, 0x7 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x7 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_819EADC + + thumb_func_start sub_819EAF8 +sub_819EAF8: @ 819EAF8 + push {lr} + bl sub_819EAC0 + movs r0, 0x5 + bl PutWindowTilemap + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_819EAF8 + + thumb_func_start sub_819EB18 +sub_819EB18: @ 819EB18 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EEC66 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x2 + bl PrintTextOnWindow + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EB18 + + thumb_func_start sub_819EB4C +sub_819EB4C: @ 819EB4C + push {r4,lr} + sub sp, 0xC + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bls _0819EB70 + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + b _0819EBD4 + .pool +_0819EB70: + ldrb r2, [r1, 0x3] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819EB84 + movs r0, 0x64 + muls r0, r2 + ldr r1, =gPlayerParty + b _0819EB8A + .pool +_0819EB84: + movs r0, 0x64 + muls r0, r2 + ldr r1, =gEnemyParty +_0819EB8A: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, =gStringVar4 + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08610925 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram +_0819EBD4: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EB4C + + thumb_func_start sub_819EBEC +sub_819EBEC: @ 819EBEC + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x2 + bl PrintTextOnWindow + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819EBEC + + thumb_func_start sub_819EC20 +sub_819EC20: @ 819EC20 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x3 + bl PutWindowTilemap + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_08610922 + str r5, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECAA + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECA5 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x11 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECB2 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x21 + bl box_print + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EC20 + + thumb_func_start sub_819EC94 +sub_819EC94: @ 819EC94 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x4 + bl PutWindowTilemap + movs r0, 0x4 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_08610922 + str r5, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECCA + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECCE + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print + movs r0, 0x4 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EC94 + + thumb_func_start sub_819ECF0 +sub_819ECF0: @ 819ECF0 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + movs r0, 0 + adds r1, r6, 0 + movs r2, 0x46 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_08610922 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0 + adds r3, r5, 0 + bl box_print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ECF0 + + thumb_func_start sub_819ED34 +sub_819ED34: @ 819ED34 + push {lr} + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + beq _0819ED56 + cmp r0, 0x1 + bne _0819ED60 + ldr r0, =gUnknown_085EECD1 + movs r1, 0 + movs r2, 0x5 + bl sub_819ECF0 +_0819ED56: + ldr r0, =gUnknown_085EECDD + movs r1, 0x18 + movs r2, 0x5 + bl sub_819ECF0 +_0819ED60: + movs r0, 0x5 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ED34 + + thumb_func_start sub_819ED78 +sub_819ED78: @ 819ED78 + push {lr} + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + beq _0819ED9A + cmp r0, 0x1 + bne _0819EDA4 + ldr r0, =gUnknown_085EECD1 + movs r1, 0x8 + movs r2, 0x3 + bl sub_819ECF0 +_0819ED9A: + ldr r0, =gUnknown_085EECDD + movs r1, 0x20 + movs r2, 0x3 + bl sub_819ECF0 +_0819EDA4: + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ED78 + + thumb_func_start sub_819EDBC +sub_819EDBC: @ 819EDBC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0819EDCC + cmp r0, 0x1 + beq _0819EDEC + b _0819EDF6 +_0819EDCC: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0x1 + bne _0819EDF6 + ldr r0, =gUnknown_085EECD1 + movs r1, 0x8 + movs r2, 0x3 + bl sub_819ECF0 + b _0819EDF6 + .pool +_0819EDEC: + ldr r0, =gUnknown_085EECDD + movs r1, 0x20 + movs r2, 0x3 + bl sub_819ECF0 +_0819EDF6: + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EDBC + + thumb_func_start sub_819EE08 +sub_819EE08: @ 819EE08 + push {r4,lr} + sub sp, 0x18 + ldr r0, =gUnknown_08610918 + add r1, sp, 0xC + movs r2, 0x4 + bl CpuSet + ldr r0, =gUnknown_03001284 + ldr r2, [r0] + ldrb r0, [r2, 0x15] + cmp r0, 0 + bne _0819EE3C + add r0, sp, 0xC + ldr r1, =gPlttBufferFaded + movs r2, 0xE4 + lsls r2, 1 + adds r1, r2 + ldrh r1, [r1] + strh r1, [r0, 0x8] + b _0819EE42 + .pool +_0819EE3C: + add r1, sp, 0xC + ldrh r0, [r2, 0x24] + strh r0, [r1, 0x8] +_0819EE42: + add r0, sp, 0xC + movs r1, 0xF0 + movs r2, 0xA + bl LoadPalette + movs r0, 0x7 + bl PutWindowTilemap + movs r0, 0x7 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bls _0819EE74 + movs r0, 0x7 + movs r1, 0x3 + bl CopyWindowToVram + b _0819EED8 + .pool +_0819EE74: + ldrb r2, [r1, 0x3] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819EE88 + movs r0, 0x64 + muls r0, r2 + ldr r1, =gPlayerParty + b _0819EE8E + .pool +_0819EE88: + movs r0, 0x64 + muls r0, r2 + ldr r1, =gEnemyParty +_0819EE8E: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, =gStringVar4 + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08610925 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x7 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x7 + movs r1, 0x3 + bl CopyWindowToVram +_0819EED8: + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EE08 + + thumb_func_start sub_819EEF0 +sub_819EEF0: @ 819EEF0 + push {r4,lr} + sub sp, 0xC + ldr r0, =gUnknown_08610918 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette + ldr r0, =gPlttBufferUnfaded+ 0x1E0 + ldr r1, =gPlttBufferFaded + 0x1C0 + movs r2, 0x5 + bl CpuSet + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bls _0819EF2C + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + b _0819EF90 + .pool +_0819EF2C: + ldrb r2, [r1, 0x3] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819EF40 + movs r0, 0x64 + muls r0, r2 + ldr r1, =gPlayerParty + b _0819EF46 + .pool +_0819EF40: + movs r0, 0x64 + muls r0, r2 + ldr r1, =gEnemyParty +_0819EF46: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, =gStringVar4 + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08610925 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram +_0819EF90: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EEF0 + + thumb_func_start sub_819EFA8 +sub_819EFA8: @ 819EFA8 + push {r4-r6,lr} + sub sp, 0x2C + ldr r6, =gUnknown_03001284 + ldr r0, [r6] + ldrb r4, [r0, 0x3] + adds r5, r4, 0 + movs r0, 0x8 + movs r1, 0 + bl FillWindowPixelBuffer + cmp r4, 0x2 + bls _0819EFD0 + movs r0, 0x8 + movs r1, 0x2 + bl CopyWindowToVram + b _0819F03A + .pool +_0819EFD0: + movs r0, 0x8 + bl PutWindowTilemap + ldr r0, [r6] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _0819EFEC + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + b _0819EFF2 + .pool +_0819EFEC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty +_0819EFF2: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + add r1, sp, 0xC + bl sub_81DB468 + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x76 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x8 + movs r1, 0x1 + add r2, sp, 0xC + bl PrintTextOnWindow + movs r0, 0x8 + movs r1, 0x2 + bl CopyWindowToVram +_0819F03A: + add sp, 0x2C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EFA8 + + thumb_func_start sub_819F048 +sub_819F048: @ 819F048 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r4, =gUnknown_03001284 + ldr r3, [r4] + ldrb r0, [r3, 0x15] + cmp r0, 0x1 + beq _0819F094 + cmp r2, 0 + beq _0819F068 + cmp r2, 0x1 + beq _0819F080 + b _0819F094 + .pool +_0819F068: + strb r2, [r3, 0x14] + ldr r0, [r4] + strb r2, [r0, 0x3] + ldr r1, [r4] + movs r0, 0x4 + strb r0, [r1, 0x17] + ldr r1, [r4] + ldr r0, =gUnknown_08610928 + b _0819F092 + .pool +_0819F080: + movs r1, 0 + strb r2, [r3, 0x14] + ldr r0, [r4] + strb r1, [r0, 0x3] + ldr r1, [r4] + movs r0, 0x5 + strb r0, [r1, 0x17] + ldr r1, [r4] + ldr r0, =gUnknown_08610948 +_0819F092: + str r0, [r1, 0x18] +_0819F094: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F048 + + thumb_func_start sub_819F0A0 +sub_819F0A0: @ 819F0A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gUnknown_03001280 + ldr r2, =gUnknown_086108AC + ldr r1, =gUnknown_03001284 + ldr r1, [r1] + ldrb r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + str r1, [r3] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F0A0 + + thumb_func_start sub_819F0CC +sub_819F0CC: @ 819F0CC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =gUnknown_03001284 + ldr r1, [r5] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + ldr r0, [r5] + ldrb r1, [r0, 0x3] + movs r5, 0 + strb r1, [r0, 0x12] + movs r0, 0x3 + bl sub_819EA64 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + ldr r1, =sub_819D9EC + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F0CC + + thumb_func_start sub_819F114 +sub_819F114: @ 819F114 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x6 + strh r0, [r1, 0x8] + ldr r0, =sub_819C90C + str r0, [r1] + bx lr + .pool + thumb_func_end sub_819F114 + + thumb_func_start sub_819F134 +sub_819F134: @ 819F134 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819EA64 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r2, =sub_819CE40 + lsrs r1, r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x12] + ldr r1, =sub_819D770 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F134 + + thumb_func_start sub_819F184 +sub_819F184: @ 819F184 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gUnknown_03001280 + ldr r1, =gUnknown_03001284 + ldr r2, [r1] + ldrb r1, [r2, 0x3] + ldr r2, [r2, 0x18] + lsls r1, 3 + adds r1, r2 + ldr r1, [r1, 0x4] + str r1, [r3] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F184 + + thumb_func_start sub_819F1AC +sub_819F1AC: @ 819F1AC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_819CC24 + lsrs r0, r2, 16 + movs r3, 0 + strh r0, [r1, 0x14] + strh r2, [r1, 0x16] + strh r3, [r1, 0x8] + strh r3, [r1, 0x12] + ldr r0, =sub_819D588 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_819F1AC + + thumb_func_start sub_819F1DC +sub_819F1DC: @ 819F1DC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_819D9EC + lsrs r0, r2, 16 + movs r3, 0 + strh r0, [r1, 0x14] + strh r2, [r1, 0x16] + strh r3, [r1, 0x12] + strh r3, [r1, 0x8] + ldr r0, =sub_819D588 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_819F1DC + + thumb_func_start sub_819F20C +sub_819F20C: @ 819F20C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =gUnknown_03001284 + ldr r1, [r5] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819F240 + ldr r3, =gTasks + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r0, 3 + adds r0, r3 + ldr r2, =sub_819CD34 + lsrs r1, r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + movs r1, 0x2 + strh r1, [r0, 0x12] + b _0819F292 + .pool +_0819F240: + ldrb r0, [r1, 0x3] + bl sub_819F59C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0819F278 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x2D + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F2B4 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + strh r4, [r0, 0x12] + ldr r1, =sub_819F488 + b _0819F29E + .pool +_0819F278: + ldr r4, =gTasks + lsls r5, r6, 2 + adds r0, r5, r6 + lsls r0, 3 + adds r0, r4 + ldr r2, =sub_819CCD4 + lsrs r1, r2, 16 + movs r3, 0 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + strh r3, [r0, 0x12] + adds r3, r4, 0 + adds r4, r5, 0 +_0819F292: + adds r0, r4, r6 + lsls r0, 3 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r1, =sub_819D588 +_0819F29E: + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F20C + + thumb_func_start sub_819F2B4 +sub_819F2B4: @ 819F2B4 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r5, r2, 24 + lsrs r5, 24 + ldr r0, =gUnknown_08610894 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + strb r0, [r4] + ldr r2, =gSprites + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_819F600 + str r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x3C] + movs r0, 0x1 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F2B4 + + thumb_func_start sub_819F304 +sub_819F304: @ 819F304 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x10 + ldr r0, =gUnknown_08610894 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r6, =gUnknown_03001284 + ldr r1, [r6] + adds r1, 0x2D + movs r2, 0 + mov r10, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x2D + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + mov r8, r1 + add r0, r8 + movs r1, 0x2 + bl StartSpriteAffineAnim + ldr r0, [r6] + ldrb r1, [r0, 0x3] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r2, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r5, 0 + mov r1, r9 + movs r3, 0x1 + bl sub_818D7D8 + ldr r1, [r6] + adds r1, 0x2C + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x28 + mov r2, r10 + strb r2, [r0] + ldr r0, [r6] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x29 + strb r2, [r0] + ldr r0, [r6] + adds r0, 0x2D + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F304 + + thumb_func_start sub_819F3F8 +sub_819F3F8: @ 819F3F8 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r5, r2, 24 + lsrs r5, 24 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_818D820 + ldr r0, =sub_819F7B4 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x16] + lsrs r4, 8 + lsls r4, 24 + lsrs r4, 24 + strh r4, [r1, 0x14] + ldr r1, [r1] + bl _call_via_r1 + movs r0, 0x1 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F3F8 + + thumb_func_start sub_819F444 +sub_819F444: @ 819F444 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_818D820 + ldr r5, =gSprites + lsls r4, 16 + lsrs r1, r4, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + movs r0, 0 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F444 + + thumb_func_start sub_819F488 +sub_819F488: @ 819F488 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_03001284 + ldr r0, [r1] + adds r0, 0x30 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x1 + beq _0819F58A + ldr r2, =gTasks + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r5, r1, 0 + cmp r0, 0x4 + bhi _0819F58A + lsls r0, 2 + ldr r1, =_0819F4C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819F4C8: + .4byte _0819F4DC + .4byte _0819F4F8 + .4byte _0819F52C + .4byte _0819F548 + .4byte _0819F568 +_0819F4DC: + ldr r0, =gUnknown_085EED0A + bl sub_819EBEC + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x20 + movs r1, 0 + strb r1, [r0] + b _0819F54E + .pool +_0819F4F8: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0819F50C + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819F58A +_0819F50C: + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + b _0819F54E + .pool +_0819F52C: + ldr r0, [r3] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819F58A + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + b _0819F54E +_0819F548: + ldr r0, =gUnknown_085EEC8B + bl sub_819EBEC +_0819F54E: + ldr r0, =gTasks + adds r1, r5, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819F58A + .pool +_0819F568: + bl sub_819EEF0 + bl sub_819EADC + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + ldr r1, =gTasks + adds r0, r5, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x12] + strh r1, [r0, 0x8] + ldr r1, =sub_819CE40 + str r1, [r0] +_0819F58A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F488 + + thumb_func_start sub_819F59C +sub_819F59C: @ 819F59C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + movs r4, 0 +_0819F5B8: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x12] + cmp r4, r0 + beq _0819F5EC + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bne _0819F5EC + movs r0, 0x1 + b _0819F5F8 + .pool +_0819F5EC: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0819F5B8 + movs r0, 0 +_0819F5F8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_819F59C + + thumb_func_start sub_819F600 +sub_819F600: @ 819F600 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819F640 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_819F69C + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r4, 0x3C] + strh r2, [r1, 0x16] + ldr r1, [r1] + bl _call_via_r1 + ldr r0, =SpriteCallbackDummy + str r0, [r4, 0x1C] +_0819F640: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F600 + + thumb_func_start sub_819F654 +sub_819F654: @ 819F654 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819F694 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _0819F688 + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x30 + movs r1, 0 + strb r1, [r0] + b _0819F68E + .pool +_0819F688: + movs r0, 0 + bl sub_819BE20 +_0819F68E: + adds r0, r4, 0 + bl DestroySprite +_0819F694: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819F654 + + thumb_func_start sub_819F69C +sub_819F69C: @ 819F69C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0819F71A + cmp r0, 0x1 + bgt _0819F6C4 + cmp r0, 0 + beq _0819F6CA + b _0819F77C + .pool +_0819F6C4: + cmp r0, 0x2 + beq _0819F73C + b _0819F77C +_0819F6CA: + movs r0, 0x58 + strh r0, [r4, 0xE] + movs r0, 0x98 + strh r0, [r4, 0x38] + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + b _0819F7A6 +_0819F71A: + movs r0, 0x3 + bl ShowBg + ldr r1, =0x00001248 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _0819F7A6 + .pool +_0819F73C: + ldrh r0, [r4, 0x12] + subs r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + adds r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _0819F758 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x5F + ble _0819F760 +_0819F758: + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] +_0819F760: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0x20 + bne _0819F7AC + b _0819F7A6 +_0819F77C: + adds r0, r5, 0 + bl DestroyTask + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x16 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _0819F7A0 + bl sub_819F8E0 + b _0819F7AC + .pool +_0819F7A0: + bl sub_819BD70 + b _0819F7AC +_0819F7A6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819F7AC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819F69C + + thumb_func_start sub_819F7B4 +sub_819F7B4: @ 819F7B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0819F844 + cmp r0, 0x1 + beq _0819F894 + movs r0, 0x3 + bl HideBg + ldr r3, =gSprites + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r4, 0x16] + strh r1, [r0, 0x3C] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_819F654 + str r1, [r0] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x1 + bl StartSpriteAffineAnim + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits + adds r0, r5, 0 + bl DestroyTask + b _0819F8D8 + .pool +_0819F844: + movs r0, 0x58 + strh r0, [r4, 0xE] + movs r0, 0x98 + strh r0, [r4, 0x38] + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + b _0819F8D2 +_0819F894: + ldrh r0, [r4, 0x12] + adds r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + subs r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + bgt _0819F8B0 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x41 + bgt _0819F8B8 +_0819F8B0: + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] +_0819F8B8: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bne _0819F8D8 +_0819F8D2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819F8D8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819F7B4 + + thumb_func_start sub_819F8E0 +sub_819F8E0: @ 819F8E0 + push {r4-r6,lr} + sub sp, 0x10 + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819F900 + ldrb r1, [r1, 0x3] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + b _0819F908 + .pool +_0819F900: + ldrb r1, [r1, 0x3] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gEnemyParty +_0819F908: + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + adds r0, r6, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_818D7D8 + ldr r2, =gUnknown_03001284 + ldr r1, [r2] + adds r1, 0x2C + movs r3, 0 + strb r0, [r1] + ldr r4, =gSprites + ldr r0, [r2] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r3, [r0] + ldr r0, [r2] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r3, [r0] + ldr r0, [r2] + adds r0, 0x30 + strb r3, [r0] + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F8E0 + + thumb_func_start sub_819F99C +sub_819F99C: @ 819F99C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDE + ldrb r1, [r1] + movs r6, 0 + adds r7, r2, 0 + ldr r0, =gStringVar1 + mov r8, r0 + cmp r1, 0 + beq _0819F9DC +_0819F9C2: + adds r0, r1, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r1, 0 + beq _0819F9DC + cmp r6, 0x3 + bls _0819F9C2 +_0819F9DC: + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r1, [r7] + adds r1, r4, r1 + movs r0, 0x8A + lsls r0, 1 + adds r1, r0 + mov r0, r8 + bl StringCopy7 + ldr r0, [r7] + adds r0, r4 + ldr r1, =0x0000011b + adds r0, r1 + ldrb r1, [r0] + mov r0, r8 + bl ConvertInternationalString + ldr r0, =gStringVar2 + ldr r1, [r7] + adds r1, r4 + adds r1, 0xDE + ldrb r1, [r1] + movs r2, 0x1 + adds r3, r6, 0 + bl ConvertIntToDecimalStringN + ldr r1, =gUnknown_08611330 + ldr r0, [r7] + adds r0, r4 + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 25 + adds r0, r1 + ldr r1, [r0] + ldr r0, =gStringVar4 + bl StringExpandPlaceholders + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F99C + + thumb_func_start sub_819FA50 +sub_819FA50: @ 819FA50 + push {lr} + bl EnableBothScriptContexts + pop {r0} + bx r0 + thumb_func_end sub_819FA50 + + thumb_func_start sub_819FA5C +sub_819FA5C: @ 819FA5C + push {r4,r5,lr} + adds r3, r0, 0 + movs r2, 0 + adds r4, r3, 0 + adds r4, 0x28 + ldr r0, =0x0000ffff + adds r5, r0, 0 +_0819FA6A: + lsls r0, r2, 1 + adds r0, r4, r0 + ldrh r1, [r0] + orrs r1, r5 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819FA6A + adds r1, r3, 0 + adds r1, 0x38 + movs r0, 0xFF + strb r0, [r1] + ldrb r1, [r3] + movs r0, 0x20 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819FA5C + + thumb_func_start sub_819FAA0 +sub_819FAA0: @ 819FAA0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + adds r1, 0xB2 + ldrb r2, [r1] + movs r0, 0x19 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0 + mov r12, r0 + adds r5, r3, 0 + mov r8, r0 + ldr r1, =0x0000ffff + mov r10, r1 +_0819FAC6: + movs r2, 0 + mov r3, r12 + lsls r7, r3, 4 + movs r4, 0x1 + add r4, r12 + mov r9, r4 + adds r0, r7, r3 + lsls r3, r0, 2 +_0819FAD6: + ldr r1, [r5] + lsls r0, r2, 1 + adds r0, r3 + movs r4, 0x82 + lsls r4, 1 + adds r1, r4 + adds r1, r0 + ldrh r0, [r1] + mov r4, r10 + orrs r0, r4 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819FAD6 + ldr r2, [r5] + mov r0, r12 + adds r3, r7, r0 + lsls r3, 2 + adds r2, r3 + adds r2, 0xDC + ldrb r1, [r2] + movs r0, 0x20 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r5] + adds r0, r3 + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xDC + ldrb r2, [r1] + movs r0, 0x61 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, r3 + adds r0, 0xDE + mov r4, r8 + strb r4, [r0] + ldr r0, [r5] + adds r0, r3 + adds r0, 0xDD + strb r4, [r0] + movs r2, 0 + ldr r6, =gSaveBlock2Ptr + movs r4, 0x88 + lsls r4, 1 +_0819FB48: + ldr r0, [r6] + adds r1, r2, r3 + adds r0, r4 + adds r0, r1 + mov r1, r8 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _0819FB48 + ldr r0, [r5] + mov r3, r12 + adds r2, r7, r3 + lsls r2, 2 + adds r0, r2 + ldr r4, =gGameLanguage + ldrb r1, [r4] + ldr r3, =0x0000011b + adds r0, r3 + strb r1, [r0] + ldr r0, [r5] + movs r4, 0x8E + lsls r4, 1 + adds r0, r4 + adds r0, r2 + mov r1, r8 + str r1, [r0] + mov r3, r9 + lsls r0, r3, 24 + lsrs r0, 24 + mov r12, r0 + cmp r0, 0x3 + bls _0819FAC6 + bl sub_81A087C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819FAA0 + + thumb_func_start sub_819FBB0 +sub_819FBB0: @ 819FBB0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r0, [r0] + movs r1, 0x3 + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_819FBB0 + + thumb_func_start sub_819FBC8 +sub_819FBC8: @ 819FBC8 + push {r4,r5,lr} + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + adds r0, 0xDE + ldrb r0, [r0] + cmp r0, 0 + bne _0819FC10 + adds r4, r2, 0 + ldr r5, =gUnknown_08611548 +_0819FBDA: + bl Random + ldr r2, [r4] + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + lsrs r1, 16 + adds r1, r5 + ldrb r0, [r1] + adds r2, 0xB0 + strb r0, [r2] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xB0 + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + ldrb r1, [r1] + lsrs r0, 27 + cmp r1, r0 + beq _0819FBDA + b _0819FC38 + .pool +_0819FC10: + adds r4, r2, 0 +_0819FC12: + bl Random + ldr r2, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + adds r2, 0xB0 + strb r0, [r2] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xB0 + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + ldrb r1, [r1] + lsrs r0, 27 + cmp r1, r0 + beq _0819FC12 +_0819FC38: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819FBC8 + + thumb_func_start sub_819FC40 +sub_819FC40: @ 819FC40 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + adds r2, 0xB1 + movs r1, 0x3 + ands r0, r1 + ldrb r3, [r2] + subs r1, 0x7 + ands r1, r3 + orrs r1, r0 + strb r1, [r2] + bx lr + .pool + thumb_func_end sub_819FC40 + + thumb_func_start sub_819FC60 +sub_819FC60: @ 819FC60 + push {r4-r7,lr} + sub sp, 0xC + movs r5, 0 +_0819FC66: + mov r1, sp + adds r0, r1, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0819FC66 + movs r5, 0 +_0819FC78: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r7, sp + adds r2, r7, r4 + ldrb r3, [r2] + adds r1, r7, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x31 + bls _0819FC78 + movs r5, 0 + ldr r6, =gSaveBlock2Ptr + movs r4, 0xF +_0819FCBC: + ldr r3, [r6] + adds r3, 0xB4 + adds r3, r5 + lsls r2, r5, 1 + mov r1, sp + adds r0, r1, r2 + ldrb r0, [r0] + adds r1, r4, 0 + ands r1, r0 + lsls r1, 4 + adds r2, 0x1 + mov r7, sp + adds r0, r7, r2 + ldrb r2, [r0] + adds r0, r4, 0 + ands r0, r2 + orrs r1, r0 + strb r1, [r3] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0819FCBC + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819FC60 + + thumb_func_start sub_819FCF8 +sub_819FCF8: @ 819FCF8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + cmp r0, 0x2 + bne _0819FD4C + ldr r6, =gUnknown_030062EC +_0819FD06: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + movs r2, 0 + ldr r1, [r6] + lsls r0, r5, 2 + adds r0, r5 + lsls r4, r0, 1 + adds r1, 0x2 +_0819FD26: + lsls r0, r2, 1 + adds r0, r4 + adds r0, r1, r0 + ldrh r0, [r0] + cmp r0, 0 + beq _0819FD38 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_0819FD38: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x4 + bls _0819FD26 + cmp r3, 0x3 + bhi _0819FD06 + b _0819FD5A + .pool +_0819FD4C: + cmp r0, 0x1 + bne _0819FD5A + ldrb r0, [r2] + adds r1, r0 + ldrb r5, [r1] + adds r0, 0x1 + strb r0, [r2] +_0819FD5A: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_819FCF8 + + thumb_func_start sub_819FD64 +sub_819FD64: @ 819FD64 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + movs r5, 0 + mov r0, sp + adds r0, 0xC + str r0, [sp, 0x14] + mov r1, sp + adds r1, 0x10 + str r1, [sp, 0x18] + adds r1, r0, 0 +_0819FD80: + adds r0, r1, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0819FD80 + movs r5, 0 + ldr r6, [sp, 0x14] +_0819FD92: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r2, r6, r4 + ldrb r3, [r2] + adds r1, r6, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0819FD92 + movs r5, 0 + ldr r2, =gUnknown_086114D3 +_0819FDD0: + mov r4, sp + adds r1, r4, r5 + adds r0, r5, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0819FDD0 + movs r5, 0 +_0819FDE6: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r6, sp + adds r2, r6, r4 + ldrb r3, [r2] + adds r1, r6, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x31 + bls _0819FDE6 + ldr r4, =gUnknown_030062EC + movs r0, 0x30 + bl AllocZeroed + str r0, [r4] + movs r1, 0 + strb r1, [r0] + movs r5, 0 + movs r2, 0x4 +_0819FE34: + movs r3, 0 +_0819FE36: + ldr r0, [r4] + lsls r1, r3, 2 + adds r1, r3 + adds r1, r5, r1 + adds r0, 0x20 + adds r0, r1 + strb r2, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _0819FE36 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _0819FE34 + movs r0, 0 + ldr r7, [sp, 0x18] + strb r0, [r7] + movs r5, 0 +_0819FE60: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + lsls r4, r5, 2 + adds r3, r4 + mov r1, sp + adds r6, r1, r5 + ldrb r0, [r6] + adds r3, 0xB8 + movs r2, 0x3 + ands r2, r0 + ldrb r0, [r3] + movs r7, 0x4 + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + ldrb r0, [r6] + adds r5, 0x1 + str r5, [sp, 0x1C] + mov r8, r4 + cmp r0, 0x3 + beq _0819FF62 + ldrb r0, [r6] + ldr r1, [sp, 0x14] + ldr r2, [sp, 0x18] + bl sub_819FCF8 + ldr r1, =gSaveBlock2Ptr + ldr r3, [r1] + add r3, r8 + adds r3, 0xB8 + movs r2, 0x3 + ands r2, r0 + lsls r2, 2 + ldrb r0, [r3] + movs r4, 0xD + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + add r0, r8 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r7, r0, 30 + ldrb r0, [r6] + cmp r0, 0x2 + bne _0819FF62 + lsls r0, r7, 2 + adds r0, r7 + mov r10, r0 + ldr r0, =gUnknown_030062EC + mov r9, r0 +_0819FED2: + bl Random + lsls r0, 16 + lsrs r4, r0, 16 + movs r1, 0x3 + ands r4, r1 + movs r3, 0 + mov r6, r9 + ldr r2, [r6] + ldrb r0, [r2] + adds r1, r0, 0x1 + lsls r5, r7, 2 + cmp r3, r1 + bge _0819FF12 + adds r2, 0x20 + mov r6, r10 + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, r4 + beq _0819FF12 + adds r6, r1, 0 + adds r1, r5, r7 +_0819FEFE: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r6 + bge _0819FF12 + adds r0, r3, r1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, r4 + bne _0819FEFE +_0819FF12: + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0] + adds r0, 0x1 + ldr r1, =gUnknown_030062EC + cmp r3, r0 + bne _0819FED2 + ldr r0, [r1] + orrs r5, r7 + ldrb r2, [r0] + adds r1, r5, r2 + adds r0, 0x20 + adds r0, r1 + strb r4, [r0] + ldr r6, =gSaveBlock2Ptr + ldr r2, [r6] + add r2, r8 + adds r2, 0xB8 + movs r7, 0x3 + ands r4, r7 + lsls r3, r4, 4 + ldrb r0, [r2] + movs r4, 0x31 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2] + ldr r0, [r6] + add r0, r8 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 30 + bl sub_819FF98 + ldr r1, [r6] + add r1, r8 + adds r1, 0xBA + strh r0, [r1] +_0819FF62: + ldr r6, [sp, 0x1C] + lsls r0, r6, 24 + lsrs r5, r0, 24 + cmp r5, 0x8 + bhi _0819FF6E + b _0819FE60 +_0819FF6E: + ldr r4, =gUnknown_030062EC + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819FD64 + + thumb_func_start sub_819FF98 +sub_819FF98: @ 819FF98 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0xC] + movs r7, 0 + ldr r1, [sp] + cmp r1, 0x2 + bhi _0819FFE0 + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0xB4 + ldr r3, [sp] + adds r0, r3 + ldrb r4, [r0] + adds r1, 0xB2 + ldrb r0, [r1] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r3 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r4, r0 + movs r0, 0xF + ands r4, r0 + b _0819FFE4 + .pool +_0819FFE0: + movs r4, 0 + ldr r2, =gSaveBlock2Ptr +_0819FFE4: + ldr r3, =gUnknown_08610970 + lsls r1, r4, 1 + ldr r4, [r2] + adds r0, r4, 0 + adds r0, 0xB0 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + adds r3, 0x34 + adds r1, r3 + ldrh r1, [r1] + str r1, [sp, 0x8] + ldr r1, =gLevelUpLearnsets + ldr r2, [sp, 0x8] + lsls r0, r2, 2 + adds r0, r1 + ldr r6, [r0] + movs r3, 0 + adds r4, 0xB1 + ldrb r1, [r4] + movs r0, 0x3 + ands r0, r1 + movs r5, 0x3C + cmp r0, 0x1 + bne _081A001A + movs r5, 0x32 +_081A001A: + ldrh r1, [r6] + ldr r4, =0x0000ffff + cmp r1, r4 + beq _081A004C + movs r2, 0xFE + lsls r2, 8 + adds r0, r2, 0 + ands r0, r1 + lsls r1, r5, 9 + cmp r0, r1 + bgt _081A004C + adds r5, r2, 0 + adds r2, r1, 0 +_081A0034: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 1 + adds r0, r6 + ldrh r1, [r0] + cmp r1, r4 + beq _081A004C + adds r0, r5, 0 + ands r0, r1 + cmp r0, r2 + ble _081A0034 +_081A004C: + adds r5, r3, 0 + movs r3, 0 + str r3, [sp, 0x4] +_081A0052: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081A0068 + ldr r0, [sp, 0xC] + cmp r0, 0x1 + bne _081A00E0 +_081A0068: + ldr r1, =0x000001ff + mov r8, r1 +_081A006C: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3A + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, [sp, 0x8] + adds r1, r4, 0 + bl CanSpeciesLearnTMHM + adds r2, r0, 0 + cmp r2, 0 + beq _081A006C + ldr r2, =0x00000121 + adds r0, r4, r2 + bl ItemIdToBattleMoveId + lsls r0, 16 + lsrs r7, r0, 16 + movs r2, 0x1 + cmp r5, 0x4 + bhi _081A00BC + movs r3, 0 + b _081A00C6 + .pool +_081A00BC: + subs r0, r5, 0x4 + b _081A00C2 +_081A00C0: + adds r0, r3, 0x1 +_081A00C2: + lsls r0, 24 + lsrs r3, r0, 24 +_081A00C6: + cmp r3, r5 + bcs _081A00DA + lsls r0, r3, 1 + adds r0, r6 + ldrh r0, [r0] + mov r1, r8 + ands r0, r1 + cmp r0, r7 + bne _081A00C0 + movs r2, 0 +_081A00DA: + cmp r2, 0x1 + bne _081A006C + b _081A0146 +_081A00E0: + cmp r5, 0x4 + bhi _081A00EA + movs r2, 0x1 + str r2, [sp, 0xC] + b _081A0168 +_081A00EA: + subs r4, r5, 0x4 + ldr r3, =0x000001ff + mov r10, r3 + mov r8, r3 + lsls r0, r4, 24 + mov r9, r0 +_081A00F6: + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + lsrs r0, 23 + adds r0, r6 + ldrh r0, [r0] + mov r7, r8 + ands r7, r0 + movs r2, 0x1 + mov r1, r9 + lsrs r3, r1, 24 + cmp r3, r5 + bcs _081A0142 + lsls r0, r3, 1 + adds r0, r6 + ldrh r1, [r0] + mov r0, r8 + b _081A013A + .pool +_081A0128: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r5 + bcs _081A0142 + lsls r0, r3, 1 + adds r0, r6 + ldrh r0, [r0] + mov r1, r10 +_081A013A: + ands r0, r1 + cmp r0, r7 + bne _081A0128 + movs r2, 0 +_081A0142: + cmp r2, 0x1 + bne _081A00F6 +_081A0146: + ldr r0, [sp] + adds r1, r7, 0 + bl sub_81A0194 + lsls r0, 24 + cmp r0, 0 + beq _081A0168 + ldr r0, =gUnknown_08611370 + adds r0, r7, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _081A0170 + ldr r0, [sp, 0x4] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] +_081A0168: + ldr r2, [sp, 0x4] + cmp r2, 0x4 + bhi _081A0170 + b _081A0052 +_081A0170: + ldr r0, =gUnknown_030062EC + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + adds r0, r7, 0 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_819FF98 + + thumb_func_start sub_81A0194 +sub_81A0194: @ 81A0194 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + movs r3, 0 + ldr r0, =gUnknown_030062EC + mov r12, r0 + ldr r2, [r0] + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r6, r0, 1 + adds r2, 0x2 + adds r7, r1, 0 +_081A01B0: + lsls r0, r3, 1 + adds r0, r6 + adds r0, r2, r0 + ldrh r0, [r0] + cmp r0, r5 + bne _081A01C4 + movs r0, 0 + b _081A01E2 + .pool +_081A01C4: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x4 + bls _081A01B0 + mov r2, r12 + ldr r1, [r2] + adds r0, r7, r4 + ldrb r2, [r1] + adds r0, r2 + lsls r0, 1 + adds r1, 0x2 + adds r1, r0 + strh r5, [r1] + movs r0, 0x1 +_081A01E2: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A0194 + + thumb_func_start sub_81A01E8 +sub_81A01E8: @ 81A01E8 + push {r4-r7,lr} + mov r12, r1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + movs r4, 0x3C + cmp r0, 0x1 + bne _081A0204 + movs r4, 0x32 +_081A0204: + ldr r1, =gLevelUpLearnsets + lsls r0, r2, 2 + adds r0, r1 + ldr r6, [r0] + movs r5, 0 + ldrh r1, [r6] + ldr r3, =0x0000ffff + cmp r1, r3 + beq _081A0240 + movs r2, 0xFE + lsls r2, 8 + adds r0, r2, 0 + ands r0, r1 + lsls r1, r4, 9 + cmp r0, r1 + bgt _081A0240 + adds r4, r2, 0 + adds r2, r1, 0 +_081A0228: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 1 + adds r0, r6 + ldrh r1, [r0] + cmp r1, r3 + beq _081A0240 + adds r0, r4, 0 + ands r0, r1 + cmp r0, r2 + ble _081A0228 +_081A0240: + adds r4, r5, 0 + cmp r4, 0x4 + bls _081A0248 + movs r4, 0x4 +_081A0248: + movs r2, 0 + cmp r2, r4 + bcs _081A026C + ldr r7, =0x000001ff +_081A0250: + lsls r3, r2, 1 + add r3, r12 + adds r2, 0x1 + subs r0, r5, r2 + lsls r0, 1 + adds r0, r6 + ldrh r1, [r0] + adds r0, r7, 0 + ands r0, r1 + strh r0, [r3] + lsls r2, 24 + lsrs r2, 24 + cmp r2, r4 + bcc _081A0250 +_081A026C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A01E8 + + thumb_func_start sub_81A0284 +sub_81A0284: @ 81A0284 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + adds r7, r1, 0 + cmp r0, 0x2 + bhi _081A02B8 + movs r0, 0 + b _081A037C + .pool +_081A02B8: + movs r4, 0 + movs r3, 0 + adds r0, r2, 0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + ldr r1, =gUnknown_08610970 + mov r12, r1 + lsls r6, 1 + lsls r5, 1 + mov r9, r5 + cmp r0, 0 + beq _081A02F4 + adds r2, r7, 0 +_081A02D4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x8 + bhi _081A02F4 + ldr r0, [r2] + lsls r1, r3, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A02D4 +_081A02F4: + ldr r0, [r7] + adds r0, 0xB0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r6, r0 + mov r1, r12 + adds r1, 0x34 + adds r0, r1 + ldrh r0, [r0] + mov r1, sp + bl sub_81A01E8 + movs r3, 0 + cmp r3, r4 + bcs _081A0376 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r3, r0 + bge _081A0376 + adds r6, r7, 0 + adds r5, r1, 0 +_081A032A: + lsls r0, r3, 2 + adds r2, r5, r0 + adds r0, r2, 0 + adds r0, 0xB8 + ldrb r1, [r0] + lsls r0, r1, 30 + lsrs r0, 30 + cmp r0, 0x2 + bne _081A035C + lsls r0, r1, 28 + lsrs r0, 30 + cmp r0, r8 + bne _081A035C + lsrs r0, r1, 6 + cmp r0, 0 + beq _081A035C + lsls r0, r1, 26 + lsrs r0, 30 + lsls r0, 1 + mov r7, sp + adds r1, r7, r0 + adds r0, r2, 0 + adds r0, 0xBA + ldrh r0, [r0] + strh r0, [r1] +_081A035C: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + bcs _081A0376 + ldr r0, [r6] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r3, r0 + blt _081A032A +_081A0376: + mov r0, sp + add r0, r9 + ldrh r0, [r0] +_081A037C: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A0284 + + thumb_func_start sub_81A0390 +sub_81A0390: @ 81A0390 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r7, =gSaveBlock2Ptr + adds r6, r7, 0 + movs r4, 0 +_081A03A6: + ldr r0, [r6] + lsls r2, r5, 1 + adds r2, r5 + lsls r2, 2 + adds r0, r2 + adds r1, r0, 0 + adds r1, 0xE0 + strh r4, [r1] + adds r0, 0xEA + strh r4, [r0] + movs r3, 0 +_081A03BC: + ldr r0, [r6] + lsls r1, r3, 1 + adds r1, r2 + adds r0, 0xE2 + adds r0, r1 + strh r4, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _081A03BC + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A03A6 + ldr r0, [r7] + adds r0, 0xB1 + ldrb r0, [r0] + lsrs r3, r0, 6 + movs r5, 0 +_081A03E6: + lsls r0, r3, 2 + mov r1, sp + adds r2, r1, r0 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, 0xE0 + ldr r1, [r7] + adds r1, r0 + str r1, [r2] + adds r0, r3, 0x1 + movs r1, 0x3 + bl __modsi3 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A03E6 + movs r5, 0 + ldr r7, =gSaveBlock2Ptr + ldr r6, =gUnknown_086109A4 +_081A0416: + ldr r0, [r7] + mov r12, r0 + adds r0, 0xB4 + adds r0, r5 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r5 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + lsls r0, r5, 2 + mov r1, sp + adds r3, r1, r0 + ldr r4, [r3] + lsls r2, 1 + mov r0, r12 + adds r0, 0xB0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r2, r0 + adds r2, r6 + ldrh r0, [r2] + strh r0, [r4] + ldr r1, [r3] + ldrh r0, [r1] + adds r1, 0x2 + bl sub_81A01E8 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A0416 + movs r5, 0 + cmp r5, r8 + bcs _081A04D6 + ldr r7, =gSaveBlock2Ptr +_081A0470: + ldr r1, [r7] + lsls r0, r5, 2 + adds r4, r1, r0 + adds r0, r4, 0 + adds r0, 0xB8 + ldrb r2, [r0] + lsls r0, r2, 30 + lsrs r1, r0, 30 + lsls r0, r2, 28 + lsrs r3, r0, 30 + adds r6, r3, 0 + cmp r1, 0x1 + bne _081A04A8 + lsrs r0, r2, 6 + cmp r0, 0 + beq _081A04CC + lsls r0, r3, 2 + add r0, sp + ldr r1, [r0] + adds r0, r4, 0 + adds r0, 0xBA + ldrh r0, [r0] + strh r0, [r1, 0xA] + b _081A04CC + .pool +_081A04A8: + cmp r1, 0x2 + bne _081A04CC + lsls r0, r2, 24 + lsrs r0, 30 + cmp r0, 0 + beq _081A04CC + lsls r2, 26 + lsrs r2, 30 + lsls r0, r6, 2 + add r0, sp + ldr r1, [r0] + lsls r2, 1 + adds r1, 0x2 + adds r1, r2 + adds r0, r4, 0 + adds r0, 0xBA + ldrh r0, [r0] + strh r0, [r1] +_081A04CC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _081A0470 +_081A04D6: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A0390 + + thumb_func_start sub_81A04E4 +sub_81A04E4: @ 81A04E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + movs r7, 0x2 + cmp r0, 0x6 + bls _081A04FC + b _081A064C +_081A04FC: + lsls r0, 2 + ldr r1, =_081A050C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A050C: + .4byte _081A0528 + .4byte _081A0540 + .4byte _081A05B4 + .4byte _081A05F4 + .4byte _081A061C + .4byte _081A064C + .4byte _081A0634 +_081A0528: + movs r0, 0x12 + mov r10, r0 + movs r6, 0x8 + ldr r0, =gUnknown_085EAEB1 + str r0, [sp, 0xC] + ldr r0, =gUnknown_085EAEB8 + str r0, [sp, 0x10] + b _081A0652 + .pool +_081A0540: + movs r7, 0x3 + movs r1, 0x12 + mov r10, r1 + movs r6, 0x6 + movs r4, 0 + ldr r0, =gSpeciesNames + mov r9, r0 + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + movs r1, 0xB2 + adds r1, r3 + mov r12, r1 + adds r5, r3, 0 + adds r5, 0xB0 + ldr r0, =gUnknown_086109A4 + mov r8, r0 +_081A0560: + adds r0, r3, 0 + adds r0, 0xB4 + adds r0, r4 + ldrb r2, [r0] + mov r1, r12 + ldrb r0, [r1] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r4 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + lsls r2, 1 + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r2, r0 + add r2, r8 + ldrh r1, [r2] + lsls r0, r4, 2 + mov r2, sp + adds r2, r0 + adds r2, 0xC + movs r0, 0xB + muls r0, r1 + add r0, r9 + str r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A0560 + b _081A0652 + .pool +_081A05B4: + movs r0, 0x12 + mov r10, r0 + movs r6, 0x8 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + cmp r0, 0x2 + bls _081A05CC + b _081A06FA +_081A05CC: + ldr r0, =gUnknown_030062F0 + ldr r3, [r0] + ldrh r0, [r3, 0x2] + movs r2, 0xB + muls r0, r2 + ldr r1, =gSpeciesNames + adds r0, r1 + str r0, [sp, 0x10] + ldrh r0, [r3] + muls r0, r2 + adds r0, r1 + str r0, [sp, 0xC] + b _081A0652 + .pool +_081A05F4: + movs r1, 0x11 + mov r10, r1 + movs r6, 0x8 + ldr r0, =gUnknown_030062F0 + ldr r3, [r0] + ldrh r0, [r3, 0x4] + movs r2, 0xD + muls r0, r2 + ldr r1, =gMoveNames + adds r0, r1 + str r0, [sp, 0xC] + ldrh r0, [r3, 0x6] + muls r0, r2 + adds r0, r1 + str r0, [sp, 0x10] + b _081A0652 + .pool +_081A061C: + movs r0, 0x12 + mov r10, r0 + movs r6, 0x8 + ldr r0, =gUnknown_085ED193 + str r0, [sp, 0xC] + ldr r0, =gUnknown_085ED198 + str r0, [sp, 0x10] + b _081A0652 + .pool +_081A0634: + movs r1, 0x14 + mov r10, r1 + movs r6, 0x8 + ldr r0, =gUnknown_085EAE62 + str r0, [sp, 0xC] + ldr r0, =gUnknown_085EAE66 + str r0, [sp, 0x10] + b _081A0652 + .pool +_081A064C: + movs r0, 0 + mov r10, r0 + movs r6, 0 +_081A0652: + movs r5, 0 + movs r4, 0 + lsls r1, r7, 25 + mov r8, r1 + cmp r4, r7 + bcs _081A067E +_081A065E: + lsls r0, r4, 2 + add r0, sp + adds r0, 0xC + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + cmp r0, r5 + ble _081A0674 + adds r5, r0, 0 +_081A0674: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _081A065E +_081A067E: + adds r0, r5, 0 + bl convert_pixel_width_to_tile_width + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r0, r10 + adds r1, r4, 0 + bl sub_80E2D5C + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + mov r0, r8 + lsrs r3, r0, 24 + mov r0, r10 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_81A0784 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + movs r4, 0 + cmp r4, r7 + bcs _081A06E6 +_081A06B8: + lsls r0, r4, 2 + add r0, sp + adds r0, 0xC + ldr r2, [r0] + lsls r0, r4, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _081A06B8 +_081A06E6: + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0x1 + adds r1, r7, 0 + adds r2, r5, 0 + bl sub_81A0804 +_081A06FA: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A04E4 + + thumb_func_start sub_81A070C +sub_81A070C: @ 81A070C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081A0730 + bl ProcessMenuInputNoWrapAround + b _081A0734 + .pool +_081A0730: + bl ProcessMenuInput +_081A0734: + lsls r0, 24 + lsrs r0, 24 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081A0778 + adds r0, 0x1 + cmp r1, r0 + bne _081A0764 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081A0778 + movs r0, 0x5 + bl PlaySE + ldr r1, =gScriptResult + movs r0, 0x7F + strh r0, [r1] + b _081A0768 + .pool +_081A0764: + ldr r0, =gScriptResult + strh r1, [r0] +_081A0768: + ldrb r0, [r4, 0xC] + bl sub_81A07E8 + adds r0, r5, 0 + bl DestroyTask + bl EnableBothScriptContexts +_081A0778: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A070C + + thumb_func_start sub_81A0784 +sub_81A0784: @ 81A0784 + push {r4,r5,lr} + sub sp, 0x20 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsls r5, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x80 + lsls r0, 17 + adds r4, r0 + lsrs r4, 24 + adds r5, r0 + lsrs r5, 24 + str r2, [sp] + str r3, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x64 + str r0, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_8198A50 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + add r0, sp, 0x18 + bl AddWindow + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + adds r0, r4, 0 + add sp, 0x20 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A0784 + + thumb_func_start sub_81A07E8 +sub_81A07E8: @ 81A07E8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8198070 + adds r0, r4, 0 + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A07E8 + + thumb_func_start sub_81A0804 +sub_81A0804: @ 81A0804 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, =sub_81A070C + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + strh r4, [r1, 0x10] + cmp r5, 0x3 + bls _081A0840 + movs r0, 0x1 + b _081A0842 + .pool +_081A0840: + movs r0, 0 +_081A0842: + strh r0, [r1, 0x12] + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x14] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0804 + + thumb_func_start sub_81A085C +sub_81A085C: @ 81A085C + push {lr} + ldr r1, =gUnknown_086114E0 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A085C + + thumb_func_start sub_81A087C +sub_81A087C: @ 81A087C + push {r4-r7,lr} + bl sub_819FBC8 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + adds r1, 0xB1 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0xB1 + ldrb r2, [r1] + movs r0, 0x3D + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0xB1 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0xB2 + ldrb r2, [r1] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r4, 0 + movs r1, 0 +_081A08BE: + ldr r0, [r3] + adds r0, 0xB4 + adds r0, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A08BE + movs r4, 0 + ldr r5, =gSaveBlock2Ptr + movs r0, 0x4 + negs r0, r0 + mov r12, r0 + movs r7, 0xD + negs r7, r7 + movs r6, 0x31 + negs r6, r6 +_081A08E2: + ldr r1, [r5] + lsls r3, r4, 2 + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + mov r0, r12 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, r3 + adds r0, 0xBA + movs r1, 0 + strh r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x8 + bls _081A08E2 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A087C + + thumb_func_start sub_81A093C +sub_81A093C: @ 81A093C + push {lr} + bl sub_819FBB0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081A0954 + ldr r0, =gScriptResult + strh r1, [r0] + b _081A095A + .pool +_081A0954: + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] +_081A095A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A093C + + thumb_func_start sub_81A0964 +sub_81A0964: @ 81A0964 + push {lr} + ldr r0, =gSpecialVar_0x8005 + ldrb r0, [r0] + bl sub_819FC40 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0964 + + thumb_func_start sub_81A0978 +sub_81A0978: @ 81A0978 + push {lr} + bl sub_819FBC8 + pop {r0} + bx r0 + thumb_func_end sub_81A0978 + + thumb_func_start sub_81A0984 +sub_81A0984: @ 81A0984 + push {lr} + bl sub_819FD64 + pop {r0} + bx r0 + thumb_func_end sub_81A0984 + + thumb_func_start sub_81A0990 +sub_81A0990: @ 81A0990 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r2, 0xB1 + ldrb r3, [r2] + lsls r1, r3, 26 + lsrs r1, 28 + adds r1, 0x1 + movs r0, 0xF + ands r1, r0 + lsls r1, 2 + movs r0, 0x3D + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_81A0990 + + thumb_func_start sub_81A09B4 +sub_81A09B4: @ 81A09B4 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A09B4 + + thumb_func_start sub_81A09D0 +sub_81A09D0: @ 81A09D0 + push {lr} + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r1, r0, 0x3 + cmp r1, 0 + bge _081A09F4 + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + b _081A0A1C + .pool +_081A09F4: + ldr r2, =gScriptResult + cmp r1, 0x8 + ble _081A09FE + movs r0, 0x1 + strh r0, [r2] +_081A09FE: + ldr r0, [r3] + lsls r1, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A0A18 + movs r0, 0x1 + b _081A0A1A + .pool +_081A0A18: + movs r0, 0 +_081A0A1A: + strh r0, [r2] +_081A0A1C: + pop {r0} + bx r0 + thumb_func_end sub_81A09D0 + + thumb_func_start sub_81A0A20 +sub_81A0A20: @ 81A0A20 + push {lr} + ldr r0, =gSpecialVar_0x8005 + ldrb r0, [r0] + bl sub_81A04E4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0A20 + + thumb_func_start sub_81A0A34 +sub_81A0A34: @ 81A0A34 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8197224 + lsls r0, 16 + cmp r0, 0 + bne _081A0A68 + adds r0, r4, 0 + bl DestroyTask + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A0A64 + ldr r0, =EnableBothScriptContexts + bl sub_81A172C + b _081A0A68 + .pool +_081A0A64: + bl EnableBothScriptContexts +_081A0A68: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A0A34 + + thumb_func_start sub_81A0A70 +sub_81A0A70: @ 81A0A70 + push {lr} + ldr r1, =gSpecialVar_0x8006 + ldrh r0, [r1] + cmp r0, 0x6 + bne _081A0A94 + ldr r1, =gUnknown_08610FF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .pool +_081A0A94: + cmp r0, 0x7 + bne _081A0AB0 + ldr r1, =gUnknown_08610FF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0AB0: + cmp r0, 0x8 + bne _081A0ACC + ldr r1, =gUnknown_086111B0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .pool +_081A0ACC: + cmp r0, 0x9 + bne _081A0AE8 + ldr r1, =gUnknown_086111B0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0AE8: + cmp r0, 0x4 + bne _081A0B04 + ldr r1, =gUnknown_08611230 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .pool +_081A0B04: + cmp r0, 0x5 + bne _081A0B20 + ldr r1, =gUnknown_08611230 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0B20: + cmp r0, 0xA + bne _081A0B40 + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + b _081A0BD6 + .pool +_081A0B40: + cmp r0, 0xB + bne _081A0B5C + ldr r1, =gUnknown_086112B0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .pool +_081A0B5C: + cmp r0, 0xC + bne _081A0B7C + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0xC + b _081A0BD6 + .pool +_081A0B7C: + cmp r0, 0xD + bne _081A0B9C + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + b _081A0BD6 + .pool +_081A0B9C: + ldrh r0, [r1] + cmp r0, 0x10 + bne _081A0BC0 + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x10 + b _081A0BD6 + .pool +_081A0BC0: + cmp r0, 0xE + bne _081A0BE4 + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x8 +_081A0BD6: + adds r0, r2 + ldr r1, [r0] + b _081A0C7A + .pool +_081A0BE4: + cmp r0, 0xF + bne _081A0C00 + ldr r1, =gUnknown_086112B0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0C00: + cmp r0, 0 + bne _081A0C1C + ldr r1, =gUnknown_08610EF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + b _081A0C66 + .pool +_081A0C1C: + cmp r0, 0x1 + bne _081A0C38 + ldr r1, =gUnknown_08610EF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0C38: + cmp r0, 0x2 + bne _081A0C54 + ldr r1, =gUnknown_08610EF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0x8 + b _081A0C66 + .pool +_081A0C54: + cmp r0, 0x3 + bne _081A0C74 + ldr r1, =gUnknown_08610EF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0xC +_081A0C66: + adds r0, r1 + ldr r1, [r0] + b _081A0C7A + .pool +_081A0C74: + bl EnableBothScriptContexts + b _081A0C8E +_081A0C7A: + ldr r0, =gStringVar4 + bl StringExpandPlaceholders + movs r0, 0x1 + bl AddTextPrinterForMessage + ldr r0, =sub_81A0A34 + movs r1, 0x1 + bl CreateTask +_081A0C8E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0A70 + + thumb_func_start sub_81A0C9C +sub_81A0C9C: @ 81A0C9C + push {lr} + bl ScriptContext2_Enable + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + bl sub_81A0A70 + pop {r0} + bx r0 + thumb_func_end sub_81A0C9C + + thumb_func_start sub_81A0CC0 +sub_81A0CC0: @ 81A0CC0 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r1, r0, 26 + lsrs r0, r1, 28 + cmp r0, 0x2 + bhi _081A0CE4 + ldr r1, =gScriptResult + movs r0, 0x2 + b _081A0D34 + .pool +_081A0CE4: + lsrs r0, r1, 28 + cmp r0, 0xB + bhi _081A0D30 + lsrs r0, r1, 28 + subs r0, 0x3 + lsls r0, 2 + adds r0, r2, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x2 + beq _081A0D18 + cmp r0, 0x2 + bgt _081A0D08 + cmp r0, 0x1 + beq _081A0D0E + b _081A0D30 +_081A0D08: + cmp r0, 0x3 + beq _081A0D24 + b _081A0D30 +_081A0D0E: + ldr r1, =gScriptResult + movs r0, 0x4 + b _081A0D34 + .pool +_081A0D18: + ldr r1, =gScriptResult + movs r0, 0x3 + b _081A0D34 + .pool +_081A0D24: + ldr r1, =gScriptResult + movs r0, 0x1 + b _081A0D34 + .pool +_081A0D30: + ldr r1, =gScriptResult + movs r0, 0x5 +_081A0D34: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0CC0 + + thumb_func_start sub_81A0D40 +sub_81A0D40: @ 81A0D40 + push {r4,lr} + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A0D6E + ldr r4, =gSpecialVar_0x8006 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r2, 0xB2 + ldrb r3, [r2] + lsls r0, r3, 29 + lsrs r0, 29 + movs r1, 0x1 + ldrb r4, [r4] + lsls r1, r4 + orrs r1, r0 + movs r0, 0x7 + ands r1, r0 + movs r0, 0x8 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_081A0D6E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0D40 + + thumb_func_start sub_81A0D80 +sub_81A0D80: @ 81A0D80 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r1, r0, 26 + lsrs r0, r1, 28 + cmp r0, 0x2 + bls _081A0DCE + subs r0, 0x3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A0DC0 + lsls r2, 2 + adds r2, r3, r2 + adds r2, 0xB8 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + b _081A0DCE + .pool +_081A0DC0: + lsls r0, r2, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r2, [r0] + movs r1, 0x3F + ands r1, r2 + strb r1, [r0] +_081A0DCE: + pop {r0} + bx r0 + thumb_func_end sub_81A0D80 + + thumb_func_start sub_81A0DD4 +sub_81A0DD4: @ 81A0DD4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r6, 0 + movs r2, 0 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + ldr r3, =gUnknown_030062F0 + mov r9, r3 + cmp r0, 0 + beq _081A0E14 + adds r3, r1, 0 +_081A0DF4: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bhi _081A0E14 + ldr r0, [r3] + lsls r1, r2, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A0DF4 +_081A0E14: + mov r4, r9 + movs r0, 0x8 + bl AllocZeroed + adds r7, r0, 0 + str r7, [r4] + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x2 + bne _081A0E88 + ldr r0, =gSaveBlock2Ptr + ldr r5, [r0] + adds r6, r5, 0 + adds r6, 0xB1 + ldrb r0, [r6] + lsls r1, r0, 26 + lsrs r0, r1, 28 + cmp r0, 0x2 + bls _081A0E3C + b _081A0FCE +_081A0E3C: + adds r2, r5, 0 + adds r2, 0xB4 + adds r0, r2, r0 + ldrb r0, [r0] + lsrs r4, r0, 4 + ldr r3, =gUnknown_08610970 + lsls r1, r4, 1 + adds r5, 0xB0 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0 + adds r3, 0x34 + adds r1, r3 + ldrh r0, [r1] + strh r0, [r7, 0x2] + ldrb r0, [r6] + lsls r0, 26 + lsrs r0, 28 + adds r2, r0 + ldrb r1, [r2] + movs r0, 0xF + ands r0, r1 + lsls r0, 1 + ldrb r1, [r5] + muls r1, r4 + adds r0, r1 + adds r0, r3 + b _081A0FCA + .pool +_081A0E88: + cmp r0, 0x3 + bne _081A0F54 + ldr r0, =gSaveBlock2Ptr + mov r8, r0 + ldr r5, [r0] + movs r1, 0xB1 + adds r1, r5 + mov r12, r1 + ldrb r0, [r1] + lsls r2, r0, 26 + lsrs r0, r2, 28 + cmp r0, 0x2 + bhi _081A0EA4 + b _081A0FCE +_081A0EA4: + adds r1, r0, 0 + adds r0, r6, 0x3 + cmp r1, r0 + blt _081A0EAE + b _081A0FCE +_081A0EAE: + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x2 + beq _081A0EC4 + b _081A0FCE +_081A0EC4: + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r6, r0, 30 + adds r0, r5, 0 + adds r0, 0xB2 + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 29 + asrs r1, r6 + movs r0, 0x1 + ands r1, r0 + adds r0, r5, 0 + adds r0, 0xB4 + adds r0, r6 + ldrb r4, [r0] + lsls r1, 2 + asrs r4, r1 + movs r0, 0xF + ands r4, r0 + ldr r2, =gUnknown_08610970 + lsls r1, r4, 1 + adds r0, r5, 0 + adds r0, 0xB0 + ldrb r3, [r0] + movs r0, 0x58 + muls r0, r3 + adds r1, r0 + adds r2, 0x34 + adds r1, r2 + ldrh r0, [r1] + strh r0, [r7] + mov r3, r12 + ldrb r0, [r3] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0xB8 + ldrb r2, [r0] + lsls r2, 26 + lsrs r2, 30 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81A0284 + mov r1, r9 + ldr r2, [r1] + strh r0, [r2, 0x4] + mov r3, r8 + ldr r1, [r3] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + adds r1, 0xBA + ldrh r0, [r1] + strh r0, [r2, 0x6] + b _081A0FCE + .pool +_081A0F54: + cmp r0, 0x4 + bne _081A0FCE + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r2, r0, 26 + lsrs r0, r2, 28 + cmp r0, 0x2 + bls _081A0FCE + adds r1, r0, 0 + adds r0, r6, 0x3 + cmp r1, r0 + bge _081A0FCE + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _081A0FCE + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r6, r0, 30 + adds r0, r3, 0 + adds r0, 0xB2 + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 29 + asrs r1, r6 + movs r0, 0x1 + ands r1, r0 + adds r0, r3, 0 + adds r0, 0xB4 + adds r0, r6 + ldrb r0, [r0] + lsls r1, 2 + asrs r0, r1 + movs r1, 0xF + ands r0, r1 + ldr r2, =gUnknown_08610970 + lsls r0, 1 + adds r1, r3, 0 + adds r1, 0xB0 + ldrb r3, [r1] + movs r1, 0x58 + muls r1, r3 + adds r0, r1 + adds r2, 0x34 + adds r0, r2 +_081A0FCA: + ldrh r0, [r0] + strh r0, [r7] +_081A0FCE: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0DD4 + + thumb_func_start sub_81A0FE4 +sub_81A0FE4: @ 81A0FE4 + push {r4,lr} + ldr r4, =gUnknown_030062F0 + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0FE4 + + thumb_func_start sub_81A0FFC +sub_81A0FFC: @ 81A0FFC + push {r4-r6,lr} + sub sp, 0x10 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A1028 + cmp r0, 0x1 + bgt _081A1018 + cmp r0, 0 + beq _081A101E + b _081A11E6 + .pool +_081A1018: + cmp r0, 0x2 + beq _081A1030 + b _081A11E6 +_081A101E: + ldr r5, =gStringVar1 + b _081A1032 + .pool +_081A1028: + ldr r5, =gStringVar2 + b _081A1032 + .pool +_081A1030: + ldr r5, =gStringVar3 +_081A1032: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0x9 + bls _081A103C + b _081A11E6 +_081A103C: + lsls r0, 2 + ldr r1, =_081A1054 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A1054: + .4byte _081A107C + .4byte _081A1094 + .4byte _081A10AC + .4byte _081A10C4 + .4byte _081A10DC + .4byte _081A10F4 + .4byte _081A1118 + .4byte _081A1164 + .4byte _081A1140 + .4byte _081A1184 +_081A107C: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + b _081A1174 + .pool +_081A1094: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0, 0x2] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + b _081A1174 + .pool +_081A10AC: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + b _081A1174 + .pool +_081A10C4: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + b _081A1174 + .pool +_081A10DC: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0, 0x6] + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + b _081A1174 + .pool +_081A10F4: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + adds r1, 0xBA + ldrh r0, [r1] + bl ItemId_GetItem + adds r1, r0, 0 + b _081A1174 + .pool +_081A1118: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_81A1650 + adds r1, r0, 0 + mov r0, sp + movs r2, 0x2 + bl sub_81DB5E8 + adds r0, r5, 0 + mov r1, sp + bl StringCopy + b _081A11E6 + .pool +_081A1140: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _081A115C + ldr r1, =gUnknown_085EAEB1 + b _081A1174 + .pool +_081A115C: + ldr r1, =gUnknown_085EAEB8 + b _081A1174 + .pool +_081A1164: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 1 + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + ldr r1, =gStringVar4 +_081A1174: + adds r0, r5, 0 + bl StringCopy + b _081A11E6 + .pool +_081A1184: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + adds r1, r3, 0 + adds r1, 0xB1 + ldrb r1, [r1] + lsls r4, r1, 24 + lsrs r1, r4, 30 + adds r6, r0, 0 + cmp r1, 0x2 + bhi _081A11C0 + adds r0, r3, 0 + adds r0, 0xB4 + adds r0, r1 + ldrb r2, [r0] + adds r0, r3, 0 + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + b _081A11C2 + .pool +_081A11C0: + movs r2, 0 +_081A11C2: + ldr r3, =gUnknown_08610970 + lsls r1, r2, 1 + ldr r0, [r6] + adds r0, 0xB0 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + adds r3, 0x34 + adds r1, r3 + ldrh r1, [r1] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r5, 0 + bl StringCopy +_081A11E6: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0FFC + + thumb_func_start sub_81A11F8 +sub_81A11F8: @ 81A11F8 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8005 + ldrb r1, [r0] + adds r2, 0xB1 + lsls r1, 6 + ldrb r3, [r2] + movs r0, 0x3F + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_81A11F8 + + thumb_func_start sub_81A1218 +sub_81A1218: @ 81A1218 + push {lr} + bl sub_81AAC28 + pop {r0} + bx r0 + thumb_func_end sub_81A1218 + + thumb_func_start sub_81A1224 +sub_81A1224: @ 81A1224 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r1, =gSaveBlock2Ptr + ldr r3, [r1] + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + adds r7, r1, 0 + cmp r0, 0x2 + bhi _081A1242 + b _081A1362 +_081A1242: + movs r5, 0 + movs r2, 0 + adds r0, r3, 0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + ldr r1, =gSpecialVar_0x8005 + mov r12, r1 + ldr r1, =gScriptResult + mov r8, r1 + cmp r0, 0 + beq _081A127C + adds r3, r7, 0 +_081A125C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bhi _081A127C + ldr r0, [r3] + lsls r1, r2, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A125C +_081A127C: + movs r4, 0 + cmp r4, r5 + bcs _081A1322 + ldr r0, [r7] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r4, r0 + bge _081A1322 + adds r6, r7, 0 + mov r9, r4 +_081A1296: + ldr r3, [r6] + lsls r0, r4, 2 + adds r2, r3, r0 + adds r0, r2, 0 + adds r0, 0xB8 + ldrb r1, [r0] + lsls r0, r1, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _081A1308 + lsrs r0, r1, 6 + cmp r0, 0 + beq _081A1308 + adds r0, r2, 0 + adds r0, 0xBA + ldrh r0, [r0] + mov r2, r12 + ldrh r2, [r2] + cmp r0, r2 + bne _081A1308 + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r2, [r0] + movs r1, 0x3F + ands r1, r2 + strb r1, [r0] + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + mov r2, r12 + ldrh r0, [r2] + adds r1, 0xBA + strh r0, [r1] + mov r1, r9 + mov r0, r8 + strh r1, [r0] + b _081A1362 + .pool +_081A1308: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcs _081A1322 + ldr r0, [r6] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r4, r0 + blt _081A1296 +_081A1322: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r2, r0 + adds r2, 0xB8 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + mov r2, r12 + ldrh r0, [r2] + adds r1, 0xBA + strh r0, [r1] + movs r0, 0x1 + mov r1, r8 + strh r0, [r1] +_081A1362: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A1224 + + thumb_func_start sub_81A1370 +sub_81A1370: @ 81A1370 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + movs r2, 0x8A + lsls r2, 1 + adds r1, r2 + ldrb r1, [r1] + adds r4, r0, 0 + cmp r1, 0xFF + beq _081A1422 + movs r5, 0 +_081A138E: + ldr r1, [r4] + adds r2, r5, 0x1 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r3, r1, r0 + movs r5, 0x8A + lsls r5, 1 + adds r0, r3, r5 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081A13B8 + adds r0, r3, 0 + adds r0, 0xDC + adds r1, 0xDC + movs r2, 0x44 + bl memcpy + b _081A1422 + .pool +_081A13B8: + adds r5, r2, 0 + cmp r5, 0x2 + ble _081A138E + ldr r0, =0x0000ffff + mov r10, r0 + movs r2, 0x1 + negs r2, r2 + mov r9, r2 + movs r5, 0x1 + ldr r7, =gSaveBlock2Ptr + movs r0, 0x90 + lsls r0, 1 + mov r8, r0 + movs r6, 0x44 +_081A13D4: + ldr r0, [r7] + add r0, r8 + adds r0, 0x34 + bl ReadUnalignedWord + adds r4, r0, 0 + ldr r0, [r7] + adds r0, 0xA + bl ReadUnalignedWord + cmp r4, r0 + bne _081A13FC + ldr r0, [r7] + adds r0, r6 + adds r0, 0xDE + ldrb r0, [r0] + cmp r0, r10 + bge _081A13FC + mov r10, r0 + mov r9, r5 +_081A13FC: + movs r2, 0x44 + add r8, r2 + adds r6, 0x44 + adds r5, 0x1 + cmp r5, 0x3 + ble _081A13D4 + mov r5, r9 + cmp r5, 0 + ble _081A1422 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r5, 4 + add r0, r9 + lsls r0, 2 + adds r0, r1, r0 + adds r0, 0xDC + adds r1, 0xDC + bl memcpy +_081A1422: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1370 + + thumb_func_start sub_81A1438 +sub_81A1438: @ 81A1438 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0xB0 + ldrb r0, [r0] + adds r2, 0xDC + movs r1, 0x1F + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x20 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r1, [r0] + lsls r1, 30 + adds r2, 0xDC + lsrs r1, 25 + ldrb r3, [r2] + movs r0, 0x61 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + movs r2, 0 + ldr r0, [r4] + b _081A148C + .pool +_081A147C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bhi _081A1496 + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, r1 +_081A148C: + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A147C +_081A1496: + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + adds r0, 0xDD + strb r2, [r0] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xDE + ldrb r0, [r1] + cmp r0, 0xFE + bhi _081A14AE + adds r0, 0x1 + strb r0, [r1] +_081A14AE: + ldr r0, [r4] + adds r0, 0xDD + ldrb r0, [r0] + bl sub_81A0390 + movs r2, 0 + adds r3, r4, 0 + movs r4, 0x88 + lsls r4, 1 + adds r5, r3, 0 +_081A14C2: + ldr r0, [r3] + adds r1, r0, r4 + adds r1, r2 + adds r0, 0xA + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _081A14C2 + ldr r1, [r5] + movs r2, 0x8A + lsls r2, 1 + adds r0, r1, r2 + bl StringCopy + ldr r1, [r5] + ldr r0, =gGameLanguage + ldrb r0, [r0] + ldr r2, =0x0000011b + adds r1, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0xDC + bl sub_8165AE8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1438 + + thumb_func_start sub_81A150C +sub_81A150C: @ 81A150C + push {lr} + ldr r2, =gUnknown_08610970 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x32 + ldrb r2, [r0] + movs r1, 0 + ldr r3, =gUnknown_085DCEDC + ldrb r0, [r3] + cmp r0, r2 + beq _081A1542 +_081A1530: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1D + bhi _081A1542 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A1530 +_081A1542: + cmp r1, 0x1E + beq _081A1568 + ldr r0, =gUnknown_085DCF0E + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, =0x00004010 + bl VarSet + b _081A1594 + .pool +_081A1568: + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _081A1584 +_081A1572: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bhi _081A1584 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A1572 +_081A1584: + cmp r1, 0x14 + beq _081A1594 + ldr r0, =gUnknown_085DCF2C + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, =0x00004010 + bl VarSet +_081A1594: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A150C + + thumb_func_start sub_81A15A4 +sub_81A15A4: @ 81A15A4 + push {lr} + ldr r2, =gUnknown_08610970 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x32 + ldrb r2, [r0] + movs r1, 0 + ldr r3, =gUnknown_085DCEDC + ldrb r0, [r3] + cmp r0, r2 + beq _081A15D6 +_081A15C4: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1D + bhi _081A15D6 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A15C4 +_081A15D6: + cmp r1, 0x1E + beq _081A15FC + ldr r0, =gUnknown_085DCF0E + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, =0x00004010 + bl VarSet + b _081A1628 + .pool +_081A15FC: + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _081A1618 +_081A1606: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bhi _081A1618 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A1606 +_081A1618: + cmp r1, 0x14 + beq _081A1628 + ldr r0, =gUnknown_085DCF2C + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, =0x00004010 + bl VarSet +_081A1628: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A15A4 + + thumb_func_start sub_81A1638 +sub_81A1638: @ 81A1638 + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x1 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A1638 + + thumb_func_start sub_81A1644 +sub_81A1644: @ 81A1644 + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x1 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A1644 + + thumb_func_start sub_81A1650 +sub_81A1650: @ 81A1650 + push {lr} + movs r2, 0x58 + muls r2, r0 + ldr r0, =gUnknown_08610970 + adds r2, r0 + subs r0, r1, 0x1 + cmp r0, 0x6 + bhi _081A16AC + lsls r0, 2 + ldr r1, =_081A1674 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A1674: + .4byte _081A1690 + .4byte _081A1694 + .4byte _081A169A + .4byte _081A16A0 + .4byte _081A16A6 + .4byte _081A16AC + .4byte _081A16AC +_081A1690: + adds r0, r2, 0 + b _081A16B0 +_081A1694: + adds r0, r2, 0 + adds r0, 0x8 + b _081A16B0 +_081A169A: + adds r0, r2, 0 + adds r0, 0x10 + b _081A16B0 +_081A16A0: + adds r0, r2, 0 + adds r0, 0x18 + b _081A16B0 +_081A16A6: + adds r0, r2, 0 + adds r0, 0x20 + b _081A16B0 +_081A16AC: + adds r0, r2, 0 + adds r0, 0x28 +_081A16B0: + pop {r1} + bx r1 + thumb_func_end sub_81A1650 + + thumb_func_start sub_81A16B4 +sub_81A16B4: @ 81A16B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081A16CE + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081A16D4 +_081A16CE: + adds r0, r2, 0 + bl SwitchTaskToFollowupFunc +_081A16D4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A16B4 + + thumb_func_start sub_81A16DC +sub_81A16DC: @ 81A16DC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081A16F6 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081A1718 +_081A16F6: + ldr r2, =gUnknown_030062F4 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + movs r3, 0xA + ldrsh r0, [r0, r3] + lsls r0, 16 + orrs r1, r0 + str r1, [r2] + bl _call_via_r1 + adds r0, r4, 0 + bl DestroyTask +_081A1718: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A16DC + + thumb_func_start sub_81A172C +sub_81A172C: @ 81A172C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =sub_81A16DC + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + lsrs r4, 16 + strh r4, [r1, 0xA] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A172C + + thumb_func_start sub_81A175C +sub_81A175C: @ 81A175C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =sub_81A16B4 + adds r0, r4, 0 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r2, r5, 0 + bl SetTaskFuncWithFollowupFunc + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A175C + + thumb_func_start sub_81A1780 +sub_81A1780: @ 81A1780 + push {lr} + ldr r1, =gUnknown_08611C18 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1780 + + thumb_func_start sub_81A17A0 +sub_81A17A0: @ 81A17A0 + push {lr} + movs r0, 0x80 + lsls r0, 7 + movs r1, 0xFF + bl VarSet + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + bhi _081A1822 + lsls r0, 2 + ldr r1, =_081A17D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A17D0: + .4byte _081A1822 + .4byte _081A17E4 + .4byte _081A1810 + .4byte _081A17EC + .4byte _081A17E8 +_081A17E4: + movs r0, 0 + b _081A17EE +_081A17E8: + movs r0, 0 + b _081A17EE +_081A17EC: + movs r0, 0x1 +_081A17EE: + bl sub_813A878 + movs r0, 0x80 + lsls r0, 7 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r2, =0x00000ca8 + adds r1, r2 + ldrb r1, [r1] + bl VarSet + b _081A1822 + .pool +_081A1810: + movs r0, 0x80 + lsls r0, 7 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r2, =0x00000ca8 + adds r1, r2 + ldrb r1, [r1] + bl VarSet +_081A1822: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A17A0 + + thumb_func_start sub_81A1830 +sub_81A1830: @ 81A1830 + push {r4-r6,lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + bl sub_81A3B30 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bne _081A184C + movs r5, 0x1 +_081A184C: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x7 + bls _081A1856 + b _081A1956 +_081A1856: + lsls r0, 2 + ldr r1, =_081A186C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A186C: + .4byte _081A188C + .4byte _081A18A8 + .4byte _081A18C8 + .4byte _081A18E4 + .4byte _081A1956 + .4byte _081A1900 + .4byte _081A1918 + .4byte _081A1938 +_081A188C: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ca8 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1] + b _081A1956 + .pool +_081A18A8: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + strh r0, [r1] + b _081A1956 + .pool +_081A18C8: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000cb2 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + b _081A1956 + .pool +_081A18E4: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + b _081A1926 + .pool +_081A1900: + ldr r2, =gScriptResult + ldr r1, =gBattleOutcome + ldrb r0, [r1] + strh r0, [r2] + movs r0, 0 + strb r0, [r1] + b _081A1956 + .pool +_081A1918: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 28 +_081A1926: + lsrs r0, 31 + strh r0, [r1] + b _081A1956 + .pool +_081A1938: + ldr r4, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + movs r0, 0xD0 + lsls r0, 4 + adds r2, r0 + ldr r3, =gUnknown_08611BFC + lsls r0, r5, 1 + lsls r1, r6, 2 + adds r0, r1 + adds r0, r3 + ldrh r1, [r2] + ldrh r0, [r0] + ands r0, r1 + strh r0, [r4] +_081A1956: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1830 + + thumb_func_start sub_81A1968 +sub_81A1968: @ 81A1968 + push {r4,r5,lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_81A3B30 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bne _081A1984 + movs r4, 0x1 +_081A1984: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x7 + bls _081A198E + b _081A1AC4 +_081A198E: + lsls r0, 2 + ldr r1, =_081A19A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A19A4: + .4byte _081A19C4 + .4byte _081A19E0 + .4byte _081A1A0C + .4byte _081A1A28 + .4byte _081A1A50 + .4byte _081A1AC4 + .4byte _081A1A7C + .4byte _081A1AA8 +_081A19C4: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + b _081A1AC4 + .pool +_081A19E0: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r2, r1 + movs r1, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _081A1AC4 + .pool +_081A1A0C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000cb2 + adds r0, r2 + strh r1, [r0] + b _081A1AC4 + .pool +_081A1A28: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + b _081A1A94 + .pool +_081A1A50: + movs r2, 0 + ldr r5, =gSaveBlock2Ptr + ldr r4, =0x00000caa + ldr r3, =gUnknown_0203CEF8 +_081A1A58: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + adds r0, r2, r3 + ldrb r0, [r0] + strh r0, [r1] + adds r2, 0x1 + cmp r2, 0x3 + ble _081A1A58 + b _081A1AC4 + .pool +_081A1A7C: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000ca9 + adds r3, r2 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 +_081A1A94: + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _081A1AC4 + .pool +_081A1AA8: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + movs r0, 0xD0 + lsls r0, 4 + adds r2, r0 + ldr r3, =gUnknown_08611BFC + lsls r1, r4, 1 + lsls r0, r5, 2 + adds r1, r0 + adds r1, r3 + ldrh r0, [r2] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2] +_081A1AC4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1968 + + thumb_func_start sub_81A1AD4 +sub_81A1AD4: @ 81A1AD4 + push {r4-r7,lr} + bl sub_81B8558 + movs r3, 0 + ldr r4, =gSpecialVar_0x8005 + ldrh r0, [r4] + cmp r3, r0 + bge _081A1B00 + ldr r7, =gUnknown_0203CEF8 + ldr r6, =gSaveBlock2Ptr + ldr r5, =0x00000caa +_081A1AEA: + adds r2, r3, r7 + ldr r0, [r6] + lsls r1, r3, 1 + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + strb r0, [r2] + adds r3, 0x1 + ldrh r0, [r4] + cmp r3, r0 + blt _081A1AEA +_081A1B00: + bl sub_80F94E8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1AD4 + + thumb_func_start sub_81A1B1C +sub_81A1B1C: @ 81A1B1C + push {lr} + bl DoSoftReset + pop {r0} + bx r0 + thumb_func_end sub_81A1B1C + + thumb_func_start sub_81A1B28 +sub_81A1B28: @ 81A1B28 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + bx lr + .pool + thumb_func_end sub_81A1B28 + + thumb_func_start sub_81A1B38 +sub_81A1B38: @ 81A1B38 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0x64 +_081A1B3E: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000caa + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _081A1B76 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldrh r1, [r1] + subs r1, 0x1 + muls r1, r5 + adds r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r0, r1 + ldr r2, =gPlayerParty + adds r1, r4, 0 + muls r1, r5 + adds r1, r2 + movs r2, 0x64 + bl memcpy +_081A1B76: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A1B3E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1B38 + + thumb_func_start sub_81A1B98 +sub_81A1B98: @ 81A1B98 + push {lr} + ldr r0, =gSpecialVar_0x8006 + ldrh r1, [r0] + adds r2, r0, 0 + cmp r1, 0x3 + bls _081A1BA8 + movs r0, 0 + strh r0, [r2] +_081A1BA8: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x7 + bhi _081A1C1E + lsls r0, 2 + ldr r1, =_081A1BC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A1BC8: + .4byte _081A1BE8 + .4byte _081A1BF0 + .4byte _081A1BF8 + .4byte _081A1C0E + .4byte _081A1C06 + .4byte _081A1C00 + .4byte _081A1C14 + .4byte _081A1C1A +_081A1BE8: + ldrb r0, [r2] + bl sub_81A1EA8 + b _081A1C1E +_081A1BF0: + ldrb r0, [r2] + bl sub_81A2134 + b _081A1C1E +_081A1BF8: + ldrb r0, [r2] + bl sub_81A2460 + b _081A1C1E +_081A1C00: + bl sub_81A2698 + b _081A1C1E +_081A1C06: + ldrb r0, [r2] + bl sub_81A2C94 + b _081A1C1E +_081A1C0E: + bl sub_81A2968 + b _081A1C1E +_081A1C14: + bl sub_81A2F38 + b _081A1C1E +_081A1C1A: + bl sub_81A2FF8 +_081A1C1E: + pop {r0} + bx r0 + thumb_func_end sub_81A1B98 + + thumb_func_start sub_81A1C24 +sub_81A1C24: @ 81A1C24 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r2, =0x00000cdc + adds r1, r2 + ldr r1, [r1] + ands r1, r0 + cmp r1, 0 + bne _081A1C44 + movs r0, 0 + b _081A1C46 + .pool +_081A1C44: + movs r0, 0x1 +_081A1C46: + pop {r1} + bx r1 + thumb_func_end sub_81A1C24 + + thumb_func_start sub_81A1C4C +sub_81A1C4C: @ 81A1C4C + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xE0 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r0, r5, 3 + adds r5, r0, 0x1 + ldr r0, =gUnknown_0203AB74 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + lsls r1, r5, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl PrintTextOnWindow + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1C4C + + thumb_func_start sub_81A1C90 +sub_81A1C90: @ 81A1C90 + push {r4,lr} + sub sp, 0x34 + adds r2, r0, 0 + ldr r3, =gUnknown_0203AB74 + movs r1, 0xAE + mov r0, sp + adds r0, 0x2F +_081A1C9E: + strb r1, [r0] + subs r0, 0x1 + add r4, sp, 0xC + cmp r0, r4 + bge _081A1C9E + add r1, sp, 0x30 + movs r0, 0xFF + strb r0, [r1] + lsls r0, r2, 3 + adds r2, r0, 0x1 + ldrb r0, [r3] + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x4 + bl PrintTextOnWindow + add sp, 0x34 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1C90 + + thumb_func_start sub_81A1CD8 +sub_81A1CD8: @ 81A1CD8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl PrintTextOnWindow + ldr r0, =0x0000270f + cmp r6, r0 + bls _081A1D24 + adds r6, r0, 0 +_081A1D24: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE302 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl PrintTextOnWindow + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1CD8 + + thumb_func_start sub_81A1D78 +sub_81A1D78: @ 81A1D78 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, [sp, 0x10] + lsls r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =gSaveBlock2Ptr + ldr r4, [r4] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + movs r0, 0xCF + lsls r0, 4 + adds r4, r0 + adds r4, r1 + ldrh r1, [r4] + ldr r0, =gUnknown_085EE319 + str r5, [sp] + bl sub_81A1CD8 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1D78 + + thumb_func_start sub_81A1DBC +sub_81A1DBC: @ 81A1DBC + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + movs r0, 0xCE + lsls r0, 4 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A1DDE + adds r0, r1, 0 +_081A1DDE: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A1DBC + + thumb_func_start sub_81A1DEC +sub_81A1DEC: @ 81A1DEC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r4, [sp, 0x20] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + lsls r4, 24 + lsrs r7, r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81A1DBC + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0x1 + beq _081A1E38 + cmp r5, 0x1 + ble _081A1E2C + cmp r5, 0x2 + beq _081A1E48 + cmp r5, 0x3 + beq _081A1E58 +_081A1E2C: + cmp r6, 0 + beq _081A1E34 + movs r0, 0x2 + b _081A1E66 +_081A1E34: + movs r0, 0x1 + b _081A1E66 +_081A1E38: + cmp r6, 0 + beq _081A1E42 + movs r0, 0x80 + lsls r0, 8 + b _081A1E66 +_081A1E42: + movs r0, 0x80 + lsls r0, 7 + b _081A1E66 +_081A1E48: + cmp r6, 0 + beq _081A1E52 + movs r0, 0x80 + lsls r0, 10 + b _081A1E66 +_081A1E52: + movs r0, 0x80 + lsls r0, 9 + b _081A1E66 +_081A1E58: + cmp r6, 0 + beq _081A1E62 + movs r0, 0x80 + lsls r0, 12 + b _081A1E66 +_081A1E62: + movs r0, 0x80 + lsls r0, 11 +_081A1E66: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A1E88 + ldr r0, =gUnknown_085EE311 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A1CD8 + b _081A1E96 + .pool +_081A1E88: + ldr r0, =gUnknown_085EE320 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A1CD8 +_081A1E96: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1DEC + + thumb_func_start sub_81A1EA8 +sub_81A1EA8: @ 81A1EA8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + cmp r7, 0 + bne _081A1EF0 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE158 + bl StringExpandPlaceholders + b _081A1F28 + .pool +_081A1EF0: + cmp r7, 0x1 + bne _081A1F08 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE178 + bl StringExpandPlaceholders + b _081A1F28 + .pool +_081A1F08: + cmp r7, 0x2 + bne _081A1F20 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE198 + bl StringExpandPlaceholders + b _081A1F28 + .pool +_081A1F20: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE1B7 + bl StringExpandPlaceholders +_081A1F28: + ldr r0, =gStringVar4 + movs r1, 0x2 + bl sub_81A1C4C + ldr r6, =gUnknown_0203AB74 + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x31 + mov r8, r1 + str r1, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl PrintTextOnWindow + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + mov r9, r1 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl PrintTextOnWindow + movs r0, 0xA + bl sub_81A1C90 + mov r0, r8 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1DEC + movs r0, 0x41 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1D78 + mov r1, r9 + str r1, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1DEC + movs r0, 0x71 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1D78 + ldrb r0, [r6] + bl PutWindowTilemap + ldrb r0, [r6] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1EA8 + + thumb_func_start sub_81A1FD8 +sub_81A1FD8: @ 81A1FD8 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000d0c + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A1FF8 + adds r0, r1, 0 +_081A1FF8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A1FD8 + + thumb_func_start sub_81A2008 +sub_81A2008: @ 81A2008 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r12, r0 + adds r7, r1, 0 + adds r4, r2, 0 + ldr r6, [sp, 0x2C] + ldr r5, [sp, 0x30] + lsls r4, 16 + lsrs r4, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r5, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r12 + bl PrintTextOnWindow + ldr r0, =gStringVar1 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + adds r0, r4, 0 + adds r1, r7, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r5, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r6, 0 + bl PrintTextOnWindow + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2008 + + thumb_func_start sub_81A2094 +sub_81A2094: @ 81A2094 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + ldr r4, [sp, 0x24] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81A1FD8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r5, 0 + beq _081A20CC + cmp r5, 0x1 + beq _081A20D8 +_081A20CC: + cmp r6, 0 + beq _081A20D4 + movs r0, 0x8 + b _081A20E6 +_081A20D4: + movs r0, 0x4 + b _081A20E6 +_081A20D8: + cmp r6, 0 + beq _081A20E2 + movs r0, 0x80 + lsls r0, 14 + b _081A20E6 +_081A20E2: + movs r0, 0x80 + lsls r0, 13 +_081A20E6: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A210C + ldr r0, =gUnknown_085EE311 + ldr r1, =gUnknown_085EE338 + str r7, [sp] + str r4, [sp, 0x4] + mov r2, r8 + mov r3, r9 + bl sub_81A2008 + b _081A211C + .pool +_081A210C: + ldr r0, =gUnknown_085EE320 + ldr r1, =gUnknown_085EE338 + str r7, [sp] + str r4, [sp, 0x4] + mov r2, r8 + mov r3, r9 + bl sub_81A2008 +_081A211C: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2094 + + thumb_func_start sub_81A2134 +sub_81A2134: @ 81A2134 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + cmp r7, 0 + bne _081A217C + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE1DB + bl StringExpandPlaceholders + b _081A2184 + .pool +_081A217C: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE1FE + bl StringExpandPlaceholders +_081A2184: + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81A1C4C + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + ldr r2, =gUnknown_085EE2F2 + movs r6, 0x21 + str r6, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + movs r0, 0xA + bl sub_81A1C90 + str r6, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x40 + movs r3, 0x79 + bl sub_81A2094 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + lsls r5, r7, 2 + ldr r1, =0x00000d14 + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + movs r0, 0x79 + mov r9, r0 + str r0, [sp] + movs r0, 0x31 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085EE319 + ldr r1, =gUnknown_085EE338 + movs r3, 0x40 + bl sub_81A2008 + ldr r1, =gUnknown_085EE332 + mov r10, r1 + ldr r0, =gUnknown_085EE349 + mov r8, r0 + ldr r0, [r4] + ldr r1, =0x00000d1c + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + movs r6, 0x70 + str r6, [sp] + movs r0, 0x41 + str r0, [sp, 0x4] + mov r0, r10 + mov r1, r8 + movs r3, 0x40 + bl sub_81A2008 + movs r0, 0x61 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x40 + movs r3, 0x79 + bl sub_81A2094 + ldr r0, [r4] + ldr r1, =0x00000d16 + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + mov r0, r9 + str r0, [sp] + movs r0, 0x71 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085EE319 + ldr r1, =gUnknown_085EE338 + movs r3, 0x40 + bl sub_81A2008 + ldr r0, [r4] + ldr r1, =0x00000d1e + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + str r6, [sp] + movs r0, 0x81 + str r0, [sp, 0x4] + mov r0, r10 + mov r1, r8 + movs r3, 0x40 + bl sub_81A2008 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + bl PutWindowTilemap + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2134 + + thumb_func_start sub_81A22B8 +sub_81A22B8: @ 81A22B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl PrintTextOnWindow + ldr r0, =0x0000270f + cmp r6, r0 + bls _081A2304 + adds r6, r0, 0 +_081A2304: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE302 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl PrintTextOnWindow + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A22B8 + + thumb_func_start sub_81A2358 +sub_81A2358: @ 81A2358 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, [sp, 0x10] + lsls r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =gSaveBlock2Ptr + ldr r4, [r4] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + movs r0, 0xDD + lsls r0, 4 + adds r4, r0 + adds r4, r1 + ldrh r1, [r4] + ldr r0, =gUnknown_085EE319 + str r5, [sp] + bl sub_81A22B8 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2358 + + thumb_func_start sub_81A239C +sub_81A239C: @ 81A239C + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000dc8 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A23BC + adds r0, r1, 0 +_081A23BC: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A239C + + thumb_func_start sub_81A23CC +sub_81A23CC: @ 81A23CC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r4, [sp, 0x20] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + lsls r4, 24 + lsrs r7, r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81A239C + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0 + beq _081A2404 + cmp r5, 0x1 + beq _081A2410 +_081A2404: + cmp r6, 0 + beq _081A240C + movs r0, 0x20 + b _081A241E +_081A240C: + movs r0, 0x10 + b _081A241E +_081A2410: + cmp r6, 0 + beq _081A241A + movs r0, 0x80 + lsls r0, 16 + b _081A241E +_081A241A: + movs r0, 0x80 + lsls r0, 15 +_081A241E: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2440 + ldr r0, =gUnknown_085EE311 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A22B8 + b _081A244E + .pool +_081A2440: + ldr r0, =gUnknown_085EE320 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A22B8 +_081A244E: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A23CC + + thumb_func_start sub_81A2460 +sub_81A2460: @ 81A2460 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + cmp r7, 0 + bne _081A24A8 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE221 + bl StringExpandPlaceholders + b _081A24B0 + .pool +_081A24A8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE241 + bl StringExpandPlaceholders +_081A24B0: + ldr r0, =gStringVar4 + movs r1, 0x2 + bl sub_81A1C4C + ldr r6, =gUnknown_0203AB74 + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x31 + mov r8, r1 + str r1, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl PrintTextOnWindow + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + mov r9, r1 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl PrintTextOnWindow + movs r0, 0xA + bl sub_81A1C90 + mov r0, r8 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A23CC + movs r0, 0x41 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A2358 + mov r1, r9 + str r1, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A23CC + movs r0, 0x71 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A2358 + ldrb r0, [r6] + bl PutWindowTilemap + ldrb r0, [r6] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2460 + + thumb_func_start sub_81A2560 +sub_81A2560: @ 81A2560 + push {lr} + lsls r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000e04 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A257A + adds r0, r1, 0 +_081A257A: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A2560 + + thumb_func_start sub_81A258C +sub_81A258C: @ 81A258C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r12, r0 + adds r7, r1, 0 + adds r4, r2, 0 + ldr r6, [sp, 0x2C] + ldr r5, [sp, 0x30] + lsls r4, 16 + lsrs r4, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r5, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r12 + bl PrintTextOnWindow + ldr r0, =gStringVar1 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + adds r0, r4, 0 + adds r1, r7, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r5, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r6, 0 + bl PrintTextOnWindow + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A258C + + thumb_func_start sub_81A2618 +sub_81A2618: @ 81A2618 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r4, 0 + bl sub_81A2560 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r4, 0 + beq _081A2648 + movs r0, 0x80 + lsls r0, 4 + b _081A264C +_081A2648: + movs r0, 0x80 + lsls r0, 3 +_081A264C: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2674 + ldr r0, =gUnknown_085EE311 + ldr r1, =gUnknown_085EE35B + str r5, [sp] + str r6, [sp, 0x4] + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2008 + b _081A2684 + .pool +_081A2674: + ldr r0, =gUnknown_085EE320 + ldr r1, =gUnknown_085EE35B + str r5, [sp] + str r6, [sp, 0x4] + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2008 +_081A2684: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2618 + + thumb_func_start sub_81A2698 +sub_81A2698: @ 81A2698 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r6, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r6] + ldrb r0, [r6] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r6] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE261 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0 + bl sub_81A1C4C + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x21 + str r1, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + movs r0, 0xA + bl sub_81A1C90 + movs r0, 0 + movs r1, 0x40 + movs r2, 0x72 + movs r3, 0x21 + bl sub_81A2618 + ldr r0, =gUnknown_085EE319 + mov r10, r0 + ldr r7, =gUnknown_085EE35B + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000e08 + adds r0, r1 + ldrh r2, [r0] + movs r4, 0x72 + str r4, [sp] + movs r0, 0x31 + str r0, [sp, 0x4] + mov r0, r10 + adds r1, r7, 0 + movs r3, 0x40 + bl sub_81A258C + ldr r0, =gUnknown_085EE332 + mov r8, r0 + ldr r1, =gUnknown_085EE36D + mov r9, r1 + ldr r0, [r5] + ldr r1, =0x00000e0c + adds r0, r1 + ldrh r2, [r0] + str r4, [sp] + movs r0, 0x41 + str r0, [sp, 0x4] + mov r0, r8 + mov r1, r9 + movs r3, 0x40 + bl sub_81A258C + movs r0, 0x1 + movs r1, 0x40 + movs r2, 0x72 + movs r3, 0x61 + bl sub_81A2618 + ldr r0, [r5] + ldr r1, =0x00000e0a + adds r0, r1 + ldrh r2, [r0] + str r4, [sp] + movs r0, 0x71 + str r0, [sp, 0x4] + mov r0, r10 + adds r1, r7, 0 + movs r3, 0x40 + bl sub_81A258C + ldr r0, [r5] + ldr r1, =0x00000e0e + adds r0, r1 + ldrh r2, [r0] + str r4, [sp] + movs r0, 0x81 + str r0, [sp, 0x4] + mov r0, r8 + mov r1, r9 + movs r3, 0x40 + bl sub_81A258C + ldrb r0, [r6] + bl PutWindowTilemap + ldrb r0, [r6] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2698 + + thumb_func_start sub_81A27E8 +sub_81A27E8: @ 81A27E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl PrintTextOnWindow + ldr r0, =0x0000270f + cmp r6, r0 + bls _081A2834 + adds r6, r0, 0 +_081A2834: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE381 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl PrintTextOnWindow + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A27E8 + + thumb_func_start sub_81A2888 +sub_81A2888: @ 81A2888 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000dde + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + ldr r0, =gUnknown_085EE319 + str r3, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_81A27E8 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2888 + + thumb_func_start sub_81A28CC +sub_81A28CC: @ 81A28CC + push {lr} + lsls r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000dda + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A28E6 + adds r0, r1, 0 +_081A28E6: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A28CC + + thumb_func_start sub_81A28F8 +sub_81A28F8: @ 81A28F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r4, 0 + bl sub_81A28CC + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0 + beq _081A2926 + movs r0, 0x80 + b _081A2928 +_081A2926: + movs r0, 0x40 +_081A2928: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2948 + ldr r0, =gUnknown_085EE311 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A27E8 + b _081A2956 + .pool +_081A2948: + ldr r0, =gUnknown_085EE320 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A27E8 +_081A2956: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A28F8 + + thumb_func_start sub_81A2968 +sub_81A2968: @ 81A2968 + push {r4-r6,lr} + sub sp, 0xC + ldr r5, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0xA + bl sub_81A1C90 + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE27C + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x2 + bl sub_81A1C4C + ldrb r0, [r5] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x31 + str r1, [sp] + movs r6, 0xFF + str r6, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl PrintTextOnWindow + ldrb r0, [r5] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl PrintTextOnWindow + movs r0, 0 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x31 + bl sub_81A28F8 + movs r0, 0 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x41 + bl sub_81A2888 + movs r0, 0x1 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x61 + bl sub_81A28F8 + movs r0, 0x1 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x71 + bl sub_81A2888 + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2968 + + thumb_func_start sub_81A2A28 +sub_81A2A28: @ 81A2A28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r12, r0 + ldr r4, [sp, 0x38] + ldr r5, [sp, 0x3C] + ldr r0, [sp, 0x40] + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0xC] + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x10] + lsls r5, 24 + lsrs r5, 24 + str r5, [sp, 0x14] + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r6, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r12 + bl PrintTextOnWindow + ldr r0, =0x0000270f + cmp r7, r0 + bls _081A2A80 + adds r7, r0, 0 +_081A2A80: + ldr r5, =gStringVar1 + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE302 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r6, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0x10] + bl PrintTextOnWindow + adds r0, r5, 0 + ldr r1, [sp, 0xC] + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r1, =gUnknown_085EE392 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r6, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0x14] + bl PrintTextOnWindow + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2A28 + + thumb_func_start sub_81A2B04 +sub_81A2B04: @ 81A2B04 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r2, 0 + ldr r4, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r0, 24 + lsls r1, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r7, =0x00000dea + adds r0, r2, r7 + adds r0, r1 + ldrh r0, [r0] + mov r8, r0 + ldr r0, =0x00000dfa + adds r2, r0 + adds r2, r1 + ldrh r2, [r2] + ldr r0, =gUnknown_085EE319 + str r3, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + mov r1, r8 + adds r3, r6, 0 + bl sub_81A2A28 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2B04 + + thumb_func_start sub_81A2B70 +sub_81A2B70: @ 81A2B70 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000de2 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A2B90 + adds r0, r1, 0 +_081A2B90: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A2B70 + + thumb_func_start sub_81A2BA0 +sub_81A2BA0: @ 81A2BA0 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000df2 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A2BC0 + adds r0, r1, 0 +_081A2BC0: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A2BA0 + + thumb_func_start sub_81A2BD0 +sub_81A2BD0: @ 81A2BD0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0xC] + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + mov r9, r4 + lsls r5, 24 + lsrs r5, 24 + mov r10, r5 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_81A2B70 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_81A2BA0 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r6, 0 + beq _081A2C20 + cmp r6, 0x1 + beq _081A2C30 +_081A2C20: + cmp r7, 0 + beq _081A2C2A + movs r0, 0x80 + lsls r0, 2 + b _081A2C3E +_081A2C2A: + movs r0, 0x80 + lsls r0, 1 + b _081A2C3E +_081A2C30: + cmp r7, 0 + beq _081A2C3A + movs r0, 0x80 + lsls r0, 18 + b _081A2C3E +_081A2C3A: + movs r0, 0x80 + lsls r0, 17 +_081A2C3E: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2C68 + ldr r0, =gUnknown_085EE311 + mov r1, r8 + str r1, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + adds r1, r5, 0 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl sub_81A2A28 + b _081A2C80 + .pool +_081A2C68: + ldr r0, =gUnknown_085EE320 + mov r1, r8 + str r1, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + adds r1, r5, 0 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl sub_81A2A28 +_081A2C80: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2BD0 + + thumb_func_start sub_81A2C94 +sub_81A2C94: @ 81A2C94 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + cmp r7, 0 + bne _081A2CD8 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE298 + bl StringExpandPlaceholders + b _081A2CE0 + .pool +_081A2CD8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE2B8 + bl StringExpandPlaceholders +_081A2CE0: + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81A1C4C + ldr r0, =gUnknown_0203AB74 + mov r8, r0 + ldrb r0, [r0] + ldr r2, =gUnknown_085EE2F2 + movs r6, 0x21 + str r6, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + mov r1, r8 + ldrb r0, [r1] + ldr r2, =gUnknown_085EE326 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x98 + bl PrintTextOnWindow + mov r1, r8 + ldrb r0, [r1] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + movs r0, 0xA + bl sub_81A1C90 + movs r4, 0x9E + str r4, [sp] + movs r0, 0x31 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2BD0 + str r4, [sp] + movs r0, 0x41 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2B04 + str r4, [sp] + movs r0, 0x71 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2BD0 + str r4, [sp] + movs r0, 0x81 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2B04 + mov r1, r8 + ldrb r0, [r1] + bl PutWindowTilemap + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2C94 + + thumb_func_start sub_81A2DB4 +sub_81A2DB4: @ 81A2DB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl PrintTextOnWindow + ldr r0, =0x0000270f + cmp r6, r0 + bls _081A2E00 + adds r6, r0, 0 +_081A2E00: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE39C + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl PrintTextOnWindow + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2DB4 + + thumb_func_start sub_81A2E54 +sub_81A2E54: @ 81A2E54 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000e1e + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + ldr r0, =gUnknown_085EE319 + str r3, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_81A2DB4 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2E54 + + thumb_func_start sub_81A2E98 +sub_81A2E98: @ 81A2E98 + push {lr} + lsls r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A2EB2 + adds r0, r1, 0 +_081A2EB2: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A2E98 + + thumb_func_start sub_81A2EC4 +sub_81A2EC4: @ 81A2EC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r4, 0 + bl sub_81A2E98 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0 + beq _081A2EF4 + movs r0, 0x80 + lsls r0, 6 + b _081A2EF8 +_081A2EF4: + movs r0, 0x80 + lsls r0, 5 +_081A2EF8: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2F18 + ldr r0, =gUnknown_085EE311 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2DB4 + b _081A2F26 + .pool +_081A2F18: + ldr r0, =gUnknown_085EE320 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2DB4 +_081A2F26: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2EC4 + + thumb_func_start sub_81A2F38 +sub_81A2F38: @ 81A2F38 + push {r4-r6,lr} + sub sp, 0xC + ldr r5, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE2D8 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x2 + bl sub_81A1C4C + ldrb r0, [r5] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x31 + str r1, [sp] + movs r6, 0xFF + str r6, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + ldrb r0, [r5] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl PrintTextOnWindow + movs r0, 0xA + bl sub_81A1C90 + movs r0, 0 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x31 + bl sub_81A2EC4 + movs r0, 0 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x41 + bl sub_81A2E54 + movs r0, 0x1 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x61 + bl sub_81A2EC4 + movs r0, 0x1 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x71 + bl sub_81A2E54 + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2F38 + + thumb_func_start sub_81A2FF8 +sub_81A2FF8: @ 81A2FF8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C7C + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gStringVar4 + mov r9, r0 + ldr r1, =gUnknown_085EDF86 + bl StringExpandPlaceholders + movs r0, 0x1 + mov r1, r9 + movs r2, 0xD0 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r6, 0xFF + str r6, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + mov r2, r9 + bl PrintTextOnWindow + ldr r7, =gUnknown_085EDFA0 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + adds r3, 0x32 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x19 + mov r8, r1 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl PrintTextOnWindow + ldr r7, =gUnknown_085EDFA4 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + adds r3, 0x58 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + mov r2, r8 + str r2, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl PrintTextOnWindow + ldr r7, =gUnknown_085EDFA8 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + adds r3, 0x7E + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + mov r1, r8 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl PrintTextOnWindow + ldr r7, =gUnknown_085EDFAC + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + adds r3, 0xA4 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + mov r2, r8 + str r2, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl PrintTextOnWindow + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0E8 + movs r1, 0x29 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl PrintTextOnWindow + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0ED + movs r1, 0x39 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl PrintTextOnWindow + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0F4 + movs r1, 0x49 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl PrintTextOnWindow + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0F9 + movs r1, 0x59 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl PrintTextOnWindow + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0FF + movs r1, 0x69 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl PrintTextOnWindow + movs r1, 0 +_081A314A: + movs r5, 0 + adds r0, r1, 0x1 + mov r8, r0 + lsls r0, r1, 28 + movs r2, 0xA4 + lsls r2, 22 + adds r0, r2 + lsrs r7, r0, 24 + lsls r4, r1, 3 +_081A315C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000624 + adds r0, r1 + adds r0, r4 + ldrh r1, [r0] + mov r0, r9 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r6, =gUnknown_0203AB74 + ldrb r0, [r6] + movs r1, 0x26 + adds r3, r5, 0 + muls r3, r1 + adds r3, 0x40 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r9 + bl PrintTextOnWindow + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _081A315C + mov r1, r8 + cmp r1, 0x4 + ble _081A314A + ldrb r0, [r6] + bl PutWindowTilemap + ldrb r0, [r6] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2FF8 + + thumb_func_start sub_81A31FC +sub_81A31FC: @ 81A31FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r4, 0x6 + bls _081A3232 + b _081A35CE +_081A3232: + lsls r0, r4, 2 + ldr r1, =_081A3250 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A3250: + .4byte _081A326C + .4byte _081A33A8 + .4byte _081A3414 + .4byte _081A347C + .4byte _081A34CC + .4byte _081A354C + .4byte _081A3594 +_081A326C: + ldr r2, =gSaveBlock2Ptr + mov r9, r2 + ldr r0, [r2] + lsls r3, r7, 1 + mov r10, r3 + mov r2, r8 + lsls r1, r2, 2 + add r1, r10 + str r1, [sp, 0x20] + movs r3, 0xCE + lsls r3, 4 + adds r1, r0, r3 + ldr r2, [sp, 0x20] + adds r1, r2 + adds r3, 0x10 + adds r0, r3 + adds r0, r2 + ldrh r1, [r1] + ldrh r2, [r0] + cmp r1, r2 + bhi _081A3298 + b _081A35CE +_081A3298: + strh r1, [r0] + mov r3, r8 + cmp r3, 0x3 + bne _081A32F2 + ldr r6, =gBattleScripting + adds r6, 0x25 + ldrb r0, [r6] + movs r4, 0x1 + eors r0, r4 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r5, =gLinkPlayers + 8 + adds r1, r5 + mov r0, sp + bl StringCopy + mov r0, sp + bl StripExtCtrlCodes + lsls r1, r7, 3 + ldr r0, =0x00000ee1 + adds r1, r0 + mov r2, r9 + ldr r0, [r2] + adds r0, r1 + mov r1, sp + bl StringCopy + ldrb r0, [r6] + eors r4, r0 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + subs r5, 0x4 + adds r0, r5 + ldr r0, [r0] + lsls r2, r7, 2 + ldr r1, =0x00000ef1 + adds r2, r1 + mov r3, r9 + ldr r1, [r3] + adds r1, r2 + bl WriteUnalignedWord +_081A32F2: + mov r7, r9 + ldr r0, [r7] + movs r1, 0xCE + lsls r1, 4 + adds r0, r1 + ldr r2, [sp, 0x20] + adds r0, r2 + ldrh r0, [r0] + cmp r0, 0x1 + bhi _081A3308 + b _081A35CE +_081A3308: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A3314 + b _081A35CE +_081A3314: + mov r3, r8 + cmp r3, 0x1 + beq _081A335A + cmp r3, 0x1 + bgt _081A3338 + cmp r3, 0 + beq _081A3344 + b _081A35CE + .pool +_081A3338: + mov r7, r8 + cmp r7, 0x2 + beq _081A3374 + cmp r7, 0x3 + beq _081A338E + b _081A35CE +_081A3344: + mov r1, r9 + ldr r0, [r1] + movs r2, 0xCE + lsls r2, 4 + adds r0, r2 + add r0, r10 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_80EE8C8 + b _081A35CE +_081A335A: + mov r3, r9 + ldr r0, [r3] + mov r1, r10 + adds r1, 0x4 + movs r7, 0xCE + lsls r7, 4 + adds r0, r7 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x2 + bl sub_80EE8C8 + b _081A35CE +_081A3374: + mov r1, r9 + ldr r0, [r1] + mov r1, r10 + adds r1, 0x8 + movs r2, 0xCE + lsls r2, 4 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x3 + bl sub_80EE8C8 + b _081A35CE +_081A338E: + mov r3, r9 + ldr r0, [r3] + mov r1, r10 + adds r1, 0xC + movs r7, 0xCE + lsls r7, 4 + adds r0, r7 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x4 + bl sub_80EE8C8 + b _081A35CE +_081A33A8: + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + lsls r7, 1 + mov r2, r8 + lsls r1, r2, 2 + adds r4, r7, r1 + ldr r5, =0x00000d0c + adds r1, r0, r5 + adds r1, r4 + ldr r3, =0x00000d14 + adds r0, r3 + adds r0, r4 + ldrh r2, [r1] + ldrh r3, [r0] + cmp r2, r3 + bhi _081A33CA + b _081A35CE +_081A33CA: + strh r2, [r0] + ldrh r0, [r1] + cmp r0, 0x1 + bhi _081A33D4 + b _081A35CE +_081A33D4: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A33E0 + b _081A35CE +_081A33E0: + mov r0, r8 + cmp r0, 0 + bne _081A3404 + ldr r0, [r6] + adds r0, r5 + adds r0, r7 + ldrh r0, [r0] + movs r1, 0x5 + bl sub_80EE8C8 + b _081A35CE + .pool +_081A3404: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x6 + bl sub_80EE8C8 + b _081A35CE +_081A3414: + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + lsls r7, 1 + mov r2, r8 + lsls r1, r2, 2 + adds r4, r7, r1 + ldr r5, =0x00000dc8 + adds r1, r0, r5 + adds r1, r4 + movs r3, 0xDD + lsls r3, 4 + adds r0, r3 + adds r0, r4 + ldrh r2, [r1] + ldrh r3, [r0] + cmp r2, r3 + bhi _081A3438 + b _081A35CE +_081A3438: + strh r2, [r0] + ldrh r0, [r1] + cmp r0, 0x1 + bhi _081A3442 + b _081A35CE +_081A3442: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A344E + b _081A35CE +_081A344E: + mov r0, r8 + cmp r0, 0 + bne _081A346C + ldr r0, [r6] + adds r0, r5 + adds r0, r7 + ldrh r0, [r0] + movs r1, 0xB + bl sub_80EE8C8 + b _081A35CE + .pool +_081A346C: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xC + bl sub_80EE8C8 + b _081A35CE +_081A347C: + ldr r6, =gSaveBlock2Ptr + ldr r1, [r6] + lsls r4, r7, 1 + ldr r5, =0x00000dda + adds r0, r1, r5 + adds r0, r4 + ldr r2, =0x00000dde + adds r1, r2 + adds r1, r4 + ldrh r2, [r0] + ldrh r3, [r1] + cmp r2, r3 + bhi _081A3498 + b _081A35CE +_081A3498: + strh r2, [r1] + ldrh r0, [r0] + cmp r0, 0x1 + bhi _081A34A2 + b _081A35CE +_081A34A2: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A34AE + b _081A35CE +_081A34AE: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xA + bl sub_80EE8C8 + b _081A35CE + .pool +_081A34CC: + ldr r6, =gSaveBlock2Ptr + ldr r2, [r6] + lsls r7, 1 + mov r9, r7 + mov r7, r8 + lsls r0, r7, 2 + mov r1, r9 + adds r4, r1, r0 + ldr r5, =0x00000de2 + adds r0, r2, r5 + adds r3, r0, r4 + ldr r7, =0x00000dea + adds r0, r2, r7 + adds r0, r4 + ldrh r1, [r3] + ldrh r7, [r0] + cmp r1, r7 + bls _081A35CE + strh r1, [r0] + ldr r0, =0x00000dfa + adds r1, r2, r0 + adds r1, r4 + ldr r7, =0x00000df2 + adds r0, r2, r7 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + ldrh r0, [r3] + cmp r0, 0x1 + bls _081A35CE + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + beq _081A35CE + mov r0, r8 + cmp r0, 0 + bne _081A353C + ldr r0, [r6] + adds r0, r5 + add r0, r9 + ldrh r0, [r0] + movs r1, 0x7 + bl sub_80EE8C8 + b _081A35CE + .pool +_081A353C: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x8 + bl sub_80EE8C8 + b _081A35CE +_081A354C: + ldr r6, =gSaveBlock2Ptr + ldr r1, [r6] + lsls r4, r7, 1 + ldr r5, =0x00000e04 + adds r0, r1, r5 + adds r0, r4 + ldr r2, =0x00000e08 + adds r1, r2 + adds r1, r4 + ldrh r2, [r0] + ldrh r3, [r1] + cmp r2, r3 + bls _081A35CE + strh r2, [r1] + ldrh r0, [r0] + cmp r0, 0x1 + bls _081A35CE + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + beq _081A35CE + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x9 + bl sub_80EE8C8 + b _081A35CE + .pool +_081A3594: + ldr r6, =gSaveBlock2Ptr + ldr r1, [r6] + lsls r4, r7, 1 + ldr r5, =0x00000e1a + adds r0, r1, r5 + adds r0, r4 + ldr r7, =0x00000e1e + adds r1, r7 + adds r1, r4 + ldrh r2, [r0] + ldrh r3, [r1] + cmp r2, r3 + bls _081A35CE + strh r2, [r1] + ldrh r0, [r0] + cmp r0, 0x1 + bls _081A35CE + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + beq _081A35CE + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xD + bl sub_80EE8C8 +_081A35CE: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A31FC + + thumb_func_start sub_81A35EC +sub_81A35EC: @ 81A35EC + push {r4,lr} + ldr r0, =0x000040cf + bl VarGet + ldr r4, =gScriptResult + bl sub_81A3610 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A35EC + + thumb_func_start sub_81A3610 +sub_81A3610: @ 81A3610 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + mov r8, r0 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x000040ce + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81A39C4 + lsls r0, 16 + ldr r1, =gUnknown_08611550 + mov r9, r1 + lsls r7, r6, 2 + adds r1, 0x3 + adds r1, r7, r1 + lsrs r0, 16 + ldrb r1, [r1] + adds r5, r0, r1 + cmp r4, 0 + beq _081A365C + movs r0, 0 + b _081A36C2 + .pool +_081A365C: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + blt _081A3680 + cmp r1, 0x1 + bgt _081A3680 + adds r0, r1, r7 + add r0, r9 + ldrb r0, [r0] + cmp r5, r0 + bne _081A36BC + adds r1, 0x1 + mov r8, r1 + b _081A36BC +_081A3680: + ldr r1, =gUnknown_08611550 + lsls r2, r6, 2 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r5, r0 + bne _081A3694 + movs r0, 0x3 + b _081A36BA + .pool +_081A3694: + adds r0, r1, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r5, r0 + bne _081A36A4 + movs r1, 0x4 + mov r8, r1 + b _081A36BC +_081A36A4: + cmp r5, r0 + ble _081A36BC + subs r0, r5, r0 + adds r1, 0x2 + adds r1, r2, r1 + ldrb r1, [r1] + bl __modsi3 + cmp r0, 0 + bne _081A36BC + movs r0, 0x4 +_081A36BA: + mov r8, r0 +_081A36BC: + mov r1, r8 + lsls r0, r1, 24 + lsrs r0, 24 +_081A36C2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A3610 + + thumb_func_start sub_81A36D0 +sub_81A36D0: @ 81A36D0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + lsls r1, 16 + lsrs r3, r1, 16 + cmp r0, 0x1 + beq _081A3766 + cmp r0, 0x1 + bgt _081A36EA + cmp r0, 0 + beq _081A36F2 + b _081A38F8 +_081A36EA: + cmp r2, 0x2 + bne _081A36F0 + b _081A3818 +_081A36F0: + b _081A38F8 +_081A36F2: + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _081A370C + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000bfc + b _081A38C4 + .pool +_081A370C: + ldr r0, =0x000003fe + cmp r3, r0 + beq _081A3786 + ldr r0, =0x0000012b + cmp r3, r0 + bhi _081A3738 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A3738: + ldr r0, =0x0000018f + cmp r3, r0 + bhi _081A3758 + ldr r1, =gSaveBlock2Ptr + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xfffef2b8 + b _081A38C4 + .pool +_081A3758: + adds r0, r3, 0 + adds r0, 0x70 + lsls r0, 24 + lsrs r0, 24 + bl sub_819F99C + b _081A38F8 +_081A3766: + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _081A3780 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000c08 + b _081A38C4 + .pool +_081A3780: + ldr r0, =0x000003fe + cmp r3, r0 + bne _081A3794 +_081A3786: + movs r0, 0 + bl sub_81A51A8 + b _081A38F8 + .pool +_081A3794: + ldr r0, =0x0000012b + cmp r3, r0 + bhi _081A37B8 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x18 + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A37B8: + ldr r0, =0x0000018f + cmp r3, r0 + bhi _081A37EC + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _081A387C + ldr r1, =gSaveBlock2Ptr + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xfffef2c4 + b _081A38C4 + .pool +_081A37EC: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _081A387C + ldr r1, =gSaveBlock2Ptr + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xffff96c4 + b _081A38C4 + .pool +_081A3818: + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _081A3830 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000c14 + b _081A38C4 + .pool +_081A3830: + ldr r0, =0x000003fe + cmp r3, r0 + bne _081A3844 + movs r0, 0x1 + bl sub_81A51A8 + b _081A38F8 + .pool +_081A3844: + ldr r0, =0x0000012b + cmp r3, r0 + bhi _081A3868 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x24 + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A3868: + ldr r0, =0x0000018f + cmp r3, r0 + bhi _081A38A8 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A3890 +_081A387C: + bl sub_81864E0 + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A3890: + ldr r1, =gSaveBlock2Ptr + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xfffef2d0 + b _081A38C4 + .pool +_081A38A8: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A38D4 + bl sub_81864A8 + lsls r0, 24 + lsrs r3, r0, 24 + movs r0, 0x58 + muls r0, r3 + ldr r1, =gUnknown_086109BA +_081A38C4: + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A38D4: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r3, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r3, r0, 27 + movs r0, 0x58 + muls r0, r3 + ldr r1, =gUnknown_086109BA + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString +_081A38F8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A36D0 + + thumb_func_start sub_81A3908 +sub_81A3908: @ 81A3908 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000cdc + adds r1, r2 + movs r2, 0 + str r2, [r1] + movs r4, 0 + mov r9, r0 + mov r8, r9 + movs r6, 0 +_081A3926: + movs r5, 0 + lsls r7, r4, 2 + mov r10, r7 + adds r0, r4, 0x1 + mov r12, r0 +_081A3930: + mov r1, r8 + ldr r2, [r1] + lsls r3, r5, 1 + mov r7, r10 + adds r1, r3, r7 + movs r7, 0xCE + lsls r7, 4 + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] + cmp r4, 0x1 + bgt _081A3960 + adds r7, 0x2C + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] + adds r7, 0xBC + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] + adds r7, 0x1A + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] +_081A3960: + cmp r4, 0 + bne _081A3980 + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00000dda + adds r1, r0, r2 + adds r1, r3 + strh r4, [r1] + ldr r7, =0x00000e04 + adds r1, r0, r7 + adds r1, r3 + strh r4, [r1] + ldr r1, =0x00000e1a + adds r0, r1 + adds r0, r3 + strh r4, [r0] +_081A3980: + adds r5, 0x1 + cmp r5, 0x1 + ble _081A3930 + mov r4, r12 + cmp r4, 0x3 + ble _081A3926 + mov r2, r9 + ldr r0, [r2] + ldr r7, =0x00000ca8 + adds r1, r0, r7 + ldrb r0, [r1] + cmp r0, 0 + beq _081A399E + movs r0, 0x1 + strb r0, [r1] +_081A399E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3908 + + thumb_func_start sub_81A39C4 +sub_81A39C4: @ 81A39C4 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bhi _081A3AC4 + lsls r0, 2 + ldr r1, =_081A3A0C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A3A0C: + .4byte _081A3A28 + .4byte _081A3A3C + .4byte _081A3A54 + .4byte _081A3A6C + .4byte _081A3A80 + .4byte _081A3A98 + .4byte _081A3AAC +_081A3A28: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + movs r2, 0xCE + lsls r2, 4 + b _081A3AB4 + .pool +_081A3A3C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000d0c + b _081A3AB4 + .pool +_081A3A54: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000dc8 + b _081A3AB4 + .pool +_081A3A6C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000dda + b _081A3AB4 + .pool +_081A3A80: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000de2 + b _081A3AB4 + .pool +_081A3A98: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e04 + b _081A3AB4 + .pool +_081A3AAC: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e1a +_081A3AB4: + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + b _081A3AC6 + .pool +_081A3AC4: + movs r0, 0 +_081A3AC6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A39C4 + + thumb_func_start sub_81A3ACC +sub_81A3ACC: @ 81A3ACC + push {r4,r5,lr} + movs r2, 0 + ldr r5, =gSaveBlock2Ptr + ldr r4, =0x00000cb4 + ldr r0, =0x0000ffff + adds r3, r0, 0 +_081A3AD8: + ldr r0, [r5] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r1, [r0] + orrs r1, r3 + strh r1, [r0] + adds r2, 0x1 + cmp r2, 0x13 + ble _081A3AD8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3ACC + + thumb_func_start sub_81A3B00 +sub_81A3B00: @ 81A3B00 + push {lr} + ldr r0, =gTrainerBattleOpponent_A + ldrh r1, [r0] + ldr r0, =0x000003fe + cmp r1, r0 + bne _081A3B20 + ldr r1, =gScriptResult + movs r0, 0x1 + b _081A3B24 + .pool +_081A3B20: + ldr r1, =gScriptResult + movs r0, 0 +_081A3B24: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3B00 + + thumb_func_start sub_81A3B30 +sub_81A3B30: @ 81A3B30 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 23 + ldr r1, =0x000008c4 + adds r0, r4, r1 + bl FlagGet + adds r5, r0, 0 + ldr r0, =0x000008c5 + adds r4, r0 + adds r0, r4, 0 + bl FlagGet + adds r5, r0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A3B30 + + thumb_func_start sub_81A3B64 +sub_81A3B64: @ 81A3B64 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r5, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + cmp r7, 0x6 + bhi _081A3C78 + lsls r0, r7, 2 + ldr r1, =_081A3BB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A3BB4: + .4byte _081A3BD0 + .4byte _081A3BE4 + .4byte _081A3C00 + .4byte _081A3C18 + .4byte _081A3C2C + .4byte _081A3C44 + .4byte _081A3C60 +_081A3BD0: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + movs r2, 0xCE + lsls r2, 4 + b _081A3C68 + .pool +_081A3BE4: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000d0c + adds r0, r2 + adds r0, r1 + ldrh r5, [r0] + b _081A3C78 + .pool +_081A3C00: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000dc8 + b _081A3C68 + .pool +_081A3C18: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000dda + b _081A3C68 + .pool +_081A3C2C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000de2 + b _081A3C68 + .pool +_081A3C44: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e04 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0xE + b _081A3C70 + .pool +_081A3C60: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e1a +_081A3C68: + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x7 +_081A3C70: + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 +_081A3C78: + cmp r5, 0 + beq _081A3C7E + subs r5, 0x1 +_081A3C7E: + cmp r5, 0x1D + bls _081A3C84 + movs r5, 0x1D +_081A3C84: + ldr r2, =gUnknown_086118B4 + lsls r1, r7, 2 + adds r1, r6, r1 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r1, r0 + adds r7, r1, r2 + ldrb r5, [r7] + ldr r0, =gTrainerBattleOpponent_A + mov r9, r0 + ldrh r0, [r0] + ldr r1, =0x000003fe + mov r8, r1 + cmp r0, r8 + bne _081A3CA6 + adds r5, 0xA +_081A3CA6: + ldr r6, =gSaveBlock2Ptr + ldr r1, [r6] + ldr r4, =0x00000eb8 + adds r1, r4 + ldrh r0, [r1] + adds r0, r5 + strh r0, [r1] + ldr r0, =gStringVar1 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r0, [r6] + adds r2, r0, r4 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A3CCE + strh r1, [r2] +_081A3CCE: + ldr r0, [r6] + ldr r4, =0x00000eba + adds r0, r4 + ldrh r5, [r0] + ldrb r0, [r7] + adds r5, r0 + bl sub_80EED60 + mov r2, r9 + ldrh r0, [r2] + cmp r0, r8 + bne _081A3CEE + adds r5, 0xA + movs r0, 0xA + bl sub_80EED60 +_081A3CEE: + ldr r0, =0x0000ffff + cmp r5, r0 + ble _081A3CF6 + adds r5, r0, 0 +_081A3CF6: + ldr r0, [r6] + adds r0, r4 + strh r5, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3B64 + + thumb_func_start sub_81A3D30 +sub_81A3D30: @ 81A3D30 + push {r4,lr} + ldr r0, =0x000040cf + bl VarGet + ldr r4, =gScriptResult + lsls r0, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3D30 + + thumb_func_start sub_81A3D58 +sub_81A3D58: @ 81A3D58 + push {r4,lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + cmp r0, 0 + bne _081A3D88 + lsls r0, r4, 17 + ldr r1, =0x8C4 << 16 + adds r0, r1 + lsrs r0, 16 + bl FlagSet + b _081A3D94 + .pool +_081A3D88: + lsls r0, r4, 17 + ldr r1, =0x8C5 << 16 + adds r0, r1 + lsrs r0, 16 + bl FlagSet +_081A3D94: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3D58 + + thumb_func_start sub_81A3DA0 +sub_81A3DA0: @ 81A3DA0 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, [r0] + ands r2, r1 + cmp r2, 0 + beq _081A3DC4 + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + b _081A3DC8 + .pool +_081A3DC4: + ldr r0, =gScriptResult + strh r2, [r0] +_081A3DC8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3DA0 + + thumb_func_start sub_81A3DD0 +sub_81A3DD0: @ 81A3DD0 + push {r4-r6,lr} + adds r5, r2, 0 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + adds r0, r6, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _081A3ED6 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + subs r0, r4, 0x1 + cmp r0, 0xA + bhi _081A3EA0 + lsls r0, 2 + ldr r1, =_081A3E0C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A3E0C: + .4byte _081A3E38 + .4byte _081A3E68 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 +_081A3E38: + cmp r5, r4 + bne _081A3E50 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB79 + bl StringAppend + b _081A3EC8 + .pool +_081A3E50: + cmp r5, r4 + ble _081A3EC8 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB7F + bl StringAppend + b _081A3EC8 + .pool +_081A3E68: + cmp r4, r5 + bne _081A3E80 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB79 + bl StringAppend + b _081A3E88 + .pool +_081A3E80: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB7F + bl StringAppend +_081A3E88: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB86 + bl StringAppend + b _081A3EC8 + .pool +_081A3EA0: + cmp r4, r5 + bne _081A3EB8 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB79 + bl StringAppend + b _081A3EC0 + .pool +_081A3EB8: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB7F + bl StringAppend +_081A3EC0: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB84 + bl StringAppend +_081A3EC8: + ldr r0, =gStringVar1 + movs r1, 0xB + muls r1, r6 + ldr r2, =gSpeciesNames + adds r1, r2 + bl StringAppend +_081A3ED6: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A3DD0 + + thumb_func_start sub_81A3EF0 +sub_81A3EF0: @ 81A3EF0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, [sp, 0x20] + ldr r4, [sp, 0x24] + mov r9, r4 + ldr r4, [sp, 0x28] + mov r10, r4 + ldr r7, [sp, 0x2C] + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r3, 24 + lsrs r3, 24 + mov r12, r3 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + movs r2, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + beq _081A3FBE + cmp r4, 0 + beq _081A3FBE + ldr r0, =gUnknown_08611C9A + ldrh r1, [r0] + ldr r5, =0x0000ffff + adds r3, r0, 0 + cmp r1, r5 + beq _081A3F54 + cmp r1, r4 + beq _081A3F48 + adds r1, r3, 0 +_081A3F3A: + adds r1, 0x2 + adds r2, 0x1 + ldrh r0, [r1] + cmp r0, r5 + beq _081A3F54 + cmp r0, r4 + bne _081A3F3A +_081A3F48: + lsls r0, r2, 1 + adds r0, r3 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081A3FBE +_081A3F54: + mov r0, r12 + cmp r0, 0 + bne _081A3F60 + mov r1, r8 + cmp r1, 0x32 + bhi _081A3FBE +_081A3F60: + movs r2, 0 + ldrb r3, [r7] + cmp r2, r3 + bge _081A3F80 + mov r1, r9 + ldrh r0, [r1] + cmp r0, r4 + beq _081A3F80 + adds r5, r3, 0 +_081A3F72: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r5 + bge _081A3F80 + ldrh r0, [r1] + cmp r0, r4 + bne _081A3F72 +_081A3F80: + cmp r2, r3 + bne _081A3FBE + cmp r6, 0 + beq _081A3FAA + movs r2, 0 + cmp r2, r3 + bge _081A3FA6 + mov r1, r10 + ldrh r0, [r1] + cmp r0, r6 + beq _081A3FA6 + adds r5, r3, 0 +_081A3F98: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r5 + bge _081A3FA6 + ldrh r0, [r1] + cmp r0, r6 + bne _081A3F98 +_081A3FA6: + cmp r2, r3 + bne _081A3FBE +_081A3FAA: + lsls r0, r3, 1 + add r0, r9 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + add r0, r10 + strh r6, [r0] + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] +_081A3FBE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3EF0 + + thumb_func_start sub_81A3FD4 +sub_81A3FD4: @ 81A3FD4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + movs r0, 0 + str r0, [sp, 0x2C] + add r4, sp, 0x28 + strb r0, [r4] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + mov r10, r4 + cmp r0, 0x1 + beq _081A4016 + cmp r0, 0x1 + bgt _081A4008 + cmp r0, 0 + beq _081A4010 + b _081A402A + .pool +_081A4008: + cmp r0, 0x3 + bgt _081A402A + movs r0, 0x2 + b _081A4028 +_081A4010: + movs r1, 0x3 + str r1, [sp, 0x2C] + b _081A402A +_081A4016: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + movs r1, 0x3 + str r1, [sp, 0x2C] + cmp r0, 0 + bne _081A402A + movs r0, 0x4 +_081A4028: + str r0, [sp, 0x2C] +_081A402A: + movs r1, 0 + mov r9, r1 + b _081A4040 + .pool +_081A4034: + mov r1, r10 + ldrb r0, [r1] + ldr r1, [sp, 0x2C] + cmp r0, r1 + blt _081A4040 + b _081A41E0 +_081A4040: + mov r5, r9 + movs r0, 0 + mov r1, r10 + strb r0, [r1] + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x30] +_081A404E: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r4, 0 + movs r1, 0x38 + bl GetMonData + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bne _081A40C8 + cmp r7, 0 + bne _081A40E4 + ldr r0, =gScriptResult + ldrb r3, [r0] + str r6, [sp] + add r1, sp, 0x10 + str r1, [sp, 0x4] + add r0, sp, 0x1C + str r0, [sp, 0x8] + mov r0, r10 + str r0, [sp, 0xC] + mov r0, r8 + movs r1, 0 + adds r2, r4, 0 + bl sub_81A3EF0 + b _081A40E4 + .pool +_081A40C8: + ldr r0, =gScriptResult + ldrb r3, [r0] + str r6, [sp] + add r1, sp, 0x10 + str r1, [sp, 0x4] + add r0, sp, 0x1C + str r0, [sp, 0x8] + mov r0, r10 + str r0, [sp, 0xC] + mov r0, r8 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_81A3EF0 +_081A40E4: + adds r5, 0x1 + cmp r5, 0x5 + ble _081A40EC + movs r5, 0 +_081A40EC: + cmp r5, r9 + bne _081A404E + ldr r1, [sp, 0x30] + mov r9, r1 + cmp r1, 0x5 + ble _081A4034 + mov r1, r10 + ldrb r0, [r1] + ldr r1, [sp, 0x2C] + cmp r0, r1 + bge _081A41E0 + movs r6, 0 + ldr r0, =gUnknown_08611C9A + ldrh r2, [r0] + ldr r1, =0x0000ffff + mov r8, r0 + cmp r2, r1 + beq _081A4134 + mov r4, r8 +_081A4112: + adds r0, r2, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _081A412A + adds r6, 0x1 +_081A412A: + adds r4, 0x2 + ldrh r2, [r4] + ldr r0, =0x0000ffff + cmp r2, r0 + bne _081A4112 +_081A4134: + ldr r1, =gStringVar1 + movs r0, 0xFF + strb r0, [r1] + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x1 + strh r0, [r1] + movs r0, 0 + mov r1, r10 + strb r0, [r1] + mov r1, r8 + ldrh r0, [r1] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _081A416A + mov r5, r10 + adds r7, r1, 0 + mov r4, r8 +_081A4156: + ldrh r0, [r4] + ldrb r1, [r5] + adds r2, r6, 0 + bl sub_81A3DD0 + strb r0, [r5] + adds r4, 0x2 + ldrh r0, [r4] + cmp r0, r7 + bne _081A4156 +_081A416A: + mov r0, r10 + ldrb r4, [r0] + cmp r4, 0 + bne _081A41A4 + ldr r4, =gStringVar1 + ldr r1, =gUnknown_085CCB82 + adds r0, r4, 0 + bl StringAppend + ldr r1, =gUnknown_085CCB88 + adds r0, r4, 0 + bl StringAppend + b _081A4202 + .pool +_081A41A4: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081A41C0 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB84 + bl StringAppend + b _081A41C8 + .pool +_081A41C0: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB82 + bl StringAppend +_081A41C8: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB8C + bl StringAppend + b _081A4202 + .pool +_081A41E0: + ldr r1, =gSpecialVar_0x8004 + movs r0, 0 + strh r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gScriptResult + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r2, r1 + movs r1, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_081A4202: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3FD4 + + thumb_func_start sub_81A4224 +sub_81A4224: @ 81A4224 + push {lr} + bl sub_81652B4 + pop {r0} + bx r0 + thumb_func_end sub_81A4224 + + thumb_func_start sub_81A4230 +sub_81A4230: @ 81A4230 + push {r4-r7,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bls _081A425A + b _081A4394 +_081A425A: + lsls r0, 2 + ldr r1, =_081A4278 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A4278: + .4byte _081A4294 + .4byte _081A42DC + .4byte _081A431C + .4byte _081A4338 + .4byte _081A434C + .4byte _081A4368 + .4byte _081A437C +_081A4294: + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + lsls r4, 1 + lsls r1, r5, 2 + adds r1, r4, r1 + movs r6, 0xCE + lsls r6, 4 + adds r3, r0, r6 + adds r2, r3, r1 + ldrh r1, [r2] + ldr r0, =0x0000270e + cmp r1, r0 + bhi _081A4394 + adds r0, r1, 0x1 + strh r0, [r2] + cmp r5, 0 + bne _081A4394 + adds r0, r3, r4 + ldrh r1, [r0] + movs r0, 0x20 + bl sav12_xor_set + ldr r1, [r7] + adds r0, r1, r6 + adds r0, r4 + ldrh r0, [r0] + ldr r2, =0x00000d02 + adds r1, r2 + b _081A4392 + .pool +_081A42DC: + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + lsls r2, r4, 1 + lsls r1, r5, 2 + adds r1, r2, r1 + ldr r3, =0x00000d0c + adds r0, r3 + adds r3, r0, r1 + ldrh r0, [r3] + ldr r2, =0x0000270e + cmp r0, r2 + bhi _081A42F8 + adds r0, 0x1 + strh r0, [r3] +_081A42F8: + ldr r0, [r6] + ldr r3, =0x00000d1c + adds r0, r3 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, r2 + bhi _081A4394 + adds r0, 0x1 + b _081A4392 + .pool +_081A431C: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r0, r4, 1 + lsls r1, r5, 2 + adds r0, r1 + ldr r1, =0x00000dc8 + adds r2, r1 + adds r1, r2, r0 + b _081A4388 + .pool +_081A4338: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000dda + adds r0, r2 + b _081A4386 + .pool +_081A434C: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r0, r4, 1 + lsls r1, r5, 2 + adds r0, r1 + ldr r3, =0x00000de2 + adds r2, r3 + adds r1, r2, r0 + b _081A4388 + .pool +_081A4368: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e04 + adds r0, r2 + b _081A4386 + .pool +_081A437C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r3, =0x00000e1a + adds r0, r3 +_081A4386: + adds r1, r0, r1 +_081A4388: + ldrh r3, [r1] + ldr r0, =0x0000270e + cmp r3, r0 + bhi _081A4394 + adds r0, r3, 0x1 +_081A4392: + strh r0, [r1] +_081A4394: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4230 + + thumb_func_start sub_81A43A8 +sub_81A43A8: @ 81A43A8 + push {r4-r6,lr} + sub sp, 0x4 + movs r4, 0 + ldr r6, =gSaveBlock1Ptr + movs r5, 0x64 +_081A43B2: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000caa + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _081A43EE + adds r1, r0, 0 + muls r1, r5 + movs r0, 0xEA + lsls r0, 1 + adds r1, r0 + ldr r0, [r6] + adds r0, r1 + movs r1, 0xC + movs r2, 0 + bl GetMonData + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl SetMonData +_081A43EE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A43B2 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A43A8 + + thumb_func_start sub_81A4410 +sub_81A4410: @ 81A4410 + push {r4,lr} + ldr r4, =gScriptResult + bl sub_8185338 + strh r0, [r4] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4410 + + thumb_func_start sub_81A443C +sub_81A443C: @ 81A443C + push {lr} + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A4450 + cmp r0, 0x1 + beq _081A4464 + b _081A446E + .pool +_081A4450: + ldr r0, =gStringVar1 + ldr r1, =gTrainerBattleOpponent_A + ldrh r1, [r1] + bl sub_8162E20 + b _081A446E + .pool +_081A4464: + ldr r0, =gStringVar2 + ldr r1, =gTrainerBattleOpponent_A + ldrh r1, [r1] + bl sub_8162E20 +_081A446E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A443C + + thumb_func_start sub_81A447C +sub_81A447C: @ 81A447C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r0, 0 + str r0, [sp] +_081A448C: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, [sp] + lsls r1, r2, 1 + ldr r4, =0x00000caa + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r1 + adds r2, 0x1 + str r2, [sp, 0x4] + cmp r0, 0x5 + bhi _081A454E + movs r6, 0 + ldr r0, [sp] + movs r2, 0x64 + adds r1, r0, 0 + muls r1, r2 + ldr r0, =gPlayerParty + adds r7, r1, r0 +_081A44BA: + movs r5, 0 + movs r4, 0xD + adds r4, r6 + mov r8, r4 + adds r0, r6, 0x1 + mov r10, r0 +_081A44C6: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000caa + adds r0, r2 + add r0, r9 + ldrh r0, [r0] + movs r4, 0x64 + adds r1, r0, 0 + muls r1, r4 + movs r0, 0xEA + lsls r0, 1 + adds r1, r0 + ldr r2, =gSaveBlock1Ptr + ldr r0, [r2] + adds r0, r1 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + adds r0, r7, 0 + mov r1, r8 + movs r2, 0 + bl GetMonData + cmp r4, r0 + beq _081A4508 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081A44C6 +_081A4508: + cmp r5, 0x4 + bne _081A4516 + adds r0, r7, 0 + movs r1, 0xA6 + adds r2, r6, 0 + bl SetMonMoveSlot +_081A4516: + mov r4, r10 + lsls r0, r4, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _081A44BA + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + ldr r4, =0x00000caa + adds r1, r4 + add r1, r9 + ldrh r1, [r1] + subs r1, 0x1 + movs r3, 0x64 + muls r1, r3 + adds r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r0, r1 + ldr r2, =gPlayerParty + ldr r4, [sp] + adds r1, r4, 0 + muls r1, r3 + adds r1, r2 + movs r2, 0x64 + bl memcpy +_081A454E: + ldr r1, [sp, 0x4] + lsls r0, r1, 24 + lsrs r0, 24 + str r0, [sp] + cmp r0, 0x3 + bls _081A448C + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A447C + + thumb_func_start sub_81A457C +sub_81A457C: @ 81A457C + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sub_81A5030 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A457C + + thumb_func_start sub_81A4594 +sub_81A4594: @ 81A4594 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + mov r8, r1 + adds r6, r3, 0 + ldr r1, =gUnknown_0203AB74 + ldrb r5, [r1] + lsls r4, r0, 1 + adds r4, r0 + ldr r1, =gUnknown_085EE424 + adds r4, r1 + mov r1, r8 + lsls r3, r1, 27 + lsrs r3, 24 + lsls r1, r0, 2 + adds r1, r0 + adds r2, r1 + lsls r2, 3 + adds r2, 0x1 + lsls r2, 24 + lsrs r7, r2, 24 + str r7, [sp] + movs r0, 0xFF + mov r10, r0 + str r0, [sp, 0x4] + movs r1, 0 + mov r9, r1 + str r1, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl PrintTextOnWindow + movs r0, 0xFF + strb r0, [r6, 0xD] + ldrh r0, [r6, 0x4] + cmp r0, 0 + beq _081A465C + adds r1, r6, 0x6 + ldrb r2, [r6, 0xE] + add r0, sp, 0xC + bl sub_81DB5E8 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + mov r3, r8 + adds r3, 0x2 + lsls r3, 27 + lsrs r3, 24 + str r7, [sp] + mov r1, r10 + str r1, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl PrintTextOnWindow + ldrh r1, [r6, 0x4] + ldr r0, =0x0000270f + cmp r1, r0 + bls _081A4618 + adds r1, r0, 0 +_081A4618: + ldr r0, =gStringVar2 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r5, =gStringVar4 + ldr r1, =gUnknown_08611D08 + ldr r0, [sp, 0x4C] + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC8 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + str r7, [sp] + mov r1, r10 + str r1, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl PrintTextOnWindow +_081A465C: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4594 + + thumb_func_start sub_81A4684 +sub_81A4684: @ 81A4684 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + adds r6, r0, 0 + adds r7, r1, 0 + mov r10, r2 + adds r5, r3, 0 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + lsls r2, r6, 1 + adds r2, r6 + ldr r1, =gUnknown_085EE424 + adds r2, r1 + lsls r3, r7, 27 + lsrs r3, 24 + mov r12, r3 + lsls r1, r6, 2 + adds r1, r6 + mov r3, r10 + adds r4, r3, r1 + lsls r1, r4, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r3, 0 + mov r8, r3 + str r3, [sp, 0x8] + movs r1, 0x1 + mov r3, r12 + bl PrintTextOnWindow + ldrh r0, [r5, 0x8] + cmp r0, 0 + beq _081A47BC + movs r0, 0xFF + strb r0, [r5, 0x11] + movs r0, 0x1 + negs r0, r0 + strb r0, [r5, 0x19] + adds r1, r5, 0 + adds r1, 0xA + ldrb r2, [r5, 0x1A] + add r0, sp, 0xC + bl sub_81DB5E8 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + adds r3, r7, 0x2 + lsls r3, 27 + lsrs r3, 24 + subs r1, r4, 0x1 + lsls r1, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + mov r2, r9 + str r2, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl PrintTextOnWindow + adds r4, r5, 0 + adds r4, 0x12 + adds r0, r4, 0 + bl sub_8009228 + cmp r0, 0 + beq _081A4734 + add r0, sp, 0xC + adds r1, r4, 0 + movs r2, 0x1 + bl sub_81DB5E8 + b _081A473C + .pool +_081A4734: + add r0, sp, 0xC + adds r1, r4, 0 + bl StringCopy +_081A473C: + ldr r2, =gUnknown_0203AB74 + mov r9, r2 + ldrb r0, [r2] + adds r3, r7, 0x4 + lsls r3, 27 + lsrs r3, 24 + lsls r1, r6, 2 + adds r1, r6 + mov r2, r10 + adds r6, r2, r1 + adds r1, r6, 0x1 + lsls r1, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + mov r8, r1 + str r1, [sp, 0x4] + movs r7, 0 + str r7, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl PrintTextOnWindow + ldrh r1, [r5, 0x8] + ldr r0, =0x0000270f + cmp r1, r0 + bls _081A4778 + adds r1, r0, 0 +_081A4778: + ldr r0, =gStringVar2 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r5, =gStringVar4 + ldr r0, =gUnknown_08611D08 + ldr r4, [r0, 0x24] + adds r0, r5, 0 + adds r1, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC8 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r2, r9 + ldrb r0, [r2] + lsls r1, r6, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl PrintTextOnWindow +_081A47BC: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4684 + + thumb_func_start sub_81A47E0 +sub_81A47E0: @ 81A47E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + mov r9, r0 + mov r10, r1 + str r2, [sp, 0x40] + movs r0, 0xAC + lsls r0, 1 + bl AllocZeroed + mov r8, r0 + bl sub_80E8260 + add r0, sp, 0x30 + mov r12, r0 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r3, [sp, 0x40] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 4 + mov r4, r10 + lsls r0, r4, 1 + add r0, r10 + lsls r0, 5 + adds r1, r0 + adds r4, r1, r2 + mov r3, sp + movs r2, 0x2 +_081A4820: + adds r0, r3, 0 + movs r5, 0x87 + lsls r5, 2 + adds r1, r4, r5 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldr r1, [r1] + str r1, [r0] + adds r4, 0x10 + adds r3, 0x10 + subs r2, 0x1 + cmp r2, 0 + bge _081A4820 + ldr r6, [sp, 0x40] + lsls r0, r6, 4 + mov r7, r10 + lsls r1, r7, 5 + adds r0, r1 + mov r1, r12 + add r0, r8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + movs r2, 0 +_081A4852: + movs r1, 0 + movs r4, 0 + movs r3, 0 + lsls r5, r2, 4 + adds r6, r2, 0x1 + mov r2, sp +_081A485E: + ldrh r0, [r2, 0x4] + cmp r0, r1 + ble _081A4868 + adds r4, r3, 0 + adds r1, r0, 0 +_081A4868: + adds r2, 0x10 + adds r3, 0x1 + cmp r3, 0x3 + ble _081A485E + mov r0, sp + ldrh r0, [r0, 0x34] + cmp r0, r1 + blt _081A487A + movs r4, 0x3 +_081A487A: + lsls r0, r4, 4 + mov r7, sp + adds r2, r7, r0 + mov r0, r9 + adds r1, r5, r0 + adds r0, r2, 0 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + movs r0, 0 + strh r0, [r2, 0x4] + adds r2, r6, 0 + cmp r2, 0x2 + ble _081A4852 + mov r0, r8 + bl Free + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A47E0 + + thumb_func_start sub_81A48B4 +sub_81A48B4: @ 81A48B4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x74 + mov r9, r0 + mov r10, r1 + movs r0, 0xAC + lsls r0, 1 + bl AllocZeroed + mov r8, r0 + bl sub_80E8260 + mov r0, sp + adds r0, 0x54 + str r0, [sp, 0x70] + add r1, sp, 0x5C + mov r12, r1 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + movs r0, 0x54 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + adds r3, r0, r1 + mov r2, sp + movs r4, 0x2 +_081A48EE: + adds r0, r2, 0 + ldr r5, =0x0000057c + adds r1, r3, r5 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldr r1, [r1] + str r1, [r0] + adds r3, 0x1C + adds r2, 0x1C + subs r4, 0x1 + cmp r4, 0 + bge _081A48EE + mov r6, r10 + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + add r0, r8 + ldr r1, [sp, 0x70] + movs r7, 0x90 + lsls r7, 1 + adds r0, r7 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldr r0, [r0] + str r0, [r1] + movs r4, 0 +_081A492A: + movs r1, 0 + movs r5, 0 + movs r3, 0 + lsls r6, r4, 3 + adds r7, r4, 0x1 + mov r2, sp +_081A4936: + ldrh r0, [r2, 0x8] + cmp r0, r1 + ble _081A4940 + adds r5, r3, 0 + adds r1, r0, 0 +_081A4940: + adds r2, 0x1C + adds r3, 0x1 + cmp r3, 0x2 + ble _081A4936 + mov r2, r12 + ldrh r0, [r2] + cmp r0, r1 + blt _081A4952 + movs r5, 0x3 +_081A4952: + subs r1, r6, r4 + lsls r1, 2 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + mov r3, sp + adds r2, r3, r0 + add r1, r9 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + movs r0, 0 + strh r0, [r2, 0x8] + adds r4, r7, 0 + cmp r4, 0x2 + ble _081A492A + mov r0, r8 + bl Free + add sp, 0x74 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A48B4 + + thumb_func_start sub_81A4998 +sub_81A4998: @ 81A4998 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x94 + adds r7, r0, 0 + str r1, [sp, 0x90] + ldr r0, =gStringVar1 + ldr r4, =gUnknown_08611CB0 + lsls r5, r7, 3 + adds r1, r5, r4 + ldr r1, [r1] + bl StringCopy + ldr r6, =gStringVar4 + adds r4, 0x4 + adds r5, r4 + ldr r1, [r5] + adds r0, r6, 0 + bl StringExpandPlaceholders + ldr r0, =gUnknown_0203AB74 + mov r8, r0 + ldrb r0, [r0] + movs r1, 0x1 + mov r10, r1 + str r1, [sp] + movs r2, 0xFF + mov r9, r2 + str r2, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + adds r2, r6, 0 + movs r3, 0 + bl PrintTextOnWindow + ldr r1, =gUnknown_08611D00 + ldr r2, [sp, 0x90] + lsls r0, r2, 2 + adds r0, r1 + ldr r4, [r0] + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xD0 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + mov r1, r8 + ldrb r0, [r1] + lsls r3, 24 + lsrs r3, 24 + mov r2, r10 + str r2, [sp] + mov r1, r9 + str r1, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl PrintTextOnWindow + cmp r7, 0x9 + bne _081A4A6C + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r1, =0x00000ee8 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r2] + movs r2, 0xEF + lsls r2, 4 + adds r0, r2 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + add r4, sp, 0x3C + adds r0, r4, 0 + ldr r1, [sp, 0x90] + bl sub_81A48B4 +_081A4A3A: + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0x4 + adds r3, r4, 0 + bl sub_81A4684 + adds r4, 0x1C + adds r5, 0x1 + cmp r5, 0x2 + ble _081A4A3A + b _081A4A90 + .pool +_081A4A6C: + add r0, sp, 0xC + adds r1, r7, 0 + ldr r2, [sp, 0x90] + bl sub_81A47E0 + movs r5, 0 + add r4, sp, 0xC +_081A4A7A: + str r7, [sp] + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0x4 + adds r3, r4, 0 + bl sub_81A4594 + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x2 + ble _081A4A7A +_081A4A90: + add sp, 0x94 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A4998 + + thumb_func_start sub_81A4AA0 +sub_81A4AA0: @ 81A4AA0 + push {r4,lr} + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C84 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + movs r1, 0 + bl sub_81A4998 + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4AA0 + + thumb_func_start sub_81A4AE8 +sub_81A4AE8: @ 81A4AE8 + push {r4,lr} + ldr r4, =gUnknown_0203AB74 + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_81A4998 + ldrb r0, [r4] + movs r1, 0x2 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4AE8 + + thumb_func_start sub_81A4B14 +sub_81A4B14: @ 81A4B14 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r1, 0 + ldr r3, =gSaveBlock2Ptr +_081A4B24: + movs r6, 0 + lsls r0, r1, 1 + adds r2, r1, 0x1 + mov r10, r2 + adds r0, r1 + lsls r0, 5 + mov r8, r0 + movs r7, 0 + movs r0, 0x87 + lsls r0, 2 + add r0, r8 + mov r9, r0 +_081A4B3C: + movs r5, 0 + adds r2, r7, 0 + mov r1, r8 + adds r4, r7, r1 +_081A4B44: + ldr r0, [r3] + add r0, r9 + adds r0, r2 + lsls r1, r5, 4 + adds r0, r1 + movs r1, 0 + str r2, [sp] + str r3, [sp, 0x4] + bl CopyUnalignedWord + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r0, r4 + ldr r1, =0x00000222 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r3] + adds r0, r4 + movs r1, 0x88 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + adds r4, 0x10 + adds r5, 0x1 + ldr r2, [sp] + cmp r5, 0x2 + ble _081A4B44 + adds r7, 0x30 + adds r6, 0x1 + cmp r6, 0x1 + ble _081A4B3C + mov r1, r10 + cmp r1, 0x8 + ble _081A4B24 + movs r6, 0 + ldr r7, =gSaveBlock2Ptr + movs r2, 0x54 + mov r10, r2 + movs r3, 0xFF + mov r9, r3 +_081A4B98: + adds r0, r6, 0x1 + mov r8, r0 + mov r1, r10 + muls r1, r6 + movs r0, 0x54 + adds r4, r6, 0 + muls r4, r0 + movs r2, 0 + ldr r3, =0x0000057c + adds r6, r1, r3 + movs r5, 0x2 +_081A4BAE: + ldr r0, [r7] + adds r0, r6 + adds r0, r2 + movs r1, 0 + str r2, [sp] + bl CopyUnalignedWord + ldr r0, [r7] + adds r0, r6 + ldr r2, [sp] + adds r0, r2 + adds r0, 0x4 + movs r1, 0 + bl CopyUnalignedWord + ldr r1, [r7] + adds r1, r4 + ldr r0, =0x00000586 + adds r1, r0 + ldrb r0, [r1] + mov r3, r9 + orrs r0, r3 + strb r0, [r1] + ldr r1, [r7] + adds r1, r4 + ldr r0, =0x0000058e + adds r1, r0 + ldrb r0, [r1] + orrs r0, r3 + strb r0, [r1] + ldr r0, [r7] + adds r0, r4 + ldr r1, =0x00000584 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + adds r4, 0x1C + ldr r2, [sp] + adds r2, 0x1C + subs r5, 0x1 + cmp r5, 0 + bge _081A4BAE + mov r6, r8 + cmp r6, 0x1 + ble _081A4B98 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4B14 + + thumb_func_start sub_81A4C30 +sub_81A4C30: @ 81A4C30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0x96 + lsls r0, 2 + bl AllocZeroed + adds r7, r0, 0 + adds r4, r7, 0 + movs r5, 0 + movs r0, 0xFA + lsls r0, 1 + adds r6, r7, r0 + ldr r0, =gPlayerParty + mov r8, r0 +_081A4C4E: + mov r0, r8 + adds r1, r5, r0 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + adds r4, 0x64 + adds r5, 0x64 + cmp r4, r6 + ble _081A4C4E + ldr r4, =gPlayerPartyCount + ldrb r5, [r4] + bl copy_player_party_from_sav1 + bl sub_8076D5C + movs r0, 0x1 + bl TrySavingData + bl sav2_gender2_inplace_and_xFE + strb r5, [r4] + adds r4, r7, 0 + ldr r5, =gPlayerParty + movs r0, 0xFA + lsls r0, 1 + adds r6, r7, r0 +_081A4C84: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r4, 0x64 + adds r5, 0x64 + cmp r4, r6 + ble _081A4C84 + adds r0, r7, 0 + bl Free + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4C30 + + thumb_func_start sub_81A4CB0 +sub_81A4CB0: @ 81A4CB0 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A4CD0 + bl sub_8185EA0 + lsls r0, 24 + lsrs r0, 24 + b _081A4CDA + .pool +_081A4CD0: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 +_081A4CDA: + ldr r2, =gTrainers + ldr r1, =gUnknown_08611D30 + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x3] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A4CB0 + + thumb_func_start sub_81A4D00 +sub_81A4D00: @ 81A4D00 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A4D20 + bl sub_8185EA0 + lsls r0, 24 + lsrs r0, 24 + b _081A4D2A + .pool +_081A4D20: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 +_081A4D2A: + ldr r2, =gTrainers + ldr r1, =gUnknown_08611D30 + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A4D00 + + thumb_func_start sub_81A4D50 +sub_81A4D50: @ 81A4D50 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A4D70 + bl sub_8185EA0 + lsls r0, 24 + lsrs r0, 24 + b _081A4D7A + .pool +_081A4D70: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 +_081A4D7A: + movs r3, 0 + lsls r0, 1 + ldr r2, =gTrainers + ldr r1, =gUnknown_08611D30 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x4 + adds r2, r0, r2 +_081A4D90: + adds r1, r4, r3 + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r3, 0x1 + cmp r3, 0x6 + ble _081A4D90 + adds r1, r4, r3 + movs r0, 0xFF + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4D50 + + thumb_func_start sub_81A4DB8 +sub_81A4DB8: @ 81A4DB8 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + ldr r1, =gUnknown_08611C8C + lsrs r0, 15 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A4DB8 + + thumb_func_start sub_81A4DD8 +sub_81A4DD8: @ 81A4DD8 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + ldr r2, =0x00004010 + ldr r1, =gUnknown_08611C8C + lsrs r0, 15 + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4DD8 + + thumb_func_start sub_81A4E04 +sub_81A4E04: @ 81A4E04 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x20] + bl sub_81A513C + str r0, [sp, 0x24] + ldr r0, [sp, 0x20] + cmp r0, 0x1 + bne _081A4E44 + ldr r0, =0x000003fe + bl sub_81953A0 + lsls r0, 16 + lsrs r0, 16 + bl sub_818FC78 + adds r4, r0, 0 + b _081A4E46 + .pool +_081A4E44: + movs r4, 0x7 +_081A4E46: + bl ZeroEnemyPartyMons + movs r1, 0 + str r1, [sp, 0x18] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + movs r2, 0 + str r2, [sp, 0x14] +_081A4E5C: + movs r0, 0x1 + ands r0, r4 + asrs r4, 1 + str r4, [sp, 0x30] + ldr r3, [sp, 0x14] + adds r3, 0x1 + str r3, [sp, 0x28] + cmp r0, 0 + bne _081A4E70 + b _081A4FC4 +_081A4E70: + ldr r4, [sp, 0x14] + lsls r4, 2 + mov r9, r4 + ldr r0, [sp, 0x24] + lsls r0, 4 + str r0, [sp, 0x38] + ldr r1, [sp, 0x20] + lsls r1, 4 + str r1, [sp, 0x34] + ldr r2, [sp, 0x1C] + lsls r2, 24 + str r2, [sp, 0x3C] + ldr r3, [sp, 0x18] + adds r3, 0x1 + str r3, [sp, 0x2C] + ldr r0, [sp, 0x14] + add r0, r9 + lsls r0, 2 + mov r8, r0 +_081A4E96: + bl Random + adds r4, r0, 0 + bl Random + lsls r4, 16 + lsrs r7, r4, 16 + lsls r0, 16 + orrs r7, r0 + ldr r0, =0x0000ef2a + adds r1, r7, 0 + bl IsShinyOtIdPersonality + lsls r0, 24 + cmp r0, 0 + bne _081A4E96 + ldr r4, [sp, 0x38] + ldr r1, [sp, 0x24] + subs r0, r4, r1 + lsls r5, r0, 2 + mov r2, r8 + adds r4, r2, r5 + ldr r3, [sp, 0x34] + ldr r1, [sp, 0x20] + subs r0, r3, r1 + lsls r6, r0, 3 + adds r4, r6 + ldr r2, =gUnknown_0861156C + adds r4, r2 + adds r0, r7, 0 + bl GetNatureFromPersonality + ldrb r1, [r4, 0x5] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _081A4E96 + ldr r4, [sp, 0x18] + movs r0, 0x64 + adds r3, r4, 0 + muls r3, r0 + mov r8, r3 + ldr r1, =gEnemyParty + add r1, r8 + mov r10, r1 + ldr r4, [sp, 0x14] + add r4, r9 + lsls r4, 2 + adds r0, r4, r5 + adds r0, r6 + ldr r2, =gUnknown_0861156C + adds r0, r2 + ldrh r1, [r0] + ldr r3, [sp, 0x3C] + lsrs r2, r3, 24 + ldrb r3, [r0, 0x4] + movs r0, 0x1 + str r0, [sp] + str r7, [sp, 0x4] + str r0, [sp, 0x8] + ldr r0, =0x0000ef2a + str r0, [sp, 0xC] + mov r0, r10 + bl CreateMon + ldr r0, =gUnknown_0861156C + adds r5, r0 + adds r5, r6, r5 + adds r4, r5, r4 + adds r4, 0x2 + mov r0, r10 + movs r1, 0xC + adds r2, r4, 0 + bl SetMonData + movs r7, 0 + mov r6, r8 + ldr r3, =gEnemyParty +_081A4F32: + adds r1, r7, 0 + adds r1, 0x1A + ldr r0, [sp, 0x14] + add r0, r9 + lsls r4, r0, 2 + adds r2, r5, r4 + adds r0, r7, 0x6 + adds r2, r0 + adds r0, r6, r3 + str r3, [sp, 0x40] + bl SetMonData + adds r7, 0x1 + ldr r3, [sp, 0x40] + cmp r7, 0x5 + ble _081A4F32 + movs r1, 0xFF + add r0, sp, 0x10 + strb r1, [r0] + movs r7, 0 + ldr r1, [sp, 0x18] + movs r2, 0x64 + adds r6, r1, 0 + muls r6, r2 + ldr r3, =gUnknown_08611578 + mov r8, r3 + ldr r3, =gEnemyParty + adds r5, r4, 0 +_081A4F6A: + ldr r4, [sp, 0x38] + ldr r0, [sp, 0x24] + subs r1, r4, r0 + lsls r1, 2 + adds r1, r5, r1 + ldr r2, [sp, 0x34] + ldr r4, [sp, 0x20] + subs r0, r2, r4 + lsls r0, 3 + adds r1, r0 + add r1, r8 + ldrh r4, [r1] + lsls r2, r7, 24 + lsrs r2, 24 + adds r0, r6, r3 + adds r1, r4, 0 + str r3, [sp, 0x40] + bl SetMonMoveSlot + ldr r3, [sp, 0x40] + cmp r4, 0xDA + bne _081A4F9C + movs r1, 0 + add r0, sp, 0x10 + strb r1, [r0] +_081A4F9C: + adds r5, 0x2 + adds r7, 0x1 + cmp r7, 0x3 + ble _081A4F6A + ldr r0, [sp, 0x18] + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x10 + bl SetMonData + adds r0, r4, 0 + bl CalculateMonStats + ldr r2, [sp, 0x2C] + str r2, [sp, 0x18] +_081A4FC4: + ldr r4, [sp, 0x30] + ldr r3, [sp, 0x28] + str r3, [sp, 0x14] + cmp r3, 0x2 + bgt _081A4FD0 + b _081A4E5C +_081A4FD0: + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4E04 + + thumb_func_start sub_81A4FF0 +sub_81A4FF0: @ 81A4FF0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x000040cf + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r3, =gUnknown_0861156C + lsls r2, r4, 2 + adds r2, r4 + lsls r1, r0, 4 + subs r1, r0 + adds r1, r2 + lsls r1, 2 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r1, r0 + adds r1, r3 + ldrh r0, [r1] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A4FF0 + + thumb_func_start sub_81A5030 +sub_81A5030: @ 81A5030 + push {lr} + lsls r0, 24 + ldr r2, =gTrainerBattleOpponent_A + ldr r3, =0x000003fe + adds r1, r3, 0 + strh r1, [r2] + ldr r2, =0x00004010 + ldr r1, =gUnknown_08611C8C + lsrs r0, 23 + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5030 + + thumb_func_start sub_81A5060 +sub_81A5060: @ 81A5060 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x000040cf + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r2, =gUnknown_0861156C + lsls r4, 1 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 2 + adds r4, r1 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 2 + adds r4, r1 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r4, r0 + adds r2, 0xC + adds r4, r2 + ldrh r0, [r4] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A5060 + + thumb_func_start sub_81A50B0 +sub_81A50B0: @ 81A50B0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x000040cf + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r3, =gUnknown_0861156C + lsls r2, r4, 2 + adds r2, r4 + lsls r1, r0, 4 + subs r1, r0 + adds r1, r2 + lsls r1, 2 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r1, r0 + adds r1, r3 + ldrb r0, [r1, 0x5] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A50B0 + + thumb_func_start sub_81A50F0 +sub_81A50F0: @ 81A50F0 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x000040cf + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r2, =gUnknown_0861156C + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 2 + adds r4, r1 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 2 + adds r4, r1 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r4, r0 + adds r2, 0x6 + adds r4, r2 + ldrb r0, [r4] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A50F0 + + thumb_func_start sub_81A513C +sub_81A513C: @ 81A513C + push {r4,r5,lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bne _081A51A0 + bl sub_81A39C4 + lsls r0, 16 + ldr r3, =gUnknown_08611550 + lsls r2, r5, 2 + adds r1, r3, 0x3 + adds r1, r2, r1 + lsrs r0, 16 + ldrb r1, [r1] + adds r1, r0, r1 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _081A5180 + movs r4, 0 + b _081A51A0 + .pool +_081A5180: + adds r0, r3, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r1, r0 + beq _081A519E + cmp r1, r0 + ble _081A51A0 + subs r0, r1, r0 + adds r1, r3, 0x2 + adds r1, r2, r1 + ldrb r1, [r1] + bl __modsi3 + cmp r0, 0 + bne _081A51A0 +_081A519E: + movs r4, 0x1 +_081A51A0: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A513C + + thumb_func_start sub_81A51A8 +sub_81A51A8: @ 81A51A8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A51D4 + bl sub_8185EA0 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8185EAC + lsls r0, 24 + lsrs r1, r0, 24 + b _081A51E4 + .pool +_081A51D4: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_81A513C + adds r1, r0, 0 +_081A51E4: + cmp r5, 0 + beq _081A51F4 + cmp r5, 0x1 + beq _081A5214 + b _081A5228 + .pool +_081A51F4: + ldr r0, =gStringVar4 + ldr r2, =gUnknown_08611DB0 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + b _081A5228 + .pool +_081A5214: + ldr r0, =gStringVar4 + ldr r2, =gUnknown_08611DB8 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy +_081A5228: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A51A8 + + thumb_func_start sub_81A5238 +sub_81A5238: @ 81A5238 + push {lr} + ldr r1, =gUnknown_08611F84 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5238 + + thumb_func_start sub_81A5258 +sub_81A5258: @ 81A5258 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r6, 0 + ldrb r0, [r5] + cmp r0, 0xA + bls _081A5268 + b _081A5544 +_081A5268: + lsls r0, 2 + ldr r1, =_081A5278 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A5278: + .4byte _081A52A4 + .4byte _081A52F4 + .4byte _081A531C + .4byte _081A53B4 + .4byte _081A540C + .4byte _081A542C + .4byte _081A544C + .4byte _081A5490 + .4byte _081A553E + .4byte _081A54D4 + .4byte _081A5520 +_081A52A4: + ldr r0, =0x7fffff1c + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x8 + bl BeginNormalPaletteFade + ldr r1, =0x00003f3e + movs r0, 0x48 + bl SetGpuReg + ldr r0, =gUnknown_08611F74 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08D855E8 + movs r1, 0xF8 + lsls r1, 1 + movs r2, 0x20 + bl LoadCompressedPalette + ldr r1, =gUnknown_02022E24 + movs r0, 0xFF + strh r0, [r1] + ldr r1, =gUnknown_02022E26 + movs r0, 0x70 + strh r0, [r1] + b _081A553E + .pool +_081A52F4: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081A5306 + b _081A5544 +_081A5306: + str r0, [sp] + movs r0, 0x5 + movs r1, 0 + movs r2, 0x18 + movs r3, 0xD + bl sub_8056A3C + b _081A553E + .pool +_081A531C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081A5328 + b _081A5544 +_081A5328: + ldr r1, =gBattleTextBuff1 + movs r2, 0xA1 + strb r2, [r1] + movs r0, 0xFF + strb r0, [r1, 0x1] + ldr r1, =gBattleTextBuff2 + strb r2, [r1] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x1] + ldr r0, =gUnknown_085CCDB2 + bl StrCpyDecodeToDisplayedStringBattle + ldr r4, =gDisplayedStringBattle + adds r0, r4, 0 + movs r1, 0xF + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDB5 + movs r1, 0x10 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDB8 + bl StrCpyDecodeToDisplayedStringBattle + adds r0, r4, 0 + movs r1, 0x11 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDBB + movs r1, 0x12 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDC0 + movs r1, 0x13 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDC6 + movs r1, 0x14 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDCB + bl StrCpyDecodeToDisplayedStringBattle + adds r0, r4, 0 + movs r1, 0x15 + bl battle_show_message_maybe + b _081A553E + .pool +_081A53B4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081A53C0 + b _081A5544 +_081A53C0: + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + movs r6, 0x80 + lsls r6, 15 + movs r4, 0x7 +_081A53CE: + asrs r1, r6, 16 + ldr r0, =gUnknown_08611F5C + movs r2, 0x54 + movs r3, 0 + bl CreateSprite + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x3 + bl StartSpriteAnim + movs r0, 0x80 + lsls r0, 13 + adds r6, r0 + subs r4, 0x1 + cmp r4, 0 + bge _081A53CE + b _081A553C + .pool +_081A540C: + ldr r0, =0x00000109 + bl PlaySE + movs r0, 0x50 + movs r1, 0x28 + movs r2, 0 + movs r3, 0 + bl sub_81A5558 + movs r0, 0xA0 + movs r1, 0x28 + movs r2, 0 + b _081A5464 + .pool +_081A542C: + ldr r0, =0x00000109 + bl PlaySE + movs r0, 0x50 + movs r1, 0x38 + movs r2, 0x1 + movs r3, 0 + bl sub_81A5558 + movs r0, 0xA0 + movs r1, 0x38 + movs r2, 0x1 + b _081A5464 + .pool +_081A544C: + ldr r0, =0x00000109 + bl PlaySE + movs r0, 0x50 + movs r1, 0x48 + movs r2, 0x2 + movs r3, 0 + bl sub_81A5558 + movs r0, 0xA0 + movs r1, 0x48 + movs r2, 0x2 +_081A5464: + movs r3, 0x1 + bl sub_81A5558 + ldr r0, =gUnknown_085CCDCB + bl StrCpyDecodeToDisplayedStringBattle + ldr r0, =gDisplayedStringBattle + movs r1, 0x15 + bl battle_show_message_maybe + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + movs r6, 0x1 + b _081A5544 + .pool +_081A5490: + movs r0, 0x85 + lsls r0, 1 + bl PlaySE + ldr r0, =gBattleTextBuff1 + ldr r1, =gBattleTextBuff2 + ldrb r2, [r0] + ldrb r0, [r1] + cmp r2, r0 + bls _081A54BC + movs r6, 0x2 + ldr r1, =gBattleScripting + movs r0, 0 + strb r0, [r1, 0x17] + b _081A553E + .pool +_081A54BC: + cmp r2, r0 + bcs _081A54D0 + movs r6, 0x3 + ldr r1, =gBattleScripting + movs r0, 0x1 + strb r0, [r1, 0x17] + b _081A553E + .pool +_081A54D0: + movs r6, 0x4 + b _081A553E +_081A54D4: + ldr r1, =0x00003f3e + movs r0, 0x48 + bl SetGpuReg + movs r0, 0x1 + str r0, [sp] + movs r0, 0x5 + movs r1, 0 + movs r2, 0x18 + movs r3, 0xD + bl sub_8056A3C + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl m4aMPlayVolumeControl + ldr r0, =0x7fffff1c + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0x8 + movs r3, 0 + bl BeginNormalPaletteFade + b _081A553E + .pool +_081A5520: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081A5544 + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + movs r0, 0xFA + lsls r0, 2 + bl FreeSpriteTilesByTag +_081A553C: + movs r6, 0x1 +_081A553E: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] +_081A5544: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A5258 + + thumb_func_start sub_81A5558 +sub_81A5558: @ 81A5558 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r7, r3, 24 + movs r6, 0 + movs r1, 0 + ldr r0, =gBattleStruct + ldr r0, [r0] + movs r3, 0xA6 + lsls r3, 2 + adds r4, r0, r3 + ldr r5, =0x0000029a + adds r3, r0, r5 + adds r5, 0x2 + adds r5, r0 + mov r8, r5 + cmp r2, 0x1 + beq _081A55C4 + cmp r2, 0x1 + bgt _081A55A8 + cmp r2, 0 + beq _081A55B0 + b _081A5612 + .pool +_081A55A8: + mov r0, r9 + cmp r0, 0x2 + beq _081A55D8 + b _081A5612 +_081A55B0: + adds r0, r4, r7 + movs r6, 0 + ldrsb r6, [r0, r6] + movs r1, 0x1 + adds r0, r7, 0 + eors r0, r1 + adds r0, r4, r0 + movs r1, 0 + ldrsb r1, [r0, r1] + b _081A5612 +_081A55C4: + adds r0, r3, r7 + movs r6, 0 + ldrsb r6, [r0, r6] + movs r1, 0x1 + adds r0, r7, 0 + eors r0, r1 + adds r0, r3, r0 + movs r1, 0 + ldrsb r1, [r0, r1] + b _081A5612 +_081A55D8: + ldr r3, =gBattleMons + mov r9, r3 + movs r5, 0x58 + adds r0, r7, 0 + muls r0, r5 + add r0, r9 + ldrh r0, [r0, 0x28] + movs r4, 0x64 + muls r0, r4 + lsls r1, r7, 1 + add r1, r8 + ldrh r1, [r1] + bl __divsi3 + adds r6, r0, 0 + movs r0, 0x1 + adds r1, r7, 0 + eors r1, r0 + adds r0, r1, 0 + muls r0, r5 + add r0, r9 + ldrh r0, [r0, 0x28] + muls r0, r4 + lsls r1, 1 + add r1, r8 + ldrh r1, [r1] + bl __divsi3 + adds r1, r0, 0 +_081A5612: + cmp r6, r1 + ble _081A5638 + movs r4, 0x2 + cmp r7, 0 + beq _081A5628 + ldr r1, =gBattleTextBuff2 + b _081A562A + .pool +_081A5628: + ldr r1, =gBattleTextBuff1 +_081A562A: + ldrb r0, [r1] + adds r0, 0x2 + strb r0, [r1] + b _081A565E + .pool +_081A5638: + cmp r6, r1 + bne _081A565C + movs r4, 0x1 + cmp r7, 0 + beq _081A564C + ldr r1, =gBattleTextBuff2 + b _081A564E + .pool +_081A564C: + ldr r1, =gBattleTextBuff1 +_081A564E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081A565E + .pool +_081A565C: + movs r4, 0 +_081A565E: + ldr r0, =gUnknown_08611F5C + ldr r1, [sp] + mov r2, r10 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + adds r1, r4, 0 + bl StartSpriteAnim + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5558 + + thumb_func_start sub_81A5698 +sub_81A5698: @ 81A5698 + push {lr} + adds r1, r0, 0 + ldr r0, =gBattleCommunication + ldrb r0, [r0] + cmp r0, 0x8 + bls _081A56AA + adds r0, r1, 0 + bl DestroySprite +_081A56AA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5698 + + thumb_func_start sub_81A56B4 +sub_81A56B4: @ 81A56B4 + ldr r0, =gBattleStruct + ldr r2, [r0] + movs r0, 0xA6 + lsls r0, 2 + adds r1, r2, r0 + adds r0, 0x2 + adds r3, r2, r0 + adds r0, 0x2 + adds r2, r0 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + strb r0, [r3] + strb r0, [r3, 0x1] + ldr r0, =gBattleMons + ldrh r1, [r0, 0x28] + strh r1, [r2] + adds r0, 0x80 + ldrh r0, [r0] + strh r0, [r2, 0x2] + bx lr + .pool + thumb_func_end sub_81A56B4 + + thumb_func_start sub_81A56E8 +sub_81A56E8: @ 81A56E8 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gBattleStruct + ldr r1, [r1] + movs r2, 0xA6 + lsls r2, 2 + adds r1, r2 + adds r1, r0 + ldr r2, =gBattleArenaMoveMindRatings + ldr r0, =gCurrentMove + ldrh r0, [r0] + adds r0, r2 + ldrb r0, [r0] + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81A56E8 + + thumb_func_start sub_81A5718 +sub_81A5718: @ 81A5718 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r6, r3, 0 + ldr r0, =gBattleStruct + ldr r2, [r0] + ldr r0, =0x0000029a + adds r5, r2, r0 + ldr r0, =gHitMarker + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _081A57DA + ldr r0, =0x000002a2 + adds r4, r2, r0 + ldrb r2, [r4] + ldr r0, =gBitTable + lsls r1, r3, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081A576C + bics r2, r1 + strb r2, [r4] + adds r1, r5, r3 + ldrb r0, [r1] + subs r0, 0x2 + b _081A57D8 + .pool +_081A576C: + ldr r0, =gBattleMoveFlags + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _081A5798 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081A5788 + ldr r0, =gBattleCommunication + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + beq _081A57DA +_081A5788: + adds r1, r5, r3 + ldrb r0, [r1] + subs r0, 0x2 + b _081A57D8 + .pool +_081A5798: + movs r0, 0x6 + ands r0, r1 + cmp r0, 0x6 + bne _081A57A4 + adds r1, r5, r3 + b _081A57D4 +_081A57A4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081A57B4 + adds r1, r5, r3 + ldrb r0, [r1] + adds r0, 0x2 + b _081A57D8 +_081A57B4: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081A57C4 + adds r1, r5, r3 + ldrb r0, [r1] + subs r0, 0x1 + b _081A57D8 +_081A57C4: + ldr r0, =gProtectStructs + lsls r1, r6, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + bne _081A57DA + adds r1, r5, r6 +_081A57D4: + ldrb r0, [r1] + adds r0, 0x1 +_081A57D8: + strb r0, [r1] +_081A57DA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5718 + + thumb_func_start sub_81A57E4 +sub_81A57E4: @ 81A57E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r1, 16 + adds r2, r1, 0 + ldr r0, =gBattleStruct + ldr r0, [r0] + ldr r5, =0x0000029a + adds r3, r0, r5 + movs r0, 0x99 + lsls r0, 1 + cmp r1, r0 + bgt _081A582A + subs r0, 0x1 + cmp r1, r0 + bge _081A585C + cmp r1, 0xC5 + bgt _081A581C + cmp r1, 0xC3 + bge _081A585C + cmp r1, 0x77 + beq _081A585C + b _081A5864 + .pool +_081A581C: + cmp r1, 0xC7 + blt _081A5864 + cmp r1, 0xCC + ble _081A585C + cmp r1, 0xCE + beq _081A585C + b _081A5864 +_081A582A: + ldr r0, =0x00000147 + cmp r1, r0 + beq _081A585C + cmp r1, r0 + bgt _081A5848 + subs r0, 0x12 + cmp r1, r0 + beq _081A585C + adds r0, 0x2 + cmp r1, r0 + beq _081A585C + b _081A5864 + .pool +_081A5848: + movs r0, 0xAD + lsls r0, 1 + cmp r2, r0 + blt _081A5864 + adds r0, 0x1 + cmp r2, r0 + ble _081A585C + adds r0, 0x3 + cmp r2, r0 + bne _081A5864 +_081A585C: + adds r1, r3, r4 + ldrb r0, [r1] + subs r0, 0x3 + strb r0, [r1] +_081A5864: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81A57E4 + + thumb_func_start sub_81A586C +sub_81A586C: @ 81A586C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gBattleStruct + ldr r3, [r1] + movs r1, 0xA7 + lsls r1, 2 + adds r3, r1 + lsls r2, r0, 1 + adds r2, r3 + ldr r5, =gBattleMons + movs r4, 0x58 + adds r1, r0, 0 + muls r1, r4 + adds r1, r5 + ldrh r1, [r1, 0x28] + strh r1, [r2] + movs r1, 0x1 + eors r0, r1 + lsls r1, r0, 1 + adds r1, r3 + muls r0, r4 + adds r0, r5 + ldrh r2, [r0, 0x28] + ldrh r0, [r1] + cmp r0, r2 + bls _081A58A4 + strh r2, [r1] +_081A58A4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A586C + + thumb_func_start sub_81A58B4 +sub_81A58B4: @ 81A58B4 + push {r4-r6,lr} + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r3, =0x00000ca9 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x00000ca8 + adds r1, r0 + movs r2, 0 + strb r2, [r1] + ldr r1, [r4] + ldr r6, =0x00000cb2 + adds r0, r1, r6 + strh r2, [r0] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + cmp r5, 0 + beq _081A5914 + ldr r0, [r4] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r2, [r0] + movs r0, 0x80 + b _081A591E + .pool +_081A5914: + ldr r0, [r4] + ldr r3, =0x00000cdc + adds r0, r3 + ldr r2, [r0] + movs r0, 0x40 +_081A591E: + ands r2, r0 + cmp r2, 0 + bne _081A5930 + ldr r0, [r4] + lsls r1, r5, 1 + ldr r6, =0x00000dda + adds r0, r6 + adds r0, r1 + strh r2, [r0] +_081A5930: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r1, =gTrainerBattleOpponent_A + movs r0, 0 + strh r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A58B4 + + thumb_func_start sub_81A5964 +sub_81A5964: @ 81A5964 + push {r4,lr} + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A59B0 + cmp r0, 0x1 + bgt _081A5994 + cmp r0, 0 + beq _081A599A + b _081A59EE + .pool +_081A5994: + cmp r0, 0x2 + beq _081A59C8 + b _081A59EE +_081A599A: + ldr r0, =gScriptResult + ldr r2, =0x00000dd8 + adds r1, r3, r2 + ldrh r1, [r1] + strh r1, [r0] + b _081A59EE + .pool +_081A59B0: + ldr r2, =gScriptResult + lsls r1, 1 + ldr r4, =0x00000dda + adds r0, r3, r4 + adds r0, r1 + ldrh r0, [r0] + b _081A59EC + .pool +_081A59C8: + cmp r1, 0 + beq _081A59E0 + ldr r2, =gScriptResult + ldr r1, =0x00000cdc + adds r0, r3, r1 + ldr r0, [r0] + movs r1, 0x80 + b _081A59EA + .pool +_081A59E0: + ldr r2, =gScriptResult + ldr r4, =0x00000cdc + adds r0, r3, r4 + ldr r0, [r0] + movs r1, 0x40 +_081A59EA: + ands r0, r1 +_081A59EC: + strh r0, [r2] +_081A59EE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5964 + + thumb_func_start sub_81A59FC +sub_81A59FC: @ 81A59FC + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A5A48 + cmp r0, 0x1 + bgt _081A5A2C + cmp r0, 0 + beq _081A5A32 + b _081A5ABA + .pool +_081A5A2C: + cmp r0, 0x2 + beq _081A5A60 + b _081A5ABA +_081A5A32: + ldr r0, =gSpecialVar_0x8006 + ldrh r1, [r0] + ldr r3, =0x00000dd8 + adds r0, r2, r3 + strh r1, [r0] + b _081A5ABA + .pool +_081A5A48: + lsls r1, 1 + ldr r3, =0x00000dda + adds r0, r2, r3 + adds r0, r1 + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + strh r1, [r0] + b _081A5ABA + .pool +_081A5A60: + cmp r1, 0 + beq _081A5A90 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A5A80 + ldr r1, =0x00000cdc + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x80 + orrs r1, r2 + b _081A5AB8 + .pool +_081A5A80: + ldr r3, =0x00000cdc + adds r0, r2, r3 + ldr r1, [r0] + movs r2, 0x81 + negs r2, r2 + b _081A5AB6 + .pool +_081A5A90: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A5AAC + ldr r1, =0x00000cdc + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x40 + orrs r1, r2 + b _081A5AB8 + .pool +_081A5AAC: + ldr r3, =0x00000cdc + adds r0, r2, r3 + ldr r1, [r0] + movs r2, 0x41 + negs r2, r2 +_081A5AB6: + ands r1, r2 +_081A5AB8: + str r1, [r0] +_081A5ABA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A59FC + + thumb_func_start sub_81A5AC4 +sub_81A5AC4: @ 81A5AC4 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5AC4 + + thumb_func_start sub_81A5B08 +sub_81A5B08: @ 81A5B08 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000dda + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0x29 + bls _081A5B58 + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_08611FAC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =0x00000dd8 + adds r4, r1 + b _081A5B76 + .pool +_081A5B58: + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_08611FA0 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r2, =0x00000dd8 + adds r4, r2 +_081A5B76: + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5B08 + + thumb_func_start sub_81A5B88 +sub_81A5B88: @ 81A5B88 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000dd8 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081A5BD0 + ldr r0, [r4] + ldr r1, =0x00000dd8 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000dd8 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081A5BD6 + .pool +_081A5BD0: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081A5BD6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5B88 + + thumb_func_start sub_81A5BE0 +sub_81A5BE0: @ 81A5BE0 + push {lr} + ldr r0, =gStringVar1 + ldr r1, =gTrainerBattleOpponent_A + ldrh r1, [r1] + bl sub_8162E20 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5BE0 + + thumb_func_start sub_81A5BF8 +sub_81A5BF8: @ 81A5BF8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + movs r0, 0x1B + mov r8, r0 + movs r5, 0x7 + movs r4, 0x1 + str r4, [sp] + movs r6, 0x6 + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0xFE + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x20 + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x31 + movs r2, 0 + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x33 + movs r2, 0x1 + movs r3, 0xE + bl FillBgTilemapBufferRect + mov r0, r8 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x34 + movs r2, 0x2 + movs r3, 0xE + bl FillBgTilemapBufferRect + movs r0, 0x1C + mov r8, r0 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x35 + movs r2, 0x1C + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x36 + movs r2, 0x1D + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + movs r6, 0x5 + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x37 + movs r2, 0 + movs r3, 0xF + bl FillBgTilemapBufferRect + mov r0, r8 + str r0, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x39 + movs r2, 0x1 + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x3A + movs r2, 0x1D + movs r3, 0xF + bl FillBgTilemapBufferRect + ldr r1, =0x00000831 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0x13 + bl FillBgTilemapBufferRect + ldr r1, =0x00000833 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x1 + movs r3, 0x13 + bl FillBgTilemapBufferRect + ldr r1, =0x00000834 + movs r0, 0x1A + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x2 + movs r3, 0x13 + bl FillBgTilemapBufferRect + ldr r1, =0x00000835 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x1C + movs r3, 0x13 + bl FillBgTilemapBufferRect + ldr r1, =0x00000836 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x1D + movs r3, 0x13 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5BF8 + + thumb_func_start sub_81A5D44 +sub_81A5D44: @ 81A5D44 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + movs r5, 0 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xE + bl FillBgTilemapBufferRect + movs r6, 0x4 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0xE + bl FillBgTilemapBufferRect + movs r0, 0x1B + mov r8, r0 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x5 + movs r2, 0x2 + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x6 + movs r2, 0x1C + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x7 + movs r2, 0x1D + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x8 + movs r2, 0 + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x9 + movs r2, 0x1 + movs r3, 0xF + bl FillBgTilemapBufferRect + mov r0, r8 + str r0, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xA + movs r2, 0x2 + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xB + movs r2, 0x1C + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xC + movs r2, 0x1D + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xD + movs r2, 0 + movs r3, 0x13 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xE + movs r2, 0x1 + movs r3, 0x13 + bl FillBgTilemapBufferRect + mov r0, r8 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xF + movs r2, 0x2 + movs r3, 0x13 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x10 + movs r2, 0x1C + movs r3, 0x13 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x11 + movs r2, 0x1D + movs r3, 0x13 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81A5D44 + + thumb_func_start sub_81A5E74 +sub_81A5E74: @ 81A5E74 + push {lr} + ldr r1, =gUnknown_08612120 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5E74 + + thumb_func_start sub_81A5E94 +sub_81A5E94: @ 81A5E94 + push {r4-r7,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r4, =0x00000ca9 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r5] + ldr r1, =0x00000ca8 + adds r0, r1 + movs r2, 0 + strb r2, [r0] + ldr r1, [r5] + ldr r3, =0x00000cb2 + adds r0, r1, r3 + strh r2, [r0] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, [r5] + ldr r0, =0x00000cdc + adds r3, r4, r0 + ldr r2, =gUnknown_08612164 + lsls r0, r7, 2 + lsls r1, r6, 3 + adds r0, r1 + adds r0, r2 + ldr r3, [r3] + ldr r0, [r0] + ands r3, r0 + cmp r3, 0 + bne _081A5F0A + lsls r1, r7, 1 + lsls r0, r6, 2 + adds r1, r0 + ldr r2, =0x00000de2 + adds r0, r4, r2 + adds r0, r1 + strh r3, [r0] + adds r2, 0x10 + adds r0, r4, r2 + adds r0, r1 + strh r3, [r0] +_081A5F0A: + ldr r1, =gUnknown_03001288 + movs r0, 0 + strb r0, [r1] + movs r2, 0 + ldr r6, =gSaveBlock1Ptr + movs r4, 0xE7 + lsls r4, 4 + ldr r0, =0x0000ffff + adds r3, r0, 0 +_081A5F1C: + ldr r1, [r5] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, r4 + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _081A5F1C + movs r2, 0 + ldr r4, =gUnknown_03006298 + ldr r1, =0x0000ffff + adds r3, r1, 0 +_081A5F40: + lsls r0, r2, 1 + adds r0, r4 + ldrh r1, [r0] + orrs r1, r3 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _081A5F40 + ldr r0, [r6] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r1, =gTrainerBattleOpponent_A + movs r0, 0 + strh r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5E94 + + thumb_func_start sub_81A5FA8 +sub_81A5FA8: @ 81A5FA8 + push {r4-r7,lr} + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x2 + beq _081A6000 + cmp r0, 0x2 + bgt _081A5FE4 + cmp r0, 0x1 + beq _081A5FEA + b _081A6044 + .pool +_081A5FE4: + cmp r0, 0x3 + beq _081A6030 + b _081A6044 +_081A5FEA: + ldr r3, =gScriptResult + ldr r0, [r7] + lsls r1, r6, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000de2 + b _081A603C + .pool +_081A6000: + ldr r4, =gScriptResult + ldr r2, [r7] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_08612164 + lsls r0, r6, 2 + lsls r1, r5, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] + b _081A6044 + .pool +_081A6030: + ldr r3, =gScriptResult + ldr r0, [r7] + lsls r1, r6, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000df2 +_081A603C: + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] +_081A6044: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5FA8 + + thumb_func_start sub_81A6054 +sub_81A6054: @ 81A6054 + push {r4-r6,lr} + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x2 + beq _081A60B4 + cmp r0, 0x2 + bgt _081A6090 + cmp r0, 0x1 + beq _081A6096 + b _081A6128 + .pool +_081A6090: + cmp r0, 0x3 + beq _081A6108 + b _081A6128 +_081A6096: + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + ldr r1, =0x00000de2 + adds r2, r1 + adds r2, r0 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + strh r0, [r2] + b _081A6128 + .pool +_081A60B4: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A60E4 + ldr r2, [r6] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_08612164 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + str r0, [r2] + b _081A6128 + .pool +_081A60E4: + ldr r2, [r6] + ldr r1, =0x00000cdc + adds r2, r1 + ldr r3, =gUnknown_08612174 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 + str r0, [r2] + b _081A6128 + .pool +_081A6108: + ldr r3, =gUnknown_03001288 + ldrb r0, [r3] + cmp r0, 0x1 + bne _081A6128 + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + ldr r1, =0x00000df2 + adds r2, r1 + adds r2, r0 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + movs r1, 0 + strh r0, [r2] + strb r1, [r3] +_081A6128: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A6054 + + thumb_func_start sub_81A613C +sub_81A613C: @ 81A613C + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A613C + + thumb_func_start nullsub_75 +nullsub_75: @ 81A6180 + bx lr + thumb_func_end nullsub_75 + + thumb_func_start nullsub_123 +nullsub_123: @ 81A6184 + bx lr + thumb_func_end nullsub_123 + + thumb_func_start sub_81A6188 +sub_81A6188: @ 81A6188 + push {lr} + bl ZeroPlayerPartyMons + bl sub_819A4F8 + pop {r0} + bx r0 + thumb_func_end sub_81A6188 + + thumb_func_start sub_81A6198 +sub_81A6198: @ 81A6198 + push {lr} + bl sub_819DC00 + pop {r0} + bx r0 + thumb_func_end sub_81A6198 + + thumb_func_start sub_81A61A4 +sub_81A61A4: @ 81A61A4 + ldr r1, =gUnknown_03001288 + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81A61A4 + + thumb_func_start sub_81A61B0 +sub_81A61B0: @ 81A61B0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0x10] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r1, [r4] + ldr r3, [sp, 0x10] + lsls r2, r3, 1 + lsrs r0, 14 + adds r2, r0 + ldr r6, =0x00000de2 + adds r1, r6 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + ldr r2, =gUnknown_0203BC88 + ldr r1, =gBattleFrontierTrainers + str r1, [r2] + ldr r5, =0x00000cb2 + lsls r0, 24 + str r0, [sp, 0x20] + mov r8, r0 +_081A61FA: + ldr r0, [r4] + adds r0, r5 + ldrb r1, [r0] + mov r2, r8 + lsrs r0, r2, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r7, 0 + ldr r1, [r4] + adds r0, r1, r5 + ldr r6, [sp, 0x10] + lsls r6, 24 + str r6, [sp, 0x1C] + ldrh r0, [r0] + cmp r7, r0 + bge _081A6244 + ldr r2, =0x00000cb4 + adds r0, r1, r2 + ldrh r0, [r0] + ldr r6, =gSaveBlock2Ptr + cmp r0, r3 + beq _081A6244 + ldr r1, [r6] + ldr r6, =0x00000cb2 + adds r0, r1, r6 + ldrh r2, [r0] + ldr r0, =0x00000cb4 + adds r1, r0 +_081A6236: + adds r1, 0x2 + adds r7, 0x1 + cmp r7, r2 + bge _081A6244 + ldrh r0, [r1] + cmp r0, r3 + bne _081A6236 +_081A6244: + ldr r0, [r4] + ldr r1, =0x00000cb2 + adds r0, r1 + ldr r6, =gSaveBlock2Ptr + ldrh r0, [r0] + cmp r7, r0 + bne _081A61FA + ldr r0, =gTrainerBattleOpponent_A + strh r3, [r0] + ldr r2, [r6] + adds r1, r2, r1 + ldrh r0, [r1] + cmp r0, 0x5 + bhi _081A626C + adds r1, r0, 0 + lsls r1, 1 + ldr r4, =0x00000cb4 + adds r0, r2, r4 + adds r0, r1 + strh r3, [r0] +_081A626C: + movs r7, 0 + mov r10, sp + movs r6, 0 + lsls r6, 1 + str r6, [sp, 0x14] + add r6, sp + str r6, [sp, 0x18] +_081A627A: + ldr r1, [sp, 0x1C] + lsrs r0, r1, 24 + ldr r2, [sp, 0x20] + lsrs r1, r2, 24 + movs r2, 0 + bl sub_81A6EF0 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r4, =gUnknown_0203BC8C + ldr r2, [r4] + lsls r1, r0, 4 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0xC9 + beq _081A636E + movs r3, 0 + ldr r6, =gSaveBlock2Ptr + mov r8, r1 + adds r5, r0, 0 + ldr r1, [r6] +_081A62A6: + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r0, [r0] + lsls r0, 4 + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + beq _081A62C0 + adds r1, 0xC + adds r3, 0x1 + cmp r3, 0x5 + ble _081A62A6 +_081A62C0: + cmp r3, 0x6 + bne _081A636E + ldr r6, [sp, 0x10] + cmp r6, 0 + bne _081A62D0 + ldr r0, =0x00000351 + cmp r9, r0 + bhi _081A636E +_081A62D0: + movs r2, 0 + adds r4, r2, r7 + cmp r2, r4 + bge _081A6302 + ldr r1, [sp, 0x18] + ldrh r0, [r1] + cmp r0, r5 + beq _081A6302 + adds r6, r4, 0 + ldr r3, =gUnknown_0203BC8C + mov r12, r3 + mov r5, r8 + ldr r3, [sp, 0x14] + add r3, sp +_081A62EC: + adds r3, 0x2 + adds r2, 0x1 + cmp r2, r6 + bge _081A6302 + mov r1, r12 + ldr r0, [r1] + adds r0, r5, r0 + ldrh r1, [r3] + ldrh r0, [r0] + cmp r1, r0 + bne _081A62EC +_081A6302: + cmp r2, r4 + bne _081A636E + movs r2, 0 + cmp r2, r4 + bge _081A633E + ldr r3, =gBattleFrontierHeldItems + mov r12, r3 + add r0, sp, 0x8 + ldr r6, [sp, 0x14] + adds r3, r0, r6 + mov r0, r8 + str r0, [sp, 0x24] + adds r5, r4, 0 +_081A631C: + ldrh r1, [r3] + cmp r1, 0 + beq _081A6336 + ldr r6, =gUnknown_0203BC8C + ldr r0, [r6] + ldr r6, [sp, 0x24] + adds r0, r6, r0 + ldrb r0, [r0, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r1, r0 + beq _081A633E +_081A6336: + adds r3, 0x2 + adds r2, 0x1 + cmp r2, r5 + blt _081A631C +_081A633E: + cmp r2, r4 + bne _081A636E + lsls r4, r7, 1 + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + add r1, r8 + ldrh r0, [r1] + mov r2, r10 + strh r0, [r2] + add r2, sp, 0x8 + adds r2, r4 + ldr r3, =gBattleFrontierHeldItems + ldrb r0, [r1, 0xA] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r2] + ldr r0, =gUnknown_03006298 + adds r4, r0 + mov r3, r9 + strh r3, [r4] + movs r4, 0x2 + add r10, r4 + adds r7, 0x1 +_081A636E: + cmp r7, 0x3 + bne _081A627A + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A61B0 + + thumb_func_start sub_81A63B8 +sub_81A63B8: @ 81A63B8 + push {lr} + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + movs r1, 0 + bl sub_8162614 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A63B8 + + thumb_func_start sub_81A63CC +sub_81A63CC: @ 81A63CC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _081A63FC + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + b _081A6400 + .pool +_081A63FC: + ldr r1, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons +_081A6400: + str r0, [r1] + movs r7, 0 + ldr r2, =gSaveBlock2Ptr + mov r8, r2 +_081A6408: + mov r0, r8 + ldr r1, [r0] + adds r0, r7, 0x3 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 2 + adds r1, r4 + ldr r0, =gUnknown_03006298 + lsls r6, r7, 1 + adds r6, r0 + ldrh r0, [r6] + movs r2, 0xE7 + lsls r2, 4 + adds r1, r2 + strh r0, [r1] + movs r0, 0x64 + adds r5, r7, 0 + muls r5, r0 + ldr r0, =gEnemyParty + adds r5, r0 + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0 + bl GetBoxMonData + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, =0x00000e78 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r2, r8 + ldr r1, [r2] + ldr r2, =0x00000e74 + adds r1, r2 + adds r1, r4 + str r0, [r1] + adds r0, r5, 0 + movs r1, 0x2E + movs r2, 0 + bl GetBoxMonData + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, =0x00000e79 + adds r1, r2 + strb r0, [r1] + ldrh r1, [r6] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrb r2, [r1, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r5, 0 + movs r1, 0xC + bl SetMonData + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _081A6408 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A63CC + + thumb_func_start sub_81A64C4 +sub_81A64C4: @ 81A64C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r2, r0, r1 + ldrb r1, [r2] + movs r3, 0x3 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0x2 + bne _081A6500 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons + str r0, [r1] + movs r2, 0x1E + str r2, [sp, 0x14] + b _081A6518 + .pool +_081A6500: + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + ldrb r1, [r2] + adds r0, r3, 0 + ands r0, r1 + movs r4, 0x32 + str r4, [sp, 0x14] + cmp r0, 0 + beq _081A6518 + movs r5, 0x64 + str r5, [sp, 0x14] +_081A6518: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + bls _081A6522 + b _081A666C +_081A6522: + bl ZeroPlayerPartyMons + movs r0, 0 + mov r8, r0 + mov r1, sp + adds r1, 0x12 + str r1, [sp, 0x1C] + ldr r2, =gUnknown_0203BC8C + mov r9, r2 +_081A6534: + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + mov r5, r8 + lsls r5, 1 + mov r10, r5 + mov r3, r10 + add r3, r8 + lsls r3, 2 + adds r1, r2, r3 + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r7, [r0] + ldr r5, =0x00000e78 + adds r1, r5 + ldrb r6, [r1] + movs r1, 0x64 + mov r0, r8 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + mov r4, r9 + ldr r1, [r4] + lsls r4, r7, 4 + adds r1, r4, r1 + ldrh r1, [r1] + movs r5, 0x1 + str r5, [sp] + ldr r5, =0x00000e74 + adds r2, r5 + adds r2, r3 + ldr r2, [r2] + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + ldr r2, [sp, 0x14] + adds r3, r6, 0 + bl CreateMon + movs r1, 0 + mov r2, r9 + ldr r0, [r2] + adds r4, r0 + ldrb r4, [r4, 0xB] + mov r5, r8 + adds r5, 0x1 + str r5, [sp, 0x18] + movs r5, 0x5 +_081A6596: + adds r0, r4, 0 + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + beq _081A65A2 + adds r1, 0x1 +_081A65A2: + lsrs r4, 1 + subs r5, 0x1 + cmp r5, 0 + bge _081A6596 + movs r0, 0xFF + lsls r0, 1 + bl __divsi3 + add r1, sp, 0x10 + strh r0, [r1] + movs r4, 0x1 + movs r5, 0 + lsls r7, 4 + movs r0, 0x64 + mov r6, r8 + muls r6, r0 + ldr r3, =gPlayerParty +_081A65C4: + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrb r0, [r0, 0xB] + ands r0, r4 + cmp r0, 0 + beq _081A65E2 + adds r1, r5, 0 + adds r1, 0x1A + adds r0, r6, r3 + add r2, sp, 0x10 + str r3, [sp, 0x20] + bl SetMonData + ldr r3, [sp, 0x20] +_081A65E2: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r5, 0x1 + cmp r5, 0x5 + ble _081A65C4 + movs r2, 0x64 + mov r4, r8 + muls r4, r2 + ldr r5, =gPlayerParty + adds r0, r4, r5 + bl CalculateMonStats + movs r0, 0 + ldr r1, [sp, 0x1C] + strb r0, [r1] + movs r6, 0 +_081A6602: + mov r2, r9 + ldr r0, [r2] + adds r0, r7, r0 + lsls r1, r6, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + adds r0, r4, r5 + bl sub_81A7024 + adds r6, 0x1 + cmp r6, 0x3 + ble _081A6602 + movs r5, 0x64 + mov r4, r8 + muls r4, r5 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x1C] + bl SetMonData + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + mov r2, r10 + add r2, r8 + lsls r2, 2 + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + adds r2, r0 + ldr r0, =0x00000e79 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2E + bl SetMonData + ldr r1, [sp, 0x18] + mov r8, r1 + cmp r1, 0x2 + bgt _081A666C + b _081A6534 +_081A666C: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A667A + cmp r0, 0x2 + beq _081A667A + b _081A67AE +_081A667A: + movs r2, 0 + mov r8, r2 + ldr r4, =gUnknown_0203BC8C + mov r9, r4 +_081A6682: + ldr r5, =gSaveBlock2Ptr + ldr r3, [r5] + mov r0, r8 + adds r0, 0x3 + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r1, r3, r2 + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r7, [r0] + ldr r5, =0x00000e78 + adds r1, r5 + ldrb r6, [r1] + movs r1, 0x64 + mov r0, r8 + muls r0, r1 + ldr r1, =gEnemyParty + adds r0, r1 + mov r4, r9 + ldr r1, [r4] + lsls r4, r7, 4 + adds r1, r4, r1 + ldrh r1, [r1] + movs r5, 0x1 + str r5, [sp] + ldr r5, =0x00000e74 + adds r3, r5 + adds r3, r2 + ldr r2, [r3] + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + ldr r2, [sp, 0x14] + adds r3, r6, 0 + bl CreateMon + movs r1, 0 + mov r2, r9 + ldr r0, [r2] + adds r4, r0 + ldrb r4, [r4, 0xB] + mov r5, r8 + lsls r5, 1 + mov r10, r5 + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x18] + movs r5, 0x5 +_081A66E8: + adds r0, r4, 0 + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + beq _081A66F4 + adds r1, 0x1 +_081A66F4: + lsrs r4, 1 + subs r5, 0x1 + cmp r5, 0 + bge _081A66E8 + add r4, sp, 0x10 + movs r0, 0xFF + lsls r0, 1 + bl __divsi3 + strh r0, [r4] + movs r4, 0x1 + movs r5, 0 + lsls r7, 4 + movs r0, 0x64 + mov r6, r8 + muls r6, r0 + ldr r3, =gEnemyParty +_081A6716: + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrb r0, [r0, 0xB] + ands r0, r4 + cmp r0, 0 + beq _081A6734 + adds r1, r5, 0 + adds r1, 0x1A + adds r0, r6, r3 + add r2, sp, 0x10 + str r3, [sp, 0x20] + bl SetMonData + ldr r3, [sp, 0x20] +_081A6734: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r5, 0x1 + cmp r5, 0x5 + ble _081A6716 + movs r2, 0x64 + mov r4, r8 + muls r4, r2 + ldr r5, =gEnemyParty + adds r0, r4, r5 + bl CalculateMonStats + movs r6, 0 +_081A674E: + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + lsls r1, r6, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + adds r0, r4, r5 + bl sub_81A7024 + adds r6, 0x1 + cmp r6, 0x3 + ble _081A674E + movs r2, 0x64 + mov r4, r8 + muls r4, r2 + ldr r0, =gEnemyParty + adds r4, r0 + mov r5, r9 + ldr r0, [r5] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + mov r2, r10 + add r2, r8 + lsls r2, 2 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + adds r2, r0 + ldr r5, =0x00000e9d + adds r2, r5 + adds r0, r4, 0 + movs r1, 0x2E + bl SetMonData + ldr r0, [sp, 0x18] + mov r8, r0 + cmp r0, 0x2 + bgt _081A67AE + b _081A6682 +_081A67AE: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A64C4 + + thumb_func_start sub_81A67EC +sub_81A67EC: @ 81A67EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4C + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + mov r0, sp + adds r0, 0xC + str r0, [sp, 0x38] + mov r1, sp + adds r1, 0x18 + str r1, [sp, 0x3C] + ldr r2, =gSaveBlock2Ptr + mov r9, r2 + movs r2, 0 + adds r3, r1, 0 + adds r1, r0, 0 + mov r0, sp + movs r4, 0x5 + mov r8, r4 +_081A681A: + strh r2, [r0] + strh r2, [r1] + strh r2, [r3] + adds r3, 0x2 + adds r1, 0x2 + adds r0, 0x2 + movs r5, 0x1 + negs r5, r5 + add r8, r5 + mov r4, r8 + cmp r4, 0 + bge _081A681A + mov r5, r9 + ldr r0, [r5] + ldr r7, =0x00000ca9 + adds r0, r7 + ldrb r4, [r0] + lsls r4, 30 + lsrs r4, 30 + ldr r6, =0x000040ce + adds r0, r6, 0 + bl VarGet + lsls r0, 24 + ldr r1, [r5] + lsls r4, 1 + lsrs r0, 22 + adds r4, r0 + ldr r5, =0x00000de2 + adds r1, r5 + adds r1, r4 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + adds r0, r6, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + movs r2, 0 + cmp r0, 0x1 + bne _081A6878 + movs r2, 0x1 +_081A6878: + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + mov r1, r9 + ldr r0, [r1] + adds r0, r7 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081A68B4 + movs r4, 0x1 + str r4, [sp, 0x28] + b _081A68B8 + .pool +_081A68B4: + movs r5, 0 + str r5, [sp, 0x28] +_081A68B8: + adds r0, r2, 0 + ldr r1, [sp, 0x28] + bl sub_81A6F70 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x2C] + movs r0, 0 + mov r10, r0 + mov r8, r0 + ldr r1, [sp, 0x3C] + str r1, [sp, 0x40] + mov r2, sp + str r2, [sp, 0x44] + lsls r4, r0, 1 + str r4, [sp, 0x30] + ldr r5, [sp, 0x38] + adds r5, r4 + str r5, [sp, 0x34] +_081A68DE: + ldr r0, [sp, 0x2C] + cmp r8, r0 + bge _081A68EC + ldr r0, [sp, 0x28] + ldr r1, [sp, 0x24] + movs r2, 0x1 + b _081A68F2 +_081A68EC: + ldr r0, [sp, 0x28] + ldr r1, [sp, 0x24] + movs r2, 0 +_081A68F2: + bl sub_81A6EF0 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + lsls r2, r7, 4 + adds r4, r2, r1 + ldrh r1, [r4] + mov r9, r2 + cmp r1, 0xC9 + beq _081A69E2 + movs r3, 0 + mov r2, r8 + adds r6, r3, r2 + cmp r3, r6 + bge _081A6950 + ldr r5, [sp, 0x34] + ldrh r0, [r5] + cmp r0, r7 + beq _081A6950 + mov r12, r4 + adds r2, r1, 0 + lsls r4, r3, 1 + ldr r1, [sp, 0x30] + add r1, sp + str r6, [sp, 0x48] +_081A6928: + ldrh r0, [r1] + cmp r0, r2 + bne _081A693A + mov r0, r10 + cmp r0, 0 + bne _081A6950 + mov r5, r12 + ldrh r5, [r5] + mov r10, r5 +_081A693A: + adds r4, 0x2 + adds r1, 0x2 + adds r3, 0x1 + ldr r0, [sp, 0x48] + cmp r3, r0 + bge _081A6950 + ldr r5, [sp, 0x38] + adds r0, r5, r4 + ldrh r0, [r0] + cmp r0, r7 + bne _081A6928 +_081A6950: + cmp r3, r6 + bne _081A69E2 + movs r3, 0 + cmp r3, r6 + bge _081A699C + ldr r0, =gBattleFrontierHeldItems + mov r12, r0 + ldr r1, [sp, 0x30] + ldr r2, [sp, 0x3C] + adds r5, r1, r2 +_081A6964: + ldrh r4, [r5] + cmp r4, 0 + beq _081A6994 + ldr r1, =gUnknown_0203BC8C + ldr r0, [r1] + mov r2, r9 + adds r1, r2, r0 + ldrb r0, [r1, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r4, r0 + bne _081A6994 + ldrh r0, [r1] + cmp r0, r10 + bne _081A699C + movs r4, 0 + mov r10, r4 + b _081A699C + .pool +_081A6994: + adds r5, 0x2 + adds r3, 0x1 + cmp r3, r6 + blt _081A6964 +_081A699C: + cmp r3, r6 + bne _081A69E2 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r5, r8 + lsls r3, r5, 1 + adds r0, r3, r5 + lsls r0, 2 + adds r1, r0 + movs r0, 0xE7 + lsls r0, 4 + adds r1, r0 + strh r7, [r1] + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + add r1, r9 + ldrh r0, [r1] + ldr r4, [sp, 0x44] + strh r0, [r4] + ldr r2, =gBattleFrontierHeldItems + ldrb r0, [r1, 0xA] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + ldr r5, [sp, 0x40] + strh r0, [r5] + ldr r0, [sp, 0x38] + adds r3, r0, r3 + strh r7, [r3] + adds r5, 0x2 + str r5, [sp, 0x40] + adds r4, 0x2 + str r4, [sp, 0x44] + movs r1, 0x1 + add r8, r1 +_081A69E2: + mov r2, r8 + cmp r2, 0x6 + beq _081A69EA + b _081A68DE +_081A69EA: + add sp, 0x4C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A67EC + + thumb_func_start sub_81A6A08 +sub_81A6A08: @ 81A6A08 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + movs r4, 0 + add r5, sp, 0x14 + ldr r7, =gScriptResult + movs r1, 0 +_081A6A1E: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x11 + bls _081A6A1E + movs r4, 0 + ldr r0, =gUnknown_03006298 + mov r8, r0 + ldr r0, =gUnknown_0203BC8C + ldr r6, [r0] + ldr r1, =gBaseStats + mov r12, r1 +_081A6A3C: + lsls r0, r4, 1 + add r0, r8 + ldrh r0, [r0] + lsls r0, 4 + adds r0, r6 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r2, r12 + adds r3, r0, r2 + ldrb r2, [r3, 0x6] + mov r0, sp + adds r1, r0, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldrb r1, [r3, 0x7] + cmp r2, r1 + beq _081A6A70 + ldrb r0, [r3, 0x7] + mov r2, sp + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081A6A70: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A6A3C + movs r0, 0 + strb r0, [r5] + strb r0, [r5, 0x1] + movs r4, 0x1 + adds r3, r5, 0 +_081A6A84: + ldrb r0, [r3] + add r0, sp + mov r2, sp + adds r1, r2, r4 + ldrb r2, [r0] + ldrb r0, [r1] + cmp r2, r0 + bcs _081A6AAC + strb r4, [r5] + b _081A6AB2 + .pool +_081A6AAC: + cmp r2, r0 + bne _081A6AB2 + strb r4, [r3, 0x1] +_081A6AB2: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x11 + bls _081A6A84 + ldrb r1, [r5] + mov r4, sp + adds r0, r4, r1 + ldrb r2, [r0] + cmp r2, 0 + beq _081A6ADA + ldrb r3, [r5, 0x1] + adds r0, r4, r3 + ldrb r0, [r0] + cmp r2, r0 + bhi _081A6AD6 + cmp r1, r3 + bne _081A6ADA +_081A6AD6: + strh r1, [r7] + b _081A6ADE +_081A6ADA: + movs r0, 0x12 + strh r0, [r7] +_081A6ADE: + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A6A08 + + thumb_func_start sub_81A6AEC +sub_81A6AEC: @ 81A6AEC + push {r4-r7,lr} + sub sp, 0x8 + movs r7, 0 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + movs r4, 0 + movs r1, 0 +_081A6AFC: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081A6AFC + movs r4, 0 +_081A6B0E: + ldr r1, =gUnknown_03006298 + lsls r0, r4, 1 + adds r0, r1 + ldrh r6, [r0] + movs r5, 0 +_081A6B18: + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + lsls r0, r6, 4 + adds r0, r1 + lsls r1, r5, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r0, [r0] + bl sub_81A6BA4 + lsls r0, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081A6B18 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A6B0E + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + movs r4, 0x1 + adds r5, r1, 0 + ldr r3, =gBattleFactoryStyleRequiredMoveCounts + adds r2, r5, 0 +_081A6B5C: + mov r1, sp + adds r0, r1, r4 + subs r1, r4, 0x1 + adds r1, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _081A6B74 + strh r4, [r2] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_081A6B74: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081A6B5C + cmp r7, 0x2 + bls _081A6B86 + movs r0, 0x8 + strh r0, [r5] +_081A6B86: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A6AEC + + thumb_func_start sub_81A6BA4 +sub_81A6BA4: @ 81A6BA4 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + movs r2, 0 + ldr r6, =gBattleFactoryStyleMoveListPointers +_081A6BAE: + movs r3, 0 + lsls r0, r2, 2 + adds r0, r6 + ldr r1, [r0] + ldrh r0, [r1] + adds r4, r2, 0x1 + cmp r0, 0 + beq _081A6BE4 + lsls r0, r4, 24 + lsrs r2, r0, 24 +_081A6BC2: + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r5 + bne _081A6BD4 + adds r0, r2, 0 + b _081A6BEE + .pool +_081A6BD4: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _081A6BC2 +_081A6BE4: + lsls r0, r4, 24 + lsrs r2, r0, 24 + cmp r2, 0x6 + bls _081A6BAE + movs r0, 0 +_081A6BEE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81A6BA4 + + thumb_func_start sub_81A6BF4 +sub_81A6BF4: @ 81A6BF4 + push {lr} + movs r2, 0 + ldr r1, =gMapHeader + ldr r3, =0xfffffea5 + adds r0, r3, 0 + ldrh r1, [r1, 0x12] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _081A6C0C + movs r2, 0x1 +_081A6C0C: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A6BF4 + + thumb_func_start sub_81A6C1C +sub_81A6C1C: @ 81A6C1C + push {r4,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _081A6C48 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + b _081A6C4C + .pool +_081A6C48: + ldr r1, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons +_081A6C4C: + str r0, [r1] + movs r4, 0 +_081A6C50: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r2, r1 + movs r1, 0xE7 + lsls r1, 4 + adds r2, r1 + ldrh r2, [r2] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r2, 4 + adds r2, r1 + ldrb r2, [r2, 0xA] + lsls r2, 1 + ldr r1, =gBattleFrontierHeldItems + adds r2, r1 + movs r1, 0xC + bl SetMonData + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A6C50 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A6C1C + + thumb_func_start sub_81A6CA8 +sub_81A6CA8: @ 81A6CA8 + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + negs r2, r1 + orrs r2, r1 + lsrs r2, 31 + lsrs r1, r0, 24 + cmp r1, 0x8 + bls _081A6CBE + movs r1, 0x7 +_081A6CBE: + ldr r0, =gUnknown_08612184 + lsls r1, 1 + adds r1, r2, r1 + adds r1, r0 + ldrb r0, [r1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A6CA8 + + thumb_func_start sub_81A6CD0 +sub_81A6CD0: @ 81A6CD0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0x2C] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + ldr r1, [r4] + ldr r3, [sp, 0x2C] + lsls r2, r3, 1 + lsrs r0, 22 + adds r2, r0 + ldr r7, =0x00000de2 + adds r1, r7 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + str r1, [sp, 0x30] + movs r2, 0x80 + lsls r2, 18 + adds r0, r2 + lsrs r0, 24 + movs r1, 0 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] + movs r3, 0 + mov r9, r3 + ldr r1, [r4] + ldrb r4, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r4, r0 + str r4, [sp, 0x28] +_081A6D4C: + ldr r0, [sp, 0x2C] + ldr r1, [sp, 0x30] + movs r2, 0 + bl sub_81A6EF0 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r7, =gUnknown_0203BC8C + ldr r1, [r7] + lsls r0, r5, 4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xC9 + bne _081A6D6A + b _081A6EB8 +_081A6D6A: + ldr r0, [sp, 0x20] + cmp r0, 0x32 + bne _081A6D78 + ldr r0, =0x00000351 + cmp r5, r0 + bls _081A6D78 + b _081A6EB8 +_081A6D78: + movs r2, 0 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + movs r3, 0xE7 + lsls r3, 4 + adds r0, r3 + ldrh r0, [r0] + cmp r5, r0 + beq _081A6DA2 + adds r4, r1, 0 + movs r1, 0 +_081A6D8E: + adds r1, 0xC + adds r2, 0x1 + cmp r2, 0x5 + bgt _081A6DA2 + ldr r0, [r4] + adds r0, r1 + adds r0, r3 + ldrh r0, [r0] + cmp r5, r0 + bne _081A6D8E +_081A6DA2: + cmp r2, 0x6 + beq _081A6DA8 + b _081A6EB8 +_081A6DA8: + movs r4, 0 + cmp r4, r9 + bge _081A6DDC + add r2, sp, 0xC + ldr r7, =gUnknown_0203BC8C + ldr r0, [r7] + lsls r1, r5, 4 + adds r0, r1, r0 + ldrh r2, [r2] + adds r7, r1, 0 + ldrh r0, [r0] + cmp r2, r0 + beq _081A6DDC + ldr r6, =gUnknown_0203BC8C + adds r3, r7, 0 + add r2, sp, 0xC +_081A6DC8: + adds r2, 0x2 + adds r4, 0x1 + cmp r4, r9 + bge _081A6DDC + ldr r0, [r6] + adds r0, r3, r0 + ldrh r1, [r2] + ldrh r0, [r0] + cmp r1, r0 + bne _081A6DC8 +_081A6DDC: + cmp r4, r9 + bne _081A6EB8 + movs r4, 0 + cmp r4, r9 + bge _081A6E0C + ldr r7, =gBattleFrontierHeldItems + ldr r6, =gUnknown_0203BC8C + add r2, sp, 0x14 + lsls r3, r5, 4 +_081A6DEE: + ldrh r1, [r2] + cmp r1, 0 + beq _081A6E04 + ldr r0, [r6] + adds r0, r3, r0 + ldrb r0, [r0, 0xA] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + cmp r1, r0 + beq _081A6E0C +_081A6E04: + adds r2, 0x2 + adds r4, 0x1 + cmp r4, r9 + blt _081A6DEE +_081A6E0C: + cmp r4, r9 + bne _081A6EB8 + mov r0, r9 + lsls r2, r0, 1 + mov r1, sp + adds r1, r2 + adds r1, 0xC + ldr r3, =gUnknown_0203BC8C + ldr r4, [r3] + lsls r5, 4 + mov r8, r5 + add r4, r8 + ldrh r0, [r4] + strh r0, [r1] + add r1, sp, 0x14 + adds r1, r2 + ldr r2, =gBattleFrontierHeldItems + ldrb r0, [r4, 0xA] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + movs r0, 0x64 + mov r5, r9 + muls r5, r0 + ldr r6, =gEnemyParty + adds r0, r5, r6 + ldrh r1, [r4] + ldr r7, [sp, 0x20] + lsls r2, r7, 24 + ldrb r3, [r4, 0xC] + ldr r7, [sp, 0x24] + str r7, [sp] + ldrb r4, [r4, 0xB] + str r4, [sp, 0x4] + ldr r4, [sp, 0x28] + str r4, [sp, 0x8] + lsrs r2, 24 + bl sub_8068634 + add r0, sp, 0x1C + movs r7, 0 + strb r7, [r0] + movs r4, 0 + mov r7, r8 + mov r10, r0 + movs r0, 0x1 + add r0, r9 + mov r8, r0 +_081A6E6E: + ldr r1, =gUnknown_0203BC8C + ldr r0, [r1] + adds r0, r7, r0 + lsls r1, r4, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r5, r6 + bl sub_81A7024 + adds r4, 0x1 + cmp r4, 0x3 + ble _081A6E6E + movs r0, 0x64 + mov r4, r9 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + mov r2, r10 + bl SetMonData + ldr r2, =gUnknown_0203BC8C + ldr r0, [r2] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + mov r9, r8 +_081A6EB8: + mov r3, r9 + cmp r3, 0x3 + beq _081A6EC0 + b _081A6D4C +_081A6EC0: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A6CD0 + + thumb_func_start sub_81A6EF0 +sub_81A6EF0: @ 81A6EF0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r4, 0x8 + negs r1, r0 + orrs r1, r0 + asrs r1, 31 + ands r1, r4 + adds r4, r1, 0 + cmp r3, 0x6 + bhi _081A6F2C + cmp r2, 0 + beq _081A6F20 + ldr r2, =gUnknown_08612194 + adds r1, r3 + adds r1, 0x1 + b _081A6F38 + .pool +_081A6F20: + ldr r2, =gUnknown_08612194 + adds r1, r3 + b _081A6F38 + .pool +_081A6F2C: + adds r1, r3, 0 + cmp r1, 0x7 + beq _081A6F34 + movs r1, 0x7 +_081A6F34: + ldr r2, =gUnknown_08612194 + adds r1, r4, r1 +_081A6F38: + lsls r1, 2 + adds r0, r2, 0x2 + adds r0, r1, r0 + adds r1, r2 + ldrh r0, [r0] + ldrh r4, [r1] + subs r0, r4 + adds r0, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, r4 + lsls r4, 16 + lsrs r0, r4, 16 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A6EF0 + + thumb_func_start sub_81A6F70 +sub_81A6F70: @ 81A6F70 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000df2 + adds r2, r0 + adds r2, r1 + ldrb r1, [r2] + movs r0, 0 + cmp r1, 0xE + bls _081A6FA8 + movs r0, 0x1 + cmp r1, 0x15 + bls _081A6FA8 + movs r0, 0x2 + cmp r1, 0x1C + bls _081A6FA8 + movs r0, 0x3 + cmp r1, 0x23 + bls _081A6FA8 + movs r0, 0x5 + cmp r1, 0x2A + bhi _081A6FA8 + movs r0, 0x4 +_081A6FA8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A6F70 + + thumb_func_start GetAiScriptsInBattleFactory +GetAiScriptsInBattleFactory: @ 81A6FB4 + push {r4,r5,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + cmp r4, 0x2 + beq _081A6FF8 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r1, [r5] + lsls r2, r4, 1 + lsrs r0, 14 + adds r2, r0 + ldr r0, =0x00000de2 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =gTrainerBattleOpponent_A + ldrh r1, [r0] + ldr r0, =0x000003fe + cmp r1, r0 + beq _081A7018 + cmp r2, 0x1 + bgt _081A7014 +_081A6FF8: + movs r0, 0 + b _081A701E + .pool +_081A7014: + cmp r2, 0x3 + ble _081A701C +_081A7018: + movs r0, 0x7 + b _081A701E +_081A701C: + movs r0, 0x1 +_081A701E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetAiScriptsInBattleFactory + + thumb_func_start sub_81A7024 +sub_81A7024: @ 81A7024 + push {lr} + lsls r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsrs r1, 16 + cmp r1, 0xD8 + bne _081A7034 + movs r1, 0xDA +_081A7034: + bl SetMonMoveSlot + pop {r0} + bx r0 + thumb_func_end sub_81A7024 + + thumb_func_start sub_81A703C +sub_81A703C: @ 81A703C + push {lr} + ldr r1, =gUnknown_086125F8 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A703C + + thumb_func_start sub_81A705C +sub_81A705C: @ 81A705C + push {lr} + bl sub_81A79EC + ldr r1, =gUnknown_0300128C + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A705C + + thumb_func_start sub_81A7070 +sub_81A7070: @ 81A7070 + push {r4-r7,lr} + ldr r0, =0x00004010 + movs r1, 0x1C + bl VarSet + ldr r0, =0x00004011 + movs r1, 0xE2 + bl VarSet + movs r4, 0x1 + movs r6, 0 + movs r5, 0 + movs r7, 0 + ldr r0, =gUnknown_0300128C + ldrb r0, [r0] + cmp r0, 0x8 + bhi _081A7132 + lsls r0, 2 + ldr r1, =_081A70AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A70AC: + .4byte _081A70D0 + .4byte _081A70DA + .4byte _081A70DE + .4byte _081A70E8 + .4byte _081A70FC + .4byte _081A70D6 + .4byte _081A7100 + .4byte _081A7108 + .4byte _081A710E +_081A70D0: + movs r0, 0 + bl sub_81A82A4 +_081A70D6: + movs r4, 0 + b _081A711A +_081A70DA: + movs r5, 0x1C + b _081A711A +_081A70DE: + bl sub_81A7B58 + lsls r0, 24 + lsrs r5, r0, 24 + b _081A711A +_081A70E8: + movs r5, 0x30 + ldr r0, =gUnknown_0300128D + ldrb r0, [r0] + movs r7, 0xE1 + cmp r0, 0x1 + bne _081A7118 + movs r7, 0xE2 + b _081A7118 + .pool +_081A70FC: + movs r5, 0x30 + b _081A711A +_081A7100: + movs r0, 0x1 + bl sub_81A82A4 + b _081A7114 +_081A7108: + bl sub_81A8374 + b _081A70D6 +_081A710E: + movs r0, 0x5 + bl sub_81A5030 +_081A7114: + movs r7, 0x1C + movs r4, 0 +_081A7118: + movs r6, 0x1 +_081A711A: + cmp r4, 0x1 + bne _081A7126 + ldr r0, =0x00004010 + adds r1, r5, 0 + bl VarSet +_081A7126: + cmp r6, 0x1 + bne _081A7132 + ldr r0, =0x00004011 + adds r1, r7, 0 + bl VarSet +_081A7132: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7070 + + thumb_func_start sub_81A7140 +sub_81A7140: @ 81A7140 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r2, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + adds r3, r1, 0 + cmp r0, 0x4 + bhi _081A723A + lsls r0, 2 + ldr r1, =_081A7174 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A7174: + .4byte _081A7188 + .4byte _081A71A0 + .4byte _081A71C4 + .4byte _081A71E8 + .4byte _081A720C +_081A7188: + ldr r0, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000e02 + adds r1, r3 + ldrh r1, [r1] + strh r1, [r0] + b _081A723A + .pool +_081A71A0: + ldr r2, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000ca9 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r3, =0x00000e04 + adds r1, r3 + adds r1, r0 + ldrh r0, [r1] + b _081A7238 + .pool +_081A71C4: + ldr r2, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000ca9 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r3, =0x00000e08 + adds r1, r3 + adds r1, r0 + ldrh r0, [r1] + b _081A7238 + .pool +_081A71E8: + ldr r2, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000ca9 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r3, =0x00000e0c + adds r1, r3 + adds r1, r0 + ldrh r0, [r1] + b _081A7238 + .pool +_081A720C: + cmp r2, 0 + beq _081A7228 + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 4 + b _081A7236 + .pool +_081A7228: + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r3, =0x00000cdc + adds r0, r3 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 3 +_081A7236: + ands r0, r1 +_081A7238: + strh r0, [r2] +_081A723A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7140 + + thumb_func_start sub_81A7248 +sub_81A7248: @ 81A7248 + push {r4,r5,lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r3, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + adds r2, r1, 0 + cmp r0, 0x4 + bls _081A7264 + b _081A73AA +_081A7264: + lsls r0, 2 + ldr r1, =_081A7280 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A7280: + .4byte _081A7294 + .4byte _081A72AC + .4byte _081A72D8 + .4byte _081A7314 + .4byte _081A7344 +_081A7294: + ldr r0, [r2] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r5, =0x00000e02 + adds r0, r5 + strh r1, [r0] + b _081A73AA + .pool +_081A72AC: + ldr r0, =gSpecialVar_0x8006 + ldrh r3, [r0] + ldr r0, =0x0000270f + cmp r3, r0 + bls _081A72B8 + b _081A73AA +_081A72B8: + ldr r0, [r2] + ldr r2, =0x00000ca9 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + ldr r5, =0x00000e04 + b _081A732C + .pool +_081A72D8: + ldr r0, =gSpecialVar_0x8006 + ldrh r4, [r0] + adds r3, r4, 0 + ldr r0, =0x0000270f + cmp r3, r0 + bhi _081A73AA + ldr r1, [r2] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r2, r0, 30 + lsrs r0, r2, 29 + ldr r5, =0x00000e08 + adds r1, r5 + adds r0, r1, r0 + ldrh r0, [r0] + cmp r0, r3 + bcs _081A73AA + lsrs r0, r2, 29 + adds r0, r1, r0 + strh r4, [r0] + b _081A73AA + .pool +_081A7314: + ldr r0, =gSpecialVar_0x8006 + ldrh r3, [r0] + ldr r0, =0x0000270f + cmp r3, r0 + bhi _081A73AA + ldr r0, [r2] + ldr r2, =0x00000ca9 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + ldr r5, =0x00000e0c +_081A732C: + adds r0, r5 + adds r0, r1 + strh r3, [r0] + b _081A73AA + .pool +_081A7344: + cmp r3, 0 + beq _081A737C + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A7368 + ldr r0, [r2] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 4 + orrs r1, r2 + b _081A73A8 + .pool +_081A7368: + ldr r0, [r2] + ldr r2, =0x00000cdc + adds r0, r2 + ldr r1, [r0] + ldr r2, =0xfffff7ff + b _081A73A6 + .pool +_081A737C: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A739C + ldr r0, [r2] + ldr r5, =0x00000cdc + adds r0, r5 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 3 + orrs r1, r2 + b _081A73A8 + .pool +_081A739C: + ldr r0, [r2] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r1, [r0] + ldr r2, =0xfffffbff +_081A73A6: + ands r1, r2 +_081A73A8: + str r1, [r0] +_081A73AA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7248 + + thumb_func_start sub_81A73B8 +sub_81A73B8: @ 81A73B8 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xE + bls _081A73DC + ldr r1, =gScriptResult + movs r0, 0x1 + b _081A73E0 + .pool +_081A73DC: + ldr r1, =gScriptResult + movs r0, 0 +_081A73E0: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A73B8 + + thumb_func_start sub_81A73EC +sub_81A73EC: @ 81A73EC + ldr r0, =gScriptResult + ldr r1, =gUnknown_0300128C + ldrb r1, [r1] + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81A73EC + + thumb_func_start sub_81A7400 +sub_81A7400: @ 81A7400 + ldr r1, =gUnknown_0300128E + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81A7400 + + thumb_func_start sub_81A740C +sub_81A740C: @ 81A740C + ldr r1, =gUnknown_0300128E + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81A740C + + thumb_func_start sub_81A7418 +sub_81A7418: @ 81A7418 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl save_serialize_map + movs r0, 0x1 + bl TrySavingData + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7418 + + thumb_func_start nullsub_76 +nullsub_76: @ 81A7460 + bx lr + thumb_func_end nullsub_76 + + thumb_func_start nullsub_124 +nullsub_124: @ 81A7464 + bx lr + thumb_func_end nullsub_124 + + thumb_func_start sub_81A7468 +sub_81A7468: @ 81A7468 + push {lr} + ldr r0, =gUnknown_03001290 + ldr r0, [r0] + cmp r0, 0x20 + beq _081A748E + cmp r0, 0x20 + bhi _081A7484 + cmp r0, 0x7 + beq _081A74BC + cmp r0, 0x10 + beq _081A7498 + b _081A74C2 + .pool +_081A7484: + cmp r0, 0x40 + beq _081A74B0 + cmp r0, 0x80 + beq _081A74A4 + b _081A74C2 +_081A748E: + ldr r1, =gScriptResult + movs r0, 0 + b _081A74C0 + .pool +_081A7498: + ldr r1, =gScriptResult + movs r0, 0x1 + b _081A74C0 + .pool +_081A74A4: + ldr r1, =gScriptResult + movs r0, 0x2 + b _081A74C0 + .pool +_081A74B0: + ldr r1, =gScriptResult + movs r0, 0x3 + b _081A74C0 + .pool +_081A74BC: + ldr r1, =gScriptResult + movs r0, 0x4 +_081A74C0: + strh r0, [r1] +_081A74C2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7468 + + thumb_func_start sub_81A74CC +sub_81A74CC: @ 81A74CC + ldr r0, =gScriptResult + ldr r1, =gUnknown_0300128D + ldrb r1, [r1] + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81A74CC + + thumb_func_start sub_81A74E0 +sub_81A74E0: @ 81A74E0 + push {r4,lr} + bl Random + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x1 + ands r4, r0 + adds r4, 0x1 + adds r0, r4, 0 + bl sub_81A7F38 + ldr r0, =gScriptResult + strh r4, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A74E0 + + thumb_func_start sub_81A7508 +sub_81A7508: @ 81A7508 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _081A7538 + ldr r1, =gUnknown_0861231C + ldr r0, =gUnknown_03001294 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x2] + b _081A7560 + .pool +_081A7538: + cmp r0, 0xA + bhi _081A7554 + ldr r1, =gUnknown_0861231C + ldr r0, =gUnknown_03001294 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x3] + b _081A7560 + .pool +_081A7554: + ldr r1, =gUnknown_0861231C + ldr r0, =gUnknown_03001294 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x4] +_081A7560: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_086123E4 + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7508 + + thumb_func_start sub_81A7580 +sub_81A7580: @ 81A7580 + push {lr} + ldr r0, =sub_81A7EE4 + movs r1, 0x2 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7580 + + thumb_func_start sub_81A7594 +sub_81A7594: @ 81A7594 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r4, 0 + movs r1, 0 +_081A759E: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A759E + adds r0, r5, 0 + movs r1, 0x3A + bl GetMonData + lsls r2, r0, 16 + mov r1, sp + strb r0, [r1] + mov r0, sp + lsrs r2, 24 + strb r2, [r0, 0x1] + adds r0, r5, 0 + movs r1, 0x39 + mov r2, sp + bl SetMonData + adds r0, r5, 0 + movs r1, 0x15 + bl GetMonData + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 +_081A75DA: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r4, 0 + bl CalculatePPWithBonus + mov r1, sp + strb r0, [r1] + adds r1, r4, 0 + adds r1, 0x11 + adds r0, r5, 0 + mov r2, sp + bl SetMonData + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A75DA + mov r0, sp + movs r1, 0 + strb r1, [r0] + strb r1, [r0, 0x1] + strb r1, [r0, 0x2] + strb r1, [r0, 0x3] + adds r0, r5, 0 + movs r1, 0x37 + mov r2, sp + bl SetMonData + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81A7594 + + thumb_func_start sub_81A7628 +sub_81A7628: @ 81A7628 + push {r4,lr} + adds r4, r1, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + cmp r4, 0x20 + beq _081A7652 + cmp r4, 0x20 + bhi _081A7648 + cmp r4, 0x7 + beq _081A7664 + cmp r4, 0x10 + beq _081A7658 + b _081A7674 +_081A7648: + cmp r4, 0x40 + beq _081A765E + cmp r4, 0x80 + beq _081A766E + b _081A7674 +_081A7652: + cmp r0, 0x28 + bne _081A7674 + b _081A7672 +_081A7658: + cmp r0, 0x29 + bne _081A7674 + b _081A7672 +_081A765E: + cmp r0, 0x7 + bne _081A7674 + b _081A7672 +_081A7664: + cmp r0, 0xF + beq _081A7672 + cmp r0, 0x48 + bne _081A7674 + b _081A7672 +_081A766E: + cmp r0, 0x11 + bne _081A7674 +_081A7672: + movs r1, 0x1 +_081A7674: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81A7628 + + thumb_func_start sub_81A767C +sub_81A767C: @ 81A767C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r3, 0 + cmp r1, 0x20 + beq _081A76C4 + cmp r1, 0x20 + bhi _081A7696 + cmp r1, 0x7 + beq _081A771C + cmp r1, 0x10 + beq _081A7704 + b _081A771C +_081A7696: + cmp r1, 0x40 + beq _081A76E0 + cmp r1, 0x80 + bne _081A771C + ldr r1, =gBaseStats + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x6] + cmp r2, 0x8 + beq _081A771A + cmp r2, 0x3 + beq _081A771A + ldrb r0, [r0, 0x7] + cmp r0, 0x8 + beq _081A771A + cmp r0, 0x3 + bne _081A771C + b _081A771A + .pool +_081A76C4: + ldr r0, =gBaseStats + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0xF + beq _081A771A + ldrb r0, [r1, 0x7] + cmp r0, 0xF + bne _081A771C + b _081A771A + .pool +_081A76E0: + ldr r1, =gBaseStats + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x6] + cmp r2, 0x4 + beq _081A771A + cmp r2, 0xD + beq _081A771A + ldrb r0, [r0, 0x7] + cmp r0, 0x4 + beq _081A771A + cmp r0, 0xD + bne _081A771C + b _081A771A + .pool +_081A7704: + ldr r0, =gBaseStats + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0xA + beq _081A771A + ldrb r0, [r1, 0x7] + cmp r0, 0xA + bne _081A771C +_081A771A: + movs r3, 0x1 +_081A771C: + adds r0, r3, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A767C + + thumb_func_start sub_81A7728 +sub_81A7728: @ 81A7728 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r6, 0 +_081A7736: + mov r1, sp + adds r0, r1, r6 + strb r6, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081A7736 + movs r4, 0 + mov r8, r4 +_081A774A: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r6, r0, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + adds r2, r1, r6 + ldrb r3, [r2] + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x9 + bls _081A774A + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r4, =0x00000cb2 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x1 + mov r10, r1 + cmp r0, 0x4 + bls _081A77A8 + movs r4, 0x3 + mov r10, r4 + cmp r0, 0x9 + bhi _081A77A8 + movs r0, 0x2 + mov r10, r0 +_081A77A8: + movs r1, 0 + str r1, [sp, 0x4] + ldr r7, =gUnknown_03001290 +_081A77AE: + movs r4, 0 + mov r9, r4 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x22 + bhi _081A77DC + movs r0, 0x80 + b _081A77FC + .pool +_081A77DC: + cmp r0, 0x3B + bhi _081A77E4 + movs r0, 0x20 + b _081A77FC +_081A77E4: + cmp r0, 0x4F + bhi _081A77EC + movs r0, 0x40 + b _081A77FC +_081A77EC: + cmp r1, 0x59 + bhi _081A77FA + movs r0, 0x7 + b _081A77FC +_081A77F4: + movs r0, 0x1 + mov r9, r0 + b _081A786E +_081A77FA: + movs r0, 0x10 +_081A77FC: + str r0, [r7] + ldr r0, =gUnknown_03001290 + ldr r0, [r0] + ldr r1, [sp, 0x4] + cmp r1, r0 + beq _081A7874 + str r0, [sp, 0x4] + movs r4, 0 + mov r8, r4 + movs r6, 0 +_081A7810: + mov r1, sp + adds r0, r1, r6 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A7860 + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081A7860 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r1, [r7] + adds r0, r4, 0 + bl sub_81A767C + lsls r0, 24 + cmp r0, 0 + beq _081A77F4 +_081A7860: + cmp r8, r10 + beq _081A786E + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081A7810 +_081A786E: + mov r4, r8 + cmp r4, 0 + beq _081A78CC +_081A7874: + mov r0, r9 + cmp r0, 0 + beq _081A77AE + ldr r0, =gUnknown_03001290 + ldr r0, [r0] + cmp r0, 0x20 + beq _081A7898 + cmp r0, 0x20 + bhi _081A78D0 + cmp r0, 0x7 + beq _081A78D0 + cmp r0, 0x10 + beq _081A78A4 + b _081A78D0 + .pool +_081A7898: + ldr r1, =gUnknown_0300128D + movs r0, 0x1 + b _081A78D4 + .pool +_081A78A4: + bl Random + lsls r0, 16 + lsrs r1, r0, 16 + movs r2, 0x1 + ands r1, r2 + cmp r1, 0 + beq _081A78C0 + ldr r0, =gUnknown_0300128D + strb r2, [r0] + b _081A78D6 + .pool +_081A78C0: + ldr r0, =gUnknown_0300128D + strb r1, [r0] + b _081A78D6 + .pool +_081A78CC: + movs r0, 0 + b _081A7956 +_081A78D0: + ldr r1, =gUnknown_0300128D + movs r0, 0 +_081A78D4: + strb r0, [r1] +_081A78D6: + movs r1, 0 + mov r8, r1 + movs r6, 0 +_081A78DC: + mov r4, sp + adds r0, r4, r6 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A7946 + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081A7946 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r7, =gUnknown_03001290 + ldr r1, [r7] + adds r0, r5, 0 + bl sub_81A7628 + lsls r0, 24 + cmp r0, 0 + bne _081A7946 + ldr r1, [r7] + adds r0, r4, 0 + bl sub_81A767C + lsls r0, 24 + cmp r0, 0 + bne _081A7946 + adds r0, r5, 0 + movs r1, 0x37 + adds r2, r7, 0 + bl SetMonData +_081A7946: + cmp r8, r10 + beq _081A7954 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081A78DC +_081A7954: + movs r0, 0x1 +_081A7956: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A7728 + + thumb_func_start sub_81A7974 +sub_81A7974: @ 81A7974 + push {r4-r7,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + movs r7, 0x1 + cmp r0, 0x4 + bls _081A798E + movs r7, 0x3 + cmp r0, 0x9 + bhi _081A798E + movs r7, 0x2 +_081A798E: + movs r6, 0 + movs r5, 0 + b _081A79A2 + .pool +_081A799C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_081A79A2: + cmp r5, 0x2 + bhi _081A79D8 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A79D4 + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081A79D4 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081A79D4: + cmp r6, r7 + bne _081A799C +_081A79D8: + cmp r6, 0 + beq _081A79E4 + movs r0, 0x1 + b _081A79E6 + .pool +_081A79E4: + movs r0, 0 +_081A79E6: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A7974 + + thumb_func_start sub_81A79EC +sub_81A79EC: @ 81A79EC + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + movs r4, 0xE1 + lsls r4, 4 + adds r0, r4 + ldrb r2, [r0] + movs r3, 0x78 + ands r3, r2 + adds r5, r1, 0 + cmp r3, 0x40 + bne _081A7A10 + lsls r0, r2, 25 + lsrs r0, 28 + b _081A7B48 + .pool +_081A7A10: + ldr r0, =gSpecialVar_0x8007 + lsls r1, r2, 29 + ldrh r0, [r0] + lsrs r1, 29 + cmp r0, r1 + bne _081A7A34 + cmp r3, 0x18 + bne _081A7A24 + bl sub_81A7728 +_081A7A24: + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 28 + b _081A7B48 + .pool +_081A7A34: + movs r2, 0 + ldr r3, =gUnknown_0861266C + movs r1, 0 +_081A7A3A: + mov r4, sp + adds r0, r4, r2 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081A7A3A + movs r4, 0x8 + ldr r0, [r5] + movs r6, 0xE1 + lsls r6, 4 + adds r0, r6 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 28 + adds r0, r3 + ldrb r1, [r0] + movs r2, 0 + adds r5, r3, 0 + movs r3, 0x1 +_081A7A64: + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, r1 + bne _081A7A78 + mov r6, sp + adds r0, r6, r2 + strb r3, [r0] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7A78: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081A7A64 + mov r0, sp + ldrb r0, [r0, 0x7] + cmp r0, 0x1 + beq _081A7AA0 + bl sub_81A8554 + lsls r0, 24 + cmp r0, 0 + bne _081A7AA0 + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x7] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7AA0: + mov r0, sp + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + beq _081A7ABE + bl sub_81A7974 + lsls r0, 24 + cmp r0, 0 + bne _081A7ABE + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x3] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7ABE: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xE1 + lsls r1, 4 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081A7AFA + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _081A7AE6 + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x1] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7AE6: + mov r0, sp + ldrb r0, [r0, 0x4] + cmp r0, 0x1 + beq _081A7AFA + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x4] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7AFA: + adds r0, r4, 0 + bl AllocZeroed + adds r5, r0, 0 + movs r3, 0 + movs r2, 0 +_081A7B06: + mov r6, sp + adds r0, r6, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _081A7B1C + adds r1, r3, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r1, r5, r1 + strb r2, [r1] +_081A7B1C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081A7B06 + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + adds r0, r5, r0 + ldrb r4, [r0] + adds r0, r5, 0 + bl Free + cmp r4, 0x3 + bne _081A7B46 + bl sub_81A7728 +_081A7B46: + adds r0, r4, 0 +_081A7B48: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A79EC + + thumb_func_start sub_81A7B58 +sub_81A7B58: @ 81A7B58 + push {r4,lr} + ldr r4, =gUnknown_03001294 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + bl __umodsi3 + strb r0, [r4] + ldr r1, =gUnknown_0861231C + ldrb r0, [r4] + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A7B58 + + thumb_func_start sub_81A7B84 +sub_81A7B84: @ 81A7B84 + ldr r0, =gUnknown_0300128E + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_81A7B84 + + thumb_func_start sub_81A7B90 +sub_81A7B90: @ 81A7B90 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl sub_81A7D00 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + ldr r4, =0x00000ca9 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 30 + ldr r1, =gUnknown_08612314 + lsrs r0, 28 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x4] + ldr r0, =gEnemyParty + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r0, r5, 16 + lsrs r0, 16 + bl sub_81A890C + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081A7C1C + bl sub_8165CB4 + adds r7, r0, 0 + cmp r7, 0x3B + ble _081A7C08 + lsls r0, r6, 2 + ldr r1, [sp, 0x4] + adds r0, r1 + ldr r1, [r0] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + subs r7, r0 + cmp r7, 0x3B + bgt _081A7C32 +_081A7C08: + movs r7, 0x3C + b _081A7C32 + .pool +_081A7C1C: + lsls r0, r6, 2 + ldr r2, [sp, 0x4] + adds r0, r2 + ldr r1, [r0] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x32 + subs r7, r0, r1 +_081A7C32: + mov r0, r8 + cmp r0, 0x1 + bne _081A7C4A + lsls r0, r7, 24 + lsrs r0, 24 + bl sub_81A88B0 + lsls r0, 24 + cmp r0, 0 + bne _081A7C4A + movs r0, 0 + b _081A7CE2 +_081A7C4A: + ldr r0, =gEnemyParty + ldr r1, =gBaseStats + mov r8, r1 + lsls r6, 2 + mov r9, r6 + ldr r2, [sp, 0x4] + add r2, r9 + mov r10, r2 + ldr r1, [r2] + lsls r6, r5, 1 + adds r4, r6, r5 + lsls r4, 2 + adds r1, r4, r1 + ldrh r2, [r1] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x13] + movs r1, 0xCA + lsls r1, 1 + muls r2, r1 + lsls r1, r7, 2 + ldr r3, =gExperienceTables + adds r1, r3 + adds r2, r1 + movs r1, 0x19 + bl SetMonData + mov r1, r10 + ldr r0, [r1] + adds r4, r0 + ldrh r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x17] + mov r7, r9 + cmp r0, 0 + beq _081A7CA8 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 +_081A7CA8: + str r0, [sp] + ldr r0, =gEnemyParty + movs r1, 0x2E + mov r2, sp + bl SetMonData + movs r4, 0 + adds r0, r6, r5 + lsls r6, r0, 2 +_081A7CBA: + ldr r2, [sp, 0x4] + adds r0, r7, r2 + ldr r0, [r0] + adds r0, r6, r0 + lsls r1, r4, 1 + adds r0, 0x4 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r4, 24 + lsrs r2, 24 + ldr r0, =gEnemyParty + bl SetMonMoveSlot + adds r4, 0x1 + cmp r4, 0x3 + ble _081A7CBA + ldr r0, =gEnemyParty + bl CalculateMonStats + movs r0, 0x1 +_081A7CE2: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A7B90 + + thumb_func_start sub_81A7D00 +sub_81A7D00: @ 81A7D00 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000e04 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + adds r2, r1, 0 + movs r0, 0x8C + lsls r0, 1 + cmp r1, r0 + bhi _081A7D34 + movs r1, 0 + b _081A7D4C + .pool +_081A7D34: + movs r0, 0x8C + lsls r0, 2 + cmp r1, r0 + bhi _081A7D40 + movs r1, 0x1 + b _081A7D4C +_081A7D40: + movs r0, 0xD2 + lsls r0, 2 + movs r1, 0x3 + cmp r2, r0 + bhi _081A7D4C + movs r1, 0x2 +_081A7D4C: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_81A7D00 + + thumb_func_start sub_81A7D54 +sub_81A7D54: @ 81A7D54 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_08612688 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081A7D66: + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _081A7D66 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7D54 + + thumb_func_start sub_81A7D8C +sub_81A7D8C: @ 81A7D8C + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081A7DA4 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _081A7DC8 +_081A7DA4: + ldrh r0, [r4, 0xA] + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x10] + ldrh r1, [r4, 0x16] + adds r0, r1 + strh r0, [r4, 0x16] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _081A7DBC + movs r0, 0x10 + strh r0, [r4, 0x16] +_081A7DBC: + movs r0, 0x1 + negs r0, r0 + ldrb r1, [r4, 0x16] + ldr r2, =0x00002d6b + bl BlendPalettes +_081A7DC8: + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0xF + ble _081A7DDA + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xC] + strh r0, [r4, 0x14] +_081A7DDA: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A7D8C + + thumb_func_start sub_81A7DE8 +sub_81A7DE8: @ 81A7DE8 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081A7E00 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _081A7E22 +_081A7E00: + ldrh r0, [r4, 0xC] + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x16] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x16] + lsls r0, 16 + cmp r0, 0 + bge _081A7E16 + movs r0, 0 + strh r0, [r4, 0x16] +_081A7E16: + movs r0, 0x1 + negs r0, r0 + ldrb r1, [r4, 0x16] + ldr r2, =0x00002d6b + bl BlendPalettes +_081A7E22: + movs r0, 0x16 + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _081A7E56 + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _081A7E50 + ldr r0, =sub_81A7D54 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + b _081A7E56 + .pool +_081A7E50: + ldrh r0, [r4, 0xA] + strh r0, [r4, 0x14] + strh r1, [r4, 0x8] +_081A7E56: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81A7DE8 + + thumb_func_start sub_81A7E60 +sub_81A7E60: @ 81A7E60 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r3, [sp, 0x18] + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r0, =sub_81A7D54 + movs r1, 0x3 + str r3, [sp] + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + mov r0, r8 + strh r0, [r1, 0xA] + strh r4, [r1, 0xC] + strh r5, [r1, 0xE] + strh r6, [r1, 0x10] + ldr r3, [sp] + strh r3, [r1, 0x12] + strh r0, [r1, 0x14] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7E60 + + thumb_func_start sub_81A7EC4 +sub_81A7EC4: @ 81A7EC4 + push {lr} + ldr r0, =sub_81A7D54 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081A7EDC + movs r0, 0 + b _081A7EDE + .pool +_081A7EDC: + movs r0, 0x1 +_081A7EDE: + pop {r1} + bx r1 + thumb_func_end sub_81A7EC4 + + thumb_func_start sub_81A7EE4 +sub_81A7EE4: @ 81A7EE4 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x8] + movs r3, 0x8 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _081A7F1C + adds r0, r2, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x2 + bl sub_81A7E60 + b _081A7F30 + .pool +_081A7F1C: + bl sub_81A7EC4 + lsls r0, 24 + cmp r0, 0 + beq _081A7F30 + bl EnableBothScriptContexts + adds r0, r4, 0 + bl DestroyTask +_081A7F30: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A7EE4 + + thumb_func_start sub_81A7F38 +sub_81A7F38: @ 81A7F38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + cmp r0, 0 + bne _081A7F50 + b _081A807A +_081A7F50: + movs r0, 0 + mov r8, r0 +_081A7F54: + mov r0, sp + add r0, r8 + mov r1, r8 + strb r1, [r0] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x2 + bls _081A7F54 + movs r5, 0 +_081A7F6C: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + mov r2, sp + add r2, r8 + ldrb r3, [r2] + mov r0, sp + adds r1, r0, r4 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _081A7F6C + movs r1, 0 + mov r8, r1 +_081A7FB0: + movs r0, 0 + mov r10, r0 + mov r4, sp + add r4, r8 + ldrb r1, [r4] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r7, 0 + movs r1, 0x3A + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + str r4, [sp, 0x8] + cmp r5, r6 + bcc _081A8044 + adds r0, r7, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + beq _081A7FFC + movs r0, 0x1 + mov r10, r0 + b _081A8048 + .pool +_081A7FFC: + adds r0, r7, 0 + movs r1, 0x15 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r4, 0 + b _081A8014 +_081A800E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A8014: + cmp r4, 0x3 + bhi _081A8048 + adds r1, r4, 0 + adds r1, 0xD + adds r0, r7, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r1, r9 + adds r2, r4, 0 + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r6, r0, 24 + adds r1, r4, 0 + adds r1, 0x11 + adds r0, r7, 0 + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r6 + bcs _081A800E +_081A8044: + movs r1, 0x1 + mov r10, r1 +_081A8048: + mov r0, r10 + cmp r0, 0x1 + bne _081A806C + ldr r0, [sp, 0x8] + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_81A7594 + ldr r0, [sp, 0x4] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + cmp r0, 0 + beq _081A807A +_081A806C: + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x2 + bls _081A7FB0 +_081A807A: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7F38 + + thumb_func_start sub_81A8090 +sub_81A8090: @ 81A8090 + push {r4,lr} + ldr r4, =gScriptResult + bl InBattlePike + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8090 + + thumb_func_start InBattlePike +InBattlePike: @ 81A80A8 + push {lr} + movs r2, 0 + ldr r0, =gMapHeader + ldrh r1, [r0, 0x12] + ldr r3, =0xfffffea1 + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _081A80CA + movs r0, 0xB3 + lsls r0, 1 + cmp r1, r0 + beq _081A80CA + adds r0, 0x1 + cmp r1, r0 + bne _081A80CC +_081A80CA: + movs r2, 0x1 +_081A80CC: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end InBattlePike + + thumb_func_start sub_81A80DC +sub_81A80DC: @ 81A80DC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =gScriptResult + movs r0, 0 + strh r0, [r4] + movs r0, 0x1 + bl sub_81A8590 + lsls r0, 24 + cmp r0, 0 + beq _081A8138 + movs r0, 0x1 + strh r0, [r4] + bl Random + ldr r5, =gSaveBlock2Ptr + ldr r4, [r5] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + movs r3, 0xE1 + lsls r3, 4 + adds r4, r3 + movs r1, 0x7 + ands r1, r0 + ldrb r2, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + ldr r2, [r5] + adds r2, r3 + ldrb r1, [r2] + movs r0, 0x79 + negs r0, r0 + ands r0, r1 + movs r1, 0x40 + b _081A8248 + .pool +_081A8138: + bl Random + ldr r7, =gSaveBlock2Ptr + ldr r4, [r7] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + movs r3, 0xE1 + lsls r3, 4 + adds r4, r3 + movs r1, 0x7 + ands r1, r0 + ldrb r2, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + ldr r0, [r7] + adds r0, r3 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + movs r6, 0x8 + cmp r0, 0 + beq _081A8172 + movs r6, 0x6 +_081A8172: + adds r0, r6, 0 + bl AllocZeroed + adds r5, r0, 0 + movs r2, 0 + movs r3, 0 + cmp r2, r6 + bcs _081A81BE + adds r4, r7, 0 +_081A8184: + ldr r0, [r4] + movs r1, 0xE1 + lsls r1, 4 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081A81B0 + cmp r2, 0x1 + beq _081A81B4 + cmp r2, 0x4 + beq _081A81B4 + adds r1, r3, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r1, r5, r1 + strb r2, [r1] + b _081A81B4 + .pool +_081A81B0: + adds r0, r5, r2 + strb r2, [r0] +_081A81B4: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r6 + bcc _081A8184 +_081A81BE: + bl Random + ldr r7, =gSaveBlock2Ptr + ldr r4, [r7] + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + adds r0, r5, r0 + ldrb r0, [r0] + movs r6, 0xE1 + lsls r6, 4 + adds r4, r6 + movs r1, 0xF + ands r1, r0 + lsls r1, 3 + ldrb r2, [r4] + movs r0, 0x79 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + adds r0, r5, 0 + bl Free + ldr r0, [r7] + adds r0, r6 + ldrb r1, [r0] + movs r0, 0x78 + ands r0, r1 + cmp r0, 0x18 + bne _081A821C + bl sub_81A7974 + lsls r0, 24 + cmp r0, 0 + bne _081A821C + ldr r2, [r7] + adds r2, r6 + ldrb r1, [r2] + mov r0, r8 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2] +_081A821C: + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + movs r4, 0xE1 + lsls r4, 4 + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x78 + ands r0, r1 + cmp r0, 0x38 + bne _081A824C + bl sub_81A8554 + lsls r0, 24 + cmp r0, 0 + bne _081A824C + ldr r2, [r5] + adds r2, r4 + ldrb r1, [r2] + movs r0, 0x79 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 +_081A8248: + orrs r0, r1 + strb r0, [r2] +_081A824C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A80DC + + thumb_func_start sub_81A825C +sub_81A825C: @ 81A825C + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r2, 0xE1 + lsls r2, 4 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A825C + + thumb_func_start sub_81A827C +sub_81A827C: @ 81A827C + ldr r2, =gScriptResult + ldr r1, =gUnknown_0861266C + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r3, 0xE1 + lsls r3, 4 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 28 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_81A827C + + thumb_func_start sub_81A82A4 +sub_81A82A4: @ 81A82A4 + push {r4-r7,lr} + lsls r0, 24 + movs r7, 0x6 + cmp r0, 0 + bne _081A82B0 + movs r7, 0x1 +_081A82B0: + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000e04 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0xE + bl __udivsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r5, r4, 0 +_081A82D2: + lsls r0, r6, 24 + lsrs r0, 24 + adds r1, r7, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r5] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r0, [r0] + subs r2, r0, 0x1 + cmp r3, r2 + bge _081A831A + ldr r0, =0x00000cb4 + adds r1, r0 + b _081A8314 + .pool +_081A830C: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _081A831A +_081A8314: + ldrh r0, [r1] + cmp r0, r4 + bne _081A830C +_081A831A: + ldr r0, [r5] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + cmp r3, r0 + bne _081A82D2 + ldr r5, =gTrainerBattleOpponent_A + strh r4, [r5] + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + ldrh r0, [r5] + movs r1, 0 + bl sub_8162614 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0x00000cb2 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0xD + bhi _081A8356 + subs r0, 0x1 + lsls r0, 1 + ldr r2, =0x00000cb4 + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_081A8356: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A82A4 + + thumb_func_start sub_81A8374 +sub_81A8374: @ 81A8374 + push {r4-r7,lr} + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000e04 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0xE + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + lsls r7, r5, 24 + adds r6, r4, 0 +_081A83A0: + lsls r0, r5, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r6] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r0, [r0] + subs r2, r0, 0x1 + cmp r3, r2 + bge _081A83EE + ldr r0, =0x00000cb4 + adds r1, r0 + b _081A83E8 + .pool +_081A83E0: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _081A83EE +_081A83E8: + ldrh r0, [r1] + cmp r0, r4 + bne _081A83E0 +_081A83EE: + ldr r0, [r6] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + cmp r3, r0 + bne _081A83A0 + ldr r5, =gTrainerBattleOpponent_A + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0 + bl sub_8162614 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r0, =0x00000cb2 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0xE + bhi _081A8424 + subs r0, 0x1 + lsls r0, 1 + ldr r2, =0x00000cb4 + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_081A8424: + adds r5, r3, 0 +_081A8426: + lsrs r0, r7, 24 + movs r1, 0x1 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r5] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r3, r0 + bge _081A8466 + adds r2, 0x2 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r4 + beq _081A8466 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + subs r2, 0x2 + adds r0, r1, r2 + ldrh r2, [r0] + ldr r0, =0x00000cb4 + adds r1, r0 +_081A8458: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _081A8466 + ldrh r0, [r1] + cmp r0, r4 + bne _081A8458 +_081A8466: + ldr r0, [r5] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r3, r0 + bne _081A8426 + ldr r5, =gTrainerBattleOpponent_B + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0x1 + bl sub_8162614 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0x00000cb2 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0xD + bhi _081A849A + subs r0, 0x2 + lsls r0, 1 + ldr r2, =0x00000cb4 + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_081A849A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8374 + + thumb_func_start sub_81A84B4 +sub_81A84B4: @ 81A84B4 + push {r4,r5,lr} + movs r2, 0 + ldr r5, =gSaveBlock2Ptr + ldr r4, =0x00000cb4 + ldr r0, =0x0000ffff + adds r3, r0, 0 +_081A84C0: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xD + bls _081A84C0 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A84B4 + + thumb_func_start sub_81A84EC +sub_81A84EC: @ 81A84EC + push {lr} + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + bne _081A8524 + ldr r3, =gTrainerBattleOpponent_A + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _081A8542 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString + b _081A8542 + .pool +_081A8524: + cmp r0, 0x1 + bne _081A8542 + ldr r3, =gTrainerBattleOpponent_B + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _081A8542 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString +_081A8542: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A84EC + + thumb_func_start sub_81A8554 +sub_81A8554: @ 81A8554 + push {r4-r6,lr} + ldr r5, =gPlayerParty + movs r6, 0 + movs r4, 0 +_081A855C: + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081A856E + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081A856E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, 0x64 + cmp r4, 0x2 + bls _081A855C + cmp r6, 0x1 + bhi _081A8588 + movs r0, 0x1 + b _081A858A + .pool +_081A8588: + movs r0, 0 +_081A858A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81A8554 + + thumb_func_start sub_81A8590 +sub_81A8590: @ 81A8590 + push {r4-r6,lr} + lsls r0, 24 + movs r6, 0 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + ldr r3, =0x00000ca9 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + ldr r3, =0x00000e04 + adds r2, r3 + adds r2, r1 + lsrs r4, r0, 24 + ldrh r2, [r2] + adds r0, r4, r2 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x5 + bl sub_81A3B30 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + blt _081A85F0 + cmp r2, 0x1 + bgt _081A85F0 + ldr r1, =gUnknown_086125DC + adds r0, r2, 0 + adds r0, 0x14 + adds r0, r1 + ldrb r0, [r0] + ldrb r1, [r1, 0x17] + subs r0, r1 + cmp r4, r0 + bne _081A8634 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + b _081A8634 + .pool +_081A85F0: + ldr r5, =gUnknown_086125DC + movs r0, 0x5 + lsls r3, r0, 2 + adds r0, r3, r5 + ldrb r1, [r0] + adds r0, r5, 0x3 + adds r0, r3, r0 + ldrb r2, [r0] + subs r1, r2 + cmp r4, r1 + bne _081A8610 + movs r6, 0x3 + b _081A8634 + .pool +_081A8610: + adds r0, r5, 0x1 + adds r0, r3, r0 + ldrb r1, [r0] + subs r0, r1, r2 + cmp r4, r0 + beq _081A8632 + cmp r4, r1 + bls _081A8634 + subs r0, r4, r1 + adds r0, r2 + adds r1, r5, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + bl __modsi3 + cmp r0, 0 + bne _081A8634 +_081A8632: + movs r6, 0x4 +_081A8634: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81A8590 + + thumb_func_start sub_81A863C +sub_81A863C: @ 81A863C + push {r4,lr} + ldr r4, =gScriptResult + movs r0, 0 + bl sub_81A8590 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A863C + + thumb_func_start sub_81A8658 +sub_81A8658: @ 81A8658 + push {r4,lr} + ldr r3, =gUnknown_08612675 + ldr r2, =gSpecialVar_0x8007 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xE1 + lsls r1, 4 + adds r0, r1 + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 29 + lsls r0, r1, 1 + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + adds r0, r3 + ldrb r4, [r0] + adds r0, r4, 0 + bl sub_81A7F38 + ldr r0, =gScriptResult + strh r4, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8658 + + thumb_func_start sub_81A869C +sub_81A869C: @ 81A869C + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8005 + ldrb r1, [r0] + movs r0, 0xE1 + lsls r0, 4 + adds r2, r0 + lsls r1, 7 + ldrb r3, [r2] + movs r0, 0x7F + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_81A869C + + thumb_func_start sub_81A86C0 +sub_81A86C0: @ 81A86C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + movs r0, 0 + mov r10, r0 +_081A86D4: + movs r0, 0 + mov r9, r0 + movs r0, 0x64 + mov r1, r10 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r7, 0 + movs r1, 0x3A + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, r5 + bcc _081A8762 + adds r0, r7, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A8762 + adds r0, r7, 0 + movs r1, 0x15 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r6, 0 + b _081A8732 + .pool +_081A872C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081A8732: + cmp r6, 0x3 + bhi _081A8766 + adds r1, r6, 0 + adds r1, 0xD + adds r0, r7, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + adds r2, r6, 0 + bl CalculatePPWithBonus + lsls r0, 24 + lsrs r5, r0, 24 + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r7, 0 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r5 + bcs _081A872C +_081A8762: + movs r0, 0x1 + mov r9, r0 +_081A8766: + mov r0, r9 + cmp r0, 0x1 + bne _081A8778 + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + b _081A8786 + .pool +_081A8778: + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0x2 + bls _081A86D4 +_081A8786: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A86C0 + + thumb_func_start sub_81A8794 +sub_81A8794: @ 81A8794 + push {r4-r7,lr} + movs r5, 0 + ldr r7, =gSaveBlock1Ptr + ldr r6, =gSaveBlock2Ptr +_081A879C: + ldr r0, [r6] + lsls r4, r5, 1 + ldr r1, =0x00000caa + adds r0, r1 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + movs r2, 0xEA + lsls r2, 1 + adds r1, r2 + ldr r0, [r7] + adds r0, r1 + movs r1, 0xC + bl GetMonData + ldr r1, [r6] + ldr r2, =0x00000e12 + adds r1, r2 + adds r1, r4 + strh r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A879C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8794 + + thumb_func_start sub_81A87E8 +sub_81A87E8: @ 81A87E8 + push {r4,lr} + movs r4, 0 +_081A87EC: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r3, r4, 1 + ldr r1, =0x00000caa + adds r0, r2, r1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gBattleScripting + 0x14 + adds r0, r1 + ldr r1, =0x00000e12 + adds r3, r1 + adds r2, r3 + movs r1, 0xC + bl SetMonData + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A87EC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A87E8 + + thumb_func_start sub_81A8830 +sub_81A8830: @ 81A8830 + push {r4-r6,lr} + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x00000ca8 + adds r1, r0 + movs r4, 0 + strb r4, [r1] + ldr r1, [r3] + ldr r6, =0x00000cb2 + adds r0, r1, r6 + strh r4, [r0] + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r3, [r3] + ldr r0, =0x00000cdc + adds r2, r3, r0 + ldr r1, =gUnknown_08612690 + lsls r0, r5, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _081A887C + lsls r1, r5, 1 + ldr r2, =0x00000e04 + adds r0, r3, r2 + adds r0, r1 + strh r4, [r0] +_081A887C: + ldr r0, =gTrainerBattleOpponent_A + strh r4, [r0] + ldr r1, =gBattleOutcome + movs r0, 0 + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8830 + + thumb_func_start sub_81A88B0 +sub_81A88B0: @ 81A88B0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gPlayerParty + adds r0, r4, 0 + movs r1, 0x6 + bl GetMonData + cmp r0, 0 + bne _081A8904 + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x33 + beq _081A88D6 + cmp r0, 0x16 + bne _081A8904 +_081A88D6: + adds r0, r4, 0 + movs r1, 0x38 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _081A8904 + subs r0, 0x5 + cmp r5, r0 + bgt _081A8904 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081A8904 + movs r0, 0 + b _081A8906 + .pool +_081A8904: + movs r0, 0x1 +_081A8906: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A88B0 + + thumb_func_start sub_81A890C +sub_81A890C: @ 81A890C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x0000017b + cmp r2, r0 + bne _081A8920 + movs r1, 0 + b _081A892A + .pool +_081A8920: + ldr r0, =0x00000149 + movs r1, 0x2 + cmp r2, r0 + bne _081A892A + movs r1, 0x1 +_081A892A: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A890C + + thumb_func_start sub_81A8934 +@ void sub_81A8934(u8) +sub_81A8934: @ 81A8934 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gUnknown_0203CE50 + ldr r0, [r4] + cmp r0, 0 + bne _081A894A + movs r0, 0x44 + bl AllocZeroed + str r0, [r4] +_081A894A: + ldr r0, [r4] + adds r0, 0x41 + strb r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8934 + + thumb_func_start sub_81A895C +sub_81A895C: @ 81A895C + push {r4,lr} + ldr r4, =gUnknown_0203CE50 + ldr r0, [r4] + cmp r0, 0 + beq _081A896E + bl Free + movs r0, 0 + str r0, [r4] +_081A896E: + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gMapObjects + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A895C + + thumb_func_start sub_81A89A0 +sub_81A89A0: @ 81A89A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0 + mov r9, r1 + movs r3, 0 + mov r10, r3 + mov r8, r3 +_081A89C4: + mov r0, r8 + lsls r4, r0, 1 + adds r1, r4, r0 + lsls r1, 3 + add r1, r9 + ldrh r0, [r1, 0x4] + adds r0, 0x7 + ldrh r1, [r1, 0x6] + adds r1, 0x7 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =gUnknown_0203CE50 + ldr r0, [r0] + adds r0, 0x41 + ldrb r0, [r0] + movs r2, 0xA6 + lsls r2, 2 + cmp r0, 0 + bne _081A89F8 + subs r2, 0x48 +_081A89F8: + ldr r0, =0x0000024f + cmp r1, r0 + bls _081A8AD4 + subs r1, r2 + adds r0, r1, 0 + cmp r1, 0 + bge _081A8A08 + adds r0, r1, 0x7 +_081A8A08: + asrs r2, r0, 3 + lsls r0, r2, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _081A8AD4 + ldr r3, [sp] + cmp r0, r3 + bne _081A8AD4 + lsls r0, r2, 3 + subs r0, r1, r0 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bhi _081A8AD4 + movs r1, 0 + movs r2, 0 + cmp r5, 0x1 + beq _081A8A58 + cmp r5, 0x1 + bgt _081A8A44 + cmp r5, 0 + beq _081A8A4E + b _081A8AD4 + .pool +_081A8A44: + cmp r5, 0x2 + beq _081A8A64 + cmp r5, 0x3 + beq _081A8A70 + b _081A8AD4 +_081A8A4E: + ldr r7, =gUnknown_08612698 + movs r1, 0x1 + b _081A8A74 + .pool +_081A8A58: + ldr r7, =gUnknown_0861269C + movs r2, 0x1 + b _081A8A74 + .pool +_081A8A64: + ldr r7, =gUnknown_086126A0 + movs r1, 0xFF + b _081A8A74 + .pool +_081A8A70: + ldr r7, =gUnknown_086126A4 + movs r2, 0xFF +_081A8A74: + mov r3, r8 + adds r0, r4, r3 + lsls r0, 3 + mov r3, r9 + adds r4, r0, r3 + lsls r0, r1, 24 + asrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r4, 0x4] + lsls r0, r2, 24 + asrs r0, 24 + ldrh r3, [r4, 0x6] + adds r0, r3 + strh r0, [r4, 0x6] + ldrb r0, [r4] + ldr r6, =gSaveBlock1Ptr + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _081A8ACC + mov r0, r8 + adds r1, r5, 0 + bl sub_81A8D60 + ldrb r4, [r4] + mov r10, r4 + mov r0, r10 + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + adds r3, r7, 0 + bl exec_movement + b _081A8AD4 + .pool +_081A8ACC: + mov r0, r8 + adds r1, r5, 0 + bl sub_81A8D94 +_081A8AD4: + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x3F + bhi _081A8AE4 + b _081A89C4 +_081A8AE4: + mov r0, r10 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A89A0 + + thumb_func_start sub_81A8AF8 +sub_81A8AF8: @ 81A8AF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, =gUnknown_0203CE50 + ldr r2, [r1] + cmp r2, 0 + bne _081A8B0C + b _081A8D4A +_081A8B0C: + adds r0, r2, 0 + adds r0, 0x41 + ldrb r0, [r0] + movs r3, 0xA6 + lsls r3, 2 + mov r10, r3 + cmp r0, 0 + bne _081A8B22 + movs r0, 0x94 + lsls r0, 2 + mov r10, r0 +_081A8B22: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r3, 0xC7 + lsls r3, 4 + adds r7, r0, r3 + movs r0, 0 + mov r9, r0 + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r9, r0 + bcc _081A8B3C + b _081A8D4A +_081A8B3C: + mov r8, r1 +_081A8B3E: + mov r1, r8 + ldr r0, [r1] + mov r2, r9 + lsls r4, r2, 2 + adds r0, r4 + ldrb r0, [r0, 0x1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r7 + ldrh r0, [r1, 0x4] + adds r0, 0x7 + ldrh r1, [r1, 0x6] + adds r1, 0x7 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r0, 16 + mov r3, r10 + subs r1, r0, r3 + adds r0, r1, 0 + cmp r1, 0 + bge _081A8B76 + adds r0, r1, 0x7 +_081A8B76: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldrb r1, [r1] + subs r0, r1 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081A8B96 + cmp r1, 0x3 + bne _081A8BAC +_081A8B96: + movs r0, 0x3 + negs r0, r0 + movs r6, 0 + cmp r1, r0 + bne _081A8BB4 + b _081A8BB2 + .pool +_081A8BAC: + movs r6, 0x2 + cmp r1, 0 + ble _081A8BB4 +_081A8BB2: + movs r6, 0x1 +_081A8BB4: + ldr r5, =gUnknown_0203CE50 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0] + ldr r1, =gSaveBlock1Ptr + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x10 + bne _081A8BDC + b _081A8D32 +_081A8BDC: + ldr r0, =gMapObjects + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x18] + lsls r0, 28 + lsrs r0, 28 + adds r1, r0, 0 + cmp r6, 0 + bne _081A8C9C + cmp r0, 0x2 + beq _081A8C60 + cmp r0, 0x2 + bgt _081A8C0C + cmp r0, 0x1 + beq _081A8C30 + b _081A8D32 + .pool +_081A8C0C: + cmp r0, 0x3 + beq _081A8C48 + cmp r0, 0x4 + beq _081A8C16 + b _081A8D32 +_081A8C16: + ldr r3, =gUnknown_086126AE + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x7 + b _081A8C72 + .pool +_081A8C30: + ldr r3, =gUnknown_086126A8 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0xA + b _081A8C72 + .pool +_081A8C48: + ldr r3, =gUnknown_086126AA + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x8 + b _081A8C72 + .pool +_081A8C60: + ldr r3, =gUnknown_086126AC + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x9 +_081A8C72: + strb r1, [r0, 0x9] + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0] + ldr r1, =gSaveBlock1Ptr + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl exec_movement + b _081A8D32 + .pool +_081A8C9C: + cmp r6, 0x1 + bne _081A8D32 + cmp r0, 0x2 + beq _081A8D00 + cmp r0, 0x2 + bgt _081A8CAE + cmp r0, 0x1 + beq _081A8CD0 + b _081A8D32 +_081A8CAE: + cmp r1, 0x3 + beq _081A8CE8 + cmp r1, 0x4 + bne _081A8D32 + ldr r3, =gUnknown_086126AA + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x8 + b _081A8D12 + .pool +_081A8CD0: + ldr r3, =gUnknown_086126AC + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x9 + b _081A8D12 + .pool +_081A8CE8: + ldr r3, =gUnknown_086126AE + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x7 + b _081A8D12 + .pool +_081A8D00: + ldr r3, =gUnknown_086126A8 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0xA +_081A8D12: + strb r1, [r0, 0x9] + mov r2, r8 + ldr r0, [r2] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0] + ldr r1, =gSaveBlock1Ptr + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl exec_movement +_081A8D32: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r3, r8 + ldr r0, [r3] + adds r0, 0x40 + ldrb r0, [r0] + cmp r9, r0 + bcs _081A8D4A + b _081A8B3E +_081A8D4A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8AF8 + + thumb_func_start sub_81A8D60 +sub_81A8D60: @ 81A8D60 + push {r4,lr} + ldr r4, =gUnknown_0203CE50 + ldr r3, [r4] + adds r2, r3, 0 + adds r2, 0x40 + ldrb r2, [r2] + lsls r2, 2 + adds r3, r2 + strb r0, [r3, 0x1] + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0 + strb r1, [r2] + ldr r1, [r4] + adds r1, 0x40 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8D60 + + thumb_func_start sub_81A8D94 +sub_81A8D94: @ 81A8D94 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r5, r0, r1 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x4] + adds r0, 0x7 + ldrh r1, [r1, 0x6] + adds r1, 0x7 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =gUnknown_0203CE50 + ldr r0, [r0] + adds r0, 0x41 + ldrb r0, [r0] + movs r1, 0xA6 + lsls r1, 2 + cmp r0, 0 + bne _081A8DDA + subs r1, 0x48 +_081A8DDA: + subs r1, r2, r1 + adds r0, r1, 0 + cmp r1, 0 + bge _081A8DE4 + adds r0, r1, 0x7 +_081A8DE4: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + subs r0, r6 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081A8DFC + cmp r1, 0x3 + bne _081A8E08 +_081A8DFC: + movs r2, 0 + b _081A8E1A + .pool +_081A8E08: + cmp r1, 0 + bgt _081A8E14 + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + bne _081A8E18 +_081A8E14: + movs r2, 0x1 + b _081A8E1A +_081A8E18: + movs r2, 0x2 +_081A8E1A: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r5 + ldrb r0, [r1, 0x9] + adds r3, r0, 0 + cmp r2, 0 + bne _081A8E4C + cmp r0, 0x8 + beq _081A8E72 + cmp r0, 0x8 + bgt _081A8E38 + cmp r0, 0x7 + beq _081A8E48 + b _081A8E76 +_081A8E38: + cmp r0, 0x9 + beq _081A8E44 + cmp r0, 0xA + bne _081A8E76 + movs r0, 0x7 + b _081A8E74 +_081A8E44: + movs r0, 0x8 + b _081A8E74 +_081A8E48: + movs r0, 0x9 + b _081A8E74 +_081A8E4C: + cmp r2, 0x1 + bne _081A8E76 + cmp r0, 0x8 + beq _081A8E6A + cmp r0, 0x8 + bgt _081A8E5E + cmp r0, 0x7 + beq _081A8E72 + b _081A8E76 +_081A8E5E: + cmp r3, 0x9 + beq _081A8E6E + cmp r3, 0xA + bne _081A8E76 + movs r0, 0x8 + b _081A8E74 +_081A8E6A: + movs r0, 0x9 + b _081A8E74 +_081A8E6E: + movs r0, 0x7 + b _081A8E74 +_081A8E72: + movs r0, 0xA +_081A8E74: + strb r0, [r1, 0x9] +_081A8E76: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81A8D94 + + thumb_func_start sub_81A8E7C +sub_81A8E7C: @ 81A8E7C + push {lr} + ldr r1, =gUnknown_08613EE0 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8E7C + + thumb_func_start sub_81A8E9C +sub_81A8E9C: @ 81A8E9C + push {r4-r6,lr} + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r4, =0x00000ca9 + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x00000ca8 + adds r1, r0 + movs r2, 0 + strb r2, [r1] + ldr r1, [r3] + ldr r6, =0x00000cb2 + adds r0, r1, r6 + strh r2, [r0] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + cmp r5, 0 + beq _081A8EF0 + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 6 + b _081A8EFC + .pool +_081A8EF0: + ldr r0, [r3] + ldr r6, =0x00000cdc + adds r0, r6 + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 5 +_081A8EFC: + ands r2, r0 + cmp r2, 0 + bne _081A8F14 + ldr r0, [r3] + lsls r1, r5, 1 + ldr r3, =0x00000e1a + adds r0, r3 + adds r0, r1 + strh r2, [r0] + adds r0, r5, 0 + bl sub_81AAA7C +_081A8F14: + bl sub_81C4EEC + ldr r0, =gTrainerBattleOpponent_A + movs r1, 0 + strh r1, [r0] + ldr r0, =gBattleOutcome + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8E9C + + thumb_func_start sub_81A8F38 +sub_81A8F38: @ 81A8F38 + push {r4,lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + adds r3, r1, 0 + cmp r0, 0x6 + bls _081A8F54 + b _081A903A +_081A8F54: + lsls r0, 2 + ldr r1, =_081A8F70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A8F70: + .4byte _081A8F8C + .4byte _081A8F9C + .4byte _081A8FB4 + .4byte _081A8FE4 + .4byte _081A8FF8 + .4byte _081A9010 + .4byte _081A9028 +_081A8F8C: + ldr r0, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000e18 + b _081A8FFE + .pool +_081A8F9C: + ldr r2, =gScriptResult + ldr r0, [r3] + lsls r1, r4, 1 + ldr r3, =0x00000e1a + adds r0, r3 + adds r0, r1 + ldrh r0, [r0] + b _081A9038 + .pool +_081A8FB4: + cmp r4, 0 + beq _081A8FCC + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + b _081A9030 + .pool +_081A8FCC: + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r3, =0x00000cdc + adds r0, r3 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + b _081A9036 + .pool +_081A8FE4: + ldr r0, =gScriptResult + ldr r1, [r3] + ldr r2, =0x00000e1a + adds r1, r2 + b _081A9000 + .pool +_081A8FF8: + ldr r0, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000e1c +_081A8FFE: + adds r1, r3 +_081A9000: + ldrh r1, [r1] + strh r1, [r0] + b _081A903A + .pool +_081A9010: + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + b _081A9036 + .pool +_081A9028: + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r3, =0x00000cdc + adds r0, r3 +_081A9030: + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 +_081A9036: + ands r0, r1 +_081A9038: + strh r0, [r2] +_081A903A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8F38 + + thumb_func_start sub_81A9048 +sub_81A9048: @ 81A9048 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A9098 + cmp r0, 0x1 + bgt _081A9078 + cmp r0, 0 + beq _081A9082 + b _081A9126 + .pool +_081A9078: + cmp r0, 0x2 + beq _081A90B0 + cmp r0, 0x7 + beq _081A911C + b _081A9126 +_081A9082: + ldr r0, =gSpecialVar_0x8006 + ldrh r1, [r0] + ldr r3, =0x00000e18 + adds r0, r2, r3 + strh r1, [r0] + b _081A9126 + .pool +_081A9098: + lsls r1, 1 + ldr r3, =0x00000e1a + adds r0, r2, r3 + adds r0, r1 + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + strh r1, [r0] + b _081A9126 + .pool +_081A90B0: + cmp r1, 0 + beq _081A90E4 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A90D0 + ldr r1, =0x00000cdc + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 6 + b _081A90F6 + .pool +_081A90D0: + ldr r3, =0x00000cdc + adds r0, r2, r3 + ldr r1, [r0] + ldr r2, =0xffffdfff + b _081A910C + .pool +_081A90E4: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A9104 + ldr r1, =0x00000cdc + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 5 +_081A90F6: + orrs r1, r2 + str r1, [r0] + b _081A9126 + .pool +_081A9104: + ldr r3, =0x00000cdc + adds r0, r2, r3 + ldr r1, [r0] + ldr r2, =0xffffefff +_081A910C: + ands r1, r2 + str r1, [r0] + b _081A9126 + .pool +_081A911C: + ldr r0, =gSpecialVar_0x8006 + ldrh r1, [r0] + ldr r3, =0x00000e2a + adds r0, r2, r3 + strb r1, [r0] +_081A9126: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9048 + + thumb_func_start sub_81A9134 +sub_81A9134: @ 81A9134 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl save_serialize_map + movs r0, 0x1 + bl TrySavingData + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9134 + + thumb_func_start sub_81A917C +sub_81A917C: @ 81A917C + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0x29 + bls _081A91CC + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_08613F34 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =0x00000e18 + adds r4, r1 + b _081A91EA + .pool +_081A91CC: + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_08613F28 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r2, =0x00000e18 + adds r4, r2 +_081A91EA: + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A917C + + thumb_func_start sub_81A91FC +sub_81A91FC: @ 81A91FC + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000e18 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081A9244 + ldr r0, [r4] + ldr r1, =0x00000e18 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000e18 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081A924A + .pool +_081A9244: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081A924A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A91FC + + thumb_func_start sub_81A9254 +sub_81A9254: @ 81A9254 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =gSaveBlock2Ptr +_081A925A: + bl Random + ldr r1, [r5] + lsls r2, r4, 1 + ldr r3, =0x00000e22 + adds r1, r3 + adds r1, r2 + strh r0, [r1] + adds r4, 0x1 + cmp r4, 0x3 + ble _081A925A + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e2a + adds r0, r1 + movs r1, 0 + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9254 + + thumb_func_start CalculateBattlePyramidItemBallItemId +CalculateBattlePyramidItemBallItemId: @ 81A9290 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + mov r10, r0 + adds r2, 0x9 + adds r0, r1, r2 + ldrh r0, [r0] + str r0, [sp] + mov r2, r10 + lsls r0, r2, 1 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x13 + bls _081A92DE + movs r0, 0x13 + mov r8, r0 +_081A92DE: + bl sub_81AA9E4 + lsls r0, 24 + ldr r1, =gScriptLastTalked + ldrh r4, [r1] + ldr r1, =gUnknown_08613650 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x1] + subs r4, r0 + subs r7, r4, 0x1 + ldr r1, [r5] + lsrs r0, r7, 31 + adds r0, r7, r0 + asrs r0, 1 + lsls r0, 1 + ldr r2, =0x00000e22 + adds r1, r2 + adds r1, r0 + ldrh r6, [r1] + adds r0, r6, 0 + bl SeedRng2 + movs r5, 0 + mov r0, r8 + lsls r0, 2 + mov r9, r0 + cmp r5, r4 + bge _081A9332 +_081A9318: + bl Random2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r5, 0x1 + adds r0, r7, 0x1 + cmp r5, r0 + blt _081A9318 +_081A9332: + ldr r0, =gUnknown_08613B3A + ldr r1, [sp] + adds r0, r1, r0 + ldrb r5, [r0] + ldr r1, =gUnknown_08613ABC + ldr r3, =gSpecialVar_0x8000 + ldr r4, =gSpecialVar_0x8001 + cmp r5, 0x3E + bhi _081A935E + lsls r2, r5, 1 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r6, r0 + blt _081A935E + adds r0, r2, r1 +_081A9350: + adds r0, 0x2 + adds r5, 0x1 + cmp r5, 0x3E + bhi _081A935E + ldrb r2, [r0] + cmp r6, r2 + bge _081A9350 +_081A935E: + mov r0, r10 + cmp r0, 0 + beq _081A9394 + ldr r2, =gUnknown_0861392C + b _081A9396 + .pool +_081A9394: + ldr r2, =gUnknown_0861379C +_081A9396: + lsls r0, r5, 1 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + mov r1, r9 + add r1, r8 + lsls r1, 2 + adds r0, r1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + movs r0, 0x1 + strh r0, [r4] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end CalculateBattlePyramidItemBallItemId + + thumb_func_start sub_81A93C8 +sub_81A93C8: @ 81A93C8 + push {r4,r5,lr} + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r3, r0, r1 + movs r2, 0 + ldr r4, =gScriptLastTalked + b _081A93F4 + .pool +_081A93E4: + adds r2, 0x1 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _081A940A +_081A93F4: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r3 + ldrb r0, [r1] + ldrh r5, [r4] + cmp r0, r5 + bne _081A93E4 + ldr r0, =0x00007fff + strh r0, [r1, 0x4] + strh r0, [r1, 0x6] +_081A940A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A93C8 + + thumb_func_start sub_81A9414 +sub_81A9414: @ 81A9414 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + bx lr + .pool + thumb_func_end sub_81A9414 + + thumb_func_start sub_81A9424 +sub_81A9424: @ 81A9424 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + movs r0, 0 + mov r9, r0 + movs r7, 0 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0 + mov r8, r1 + ldr r2, =gMapObjects + ldr r0, =gUnknown_03005DF0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x8] + bl sub_81A9AA8 + lsls r0, 16 + lsrs r5, r0, 16 + movs r6, 0 + ldr r2, =gUnknown_08613C1C + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bne _081A9488 + ldrb r2, [r2, 0x1] + mov r9, r2 + b _081A94AE + .pool +_081A9488: + adds r6, 0x1 + cmp r6, 0x31 + bhi _081A94AE + ldr r4, =gUnknown_08613C1C + lsls r3, r6, 1 + adds r2, r3, r4 + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bne _081A9488 + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + mov r9, r0 +_081A94AE: + ldr r3, =gUnknown_08613ED8 + ldr r2, =gMapObjects + ldr r0, =gUnknown_03005DF0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x8] + subs r0, 0x1 + adds r0, r3 + ldrb r0, [r0] + str r0, [sp] + movs r6, 0 + mov r3, r9 + lsls r3, 2 + mov r9, r3 +_081A94D0: + ldr r0, [sp] + cmp r0, 0x8 + bls _081A94D8 + b _081A95E8 +_081A94D8: + lsls r0, 2 + ldr r1, =_081A94FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A94FC: + .4byte _081A9520 + .4byte _081A9530 + .4byte _081A9572 + .4byte _081A95B4 + .4byte _081A95BA + .4byte _081A95C0 + .4byte _081A95C6 + .4byte _081A95D2 + .4byte _081A95DE +_081A9520: + mov r0, sp + movs r1, 0x8 + movs r2, 0 + bl sub_81A9998 + lsls r0, 24 + lsrs r7, r0, 24 + b _081A95EE +_081A9530: + movs r6, 0 + ldr r2, =0x7fff0000 + mov r4, r8 + adds r4, 0x4 + mov r5, r8 + b _081A9560 + .pool +_081A9540: + ldrb r0, [r5, 0x1] + cmp r0, 0x3B + bne _081A955A + movs r1, 0 + ldrsh r0, [r4, r1] + asrs r1, r2, 16 + cmp r0, r1 + beq _081A955A + movs r3, 0x2 + ldrsh r0, [r4, r3] + cmp r0, r1 + beq _081A955A + adds r7, 0x1 +_081A955A: + adds r4, 0x18 + adds r5, 0x18 + adds r6, 0x1 +_081A9560: + str r2, [sp, 0x4] + bl sub_81AAA40 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x4] + cmp r6, r0 + blt _081A9540 + b _081A95EE +_081A9572: + bl sub_81AA9E4 + lsls r0, 24 + ldr r1, =gUnknown_08613650 + lsrs r0, 20 + adds r0, r1 + ldrb r7, [r0, 0x1] + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e2a + adds r0, r1 + ldrb r2, [r0] + ldr r1, =gBitTable + movs r6, 0x7 +_081A958E: + ldr r0, [r1] + ands r0, r2 + cmp r0, 0 + beq _081A9598 + subs r7, 0x1 +_081A9598: + adds r1, 0x4 + subs r6, 0x1 + cmp r6, 0 + bge _081A958E + b _081A95EE + .pool +_081A95B4: + mov r0, sp + movs r1, 0x8 + b _081A95D6 +_081A95BA: + mov r0, sp + movs r1, 0x8 + b _081A95CA +_081A95C0: + mov r0, sp + movs r1, 0x10 + b _081A95D6 +_081A95C6: + mov r0, sp + movs r1, 0x10 +_081A95CA: + movs r2, 0x1 + bl sub_81A9998 + b _081A95E8 +_081A95D2: + mov r0, sp + movs r1, 0x18 +_081A95D6: + movs r2, 0x2 + bl sub_81A9998 + b _081A95E8 +_081A95DE: + mov r0, sp + movs r1, 0x18 + movs r2, 0x1 + bl sub_81A9998 +_081A95E8: + cmp r6, 0 + bne _081A95EE + b _081A94D0 +_081A95EE: + ldr r1, =gUnknown_08613EC0 + add r1, r9 + ldr r0, [sp] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r0, r7, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9424 + + thumb_func_start sub_81A9618 +sub_81A9618: @ 81A9618 + push {r4,r5,lr} + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r2, r0, 29 + ldr r4, =0x00000e1a + adds r1, r4 + adds r1, r2 + ldrh r3, [r1] + ldr r0, =0x000003e6 + cmp r3, r0 + bhi _081A963A + adds r0, r3, 0x1 + strh r0, [r1] +_081A963A: + ldr r0, [r5] + adds r1, r0, r4 + adds r1, r2 + ldr r3, =0x00000e1e + adds r0, r3 + adds r0, r2 + ldrh r1, [r1] + ldrh r2, [r0] + cmp r1, r2 + bls _081A9650 + strh r1, [r0] +_081A9650: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9618 + + thumb_func_start sub_81A966C +sub_81A966C: @ 81A966C + push {r4,lr} + ldr r4, =gScriptResult + bl InBattlePyramid + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A966C + + thumb_func_start sub_81A9684 +sub_81A9684: @ 81A9684 + push {r4,lr} + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A9698 + cmp r0, 0x1 + beq _081A96B4 + b _081A9754 + .pool +_081A9698: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000e68 + adds r0, r2 + strb r1, [r0] + b _081A9754 + .pool +_081A96B4: + ldr r4, =gScriptResult + ldrh r0, [r4] + cmp r0, 0x1 + beq _081A9710 + cmp r0, 0x1 + bgt _081A9754 + cmp r0, 0 + bne _081A9754 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081A9754 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e68 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x77 + bls _081A96F4 + movs r0, 0x78 + strb r0, [r1] + b _081A96FC + .pool +_081A96F4: + ldr r0, =gSpecialVar_0x8007 + ldrh r0, [r0] + bl PlaySE +_081A96FC: + ldr r1, =gScriptResult + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081A9754 + .pool +_081A9710: + ldr r1, =gSpecialVar_0x8005 + ldrh r0, [r1] + cmp r0, 0 + beq _081A9750 + subs r0, 0x1 + strh r0, [r1] + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r2, =0x00000e68 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r3] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x78 + bls _081A973E + movs r0, 0x78 + strb r0, [r1] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081A973E: + bl door_upload_tiles + b _081A9754 + .pool +_081A9750: + movs r0, 0x2 + strh r0, [r4] +_081A9754: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A9684 + + thumb_func_start sub_81A975C +sub_81A975C: @ 81A975C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r1, 0 + mov r0, sp + strh r1, [r0] + movs r5, 0 + movs r0, 0x64 + mov r9, r0 + ldr r1, =gPlayerParty + mov r8, r1 +_081A9776: + movs r4, 0 + adds r7, r5, 0x1 + mov r6, r9 + muls r6, r5 +_081A977E: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000caa + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _081A97A2 + subs r0, 0x1 + cmp r0, r5 + bne _081A97A2 + mov r1, r8 + adds r0, r6, r1 + movs r1, 0xC + mov r2, sp + bl SetMonData +_081A97A2: + adds r4, 0x1 + cmp r4, 0x3 + ble _081A977E + adds r5, r7, 0 + cmp r5, 0x5 + ble _081A9776 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A975C + + thumb_func_start sub_81A97C8 +sub_81A97C8: @ 81A97C8 + push {lr} + ldr r0, =sub_81A97DC + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A97C8 + + thumb_func_start sub_81A97DC +sub_81A97DC: @ 81A97DC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081A980C + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 5 + ldr r1, =gUnknown_08D856C8 + adds r0, r1 + ldr r1, =gPlttBufferUnfaded + 0xC0 + movs r2, 0x10 + bl CpuSet + adds r0, r4, 0 + bl DestroyTask +_081A980C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A97DC + + thumb_func_start sub_81A9828 +sub_81A9828: @ 81A9828 + push {lr} + bl sub_809FDD4 + pop {r0} + bx r0 + thumb_func_end sub_81A9828 + + thumb_func_start sub_81A9834 +sub_81A9834: @ 81A9834 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + movs r0, 0 + str r0, [sp] +_081A9844: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, [sp] + lsls r1, r2, 1 + ldr r5, =0x00000caa + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + subs r5, r0, 0x1 + movs r0, 0 + str r0, [sp, 0x4] + movs r2, 0x64 + adds r1, r5, 0 + muls r1, r2 + str r1, [sp, 0x8] + movs r0, 0x8E + lsls r0, 2 + adds r6, r1, r0 + movs r1, 0 + str r1, [sp, 0x10] +_081A986C: + ldr r2, =gSaveBlock1Ptr + ldr r0, [r2] + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + ldr r3, =gPlayerParty + ldr r1, [sp, 0x10] + adds r0, r1, r3 + movs r1, 0xB + movs r2, 0 + str r3, [sp, 0x14] + bl GetMonData + ldr r3, [sp, 0x14] + cmp r4, r0 + bne _081A993C + movs r6, 0 + adds r2, r5, 0x1 + str r2, [sp, 0xC] + movs r1, 0x64 + adds r0, r5, 0 + muls r0, r1 + movs r5, 0x8E + lsls r5, 2 + adds r5, r0 + mov r9, r5 + ldr r7, [sp, 0x4] + muls r7, r1 + mov r10, r3 +_081A98AC: + movs r5, 0 + adds r0, r6, 0x1 + mov r8, r0 + b _081A98C6 + .pool +_081A98C4: + adds r5, 0x1 +_081A98C6: + cmp r5, 0x3 + bgt _081A98EE + ldr r1, =gSaveBlock1Ptr + ldr r0, [r1] + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + adds r1, r6, 0 + adds r1, 0xD + mov r2, r10 + adds r0, r7, r2 + movs r2, 0 + bl GetMonData + cmp r4, r0 + bne _081A98C4 +_081A98EE: + cmp r5, 0x4 + bne _081A9900 + lsls r2, r6, 24 + lsrs r2, 24 + mov r5, r10 + adds r0, r7, r5 + movs r1, 0xA6 + bl SetMonMoveSlot +_081A9900: + mov r6, r8 + cmp r6, 0x3 + ble _081A98AC + ldr r1, =gSaveBlock1Ptr + ldr r0, [r1] + ldr r2, [sp, 0x8] + adds r0, r2 + movs r5, 0x8E + lsls r5, 2 + adds r0, r5 + ldr r1, =gPlayerParty + ldr r2, [sp, 0x10] + adds r1, r2, r1 + movs r2, 0x64 + bl memcpy + ldr r0, =gUnknown_0203CEF8 + ldr r5, [sp, 0x4] + adds r0, r5, r0 + mov r1, sp + ldrb r1, [r1, 0xC] + strb r1, [r0] + b _081A994C + .pool +_081A993C: + ldr r2, [sp, 0x10] + adds r2, 0x64 + str r2, [sp, 0x10] + ldr r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x4] + cmp r0, 0x2 + ble _081A986C +_081A994C: + ldr r1, [sp] + adds r1, 0x1 + str r1, [sp] + cmp r1, 0x2 + bgt _081A9958 + b _081A9844 +_081A9958: + movs r2, 0 + str r2, [sp] + ldr r4, =gSaveBlock2Ptr + ldr r3, =0x00000caa + ldr r2, =gUnknown_0203CEF8 +_081A9962: + ldr r1, [r4] + ldr r5, [sp] + lsls r0, r5, 1 + adds r1, r3 + adds r1, r0 + adds r0, r5, r2 + ldrb r0, [r0] + strh r0, [r1] + adds r5, 0x1 + str r5, [sp] + cmp r5, 0x2 + ble _081A9962 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9834 + + thumb_func_start sub_81A9998 +sub_81A9998: @ 81A9998 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + movs r4, 0 + ldr r0, =gUnknown_03005DC0 + ldr r5, [r0, 0x8] + ldr r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, 0xE + adds r5, r0 + movs r3, 0 + ldr r0, =0x000003ff + mov r8, r0 + ldr r1, =0x0000028e + mov r12, r1 + ldr r0, =gMapObjects + mov r9, r0 +_081A99CC: + movs r2, 0 +_081A99CE: + lsls r0, r2, 1 + adds r0, r5 + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + cmp r0, r12 + bne _081A9A8A + adds r2, 0x7 + ldr r0, =gUnknown_03005DF0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r9 + movs r5, 0xC + ldrsh r1, [r0, r5] + subs r2, r1 + adds r1, r3, 0x7 + movs r3, 0xE + ldrsh r0, [r0, r3] + subs r3, r1, r0 + cmp r2, r6 + bge _081A9A0E + negs r0, r6 + cmp r2, r0 + ble _081A9A0E + cmp r3, r6 + bge _081A9A0E + cmp r3, r0 + ble _081A9A0E + cmp r7, 0 + bne _081A9A84 +_081A9A0E: + cmp r2, 0 + ble _081A9A34 + cmp r3, 0 + ble _081A9A34 + movs r4, 0x3 + cmp r2, r3 + blt _081A9A7C + movs r4, 0x2 + b _081A9A7C + .pool +_081A9A34: + cmp r2, 0 + bge _081A9A46 + cmp r3, 0 + bge _081A9A46 + movs r4, 0x1 + cmp r2, r3 + ble _081A9A7C + movs r4, 0 + b _081A9A7C +_081A9A46: + cmp r2, 0 + bne _081A9A54 + movs r4, 0 + cmp r3, 0 + ble _081A9A7C + movs r4, 0x3 + b _081A9A7C +_081A9A54: + cmp r3, 0 + bne _081A9A62 + movs r4, 0x1 + cmp r2, 0 + ble _081A9A7C + movs r4, 0x2 + b _081A9A7C +_081A9A62: + cmp r2, 0 + bge _081A9A72 + adds r0, r2, r3 + movs r4, 0x1 + cmp r0, 0 + ble _081A9A7C + movs r4, 0x3 + b _081A9A7C +_081A9A72: + adds r0, r2, r3 + mvns r0, r0 + asrs r4, r0, 31 + movs r0, 0x2 + ands r4, r0 +_081A9A7C: + movs r0, 0 + mov r5, r10 + str r0, [r5] + b _081A9A98 +_081A9A84: + mov r0, r10 + str r7, [r0] + b _081A9A98 +_081A9A8A: + adds r2, 0x1 + cmp r2, 0x1F + ble _081A99CE + adds r5, 0x5E + adds r3, 0x1 + cmp r3, 0x1F + ble _081A99CC +_081A9A98: + adds r0, r4, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A9998 + + thumb_func_start sub_81A9AA8 +sub_81A9AA8: @ 81A9AA8 + lsls r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + adds r1, r0 + ldr r0, =0x00000cb2 + adds r1, r0 + ldrh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A9AA8 + + thumb_func_start GetBattlePyramidTrainerFlag +GetBattlePyramidTrainerFlag: @ 81A9AC4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + ldr r1, =0x00000e2a + adds r2, r1 + ldr r4, =gBitTable + ldr r3, =gMapObjects + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r1, 0x8] + subs r0, 0x1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrb r1, [r2] + ands r0, r1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetBattlePyramidTrainerFlag + + thumb_func_start sub_81A9B04 +sub_81A9B04: @ 81A9B04 + push {lr} + ldr r0, =gTrainerBattleOpponent_A + ldrh r0, [r0] + bl sub_81A9B44 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _081A9B2E + movs r0, 0x1 + bl sub_80B47E0 + ldr r1, =gUnknown_03005DF0 + strb r0, [r1] + ldr r0, =gTrainerBattleOpponent_B + ldrh r0, [r0] + bl sub_81A9B44 +_081A9B2E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9B04 + + thumb_func_start sub_81A9B44 +sub_81A9B44: @ 81A9B44 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0 + ldr r0, =gMapObjects + mov r12, r0 + ldr r6, =gUnknown_03005DF0 + ldr r1, =gSaveBlock1Ptr + mov r10, r1 + ldr r7, =gSaveBlock2Ptr + mov r9, r7 + ldr r0, =0x00000cb4 + mov r8, r0 + ldr r4, =gBitTable +_081A9B68: + mov r1, r9 + ldr r2, [r1] + lsls r0, r3, 1 + mov r7, r8 + adds r1, r2, r7 + adds r1, r0 + ldrh r0, [r1] + cmp r0, r5 + bne _081A9B86 + ldr r1, =0x00000e2a + adds r0, r2, r1 + ldr r1, [r4] + ldrb r2, [r0] + orrs r1, r2 + strb r1, [r0] +_081A9B86: + adds r4, 0x4 + adds r3, 0x1 + cmp r3, 0x7 + ble _081A9B68 + ldrb r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r12 + movs r3, 0x2 + strb r3, [r0, 0x6] + mov r7, r10 + ldr r2, [r7] + ldr r0, =gScriptLastTalked + ldrh r1, [r0] + subs r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + ldr r1, =0x00000c79 + adds r2, r1 + strb r3, [r2] + ldrb r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x10] + strh r1, [r0, 0xC] + ldrb r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x12] + strh r1, [r0, 0xE] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9B44 + + thumb_func_start sub_81A9C04 +sub_81A9C04: @ 81A9C04 + push {r4-r6,lr} + sub sp, 0x14 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + lsls r0, r5, 1 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x13 + bls _081A9C3A + movs r0, 0x13 +_081A9C3A: + cmp r5, 0 + beq _081A9C54 + ldr r1, =gBattlePyramidOpenLevelWildMonPointers + b _081A9C56 + .pool +_081A9C54: + ldr r1, =gBattlePyramidLevel50WildMonPointers +_081A9C56: + lsls r0, 2 + adds r0, r1 + ldr r6, [r0] + ldr r4, =gEnemyParty + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + subs r0, 0x1 + str r0, [sp, 0x10] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r6, r2 + adds r0, r4, 0 + movs r1, 0xB + bl SetMonData + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0] + mov r0, sp + bl GetSpeciesName + adds r0, r4, 0 + movs r1, 0x2 + mov r2, sp + bl SetMonData + cmp r5, 0 + beq _081A9CD4 + bl sub_8165C40 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x2] + subs r5, r0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xB + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x5 + adds r5, r0 + b _081A9CF6 + .pool +_081A9CD4: + bl Random + ldr r2, [sp, 0x10] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r6 + ldrb r4, [r1, 0x2] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xB + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x5 + adds r5, r4, r0 +_081A9CF6: + ldr r4, =gEnemyParty + ldr r2, =gBaseStats + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + adds r2, r1, 0 + muls r2, r0 + lsls r0, r5, 2 + ldr r1, =gExperienceTables + adds r0, r1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x19 + bl SetMonData + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x3] + cmp r1, 0 + blt _081A9D4C + cmp r1, 0x1 + bgt _081A9D4C + adds r2, r0, 0x3 + b _081A9D7C + .pool +_081A9D4C: + ldr r2, =gBaseStats + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x17] + cmp r0, 0 + beq _081A9D90 + ldr r4, =gEnemyParty + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + movs r1, 0x1 + ands r1, r0 + str r1, [sp, 0xC] + add r2, sp, 0xC +_081A9D7C: + adds r0, r4, 0 + movs r1, 0x2E + bl SetMonData + b _081A9D9C + .pool +_081A9D90: + str r0, [sp, 0xC] + ldr r0, =gEnemyParty + add r2, sp, 0xC + movs r1, 0x2E + bl SetMonData +_081A9D9C: + movs r0, 0 + str r0, [sp, 0xC] + movs r2, 0 + lsls r4, r5, 1 +_081A9DA4: + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + lsls r1, r2, 1 + adds r0, 0x4 + adds r0, r1 + ldrh r1, [r0] + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gEnemyParty + bl SetMonMoveSlot + ldr r0, [sp, 0xC] + adds r0, 0x1 + str r0, [sp, 0xC] + adds r2, r0, 0 + cmp r2, 0x3 + ble _081A9DA4 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e1a + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0x8B + bls _081A9E0C + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x11 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, 0xF + str r0, [sp, 0x10] + movs r0, 0 + str r0, [sp, 0xC] +_081A9DF6: + adds r1, r0, 0 + adds r1, 0x27 + ldr r0, =gEnemyParty + add r2, sp, 0x10 + bl SetMonData + ldr r0, [sp, 0xC] + adds r0, 0x1 + str r0, [sp, 0xC] + cmp r0, 0x5 + ble _081A9DF6 +_081A9E0C: + ldr r0, =gEnemyParty + bl CalculateMonStats + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9C04 + + thumb_func_start sub_81A9E28 +sub_81A9E28: @ 81A9E28 + push {lr} + bl sub_81AA9E4 + lsls r0, 24 + ldr r1, =gUnknown_08613650 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x4] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A9E28 + + thumb_func_start InBattlePyramid +InBattlePyramid: @ 81A9E40 + push {lr} + ldr r0, =gMapHeader + ldrh r1, [r0, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + bne _081A9E58 + movs r0, 0x1 + b _081A9E66 + .pool +_081A9E58: + movs r0, 0xBD + lsls r0, 1 + cmp r1, r0 + beq _081A9E64 + movs r0, 0 + b _081A9E66 +_081A9E64: + movs r0, 0x2 +_081A9E66: + pop {r1} + bx r1 + thumb_func_end InBattlePyramid + + thumb_func_start sub_81A9E6C +sub_81A9E6C: @ 81A9E6C + push {lr} + movs r2, 0 + ldr r0, =gMapHeader + ldrh r1, [r0, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + beq _081A9E80 + adds r0, 0x11 + cmp r1, r0 + bne _081A9E82 +_081A9E80: + movs r2, 0x1 +_081A9E82: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A9E6C + + thumb_func_start sub_81A9E90 +sub_81A9E90: @ 81A9E90 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _081A9EB8 + bl sub_81A9834 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca8 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, =0x0000400e + movs r1, 0 + bl VarSet + bl copy_player_party_from_sav1 +_081A9EB8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9E90 + + thumb_func_start sub_81A9EC8 +sub_81A9EC8: @ 81A9EC8 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _081A9ED8 + bl DoSoftReset +_081A9ED8: + pop {r0} + bx r0 + thumb_func_end sub_81A9EC8 + + thumb_func_start sub_81A9EDC +sub_81A9EDC: @ 81A9EDC + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gUnknown_0203BC88 + movs r1, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9EDC + + thumb_func_start sub_81A9EFC +sub_81A9EFC: @ 81A9EFC + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gUnknown_0203BC88 + movs r1, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x18 + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9EFC + + thumb_func_start sub_81A9F1C +sub_81A9F1C: @ 81A9F1C + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gUnknown_0203BC88 + movs r1, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x24 + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9F1C + + thumb_func_start sub_81A9F3C +sub_81A9F3C: @ 81A9F3C + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + movs r4, 0 + ldr r3, =gTrainerClassNameIndices + ldr r1, =gUnknown_0203BC88 + ldr r2, [r1] + movs r1, 0x34 + muls r0, r1 + adds r0, r2 + ldrb r0, [r0] + adds r0, r3 + ldrb r2, [r0] + ldr r1, =gUnknown_08613B44 +_081A9F58: + ldrb r0, [r1] + cmp r0, r2 + bne _081A9F70 + ldrb r0, [r1, 0x1] + b _081A9F7A + .pool +_081A9F70: + adds r1, 0x4 + adds r4, 0x1 + cmp r4, 0x35 + bls _081A9F58 + movs r0, 0 +_081A9F7A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81A9F3C + + thumb_func_start sub_81A9F80 +sub_81A9F80: @ 81A9F80 + push {lr} + ldr r0, =gUnknown_08252C88 + bl ScriptContext1_SetupScript + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9F80 + + thumb_func_start sub_81A9F90 +sub_81A9F90: @ 81A9F90 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r1, =0x00000ca9 + adds r0, r4, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 29 + ldr r2, =0x00000e1a + adds r0, r4, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x00000cb2 + adds r4, r1 + ldrh r1, [r4] + cmp r1, 0x7 + bne _081AA020 + adds r0, 0x1 + lsls r7, r0, 24 + lsls r1, 24 + mov r8, r1 +_081A9FCC: + lsrs r0, r7, 24 + mov r2, r8 + lsrs r1, r2, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r5 + bge _081AA004 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r4, =0x00000cb4 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r3 + beq _081AA004 + adds r6, r1, 0 +_081A9FF0: + adds r2, 0x1 + cmp r2, r5 + bge _081AA004 + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _081A9FF0 +_081AA004: + cmp r2, r5 + bne _081A9FCC + b _081AA062 + .pool +_081AA020: + lsls r1, 24 + mov r8, r1 + lsls r7, r0, 24 +_081AA026: + lsrs r0, r7, 24 + mov r2, r8 + lsrs r1, r2, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r5 + bge _081AA05E + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r4, =0x00000cb4 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r3 + beq _081AA05E + adds r6, r1, 0 +_081AA04A: + adds r2, 0x1 + cmp r2, r5 + bge _081AA05E + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _081AA04A +_081AA05E: + cmp r2, r5 + bne _081AA026 +_081AA062: + adds r0, r3, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A9F90 + + thumb_func_start sub_81AA078 +sub_81AA078: @ 81AA078 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + str r0, [sp, 0x4] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x8] + movs r0, 0x10 + bl AllocZeroed + str r0, [sp, 0xC] + bl sub_81AA96C + mov r4, sp + adds r4, 0x1 + mov r0, sp + adds r1, r4, 0 + bl sub_81AA33C + movs r7, 0 +_081AA0A6: + ldr r1, [sp, 0xC] + adds r0, r1, r7 + ldrb r0, [r0] + ldr r2, =0x00000169 + adds r0, r2 + lsls r0, 2 + ldr r1, =gUnknown_08481DD4 + adds r0, r1 + ldr r6, [r0] + ldr r2, [r6, 0xC] + mov r10, r2 + ldr r0, [sp, 0x4] + ldr r1, =gUnknown_03005DC0 + str r0, [r1, 0x8] + ldr r0, [r6] + lsls r0, 2 + adds r2, r0, 0 + adds r2, 0xF + str r2, [r1] + ldr r0, [r6, 0x4] + lsls r0, 2 + adds r0, 0xE + str r0, [r1, 0x4] + ldr r0, [sp, 0x4] + mov r9, r0 + adds r1, r7, 0 + cmp r7, 0 + bge _081AA0E0 + adds r1, r7, 0x3 +_081AA0E0: + asrs r1, 2 + ldr r4, [r6, 0x4] + adds r0, r1, 0 + muls r0, r4 + adds r0, 0x7 + muls r2, r0 + lsls r1, 2 + subs r1, r7, r1 + ldr r3, [r6] + adds r0, r1, 0 + muls r0, r3 + adds r0, 0x7 + adds r2, r0 + lsls r2, 1 + add r9, r2 + movs r1, 0 + mov r8, r1 + adds r2, r7, 0x1 + str r2, [sp, 0x10] + cmp r8, r4 + bge _081AA1B6 +_081AA10A: + movs r0, 0 + mov r12, r0 + mov r1, r8 + adds r1, 0x1 + str r1, [sp, 0x14] + cmp r12, r3 + bge _081AA1A2 + ldr r2, =gSaveBlock1Ptr + str r2, [sp, 0x18] + mov r4, r9 + mov r5, r10 +_081AA120: + ldrh r1, [r5] + ldr r0, =0x000003ff + ands r0, r1 + ldr r2, =0x0000028e + cmp r0, r2 + bne _081AA194 + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r7, r0 + beq _081AA194 + mov r0, sp + ldrb r0, [r0] + cmp r7, r0 + bne _081AA164 + ldr r1, [sp, 0x8] + cmp r1, 0 + bne _081AA164 + ldr r2, [sp, 0x18] + ldr r3, [r2] + adds r2, r7, 0 + cmp r7, 0 + bge _081AA14E + adds r2, r7, 0x3 +_081AA14E: + asrs r2, 2 + lsls r1, r2, 2 + subs r1, r7, r1 + ldr r0, [r6] + muls r0, r1 + add r0, r12 + strh r0, [r3] + ldr r0, [r6, 0x4] + muls r0, r2 + add r0, r8 + strh r0, [r3, 0x2] +_081AA164: + ldrh r0, [r5] + movs r1, 0xFC + lsls r1, 8 + ands r1, r0 + ldr r2, =0x0000028d + adds r0, r2, 0 + orrs r1, r0 + strh r1, [r4] + ldr r3, [r6] + b _081AA196 + .pool +_081AA194: + strh r1, [r4] +_081AA196: + adds r4, 0x2 + adds r5, 0x2 + movs r0, 0x1 + add r12, r0 + cmp r12, r3 + blt _081AA120 +_081AA1A2: + lsls r0, r3, 3 + adds r0, 0x1E + add r9, r0 + lsls r0, r3, 1 + add r10, r0 + ldr r1, [sp, 0x14] + mov r8, r1 + ldr r0, [r6, 0x4] + cmp r8, r0 + blt _081AA10A +_081AA1B6: + ldr r7, [sp, 0x10] + cmp r7, 0xF + bgt _081AA1BE + b _081AA0A6 +_081AA1BE: + bl mapheader_run_script_with_tag_x1 + ldr r0, [sp, 0xC] + bl Free + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AA078 + + thumb_func_start sub_81AA1D8 +sub_81AA1D8: @ 81AA1D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r5, 0 + mov r6, sp + adds r6, 0x1 + add r0, sp, 0x4 + mov r8, r0 + ldr r4, =gSaveBlock2Ptr + ldr r3, =0x00000cb4 + ldr r0, =0x0000ffff + adds r2, r0, 0 +_081AA1F2: + ldr r0, [r4] + lsls r1, r5, 1 + adds r0, r3 + adds r0, r1 + ldrh r1, [r0] + orrs r1, r2 + strh r1, [r0] + adds r5, 0x1 + cmp r5, 0x7 + ble _081AA1F2 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r7, r0, 24 + mov r0, sp + adds r1, r6, 0 + bl sub_81AA33C + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + movs r0, 0xC7 + lsls r0, 4 + adds r1, r0 + ldr r2, =0x05000180 + mov r0, r8 + bl CpuSet + movs r5, 0 +_081AA22E: + cmp r5, 0 + bne _081AA254 + ldr r1, =gUnknown_08613650 + lsls r0, r7, 4 + adds r0, r1 + ldrb r0, [r0, 0x3] + b _081AA25C + .pool +_081AA254: + ldr r1, =gUnknown_08613650 + lsls r0, r7, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] +_081AA25C: + cmp r0, 0x4 + bhi _081AA2E4 + lsls r0, 2 + ldr r1, =_081AA274 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AA274: + .4byte _081AA288 + .4byte _081AA292 + .4byte _081AA2A2 + .4byte _081AA2B0 + .4byte _081AA2CC +_081AA288: + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_81AA398 + b _081AA2E4 +_081AA292: + lsls r0, r5, 24 + lsrs r4, r0, 24 + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_81AA4D8 + b _081AA2BE +_081AA2A2: + lsls r0, r5, 24 + lsrs r4, r0, 24 + ldrb r1, [r6] + adds r0, r4, 0 + bl sub_81AA4D8 + b _081AA2BE +_081AA2B0: + lsls r0, r5, 24 + lsrs r4, r0, 24 + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_81AA648 +_081AA2BE: + lsls r0, 24 + cmp r0, 0 + beq _081AA2E4 + adds r0, r4, 0 + bl sub_81AA398 + b _081AA2E4 +_081AA2CC: + lsls r0, r5, 24 + lsrs r4, r0, 24 + ldrb r1, [r6] + adds r0, r4, 0 + bl sub_81AA648 + lsls r0, 24 + cmp r0, 0 + beq _081AA2E4 + adds r0, r4, 0 + bl sub_81AA398 +_081AA2E4: + adds r5, 0x1 + cmp r5, 0x1 + ble _081AA22E + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AA1D8 + + thumb_func_start sub_81AA2F8 +sub_81AA2F8: @ 81AA2F8 + push {r4,r5,lr} + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r5, =gUnknown_08252C4F + ldr r4, =gUnknown_08252C6A + movs r2, 0xC8 + lsls r2, 4 + adds r1, r0, r2 + movs r3, 0xC7 + lsls r3, 4 + adds r2, r0, r3 + movs r3, 0x3F +_081AA310: + ldrb r0, [r2, 0x1] + cmp r0, 0x3B + beq _081AA328 + str r5, [r1] + b _081AA32A + .pool +_081AA328: + str r4, [r1] +_081AA32A: + adds r1, 0x18 + adds r2, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _081AA310 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81AA2F8 + + thumb_func_start sub_81AA33C +sub_81AA33C: @ 81AA33C + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r2, =0x00000e28 + adds r0, r1, r2 + ldrh r2, [r0] + movs r3, 0xF + ands r2, r3 + strb r2, [r4] + ldr r7, =0x00000e22 + adds r1, r7 + ldrh r0, [r1] + ands r0, r3 + strb r0, [r6] + cmp r2, r0 + bne _081AA386 + ldr r1, [r5] + ldr r2, =0x00000e28 + adds r0, r1, r2 + ldrh r2, [r0] + adds r3, r2, 0x1 + adds r0, r3, 0 + asrs r0, 4 + lsls r0, 4 + subs r0, r3, r0 + strb r0, [r4] + adds r0, r1, r7 + ldrh r1, [r0] + adds r2, r1, 0 + adds r2, 0xF + adds r0, r2, 0 + asrs r0, 4 + lsls r0, 4 + subs r0, r2, r0 + strb r0, [r6] +_081AA386: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AA33C + + thumb_func_start sub_81AA398 +sub_81AA398: @ 81AA398 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r5, 0 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x10 + bl AllocZeroed + str r0, [sp, 0x8] + bl sub_81AA96C + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e26 + adds r0, r1 + ldrh r4, [r0] + movs r0, 0xF + ands r4, r0 + ldr r0, [sp] + cmp r0, 0 + bne _081AA3F0 + ldr r1, =gUnknown_08613650 + lsls r0, r6, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + mov r10, r0 + movs r1, 0 + str r1, [sp, 0x4] + b _081AA3FE + .pool +_081AA3F0: + ldr r1, =gUnknown_08613650 + lsls r0, r6, 4 + adds r0, r1 + ldrb r1, [r0] + mov r10, r1 + ldrb r0, [r0, 0x1] + str r0, [sp, 0x4] +_081AA3FE: + movs r0, 0 + mov r8, r0 + cmp r8, r10 + bge _081AA4C0 +_081AA406: + movs r1, 0x1 + add r1, r8 + mov r9, r1 + b _081AA42E + .pool +_081AA414: + lsls r2, r4, 24 + lsrs r2, 24 + ldr r3, [sp, 0x4] + add r3, r8 + lsls r3, 24 + lsrs r3, 24 + ldr r0, [sp] + ldr r1, [sp, 0x8] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA4B6 +_081AA42E: + ldr r0, =gBitTable + mov r12, r0 + ldr r6, =gSaveBlock2Ptr + ldr r7, =0x00000e28 + movs r3, 0x2 + lsls r0, r4, 2 + mov r1, r12 + adds r2, r0, r1 +_081AA43E: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _081AA464 + ldr r0, [r6] + adds r0, r7 + ldrh r1, [r0] + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + bne _081AA474 + b _081AA472 + .pool +_081AA464: + ldr r0, [r6] + adds r0, r7 + ldrh r1, [r0] + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + beq _081AA474 +_081AA472: + orrs r5, r3 +_081AA474: + adds r2, 0x4 + adds r4, 0x1 + cmp r4, 0xF + ble _081AA480 + mov r2, r12 + movs r4, 0 +_081AA480: + ldr r0, [r6] + ldr r1, =0x00000e26 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xF + ands r1, r0 + cmp r4, r1 + bne _081AA4A6 + movs r1, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _081AA4A4 + movs r0, 0x6 + orrs r5, r0 + b _081AA4A6 + .pool +_081AA4A4: + orrs r5, r1 +_081AA4A6: + adds r0, r5, 0 + ands r0, r3 + cmp r0, 0 + beq _081AA43E + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + beq _081AA414 +_081AA4B6: + movs r0, 0x1 + ands r5, r0 + mov r8, r9 + cmp r8, r10 + blt _081AA406 +_081AA4C0: + ldr r0, [sp, 0x8] + bl Free + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AA398 + + thumb_func_start sub_81AA4D8 +sub_81AA4D8: @ 81AA4D8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r6, 0 + movs r7, 0 + movs r0, 0 + str r0, [sp, 0xC] + bl sub_81AA9E4 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x10 + bl AllocZeroed + str r0, [sp, 0x14] + bl sub_81AA96C + ldr r1, [sp] + cmp r1, 0 + bne _081AA524 + ldr r1, =gUnknown_08613650 + lsls r0, r4, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + str r0, [sp, 0x10] + movs r0, 0 + b _081AA530 + .pool +_081AA524: + ldr r1, =gUnknown_08613650 + lsls r0, r4, 4 + adds r0, r1 + ldrb r2, [r0] + str r2, [sp, 0x10] + ldrb r0, [r0, 0x1] +_081AA530: + movs r3, 0 + str r3, [sp, 0x8] + ldr r1, [sp, 0x10] + asrs r1, 31 + str r1, [sp, 0x18] + ldr r2, [sp, 0x10] + cmp r3, r2 + bge _081AA622 + str r0, [sp, 0x1C] + adds r3, r0, 0 + lsls r3, 24 + mov r9, r3 +_081AA548: + cmp r7, 0 + bne _081AA56E + mov r0, r9 + lsrs r3, r0, 24 + ldr r0, [sp] + ldr r1, [sp, 0x14] + ldr r2, [sp, 0x4] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA568 + movs r7, 0x1 + b _081AA56E + .pool +_081AA568: + ldr r1, [sp, 0xC] + adds r1, 0x1 + str r1, [sp, 0xC] +_081AA56E: + movs r0, 0x1 + ands r0, r7 + cmp r0, 0 + beq _081AA600 + ldr r2, =gUnknown_08613F46 + mov r8, r2 + ldr r3, [sp, 0x4] + lsls r4, r3, 2 + adds r0, r6, r4 + add r0, r8 + ldrb r2, [r0] + mov r0, r9 + lsrs r3, r0, 24 + ldr r0, [sp] + ldr r1, [sp, 0x14] + bl sub_81AA760 + lsls r0, 24 + ldr r1, [sp, 0x1C] + mov r10, r1 + adds r5, r4, 0 + cmp r0, 0 + beq _081AA5E8 + ldr r4, [sp, 0xC] + adds r4, 0x1 + b _081AA5C2 + .pool +_081AA5A8: + adds r0, r6, r5 + adds r0, r2 + ldrb r2, [r0] + mov r0, r10 + lsls r3, r0, 24 + lsrs r3, 24 + ldr r0, [sp] + ldr r1, [sp, 0x14] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA5E0 +_081AA5C2: + adds r6, 0x1 + ldr r0, =gUnknown_08613F46 + adds r1, r6, r5 + adds r1, r0 + ldrb r1, [r1] + adds r2, r0, 0 + cmp r1, 0xFF + beq _081AA5D6 + cmp r6, 0x3 + ble _081AA5D8 +_081AA5D6: + movs r6, 0 +_081AA5D8: + adds r7, 0x2 + asrs r0, r7, 1 + cmp r0, 0x4 + bne _081AA5A8 +_081AA5E0: + str r4, [sp, 0xC] + b _081AA600 + .pool +_081AA5E8: + adds r6, 0x1 + adds r0, r6, r4 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081AA5F8 + cmp r6, 0x3 + ble _081AA5FA +_081AA5F8: + movs r6, 0 +_081AA5FA: + ldr r1, [sp, 0xC] + adds r1, 0x1 + str r1, [sp, 0xC] +_081AA600: + asrs r0, r7, 1 + cmp r0, 0x4 + beq _081AA622 + movs r0, 0x1 + ands r7, r0 + ldr r2, [sp, 0x1C] + adds r2, 0x1 + str r2, [sp, 0x1C] + movs r3, 0x80 + lsls r3, 17 + add r9, r3 + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x8] + ldr r1, [sp, 0x10] + cmp r0, r1 + blt _081AA548 +_081AA622: + movs r1, 0 + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x18] + subs r0, r2, r3 + asrs r0, 1 + ldr r2, [sp, 0xC] + cmp r0, r2 + ble _081AA634 + movs r1, 0x1 +_081AA634: + adds r0, r1, 0 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AA4D8 + + thumb_func_start sub_81AA648 +sub_81AA648: @ 81AA648 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r6, r1, 24 + movs r4, 0 + movs r7, 0 + movs r0, 0 + mov r8, r0 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x10 + bl AllocZeroed + str r0, [sp, 0x8] + bl sub_81AA96C + ldr r1, [sp] + cmp r1, 0 + bne _081AA694 + ldr r1, =gUnknown_08613650 + lsls r0, r5, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + mov r10, r0 + movs r0, 0 + b _081AA6A0 + .pool +_081AA694: + ldr r1, =gUnknown_08613650 + lsls r0, r5, 4 + adds r0, r1 + ldrb r2, [r0] + mov r10, r2 + ldrb r0, [r0, 0x1] +_081AA6A0: + movs r3, 0 + str r3, [sp, 0x4] + mov r1, r10 + asrs r1, 31 + str r1, [sp, 0xC] + cmp r3, r10 + bge _081AA73E + ldr r2, =gUnknown_08613F46 + mov r9, r2 + lsls r5, r6, 2 + lsls r6, r0, 24 +_081AA6B6: + adds r0, r4, r5 + add r0, r9 + ldrb r2, [r0] + lsrs r3, r6, 24 + ldr r0, [sp] + ldr r1, [sp, 0x8] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA714 + adds r7, 0x1 + b _081AA6EE + .pool +_081AA6D8: + adds r0, r4, r5 + adds r0, r1 + ldrb r2, [r0] + lsrs r3, r6, 24 + ldr r0, [sp] + ldr r1, [sp, 0x8] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA728 +_081AA6EE: + adds r4, 0x1 + adds r0, r4, r5 + add r0, r9 + ldrb r0, [r0] + ldr r1, =gUnknown_08613F46 + cmp r0, 0xFF + beq _081AA700 + cmp r4, 0x3 + ble _081AA702 +_081AA700: + movs r4, 0 +_081AA702: + movs r3, 0x1 + add r8, r3 + mov r0, r8 + cmp r0, 0x4 + bne _081AA6D8 + b _081AA728 + .pool +_081AA714: + adds r4, 0x1 + adds r0, r4, r5 + add r0, r9 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081AA724 + cmp r4, 0x3 + ble _081AA726 +_081AA724: + movs r4, 0 +_081AA726: + adds r7, 0x1 +_081AA728: + mov r1, r8 + cmp r1, 0x4 + beq _081AA73E + movs r2, 0x80 + lsls r2, 17 + adds r6, r2 + ldr r3, [sp, 0x4] + adds r3, 0x1 + str r3, [sp, 0x4] + cmp r3, r10 + blt _081AA6B6 +_081AA73E: + movs r1, 0 + mov r2, r10 + ldr r3, [sp, 0xC] + subs r0, r2, r3 + asrs r0, 1 + cmp r0, r7 + ble _081AA74E + movs r1, 0x1 +_081AA74E: + adds r0, r1, 0 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AA648 + + thumb_func_start sub_81AA760 +sub_81AA760: @ 81AA760 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r10, r1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r7, r3, 24 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e22 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AA7D0 + movs r6, 0x7 +_081AA792: + movs r4, 0x7 + lsls r5, r6, 24 +_081AA796: + lsls r1, r4, 24 + lsrs r1, 24 + mov r0, r8 + str r0, [sp] + str r7, [sp, 0x4] + mov r0, r9 + lsrs r2, r5, 24 + mov r3, r10 + bl sub_81AA810 + lsls r0, 24 + cmp r0, 0 + beq _081AA7CC + subs r4, 0x1 + cmp r4, 0 + bge _081AA796 + subs r6, 0x1 + movs r1, 0x1 + negs r1, r1 + cmp r6, r1 + bgt _081AA792 + b _081AA7FC + .pool +_081AA7CC: + movs r0, 0 + b _081AA7FE +_081AA7D0: + movs r6, 0 +_081AA7D2: + movs r4, 0 + lsls r5, r6, 24 +_081AA7D6: + lsls r1, r4, 24 + lsrs r1, 24 + mov r0, r8 + str r0, [sp] + str r7, [sp, 0x4] + mov r0, r9 + lsrs r2, r5, 24 + mov r3, r10 + bl sub_81AA810 + lsls r0, 24 + cmp r0, 0 + beq _081AA7CC + adds r4, 0x1 + cmp r4, 0x7 + ble _081AA7D6 + adds r6, 0x1 + cmp r6, 0x7 + ble _081AA7D2 +_081AA7FC: + movs r0, 0x1 +_081AA7FE: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AA760 + + thumb_func_start sub_81AA810 +sub_81AA810: @ 81AA810 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r4, [sp, 0x34] + ldr r5, [sp, 0x38] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + lsls r5, 24 + lsrs r6, r5, 24 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0, r1 + str r1, [sp, 0x8] + add r3, r10 + ldrb r1, [r3] + adds r1, 0x2C + movs r0, 0x19 + bl get_mapheader_by_bank_and_number + adds r5, r0, 0 + movs r7, 0 + ldr r1, [r5, 0x4] + ldrb r2, [r1] + cmp r7, r2 + bge _081AA95A + movs r0, 0x3 + ands r0, r4 + lsls r0, 3 + str r0, [sp, 0xC] +_081AA868: + ldr r1, [r1, 0x4] + lsls r2, r7, 1 + adds r0, r2, r7 + lsls r0, 3 + adds r3, r0, r1 + movs r4, 0x4 + ldrsh r0, [r3, r4] + ldr r1, [r5, 0x4] + mov r12, r1 + mov r9, r2 + ldr r2, [sp, 0x4] + cmp r0, r2 + bne _081AA950 + movs r4, 0x6 + ldrsh r0, [r3, r4] + cmp r0, r8 + bne _081AA950 + ldr r0, [sp] + cmp r0, 0 + bne _081AA896 + ldrb r0, [r3, 0x1] + cmp r0, 0x3B + bne _081AA8A2 +_081AA896: + ldr r1, [sp] + cmp r1, 0x1 + bne _081AA950 + ldrb r0, [r3, 0x1] + cmp r0, 0x3B + bne _081AA950 +_081AA8A2: + movs r3, 0 + ldr r2, [r5, 0x4] + mov r12, r2 + cmp r3, r6 + bge _081AA8DC + ldr r4, [sp, 0x4] + ldr r0, [sp, 0xC] + adds r4, r0 + str r4, [sp, 0x10] + mov r1, r10 + lsrs r0, r1, 2 + lsls r0, 3 + mov r2, r8 + adds r1, r2, r0 + ldr r2, [sp, 0x8] + adds r2, 0x4 +_081AA8C2: + movs r4, 0 + ldrsh r0, [r2, r4] + ldr r4, [sp, 0x10] + cmp r0, r4 + bne _081AA8D4 + movs r4, 0x2 + ldrsh r0, [r2, r4] + cmp r0, r1 + beq _081AA8DC +_081AA8D4: + adds r2, 0x18 + adds r3, 0x1 + cmp r3, r6 + blt _081AA8C2 +_081AA8DC: + cmp r3, r6 + bne _081AA950 + lsls r0, r6, 1 + mov r8, r0 + adds r0, r6 + lsls r0, 3 + ldr r1, [sp, 0x8] + adds r5, r0, r1 + mov r3, r12 + ldr r2, [r3, 0x4] + mov r4, r9 + adds r1, r4, r7 + lsls r1, 3 + adds r0, r5, 0 + adds r1, r2 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldrh r0, [r5, 0x4] + ldr r1, [sp, 0xC] + adds r0, r1 + strh r0, [r5, 0x4] + mov r2, r10 + lsrs r0, r2, 2 + lsls r0, 3 + ldrh r3, [r5, 0x6] + adds r0, r3 + strh r0, [r5, 0x6] + adds r0, r6, 0x1 + strb r0, [r5] + ldrb r0, [r5, 0x1] + cmp r0, 0x3B + beq _081AA940 + adds r0, r6, 0 + bl sub_81A9F90 + lsls r0, 16 + lsrs r7, r0, 16 + adds r4, r7, 0 + adds r0, r4, 0 + bl sub_81627A4 + strb r0, [r5, 0x1] + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb4 + adds r0, r1 + add r0, r8 + strh r4, [r0] +_081AA940: + movs r0, 0 + b _081AA95C + .pool +_081AA950: + adds r7, 0x1 + mov r1, r12 + ldrb r2, [r1] + cmp r7, r2 + blt _081AA868 +_081AA95A: + movs r0, 0x1 +_081AA95C: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AA810 + + thumb_func_start sub_81AA96C +sub_81AA96C: @ 81AA96C + push {r4-r7,lr} + adds r6, r0, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e22 + adds r1, r0, r2 + ldrh r4, [r1] + ldr r1, =0x00000e24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + orrs r4, r0 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + ldr r2, =gUnknown_08613655 + mov r12, r2 + movs r7, 0x7 +_081AA994: + adds r2, r6, r3 + adds r0, r4, 0 + ands r0, r7 + lsls r1, r5, 4 + adds r0, r1 + add r0, r12 + ldrb r0, [r0] + strb r0, [r2] + asrs r4, 3 + cmp r3, 0x7 + bne _081AA9C0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000e26 + adds r0, r1, r2 + ldrh r4, [r0] + ldr r0, =0x00000e28 + adds r1, r0 + ldrh r0, [r1] + lsls r0, 16 + orrs r4, r0 + asrs r4, 8 +_081AA9C0: + adds r3, 0x1 + cmp r3, 0xF + ble _081AA994 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AA96C + + thumb_func_start sub_81AA9E4 +sub_81AA9E4: @ 81AA9E4 + push {r4,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r1, =0x00000e28 + adds r0, r4, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x00000cb2 + adds r4, r0 + ldrh r0, [r4] + ldr r1, =gUnknown_08613794 + adds r0, r1 + ldrb r2, [r0] + cmp r2, 0x21 + bhi _081AAA38 + ldr r1, =gUnknown_08613750 + lsls r0, r2, 1 + adds r0, r1 +_081AAA10: + ldrb r1, [r0] + cmp r3, r1 + bge _081AAA30 + ldrb r0, [r0, 0x1] + b _081AAA3A + .pool +_081AAA30: + adds r0, 0x2 + adds r2, 0x1 + cmp r2, 0x21 + bls _081AAA10 +_081AAA38: + movs r0, 0 +_081AAA3A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81AA9E4 + + thumb_func_start sub_81AAA40 +sub_81AAA40: @ 81AAA40 + push {lr} + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r2, r0, r1 + movs r1, 0 + movs r3, 0xC7 + lsls r3, 4 + adds r0, r3 + b _081AAA6E + .pool +_081AAA5C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bhi _081AAA74 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r2 +_081AAA6E: + ldrb r0, [r0] + cmp r0, 0 + bne _081AAA5C +_081AAA74: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_81AAA40 + + thumb_func_start sub_81AAA7C +sub_81AAA7C: @ 81AAA7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + ldr r1, =gSaveBlock2Ptr + mov r8, r1 + lsls r1, r0, 2 + adds r1, r0 + movs r0, 0 + mov r12, r0 + lsls r4, r1, 1 + ldr r7, =0x00000e2c + movs r6, 0 + ldr r5, =0x00000e54 + lsls r2, r1, 2 +_081AAA9E: + mov r1, r8 + ldr r0, [r1] + adds r1, r0, r7 + adds r1, r2 + strh r6, [r1] + adds r1, r3, r4 + adds r0, r5 + adds r0, r1 + mov r1, r12 + strb r1, [r0] + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x9 + ble _081AAA9E + movs r0, 0x15 + movs r1, 0x1 + bl AddPyramidBagItem + movs r0, 0x22 + movs r1, 0x1 + bl AddPyramidBagItem + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAA7C + + thumb_func_start CalculateBattlePyramidPickupItemId +CalculateBattlePyramidPickupItemId: @ 81AAAE0 + push {r4-r6,lr} + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + lsls r0, r6, 1 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + ble _081AAB0A + movs r4, 0x13 +_081AAB0A: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + ldr r3, =gUnknown_08613F86 + ldrb r0, [r3] + lsls r5, r4, 2 + cmp r0, r2 + bgt _081AAB36 +_081AAB28: + adds r1, 0x1 + cmp r1, 0x9 + bhi _081AAB3A + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + ble _081AAB28 +_081AAB36: + cmp r1, 0x9 + bls _081AAB3C +_081AAB3A: + movs r1, 0x9 +_081AAB3C: + cmp r6, 0 + bne _081AAB58 + ldr r2, =gUnknown_0861379C + b _081AAB5A + .pool +_081AAB58: + ldr r2, =gUnknown_0861392C +_081AAB5A: + lsls r1, 1 + adds r0, r5, r4 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end CalculateBattlePyramidPickupItemId + + thumb_func_start ResetBagScrollPositions +ResetBagScrollPositions: @ 81AAB70 + push {r4,lr} + ldr r4, =gUnknown_0203CE58 + movs r0, 0 + strb r0, [r4, 0x5] + adds r0, r4, 0 + adds r0, 0x8 + movs r1, 0 + movs r2, 0xA + bl memset + adds r4, 0x12 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0xA + bl memset + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ResetBagScrollPositions + + thumb_func_start CB2_BagMenuFromStartMenu +@ void CB2_BagMenuFromStartMenu() +CB2_BagMenuFromStartMenu: @ 81AAB9C + push {lr} + ldr r2, =sub_8086194 + movs r0, 0 + movs r1, 0x5 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end CB2_BagMenuFromStartMenu + + thumb_func_start sub_81AABB0 +sub_81AABB0: @ 81AABB0 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _081AABCC + ldr r2, =sub_8059D50 + movs r0, 0x1 + movs r1, 0x5 + bl GoToBagMenu + b _081AABD4 + .pool +_081AABCC: + ldr r1, =sub_8059D50 + movs r0, 0x1 + bl sub_81C4F98 +_081AABD4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AABB0 + + thumb_func_start CB2_ChooseBerry +CB2_ChooseBerry: @ 81AABDC + push {lr} + ldr r2, =sub_80861B0 + movs r0, 0x4 + movs r1, 0x3 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end CB2_ChooseBerry + + thumb_func_start sub_81AABF0 +sub_81AABF0: @ 81AABF0 + push {lr} + adds r2, r0, 0 + movs r0, 0x5 + movs r1, 0x3 + bl GoToBagMenu + pop {r0} + bx r0 + thumb_func_end sub_81AABF0 + + thumb_func_start CB2_GoToSellMenu +@ void CB2_GoToSellMenu() +CB2_GoToSellMenu: @ 81AAC00 + push {lr} + ldr r2, =CB2_ExitSellMenu + movs r0, 0x3 + movs r1, 0x5 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end CB2_GoToSellMenu + + thumb_func_start sub_81AAC14 +sub_81AAC14: @ 81AAC14 + push {lr} + ldr r2, =sub_816B31C + movs r0, 0x6 + movs r1, 0x5 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAC14 + + thumb_func_start sub_81AAC28 +sub_81AAC28: @ 81AAC28 + push {lr} + ldr r2, =bag_menu_leave_maybe_3 + movs r0, 0x9 + movs r1, 0x5 + bl GoToBagMenu + ldr r0, =gSpecialVar_0x8005 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAC28 + + thumb_func_start sub_81AAC50 +sub_81AAC50: @ 81AAC50 + push {lr} + ldr r2, =bag_menu_leave_maybe_2 + movs r0, 0x7 + movs r1, 0x5 + bl GoToBagMenu + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAC50 + + thumb_func_start sub_81AAC70 +sub_81AAC70: @ 81AAC70 + push {lr} + ldr r2, =bag_menu_leave_maybe + movs r0, 0x8 + movs r1, 0x5 + bl GoToBagMenu + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAC70 + + thumb_func_start GoToBagMenu +@ void GoToBagMenu(u8 bagMenuType, u8 pocketId, void ( *postExitMenuMainCallback2)()) +GoToBagMenu: @ 81AAC90 + push {r4-r7,lr} + adds r4, r2, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r6, =gUnknown_0203CE54 + ldr r0, =0x00000c48 + bl AllocZeroed + str r0, [r6] + cmp r0, 0 + bne _081AACBC + adds r0, r4, 0 + bl SetMainCallback2 + b _081AAD3A + .pool +_081AACBC: + ldr r0, =gUnknown_0203CE58 + cmp r5, 0xC + beq _081AACC4 + strb r5, [r0, 0x4] +_081AACC4: + cmp r4, 0 + beq _081AACCA + str r4, [r0] +_081AACCA: + cmp r7, 0x4 + bhi _081AACD0 + strb r7, [r0, 0x5] +_081AACD0: + ldrb r0, [r0, 0x4] + subs r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081AACF0 + ldr r2, [r6] + ldr r0, =0x0000081b + adds r2, r0 + ldrb r1, [r2] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_081AACF0: + ldr r0, [r6] + movs r1, 0 + str r1, [r0] + ldr r1, =0x0000081a + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x0000081e + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x0000081f + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x00000804 + adds r0, r1 + movs r1, 0xFF + movs r2, 0xC + bl memset + ldr r0, [r6] + movs r1, 0x81 + lsls r1, 4 + adds r0, r1 + movs r1, 0xFF + movs r2, 0xA + bl memset + ldr r0, =CB2_Bag + bl SetMainCallback2 +_081AAD3A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end GoToBagMenu + + thumb_func_start c2_bag_3 +c2_bag_3: @ 81AAD5C + push {lr} + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl do_scheduled_bg_tilemap_copies_to_vram + bl UpdatePaletteFade + pop {r0} + bx r0 + thumb_func_end c2_bag_3 + + thumb_func_start vblank_cb_bag_menu +vblank_cb_bag_menu: @ 81AAD78 + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end vblank_cb_bag_menu + + thumb_func_start CB2_Bag +CB2_Bag: @ 81AAD8C + push {lr} +_081AAD8E: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AADB2 + bl setup_bag_menu + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AADB2 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AAD8E +_081AADB2: + pop {r0} + bx r0 + thumb_func_end CB2_Bag + + thumb_func_start setup_bag_menu +setup_bag_menu: @ 81AADB8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x14 + bls _081AADCE + b _081AB02C +_081AADCE: + lsls r0, 2 + ldr r1, =_081AADE0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AADE0: + .4byte _081AAE34 + .4byte _081AAE3E + .4byte _081AAE50 + .4byte _081AAE56 + .4byte _081AAE78 + .4byte _081AAE7E + .4byte _081AAE86 + .4byte _081AAEA4 + .4byte _081AAECC + .4byte _081AAEDA + .4byte _081AAEEC + .4byte _081AAEFA + .4byte _081AAF0C + .4byte _081AAF1C + .4byte _081AAF54 + .4byte _081AAFA0 + .4byte _081AAFBC + .4byte _081AAFC2 + .4byte _081AAFD8 + .4byte _081AAFDE + .4byte _081AAFF8 +_081AAE34: + bl SetVBlankHBlankCallbacksToNull + bl clear_scheduled_bg_copies_to_vram + b _081AB012 +_081AAE3E: + bl remove_some_task + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAE50: + bl FreeAllSpritePalettes + b _081AB012 +_081AAE56: + bl ResetPaletteFade + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAE78: + bl ResetSpriteData + b _081AB012 +_081AAE7E: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _081AB01A +_081AAE86: + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081AAE94 + bl ResetTasks +_081AAE94: + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAEA4: + bl bag_menu_init_bgs + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000834 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAECC: + bl load_bag_menu_graphics + lsls r0, 24 + cmp r0, 0 + bne _081AAED8 + b _081AB044 +_081AAED8: + b _081AB012 +_081AAEDA: + bl setup_bag_menu_textboxes + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAEEC: + bl sub_81ABA6C + bl sub_81ABAC4 + bl sub_81ABAE0 + b _081AB012 +_081AAEFA: + bl allocate_bag_item_list_buffers + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAF0C: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + bl load_bag_item_list_buffers + b _081AB012 + .pool +_081AAF1C: + ldr r1, =gUnknown_085E91FC + ldr r4, =gUnknown_0203CE58 + ldrb r0, [r4, 0x5] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl bag_menu_print_pocket_names + movs r0, 0 + bl bag_menu_copy_pocket_name_to_window + ldrb r0, [r4, 0x5] + movs r1, 0x1 + bl bag_menu_draw_pocket_indicator_square + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAF54: + ldr r4, =gUnknown_0203CE58 + ldrb r0, [r4, 0x4] + bl sub_81AB1F0 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_03006310 + ldrb r2, [r4, 0x5] + lsls r2, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r2, r1 + ldrh r1, [r1] + adds r4, 0x8 + adds r2, r4 + ldrh r2, [r2] + bl ListMenuInit + ldr r2, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + strh r0, [r1, 0x8] + strh r2, [r1, 0xE] + strh r2, [r1, 0x18] + b _081AB012 + .pool +_081AAFA0: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + bl AddBagVisualObject + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAFBC: + bl sub_80D4FAC + b _081AB012 +_081AAFC2: + bl bag_menu_add_pocket_scroll_arrow_indicators_maybe + bl bag_menu_add_list_scroll_arrow_indicators_maybe + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAFD8: + bl bag_menu_prepare_tmhm_move_window + b _081AB012 +_081AAFDE: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAFF8: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r2, =gPaletteFade + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] +_081AB012: + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_081AB01A: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081AB044 + .pool +_081AB02C: + ldr r0, =vblank_cb_bag_menu + bl SetVBlankCallback + ldr r0, =c2_bag_3 + bl SetMainCallback2 + movs r0, 0x1 + b _081AB046 + .pool +_081AB044: + movs r0, 0 +_081AB046: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end setup_bag_menu + + thumb_func_start bag_menu_init_bgs +bag_menu_init_bgs: @ 81AB050 + push {r4,lr} + bl sub_8121DA0 + ldr r4, =gUnknown_0203CE54 + ldr r0, [r4] + adds r0, 0x4 + movs r2, 0x80 + lsls r2, 4 + movs r1, 0 + bl memset + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08613F90 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0x2 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_init_bgs + + thumb_func_start load_bag_menu_graphics +load_bag_menu_graphics: @ 81AB0BC + push {r4,lr} + sub sp, 0x4 + ldr r4, =gUnknown_0203CE54 + ldr r0, [r4] + ldr r1, =0x00000834 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bls _081AB0D2 + b _081AB1CC +_081AB0D2: + lsls r0, 2 + ldr r1, =_081AB0E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AB0E8: + .4byte _081AB0FC + .4byte _081AB118 + .4byte _081AB13C + .4byte _081AB174 + .4byte _081AB1A8 +_081AB0FC: + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08D9A620 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _081AB1AE + .pool +_081AB118: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AB1E4 + ldr r0, =gUnknown_08D9A88C + ldr r4, =gUnknown_0203CE54 + ldr r1, [r4] + adds r1, 0x4 + bl LZDecompressWram + ldr r1, [r4] + b _081AB1B2 + .pool +_081AB13C: + bl IsWallysBag + lsls r0, 24 + cmp r0, 0 + bne _081AB164 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _081AB164 + ldr r0, =gUnknown_08D9A5D4 + movs r1, 0 + movs r2, 0x40 + bl LoadCompressedPalette + b _081AB1AE + .pool +_081AB164: + ldr r0, =gUnknown_08D9A588 + movs r1, 0 + movs r2, 0x40 + bl LoadCompressedPalette + b _081AB1AE + .pool +_081AB174: + bl IsWallysBag + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AB18A + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _081AB19C +_081AB18A: + ldr r0, =gUnknown_0857FB34 + bl LoadCompressedObjectPic + b _081AB1AE + .pool +_081AB19C: + ldr r0, =gUnknown_0857FB3C + bl LoadCompressedObjectPic + b _081AB1AE + .pool +_081AB1A8: + ldr r0, =gUnknown_0857FB44 + bl LoadCompressedObjectPalette +_081AB1AE: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] +_081AB1B2: + ldr r0, =0x00000834 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081AB1E4 + .pool +_081AB1CC: + bl sub_8122328 + ldr r0, [r4] + ldr r1, =0x00000834 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _081AB1E6 + .pool +_081AB1E4: + movs r0, 0 +_081AB1E6: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end load_bag_menu_graphics + + thumb_func_start sub_81AB1F0 +sub_81AB1F0: @ 81AB1F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA + bne _081AB204 + ldr r0, =Task_WallyTutorialBagMenu + b _081AB206 + .pool +_081AB204: + ldr r0, =Task_BagMenu +_081AB206: + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81AB1F0 + + thumb_func_start allocate_bag_item_list_buffers +allocate_bag_item_list_buffers: @ 81AB218 + push {r4,lr} + ldr r4, =gUnknown_0203CE74 + movs r0, 0x82 + lsls r0, 2 + bl Alloc + str r0, [r4] + ldr r4, =gUnknown_0203CE78 + movs r0, 0xC3 + lsls r0, 3 + bl Alloc + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end allocate_bag_item_list_buffers + + thumb_func_start load_bag_item_list_buffers +@ void load_bag_item_list_buffers(int pocket_id) +load_bag_item_list_buffers: @ 81AB240 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, r7, 3 + ldr r0, =gBagPockets + adds r1, r0 + mov r8, r1 + ldr r0, =gUnknown_0203CE54 + ldr r2, [r0] + ldr r1, =0x0000081b + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081AB2FC + movs r6, 0 + ldr r3, =0x00000829 + adds r0, r2, r3 + adds r0, r7 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + bge _081AB2B6 + ldr r5, =gUnknown_0203CE78 +_081AB276: + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r0, [r5] + adds r0, r4 + mov r1, r8 + ldr r2, [r1] + lsls r1, r6, 2 + adds r1, r2 + ldrh r1, [r1] + bl get_name + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r5] + adds r0, r4 + str r0, [r1] + str r6, [r1, 0x4] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r3, =0x00000829 + adds r0, r3 + adds r0, r7 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + blt _081AB276 +_081AB2B6: + ldr r5, =gUnknown_0203CE78 + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r0, [r5] + adds r0, r4 + ldr r1, =gUnknown_085E8DB4 + bl StringCopy + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r5] + adds r0, r4 + str r0, [r1] + movs r0, 0x2 + negs r0, r0 + str r0, [r1, 0x4] + b _081AB34A + .pool +_081AB2FC: + movs r6, 0 + ldr r4, =0x00000829 + adds r0, r2, r4 + adds r0, r7 + ldrb r0, [r0] + cmp r6, r0 + bcs _081AB34A + ldr r5, =gUnknown_0203CE78 +_081AB30C: + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r0, [r5] + adds r0, r4 + mov r1, r8 + ldr r2, [r1] + lsls r1, r6, 2 + adds r1, r2 + ldrh r1, [r1] + bl get_name + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r5] + adds r0, r4 + str r0, [r1] + str r6, [r1, 0x4] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r3, =0x00000829 + adds r0, r3 + adds r0, r7 + ldrb r0, [r0] + cmp r6, r0 + bcc _081AB30C +_081AB34A: + ldr r2, =gUnknown_03006310 + adds r1, r2, 0 + ldr r0, =gUnknown_08613F9C + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + ldr r4, =0x00000829 + adds r0, r1, r4 + adds r0, r7 + ldrb r0, [r0] + strh r0, [r2, 0xC] + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + str r0, [r2] + ldr r5, =0x0000082e + adds r1, r5 + adds r1, r7 + ldrb r0, [r1] + strh r0, [r2, 0xE] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end load_bag_item_list_buffers + + thumb_func_start get_name +@ void get_name(char *dest, int name_id) +get_name: @ 81AB39C + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x2 + beq _081AB3C0 + cmp r0, 0x3 + beq _081AB420 + adds r0, r5, 0 + adds r1, r6, 0 + bl CopyItemName + b _081AB43E + .pool +_081AB3C0: + ldr r4, =gStringVar2 + adds r0, r5, 0 + bl ItemIdToBattleMoveId + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0xA9 + lsls r0, 1 + cmp r5, r0 + bls _081AB408 + ldr r0, =gStringVar1 + ldr r2, =0xfffffeae + adds r1, r5, r2 + movs r2, 0x2 + movs r3, 0x1 + bl ConvertIntToDecimalStringN + ldr r1, =gUnknown_085E921A + b _081AB438 + .pool +_081AB408: + ldr r0, =gStringVar1 + ldr r2, =0xfffffee0 + adds r1, r5, r2 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + b _081AB436 + .pool +_081AB420: + ldr r0, =gStringVar1 + adds r1, r5, 0 + subs r1, 0x84 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r1, =gStringVar2 + adds r0, r5, 0 + bl CopyItemName +_081AB436: + ldr r1, =gUnknown_085E9210 +_081AB438: + adds r0, r6, 0 + bl StringExpandPlaceholders +_081AB43E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end get_name + + thumb_func_start bag_menu_change_item_callback +bag_menu_change_item_callback: @ 81AB450 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _081AB466 + movs r0, 0x5 + bl PlaySE + bl ShakeBagVisual +_081AB466: + ldr r4, =gUnknown_0203CE54 + ldr r1, [r4] + ldr r2, =0x0000081a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081AB50C + adds r2, 0x1 + adds r0, r1, r2 + ldrb r1, [r0] + lsls r1, 26 + lsrs r1, 30 + movs r0, 0x1 + eors r0, r1 + bl RemoveBagItemIconObject + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _081AB4C8 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r6, 16 + lsrs r1, 16 + bl BagGetItemIdByPocketPosition + lsls r0, 16 + lsrs r0, 16 + ldr r1, [r4] + ldr r2, =0x0000081b + adds r1, r2 + ldrb r1, [r1] + lsls r1, 26 + lsrs r1, 30 + bl AddBagItemIconObject + b _081AB4DA + .pool +_081AB4C8: + ldr r0, =0x0000ffff + ldr r1, [r4] + ldr r2, =0x0000081b + adds r1, r2 + ldrb r1, [r1] + lsls r1, 26 + lsrs r1, 30 + bl AddBagItemIconObject +_081AB4DA: + ldr r5, =gUnknown_0203CE54 + ldr r2, [r5] + ldr r4, =0x0000081b + adds r2, r4 + ldrb r3, [r2] + lsls r0, r3, 26 + lsrs r0, 30 + movs r1, 0x1 + eors r1, r0 + lsls r1, 4 + movs r0, 0x31 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _081AB50C + adds r0, r6, 0 + bl bag_menu_print_description_box_text +_081AB50C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_change_item_callback + + thumb_func_start sub_81AB520 +@ void sub_81AB520(u8 rbox_id, int item_index_in_pocket, int a3) +sub_81AB520: @ 81AB520 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r2, 24 + lsrs r7, r2, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + bne _081AB540 + b _081AB696 +_081AB540: + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x0000081a + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0xFF + beq _081AB570 + lsls r0, r4, 24 + lsrs r0, 24 + cmp r1, r0 + bne _081AB568 + adds r0, r7, 0 + movs r1, 0x2 + bl bag_menu_print_cursor + b _081AB570 + .pool +_081AB568: + adds r0, r7, 0 + movs r1, 0xFF + bl bag_menu_print_cursor +_081AB570: + ldr r5, =gUnknown_0203CE58 + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + adds r1, r4, 0 + bl BagGetItemIdByPocketPosition + lsls r0, 16 + lsrs r6, r0, 16 + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl BagGetQuantityByPocketPosition + lsls r0, 16 + lsrs r4, r0, 16 + mov r9, r4 + ldr r1, =0xfffffead + adds r0, r6, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7 + bhi _081AB5BE + ldr r1, =gUnknown_08DC6378 + subs r3, r7, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x10 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r8 + movs r2, 0x8 + bl BlitBitmapToWindow +_081AB5BE: + ldrb r0, [r5, 0x5] + cmp r0, 0x3 + bne _081AB610 + ldr r0, =gStringVar1 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x77 + bl GetStringRightAlignXOffset + lsls r3, r0, 24 + lsrs r3, 24 + str r7, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + str r1, [sp, 0x10] + b _081AB652 + .pool +_081AB610: + cmp r0, 0x4 + beq _081AB66C + adds r0, r6, 0 + bl itemid_is_unique + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081AB66C + ldr r0, =gStringVar1 + mov r1, r9 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x77 + bl GetStringRightAlignXOffset + lsls r3, r0, 24 + lsrs r3, 24 + str r7, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + str r5, [sp, 0x10] +_081AB652: + mov r0, r8 + movs r1, 0x7 + adds r2, r4, 0 + bl bag_menu_print + b _081AB696 + .pool +_081AB66C: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00000496 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _081AB696 + cmp r0, r6 + bne _081AB696 + ldr r1, =gUnknown_086140A4 + subs r3, r7, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x18 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + mov r0, r8 + movs r2, 0x60 + bl BlitBitmapToWindow +_081AB696: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AB520 + + thumb_func_start bag_menu_print_description_box_text +@ void bag_menu_print_description_box_text(int a1) +bag_menu_print_description_box_text: @ 81AB6B0 + push {r4,lr} + sub sp, 0x14 + adds r1, r0, 0 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081AB6E0 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + bl BagGetItemIdByPocketPosition + lsls r0, 16 + lsrs r0, 16 + bl ItemId_GetDescription + adds r4, r0, 0 + b _081AB6FC + .pool +_081AB6E0: + ldr r0, =gStringVar1 + ldr r2, =gUnknown_085E9180 + ldr r1, =gUnknown_0203CE58 + ldrb r1, [r1, 0x4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E91C0 + adds r0, r4, 0 + bl StringExpandPlaceholders +_081AB6FC: + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_description_box_text + + thumb_func_start bag_menu_print_cursor_ +bag_menu_print_cursor_: @ 81AB73C + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + bl ListMenuGetYCoordForPrintingArrowCursor + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl bag_menu_print_cursor + pop {r4} + pop {r0} + bx r0 + thumb_func_end bag_menu_print_cursor_ + + thumb_func_start bag_menu_print_cursor +bag_menu_print_cursor: @ 81AB75C + push {r4,r5,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0xFF + bne _081AB798 + movs r0, 0x1 + movs r1, 0 + bl GetMenuCursorDimensionByFont + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + str r4, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + adds r3, r5, 0 + bl FillWindowPixelRect + b _081AB7AE +_081AB798: + ldr r2, =gUnknown_085E8D60 + str r5, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + movs r3, 0 + bl bag_menu_print +_081AB7AE: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_cursor + + thumb_func_start bag_menu_add_pocket_scroll_arrow_indicators_maybe +bag_menu_add_pocket_scroll_arrow_indicators_maybe: @ 81AB7BC + push {r4-r6,lr} + sub sp, 0x10 + ldr r5, =gUnknown_0203CE54 + ldr r4, [r5] + ldr r1, =0x0000081e + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081AB80A + ldr r2, =gUnknown_0203CE58 + ldrb r3, [r2, 0x5] + ldr r6, =0x00000829 + adds r0, r4, r6 + adds r0, r3 + ldrb r1, [r0] + adds r6, 0x5 + adds r0, r4, r6 + adds r0, r3 + ldrb r0, [r0] + subs r1, r0 + str r1, [sp] + movs r0, 0x6E + str r0, [sp, 0x4] + str r0, [sp, 0x8] + ldrb r0, [r2, 0x5] + lsls r0, 1 + adds r2, 0x12 + adds r0, r2 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xAC + movs r2, 0xC + movs r3, 0x94 + bl AddScrollIndicatorArrowPairParametrized + ldr r1, [r5] + ldr r2, =0x0000081e + adds r1, r2 + strb r0, [r1] +_081AB80A: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_add_pocket_scroll_arrow_indicators_maybe + + thumb_func_start sub_81AB824 +sub_81AB824: @ 81AB824 + push {r4,lr} + ldr r4, =gUnknown_0203CE54 + ldr r0, [r4] + ldr r2, =0x0000081e + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081AB842 + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r1, =0x0000081e + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_081AB842: + bl sub_81AB89C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AB824 + + thumb_func_start bag_menu_add_list_scroll_arrow_indicators_maybe +bag_menu_add_list_scroll_arrow_indicators_maybe: @ 81AB854 + push {r4,lr} + ldr r4, =gUnknown_0203CE54 + ldr r2, [r4] + ldr r1, =0x0000081b + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + beq _081AB882 + ldr r1, =0x0000081f + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081AB882 + ldr r0, =gUnknown_08614094 + ldr r1, =gUnknown_0203CE5E + bl AddScrollIndicatorArrowPair + ldr r1, [r4] + ldr r2, =0x0000081f + adds r1, r2 + strb r0, [r1] +_081AB882: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_add_list_scroll_arrow_indicators_maybe + + thumb_func_start sub_81AB89C +sub_81AB89C: @ 81AB89C + push {r4,lr} + ldr r4, =gUnknown_0203CE54 + ldr r0, [r4] + ldr r2, =0x0000081f + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081AB8BA + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r1, =0x0000081f + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_081AB8BA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AB89C + + thumb_func_start free_bag_item_list_buffers +free_bag_item_list_buffers: @ 81AB8C8 + push {lr} + ldr r0, =gUnknown_0203CE78 + ldr r0, [r0] + bl Free + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + bl Free + pop {r0} + bx r0 + .pool + thumb_func_end free_bag_item_list_buffers + + thumb_func_start unknown_ItemMenu_Confirm +unknown_ItemMenu_Confirm: @ 81AB8F8 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_close_bag_menu_2 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_ItemMenu_Confirm + + thumb_func_start task_close_bag_menu_2 +task_close_bag_menu_2: @ 81AB930 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r2, r0, r1 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081AB9A0 + ldrb r0, [r2] + ldr r4, =gUnknown_0203CE58 + ldrb r2, [r4, 0x5] + lsls r2, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r3, r4, 0 + adds r3, 0x8 + adds r2, r3 + bl sub_81AE6C8 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _081AB984 + bl SetMainCallback2 + b _081AB98A + .pool +_081AB984: + ldr r0, [r4] + bl SetMainCallback2 +_081AB98A: + bl sub_81AB824 + bl ResetSpriteData + bl FreeAllSpritePalettes + bl free_bag_item_list_buffers + adds r0, r5, 0 + bl DestroyTask +_081AB9A0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_close_bag_menu_2 + + thumb_func_start sub_81AB9A8 +sub_81AB9A8: @ 81AB9A8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, r5, 3 + ldr r0, =gBagPockets + adds r4, r1, r0 + cmp r5, 0x3 + bgt _081AB9C8 + cmp r5, 0x2 + blt _081AB9C8 + adds r0, r4, 0 + bl sub_80D6FB4 + b _081AB9CE + .pool +_081AB9C8: + adds r0, r4, 0 + bl sub_80D6F64 +_081AB9CE: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + ldr r6, =0x00000829 + adds r1, r6 + adds r1, r5 + movs r2, 0 + strb r2, [r1] + adds r3, r0, 0 + ldrb r0, [r4, 0x4] + cmp r2, r0 + bcs _081ABA12 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _081ABA12 + adds r7, r3, 0 +_081AB9EE: + ldr r0, [r7] + adds r0, r6 + adds r0, r5 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrb r1, [r4, 0x4] + cmp r2, r1 + bcs _081ABA12 + ldr r0, [r4] + lsls r1, r2, 2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _081AB9EE +_081ABA12: + ldr r2, [r3] + ldr r1, =0x0000081b + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081ABA2E + ldr r0, =0x00000829 + adds r1, r2, r0 + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081ABA2E: + ldr r1, [r3] + ldr r2, =0x00000829 + adds r0, r1, r2 + adds r0, r5 + ldrb r2, [r0] + cmp r2, 0x8 + bls _081ABA58 + ldr r3, =0x0000082e + adds r0, r1, r3 + adds r0, r5 + movs r1, 0x8 + strb r1, [r0] + b _081ABA60 + .pool +_081ABA58: + ldr r3, =0x0000082e + adds r0, r1, r3 + adds r0, r5 + strb r2, [r0] +_081ABA60: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AB9A8 + + thumb_func_start sub_81ABA6C +sub_81ABA6C: @ 81ABA6C + push {r4,lr} + movs r4, 0 +_081ABA70: + adds r0, r4, 0 + bl sub_81AB9A8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081ABA70 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81ABA6C + + thumb_func_start sub_81ABA88 +sub_81ABA88: @ 81ABA88 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + ldr r2, =gUnknown_0203CE6A + adds r4, r1, r2 + subs r2, 0xA + adds r1, r2 + ldr r2, =gUnknown_0203CE54 + ldr r3, [r2] + ldr r5, =0x0000082e + adds r2, r3, r5 + adds r2, r0 + ldrb r2, [r2] + subs r5, 0x5 + adds r3, r5 + adds r3, r0 + ldrb r3, [r3] + adds r0, r4, 0 + bl sub_812225C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ABA88 + + thumb_func_start sub_81ABAC4 +sub_81ABAC4: @ 81ABAC4 + push {r4,lr} + movs r4, 0 +_081ABAC8: + adds r0, r4, 0 + bl sub_81ABA88 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081ABAC8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81ABAC4 + + thumb_func_start sub_81ABAE0 +sub_81ABAE0: @ 81ABAE0 + push {r4-r7,lr} + sub sp, 0x4 + movs r5, 0 + ldr r6, =gUnknown_0203CE6A + adds r7, r6, 0 + subs r7, 0xA +_081ABAEC: + lsls r1, r5, 1 + adds r0, r1, r6 + adds r1, r7 + ldr r2, =gUnknown_0203CE54 + ldr r3, [r2] + ldr r4, =0x0000082e + adds r2, r3, r4 + adds r2, r5 + ldrb r2, [r2] + subs r4, 0x5 + adds r3, r4 + adds r3, r5 + ldrb r3, [r3] + movs r4, 0x8 + str r4, [sp] + bl sub_8122298 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _081ABAEC + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ABAE0 + + thumb_func_start sub_81ABB2C +sub_81ABB2C: @ 81ABB2C + lsls r0, 24 + ldr r1, =gUnknown_0203CE58 + lsrs r0, 23 + adds r2, r1, 0 + adds r2, 0x12 + adds r2, r0, r2 + adds r1, 0x8 + adds r0, r1 + ldrb r0, [r0] + ldrb r2, [r2] + adds r0, r2 + lsls r0, 24 + lsrs r0, 24 + bx lr + .pool + thumb_func_end sub_81ABB2C + + thumb_func_start DisplayItemMessage +@ void DisplayItemMessage(u8 taskId, u8 fontId, u8 *str, void ( *callback)(u8 taskId)) +DisplayItemMessage: @ 81ABB4C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + mov r9, r3 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + movs r0, 0x4 + bl AddItemMessageWindow + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + movs r1, 0x11 + bl FillWindowPixelBuffer + bl sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r4, 0x14] + str r6, [sp] + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + adds r0, r5, 0 + movs r2, 0xA + movs r3, 0xD + bl DisplayMessageAndContinueTask + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DisplayItemMessage + + thumb_func_start bag_menu_inits_lists_menu +bag_menu_inits_lists_menu: @ 81ABBBC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r5, r6, 2 + adds r5, r6 + lsls r5, 3 + ldr r0, =gTasks + 0x8 + adds r5, r0 + ldr r7, =gUnknown_0203CE58 + ldrb r4, [r7, 0x5] + lsls r4, 1 + movs r0, 0x12 + adds r0, r7 + mov r8, r0 + add r8, r4 + adds r0, r7, 0 + adds r0, 0x8 + adds r4, r0 + movs r0, 0x4 + bl bag_menu_RemoveBagItem_message_window + ldrb r0, [r5] + mov r1, r8 + adds r2, r4, 0 + bl sub_81AE6C8 + ldrb r0, [r7, 0x5] + bl sub_81AB9A8 + ldrb r0, [r7, 0x5] + bl sub_81ABA88 + ldrb r0, [r7, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + mov r2, r8 + ldrh r1, [r2] + ldrh r2, [r4] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl set_callback3_to_bag + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_inits_lists_menu + + thumb_func_start sub_81ABC3C +sub_81ABC3C: @ 81ABC3C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl bag_menu_add_window + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81ABC54 + pop {r0} + bx r0 + thumb_func_end sub_81ABC3C + + thumb_func_start sub_81ABC54 +sub_81ABC54: @ 81ABC54 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + movs r3, 0x2 + cmp r0, 0x3 + bne _081ABC6C + movs r3, 0x3 +_081ABC6C: + ldr r0, =gStringVar1 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x2 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x28 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl PrintTextOnWindow + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ABC54 + + thumb_func_start sub_81ABCC0 +sub_81ABCC0: @ 81ABCC0 + push {r4-r7,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r7, r2, 0 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + movs r3, 0x2 + cmp r0, 0x3 + bne _081ABCD4 + movs r3, 0x3 +_081ABCD4: + ldr r0, =gStringVar1 + movs r2, 0x2 + bl ConvertIntToDecimalStringN + ldr r6, =gStringVar4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r6, 0 + bl StringExpandPlaceholders + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r6, 0 + movs r3, 0 + bl PrintTextOnWindow + str r5, [sp] + adds r0, r4, 0 + movs r1, 0x26 + movs r2, 0x1 + adds r3, r7, 0 + bl PrintMoneyAmount + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ABCC0 + + thumb_func_start Task_BagMenu +Task_BagMenu: @ 81ABD28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + str r0, [sp] + ldr r1, =gTasks + 0x8 + adds r6, r0, r1 + ldr r5, =gUnknown_0203CE58 + ldrb r0, [r5, 0x5] + lsls r0, 1 + adds r1, r5, 0 + adds r1, 0x12 + adds r7, r0, r1 + subs r1, 0xA + adds r0, r1 + mov r8, r0 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ABD66 + b _081ABEB2 +_081ABD66: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081ABD74 + b _081ABEB2 +_081ABD74: + bl GetSwitchBagPocketDirection + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081ABDB8 + cmp r0, 0x2 + beq _081ABDC0 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + cmp r0, 0 + beq _081ABE10 + bl sub_81AC2C0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081ABDA4 + b _081ABEB2 +_081ABDA4: + b _081ABDCC + .pool +_081ABDB8: + movs r1, 0x1 + negs r1, r1 + mov r0, r9 + b _081ABDC4 +_081ABDC0: + mov r0, r9 + movs r1, 0x1 +_081ABDC4: + movs r2, 0 + bl SwitchBagPocket + b _081ABEB2 +_081ABDCC: + ldrb r0, [r6] + adds r1, r7, 0 + mov r2, r8 + bl get_coro_args_x18_x1A + ldrh r2, [r7] + mov r3, r8 + ldrh r0, [r3] + adds r2, r0 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =gUnknown_0203CE58 + ldr r3, =0x00000829 + adds r0, r3 + ldrb r1, [r1, 0x5] + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x1 + cmp r2, r0 + beq _081ABEB2 + movs r0, 0x5 + bl PlaySE + mov r0, r9 + bl bag_menu_swap_items + b _081ABEB2 + .pool +_081ABE10: + ldrb r0, [r6] + bl ListMenuHandleInput + adds r4, r0, 0 + ldrb r0, [r6] + adds r1, r7, 0 + mov r2, r8 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081ABE32 + adds r0, 0x1 + cmp r4, r0 + bne _081ABE68 + b _081ABEB2 +_081ABE32: + ldrb r0, [r5, 0x4] + cmp r0, 0x5 + bne _081ABE40 + movs r0, 0x20 + bl PlaySE + b _081ABEB2 +_081ABE40: + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CE7C + mov r1, r10 + strh r1, [r0] + ldr r0, =gTasks + 0x8 + subs r0, 0x8 + ldr r3, [sp] + adds r0, r3, r0 + ldr r1, =unknown_ItemMenu_Confirm + str r1, [r0] + b _081ABEB2 + .pool +_081ABE68: + movs r0, 0x5 + bl PlaySE + bl sub_81AB824 + ldrb r0, [r6] + movs r1, 0x2 + bl bag_menu_print_cursor_ + strh r4, [r6, 0x2] + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + adds r1, r4, 0 + bl BagGetQuantityByPocketPosition + strh r0, [r6, 0x4] + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl BagGetItemIdByPocketPosition + ldr r1, =gUnknown_0203CE7C + strh r0, [r1] + ldr r1, =gUnknown_08614054 + ldrb r0, [r5, 0x4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + mov r0, r9 + bl _call_via_r1 +_081ABEB2: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end Task_BagMenu + + thumb_func_start set_callback3_to_bag +set_callback3_to_bag: @ 81ABECC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl bag_menu_add_pocket_scroll_arrow_indicators_maybe + bl bag_menu_add_list_scroll_arrow_indicators_maybe + movs r0, 0x3 + bl ClearWindowTilemap + movs r0, 0x4 + bl ClearWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =Task_BagMenu + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end set_callback3_to_bag + + thumb_func_start GetSwitchBagPocketDirection +GetSwitchBagPocketDirection: @ 81ABF10 + push {lr} + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x0000081b + adds r0, r1 + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _081ABF6A + bl GetLRKeysState + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081ABF3C + cmp r2, 0x1 + bne _081ABF54 +_081ABF3C: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + b _081ABF6C + .pool +_081ABF54: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081ABF60 + cmp r2, 0x2 + bne _081ABF6A +_081ABF60: + movs r0, 0x5 + bl PlaySE + movs r0, 0x2 + b _081ABF6C +_081ABF6A: + movs r0, 0 +_081ABF6C: + pop {r1} + bx r1 + thumb_func_end GetSwitchBagPocketDirection + + thumb_func_start ChangeBagPocketId +@ void ChangeBagPocketId(u8 *bagPocketId, u8 deltaBagPocketId) +ChangeBagPocketId: @ 81ABF70 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + asrs r1, 24 + cmp r1, 0x1 + bne _081ABF88 + ldrb r0, [r2] + cmp r0, 0x4 + bne _081ABF88 + movs r0, 0 + b _081ABFA0 +_081ABF88: + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + ldrb r3, [r2] + cmp r0, r1 + bne _081ABF9E + cmp r3, 0 + bne _081ABF9E + movs r0, 0x4 + b _081ABFA0 +_081ABF9E: + adds r0, r3, r4 +_081ABFA0: + strb r0, [r2] + pop {r4} + pop {r0} + bx r0 + thumb_func_end ChangeBagPocketId + + thumb_func_start SwitchBagPocket +@ void SwitchBagPocket(u8 taskId, u16 deltaBagPocketId, u16 a3) +SwitchBagPocket: @ 81ABFA8 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 16 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + movs r0, 0 + strh r0, [r4, 0x1A] + strh r0, [r4, 0x18] + strh r5, [r4, 0x16] + cmp r2, 0 + bne _081AC026 + movs r0, 0 + bl ClearWindowTilemap + movs r0, 0x1 + bl ClearWindowTilemap + ldrb r0, [r4] + ldr r3, =gUnknown_0203CE58 + ldrb r2, [r3, 0x5] + lsls r2, 1 + adds r1, r3, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r3, 0x8 + adds r2, r3 + bl sub_81AE6C8 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r3, =gSprites + ldr r0, =gUnknown_0203CE54 + ldr r2, [r0] + ldr r1, =0x0000081b + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 26 + lsrs r1, 30 + movs r0, 0x1 + eors r0, r1 + adds r2, r0 + ldr r0, =0x00000806 + adds r2, r0 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + bl sub_81AB824 +_081AC026: + ldr r4, =gUnknown_0203CE58 + ldrb r1, [r4, 0x5] + add r0, sp, 0x8 + strb r1, [r0] + lsls r1, r5, 24 + asrs r1, 24 + bl ChangeBagPocketId + lsls r0, r5, 16 + asrs r1, r0, 16 + adds r5, r0, 0 + cmp r1, 0x1 + bne _081AC07C + ldr r2, =gUnknown_085E91FC + ldrb r0, [r4, 0x5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + add r1, sp, 0x8 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl bag_menu_print_pocket_names + movs r0, 0 + bl bag_menu_copy_pocket_name_to_window + b _081AC09A + .pool +_081AC07C: + ldr r2, =gUnknown_085E91FC + add r0, sp, 0x8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldrb r1, [r4, 0x5] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl bag_menu_print_pocket_names + movs r0, 0x8 + bl bag_menu_copy_pocket_name_to_window +_081AC09A: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + movs r1, 0 + bl bag_menu_draw_pocket_indicator_square + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x1 + bl bag_menu_draw_pocket_indicator_square + movs r0, 0xF + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0xB + movs r2, 0xE + movs r3, 0x2 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x1 + bl SetBagVisualPocketId + movs r0, 0x1 + bl RemoveBagObject + asrs r0, r5, 16 + bl AddSwitchPocketRotatingBallObject + ldr r1, =sub_81AC10C + ldr r2, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r2 + ldr r2, [r0] + adds r0, r6, 0 + bl SetTaskFuncWithFollowupFunc + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end SwitchBagPocket + + thumb_func_start sub_81AC10C +sub_81AC10C: @ 81AC10C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r6, r0, r1 + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081AC184 + bl IsWallysBag + lsls r0, 24 + cmp r0, 0 + bne _081AC184 + bl GetSwitchBagPocketDirection + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC148 + cmp r0, 0x2 + beq _081AC164 + b _081AC184 + .pool +_081AC148: + ldr r0, =gUnknown_0203CE5D + movs r1, 0x16 + ldrsb r1, [r6, r1] + bl ChangeBagPocketId + adds r0, r7, 0 + bl SwitchTaskToFollowupFunc + movs r1, 0x1 + negs r1, r1 + adds r0, r7, 0 + b _081AC178 + .pool +_081AC164: + ldr r0, =gUnknown_0203CE5D + movs r1, 0x16 + ldrsb r1, [r6, r1] + bl ChangeBagPocketId + adds r0, r7, 0 + bl SwitchTaskToFollowupFunc + adds r0, r7, 0 + movs r1, 0x1 +_081AC178: + movs r2, 0x1 + bl SwitchBagPocket + b _081AC22E + .pool +_081AC184: + movs r1, 0x1A + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _081AC192 + cmp r0, 0x1 + beq _081AC1DC + b _081AC22E +_081AC192: + ldrb r0, [r6, 0x18] + bl sub_81AC23C + ldrh r0, [r6, 0x18] + adds r1, r0, 0x1 + strh r1, [r6, 0x18] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081AC1CC + movs r2, 0x16 + ldrsh r0, [r6, r2] + cmp r0, 0x1 + bne _081AC1BC + lsls r0, r1, 16 + asrs r0, 17 + lsls r0, 24 + lsrs r0, 24 + bl bag_menu_copy_pocket_name_to_window + b _081AC1CC +_081AC1BC: + lsls r1, 16 + asrs r1, 17 + movs r0, 0x8 + subs r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl bag_menu_copy_pocket_name_to_window +_081AC1CC: + movs r1, 0x18 + ldrsh r0, [r6, r1] + cmp r0, 0x10 + bne _081AC22E + ldrh r0, [r6, 0x1A] + adds r0, 0x1 + strh r0, [r6, 0x1A] + b _081AC22E +_081AC1DC: + ldr r4, =gUnknown_0203CE5D + movs r1, 0x16 + ldrsb r1, [r6, r1] + adds r0, r4, 0 + bl ChangeBagPocketId + subs r5, r4, 0x5 + ldrb r0, [r5, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + ldrb r2, [r5, 0x5] + lsls r2, 1 + adds r1, r4, 0 + adds r1, 0xD + adds r1, r2, r1 + ldrh r1, [r1] + adds r4, 0x3 + adds r2, r4 + ldrh r2, [r2] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6] + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + bl bag_menu_add_pocket_scroll_arrow_indicators_maybe + bl bag_menu_add_list_scroll_arrow_indicators_maybe + adds r0, r7, 0 + bl SwitchTaskToFollowupFunc +_081AC22E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AC10C + + thumb_func_start sub_81AC23C +sub_81AC23C: @ 81AC23C + push {lr} + sub sp, 0x8 + adds r3, r0, 0 + lsls r3, 24 + movs r0, 0x80 + lsls r0, 18 + adds r3, r0 + lsrs r3, 24 + movs r0, 0xF + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x11 + movs r2, 0xE + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_81AC23C + + thumb_func_start bag_menu_draw_pocket_indicator_square +@ void bag_menu_draw_pocket_indicator_square(char x, int is_current_bag) +bag_menu_draw_pocket_indicator_square: @ 81AC26C + push {lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + cmp r1, 0 + bne _081AC298 + ldr r1, =0x00001017 + adds r2, r0, 0x5 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x2 + movs r3, 0x3 + bl FillBgTilemapBufferRect_Palette0 + b _081AC2AE + .pool +_081AC298: + ldr r1, =0x0000102b + adds r2, r0, 0x5 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x2 + movs r3, 0x3 + bl FillBgTilemapBufferRect_Palette0 +_081AC2AE: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_draw_pocket_indicator_square + + thumb_func_start sub_81AC2C0 +sub_81AC2C0: @ 81AC2C0 + push {lr} + ldr r1, =gUnknown_0203CE58 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + bhi _081AC2E0 + ldrb r0, [r1, 0x5] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _081AC2E0 + movs r0, 0x1 + b _081AC2E2 + .pool +_081AC2E0: + movs r0, 0 +_081AC2E2: + pop {r1} + bx r1 + thumb_func_end sub_81AC2C0 + + thumb_func_start bag_menu_swap_items +bag_menu_swap_items: @ 81AC2E8 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + mov r9, r0 + adds r6, r4, r0 + ldrb r0, [r6] + movs r1, 0x10 + movs r2, 0x1 + bl sub_81AF15C + ldr r3, =gUnknown_0203CE58 + ldrb r0, [r3, 0x5] + lsls r0, 1 + adds r2, r3, 0 + adds r2, 0x12 + adds r2, r0, r2 + adds r1, r3, 0 + adds r1, 0x8 + adds r0, r1 + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + strh r1, [r6, 0x2] + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r2, =0x0000081a + adds r0, r2 + movs r5, 0 + strb r1, [r0] + ldrb r0, [r3, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x2] + bl BagGetItemIdByPocketPosition + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar4 + mov r8, r0 + ldr r1, =gUnknown_085E8DFE + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] + movs r1, 0x1 + mov r2, r8 + movs r3, 0x3 + bl bag_menu_print + ldrb r0, [r6, 0x2] + bl sub_80D4FEC + bl sub_81AB89C + ldrb r0, [r6] + movs r1, 0x2 + bl bag_menu_print_cursor_ + movs r2, 0x8 + negs r2, r2 + add r9, r2 + add r4, r9 + ldr r0, =sub_81AC3C0 + str r0, [r4] + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_swap_items + + thumb_func_start sub_81AC3C0 +@ void sub_81AC3C0(u8 taskId) +sub_81AC3C0: @ 81AC3C0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC48E + ldr r0, =gMain + mov r8, r0 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081AC418 + movs r0, 0x5 + bl PlaySE + ldrb r0, [r4] + ldr r3, =gUnknown_0203CE58 + ldrb r2, [r3, 0x5] + lsls r2, 1 + adds r1, r3, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r3, 0x8 + adds r2, r3 + bl get_coro_args_x18_x1A + b _081AC472 + .pool +_081AC418: + ldrb r0, [r4] + bl ListMenuHandleInput + adds r7, r0, 0 + ldrb r0, [r4] + ldr r5, =gUnknown_0203CE58 + ldrb r2, [r5, 0x5] + lsls r2, 1 + adds r1, r5, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r4, r5, 0 + adds r4, 0x8 + adds r2, r4 + bl get_coro_args_x18_x1A + movs r0, 0 + bl sub_80D4FC8 + ldrb r0, [r5, 0x5] + lsls r0, 1 + adds r0, r4 + ldrb r0, [r0] + bl sub_80D4FEC + movs r0, 0x2 + negs r0, r0 + cmp r7, r0 + beq _081AC460 + adds r0, 0x1 + cmp r7, r0 + bne _081AC482 + b _081AC48E + .pool +_081AC460: + movs r0, 0x5 + bl PlaySE + mov r0, r8 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AC47A +_081AC472: + adds r0, r6, 0 + bl sub_81AC498 + b _081AC48E +_081AC47A: + adds r0, r6, 0 + bl sub_81AC590 + b _081AC48E +_081AC482: + movs r0, 0x5 + bl PlaySE + adds r0, r6, 0 + bl sub_81AC498 +_081AC48E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AC3C0 + + thumb_func_start sub_81AC498 +sub_81AC498: @ 81AC498 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + mov r10, r0 + ldr r0, =gTasks + 0x8 + add r0, r10 + mov r9, r0 + ldr r5, =gUnknown_0203CE58 + ldrb r6, [r5, 0x5] + lsls r1, r6, 1 + adds r0, r5, 0 + adds r0, 0x12 + adds r0, r1 + mov r8, r0 + ldr r2, =gUnknown_0203CE60 + adds r7, r1, r2 + ldrh r0, [r7] + mov r1, r8 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + mov r0, r9 + movs r1, 0x2 + ldrsh r2, [r0, r1] + cmp r2, r4 + beq _081AC4E2 + subs r0, r4, 0x1 + cmp r2, r0 + bne _081AC4F8 +_081AC4E2: + adds r0, r3, 0 + bl sub_81AC590 + b _081AC566 + .pool +_081AC4F8: + ldr r1, =gBagPockets + lsls r0, r6, 3 + adds r0, r1 + ldr r0, [r0] + adds r1, r2, 0 + adds r2, r4, 0 + bl sub_80D702C + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r2, =0x0000081a + adds r0, r2 + movs r1, 0xFF + strb r1, [r0] + mov r1, r9 + ldrb r0, [r1] + mov r1, r8 + adds r2, r7, 0 + bl sub_81AE6C8 + mov r2, r9 + movs r1, 0x2 + ldrsh r0, [r2, r1] + cmp r0, r4 + bge _081AC538 + ldrb r1, [r5, 0x5] + lsls r1, 1 + ldr r2, =gUnknown_0203CE60 + adds r1, r2 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_081AC538: + ldrb r0, [r5, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + mov r2, r8 + ldrh r1, [r2] + ldrh r2, [r7] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + mov r1, r9 + strh r0, [r1] + movs r0, 0x1 + bl sub_80D4FC8 + bl bag_menu_add_list_scroll_arrow_indicators_maybe + ldr r0, =gTasks + 0x8 + subs r0, 0x8 + add r0, r10 + ldr r1, =Task_BagMenu + str r1, [r0] +_081AC566: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AC498 + + thumb_func_start sub_81AC590 +sub_81AC590: @ 81AC590 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + mov r9, r1 + ldr r0, =gTasks + 0x8 + mov r10, r0 + mov r7, r9 + add r7, r10 + ldr r4, =gUnknown_0203CE58 + ldrb r0, [r4, 0x5] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r6, r0, r1 + movs r1, 0x8 + adds r1, r4 + mov r8, r1 + adds r5, r0, r1 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x0000081a + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrb r0, [r7] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_81AE6C8 + movs r0, 0x2 + ldrsh r2, [r7, r0] + ldrh r0, [r6] + ldrh r1, [r5] + adds r0, r1 + cmp r2, r0 + bge _081AC5F2 + ldrb r1, [r4, 0x5] + lsls r1, 1 + add r1, r8 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_081AC5F2: + ldrb r0, [r4, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + ldrh r1, [r6] + ldrh r2, [r5] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + movs r0, 0x1 + bl sub_80D4FC8 + bl bag_menu_add_list_scroll_arrow_indicators_maybe + mov r0, r10 + subs r0, 0x8 + add r0, r9 + ldr r1, =Task_BagMenu + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AC590 + + thumb_func_start sub_81AC644 +sub_81AC644: @ 81AC644 + push {r4,r5,lr} + sub sp, 0x14 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x4] + subs r0, 0x1 + cmp r0, 0x9 + bls _081AC654 + b _081AC82C +_081AC654: + lsls r0, 2 + ldr r1, =_081AC668 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AC668: + .4byte _081AC690 + .4byte _081AC82C + .4byte _081AC82C + .4byte _081AC82C + .4byte _081AC6E8 + .4byte _081AC82C + .4byte _081AC76C + .4byte _081AC7CC + .4byte _081AC70C + .4byte _081AC690 +_081AC690: + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl ItemId_GetBattleUsage + lsls r0, 24 + cmp r0, 0 + beq _081AC6C4 + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614042 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC6C4: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC6E8: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614047 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + b _081ACA10 + .pool +_081AC70C: + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AC748 + ldrh r0, [r4] + cmp r0, 0xAF + beq _081AC748 + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_0861404B + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC748: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC76C: + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AC7A8 + ldrh r0, [r4] + cmp r0, 0xAF + beq _081AC7A8 + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_0861404D + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC7A8: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC7CC: + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AC808 + ldrh r0, [r4] + cmp r0, 0xAF + beq _081AC808 + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_0861404F + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC808: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC82C: + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC840 + bl InUnionRoom + cmp r0, 0x1 + bne _081AC8A4 +_081AC840: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _081AC856 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl sub_8122148 + lsls r0, 24 + cmp r0, 0 + bne _081AC880 +_081AC856: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC880: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614044 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC8A4: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + bls _081AC8AE + b _081ACA12 +_081AC8AE: + lsls r0, 2 + ldr r1, =_081AC8C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AC8C0: + .4byte _081AC8D4 + .4byte _081AC9B4 + .4byte _081AC9D8 + .4byte _081AC9FC + .4byte _081AC92C +_081AC8D4: + ldr r4, =gUnknown_0203CE54 + ldr r1, [r4] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r3, =0x00000824 + adds r0, r1, r3 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + strb r0, [r1] + ldr r0, [r4] + adds r0, r3 + ldr r1, =gUnknown_0861402C + movs r2, 0x4 + bl memcpy + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC90A + b _081ACA12 +_081AC90A: + ldr r0, [r4] + ldr r1, =0x00000824 + adds r0, r1 + movs r1, 0x6 + strb r1, [r0] + b _081ACA12 + .pool +_081AC92C: + ldr r4, =gUnknown_0203CE54 + ldr r1, [r4] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r5, =0x00000824 + adds r0, r1, r5 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + strb r0, [r1] + ldr r0, [r4] + adds r0, r5 + ldr r1, =gUnknown_08614030 + movs r2, 0x4 + bl memcpy + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00000496 + adds r0, r1 + ldr r2, =gUnknown_0203CE7C + ldrh r0, [r0] + ldrh r1, [r2] + cmp r0, r1 + bne _081AC96C + ldr r0, [r4] + ldr r1, =0x00000825 + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] +_081AC96C: + ldrh r1, [r2] + ldr r0, =0x00000103 + cmp r1, r0 + beq _081AC97A + adds r0, 0xD + cmp r1, r0 + bne _081ACA12 +_081AC97A: + movs r0, 0x6 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _081ACA12 + ldr r0, [r4] + adds r0, r5 + movs r1, 0x7 + strb r1, [r0] + b _081ACA12 + .pool +_081AC9B4: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614034 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + b _081ACA10 + .pool +_081AC9D8: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614038 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + b _081ACA10 + .pool +_081AC9FC: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_0861403C + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x6 +_081ACA10: + strb r0, [r1] +_081ACA12: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x2 + bne _081ACA50 + movs r0, 0x1 + bl ClearWindowTilemap + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl PrintTMHMMoveData + movs r0, 0x3 + bl PutWindowTilemap + movs r0, 0x4 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + b _081ACA86 + .pool +_081ACA50: + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8DBE + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print +_081ACA86: + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000828 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081ACAB0 + movs r0, 0 + b _081ACAB6 + .pool +_081ACAB0: + cmp r0, 0x2 + bne _081ACAC4 + movs r0, 0x1 +_081ACAB6: + bl bag_menu_add_window + lsls r0, 24 + lsrs r0, 24 + bl sub_81ACAF8 + b _081ACAEE +_081ACAC4: + cmp r0, 0x4 + bne _081ACADC + movs r0, 0x2 + bl bag_menu_add_window + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + movs r2, 0x2 + bl sub_81ACB54 + b _081ACAEE +_081ACADC: + movs r0, 0x3 + bl bag_menu_add_window + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + movs r2, 0x3 + bl sub_81ACB54 +_081ACAEE: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81AC644 + + thumb_func_start sub_81ACAF8 +sub_81ACAF8: @ 81ACAF8 + push {r4-r6,lr} + sub sp, 0x14 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + ldr r6, =gUnknown_0203CE54 + ldr r1, [r6] + ldr r5, =0x00000828 + adds r0, r1, r5 + ldrb r0, [r0] + str r0, [sp, 0x8] + ldr r0, =gUnknown_08613FB4 + str r0, [sp, 0xC] + movs r0, 0x82 + lsls r0, 4 + adds r1, r0 + ldr r0, [r1] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x8 + movs r3, 0x1 + bl AddItemMenuActionTextPrinters + ldr r0, [r6] + adds r0, r5 + ldrb r1, [r0] + adds r0, r4, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ACAF8 + + thumb_func_start sub_81ACB54 +sub_81ACB54: @ 81ACB54 + push {r4-r6,lr} + sub sp, 0x14 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x38 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + ldr r0, =gUnknown_08613FB4 + str r0, [sp, 0xC] + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 4 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x8 + movs r3, 0x1 + bl sub_8198DBC + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x38 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8199944 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ACB54 + + thumb_func_start unknown_item_menu_type +unknown_item_menu_type: @ 81ACBB0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81AC644 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000828 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bhi _081ACBE8 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =Task_HandleInBattleItemMenuInput + b _081ACBF4 + .pool +_081ACBE8: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =Task_HandleOutOfBattleItemMenuInput +_081ACBF4: + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_item_menu_type + + thumb_func_start Task_HandleInBattleItemMenuInput +Task_HandleInBattleItemMenuInput: @ 81ACC04 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081ACC6A + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081ACC6A + adds r0, 0x1 + cmp r4, r0 + bne _081ACC44 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_08613FB4 + ldr r1, [r0, 0x24] + adds r0, r5, 0 + bl _call_via_r1 + b _081ACC6A + .pool +_081ACC44: + movs r0, 0x5 + bl PlaySE + ldr r1, =gUnknown_08613FB4 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + movs r2, 0x82 + lsls r2, 4 + adds r0, r2 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 +_081ACC6A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end Task_HandleInBattleItemMenuInput + + thumb_func_start Task_HandleOutOfBattleItemMenuInput +Task_HandleOutOfBattleItemMenuInput: @ 81ACC78 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ACC8C + b _081ACDF0 +_081ACC8C: + bl GetMenuCursorPos + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gMain + ldrh r1, [r5, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081ACCD4 + lsls r0, r4, 24 + asrs r0, 24 + cmp r0, 0 + bgt _081ACCAA + b _081ACDF0 +_081ACCAA: + subs r0, 0x2 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + bne _081ACCBC + b _081ACDF0 +_081ACCBC: + movs r0, 0x5 + bl PlaySE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + bl sub_8199134 + b _081ACDF0 + .pool +_081ACCD4: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081ACD1C + lsls r0, r4, 24 + asrs r1, r0, 24 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r2, =0x00000828 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x2 + cmp r1, r0 + blt _081ACCF2 + b _081ACDF0 +_081ACCF2: + adds r0, r1, 0x2 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl PlaySE + movs r0, 0 + movs r1, 0x1 + bl sub_8199134 + b _081ACDF0 + .pool +_081ACD1C: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081ACD30 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ACD58 +_081ACD30: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081ACDF0 + subs r0, r1, 0x1 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _081ACD92 +_081ACD58: + ldrh r1, [r5, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081ACD6E + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081ACD9A +_081ACD6E: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081ACDF0 + adds r0, r1, 0x1 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_081ACD92: + movs r1, 0 + bl sub_8199134 + b _081ACDF0 +_081ACD9A: + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081ACDD8 + movs r0, 0x5 + bl PlaySE + ldr r2, =gUnknown_08613FB4 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + lsls r1, r4, 24 + asrs r1, 24 + movs r3, 0x82 + lsls r3, 4 + adds r0, r3 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 3 + adds r2, 0x4 + adds r0, r2 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 + b _081ACDF0 + .pool +_081ACDD8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_08613FB4 + ldr r1, [r0, 0x24] + adds r0, r6, 0 + bl _call_via_r1 +_081ACDF0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end Task_HandleOutOfBattleItemMenuInput + + thumb_func_start sub_81ACDFC +sub_81ACDFC: @ 81ACDFC + push {lr} + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081ACE30 + ldr r0, =gUnknown_0203CE54 + ldr r2, [r0] + ldr r3, =0x00000828 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bgt _081ACE30 + movs r3, 0x82 + lsls r3, 4 + adds r0, r2, r3 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xE + beq _081ACE30 + movs r0, 0x1 + b _081ACE32 + .pool +_081ACE30: + movs r0, 0 +_081ACE32: + pop {r1} + bx r1 + thumb_func_end sub_81ACDFC + + thumb_func_start bag_menu_remove_some_window +bag_menu_remove_some_window: @ 81ACE38 + push {lr} + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000828 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081ACE58 + movs r0, 0 + bl bag_menu_remove_window + b _081ACE76 + .pool +_081ACE58: + cmp r0, 0x2 + bne _081ACE64 + movs r0, 0x1 + bl bag_menu_remove_window + b _081ACE76 +_081ACE64: + cmp r0, 0x4 + bne _081ACE70 + movs r0, 0x2 + bl bag_menu_remove_window + b _081ACE76 +_081ACE70: + movs r0, 0x3 + bl bag_menu_remove_window +_081ACE76: + pop {r0} + bx r0 + thumb_func_end bag_menu_remove_some_window + + thumb_func_start ItemMenu_UseOutOfBattle +@ void ItemMenu_UseOutOfBattle(u8 taskId) +ItemMenu_UseOutOfBattle: @ 81ACE7C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gUnknown_0203CE7C + ldrh r0, [r5] + bl ItemId_GetFieldFunc + cmp r0, 0 + beq _081ACEEE + bl bag_menu_remove_some_window + bl CalculatePlayerPartyCount + lsls r0, 24 + cmp r0, 0 + bne _081ACEB8 + ldrh r0, [r5] + bl ItemId_GetType + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ACEB8 + adds r0, r4, 0 + bl bag_menu_print_there_is_no_pokemon + b _081ACEEE + .pool +_081ACEB8: + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x3 + beq _081ACEE8 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl ItemId_GetFieldFunc + adds r1, r0, 0 + adds r0, r4, 0 + bl _call_via_r1 + b _081ACEEE + .pool +_081ACEE8: + adds r0, r4, 0 + bl sub_80FDD10 +_081ACEEE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end ItemMenu_UseOutOfBattle + + thumb_func_start ItemMenu_Toss +ItemMenu_Toss: @ 81ACEF4 + push {r4-r7,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r6, r0, 3 + ldr r7, =gTasks + 0x8 + adds r4, r6, r7 + bl bag_menu_remove_some_window + movs r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _081ACF24 + adds r0, r5, 0 + bl BagMenuConfirmToss + b _081ACF6A + .pool +_081ACF24: + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8EE0 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + movs r0, 0x7 + bl sub_81ABC3C + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =Task_ChooseHowManyToToss + str r1, [r0] +_081ACF6A: + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_Toss + + thumb_func_start BagMenuConfirmToss +BagMenuConfirmToss: @ 81ACF88 + push {r4,r5,lr} + sub sp, 0x14 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar2 + movs r2, 0x10 + ldrsh r1, [r4, r2] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8F0E + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + ldr r2, =gUnknown_08614084 + adds r0, r5, 0 + movs r1, 0x5 + bl bag_menu_yes_no + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end BagMenuConfirmToss + + thumb_func_start BagMenuCancelToss +BagMenuCancelToss: @ 81AD010 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl bag_menu_print_description_box_text + ldrb r0, [r4] + movs r1, 0 + bl bag_menu_print_cursor_ + adds r0, r5, 0 + bl set_callback3_to_bag + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end BagMenuCancelToss + + thumb_func_start Task_ChooseHowManyToToss +Task_ChooseHowManyToToss: @ 81AD044 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x10 + ldrh r1, [r4, 0x4] + bl AdjustQuantityAccordingToDPadInput + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD088 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000817 + adds r0, r1 + ldrb r0, [r0] + movs r2, 0x10 + ldrsh r1, [r4, r2] + bl sub_81ABC54 + b _081AD0C6 + .pool +_081AD088: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD0AC + movs r0, 0x5 + bl PlaySE + movs r0, 0x7 + bl bag_menu_remove_window + adds r0, r5, 0 + bl BagMenuConfirmToss + b _081AD0C6 + .pool +_081AD0AC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AD0C6 + movs r0, 0x5 + bl PlaySE + movs r0, 0x7 + bl bag_menu_remove_window + adds r0, r6, 0 + bl BagMenuCancelToss +_081AD0C6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end Task_ChooseHowManyToToss + + thumb_func_start BagMenuActuallyToss +BagMenuActuallyToss: @ 81AD0CC + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =gTasks + 0x8 + adds r6, r4, r5 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar2 + movs r2, 0x10 + ldrsh r1, [r6, r2] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r6, =gStringVar4 + ldr r1, =gUnknown_085E8EF9 + adds r0, r6, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r6, 0 + movs r3, 0x3 + bl bag_menu_print + subs r5, 0x8 + adds r4, r5 + ldr r0, =Task_ActuallyToss + str r0, [r4] + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end BagMenuActuallyToss + + thumb_func_start Task_ActuallyToss +Task_ActuallyToss: @ 81AD150 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldr r4, =gUnknown_0203CE58 + ldrb r0, [r4, 0x5] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r0 + mov r8, r1 + adds r1, r4, 0 + adds r1, 0x8 + adds r7, r0, r1 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081AD1CE + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldrh r1, [r5, 0x10] + bl RemoveBagItem + ldrb r0, [r5] + mov r1, r8 + adds r2, r7, 0 + bl sub_81AE6C8 + ldrb r0, [r4, 0x5] + bl sub_81AB9A8 + ldrb r0, [r4, 0x5] + bl sub_81ABA88 + ldrb r0, [r4, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + mov r2, r8 + ldrh r1, [r2] + ldrh r2, [r7] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl set_callback3_to_bag +_081AD1CE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end Task_ActuallyToss + + thumb_func_start ItemMenu_Register +ItemMenu_Register: @ 81AD1EC + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + ldr r0, =gUnknown_0203CE58 + ldrb r1, [r0, 0x5] + lsls r1, 1 + adds r2, r0, 0 + adds r2, 0x12 + adds r6, r1, r2 + adds r0, 0x8 + adds r5, r1, r0 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00000496 + adds r1, r0, r2 + ldr r0, =gUnknown_0203CE7C + ldrh r2, [r0] + ldrh r0, [r1] + cmp r0, r2 + bne _081AD238 + movs r0, 0 + strh r0, [r1] + b _081AD23A + .pool +_081AD238: + strh r2, [r1] +_081AD23A: + ldrb r0, [r7] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_81AE6C8 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + ldrh r1, [r6] + ldrh r2, [r5] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r4, 0 + bl ItemMenu_Cancel + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_Register + + thumb_func_start ItemMenu_Give +ItemMenu_Give: @ 81AD278 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + bl bag_menu_remove_some_window + ldr r5, =gUnknown_0203CE7C + ldrh r0, [r5] + bl itemid_80BF6D8_mail_related + lsls r0, 24 + cmp r0, 0 + bne _081AD2AC + ldr r2, =gUnknown_085E8DCE + ldr r3, =sub_81AD350 + adds r0, r4, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _081AD2EA + .pool +_081AD2AC: + ldrh r0, [r5] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AD2E4 + bl CalculatePlayerPartyCount + lsls r0, 24 + cmp r0, 0 + bne _081AD2CA + adds r0, r4, 0 + bl bag_menu_print_there_is_no_pokemon + b _081AD2EA +_081AD2CA: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + ldr r0, =sub_81B7F60 + str r0, [r1] + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + b _081AD2EA + .pool +_081AD2E4: + adds r0, r6, 0 + bl bag_menu_print_cant_be_held_msg +_081AD2EA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end ItemMenu_Give + + thumb_func_start bag_menu_print_there_is_no_pokemon +bag_menu_print_there_is_no_pokemon: @ 81AD2F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_085E8DE9 + ldr r3, =sub_81AD350 + movs r1, 0x1 + bl DisplayItemMessage + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_there_is_no_pokemon + + thumb_func_start bag_menu_print_cant_be_held_msg +bag_menu_print_cant_be_held_msg: @ 81AD30C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r5, =gStringVar4 + ldr r1, =gUnknown_085E8E11 + adds r0, r5, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD350 + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl DisplayItemMessage + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_cant_be_held_msg + + thumb_func_start sub_81AD350 +sub_81AD350: @ 81AD350 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD36E + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl bag_menu_inits_lists_menu +_081AD36E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD350 + + thumb_func_start ItemMenu_CheckTag +ItemMenu_CheckTag: @ 81AD378 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CE54 + ldr r2, [r1] + ldr r1, =sub_8177C14 + str r1, [r2] + bl unknown_ItemMenu_Confirm + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_CheckTag + + thumb_func_start ItemMenu_Cancel +ItemMenu_Cancel: @ 81AD398 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + bl bag_menu_remove_some_window + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl bag_menu_print_description_box_text + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + ldrb r0, [r4] + movs r1, 0 + bl bag_menu_print_cursor_ + adds r0, r5, 0 + bl set_callback3_to_bag + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_Cancel + + thumb_func_start ItemMenu_UseInBattle +ItemMenu_UseInBattle: @ 81AD3DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl ItemId_GetBattleFunc + cmp r0, 0 + beq _081AD400 + bl bag_menu_remove_some_window + ldrh r0, [r4] + bl ItemId_GetBattleFunc + adds r1, r0, 0 + adds r0, r5, 0 + bl _call_via_r1 +_081AD400: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_UseInBattle + + thumb_func_start bag_menu_mail_related +bag_menu_mail_related: @ 81AD40C + push {lr} + movs r0, 0xC + movs r1, 0x5 + movs r2, 0 + bl GoToBagMenu + pop {r0} + bx r0 + thumb_func_end bag_menu_mail_related + + thumb_func_start item_menu_type_2 +item_menu_type_2: @ 81AD41C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl itemid_80BF6D8_mail_related + lsls r0, 24 + cmp r0, 0 + bne _081AD44C + ldr r2, =gUnknown_085E8DCE + ldr r3, =sub_81AD350 + adds r0, r5, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _081AD4AE + .pool +_081AD44C: + ldrh r0, [r4] + bl sub_8122148 + lsls r0, 24 + cmp r0, 0 + bne _081AD488 + ldrh r0, [r4] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8E27 + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD350 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + b _081AD4AE + .pool +_081AD488: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _081AD4A8 + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AD4A8 + adds r0, r5, 0 + bl unknown_ItemMenu_Confirm + b _081AD4AE + .pool +_081AD4A8: + adds r0, r5, 0 + bl bag_menu_print_cant_be_held_msg +_081AD4AE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end item_menu_type_2 + + thumb_func_start item_menu_type_b +item_menu_type_b: @ 81AD4B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gUnknown_0203CE7C + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD4E4 + ldr r2, =gUnknown_085E8DCE + ldr r3, =sub_81AD350 + adds r0, r4, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _081AD51A + .pool +_081AD4E4: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _081AD514 + ldrh r0, [r5] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AD514 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =unknown_ItemMenu_Confirm + str r0, [r1] + b _081AD51A + .pool +_081AD514: + adds r0, r4, 0 + bl bag_menu_print_cant_be_held_msg +_081AD51A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end item_menu_type_b + + thumb_func_start UseRegisteredKeyItemOnField +@ bool8 UseRegisteredKeyItemOnField() +UseRegisteredKeyItemOnField: @ 81AD520 + push {r4-r7,lr} + bl InUnionRoom + cmp r0, 0x1 + beq _081AD54C + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _081AD54C + bl InBattlePike + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _081AD54C + bl InMultiBattleRoom + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD550 +_081AD54C: + movs r0, 0 + b _081AD5D2 +_081AD550: + bl HideMapNamePopUpWindow + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY_ScreenOff + ldr r4, =gSaveBlock1Ptr + ldr r0, [r4] + ldr r5, =0x00000496 + adds r1, r0, r5 + ldrh r0, [r1] + cmp r0, 0 + beq _081AD5CA + movs r1, 0x1 + bl CheckBagHasItem + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bne _081AD5C4 + bl ScriptContext2_Enable + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 + ldr r2, =gUnknown_0203CE7C + ldr r0, [r4] + adds r0, r5 + ldrh r1, [r0] + strh r1, [r2] + ldrh r0, [r0] + bl ItemId_GetFieldFunc + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r6, [r1, 0xE] + b _081AD5D0 + .pool +_081AD5C4: + ldr r0, [r4] + adds r0, r5 + strh r7, [r0] +_081AD5CA: + ldr r0, =gUnknown_082736B3 + bl ScriptContext1_SetupScript +_081AD5D0: + movs r0, 0x1 +_081AD5D2: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end UseRegisteredKeyItemOnField + + thumb_func_start display_sell_item_ask_str +@ void display_sell_item_ask_str(int a1) +display_sell_item_ask_str: @ 81AD5DC + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r6, =gUnknown_0203CE7C + ldrh r0, [r6] + bl itemid_get_market_price + lsls r0, 16 + cmp r0, 0 + bne _081AD634 + ldrh r0, [r6] + ldr r1, =gStringVar2 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E960F + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =bag_menu_inits_lists_menu + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + b _081AD66A + .pool +_081AD634: + movs r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _081AD64C + bl bag_menu_AddMoney_window + adds r0, r5, 0 + bl sub_81AD680 + b _081AD66A +_081AD64C: + ldrh r0, [r6] + ldr r1, =gStringVar2 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E962F + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD730 + adds r0, r7, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage +_081AD66A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end display_sell_item_ask_str + + thumb_func_start sub_81AD680 +sub_81AD680: @ 81AD680 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldr r6, =gStringVar1 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + movs r2, 0x10 + ldrsh r1, [r4, r2] + muls r1, r0 + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9654 + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD6E4 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD680 + + thumb_func_start sub_81AD6E4 +sub_81AD6E4: @ 81AD6E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_0861408C + movs r1, 0x6 + bl bag_menu_yes_no + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD6E4 + + thumb_func_start sub_81AD6FC +sub_81AD6FC: @ 81AD6FC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + bl bag_menu_remove_money_window + movs r0, 0x4 + bl bag_menu_RemoveBagItem_message_window + ldrb r0, [r4] + movs r1, 0 + bl bag_menu_print_cursor_ + adds r0, r5, 0 + bl set_callback3_to_bag + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD6FC + + thumb_func_start sub_81AD730 +sub_81AD730: @ 81AD730 + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r6, =gTasks + 0x8 + adds r0, r4, r6 + mov r8, r0 + movs r0, 0x8 + bl bag_menu_add_window + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + mov r2, r8 + movs r3, 0x10 + ldrsh r1, [r2, r3] + adds r2, r0, 0 + muls r2, r1 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81ABCC0 + bl bag_menu_AddMoney_window + subs r6, 0x8 + adds r4, r6 + ldr r0, =sub_81AD794 + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD730 + + thumb_func_start sub_81AD794 +sub_81AD794: @ 81AD794 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r6, r0, r1 + adds r0, r6, 0 + adds r0, 0x10 + ldrh r1, [r6, 0x4] + bl AdjustQuantityAccordingToDPadInput + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD7F4 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000818 + adds r0, r1 + ldrb r4, [r0] + movs r2, 0x10 + ldrsh r5, [r6, r2] + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + movs r2, 0x10 + ldrsh r1, [r6, r2] + adds r2, r0, 0 + muls r2, r1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81ABCC0 + b _081AD844 + .pool +_081AD7F4: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD818 + movs r0, 0x5 + bl PlaySE + movs r0, 0x8 + bl bag_menu_remove_window + adds r0, r4, 0 + bl sub_81AD680 + b _081AD844 + .pool +_081AD818: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AD844 + movs r0, 0x5 + bl PlaySE + ldrb r0, [r6] + movs r1, 0 + bl bag_menu_print_cursor_ + bl bag_menu_remove_money_window + movs r0, 0x8 + bl bag_menu_remove_window + movs r0, 0x4 + bl bag_menu_RemoveBagItem_message_window + adds r0, r5, 0 + bl set_callback3_to_bag +_081AD844: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81AD794 + + thumb_func_start sub_81AD84C +sub_81AD84C: @ 81AD84C + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldr r6, =gUnknown_0203CE7C + ldrh r0, [r6] + ldr r1, =gStringVar2 + bl CopyItemName + ldr r0, =gStringVar1 + mov r8, r0 + ldrh r0, [r6] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + movs r2, 0x10 + ldrsh r1, [r4, r2] + muls r1, r0 + mov r0, r8 + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9677 + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD8C8 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD84C + + thumb_func_start sub_81AD8C8 +sub_81AD8C8: @ 81AD8C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + lsls r6, r0, 2 + adds r6, r0 + lsls r6, 3 + ldr r0, =gTasks + 0x8 + adds r0, r6 + mov r10, r0 + ldr r7, =gUnknown_0203CE58 + ldrb r5, [r7, 0x5] + lsls r5, 1 + movs r1, 0x12 + adds r1, r7 + mov r9, r1 + add r9, r5 + adds r0, r7, 0 + adds r0, 0x8 + adds r5, r0 + movs r0, 0x5F + bl PlaySE + ldr r2, =gUnknown_0203CE7C + mov r8, r2 + ldrh r0, [r2] + mov r3, r10 + ldrh r1, [r3, 0x10] + bl RemoveBagItem + ldr r0, =gSaveBlock1Ptr + ldr r4, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r4, r1 + mov r2, r8 + ldrh r0, [r2] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + mov r3, r10 + movs r2, 0x10 + ldrsh r1, [r3, r2] + muls r1, r0 + adds r0, r4, 0 + bl AddMoney + mov r3, r10 + ldrb r0, [r3] + mov r1, r9 + adds r2, r5, 0 + bl sub_81AE6C8 + ldrb r0, [r7, 0x5] + bl sub_81AB9A8 + ldrb r0, [r7, 0x5] + bl sub_81ABA88 + ldrb r0, [r7, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + mov r2, r9 + ldrh r1, [r2] + ldrh r2, [r5] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + mov r3, r10 + strh r0, [r3] + movs r1, 0x2 + bl bag_menu_print_cursor_ + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000819 + adds r0, r1 + ldrb r4, [r0] + ldr r2, =gSaveBlock1Ptr + ldr r0, [r2] + movs r3, 0x92 + lsls r3, 3 + adds r0, r3 + bl GetMoney + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl PrintMoneyAmountInMoneyBox + ldr r0, =gTasks + 0x8 + subs r0, 0x8 + adds r6, r0 + ldr r0, =sub_81AD9C0 + str r0, [r6] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD8C8 + + thumb_func_start sub_81AD9C0 +sub_81AD9C0: @ 81AD9C0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081AD9E2 + movs r0, 0x5 + bl PlaySE + bl bag_menu_remove_money_window + adds r0, r4, 0 + bl bag_menu_inits_lists_menu +_081AD9E2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD9C0 + + thumb_func_start display_deposit_item_ask_str +display_deposit_item_ask_str: @ 81AD9EC + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r5, r0, 3 + ldr r6, =gTasks + 0x8 + adds r1, r5, r6 + movs r0, 0x1 + strh r0, [r1, 0x10] + movs r3, 0x4 + ldrsh r0, [r1, r3] + cmp r0, 0x1 + bne _081ADA18 + adds r0, r2, 0 + bl sub_81ADB14 + b _081ADA5E + .pool +_081ADA18: + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8E42 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + movs r0, 0x7 + bl sub_81ABC3C + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, =sub_81ADA7C + str r1, [r0] +_081ADA5E: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end display_deposit_item_ask_str + + thumb_func_start sub_81ADA7C +sub_81ADA7C: @ 81ADA7C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + adds r0, r5, 0 + adds r0, 0x10 + ldrh r1, [r5, 0x4] + bl AdjustQuantityAccordingToDPadInput + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ADAC0 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000817 + adds r0, r1 + ldrb r0, [r0] + movs r2, 0x10 + ldrsh r1, [r5, r2] + bl sub_81ABC54 + b _081ADB0E + .pool +_081ADAC0: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081ADAE4 + movs r0, 0x5 + bl PlaySE + movs r0, 0x7 + bl bag_menu_remove_window + adds r0, r4, 0 + bl sub_81ADB14 + b _081ADB0E + .pool +_081ADAE4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081ADB0E + movs r0, 0x5 + bl PlaySE + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl bag_menu_print_description_box_text + ldrb r0, [r5] + movs r1, 0 + bl bag_menu_print_cursor_ + movs r0, 0x7 + bl bag_menu_remove_window + adds r0, r6, 0 + bl set_callback3_to_bag +_081ADB0E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81ADA7C + + thumb_func_start sub_81ADB14 +sub_81ADB14: @ 81ADB14 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r7, r1, 3 + ldr r0, =gTasks + 0x8 + mov r9, r0 + adds r2, r7, 0 + add r2, r9 + mov r8, r2 + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _081ADB6C + ldr r2, =gUnknown_085E8E8E + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + b _081ADBE2 + .pool +_081ADB6C: + ldrh r0, [r4] + mov r3, r8 + ldrh r1, [r3, 0x10] + bl sub_80D6D70 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bne _081ADBD4 + ldrh r0, [r4] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar2 + mov r2, r8 + movs r3, 0x10 + ldrsh r1, [r2, r3] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8E5A + adds r0, r4, 0 + bl StringExpandPlaceholders + str r6, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + mov r0, r9 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =Task_ActuallyToss + b _081ADBF2 + .pool +_081ADBD4: + ldr r2, =gUnknown_085E8E6E + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] +_081ADBE2: + movs r1, 0x1 + movs r3, 0x3 + bl bag_menu_print + mov r0, r9 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =sub_81ADC0C +_081ADBF2: + str r1, [r0] + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ADB14 + + thumb_func_start sub_81ADC0C +sub_81ADC0C: @ 81ADC0C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081ADC44 + movs r0, 0x5 + bl PlaySE + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl bag_menu_print_description_box_text + ldrb r0, [r5] + movs r1, 0 + bl bag_menu_print_cursor_ + adds r0, r4, 0 + bl set_callback3_to_bag +_081ADC44: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ADC0C + + thumb_func_start IsWallysBag +@ bool8 IsWallysBag() +IsWallysBag: @ 81ADC54 + push {lr} + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x4] + cmp r0, 0xA + beq _081ADC68 + movs r0, 0 + b _081ADC6A + .pool +_081ADC68: + movs r0, 0x1 +_081ADC6A: + pop {r1} + bx r1 + thumb_func_end IsWallysBag + + thumb_func_start PrepareBagForWallyTutorial +@ void PrepareBagForWallyTutorial() +PrepareBagForWallyTutorial: @ 81ADC70 + push {r4-r6,lr} + ldr r4, =gUnknown_0203CE80 + movs r0, 0xD0 + bl AllocZeroed + str r0, [r4] + ldr r5, =gSaveBlock1Ptr + ldr r1, [r5] + movs r2, 0xAC + lsls r2, 3 + adds r1, r2 + movs r2, 0x78 + bl memcpy + ldr r0, [r4] + ldr r1, [r5] + movs r2, 0xCA + lsls r2, 3 + adds r1, r2 + adds r0, 0x78 + movs r2, 0x40 + bl memcpy + ldr r0, [r4] + ldr r2, =gUnknown_0203CE58 + ldrb r1, [r2, 0x5] + adds r0, 0xCE + strh r1, [r0] + movs r6, 0 + adds r5, r2, 0 + adds r5, 0x8 +_081ADCAE: + ldr r2, [r4] + lsls r3, r6, 1 + adds r0, r2, 0 + adds r0, 0xB8 + adds r0, r3 + ldrh r1, [r5] + strh r1, [r0] + adds r2, 0xC2 + adds r2, r3 + ldrh r0, [r5, 0xA] + strh r0, [r2] + adds r5, 0x2 + adds r6, 0x1 + cmp r6, 0x4 + bls _081ADCAE + ldr r4, =gSaveBlock1Ptr + ldr r0, [r4] + movs r1, 0xAC + lsls r1, 3 + adds r0, r1 + movs r1, 0x1E + bl ClearItemSlots + ldr r0, [r4] + movs r2, 0xCA + lsls r2, 3 + adds r0, r2 + movs r1, 0x10 + bl ClearItemSlots + bl ResetBagScrollPositions + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end PrepareBagForWallyTutorial + + thumb_func_start RestoreBagAfterWallyTutorial +@ void RestoreBagAfterWallyTutorial() +RestoreBagAfterWallyTutorial: @ 81ADD00 + push {r4-r6,lr} + ldr r5, =gSaveBlock1Ptr + ldr r0, [r5] + movs r1, 0xAC + lsls r1, 3 + adds r0, r1 + ldr r4, =gUnknown_0203CE80 + ldr r1, [r4] + movs r2, 0x78 + bl memcpy + ldr r0, [r5] + movs r1, 0xCA + lsls r1, 3 + adds r0, r1 + ldr r1, [r4] + adds r1, 0x78 + movs r2, 0x40 + bl memcpy + ldr r1, =gUnknown_0203CE58 + ldr r0, [r4] + adds r0, 0xCE + ldrh r0, [r0] + strb r0, [r1, 0x5] + movs r5, 0 + adds r6, r4, 0 + adds r3, r1, 0 + adds r3, 0x8 +_081ADD3A: + lsls r2, r5, 1 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xB8 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + adds r1, 0xC2 + adds r1, r2 + ldrh r0, [r1] + strh r0, [r3, 0xA] + adds r3, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + bls _081ADD3A + ldr r0, [r6] + bl Free + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end RestoreBagAfterWallyTutorial + + thumb_func_start DoWallyTutorialBagMenu +@ void DoWallyTutorialBagMenu() +DoWallyTutorialBagMenu: @ 81ADD70 + push {lr} + bl PrepareBagForWallyTutorial + movs r0, 0xD + movs r1, 0x1 + bl AddBagItem + movs r0, 0x4 + movs r1, 0x1 + bl AddBagItem + ldr r2, =sub_8059D50 + movs r0, 0xA + movs r1, 0 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end DoWallyTutorialBagMenu + + thumb_func_start Task_WallyTutorialBagMenu +@ void Task_WallyTutorialBagMenu(u8 taskId) +Task_WallyTutorialBagMenu: @ 81ADD98 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081ADE32 + movs r0, 0x10 + ldrsh r1, [r4, r0] + cmp r1, 0xCC + beq _081ADDEC + cmp r1, 0xCC + bgt _081ADDD0 + cmp r1, 0x66 + beq _081ADDDA + b _081ADE2C + .pool +_081ADDD0: + movs r0, 0x99 + lsls r0, 1 + cmp r1, r0 + beq _081ADE0C + b _081ADE2C +_081ADDDA: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0 + bl SwitchBagPocket + b _081ADE2C +_081ADDEC: + movs r0, 0x5 + bl PlaySE + ldrb r0, [r4] + movs r1, 0x2 + bl bag_menu_print_cursor_ + ldr r1, =gUnknown_0203CE7C + movs r0, 0x4 + strh r0, [r1] + adds r0, r5, 0 + bl sub_81AC644 + b _081ADE2C + .pool +_081ADE0C: + movs r0, 0x5 + bl PlaySE + bl bag_menu_remove_some_window + ldrb r0, [r4] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + bl RestoreBagAfterWallyTutorial + adds r0, r5, 0 + bl unknown_ItemMenu_Confirm + b _081ADE32 +_081ADE2C: + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] +_081ADE32: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end Task_WallyTutorialBagMenu + + thumb_func_start unknown_ItemMenu_Show +unknown_ItemMenu_Show: @ 81ADE38 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gSpecialVar_0x8005 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + bl bag_menu_remove_some_window + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_ItemMenu_Show + + thumb_func_start bag_menu_leave_maybe_3 +bag_menu_leave_maybe_3: @ 81ADE6C + push {lr} + ldr r0, =gUnknown_03005DAC + ldr r1, =sub_819FA50 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_leave_maybe_3 + + thumb_func_start unknown_ItemMenu_Give2 +unknown_ItemMenu_Give2: @ 81ADE8C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + movs r1, 0x1 + bl RemoveBagItem + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + bl bag_menu_remove_some_window + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_ItemMenu_Give2 + + thumb_func_start bag_menu_leave_maybe_2 +bag_menu_leave_maybe_2: @ 81ADEBC + push {lr} + ldr r0, =gUnknown_03005DAC + ldr r1, =sub_818DEF4 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_leave_maybe_2 + + thumb_func_start unknown_ItemMenu_Confirm2 +unknown_ItemMenu_Confirm2: @ 81ADEDC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + bl bag_menu_remove_some_window + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_ItemMenu_Confirm2 + + thumb_func_start bag_menu_leave_maybe +bag_menu_leave_maybe: @ 81ADF00 + push {lr} + ldr r0, =gUnknown_03005DAC + ldr r1, =sub_818E564 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_leave_maybe + + thumb_func_start bag_menu_print_pocket_names +bag_menu_print_pocket_names: @ 81ADF20 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + adds r4, r0, 0 + mov r8, r1 + movs r0, 0 + movs r1, 0 + str r0, [sp, 0x14] + str r1, [sp, 0x18] + ldr r1, =0x00ffffff + ldr r0, [sp, 0x14] + ands r0, r1 + movs r1, 0x80 + lsls r1, 21 + orrs r0, r1 + str r0, [sp, 0x14] + ldr r1, =0xffffff00 + ldr r0, [sp, 0x18] + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + str r0, [sp, 0x18] + add r0, sp, 0x14 + bl AddWindow + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x40 + bl GetStringCenterAlignXOffset + lsls r3, r0, 24 + lsrs r3, 24 + movs r7, 0x1 + str r7, [sp] + movs r5, 0 + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0xFF + mov r9, r0 + str r0, [sp, 0xC] + str r7, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl bag_menu_print + mov r2, r8 + cmp r2, 0 + beq _081ADFBA + movs r0, 0x1 + mov r1, r8 + movs r2, 0x40 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + adds r3, 0x40 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + str r7, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0x1 + mov r2, r8 + bl bag_menu_print +_081ADFBA: + adds r0, r6, 0 + movs r1, 0x7 + bl GetWindowAttribute + ldr r1, =gUnknown_0203CE54 + ldr r1, [r1] + ldr r2, =0x00000844 + adds r1, r2 + ldr r2, =0x04000100 + bl CpuSet + adds r0, r6, 0 + bl RemoveWindow + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_pocket_names + + thumb_func_start bag_menu_copy_pocket_name_to_window +bag_menu_copy_pocket_name_to_window: @ 81ADFF8 + push {r4-r7,lr} + adds r7, r0, 0 + cmp r7, 0x8 + bls _081AE002 + movs r7, 0x8 +_081AE002: + ldr r0, =gUnknown_0203CE54 + ldr r4, [r0] + ldr r0, =0x00000844 + adds r4, r0 + movs r0, 0x2 + movs r1, 0x7 + bl GetWindowAttribute + adds r5, r0, 0 + lsls r0, r7, 5 + adds r0, r4, r0 + ldr r6, =0x04000040 + adds r1, r5, 0 + adds r2, r6, 0 + bl CpuSet + adds r0, r7, 0 + adds r0, 0x10 + lsls r0, 5 + adds r4, r0 + movs r0, 0x80 + lsls r0, 1 + adds r5, r0 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl CpuSet + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_copy_pocket_name_to_window + + thumb_func_start setup_bag_menu_textboxes +setup_bag_menu_textboxes: @ 81AE054 + push {r4,lr} + ldr r0, =gUnknown_08614174 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_809882C + movs r0, 0 + movs r1, 0xA + movs r2, 0xD0 + bl copy_textbox_border_tile_patterns_to_vram + movs r0, 0xC0 + movs r1, 0x1 + bl sub_819A2BC + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadPalette + movs r4, 0 +_081AE088: + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081AE088 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end setup_bag_menu_textboxes + + thumb_func_start bag_menu_print +bag_menu_print: @ 81AE0BC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r9, r3 + ldr r3, [sp, 0x30] + ldr r4, [sp, 0x34] + ldr r6, [sp, 0x38] + ldr r5, [sp, 0x3C] + mov r8, r5 + ldr r5, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r7, r9 + lsls r7, 24 + lsrs r7, 24 + mov r9, r7 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + str r4, [sp] + str r6, [sp, 0x4] + lsls r4, r5, 1 + adds r4, r5 + ldr r5, =gUnknown_08614164 + adds r4, r5 + str r4, [sp, 0x8] + mov r4, r8 + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + str r2, [sp, 0x10] + mov r2, r9 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print + + thumb_func_start sub_81AE124 +sub_81AE124: @ 81AE124 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CE54 + ldr r1, [r1] + movs r2, 0x81 + lsls r2, 4 + adds r1, r2 + adds r1, r0 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end sub_81AE124 + + thumb_func_start bag_menu_add_window +bag_menu_add_window: @ 81AE13C + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203CE54 + movs r3, 0x81 + lsls r3, 4 + adds r1, r2, r3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081AE172 + lsls r0, r2, 3 + ldr r1, =gUnknown_086141AC + adds r0, r1 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_081AE172: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end bag_menu_add_window + + thumb_func_start bag_menu_remove_window +bag_menu_remove_window: @ 81AE184 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CE54 + movs r2, 0x81 + lsls r2, 4 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081AE1B8 + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0xFF + strb r0, [r4] +_081AE1B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_remove_window + + thumb_func_start AddItemMessageWindow +@ u8 AddItemMessageWindow(u8 a1) +AddItemMessageWindow: @ 81AE1C4 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203CE54 + movs r3, 0x81 + lsls r3, 4 + adds r1, r2, r3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081AE1E8 + lsls r0, r2, 3 + ldr r1, =gUnknown_086141AC + adds r0, r1 + bl AddWindow + strb r0, [r4] +_081AE1E8: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end AddItemMessageWindow + + thumb_func_start bag_menu_RemoveBagItem_message_window +bag_menu_RemoveBagItem_message_window: @ 81AE1F8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CE54 + movs r2, 0x81 + lsls r2, 4 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081AE22C + movs r1, 0 + bl sub_8197DF8 + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0xFF + strb r0, [r4] +_081AE22C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_RemoveBagItem_message_window + + thumb_func_start bag_menu_yes_no +bag_menu_yes_no: @ 81AE238 + push {lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 21 + ldr r3, =gUnknown_086141AC + adds r1, r3 + movs r3, 0x2 + str r3, [sp] + movs r3, 0x1 + str r3, [sp, 0x4] + movs r3, 0xE + str r3, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x1 + movs r3, 0 + bl CreateYesNoMenuWithCallbacks + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_yes_no + + thumb_func_start bag_menu_AddMoney_window +bag_menu_AddMoney_window: @ 81AE268 + push {r4,lr} + movs r0, 0x9 + bl bag_menu_add_window + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl GetMoney + adds r3, r0, 0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0xE + bl set_window_border_style_and_print_money_box + movs r0, 0x13 + movs r1, 0xB + bl AddMoneyLabelObject + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_AddMoney_window + + thumb_func_start bag_menu_remove_money_window +bag_menu_remove_money_window: @ 81AE2A4 + push {lr} + movs r0, 0x9 + bl bag_menu_remove_window + bl RemoveMoneyLabelObject + pop {r0} + bx r0 + thumb_func_end bag_menu_remove_money_window + + thumb_func_start bag_menu_prepare_tmhm_move_window +bag_menu_prepare_tmhm_move_window: @ 81AE2B4 + push {lr} + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x3 + movs r1, 0x13 + movs r2, 0 + movs r3, 0 + bl blit_move_info_icon + movs r0, 0x3 + movs r1, 0x14 + movs r2, 0 + movs r3, 0xC + bl blit_move_info_icon + movs r0, 0x3 + movs r1, 0x15 + movs r2, 0 + movs r3, 0x18 + bl blit_move_info_icon + movs r0, 0x3 + movs r1, 0x16 + movs r2, 0 + movs r3, 0x24 + bl blit_move_info_icon + movs r0, 0x3 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end bag_menu_prepare_tmhm_move_window + + thumb_func_start PrintTMHMMoveData +PrintTMHMMoveData: @ 81AE2FC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x4 + movs r1, 0 + bl FillWindowPixelBuffer + cmp r4, 0 + bne _081AE354 + movs r4, 0 + movs r5, 0 +_081AE31A: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 26 + lsrs r0, 24 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + movs r0, 0x4 + str r0, [sp, 0x10] + movs r1, 0x1 + ldr r2, =gUnknown_085E8D45 + movs r3, 0x7 + bl bag_menu_print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081AE31A + movs r0, 0x4 + movs r1, 0x2 + bl CopyWindowToVram + b _081AE440 + .pool +_081AE354: + adds r0, r4, 0 + bl ItemIdToBattleMoveId + lsls r0, 16 + lsrs r7, r0, 16 + ldr r1, =gBattleMoves + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r5, r0, r1 + ldrb r1, [r5, 0x2] + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x4 + movs r2, 0 + movs r3, 0 + bl blit_move_info_icon + ldrb r0, [r5, 0x1] + cmp r0, 0x1 + bhi _081AE38C + ldr r2, =gUnknown_085E8D45 + b _081AE39C + .pool +_081AE38C: + ldr r4, =gStringVar1 + ldrb r1, [r5, 0x1] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r2, r4, 0 +_081AE39C: + movs r0, 0xC + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + movs r0, 0x4 + str r0, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x7 + bl bag_menu_print + ldr r2, =gBattleMoves + lsls r1, r7, 1 + adds r0, r1, r7 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x3] + adds r6, r1, 0 + cmp r0, 0 + bne _081AE3D8 + ldr r2, =gUnknown_085E8D45 + b _081AE3E8 + .pool +_081AE3D8: + ldr r4, =gStringVar1 + ldrb r1, [r2, 0x3] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r2, r4, 0 +_081AE3E8: + movs r0, 0x18 + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0xFF + mov r8, r0 + str r0, [sp, 0xC] + movs r0, 0x4 + mov r9, r0 + str r0, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x7 + bl bag_menu_print + ldr r5, =gStringVar1 + ldr r1, =gBattleMoves + adds r0, r6, r7 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x4] + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + movs r0, 0x24 + str r0, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + mov r0, r8 + str r0, [sp, 0xC] + mov r0, r9 + str r0, [sp, 0x10] + movs r0, 0x4 + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x7 + bl bag_menu_print + movs r0, 0x4 + movs r1, 0x2 + bl CopyWindowToVram +_081AE440: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end PrintTMHMMoveData + + thumb_func_start ListMenuDummyTask +@ void ListMenuDummyTask(u8 taskId) +ListMenuDummyTask: @ 81AE458 + bx lr + thumb_func_end ListMenuDummyTask + + thumb_func_start DoMysteryGiftListMenu +@ int DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, int a3, int a4, int a5) +DoMysteryGiftListMenu: @ 81AE45C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r12, r0 + str r1, [sp] + ldr r0, [sp, 0x28] + lsls r2, 24 + lsrs r6, r2, 24 + mov r10, r6 + lsls r3, 16 + lsrs r7, r3, 16 + str r7, [sp, 0x4] + lsls r0, 16 + mov r8, r0 + lsrs r0, 16 + mov r9, r0 + ldr r5, =gUnknown_0203CE84 + ldrb r4, [r5, 0x4] + cmp r4, 0x1 + beq _081AE4F4 + cmp r4, 0x1 + ble _081AE492 + cmp r4, 0x2 + beq _081AE558 +_081AE492: + mov r0, r12 + bl AddWindow + strb r0, [r5, 0x5] + cmp r6, 0x1 + beq _081AE4B0 + cmp r6, 0x2 + bne _081AE4C0 + ldrb r0, [r5, 0x5] + mov r1, r9 + lsls r2, r1, 24 + lsrs r2, 24 + adds r1, r7, 0 + bl sub_809882C +_081AE4B0: + ldrb r0, [r5, 0x5] + mov r3, r8 + lsrs r2, r3, 20 + lsls r2, 24 + lsrs r2, 24 + ldr r1, [sp, 0x4] + bl sub_8098858 +_081AE4C0: + ldr r0, =gUnknown_03006310 + adds r2, r0, 0 + ldr r1, [sp] + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldr r4, =gUnknown_0203CE84 + ldrb r1, [r4, 0x5] + strb r1, [r0, 0x10] + movs r1, 0 + movs r2, 0 + bl ListMenuInit + strb r0, [r4, 0x6] + ldrb r0, [r4, 0x5] + movs r1, 0x1 + bl CopyWindowToVram + movs r0, 0x1 + strb r0, [r4, 0x4] + b _081AE570 + .pool +_081AE4F4: + ldrb r0, [r5, 0x6] + bl ListMenuHandleInput + str r0, [r5] + ldr r1, =gMain + ldrh r0, [r1, 0x2E] + ands r4, r0 + cmp r4, 0 + beq _081AE50A + movs r0, 0x2 + strb r0, [r5, 0x4] +_081AE50A: + ldrh r1, [r1, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AE51E + movs r0, 0x2 + negs r0, r0 + str r0, [r5] + movs r0, 0x2 + strb r0, [r5, 0x4] +_081AE51E: + ldrb r0, [r5, 0x4] + cmp r0, 0x2 + bne _081AE570 + cmp r6, 0 + bne _081AE534 + ldrb r0, [r5, 0x5] + bl ClearWindowTilemap + b _081AE546 + .pool +_081AE534: + mov r4, r10 + cmp r4, 0 + blt _081AE546 + cmp r4, 0x2 + bgt _081AE546 + ldrb r0, [r5, 0x5] + movs r1, 0 + bl sub_819746C +_081AE546: + ldr r0, =gUnknown_0203CE84 + ldrb r0, [r0, 0x5] + movs r1, 0x1 + bl CopyWindowToVram + b _081AE570 + .pool +_081AE558: + ldrb r0, [r5, 0x6] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r5, 0x5] + bl RemoveWindow + movs r0, 0 + strb r0, [r5, 0x4] + ldr r0, [r5] + b _081AE574 +_081AE570: + movs r0, 0x1 + negs r0, r0 +_081AE574: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end DoMysteryGiftListMenu + + thumb_func_start ListMenuInit +@ u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow) +ListMenuInit: @ 81AE584 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + bl ListMenuInitInternal + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5, 0x10] + bl PutWindowTilemap + ldrb r0, [r5, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end ListMenuInit + + thumb_func_start Unused_ListMenuInit2 +@ u8 Unused_ListMenuInit2(struct ListMenuTemplate *listMenuTemplate, int a2, u16 scrollOffset, u16 selectedRow) +Unused_ListMenuInit2: @ 81AE5B0 + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r4, r1, 0 + adds r1, r2, 0 + adds r2, r3, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + bl ListMenuInitInternal + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r4, 0x4] + cmp r0, 0xFF + beq _081AE5F0 + adds r5, r4, 0 +_081AE5D4: + ldrb r0, [r6, 0x10] + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + ldrb r3, [r5, 0x2] + ldrb r4, [r5, 0x3] + str r4, [sp] + ldrb r4, [r5, 0x4] + str r4, [sp, 0x4] + bl PutWindowRectTilemapOverridePalette + adds r5, 0x8 + ldrb r0, [r5, 0x4] + cmp r0, 0xFF + bne _081AE5D4 +_081AE5F0: + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r7, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end Unused_ListMenuInit2 + + thumb_func_start ListMenuHandleInput +@ int ListMenuHandleInput(u8 taskId) +ListMenuHandleInput: @ 81AE604 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r3, r1, r0 + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AE638 + ldrh r0, [r3, 0x18] + ldrh r1, [r3, 0x1A] + adds r0, r1 + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + b _081AE6C2 + .pool +_081AE638: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AE646 + movs r0, 0x2 + negs r0, r0 + b _081AE6C2 +_081AE646: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081AE65A + adds r0, r3, 0 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0 + b _081AE6BA +_081AE65A: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081AE66A + adds r0, r3, 0 + movs r1, 0x1 + movs r2, 0x1 + b _081AE6B8 +_081AE66A: + ldrb r0, [r3, 0x16] + lsrs r0, 6 + cmp r0, 0x1 + beq _081AE680 + cmp r0, 0x1 + ble _081AE67A + cmp r0, 0x2 + beq _081AE68C +_081AE67A: + movs r2, 0 + movs r0, 0 + b _081AE6A0 +_081AE680: + movs r0, 0x20 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0x10 + b _081AE69A +_081AE68C: + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0x80 + lsls r0, 1 +_081AE69A: + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 +_081AE6A0: + cmp r2, 0 + beq _081AE6AE + ldrb r2, [r3, 0xE] + adds r0, r3, 0 + movs r1, 0x1 + movs r3, 0 + b _081AE6BA +_081AE6AE: + cmp r0, 0 + beq _081AE6BE + ldrb r2, [r3, 0xE] + adds r0, r3, 0 + movs r1, 0x1 +_081AE6B8: + movs r3, 0x1 +_081AE6BA: + bl ListMenuChangeSelection +_081AE6BE: + movs r0, 0x1 + negs r0, r0 +_081AE6C2: + pop {r1} + bx r1 + thumb_func_end ListMenuHandleInput + + thumb_func_start sub_81AE6C8 +sub_81AE6C8: @ 81AE6C8 + push {r4,lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r1, r0, r1 + cmp r3, 0 + beq _081AE6E4 + ldrh r0, [r1, 0x18] + strh r0, [r3] +_081AE6E4: + cmp r2, 0 + beq _081AE6EC + ldrh r0, [r1, 0x1A] + strh r0, [r2] +_081AE6EC: + ldrb r0, [r1, 0x1E] + cmp r0, 0xFF + beq _081AE6FC + ldrb r1, [r1, 0x17] + lsrs r1, 6 + subs r1, 0x2 + bl ListMenuRemoveCursorObject +_081AE6FC: + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE6C8 + + thumb_func_start sub_81AE70C +sub_81AE70C: @ 81AE70C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldrb r0, [r4, 0x10] + ldrb r2, [r4, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl FillWindowPixelBuffer + ldrh r1, [r4, 0x18] + ldrh r3, [r4, 0xE] + adds r0, r4, 0 + movs r2, 0 + bl ListMenuPrintEntries + adds r0, r4, 0 + bl ListMenuDrawCursor + ldrb r0, [r4, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE70C + + thumb_func_start sub_81AE750 +sub_81AE750: @ 81AE750 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + lsrs r1, 20 + ldrb r6, [r4, 0x14] + movs r5, 0xF + adds r0, r5, 0 + ands r0, r6 + orrs r0, r1 + strb r0, [r4, 0x14] + ands r2, r5 + ldrb r1, [r4, 0x15] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + orrs r0, r2 + lsrs r3, 20 + ands r0, r5 + orrs r0, r3 + strb r0, [r4, 0x15] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE750 + + thumb_func_start sub_81AE794 +sub_81AE794: @ 81AE794 + push {r4,r5,lr} + adds r3, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldrb r0, [r4, 0x10] + movs r1, 0x1 + adds r2, r3, 0 + bl SetWindowAttribute + ldrb r0, [r4, 0x10] + movs r1, 0x2 + adds r2, r5, 0 + bl SetWindowAttribute + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE794 + + thumb_func_start sub_81AE7D0 +sub_81AE7D0: @ 81AE7D0 + push {r4-r7,lr} + sub sp, 0x20 + mov r12, r2 + ldr r5, [sp, 0x34] + lsls r3, 16 + lsrs r3, 16 + adds r4, r3, 0 + mov r3, sp + ldm r0!, {r2,r6,r7} + stm r3!, {r2,r6,r7} + ldm r0!, {r2,r6,r7} + stm r3!, {r2,r6,r7} + mov r0, sp + movs r3, 0 + strh r1, [r0, 0x18] + mov r1, r12 + strh r1, [r0, 0x1A] + strb r3, [r0, 0x1C] + strb r3, [r0, 0x1D] + cmp r4, 0x40 + bne _081AE804 + movs r1, 0 + movs r2, 0x1 + movs r3, 0 + bl ListMenuChangeSelection +_081AE804: + cmp r4, 0x80 + bne _081AE814 + mov r0, sp + movs r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl ListMenuChangeSelection +_081AE814: + cmp r5, 0 + beq _081AE81E + mov r0, sp + ldrh r0, [r0, 0x18] + strh r0, [r5] +_081AE81E: + ldr r2, [sp, 0x38] + cmp r2, 0 + beq _081AE82A + mov r0, sp + ldrh r0, [r0, 0x1A] + strh r0, [r2] +_081AE82A: + movs r0, 0x1 + negs r0, r0 + add sp, 0x20 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AE7D0 + + thumb_func_start sub_81AE838 +sub_81AE838: @ 81AE838 + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r1, r0 + cmp r2, 0 + beq _081AE856 + ldrh r0, [r1, 0x1A] + ldrh r1, [r1, 0x18] + adds r0, r1 + strh r0, [r2] +_081AE856: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE838 + + thumb_func_start get_coro_args_x18_x1A +get_coro_args_x18_x1A: @ 81AE860 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r1, r0 + cmp r3, 0 + beq _081AE87A + ldrh r0, [r1, 0x18] + strh r0, [r3] +_081AE87A: + cmp r2, 0 + beq _081AE882 + ldrh r0, [r1, 0x1A] + strh r0, [r2] +_081AE882: + pop {r0} + bx r0 + .pool + thumb_func_end get_coro_args_x18_x1A + + thumb_func_start ListMenuGetYCoordForPrintingArrowCursor +@ u8 ListMenuGetYCoordForPrintingArrowCursor(u8 taskId) +ListMenuGetYCoordForPrintingArrowCursor: @ 81AE88C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldrb r0, [r4, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + ldrb r1, [r4, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x1A] + adds r2, r1, 0 + muls r2, r0 + adds r1, r2, 0 + ldrb r0, [r4, 0x14] + lsls r0, 28 + lsrs r0, 28 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuGetYCoordForPrintingArrowCursor + + thumb_func_start ListMenuInitInternal +@ u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow) +ListMenuInitInternal: @ 81AE8D4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + ldr r0, =ListMenuDummyTask + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + adds r0, r7, 0 + ldm r4!, {r1-r3} + stm r0!, {r1-r3} + ldm r4!, {r1-r3} + stm r0!, {r1-r3} + movs r1, 0 + strh r5, [r7, 0x18] + strh r6, [r7, 0x1A] + strb r1, [r7, 0x1C] + strb r1, [r7, 0x1D] + movs r0, 0xFF + strb r0, [r7, 0x1E] + strb r1, [r7, 0x1F] + ldr r3, =gUnknown_03006300 + ldrb r1, [r7, 0x14] + movs r5, 0xF + lsrs r1, 4 + ldrb r4, [r3] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r3] + ldrb r1, [r7, 0x15] + lsls r1, 28 + lsrs r1, 24 + ands r0, r5 + orrs r0, r1 + strb r0, [r3] + ldrb r0, [r7, 0x15] + lsrs r0, 4 + ands r5, r0 + ldrb r0, [r3, 0x1] + ands r2, r0 + orrs r2, r5 + strb r2, [r3, 0x1] + ldrb r1, [r7, 0x16] + lsls r1, 29 + lsrs r1, 17 + ldr r0, [r3] + ldr r2, =0xfffc0fff + ands r0, r2 + orrs r0, r1 + str r0, [r3] + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 26 + strb r0, [r3, 0x3] + ldrh r0, [r7, 0xC] + ldrh r1, [r7, 0xE] + cmp r0, r1 + bcs _081AE96C + strh r0, [r7, 0xE] +_081AE96C: + ldrb r0, [r7, 0x10] + ldrb r2, [r7, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl FillWindowPixelBuffer + ldrh r1, [r7, 0x18] + ldrh r3, [r7, 0xE] + adds r0, r7, 0 + movs r2, 0 + bl ListMenuPrintEntries + adds r0, r7, 0 + bl ListMenuDrawCursor + adds r0, r7, 0 + movs r1, 0x1 + bl ListMenuCallSelectionChangedCallback + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuInitInternal + + thumb_func_start ListMenuPrint +@ void ListMenuPrint(struct ListMenu *listMenu, u8 *str, u8 x, u8 y) +ListMenuPrint: @ 81AE9B4 + push {r4-r7,lr} + sub sp, 0x18 + adds r4, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r12, r3 + ldr r5, =gUnknown_03006300 + ldrb r1, [r5, 0x3] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _081AEA20 + add r1, sp, 0x14 + ldr r2, [r5] + lsls r0, r2, 24 + lsrs r0, 28 + movs r3, 0 + strb r0, [r1] + lsls r0, r2, 28 + lsrs r0, 28 + strb r0, [r1, 0x1] + lsls r0, r2, 20 + lsrs r0, 28 + strb r0, [r1, 0x2] + ldrb r0, [r4, 0x10] + lsls r1, r2, 1 + lsrs r1, 25 + lsls r2, 14 + lsrs r2, 26 + str r2, [sp] + str r3, [sp, 0x4] + add r2, sp, 0x14 + str r2, [sp, 0x8] + movs r2, 0x1 + negs r2, r2 + str r2, [sp, 0xC] + str r6, [sp, 0x10] + adds r2, r7, 0 + mov r3, r12 + bl AddTextPrinterParametrized2 + ldrb r1, [r5, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r5, 0x3] + b _081AEA5E + .pool +_081AEA20: + add r2, sp, 0x14 + ldrb r1, [r4, 0x15] + lsls r0, r1, 28 + lsrs r0, 28 + strb r0, [r2] + ldrb r0, [r4, 0x14] + lsrs r0, 4 + strb r0, [r2, 0x1] + adds r0, r2, 0 + lsls r1, 24 + lsrs r1, 28 + strb r1, [r0, 0x2] + ldrb r0, [r4, 0x10] + ldrb r1, [r4, 0x17] + lsls r1, 26 + lsrs r1, 26 + ldrb r2, [r4, 0x16] + lsls r2, 29 + lsrs r2, 29 + str r2, [sp] + str r3, [sp, 0x4] + add r2, sp, 0x14 + str r2, [sp, 0x8] + movs r2, 0x1 + negs r2, r2 + str r2, [sp, 0xC] + str r6, [sp, 0x10] + adds r2, r7, 0 + mov r3, r12 + bl AddTextPrinterParametrized2 +_081AEA5E: + add sp, 0x18 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuPrint + + thumb_func_start ListMenuPrintEntries +@ void ListMenuPrintEntries(struct ListMenu *listMenu, u16 startIndex, u16 yOffset, u16 count) +ListMenuPrintEntries: @ 81AEA68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp] + lsls r3, 16 + lsrs r3, 16 + mov r10, r3 + ldrb r0, [r4, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + ldrb r1, [r4, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0 + mov r8, r0 + cmp r8, r10 + bge _081AEB10 +_081AEAAA: + ldr r0, [r4] + mov r2, r9 + lsls r1, r2, 3 + adds r0, r1, r0 + ldr r2, [r0, 0x4] + movs r0, 0x3 + negs r0, r0 + adds r5, r1, 0 + cmp r2, r0 + beq _081AEAC2 + ldrb r6, [r4, 0x12] + b _081AEAC4 +_081AEAC2: + ldrb r6, [r4, 0x11] +_081AEAC4: + ldr r0, [sp] + add r0, r8 + ldr r2, [sp, 0x4] + adds r1, r0, 0 + muls r1, r2 + ldrb r0, [r4, 0x14] + lsls r0, 28 + lsrs r0, 28 + adds r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r7, r2, 0 + ldr r3, [r4, 0x8] + cmp r3, 0 + beq _081AEAEE + ldrb r0, [r4, 0x10] + ldr r1, [r4] + adds r1, r5, r1 + ldr r1, [r1, 0x4] + bl _call_via_r3 +_081AEAEE: + ldr r0, [r4] + adds r0, r5, r0 + ldr r1, [r0] + adds r0, r4, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl ListMenuPrint + mov r0, r9 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r0, 0x1 + add r8, r0 + cmp r8, r10 + blt _081AEAAA +_081AEB10: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuPrintEntries + + thumb_func_start ListMenuDrawCursor +@ void ListMenuDrawCursor(struct ListMenu *listMenu) +ListMenuDrawCursor: @ 81AEB20 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldrb r0, [r6, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + ldrb r1, [r6, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r6, 0x13] + mov r8, r1 + ldrh r1, [r6, 0x1A] + muls r1, r0 + ldrb r0, [r6, 0x14] + lsls r0, 28 + lsrs r0, 28 + adds r0, r1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r6, 0x17] + lsrs r0, 6 + cmp r0, 0x1 + beq _081AEC0C + cmp r0, 0x1 + bgt _081AEB66 + cmp r0, 0 + beq _081AEB70 + b _081AEC0C +_081AEB66: + cmp r0, 0x2 + beq _081AEB84 + cmp r0, 0x3 + beq _081AEBCC + b _081AEC0C +_081AEB70: + ldr r1, =gUnknown_085E8D60 + adds r0, r6, 0 + mov r2, r8 + adds r3, r7, 0 + bl ListMenuPrint + b _081AEC0C + .pool +_081AEB84: + ldrb r0, [r6, 0x1E] + cmp r0, 0xFF + bne _081AEB94 + adds r0, r6, 0 + movs r1, 0 + bl ListMenuAddCursorObject + strb r0, [r6, 0x1E] +_081AEB94: + ldrb r5, [r6, 0x1E] + ldrb r0, [r6, 0x10] + movs r1, 0x1 + bl GetWindowAttribute + adds r4, r0, 0 + lsls r4, 19 + ldr r0, =0xffff0000 + adds r4, r0 + lsrs r4, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl GetWindowAttribute + adds r2, r0, 0 + lsls r2, 3 + adds r2, r7 + subs r2, 0x1 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0 + bl ListMenuUpdateCursorObject + b _081AEC0C + .pool +_081AEBCC: + ldrb r0, [r6, 0x1E] + cmp r0, 0xFF + bne _081AEBDC + adds r0, r6, 0 + movs r1, 0x1 + bl ListMenuAddCursorObject + strb r0, [r6, 0x1E] +_081AEBDC: + ldrb r5, [r6, 0x1E] + ldrb r0, [r6, 0x10] + movs r1, 0x1 + bl GetWindowAttribute + adds r4, r0, 0 + lsls r4, 3 + add r4, r8 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl GetWindowAttribute + adds r2, r0, 0 + lsls r2, 3 + adds r2, r7 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl ListMenuUpdateCursorObject +_081AEC0C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuDrawCursor + + thumb_func_start ListMenuAddCursorObject +ListMenuAddCursorObject: @ 81AEC18 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + mov r1, sp + movs r0, 0 + strb r0, [r1] + movs r0, 0xA0 + strb r0, [r1, 0x1] + ldrb r0, [r4, 0x10] + movs r1, 0x3 + bl GetWindowAttribute + mov r1, sp + lsls r0, 3 + adds r0, 0x2 + strh r0, [r1, 0x2] + ldrb r0, [r4, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + mov r1, sp + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x2 + strh r0, [r1, 0x4] + movs r0, 0x80 + lsls r0, 7 + strh r0, [r1, 0x6] + ldr r0, =0x0000ffff + strh r0, [r1, 0x8] + movs r0, 0xF + strb r0, [r1, 0xA] + mov r0, sp + adds r1, r5, 0 + bl ListMenuAddCursorObjectInternal + lsls r0, 24 + lsrs r0, 24 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuAddCursorObject + + thumb_func_start ListMenuErasePrintedCursor +ListMenuErasePrintedCursor: @ 81AEC78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + ldrb r1, [r7, 0x17] + lsrs r0, r1, 6 + cmp r0, 0 + bne _081AECF4 + lsls r0, r1, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + adds r4, r0, 0 + ldrb r0, [r7, 0x16] + lsls r0, 26 + lsrs r0, 29 + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0 + bl GetMenuCursorDimensionByFont + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + ldrb r6, [r7, 0x10] + ldrb r2, [r7, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + ldrb r2, [r7, 0x13] + mov r3, r8 + muls r3, r4 + adds r4, r3, 0 + ldrb r3, [r7, 0x14] + lsls r3, 28 + lsrs r3, 28 + adds r3, r4 + lsls r3, 16 + lsrs r3, 16 + str r5, [sp] + str r0, [sp, 0x4] + adds r0, r6, 0 + bl FillWindowPixelRect +_081AECF4: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuErasePrintedCursor + + thumb_func_start ListMenuUpdateSelectedRowIndexAndScrollOffset +@ u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(int, bool8 movingDown) +ListMenuUpdateSelectedRowIndexAndScrollOffset: @ 81AED00 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + ldrh r3, [r4, 0x1A] + ldrh r5, [r4, 0x18] + cmp r1, 0 + bne _081AED74 + ldrh r0, [r4, 0xE] + cmp r0, 0x1 + bne _081AED18 + movs r2, 0 + b _081AED2A +_081AED18: + ldrh r0, [r4, 0xE] + lsrs r2, r0, 1 + movs r1, 0x1 + ands r1, r0 + adds r2, r1 + subs r0, r2 + subs r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 +_081AED2A: + cmp r5, 0 + bne _081AED50 + cmp r3, 0 + beq _081AEDB6 + ldr r1, [r4] + movs r2, 0x3 + negs r2, r2 +_081AED38: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, r2 + bne _081AEDBA + cmp r3, 0 + bne _081AED38 + b _081AEDB6 +_081AED50: + cmp r3, r2 + bls _081AED70 + ldr r1, [r4] + movs r6, 0x3 + negs r6, r6 +_081AED5A: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, r6 + bne _081AEDBA + cmp r3, r2 + bhi _081AED5A +_081AED70: + subs r0, r5, 0x1 + b _081AEDE2 +_081AED74: + ldrh r0, [r4, 0xE] + cmp r0, 0x1 + bne _081AED7E + movs r2, 0 + b _081AED88 +_081AED7E: + ldrh r0, [r4, 0xE] + lsrs r2, r0, 1 + movs r1, 0x1 + ands r1, r0 + adds r2, r1 +_081AED88: + adds r1, r0, 0 + ldrh r0, [r4, 0xC] + subs r0, r1 + cmp r5, r0 + bne _081AEDC0 + subs r0, r1, 0x1 + cmp r3, r0 + bge _081AEDB6 + ldr r2, [r4] + movs r6, 0x3 + negs r6, r6 + adds r1, r0, 0 +_081AEDA0: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r2 + ldr r0, [r0, 0x4] + cmp r0, r6 + bne _081AEDBA + cmp r3, r1 + blt _081AEDA0 +_081AEDB6: + movs r0, 0 + b _081AEDE8 +_081AEDBA: + strh r3, [r4, 0x1A] + movs r0, 0x1 + b _081AEDE8 +_081AEDC0: + cmp r3, r2 + bcs _081AEDE0 + ldr r1, [r4] + movs r6, 0x3 + negs r6, r6 +_081AEDCA: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, r6 + bne _081AEDBA + cmp r3, r2 + bcc _081AEDCA +_081AEDE0: + adds r0, r5, 0x1 +_081AEDE2: + strh r2, [r4, 0x1A] + strh r0, [r4, 0x18] + movs r0, 0x2 +_081AEDE8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end ListMenuUpdateSelectedRowIndexAndScrollOffset + + thumb_func_start ListMenuScroll +@ void ListMenuScroll(struct ListMenu *listMenu, int a2, bool8 movingDown) +ListMenuScroll: @ 81AEDF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + adds r7, r5, 0 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldrh r0, [r6, 0xE] + cmp r5, r0 + bcc _081AEE2A + ldrb r0, [r6, 0x10] + ldrb r2, [r6, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl FillWindowPixelBuffer + ldrh r1, [r6, 0x18] + ldrh r3, [r6, 0xE] + adds r0, r6, 0 + movs r2, 0 + bl ListMenuPrintEntries + b _081AEF1A +_081AEE2A: + ldrb r0, [r6, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + ldrb r1, [r6, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + mov r1, r8 + cmp r1, 0 + bne _081AEEBC + ldrb r0, [r6, 0x10] + adds r2, r5, 0 + muls r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r1, [r6, 0x15] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0x1 + bl ScrollWindow + ldrh r1, [r6, 0x18] + adds r0, r6, 0 + movs r2, 0 + adds r3, r5, 0 + bl ListMenuPrintEntries + ldrh r0, [r6, 0xE] + adds r1, r0, 0 + muls r1, r4 + adds r0, r1, 0 + ldrb r4, [r6, 0x14] + lsls r4, 28 + lsrs r4, 28 + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x3 + bl GetWindowAttribute + adds r5, r0, 0 + lsls r5, 19 + lsrs r5, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x4 + bl GetWindowAttribute + lsls r0, 3 + subs r0, r4 + lsls r0, 16 + lsrs r0, 16 + ldrb r3, [r6, 0x10] + ldrb r2, [r6, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + str r5, [sp] + str r0, [sp, 0x4] + adds r0, r3, 0 + movs r2, 0 + adds r3, r4, 0 + bl FillWindowPixelRect + b _081AEF1A +_081AEEBC: + ldrb r0, [r6, 0x10] + adds r2, r7, 0 + muls r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r1, [r6, 0x15] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0 + bl ScrollWindow + ldrh r2, [r6, 0xE] + subs r2, r7 + ldrh r1, [r6, 0x18] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + adds r0, r6, 0 + adds r3, r7, 0 + bl ListMenuPrintEntries + ldrb r0, [r6, 0x10] + movs r1, 0x3 + bl GetWindowAttribute + lsls r0, 19 + lsrs r0, 16 + ldrb r3, [r6, 0x10] + ldrb r2, [r6, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + str r0, [sp] + ldrb r0, [r6, 0x14] + lsls r0, 28 + lsrs r0, 28 + str r0, [sp, 0x4] + adds r0, r3, 0 + movs r2, 0 + movs r3, 0 + bl FillWindowPixelRect +_081AEF1A: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuScroll + + thumb_func_start ListMenuChangeSelection +@ bool8 ListMenuChangeSelection(struct ListMenu *listMenu, bool8 updateCursorAndCallCallback, u8 count, bool8 movingDown) +ListMenuChangeSelection: @ 81AEF28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + ldrh r0, [r4, 0x1A] + mov r10, r0 + movs r7, 0 + movs r5, 0 + movs r0, 0 + cmp r7, r8 + bcs _081AEF90 +_081AEF56: + adds r6, r0, 0x1 + b _081AEF76 +_081AEF5A: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r4, 0x18] + ldrh r1, [r4, 0x1A] + adds r0, r1 + ldr r1, [r4] + lsls r0, 3 + adds r0, r1 + ldr r1, [r0, 0x4] + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + bne _081AEF88 +_081AEF76: + adds r0, r4, 0 + mov r1, r9 + bl ListMenuUpdateSelectedRowIndexAndScrollOffset + lsls r0, 24 + lsrs r0, 24 + orrs r5, r0 + cmp r0, 0x2 + beq _081AEF5A +_081AEF88: + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, r8 + bcc _081AEF56 +_081AEF90: + ldr r0, [sp] + cmp r0, 0 + beq _081AEFEE + cmp r5, 0x1 + beq _081AEFA6 + cmp r5, 0x1 + ble _081AEFA2 + cmp r5, 0x3 + ble _081AEFC6 +_081AEFA2: + movs r0, 0x1 + b _081AEFF0 +_081AEFA6: + adds r0, r4, 0 + mov r1, r10 + bl ListMenuErasePrintedCursor + adds r0, r4, 0 + bl ListMenuDrawCursor + adds r0, r4, 0 + movs r1, 0 + bl ListMenuCallSelectionChangedCallback + ldrb r0, [r4, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + b _081AEFEE +_081AEFC6: + adds r0, r4, 0 + mov r1, r10 + bl ListMenuErasePrintedCursor + adds r0, r4, 0 + adds r1, r7, 0 + mov r2, r9 + bl ListMenuScroll + adds r0, r4, 0 + bl ListMenuDrawCursor + adds r0, r4, 0 + movs r1, 0 + bl ListMenuCallSelectionChangedCallback + ldrb r0, [r4, 0x10] + movs r1, 0x2 + bl CopyWindowToVram +_081AEFEE: + movs r0, 0 +_081AEFF0: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end ListMenuChangeSelection + + thumb_func_start ListMenuCallSelectionChangedCallback +@ void ListMenuCallSelectionChangedCallback(struct ListMenu *listMenu, u8 a2) +ListMenuCallSelectionChangedCallback: @ 81AF000 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r3, [r2, 0x4] + cmp r3, 0 + beq _081AF022 + ldrh r0, [r2, 0x18] + ldrh r1, [r2, 0x1A] + adds r0, r1 + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + adds r1, r4, 0 + bl _call_via_r3 +_081AF022: + pop {r4} + pop {r0} + bx r0 + thumb_func_end ListMenuCallSelectionChangedCallback + + thumb_func_start sub_81AF028 +sub_81AF028: @ 81AF028 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r6, =gUnknown_03006300 + movs r5, 0xF + ands r0, r5 + ldrb r3, [r6] + mov r8, r3 + movs r4, 0x10 + negs r4, r4 + adds r3, r4, 0 + mov r7, r8 + ands r3, r7 + orrs r3, r0 + lsrs r1, 20 + ands r3, r5 + orrs r3, r1 + strb r3, [r6] + ands r2, r5 + ldrb r0, [r6, 0x1] + ands r4, r0 + orrs r4, r2 + strb r4, [r6, 0x1] + ldrb r0, [r6, 0x3] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r6, 0x3] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AF028 + + thumb_func_start sub_81AF078 +sub_81AF078: @ 81AF078 + push {lr} + lsls r1, 24 + cmp r1, 0 + bne _081AF086 + movs r0, 0x5 + bl PlaySE +_081AF086: + pop {r0} + bx r0 + thumb_func_end sub_81AF078 + + thumb_func_start sub_81AF08C +sub_81AF08C: @ 81AF08C + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r2, r1, r0 + cmp r3, 0x10 + bhi _081AF154 + lsls r0, r3, 2 + ldr r1, =_081AF0B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AF0B8: + .4byte _081AF0FC + .4byte _081AF0FC + .4byte _081AF100 + .4byte _081AF104 + .4byte _081AF108 + .4byte _081AF10C + .4byte _081AF110 + .4byte _081AF114 + .4byte _081AF118 + .4byte _081AF11C + .4byte _081AF122 + .4byte _081AF12A + .4byte _081AF130 + .4byte _081AF138 + .4byte _081AF140 + .4byte _081AF146 + .4byte _081AF14E +_081AF0FC: + ldr r0, [r2, 0x4] + b _081AF158 +_081AF100: + ldrh r0, [r2, 0xC] + b _081AF158 +_081AF104: + ldrh r0, [r2, 0xE] + b _081AF158 +_081AF108: + ldrb r0, [r2, 0x10] + b _081AF158 +_081AF10C: + ldrb r0, [r2, 0x11] + b _081AF158 +_081AF110: + ldrb r0, [r2, 0x12] + b _081AF158 +_081AF114: + ldrb r0, [r2, 0x13] + b _081AF158 +_081AF118: + ldrb r0, [r2, 0x14] + b _081AF124 +_081AF11C: + ldrb r0, [r2, 0x14] + lsrs r0, 4 + b _081AF158 +_081AF122: + ldrb r0, [r2, 0x15] +_081AF124: + lsls r0, 28 + lsrs r0, 28 + b _081AF158 +_081AF12A: + ldrb r0, [r2, 0x15] + lsrs r0, 4 + b _081AF158 +_081AF130: + ldrb r0, [r2, 0x16] + lsls r0, 29 + lsrs r0, 29 + b _081AF158 +_081AF138: + ldrb r0, [r2, 0x16] + lsls r0, 26 + lsrs r0, 29 + b _081AF158 +_081AF140: + ldrb r0, [r2, 0x16] + lsrs r0, 6 + b _081AF158 +_081AF146: + ldrb r0, [r2, 0x17] + lsls r0, 26 + lsrs r0, 26 + b _081AF158 +_081AF14E: + ldrb r0, [r2, 0x17] + lsrs r0, 6 + b _081AF158 +_081AF154: + movs r0, 0x1 + negs r0, r0 +_081AF158: + pop {r1} + bx r1 + thumb_func_end sub_81AF08C + + thumb_func_start sub_81AF15C +sub_81AF15C: @ 81AF15C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r3, r1, r0 + cmp r4, 0x10 + bhi _081AF25C + lsls r0, r4, 2 + ldr r1, =_081AF188 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AF188: + .4byte _081AF1CC + .4byte _081AF1CC + .4byte _081AF1D0 + .4byte _081AF1D4 + .4byte _081AF1D8 + .4byte _081AF1DC + .4byte _081AF1E0 + .4byte _081AF1E4 + .4byte _081AF1E8 + .4byte _081AF1F4 + .4byte _081AF202 + .4byte _081AF20E + .4byte _081AF21C + .4byte _081AF228 + .4byte _081AF236 + .4byte _081AF244 + .4byte _081AF250 +_081AF1CC: + str r2, [r3, 0x4] + b _081AF25C +_081AF1D0: + strh r2, [r3, 0xC] + b _081AF25C +_081AF1D4: + strh r2, [r3, 0xE] + b _081AF25C +_081AF1D8: + strb r2, [r3, 0x10] + b _081AF25C +_081AF1DC: + strb r2, [r3, 0x11] + b _081AF25C +_081AF1E0: + strb r2, [r3, 0x12] + b _081AF25C +_081AF1E4: + strb r2, [r3, 0x13] + b _081AF25C +_081AF1E8: + movs r0, 0xF + ands r2, r0 + ldrb r1, [r3, 0x14] + movs r0, 0x10 + negs r0, r0 + b _081AF1FA +_081AF1F4: + lsls r2, 4 + ldrb r1, [r3, 0x14] + movs r0, 0xF +_081AF1FA: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x14] + b _081AF25C +_081AF202: + movs r0, 0xF + ands r2, r0 + ldrb r1, [r3, 0x15] + movs r0, 0x10 + negs r0, r0 + b _081AF214 +_081AF20E: + lsls r2, 4 + ldrb r1, [r3, 0x15] + movs r0, 0xF +_081AF214: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x15] + b _081AF25C +_081AF21C: + movs r0, 0x7 + ands r2, r0 + ldrb r1, [r3, 0x16] + movs r0, 0x8 + negs r0, r0 + b _081AF23C +_081AF228: + movs r0, 0x7 + ands r2, r0 + lsls r2, 3 + ldrb r1, [r3, 0x16] + movs r0, 0x39 + negs r0, r0 + b _081AF23C +_081AF236: + lsls r2, 6 + ldrb r1, [r3, 0x16] + movs r0, 0x3F +_081AF23C: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x16] + b _081AF25C +_081AF244: + movs r0, 0x3F + ands r2, r0 + ldrb r1, [r3, 0x17] + movs r0, 0x40 + negs r0, r0 + b _081AF256 +_081AF250: + lsls r2, 6 + ldrb r1, [r3, 0x17] + movs r0, 0x3F +_081AF256: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x17] +_081AF25C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81AF15C + + thumb_func_start sub_81AF264 +sub_81AF264: @ 81AF264 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081AF276 + cmp r0, 0x1 + beq _081AF28A + b _081AF2E4 +_081AF276: + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartSpriteAnim + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _081AF2E4 +_081AF28A: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081AF29A + cmp r0, 0x1 + beq _081AF2C0 + ldrh r2, [r4, 0x38] + b _081AF2DE +_081AF29A: + movs r0, 0x34 + ldrsh r3, [r4, r0] + ldr r1, =gSineTable + ldrh r2, [r4, 0x38] + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + muls r0, r3 + cmp r0, 0 + bge _081AF2B4 + adds r0, 0xFF +_081AF2B4: + asrs r0, 8 + strh r0, [r4, 0x24] + b _081AF2DE + .pool +_081AF2C0: + movs r0, 0x34 + ldrsh r3, [r4, r0] + ldr r1, =gSineTable + ldrh r2, [r4, 0x38] + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + muls r0, r3 + cmp r0, 0 + bge _081AF2DA + adds r0, 0xFF +_081AF2DA: + asrs r0, 8 + strh r0, [r4, 0x26] +_081AF2DE: + ldrh r0, [r4, 0x36] + adds r0, r2, r0 + strh r0, [r4, 0x38] +_081AF2E4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AF264 + + thumb_func_start AddScrollIndicatorArrowObject +AddScrollIndicatorArrowObject: @ 81AF2F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + adds r6, r0, 0 + ldr r5, [sp, 0x30] + lsls r6, 24 + lsrs r6, 24 + mov r8, r6 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r5, 16 + lsrs r5, 16 + mov r12, r5 + mov r4, sp + ldr r0, =gUnknown_08614244 + ldm r0!, {r5-r7} + stm r4!, {r5-r7} + ldm r0!, {r5-r7} + stm r4!, {r5-r7} + mov r0, sp + movs r4, 0 + strh r3, [r0] + mov r3, r12 + strh r3, [r0, 0x2] + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSprites + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r1 + adds r5, r3, 0 + adds r5, 0x3E + ldrb r1, [r5] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r5] + strh r4, [r3, 0x2E] + ldr r1, =gUnknown_086141FC + mov r5, r8 + lsls r6, r5, 2 + adds r6, r1 + ldrb r2, [r6] + lsls r1, r2, 28 + lsrs r1, 28 + strh r1, [r3, 0x30] + lsrs r2, 4 + strh r2, [r3, 0x32] + ldrb r1, [r6, 0x1] + strh r1, [r3, 0x34] + ldrh r1, [r6, 0x2] + strh r1, [r3, 0x36] + strh r4, [r3, 0x38] + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end AddScrollIndicatorArrowObject + + thumb_func_start AddScrollIndicatorArrowPair +AddScrollIndicatorArrowPair: @ 81AF380 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r6, r0, 0 + mov r9, r1 + ldr r0, =gUnknown_086142C8 + str r0, [sp, 0x4] + ldr r5, =0xffff0000 + ldr r0, [sp, 0x8] + ands r0, r5 + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + ldrh r1, [r6, 0xA] + lsls r1, 16 + ldr r4, =0x0000ffff + ands r0, r4 + orrs r0, r1 + str r0, [sp, 0x8] + add r0, sp, 0x4 + bl LoadCompressedObjectPic + ldrh r2, [r6, 0xC] + cmp r2, r4 + bne _081AF3DC + ldr r0, =gUnknown_086142A8 + ldrb r1, [r6, 0xE] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl LoadPalette + b _081AF3EE + .pool +_081AF3DC: + ldr r0, =gUnknown_086142A8 + str r0, [sp, 0xC] + add r0, sp, 0xC + ldr r1, [r0, 0x4] + ands r1, r5 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadSpritePalette +_081AF3EE: + ldr r0, =Task_ScrollIndicatorArrowPair + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + movs r0, 0 + strb r0, [r7] + mov r0, r9 + str r0, [r7, 0x4] + ldrh r0, [r6, 0x6] + strh r0, [r7, 0x8] + ldrh r0, [r6, 0x8] + strh r0, [r7, 0xA] + ldrh r0, [r6, 0xA] + strh r0, [r7, 0xE] + ldrh r0, [r6, 0xC] + strh r0, [r7, 0x10] + ldrb r0, [r6] + ldrb r1, [r6, 0x1] + ldrb r2, [r6, 0x2] + ldrh r3, [r6, 0xA] + ldrh r4, [r6, 0xC] + str r4, [sp] + bl AddScrollIndicatorArrowObject + strb r0, [r7, 0xC] + ldrb r0, [r6, 0x3] + ldrb r1, [r6, 0x4] + ldrb r2, [r6, 0x5] + ldrh r3, [r6, 0xA] + ldrh r4, [r6, 0xC] + str r4, [sp] + bl AddScrollIndicatorArrowObject + strb r0, [r7, 0xD] + ldrh r1, [r6, 0xC] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081AF47C + ldr r5, =gSprites + ldrb r0, [r7, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r3, [r6, 0xE] + lsls r3, 4 + ldrb r4, [r1, 0x5] + movs r2, 0xF + adds r0, r2, 0 + ands r0, r4 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r1, [r7, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r6, 0xE] + lsls r1, 4 + ldrb r3, [r0, 0x5] + ands r2, r3 + orrs r2, r1 + strb r2, [r0, 0x5] +_081AF47C: + mov r0, r8 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end AddScrollIndicatorArrowPair + + thumb_func_start AddScrollIndicatorArrowPairParametrized +AddScrollIndicatorArrowPairParametrized: @ 81AF4A0 + push {r4,lr} + adds r4, r1, 0 + subs r0, 0x2 + cmp r0, 0x1 + bhi _081AF4C4 + ldr r0, =gUnknown_0203CE8C + movs r1, 0x2 + strb r1, [r0] + strb r4, [r0, 0x1] + strb r2, [r0, 0x2] + movs r1, 0x3 + strb r1, [r0, 0x3] + strb r4, [r0, 0x4] + strb r3, [r0, 0x5] + b _081AF4D6 + .pool +_081AF4C4: + ldr r0, =gUnknown_0203CE8C + movs r1, 0 + strb r1, [r0] + strb r2, [r0, 0x1] + strb r4, [r0, 0x2] + movs r1, 0x1 + strb r1, [r0, 0x3] + strb r3, [r0, 0x4] + strb r4, [r0, 0x5] +_081AF4D6: + adds r2, r0, 0 + movs r1, 0 + movs r0, 0 + strh r0, [r2, 0x6] + ldr r0, [sp, 0x8] + strh r0, [r2, 0x8] + ldr r0, [sp, 0xC] + strh r0, [r2, 0xA] + ldr r0, [sp, 0x10] + strh r0, [r2, 0xC] + strb r1, [r2, 0xE] + adds r0, r2, 0 + ldr r1, [sp, 0x14] + bl AddScrollIndicatorArrowPair + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end AddScrollIndicatorArrowPairParametrized + + thumb_func_start Task_ScrollIndicatorArrowPair +Task_ScrollIndicatorArrowPair: @ 81AF504 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + ldr r0, [r4, 0x4] + ldrh r5, [r0] + ldrh r0, [r4, 0x8] + cmp r5, r0 + bne _081AF548 + ldr r0, =0x0000ffff + cmp r5, r0 + beq _081AF548 + ldr r3, =gSprites + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081AF55E + .pool +_081AF548: + ldr r3, =gSprites + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081AF55E: + strb r1, [r0] + ldrh r0, [r4, 0xA] + cmp r5, r0 + bne _081AF580 + ldrb r1, [r4, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081AF594 + .pool +_081AF580: + ldrb r1, [r4, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081AF594: + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end Task_ScrollIndicatorArrowPair + + thumb_func_start Task_ScrollIndicatorArrowPairOnMainMenu +Task_ScrollIndicatorArrowPairOnMainMenu: @ 81AF59C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081AF5E8 + ldr r3, =gSprites + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldrb r1, [r4, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081AF612 + .pool +_081AF5E8: + ldr r3, =gSprites + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldrb r1, [r4, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081AF612: + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end Task_ScrollIndicatorArrowPairOnMainMenu + + thumb_func_start RemoveScrollIndicatorArrowPair +RemoveScrollIndicatorArrowPair: @ 81AF620 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldrh r0, [r5, 0xE] + ldr r4, =0x0000ffff + cmp r0, r4 + beq _081AF63E + bl FreeSpriteTilesByTag +_081AF63E: + ldrh r0, [r5, 0x10] + cmp r0, r4 + beq _081AF648 + bl FreeSpritePaletteByTag +_081AF648: + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl DestroySprite + ldrb r1, [r5, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + adds r0, r6, 0 + bl DestroyTask + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveScrollIndicatorArrowPair + + thumb_func_start ListMenuAddCursorObjectInternal +ListMenuAddCursorObjectInternal: @ 81AF680 + push {lr} + cmp r1, 0 + beq _081AF68A + cmp r1, 0x1 + beq _081AF690 +_081AF68A: + bl ListMenuAddRedOutlineCursorObject + b _081AF694 +_081AF690: + bl ListMenuAddRedArrowCursorObject +_081AF694: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end ListMenuAddCursorObjectInternal + + thumb_func_start ListMenuUpdateCursorObject +@ void ListMenuUpdateCursorObject(u8 taskId, u16 x, u16 y, u32 a4) +ListMenuUpdateCursorObject: @ 81AF69C + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + cmp r3, 0 + beq _081AF6B4 + cmp r3, 0x1 + beq _081AF6BA + b _081AF6BE +_081AF6B4: + bl ListMenuUpdateRedOutlineCursorObject + b _081AF6BE +_081AF6BA: + bl ListMenuUpdateRedArrowCursorObject +_081AF6BE: + pop {r0} + bx r0 + thumb_func_end ListMenuUpdateCursorObject + + thumb_func_start ListMenuRemoveCursorObject +ListMenuRemoveCursorObject: @ 81AF6C4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r1, 0 + beq _081AF6D4 + cmp r1, 0x1 + beq _081AF6DA + b _081AF6DE +_081AF6D4: + bl ListMenuRemoveRedOutlineCursorObject + b _081AF6DE +_081AF6DA: + bl ListMenuRemoveRedArrowCursorObject +_081AF6DE: + pop {r0} + bx r0 + thumb_func_end ListMenuRemoveCursorObject + + thumb_func_start Task_RedOutlineCursor +Task_RedOutlineCursor: @ 81AF6E4 + bx lr + thumb_func_end Task_RedOutlineCursor + + thumb_func_start ListMenuGetRedOutlineCursorSpriteCount +ListMenuGetRedOutlineCursorSpriteCount: @ 81AF6E8 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + movs r3, 0x4 + cmp r0, 0x10 + bls _081AF708 + movs r2, 0x8 + subs r0, 0x8 + cmp r2, r0 + bge _081AF708 +_081AF700: + adds r3, 0x2 + adds r2, 0x8 + cmp r2, r0 + blt _081AF700 +_081AF708: + cmp r1, 0x10 + bls _081AF71C + movs r2, 0x8 + subs r1, 0x8 + cmp r2, r1 + bge _081AF71C +_081AF714: + adds r3, 0x2 + adds r2, 0x8 + cmp r2, r1 + blt _081AF714 +_081AF71C: + lsls r0, r3, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end ListMenuGetRedOutlineCursorSpriteCount + + thumb_func_start ListMenuSetUpRedOutlineCursorSpriteOamTable +ListMenuSetUpRedOutlineCursorSpriteOamTable: @ 81AF724 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r3, r2, 0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldr r0, =gUnknown_0861425C + ldr r0, [r0] + str r0, [r3] + movs r1, 0x88 + strb r1, [r3] + strb r1, [r3, 0x1] + ldr r0, =gUnknown_08614260 + ldr r0, [r0] + str r0, [r3, 0x4] + mov r2, r8 + adds r2, 0x80 + strb r2, [r3, 0x4] + strb r1, [r3, 0x5] + ldr r0, =gUnknown_08614274 + ldr r0, [r0] + str r0, [r3, 0x8] + strb r1, [r3, 0x8] + mov r4, r9 + adds r4, 0x80 + strb r4, [r3, 0x9] + ldr r0, =gUnknown_08614278 + ldr r0, [r0] + str r0, [r3, 0xC] + strb r2, [r3, 0xC] + strb r4, [r3, 0xD] + movs r0, 0x4 + mov r12, r0 + mov r2, r8 + cmp r2, 0x10 + bls _081AF7B8 + movs r2, 0x8 + mov r5, r8 + subs r5, 0x8 + cmp r2, r5 + bge _081AF7B8 + ldr r0, =gUnknown_08614264 + ldr r0, [r0] + str r0, [sp] + ldr r0, =gUnknown_08614270 + ldr r6, [r0] + adds r1, r3, 0 + adds r1, 0x10 + movs r7, 0x88 + mov r10, r7 +_081AF796: + ldr r0, [sp] + str r0, [r1] + adds r0, r2, 0 + subs r0, 0x78 + strb r0, [r1] + mov r7, r10 + strb r7, [r1, 0x1] + adds r1, 0x4 + str r6, [r1] + strb r0, [r1] + strb r4, [r1, 0x1] + adds r1, 0x4 + movs r0, 0x2 + add r12, r0 + adds r2, 0x8 + cmp r2, r5 + blt _081AF796 +_081AF7B8: + mov r2, r9 + cmp r2, 0x10 + bls _081AF7F6 + movs r1, 0x8 + mov r4, r9 + subs r4, 0x8 + cmp r1, r4 + bge _081AF7F6 + ldr r0, =gUnknown_08614268 + ldr r6, [r0] + ldr r0, =gUnknown_0861426C + ldr r5, [r0] + mov r7, r12 + lsls r0, r7, 2 + adds r2, r0, r3 + movs r7, 0x88 + mov r3, r8 + adds r3, 0x80 +_081AF7DC: + str r6, [r2] + strb r7, [r2] + adds r0, r1, 0 + subs r0, 0x78 + strb r0, [r2, 0x1] + adds r2, 0x4 + str r5, [r2] + strb r3, [r2] + strb r0, [r2, 0x1] + adds r2, 0x4 + adds r1, 0x8 + cmp r1, r4 + blt _081AF7DC +_081AF7F6: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuSetUpRedOutlineCursorSpriteOamTable + + thumb_func_start ListMenuAddRedOutlineCursorObject +ListMenuAddRedOutlineCursorObject: @ 81AF828 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x28 + adds r6, r0, 0 + ldr r0, =gUnknown_08614338 + str r0, [sp, 0x18] + ldr r5, =0xffff0000 + add r0, sp, 0x18 + ldr r1, [r0, 0x4] + ands r1, r5 + movs r2, 0x80 + lsls r2, 1 + orrs r1, r2 + ldrh r2, [r6, 0x6] + lsls r2, 16 + ldr r3, =0x0000ffff + ands r1, r3 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadCompressedObjectPic + ldrh r2, [r6, 0x8] + ldr r7, =0x0000ffff + cmp r2, r7 + bne _081AF884 + ldr r0, =gUnknown_086142A8 + ldrb r1, [r6, 0xA] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl LoadPalette + b _081AF896 + .pool +_081AF884: + ldr r0, =gUnknown_086142A8 + str r0, [sp, 0x20] + add r0, sp, 0x20 + ldr r1, [r0, 0x4] + ands r1, r5 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadSpritePalette +_081AF896: + ldr r0, =Task_RedOutlineCursor + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldrh r0, [r6, 0x6] + movs r3, 0 + mov r8, r3 + strh r0, [r5, 0xE] + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x10] + ldrh r0, [r6, 0x2] + ldrh r1, [r6, 0x4] + bl ListMenuGetRedOutlineCursorSpriteCount + strb r0, [r5] + ldrb r0, [r5] + lsls r0, 2 + bl Alloc + adds r2, r0, 0 + str r2, [r5, 0x8] + str r2, [r5, 0x4] + ldrh r0, [r6, 0x2] + ldrh r1, [r6, 0x4] + bl ListMenuSetUpRedOutlineCursorSpriteOamTable + mov r1, sp + ldr r0, =gDummySpriteTemplate + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + mov r1, sp + ldrh r0, [r6, 0x6] + strh r0, [r1] + ldrh r0, [r6, 0x8] + strh r0, [r1, 0x2] + ldrb r1, [r6] + adds r1, 0x78 + ldrb r2, [r6, 0x1] + adds r2, 0x78 + mov r0, sp + movs r3, 0 + bl CreateSprite + strb r0, [r5, 0xC] + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r7, =gSprites + adds r0, r7 + adds r1, r5, 0 + bl SetSubspriteTables + ldrb r0, [r5, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x43 + mov r1, r8 + strb r1, [r0] + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x42 + ldrb r2, [r0] + movs r1, 0x40 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldrh r1, [r6, 0x8] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081AF96E + ldrb r0, [r5, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r6, 0xA] + lsls r2, 4 + ldrb r3, [r1, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_081AF96E: + adds r0, r4, 0 + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuAddRedOutlineCursorObject + + thumb_func_start ListMenuUpdateRedOutlineCursorObject +@ void ListMenuUpdateRedOutlineCursorObject(u8 taskId, u16 x, u16 y) +ListMenuUpdateRedOutlineCursorObject: @ 81AF994 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 3 + ldr r0, =gTasks + 0x8 + adds r3, r0 + ldr r5, =gSprites + ldrb r4, [r3, 0xC] + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + adds r1, 0x78 + strh r1, [r0, 0x20] + ldrb r1, [r3, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r2, 0x78 + strh r2, [r0, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuUpdateRedOutlineCursorObject + + thumb_func_start ListMenuRemoveRedOutlineCursorObject +ListMenuRemoveRedOutlineCursorObject: @ 81AF9D8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r0, [r4, 0x8] + bl Free + ldrh r0, [r4, 0xE] + ldr r6, =0x0000ffff + cmp r0, r6 + beq _081AF9FC + bl FreeSpriteTilesByTag +_081AF9FC: + ldrh r0, [r4, 0x10] + cmp r0, r6 + beq _081AFA06 + bl FreeSpritePaletteByTag +_081AFA06: + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r5, 0 + bl DestroyTask + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuRemoveRedOutlineCursorObject + + thumb_func_start ObjectCB_RedArrowCursor +ObjectCB_RedArrowCursor: @ 81AFA30 + push {lr} + adds r2, r0, 0 + ldr r1, =gSineTable + ldrh r3, [r2, 0x2E] + lsls r0, r3, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _081AFA48 + adds r0, 0x3F +_081AFA48: + asrs r0, 6 + strh r0, [r2, 0x24] + adds r0, r3, 0 + adds r0, 0x8 + strh r0, [r2, 0x2E] + pop {r0} + bx r0 + .pool + thumb_func_end ObjectCB_RedArrowCursor + + thumb_func_start Task_RedArrowCursor +Task_RedArrowCursor: @ 81AFA5C + bx lr + thumb_func_end Task_RedArrowCursor + + thumb_func_start ListMenuAddRedArrowCursorObject +ListMenuAddRedArrowCursorObject: @ 81AFA60 + push {r4-r7,lr} + sub sp, 0x28 + adds r5, r0, 0 + ldr r0, =gUnknown_08614378 + str r0, [sp, 0x18] + ldr r6, =0xffff0000 + add r0, sp, 0x18 + ldr r1, [r0, 0x4] + ands r1, r6 + movs r2, 0x80 + orrs r1, r2 + ldrh r2, [r5, 0x6] + lsls r2, 16 + ldr r4, =0x0000ffff + ands r1, r4 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadCompressedObjectPic + ldrh r2, [r5, 0x8] + cmp r2, r4 + bne _081AFAB4 + ldr r0, =gUnknown_086142A8 + ldrb r1, [r5, 0xA] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl LoadPalette + b _081AFAC6 + .pool +_081AFAB4: + ldr r0, =gUnknown_086142A8 + str r0, [sp, 0x20] + add r0, sp, 0x20 + ldr r1, [r0, 0x4] + ands r1, r6 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadSpritePalette +_081AFAC6: + ldr r0, =Task_RedArrowCursor + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x4] + mov r1, sp + ldr r0, =gUnknown_08614290 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + mov r1, sp + ldrh r0, [r5, 0x6] + strh r0, [r1] + ldrh r0, [r5, 0x8] + strh r0, [r1, 0x2] + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + mov r0, sp + movs r3, 0 + bl CreateSprite + strb r0, [r4] + ldr r3, =gSprites + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r2, 0x8 + strh r2, [r0, 0x24] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x26] + ldrh r1, [r5, 0x8] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081AFB46 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r5, 0xA] + lsls r2, 4 + ldrb r3, [r1, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_081AFB46: + adds r0, r6, 0 + add sp, 0x28 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuAddRedArrowCursorObject + + thumb_func_start ListMenuUpdateRedArrowCursorObject +@ void ListMenuUpdateRedArrowCursorObject(u8 taskId, u16 x, u16 y) +ListMenuUpdateRedArrowCursorObject: @ 81AFB68 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 3 + ldr r0, =gTasks + 0x8 + adds r3, r0 + ldr r5, =gSprites + ldrb r4, [r3] + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + strh r1, [r0, 0x20] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuUpdateRedArrowCursorObject + + thumb_func_start ListMenuRemoveRedArrowCursorObject +ListMenuRemoveRedArrowCursorObject: @ 81AFBA0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldrh r0, [r4, 0x2] + ldr r6, =0x0000ffff + cmp r0, r6 + beq _081AFBBE + bl FreeSpriteTilesByTag +_081AFBBE: + ldrh r0, [r4, 0x4] + cmp r0, r6 + beq _081AFBC8 + bl FreeSpritePaletteByTag +_081AFBC8: + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r5, 0 + bl DestroyTask + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuRemoveRedArrowCursorObject + + thumb_func_start sub_81AFBF0 +sub_81AFBF0: @ 81AFBF0 + push {lr} + ldr r1, =gUnknown_0203CE9C + movs r2, 0 + adds r0, r1, 0 + adds r0, 0x1C +_081AFBFA: + str r2, [r0] + subs r0, 0x4 + cmp r0, r1 + bge _081AFBFA + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AFBF0 + + thumb_func_start sub_81AFC0C +sub_81AFC0C: @ 81AFC0C + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x7 + bhi _081AFC20 + ldr r1, =gUnknown_0203CE9C + lsls r0, 2 + adds r0, r1 + str r2, [r0] +_081AFC20: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AFC0C + + thumb_func_start sub_81AFC28 +sub_81AFC28: @ 81AFC28 + push {r4,r5,lr} + adds r2, r0, 0 + adds r4, r1, 0 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + beq _081AFC68 + ldr r5, =gUnknown_0203CE9C +_081AFC38: + cmp r1, 0xF7 + beq _081AFC48 + strb r1, [r2] + adds r4, 0x1 + adds r2, 0x1 + b _081AFC60 + .pool +_081AFC48: + adds r4, 0x1 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + cmp r1, 0 + beq _081AFC5E + adds r0, r2, 0 + bl StringCopy + adds r2, r0, 0 +_081AFC5E: + adds r4, 0x1 +_081AFC60: + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _081AFC38 +_081AFC68: + movs r0, 0xFF + strb r0, [r2] + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81AFC28 + + thumb_func_start sub_81AFC74 +sub_81AFC74: @ 81AFC74 + lsls r0, 24 + ldr r1, =gUnknown_0203CE9C + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .pool + thumb_func_end sub_81AFC74 + + thumb_func_start sav1_are_mapnumbers_in_given_list +sav1_are_mapnumbers_in_given_list: @ 81AFC84 + push {r4,lr} + adds r2, r0, 0 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + lsls r1, 8 + ldrb r0, [r0, 0x5] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r0, [r2] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _081AFCC4 + adds r4, r1, 0 + adds r1, r2, 0 +_081AFCAA: + ldrh r0, [r1] + cmp r0, r3 + bne _081AFCBC + movs r0, 0x1 + b _081AFCC6 + .pool +_081AFCBC: + adds r1, 0x2 + ldrh r0, [r1] + cmp r0, r4 + bne _081AFCAA +_081AFCC4: + movs r0, 0 +_081AFCC6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sav1_are_mapnumbers_in_given_list + + thumb_func_start sav1_is_in_pokecenter +sav1_is_in_pokecenter: @ 81AFCCC + push {lr} + ldr r0, =gUnknown_086143BC + bl sav1_are_mapnumbers_in_given_list + pop {r1} + bx r1 + .pool + thumb_func_end sav1_is_in_pokecenter + + thumb_func_start sub_81AFCDC +sub_81AFCDC: @ 81AFCDC + push {lr} + ldr r0, =gUnknown_0861440A + bl sav1_are_mapnumbers_in_given_list + pop {r1} + bx r1 + .pool + thumb_func_end sub_81AFCDC + + thumb_func_start sub_81AFCEC +sub_81AFCEC: @ 81AFCEC + push {lr} + ldr r0, =gUnknown_0861440E + bl sav1_are_mapnumbers_in_given_list + pop {r1} + bx r1 + .pool + thumb_func_end sub_81AFCEC + + thumb_func_start sav2_set_x9_bit3_when_sav1_in_pokecenter +sav2_set_x9_bit3_when_sav1_in_pokecenter: @ 81AFCFC + push {lr} + bl sav1_is_in_pokecenter + cmp r0, 0 + bne _081AFD18 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFD + ands r0, r1 + b _081AFD22 + .pool +_081AFD18: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x2 + orrs r0, r1 +_081AFD22: + strb r0, [r2, 0x9] + pop {r0} + bx r0 + .pool + thumb_func_end sav2_set_x9_bit3_when_sav1_in_pokecenter + + thumb_func_start sub_81AFD2C +sub_81AFD2C: @ 81AFD2C + push {lr} + bl sub_81AFCDC + cmp r0, 0 + bne _081AFD48 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFB + ands r0, r1 + b _081AFD52 + .pool +_081AFD48: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x4 + orrs r0, r1 +_081AFD52: + strb r0, [r2, 0x9] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AFD2C + + thumb_func_start sub_81AFD5C +sub_81AFD5C: @ 81AFD5C + push {lr} + bl sub_81AFCEC + cmp r0, 0 + bne _081AFD78 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xF7 + ands r0, r1 + b _081AFD82 + .pool +_081AFD78: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x8 + orrs r0, r1 +_081AFD82: + strb r0, [r2, 0x9] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AFD5C + + thumb_func_start sav2_set_x9_depending_on_sav1_map +sav2_set_x9_depending_on_sav1_map: @ 81AFD8C + push {lr} + bl sav2_set_x9_bit3_when_sav1_in_pokecenter + bl sub_81AFD2C + bl sub_81AFD5C + pop {r0} + bx r0 + thumb_func_end sav2_set_x9_depending_on_sav1_map + + thumb_func_start sub_81AFDA0 +sub_81AFDA0: @ 81AFDA0 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r2, 0xA8 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + movs r1, 0x1 + orrs r0, r1 + movs r1, 0x2 + orrs r0, r1 + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x10 + orrs r0, r1 + movs r1, 0x20 + orrs r0, r1 + movs r1, 0x8 + orrs r0, r1 + str r0, [r2] + bx lr + .pool + thumb_func_end sub_81AFDA0 + + thumb_func_start sub_81AFDD0 +sub_81AFDD0: @ 81AFDD0 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x80 + orrs r0, r1 + strb r0, [r2, 0x9] + bx lr + .pool + thumb_func_end sub_81AFDD0 + + thumb_func_start AllocItemIconTemporaryBuffers +@ bool8 AllocItemIconTemporaryBuffers() +AllocItemIconTemporaryBuffers: @ 81AFDE4 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CEBC + movs r0, 0x90 + lsls r0, 1 + bl Alloc + str r0, [r5] + cmp r0, 0 + beq _081AFE1A + ldr r4, =gUnknown_0203CEC0 + movs r0, 0x80 + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + cmp r0, 0 + beq _081AFE14 + movs r0, 0x1 + b _081AFE1C + .pool +_081AFE14: + ldr r0, [r5] + bl Free +_081AFE1A: + movs r0, 0 +_081AFE1C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end AllocItemIconTemporaryBuffers + + thumb_func_start FreeItemIconTemporaryBuffers +@ void FreeItemIconTemporaryBuffers() +FreeItemIconTemporaryBuffers: @ 81AFE24 + push {lr} + ldr r0, =gUnknown_0203CEBC + ldr r0, [r0] + bl Free + ldr r0, =gUnknown_0203CEC0 + ldr r0, [r0] + bl Free + pop {r0} + bx r0 + .pool + thumb_func_end FreeItemIconTemporaryBuffers + + thumb_func_start CopyItemIconPicTo4x4Buffer +@ void CopyItemIconPicTo4x4Buffer(void *src, void *dest) +CopyItemIconPicTo4x4Buffer: @ 81AFE44 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r4, 0 +_081AFE4C: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 5 + adds r0, r6, r0 + lsls r1, r4, 7 + adds r1, r5, r1 + movs r2, 0x30 + bl CpuSet + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081AFE4C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end CopyItemIconPicTo4x4Buffer + + thumb_func_start AddItemIconObject +@ u8 AddItemIconObject(u16 tilesTag, u16 paletteTag, u16 itemId) +AddItemIconObject: @ 81AFE70 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + bl AllocItemIconTemporaryBuffers + lsls r0, 24 + cmp r0, 0 + beq _081AFF28 + adds r0, r5, 0 + movs r1, 0 + bl GetItemIconPicOrPalette + ldr r4, =gUnknown_0203CEBC + ldr r1, [r4] + bl LZDecompressWram + ldr r0, [r4] + ldr r4, =gUnknown_0203CEC0 + ldr r1, [r4] + bl CopyItemIconPicTo4x4Buffer + ldr r0, [r4] + str r0, [sp] + ldr r4, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r4 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + lsls r2, r7, 16 + ldr r1, =0x0000ffff + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl LoadSpriteSheet + adds r0, r5, 0 + movs r1, 0x1 + bl GetItemIconPicOrPalette + str r0, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, [r0, 0x4] + ands r1, r4 + orrs r1, r6 + str r1, [r0, 0x4] + bl LoadCompressedObjectPalette + movs r0, 0x18 + bl Alloc + adds r5, r0, 0 + ldr r0, =gUnknown_08614FF4 + adds r1, r5, 0 + movs r2, 0xC + bl CpuSet + strh r7, [r5] + strh r6, [r5, 0x2] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl CreateSprite + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl FreeItemIconTemporaryBuffers + adds r0, r5, 0 + bl Free + adds r0, r4, 0 + b _081AFF2A + .pool +_081AFF28: + movs r0, 0x40 +_081AFF2A: + add sp, 0x10 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end AddItemIconObject + + thumb_func_start AddItemIconObjectWithCustomObjectTemplate +@ u8 AddItemIconObjectWithCustomObjectTemplate(struct objtemplate *objectTemplate, u16 tilesTag, u16 paletteTag, u16 itemId) +AddItemIconObjectWithCustomObjectTemplate: @ 81AFF34 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + mov r8, r0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r6, r2, 16 + lsls r3, 16 + lsrs r5, r3, 16 + bl AllocItemIconTemporaryBuffers + lsls r0, 24 + cmp r0, 0 + beq _081AFFEC + adds r0, r5, 0 + movs r1, 0 + bl GetItemIconPicOrPalette + ldr r4, =gUnknown_0203CEBC + ldr r1, [r4] + bl LZDecompressWram + ldr r0, [r4] + ldr r4, =gUnknown_0203CEC0 + ldr r1, [r4] + bl CopyItemIconPicTo4x4Buffer + ldr r0, [r4] + str r0, [sp] + ldr r4, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r4 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + lsls r2, r7, 16 + ldr r1, =0x0000ffff + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl LoadSpriteSheet + adds r0, r5, 0 + movs r1, 0x1 + bl GetItemIconPicOrPalette + str r0, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, [r0, 0x4] + ands r1, r4 + orrs r1, r6 + str r1, [r0, 0x4] + bl LoadCompressedObjectPalette + movs r0, 0x18 + bl Alloc + adds r5, r0, 0 + mov r0, r8 + adds r1, r5, 0 + movs r2, 0xC + bl CpuSet + strh r7, [r5] + strh r6, [r5, 0x2] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl CreateSprite + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl FreeItemIconTemporaryBuffers + adds r0, r5, 0 + bl Free + adds r0, r4, 0 + b _081AFFEE + .pool +_081AFFEC: + movs r0, 0x40 +_081AFFEE: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end AddItemIconObjectWithCustomObjectTemplate + + thumb_func_start GetItemIconPicOrPalette +@ u32 GetItemIconPicOrPalette(u16 itemId, u8 which) +GetItemIconPicOrPalette: @ 81AFFFC + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x0000ffff + cmp r3, r0 + bne _081B0018 + ldr r3, =0x00000179 + b _081B0022 + .pool +_081B0018: + movs r0, 0xBC + lsls r0, 1 + cmp r3, r0 + bls _081B0022 + movs r3, 0 +_081B0022: + ldr r2, =gItemIconTable + lsls r0, r1, 2 + lsls r1, r3, 3 + adds r0, r1 + adds r0, r2 + ldr r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end GetItemIconPicOrPalette + + thumb_func_start sub_81B0038 +sub_81B0038: @ 81B0038 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + lsls r4, 24 + lsrs r6, r4, 24 + bl reset_brm + ldr r0, =gUnknown_0203CEC4 + mov r10, r0 + movs r0, 0x8E + lsls r0, 2 + bl Alloc + adds r5, r0, 0 + mov r1, r10 + str r5, [r1] + cmp r5, 0 + bne _081B0088 + ldr r0, [sp, 0x2C] + bl SetMainCallback2 + b _081B0194 + .pool +_081B0088: + ldr r3, =gUnknown_0203CEC8 + movs r1, 0xF + mov r4, r8 + ands r1, r4 + ldrb r2, [r3, 0x8] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] + ldr r0, [sp, 0x2C] + str r0, [r3] + movs r4, 0 + strb r7, [r3, 0xB] + lsls r2, r6, 2 + ldrh r1, [r5, 0xA] + movs r0, 0x3 + ands r0, r1 + orrs r0, r2 + strh r0, [r5, 0xA] + ldr r0, [sp, 0x28] + str r0, [r5] + str r4, [r5, 0x4] + ldrb r1, [r5, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x8] + mov r1, r10 + ldr r2, [r1] + ldrh r0, [r2, 0x8] + movs r4, 0xFE + lsls r4, 3 + adds r1, r4, 0 + orrs r0, r1 + strh r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r1, 0xFE + lsls r1, 10 + orrs r0, r1 + str r0, [r2, 0x8] + adds r6, r3, 0 + mov r5, r8 + cmp r5, 0x4 + bne _081B00F0 + ldrb r0, [r2, 0x8] + movs r1, 0x1 + orrs r0, r1 + b _081B00F8 + .pool +_081B00F0: + ldrb r1, [r2, 0x8] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 +_081B00F8: + strb r0, [r2, 0x8] + mov r0, r9 + cmp r0, 0xFF + beq _081B0114 + movs r0, 0x3 + mov r1, r9 + ands r0, r1 + lsls r0, 4 + ldrb r2, [r6, 0x8] + movs r1, 0x31 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r6, 0x8] +_081B0114: + movs r2, 0 + ldr r5, =gUnknown_0203CEC4 + movs r4, 0x86 + lsls r4, 2 + movs r3, 0 +_081B011E: + ldr r0, [r5] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + strh r3, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _081B011E + movs r2, 0 + ldr r4, =gUnknown_0203CEC4 + movs r3, 0xFF +_081B0138: + ldr r0, [r4] + adds r0, 0xC + adds r0, r2 + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x2 + bls _081B0138 + ldr r4, [sp] + cmp r4, 0 + bne _081B015C + strb r4, [r6, 0x9] + b _081B017E + .pool +_081B015C: + adds r1, r6, 0 + movs r0, 0x9 + ldrsb r0, [r1, r0] + cmp r0, 0x5 + bgt _081B017A + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + bne _081B017E +_081B017A: + movs r0, 0 + strb r0, [r6, 0x9] +_081B017E: + ldr r2, =gTextFlags + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl CalculatePlayerPartyCount + ldr r0, =c2_811EBD0 + bl SetMainCallback2 +_081B0194: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0038 + + thumb_func_start sub_81B01B0 +sub_81B01B0: @ 81B01B0 + push {lr} + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl do_scheduled_bg_tilemap_copies_to_vram + bl UpdatePaletteFade + pop {r0} + bx r0 + thumb_func_end sub_81B01B0 + + thumb_func_start sub_81B01CC +sub_81B01CC: @ 81B01CC + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_81B01CC + + thumb_func_start c2_811EBD0 +c2_811EBD0: @ 81B01E0 + push {lr} +_081B01E2: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B0206 + bl sub_81B020C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B0206 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B01E2 +_081B0206: + pop {r0} + bx r0 + thumb_func_end c2_811EBD0 + + thumb_func_start sub_81B020C +sub_81B020C: @ 81B020C + push {r4,lr} + sub sp, 0x4 + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x16 + bls _081B0222 + b _081B0498 +_081B0222: + lsls r0, 2 + ldr r1, =_081B0234 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B0234: + .4byte _081B0290 + .4byte _081B02AC + .4byte _081B02B2 + .4byte _081B02D4 + .4byte _081B02DA + .4byte _081B02EC + .4byte _081B02FE + .4byte _081B0310 + .4byte _081B0338 + .4byte _081B0354 + .4byte _081B0368 + .4byte _081B038C + .4byte _081B03A0 + .4byte _081B03A6 + .4byte _081B03B8 + .4byte _081B03BE + .4byte _081B03E0 + .4byte _081B0400 + .4byte _081B0414 + .4byte _081B0428 + .4byte _081B0430 + .4byte _081B044C + .4byte _081B0474 +_081B0290: + bl SetVBlankHBlankCallbacksToNull + bl sub_8121DA0 + bl clear_scheduled_bg_copies_to_vram + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B02AC: + bl remove_some_task + b _081B0484 +_081B02B2: + bl ResetPaletteFade + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B02D4: + bl ResetSpriteData + b _081B0484 +_081B02DA: + bl FreeAllSpritePalettes + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B02EC: + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + beq _081B02F8 + b _081B0484 +_081B02F8: + bl ResetTasks + b _081B0484 +_081B02FE: + bl sub_81B209C + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0310: + bl sub_81B0550 + lsls r0, 24 + cmp r0, 0 + bne _081B0322 + bl sub_81B04BC + movs r0, 0x1 + b _081B04B2 +_081B0322: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .pool +_081B0338: + bl sub_81B05C8 + lsls r0, 24 + cmp r0, 0 + bne _081B0344 + b _081B04B0 +_081B0344: + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0354: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + bl sub_81B239C + b _081B0484 + .pool +_081B0368: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + bl sub_81B0740 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .pool +_081B038C: + bl sub_81B5D30 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B03A0: + bl sub_81B6040 + b _081B0484 +_081B03A6: + bl sub_81B6160 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B03B8: + bl sub_80D2F04 + b _081B0484 +_081B03BE: + bl party_menu_add_per_mon_objects + lsls r0, 24 + cmp r0, 0 + bne _081B03CA + b _081B04B0 +_081B03CA: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .pool +_081B03E0: + bl sub_81B0DA0 + lsls r0, 24 + cmp r0, 0 + beq _081B04B0 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .pool +_081B0400: + bl sub_81B0F28 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0414: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + lsrs r0, 31 + bl sub_81B2428 + b _081B0484 + .pool +_081B0428: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _081B048C +_081B0430: + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0 + bl CreateTask + ldr r0, [r4] + ldrh r0, [r0, 0xA] + lsrs r0, 2 + bl display_pokemon_menu_message + b _081B0484 + .pool +_081B044C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + ldr r2, =gPaletteFade + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0474: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade +_081B0484: + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_081B048C: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081B04B0 + .pool +_081B0498: + ldr r0, =sub_81B01CC + bl SetVBlankCallback + ldr r0, =sub_81B01B0 + bl SetMainCallback2 + movs r0, 0x1 + b _081B04B2 + .pool +_081B04B0: + movs r0, 0 +_081B04B2: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B020C + + thumb_func_start sub_81B04BC +sub_81B04BC: @ 81B04BC + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r0, =sub_81B04F8 + movs r1, 0 + bl CreateTask + ldr r0, =sub_81B01CC + bl SetVBlankCallback + ldr r0, =sub_81B01B0 + bl SetMainCallback2 + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B04BC + + thumb_func_start sub_81B04F8 +sub_81B04F8: @ 81B04F8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B051C + ldr r0, =gUnknown_0203CEC8 + ldr r0, [r0] + bl SetMainCallback2 + bl sub_81B06F4 + adds r0, r4, 0 + bl DestroyTask +_081B051C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B04F8 + + thumb_func_start reset_brm +reset_brm: @ 81B052C + ldr r0, =gUnknown_0203CEC4 + movs r1, 0 + str r1, [r0] + ldr r0, =gUnknown_0203CEE4 + str r1, [r0] + ldr r0, =gUnknown_0203CEDC + str r1, [r0] + ldr r0, =gUnknown_0203CEE0 + str r1, [r0] + bx lr + .pool + thumb_func_end reset_brm + + thumb_func_start sub_81B0550 +sub_81B0550: @ 81B0550 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CEE4 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + cmp r0, 0 + beq _081B05C0 + movs r1, 0 + adds r2, r4, 0 + bl memset + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_086156B8 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r1, [r5] + movs r0, 0x1 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x1 + b _081B05C2 + .pool +_081B05C0: + movs r0, 0 +_081B05C2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81B0550 + + thumb_func_start sub_81B05C8 +sub_81B05C8: @ 81B05C8 + push {r4,lr} + sub sp, 0x4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x7 + bhi _081B06B0 + lsls r0, 2 + ldr r1, =_081B05F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B05F0: + .4byte _081B0610 + .4byte _081B0638 + .4byte _081B0658 + .4byte _081B0684 + .4byte _081B0688 + .4byte _081B068C + .4byte _081B0690 + .4byte _081B0694 +_081B0610: + ldr r4, =gUnknown_0203CEE0 + ldr r0, =gUnknown_08D967EC + mov r1, sp + bl malloc_and_decompress + adds r1, r0, 0 + str r1, [r4] + ldr r2, [sp] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTiles + b _081B069A + .pool +_081B0638: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _081B06B4 + ldr r0, =gUnknown_08D96BA0 + ldr r1, =gUnknown_0203CEE4 + ldr r1, [r1] + bl LZDecompressWram + b _081B069A + .pool +_081B0658: + ldr r0, =gUnknown_08D96AB4 + movs r2, 0xB0 + lsls r2, 1 + movs r1, 0 + bl LoadCompressedPalette + ldr r0, =gPlttBufferUnfaded + ldr r4, =gUnknown_0203CEC4 + ldr r1, [r4] + adds r1, 0x18 + movs r2, 0xB0 + bl CpuSet + ldr r1, [r4] + b _081B069E + .pool +_081B0684: + movs r0, 0x4 + b _081B0696 +_081B0688: + movs r0, 0x5 + b _081B0696 +_081B068C: + movs r0, 0x6 + b _081B0696 +_081B0690: + movs r0, 0x7 + b _081B0696 +_081B0694: + movs r0, 0x8 +_081B0696: + bl sub_81B06C0 +_081B069A: + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] +_081B069E: + movs r0, 0x86 + lsls r0, 2 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081B06B4 + .pool +_081B06B0: + movs r0, 0x1 + b _081B06B6 +_081B06B4: + movs r0, 0 +_081B06B6: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B05C8 + + thumb_func_start sub_81B06C0 +sub_81B06C0: @ 81B06C0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 28 + ldr r5, =gPlttBufferUnfaded + 0x60 + lsrs r4, 23 + adds r1, r5, 0 + subs r1, 0x60 + adds r1, r4, r1 + adds r0, r5, 0 + movs r2, 0x10 + bl CpuSet + ldr r0, =gPlttBufferFaded + adds r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x10 + bl CpuSet + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B06C0 + + thumb_func_start sub_81B06F4 +sub_81B06F4: @ 81B06F4 + push {lr} + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + cmp r0, 0 + beq _081B0702 + bl Free +_081B0702: + ldr r0, =gUnknown_0203CEE4 + ldr r0, [r0] + cmp r0, 0 + beq _081B070E + bl Free +_081B070E: + ldr r0, =gUnknown_0203CEE0 + ldr r0, [r0] + cmp r0, 0 + beq _081B071A + bl Free +_081B071A: + ldr r0, =gUnknown_0203CEDC + ldr r0, [r0] + cmp r0, 0 + beq _081B0726 + bl Free +_081B0726: + bl FreeAllWindowBuffers + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B06F4 + + thumb_func_start sub_81B0740 +sub_81B0740: @ 81B0740 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203CEDC + movs r0, 0x60 + bl Alloc + str r0, [r4] + movs r5, 0 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 4 + mov r8, r0 + movs r6, 0xFF + mov r9, r4 +_081B0764: + ldr r2, [r4] + lsls r3, r5, 4 + adds r2, r3, r2 + ldr r0, =gUnknown_086156E4 + mov r12, r0 + str r0, [r2] + lsls r0, r5, 3 + ldr r1, =gUnknown_08615704 + adds r0, r1 + add r0, r8 + str r0, [r2, 0x4] + strb r5, [r2, 0x8] + ldr r1, [r4] + adds r1, r3, r1 + ldrb r0, [r1, 0x9] + orrs r0, r6 + strb r0, [r1, 0x9] + ldr r1, [r4] + adds r1, r3, r1 + ldrb r0, [r1, 0xA] + orrs r0, r6 + strb r0, [r1, 0xA] + ldr r1, [r4] + adds r1, r3, r1 + ldrb r0, [r1, 0xB] + orrs r0, r6 + strb r0, [r1, 0xB] + ldr r0, [r4] + adds r3, r0 + ldrb r0, [r3, 0xC] + orrs r0, r6 + strb r0, [r3, 0xC] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081B0764 + mov r1, r9 + ldr r0, [r1] + mov r1, r12 + subs r1, 0x20 + str r1, [r0] + cmp r7, 0x3 + bne _081B07CC + str r1, [r0, 0x30] + b _081B07D2 + .pool +_081B07CC: + cmp r7, 0 + beq _081B07D2 + str r1, [r0, 0x10] +_081B07D2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B0740 + + thumb_func_start sub_81B07E0 +sub_81B07E0: @ 81B07E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B085C + cmp r5, 0x2 + bls _081B085C + adds r0, r5, 0 + bl sub_81B0CEC + ldr r0, =gUnknown_02022FF8 + subs r1, r5, 0x3 + lsls r1, 5 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _081B0828 + ldr r0, =gUnknown_0203CEDC + lsls r4, r5, 4 + ldr r0, [r0] + adds r0, r4 + movs r1, 0x40 + bl sub_81B2748 + b _081B0836 + .pool +_081B0828: + ldr r0, =gUnknown_0203CEDC + lsls r4, r5, 4 + ldr r0, [r0] + adds r0, r4 + movs r1, 0x8 + bl sub_81B2748 +_081B0836: + adds r5, r4, 0 + ldr r4, =gUnknown_0203CEDC + ldr r0, [r4] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, [r4] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + b _081B093E + .pool +_081B085C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + bne _081B089C + ldr r4, =gUnknown_0203CEDC + ldr r0, [r4] + lsls r5, 4 + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + bl sub_81B2720 + ldr r0, [r4] + adds r0, r5 + movs r1, 0x40 + bl sub_81B2748 + ldr r0, [r4] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + movs r1, 0x2 + bl CopyWindowToVram + b _081B092C + .pool +_081B089C: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + movs r1, 0xF + ands r1, r0 + cmp r1, 0x7 + bne _081B08B4 + adds r0, r5, 0 + bl sub_81B0B60 + b _081B08F6 + .pool +_081B08B4: + cmp r1, 0x2 + bne _081B08C0 + adds r0, r5, 0 + bl sub_81B0B08 + b _081B08F6 +_081B08C0: + cmp r1, 0x4 + bne _081B08CC + adds r0, r5, 0 + bl sub_81B0A9C + b _081B08F6 +_081B08CC: + cmp r1, 0xB + bne _081B08D8 + adds r0, r5, 0 + bl sub_81B0B98 + b _081B08F6 +_081B08D8: + cmp r1, 0xC + bne _081B08E4 + adds r0, r5, 0 + bl sub_81B0BC4 + b _081B08F6 +_081B08E4: + adds r0, r5, 0 + bl sub_81B0BFC + lsls r0, 24 + cmp r0, 0 + bne _081B08F6 + adds r0, r5, 0 + bl sub_81B0948 +_081B08F6: + ldr r2, =gUnknown_0203CEC8 + ldrb r1, [r2, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B0910 + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0FCC + b _081B092A + .pool +_081B0910: + movs r0, 0x9 + ldrsb r0, [r2, r0] + cmp r0, r5 + bne _081B0922 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81B0FCC + b _081B092A +_081B0922: + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0FCC +_081B092A: + lsls r5, 4 +_081B092C: + ldr r0, =gUnknown_0203CEDC + ldr r0, [r0] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram +_081B093E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B07E0 + + thumb_func_start sub_81B0948 +sub_81B0948: @ 81B0948 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + adds r1, r4, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x2D + bl GetMonData + adds r2, r0, 0 + cmp r2, 0 + beq _081B09A0 + ldr r6, =gUnknown_0203CEDC + ldr r0, [r6] + lsls r5, r4, 4 + adds r0, r5, r0 + ldr r2, [r0] + ldrb r0, [r0, 0x8] + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + ldr r4, [r2] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl _call_via_r4 + ldr r1, [r6] + adds r1, r5 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2A70 + b _081B0A02 + .pool +_081B09A0: + ldr r5, =gUnknown_0203CEDC + ldr r0, [r5] + lsls r4, 4 + adds r0, r4, r0 + ldr r1, [r0] + ldrb r0, [r0, 0x8] + str r2, [sp] + str r2, [sp, 0x4] + ldr r6, [r1] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl _call_via_r6 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2A70 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2AC8 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2B8C + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2CD4 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2D74 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + bl sub_81B2E28 +_081B0A02: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0948 + + thumb_func_start sub_81B0A10 +sub_81B0A10: @ 81B0A10 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r1, 0x64 + adds r2, r0, 0 + muls r2, r1 + ldr r1, =gPlayerParty + adds r6, r2, r1 + ldr r7, =gUnknown_0203CEDC + ldr r1, [r7] + lsls r5, r0, 4 + adds r1, r5, r1 + ldr r2, [r1] + ldrb r0, [r1, 0x8] + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + ldr r4, [r2] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl _call_via_r4 + ldr r1, [r7] + adds r1, r5 + adds r0, r6, 0 + movs r2, 0 + bl sub_81B2A70 + adds r0, r6, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081B0A7C + ldr r1, [r7] + adds r1, r5 + adds r0, r6, 0 + movs r2, 0 + bl sub_81B2AC8 + ldr r1, [r7] + adds r1, r5 + adds r0, r6, 0 + movs r2, 0 + bl sub_81B2B8C +_081B0A7C: + ldr r1, [r7] + adds r1, r5 + mov r0, r8 + movs r2, 0 + bl sub_81B2FA8 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0A10 + + thumb_func_start sub_81B0A9C +sub_81B0A9C: @ 81B0A9C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r6, =gUnknown_0203CEF8 + bl sub_81B85AC + lsls r0, 24 + cmp r0, 0 + bne _081B0AD6 + adds r0, r5, 0 + movs r1, 0x7 + bl sub_81B0A10 + b _081B0B02 + .pool +_081B0AC8: + adds r1, r4, 0x2 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_81B0A10 + b _081B0B02 +_081B0AD6: + movs r4, 0 + b _081B0AEE +_081B0ADA: + adds r1, r6, r4 + ldrb r0, [r1] + cmp r0, 0 + beq _081B0AE8 + subs r0, 0x1 + cmp r0, r5 + beq _081B0AC8 +_081B0AE8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B0AEE: + bl sub_81B8830 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _081B0ADA + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81B0A10 +_081B0B02: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B0A9C + + thumb_func_start sub_81B0B08 +sub_81B0B08: @ 81B0B08 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_80DAE0C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _081B0B5A + lsls r0, 2 + ldr r1, =_081B0B34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B0B34: + .4byte _081B0B48 + .4byte _081B0B52 + .4byte _081B0B52 + .4byte _081B0B48 + .4byte _081B0B48 +_081B0B48: + adds r0, r4, 0 + movs r1, 0x7 + bl sub_81B0A10 + b _081B0B5A +_081B0B52: + adds r0, r4, 0 + movs r1, 0x6 + bl sub_81B0A10 +_081B0B5A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0B08 + + thumb_func_start sub_81B0B60 +sub_81B0B60: @ 81B0B60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl GetNumberOfRelearnableMoves + lsls r0, 24 + cmp r0, 0 + bne _081B0B88 + adds r0, r4, 0 + movs r1, 0x9 + bl sub_81B0A10 + b _081B0B90 + .pool +_081B0B88: + adds r0, r4, 0 + movs r1, 0x8 + bl sub_81B0A10 +_081B0B90: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0B60 + + thumb_func_start sub_81B0B98 +sub_81B0B98: @ 81B0B98 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81B218C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B0BB6 + adds r0, r4, 0 + movs r1, 0x6 + bl sub_81B0A10 + b _081B0BBE +_081B0BB6: + adds r0, r4, 0 + movs r1, 0x7 + bl sub_81B0A10 +_081B0BBE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0B98 + + thumb_func_start sub_81B0BC4 +sub_81B0BC4: @ 81B0BC4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + beq _081B0BEC + adds r0, r4, 0 + movs r1, 0xB + bl sub_81B0A10 + b _081B0BF4 + .pool +_081B0BEC: + adds r0, r4, 0 + movs r1, 0xC + bl sub_81B0A10 +_081B0BF4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0BC4 + + thumb_func_start sub_81B0BFC +sub_81B0BFC: @ 81B0BFC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r6, r1, r0 + ldr r0, =gUnknown_0203CE7C + ldrh r4, [r0] + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0xC + bne _081B0C40 + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + ldr r0, =gSpecialVar_0x8005 + ldrb r2, [r0] + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0C94 + b _081B0C8A + .pool +_081B0C40: + cmp r0, 0x3 + bne _081B0C56 + adds r0, r4, 0 + bl CheckIfItemIsTMHMOrEvolutionStone + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B0C5A + cmp r0, 0x2 + beq _081B0C66 +_081B0C56: + movs r0, 0 + b _081B0C8C +_081B0C5A: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B0C94 + b _081B0C8A +_081B0C66: + adds r0, r6, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081B0C82 + adds r0, r6, 0 + movs r1, 0x3 + adds r2, r4, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + cmp r0, 0 + bne _081B0C56 +_081B0C82: + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0A10 +_081B0C8A: + movs r0, 0x1 +_081B0C8C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81B0BFC + + thumb_func_start sub_81B0C94 +sub_81B0C94: @ 81B0C94 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x64 + muls r0, r4 + ldr r3, =gPlayerParty + adds r0, r3 + bl sub_81B22D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _081B0CD2 + cmp r0, 0x2 + bgt _081B0CC4 + cmp r0, 0x1 + beq _081B0CC8 + b _081B0CDC + .pool +_081B0CC4: + cmp r0, 0x3 + bne _081B0CDC +_081B0CC8: + adds r0, r4, 0 + movs r1, 0x9 + bl sub_81B0A10 + b _081B0CE4 +_081B0CD2: + adds r0, r4, 0 + movs r1, 0xA + bl sub_81B0A10 + b _081B0CE4 +_081B0CDC: + adds r0, r4, 0 + movs r1, 0x8 + bl sub_81B0A10 +_081B0CE4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0C94 + + thumb_func_start sub_81B0CEC +sub_81B0CEC: @ 81B0CEC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CEDC + lsls r2, r0, 4 + ldr r1, [r1] + adds r6, r1, r2 + subs r0, 0x3 + lsls r0, 24 + ldr r5, =gUnknown_02022FF8 + lsrs r0, 19 + mov r8, r0 + adds r7, r0, r5 + ldrh r0, [r7] + cmp r0, 0 + bne _081B0D24 + ldrb r0, [r6, 0x8] + bl sub_81B2720 + b _081B0D8E + .pool +_081B0D24: + ldr r2, [r6] + ldrb r0, [r6, 0x8] + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + ldr r4, [r2] + movs r2, 0 + movs r3, 0 + bl _call_via_r4 + ldr r4, =gStringVar1 + adds r5, 0x4 + add r5, r8 + adds r0, r4, 0 + adds r1, r5, 0 + bl StringCopy + adds r0, r4, 0 + bl StringGetEnd10 + adds r0, r4, 0 + bl sub_81DB52C + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x4 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B2A3C + ldrb r0, [r7, 0xF] + adds r1, r6, 0 + bl sub_81B2B40 + ldrb r0, [r7, 0x1C] + ldrh r1, [r7] + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_81B2BF4 + ldrh r0, [r7, 0x10] + adds r1, r6, 0 + bl sub_81B2D3C + ldrh r0, [r7, 0x12] + adds r1, r6, 0 + bl sub_81B2DDC + ldrh r0, [r7, 0x10] + ldrh r1, [r7, 0x12] + adds r2, r6, 0 + bl sub_81B2E64 +_081B0D8E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0CEC + + thumb_func_start sub_81B0DA0 +sub_81B0DA0: @ 81B0DA0 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CEC4 + ldr r0, [r5] + movs r4, 0x86 + lsls r4, 2 + adds r0, r4 + ldrb r0, [r0] + bl sub_81B07E0 + ldr r1, [r5] + adds r1, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + beq _081B0DCC + movs r0, 0 + b _081B0DCE + .pool +_081B0DCC: + movs r0, 0x1 +_081B0DCE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81B0DA0 + + thumb_func_start sub_81B0DD4 +sub_81B0DD4: @ 81B0DD4 + lsls r0, 16 + ldr r1, =gUnknown_0203CEE0 + lsrs r0, 11 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .pool + thumb_func_end sub_81B0DD4 + + thumb_func_start party_menu_add_per_mon_objects_internal +party_menu_add_per_mon_objects_internal: @ 81B0DE8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B0E98 + cmp r7, 0x2 + bls _081B0E98 + subs r0, r7, 0x3 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, =gUnknown_02022FF8 + mov r9, r0 + mov r2, r10 + lsls r2, 5 + mov r8, r2 + mov r6, r8 + add r6, r9 + ldrh r0, [r6] + cmp r0, 0 + beq _081B0EDC + mov r1, r9 + adds r1, 0x18 + add r1, r8 + ldr r1, [r1] + ldr r4, =gUnknown_0203CEDC + lsls r5, r7, 4 + ldr r2, [r4] + adds r2, r5 + movs r3, 0 + str r3, [sp] + bl party_menu_link_mon_icon_anim + ldrh r0, [r6] + ldrh r1, [r6, 0x2] + ldr r2, [r4] + adds r2, r5 + bl party_menu_link_mon_held_item_object + ldrh r0, [r6] + ldr r1, [r4] + adds r1, r5 + bl party_menu_link_mon_pokeball_object + ldrh r0, [r6, 0x10] + cmp r0, 0 + bne _081B0E68 + movs r3, 0x7 + b _081B0E78 + .pool +_081B0E68: + mov r0, r9 + adds r0, 0x14 + add r0, r8 + ldr r0, [r0] + bl pokemon_ailments_get_primary + lsls r0, 24 + lsrs r3, r0, 24 +_081B0E78: + ldr r1, =gUnknown_02022FF8 + mov r2, r10 + lsls r0, r2, 5 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gUnknown_0203CEDC + ldr r2, [r1] + adds r2, r5 + adds r1, r3, 0 + bl party_menu_link_mon_status_condition_object + b _081B0EDC + .pool +_081B0E98: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B0EDC + ldr r4, =gUnknown_0203CEDC + lsls r5, r7, 4 + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + adds r2, r7, 0 + bl party_menu_icon_anim + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + bl party_menu_held_item_object + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + bl party_menu_pokeball_object + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + bl party_menu_status_condition_object +_081B0EDC: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_add_per_mon_objects_internal + + thumb_func_start party_menu_add_per_mon_objects +party_menu_add_per_mon_objects: @ 81B0EF4 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CEC4 + ldr r0, [r5] + movs r4, 0x86 + lsls r4, 2 + adds r0, r4 + ldrb r0, [r0] + bl party_menu_add_per_mon_objects_internal + ldr r1, [r5] + adds r1, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + beq _081B0F20 + movs r0, 0 + b _081B0F22 + .pool +_081B0F20: + movs r0, 0x1 +_081B0F22: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end party_menu_add_per_mon_objects + + thumb_func_start sub_81B0F28 +sub_81B0F28: @ 81B0F28 + push {r4,lr} + sub sp, 0xC + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B0F54 + movs r0, 0x7 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r1, 0xE + movs r2, 0x17 + movs r3, 0x11 + bl FillBgTilemapBufferRect + b _081B0FBC + .pool +_081B0F54: + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B0F94 + movs r0, 0xBF + movs r1, 0x88 + bl sub_81B5F74 + ldr r3, [r4] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x7F + ands r0, r1 + lsls r0, 4 + ldrh r2, [r3, 0x8] + ldr r1, =0xfffff80f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x8] + bl sub_81B120C + movs r0, 0xBF + movs r1, 0x98 + bl sub_81B5F74 + b _081B0F9C + .pool +_081B0F94: + movs r0, 0xC6 + movs r1, 0x94 + bl sub_81B5F34 +_081B0F9C: + ldr r3, [r4] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x7F + ands r0, r1 + lsls r0, 11 + ldr r1, [r3, 0x8] + ldr r2, =0xfffc07ff + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x8] + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + movs r1, 0x1 + bl sub_81B0FCC +_081B0FBC: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0F28 + + thumb_func_start sub_81B0FCC +sub_81B0FCC: @ 81B0FCC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + cmp r7, 0x6 + beq _081B1038 + cmp r7, 0x7 + beq _081B1074 + movs r0, 0x64 + muls r0, r7 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B10E8 + ldr r6, =gUnknown_0203CEDC + lsls r5, r7, 4 + ldr r4, [r6] + adds r4, r5 + adds r0, r7, 0 + mov r1, r8 + bl sub_81B10F8 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B2748 + ldr r0, [r6] + adds r0, r5, r0 + ldrb r0, [r0, 0x9] + mov r1, r8 + bl sub_81B5B6C + ldr r0, [r6] + adds r5, r0 + ldrb r0, [r5, 0xB] + mov r1, r8 + bl sub_81B5F98 + b _081B10E8 + .pool +_081B1038: + mov r0, r8 + cmp r0, 0 + bne _081B1052 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r1, 0x17 + movs r2, 0x10 + movs r3, 0x7 + bl sub_8199C30 + b _081B1064 +_081B1052: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x17 + movs r2, 0x10 + movs r3, 0x7 + bl sub_8199C30 +_081B1064: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrh r0, [r0, 0x8] + lsls r0, 21 + b _081B10DA + .pool +_081B1074: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + bne _081B10A6 + mov r0, r8 + cmp r0, 0 + bne _081B1098 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r1, 0x17 + movs r2, 0x11 + b _081B10B8 + .pool +_081B1098: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x17 + movs r2, 0x11 + b _081B10B8 +_081B10A6: + mov r0, r8 + cmp r0, 0 + bne _081B10C0 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r1, 0x17 + movs r2, 0x12 +_081B10B8: + movs r3, 0x7 + bl sub_8199C30 + b _081B10D2 +_081B10C0: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x17 + movs r2, 0x12 + movs r3, 0x7 + bl sub_8199C30 +_081B10D2: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldr r0, [r0, 0x8] + lsls r0, 14 +_081B10DA: + lsrs r0, 25 + mov r1, r8 + bl sub_81B5F98 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_081B10E8: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0FCC + + thumb_func_start sub_81B10F8 +sub_81B10F8: @ 81B10F8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r4, 0 + cmp r1, 0x1 + bne _081B110A + movs r4, 0x1 +_081B110A: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B1120 + movs r0, 0x2 + orrs r4, r0 +_081B1120: + adds r0, r5, 0 + bl sub_81B118C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B1136 + movs r0, 0x8 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B1136: + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0xB] + adds r2, r0, 0 + cmp r1, 0x9 + bne _081B1148 + movs r0, 0x10 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B1148: + cmp r1, 0x8 + bne _081B1164 + movs r0, 0x9 + ldrsb r0, [r2, r0] + cmp r5, r0 + beq _081B115C + movs r0, 0xA + ldrsb r0, [r2, r0] + cmp r5, r0 + bne _081B1164 +_081B115C: + movs r0, 0x4 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B1164: + ldrb r0, [r2, 0xB] + cmp r0, 0xA + bne _081B117A + movs r0, 0x9 + ldrsb r0, [r2, r0] + cmp r5, r0 + bne _081B117A + movs r0, 0x20 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B117A: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B10F8 + + thumb_func_start sub_81B118C +sub_81B118C: @ 81B118C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0x20 + bne _081B11B4 + cmp r2, 0x1 + beq _081B11AA + cmp r2, 0x4 + beq _081B11AA + cmp r2, 0x5 + bne _081B11B4 +_081B11AA: + movs r0, 0x1 + b _081B11F8 + .pool +_081B11B4: + cmp r2, 0x2 + bhi _081B11F6 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _081B11F6 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B11F6 + adds r0, r2, 0 + bl sub_81B8F38 + ldr r1, =gBattleStruct + ldr r1, [r1] + movs r2, 0xA8 + lsls r2, 2 + adds r1, r2 + ldrb r1, [r1] + lsls r0, 24 + lsrs r0, 24 + asrs r1, r0 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _081B11F8 +_081B11F6: + movs r0, 0 +_081B11F8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B118C + + thumb_func_start sub_81B120C +sub_81B120C: @ 81B120C + push {r4-r6,lr} + sub sp, 0xC + ldr r1, =gUnknown_086157C4 + movs r6, 0x7 + str r6, [sp] + movs r5, 0x2 + str r5, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x17 + movs r3, 0x10 + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r1, =gUnknown_086157E0 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x17 + movs r3, 0x12 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B120C + + thumb_func_start sub_81B1250 +sub_81B1250: @ 81B1250 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x49 + ands r0, r1 + cmp r0, 0x49 + bne _081B1280 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B1280 + movs r0, 0x1 + b _081B1282 + .pool +_081B1280: + movs r0, 0 +_081B1282: + pop {r1} + bx r1 + thumb_func_end sub_81B1250 + + thumb_func_start sub_81B1288 +sub_81B1288: @ 81B1288 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + movs r0, 0x64 + bl Alloc + adds r5, r0, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x64 + bl memcpy + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r0, r5, 0 + bl Free + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B1288 + + thumb_func_start sub_81B12C0 +sub_81B12C0: @ 81B12C0 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =c3_0811FAB4 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B12C0 + + thumb_func_start c3_0811FAB4 +c3_0811FAB4: @ 81B12F8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B134C + ldr r4, =gUnknown_0203CEC8 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B131A + bl sub_81B9080 +_081B131A: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r0, 0 + beq _081B1338 + bl SetMainCallback2 + b _081B133E + .pool +_081B1338: + ldr r0, [r4] + bl SetMainCallback2 +_081B133E: + bl ResetSpriteData + bl sub_81B06F4 + adds r0, r5, 0 + bl DestroyTask +_081B134C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end c3_0811FAB4 + + thumb_func_start brm_get_pokemon_selection +brm_get_pokemon_selection: @ 81B1354 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + bx lr + .pool + thumb_func_end brm_get_pokemon_selection + + thumb_func_start sub_81B1360 +sub_81B1360: @ 81B1360 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r0, 28 + bx lr + .pool + thumb_func_end sub_81B1360 + + thumb_func_start sub_81B1370 +sub_81B1370: @ 81B1370 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B13E0 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B13E0 + bl sub_81B13EC + adds r4, r0, 0 + bl sub_81B1760 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + beq _081B13C0 + cmp r0, 0x2 + bgt _081B13B0 + cmp r0, 0x1 + beq _081B13B6 + b _081B13E0 + .pool +_081B13B0: + cmp r0, 0x8 + beq _081B13CA + b _081B13E0 +_081B13B6: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B140C + b _081B13E0 +_081B13C0: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81B15D0 + b _081B13E0 +_081B13CA: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B13E0 + movs r0, 0x5 + bl PlaySE + bl sub_81B4F88 +_081B13E0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1370 + + thumb_func_start sub_81B13EC +sub_81B13EC: @ 81B13EC + push {lr} + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0xB] + cmp r1, 0x8 + beq _081B13FA + cmp r1, 0xA + bne _081B1404 +_081B13FA: + adds r0, 0xA + b _081B1406 + .pool +_081B1404: + adds r0, 0x9 +_081B1406: + pop {r1} + bx r1 + thumb_func_end sub_81B13EC + + thumb_func_start sub_81B140C +sub_81B140C: @ 81B140C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x6 + bne _081B142C + ldr r0, =gUnknown_0203CEC8 + ldr r1, [r0, 0x4] + adds r0, r5, 0 + bl _call_via_r1 + b _081B159E + .pool +_081B142C: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + subs r0, 0x3 + cmp r0, 0xA + bls _081B1438 + b _081B1592 +_081B1438: + lsls r0, 2 + ldr r1, =_081B144C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B144C: + .4byte _081B149C + .4byte _081B1592 + .4byte _081B1538 + .4byte _081B1538 + .4byte _081B1510 + .4byte _081B1560 + .4byte _081B1592 + .4byte _081B1478 + .4byte _081B156E + .4byte _081B14E8 + .4byte _081B157C +_081B1478: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + bne _081B1486 + b _081B159E +_081B1486: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81615A8 + b _081B159E + .pool +_081B149C: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + bne _081B14AA + b _081B159E +_081B14AA: + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + ldr r2, =gUnknown_0203CEC4 + cmp r0, 0x1 + bne _081B14BE + ldr r1, [r2] + ldr r0, =sub_81B9140 + str r0, [r1, 0x4] +_081B14BE: + ldr r0, [r2] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gUnknown_03006328 + ldr r1, =sub_81B6794 + ldr r2, [r0] + adds r0, r5, 0 + bl _call_via_r2 + b _081B159E + .pool +_081B14E8: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B7E4C + b _081B159E + .pool +_081B1510: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B8474 + b _081B159E + .pool +_081B1538: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B7FAC + b _081B159E + .pool +_081B1560: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81B3938 + b _081B159E +_081B156E: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81B12C0 + b _081B159E +_081B157C: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + ldrb r1, [r4] + adds r0, r5, 0 + bl sub_81B21AC + b _081B159E +_081B1592: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81B36FC +_081B159E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B140C + + thumb_func_start sub_81B15A4 +sub_81B15A4: @ 81B15A4 + push {lr} + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2D + bl GetMonData + cmp r0, 0x1 + beq _081B15C4 + movs r0, 0x1 + b _081B15CC + .pool +_081B15C4: + movs r0, 0x20 + bl PlaySE + movs r0, 0 +_081B15CC: + pop {r1} + bx r1 + thumb_func_end sub_81B15A4 + + thumb_func_start sub_81B15D0 +sub_81B15D0: @ 81B15D0 + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x8 + beq _081B1602 + cmp r0, 0x8 + bgt _081B15F0 + cmp r0, 0x1 + beq _081B15FA + b _081B161E + .pool +_081B15F0: + cmp r0, 0xA + beq _081B1602 + cmp r0, 0xD + beq _081B1610 + b _081B161E +_081B15FA: + movs r0, 0x20 + bl PlaySE + b _081B1652 +_081B1602: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B407C + b _081B1652 +_081B1610: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B2210 + b _081B1652 +_081B161E: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B1660 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B1652 + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081B1642 + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x7 + strh r0, [r1] +_081B1642: + ldr r0, =gUnknown_0203CEE8 + movs r1, 0 + strb r1, [r0] + movs r0, 0x7 + strb r0, [r5] + adds r0, r4, 0 + bl sub_81B12C0 +_081B1652: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B15D0 + + thumb_func_start sub_81B1660 +sub_81B1660: @ 81B1660 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + movs r1, 0xF + ands r1, r0 + cmp r1, 0x2 + bne _081B1680 + ldr r5, =gUnknown_085EA110 + b _081B168A + .pool +_081B1680: + cmp r1, 0x4 + bne _081B168A + bl sub_81B88BC + adds r5, r0, 0 +_081B168A: + cmp r5, 0 + beq _081B16CC + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + ldr r4, =gStringVar4 + adds r0, r4, 0 + adds r1, r5, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B16D4 + str r1, [r0] + movs r0, 0x1 + b _081B16CE + .pool +_081B16CC: + movs r0, 0 +_081B16CE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81B1660 + + thumb_func_start sub_81B16D4 +sub_81B16D4: @ 81B16D4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B16F8 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1708 + str r0, [r1] +_081B16F8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B16D4 + + thumb_func_start sub_81B1708 +sub_81B1708: @ 81B1708 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B172E + cmp r1, 0 + bgt _081B1728 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B174C + b _081B1758 +_081B1728: + cmp r1, 0x1 + beq _081B1752 + b _081B1758 +_081B172E: + ldr r0, =gUnknown_0203CEE8 + strb r1, [r0] + ldr r1, =gUnknown_0203CEC8 + movs r0, 0x7 + strb r0, [r1, 0x9] + bl sub_81B8558 + adds r0, r4, 0 + bl sub_81B12C0 + b _081B1758 + .pool +_081B174C: + movs r0, 0x5 + bl PlaySE +_081B1752: + adds r0, r4, 0 + bl sub_81B1C1C +_081B1758: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B1708 + + thumb_func_start sub_81B1760 +sub_81B1760: @ 81B1760 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gMain + ldrh r1, [r0, 0x30] + adds r3, r0, 0 + cmp r1, 0x20 + beq _081B178E + cmp r1, 0x20 + bgt _081B177C + cmp r1, 0x10 + beq _081B1792 + b _081B1796 + .pool +_081B177C: + cmp r1, 0x40 + beq _081B1786 + cmp r1, 0x80 + beq _081B178A + b _081B1796 +_081B1786: + movs r1, 0xFF + b _081B17B2 +_081B178A: + movs r1, 0x1 + b _081B17B2 +_081B178E: + movs r1, 0xFE + b _081B17B2 +_081B1792: + movs r1, 0x2 + b _081B17B2 +_081B1796: + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B17AA + cmp r0, 0x2 + beq _081B17AE + movs r1, 0 + b _081B17B0 +_081B17AA: + movs r1, 0xFF + b _081B17B0 +_081B17AE: + movs r1, 0x1 +_081B17B0: + ldr r3, =gMain +_081B17B2: + ldrh r2, [r3, 0x2E] + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _081B17C4 + movs r0, 0x8 + b _081B17F0 + .pool +_081B17C4: + lsls r0, r1, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B17D6 + adds r0, r4, 0 + bl sub_81B17F8 + movs r0, 0 + b _081B17F0 +_081B17D6: + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _081B17EA + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x7 + bne _081B17EA + movs r0, 0x2 + b _081B17F0 +_081B17EA: + ldrh r1, [r3, 0x2E] + movs r0, 0x3 + ands r0, r1 +_081B17F0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B1760 + + thumb_func_start sub_81B17F8 +sub_81B17F8: @ 81B17F8 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldrb r4, [r5] + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + cmp r0, 0 + bne _081B1820 + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl sub_81B1854 + b _081B182A + .pool +_081B1820: + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl sub_81B195C +_081B182A: + movs r1, 0 + ldrsb r1, [r5, r1] + lsls r4, 24 + asrs r0, r4, 24 + cmp r1, r0 + beq _081B184C + movs r0, 0x5 + bl PlaySE + lsrs r0, r4, 24 + movs r1, 0 + bl sub_81B0FCC + ldrb r0, [r5] + movs r1, 0x1 + bl sub_81B0FCC +_081B184C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B17F8 + + thumb_func_start sub_81B1854 +sub_81B1854: @ 81B1854 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B187A + cmp r1, r0 + bgt _081B1870 + subs r0, 0x1 + cmp r1, r0 + beq _081B1924 + b _081B1952 +_081B1870: + cmp r1, 0x1 + beq _081B18C0 + cmp r1, 0x2 + beq _081B18F8 + b _081B1952 +_081B187A: + ldrb r0, [r4] + movs r1, 0 + ldrsb r1, [r4, r1] + cmp r1, 0 + bne _081B1888 + movs r0, 0x7 + b _081B1950 +_081B1888: + cmp r1, 0x6 + bne _081B1898 + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + subs r0, 0x1 + b _081B1950 + .pool +_081B1898: + cmp r1, 0x7 + bne _081B18BC + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B18B0 + movs r0, 0x6 + b _081B1950 + .pool +_081B18B0: + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + subs r0, 0x1 + b _081B1950 + .pool +_081B18BC: + subs r0, 0x1 + b _081B1950 +_081B18C0: + ldrb r2, [r4] + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x7 + beq _081B194E + movs r1, 0 + ldrsb r1, [r4, r1] + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _081B18F4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B18F0 + movs r0, 0x6 + b _081B1950 + .pool +_081B18F0: + movs r0, 0x7 + b _081B1950 +_081B18F4: + adds r0, r2, 0x1 + b _081B1950 +_081B18F8: + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + cmp r0, 0x1 + beq _081B1952 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _081B1952 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0 + bne _081B1950 + movs r0, 0x1 + b _081B1950 + .pool +_081B1924: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + beq _081B1952 + cmp r0, 0x6 + beq _081B1952 + cmp r0, 0x7 + beq _081B1952 + ldr r0, =gUnknown_0203CEC4 + ldr r3, [r0] + movs r1, 0 + ldrsb r1, [r4, r1] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] +_081B194E: + movs r0, 0 +_081B1950: + strb r0, [r4] +_081B1952: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1854 + + thumb_func_start sub_81B195C +sub_81B195C: @ 81B195C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r2, r1, 24 + asrs r5, r1, 24 + movs r6, 0x1 + negs r6, r6 + cmp r5, r6 + beq _081B1988 + cmp r5, r6 + bgt _081B197E + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + bne _081B197C + b _081B1A9C +_081B197C: + b _081B1AF4 +_081B197E: + cmp r5, 0x1 + beq _081B19E4 + cmp r5, 0x2 + beq _081B1A24 + b _081B1AF4 +_081B1988: + ldrb r1, [r4] + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _081B1996 + movs r0, 0x7 + b _081B1AF2 +_081B1996: + cmp r0, 0x6 + bne _081B19A8 + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + subs r0, 0x1 + b _081B1AF2 + .pool +_081B19A8: + cmp r0, 0x7 + bne _081B19C4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B19C0 + movs r0, 0x6 + b _081B1AF2 + .pool +_081B19C0: + subs r0, r1, 0x1 + strb r0, [r4] +_081B19C4: + movs r0, 0 + ldrsb r0, [r4, r0] + lsls r1, r2, 24 + asrs r1, 24 + bl sub_81B1B00 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _081B19E0 + b _081B1AF4 +_081B19E0: + strb r2, [r4] + b _081B1AF4 +_081B19E4: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x6 + bne _081B19F0 + movs r0, 0x7 + b _081B1AF2 +_081B19F0: + cmp r0, 0x7 + bne _081B19F8 + movs r0, 0 + b _081B1AF2 +_081B19F8: + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x1 + bl sub_81B1B00 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, r6 + bne _081B19E0 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B1A20 + movs r0, 0x6 + b _081B1AF2 + .pool +_081B1A20: + movs r0, 0x7 + b _081B1AF2 +_081B1A24: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _081B1A5C + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r6, r0, 29 + cmp r6, 0x3 + bne _081B1A54 + ldr r0, =gPlayerParty + 300 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B1AF4 + strb r6, [r4] + b _081B1AF4 + .pool +_081B1A54: + ldr r0, =gPlayerParty + 200 + b _081B1A70 + .pool +_081B1A5C: + cmp r0, 0x1 + bne _081B1AF4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r5, r0, 29 + cmp r5, 0x5 + bne _081B1A88 + ldr r0, =gPlayerParty + 500 +_081B1A70: + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B1AF4 + strb r5, [r4] + b _081B1AF4 + .pool +_081B1A88: + ldr r0, =gPlayerParty + 400 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B1AF4 + movs r0, 0x4 + b _081B1AF2 + .pool +_081B1A9C: + ldrb r1, [r4] + subs r0, r1, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B1ACC + ldr r0, =gUnknown_0203CEC4 + ldr r3, [r0] + movs r1, 0 + ldrsb r1, [r4, r1] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] + movs r0, 0 + b _081B1AF2 + .pool +_081B1ACC: + subs r0, r1, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B1AF4 + ldr r0, =gUnknown_0203CEC4 + ldr r3, [r0] + movs r1, 0 + ldrsb r1, [r4, r1] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] + movs r0, 0x1 +_081B1AF2: + strb r0, [r4] +_081B1AF4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B195C + + thumb_func_start sub_81B1B00 +sub_81B1B00: @ 81B1B00 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + asrs r6, r1, 24 +_081B1B0A: + lsls r0, r5, 24 + asrs r0, 24 + adds r0, r6 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, r5, 24 + lsrs r0, r1, 24 + cmp r0, 0x5 + bhi _081B1B38 + asrs r4, r1, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B1B0A + adds r0, r4, 0 + b _081B1B3C + .pool +_081B1B38: + movs r0, 0x1 + negs r0, r0 +_081B1B3C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81B1B00 + + thumb_func_start GetMonNickname +@ u8 *GetMonNickname(struct pokemon *mon, u8 *dest) +GetMonNickname: @ 81B1B44 + push {r4,lr} + adds r4, r1, 0 + movs r1, 0x2 + adds r2, r4, 0 + bl GetMonData + adds r0, r4, 0 + bl StringGetEnd10 + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetMonNickname + + thumb_func_start sub_81B1B5C +sub_81B1B5C: @ 81B1B5C + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + bl sub_81B3300 + ldr r0, =sub_81B1B8C + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B1B5C + + thumb_func_start sub_81B1B8C +sub_81B1B8C: @ 81B1B8C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + movs r0, 0x6 + bl sub_8121F20 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _081B1BC8 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _081B1BC2 + movs r0, 0x6 + movs r1, 0 + bl sub_8198070 + movs r0, 0x6 + bl ClearWindowTilemap +_081B1BC2: + adds r0, r5, 0 + bl DestroyTask +_081B1BC8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1B8C + + thumb_func_start sub_81B1BD4 +sub_81B1BD4: @ 81B1BD4 + push {lr} + ldr r0, =sub_81B1B8C + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B1BD4 + + thumb_func_start sub_81B1BE8 +sub_81B1BE8: @ 81B1BE8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B1C0E + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 + str r0, [r1] +_081B1C0E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1BE8 + + thumb_func_start sub_81B1C1C +sub_81B1C1C: @ 81B1C1C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B1C74 + movs r0, 0x6 + movs r1, 0 + bl sub_8198070 + movs r0, 0x6 + bl ClearWindowTilemap + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B1C60 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1BE8 + b _081B1C72 + .pool +_081B1C60: + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 +_081B1C72: + str r0, [r1] +_081B1C74: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1C1C + + thumb_func_start sub_81B1C84 +sub_81B1C84: @ 81B1C84 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r1, =gStringVar2 + adds r0, r4, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E991B + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1C84 + + thumb_func_start sub_81B1CD0 +sub_81B1CD0: @ 81B1CD0 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r1, =gStringVar2 + adds r0, r4, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E999D + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1CD0 + + thumb_func_start sub_81B1D1C +sub_81B1D1C: @ 81B1D1C + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r1, =gStringVar2 + adds r0, r4, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E993A + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1D1C + + thumb_func_start sub_81B1D68 +sub_81B1D68: @ 81B1D68 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gStringVar1 + bl CopyItemName + ldr r1, =gStringVar2 + adds r0, r4, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E99DB + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1D68 + + thumb_func_start sub_81B1DB8 +sub_81B1DB8: @ 81B1DB8 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + lsls r5, r1, 16 + lsrs r4, r5, 16 + adds r7, r4, 0 + adds r0, r4, 0 + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B1DE2 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80D4420 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081B1DF6 +_081B1DE2: + mov r0, sp + strb r7, [r0] + mov r1, sp + lsrs r0, r5, 24 + strb r0, [r1, 0x1] + adds r0, r6, 0 + movs r1, 0xC + mov r2, sp + bl SetMonData +_081B1DF6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B1DB8 + + thumb_func_start sub_81B1E00 +sub_81B1E00: @ 81B1E00 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r1, sp + strh r0, [r1] + cmp r0, 0 + bne _081B1E1C + movs r0, 0 + b _081B1E3E +_081B1E1C: + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + cmp r0, 0 + beq _081B1E3C + movs r1, 0 + mov r0, sp + strh r1, [r0] + adds r0, r4, 0 + movs r1, 0xC + mov r2, sp + bl SetMonData + movs r0, 0x2 + b _081B1E3E +_081B1E3C: + movs r0, 0x1 +_081B1E3E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B1E00 + + thumb_func_start pokemon_item_not_removed +pokemon_item_not_removed: @ 81B1E48 + push {lr} + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9A69 + bl StringExpandPlaceholders + pop {r0} + bx r0 + .pool + thumb_func_end pokemon_item_not_removed + + thumb_func_start sub_81B1E60 +sub_81B1E60: @ 81B1E60 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + ldrh r0, [r7, 0x4] + ldrh r1, [r7] + adds r0, r1 + strh r0, [r7] + ldrh r0, [r7, 0x6] + subs r0, 0x1 + strh r0, [r7, 0x6] + movs r2, 0x8 + ldrsh r0, [r7, r2] + movs r5, 0x64 + muls r0, r5 + ldr r4, =gPlayerParty + adds r0, r4 + movs r1, 0x39 + adds r2, r7, 0 + bl SetMonData + movs r3, 0x8 + ldrsh r2, [r7, r3] + adds r0, r2, 0 + muls r0, r5 + adds r0, r4 + ldr r6, =gUnknown_0203CEDC + lsls r2, 4 + ldr r1, [r6] + adds r1, r2 + movs r2, 0x1 + bl sub_81B2CD4 + movs r0, 0x8 + ldrsh r2, [r7, r0] + adds r0, r2, 0 + muls r0, r5 + adds r0, r4 + lsls r2, 4 + ldr r1, [r6] + adds r1, r2 + bl sub_81B2E28 + movs r1, 0x6 + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _081B1EDC + movs r2, 0 + ldrsh r1, [r7, r2] + cmp r1, 0 + beq _081B1EDC + movs r3, 0x2 + ldrsh r0, [r7, r3] + cmp r1, r0 + bne _081B1EFE +_081B1EDC: + movs r0, 0 + ldrsh r1, [r7, r0] + movs r2, 0xA + ldrsh r0, [r7, r2] + cmp r1, r0 + ble _081B1EF8 + ldr r0, =gStringVar2 + movs r3, 0xA + ldrsh r2, [r7, r3] + subs r1, r2 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN +_081B1EF8: + mov r0, r8 + bl SwitchTaskToFollowupFunc +_081B1EFE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1E60 + + thumb_func_start sub_81B1F18 +sub_81B1F18: @ 81B1F18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + mov r9, r1 + adds r5, r2, 0 + mov r10, r3 + ldr r7, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r5, 24 + lsrs r5, 24 + mov r0, r10 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + movs r0, 0x64 + mov r6, r9 + muls r6, r0 + ldr r0, =gPlayerParty + adds r6, r0 + mov r0, r8 + lsls r4, r0, 2 + add r4, r8 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + adds r0, r6, 0 + movs r1, 0x39 + bl GetMonData + strh r0, [r4] + adds r0, r6, 0 + movs r1, 0x3A + bl GetMonData + strh r0, [r4, 0x2] + lsls r5, 24 + asrs r5, 24 + strh r5, [r4, 0x4] + mov r0, r10 + strh r0, [r4, 0x6] + mov r0, r9 + strh r0, [r4, 0x8] + ldrh r0, [r4] + strh r0, [r4, 0xA] + ldr r1, =sub_81B1E60 + mov r0, r8 + adds r2, r7, 0 + bl SetTaskFuncWithFollowupFunc + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1F18 + + thumb_func_start sub_81B1FA8 +sub_81B1FA8: @ 81B1FA8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r3, r0, r1 + cmp r5, 0x5 + bhi _081B200A + lsls r0, r5, 2 + ldr r1, =_081B1FD4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B1FD4: + .4byte _081B1FEC + .4byte _081B1FF2 + .4byte _081B1FF6 + .4byte _081B1FFA + .4byte _081B1FFE + .4byte _081B2002 +_081B1FEC: + strh r2, [r3] + strh r2, [r3, 0xA] + b _081B200A +_081B1FF2: + strh r2, [r3, 0x2] + b _081B200A +_081B1FF6: + strh r2, [r3, 0x4] + b _081B200A +_081B1FFA: + strh r2, [r3, 0x6] + b _081B200A +_081B1FFE: + strh r2, [r3, 0x8] + b _081B200A +_081B2002: + ldr r1, =sub_81B1E60 + adds r0, r4, 0 + bl SetTaskFuncWithFollowupFunc +_081B200A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1FA8 + + thumb_func_start pokemon_ailments_get_primary +pokemon_ailments_get_primary: @ 81B2014 + push {lr} + adds r1, r0, 0 + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + beq _081B2024 + movs r0, 0x1 + b _081B2056 +_081B2024: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081B2030 + movs r0, 0x2 + b _081B2056 +_081B2030: + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _081B203C + movs r0, 0x3 + b _081B2056 +_081B203C: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081B2048 + movs r0, 0x4 + b _081B2056 +_081B2048: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081B2054 + movs r0, 0 + b _081B2056 +_081B2054: + movs r0, 0x5 +_081B2056: + pop {r1} + bx r1 + thumb_func_end pokemon_ailments_get_primary + + thumb_func_start sub_81B205C +@ u8 sub_81B205C(struct pokemon *mon, int a2, void *a3) +sub_81B205C: @ 81B205C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B206E + movs r0, 0x7 + b _081B2096 +_081B206E: + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _081B2096 + adds r0, r4, 0 + movs r1, 0 + bl CheckPartyPokerus + lsls r0, 24 + cmp r0, 0 + bne _081B2094 + movs r0, 0 + b _081B2096 +_081B2094: + movs r0, 0x6 +_081B2096: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B205C + + thumb_func_start sub_81B209C +sub_81B209C: @ 81B209C + push {r4,r5,lr} + ldr r2, =gUnknown_0203CEC8 + ldrb r1, [r2, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xB + bne _081B2126 + adds r5, r2, 0 + adds r5, 0xE + movs r0, 0 + strh r0, [r2, 0xE] + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + bne _081B20FC + movs r4, 0 + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + cmp r4, r0 + bcs _081B2126 +_081B20C4: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_81B2134 + lsls r0, 16 + lsrs r0, 16 + lsls r0, r4 + ldrh r1, [r5] + adds r0, r1 + strh r0, [r5] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + cmp r4, r0 + bcc _081B20C4 + b _081B2126 + .pool +_081B20FC: + movs r4, 0 + b _081B211E +_081B2100: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_81B2164 + lsls r0, 16 + lsrs r0, 16 + lsls r0, r4 + ldrh r1, [r5] + adds r0, r1 + strh r0, [r5] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B211E: + ldr r0, =gPlayerPartyCount + ldrb r0, [r0] + cmp r4, r0 + bcc _081B2100 +_081B2126: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B209C + + thumb_func_start sub_81B2134 +sub_81B2134: @ 81B2134 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0x1 + beq _081B215A + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl sub_802C908 + cmp r0, 0 + beq _081B215A + movs r0, 0x1 + b _081B215C +_081B215A: + movs r0, 0 +_081B215C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B2134 + + thumb_func_start sub_81B2164 +sub_81B2164: @ 81B2164 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0x1 + beq _081B2182 + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0x55 + bne _081B2182 + movs r0, 0x1 + b _081B2184 +_081B2182: + movs r0, 0 +_081B2184: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B2164 + + thumb_func_start sub_81B218C +sub_81B218C: @ 81B218C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CEC8 + movs r2, 0xE + ldrsh r1, [r1, r2] + asrs r1, r0 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _081B21A4 + movs r0, 0 +_081B21A4: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B218C + + thumb_func_start sub_81B21AC +sub_81B21AC: @ 81B21AC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + adds r0, r5, 0 + bl sub_81B218C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B21DC + movs r0, 0x5 + bl PlaySE + ldr r0, =gSpecialVar_0x8004 + strh r5, [r0] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B21FE + .pool +_081B21DC: + movs r0, 0x20 + bl PlaySE + ldr r0, =gUnknown_085EA0EE + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B21FE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B21AC + + thumb_func_start sub_81B2210 +sub_81B2210: @ 81B2210 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085EA110 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B2248 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2210 + + thumb_func_start sub_81B2248 +sub_81B2248: @ 81B2248 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B226C + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B227C + str r0, [r1] +_081B226C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2248 + + thumb_func_start sub_81B227C +sub_81B227C: @ 81B227C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B22A2 + cmp r1, 0 + bgt _081B229C + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B22B4 + b _081B22C8 +_081B229C: + cmp r1, 0x1 + beq _081B22BA + b _081B22C8 +_081B22A2: + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x7 + strh r0, [r1] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B22C8 + .pool +_081B22B4: + movs r0, 0x5 + bl PlaySE +_081B22BA: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1C1C + str r0, [r1] +_081B22C8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B227C + + thumb_func_start sub_81B22D8 +sub_81B22D8: @ 81B22D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r7, r4, 0 + lsls r2, 24 + lsrs r6, r2, 24 + mov r8, r6 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _081B22FA + movs r0, 0x3 + b _081B2356 +_081B22FA: + movs r0, 0x90 + lsls r0, 1 + cmp r4, r0 + bls _081B231C + adds r1, r4, 0 + subs r1, 0x21 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl CanMonLearnTMHM + cmp r0, 0 + beq _081B2334 + adds r0, r7, 0 + bl ItemIdToBattleMoveId + b _081B233E +_081B231C: + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl sub_81B2370 + lsls r0, 24 + cmp r0, 0 + bne _081B2338 +_081B2334: + movs r0, 0x1 + b _081B2356 +_081B2338: + mov r0, r8 + bl sub_81B2360 +_081B233E: + lsls r0, 16 + lsrs r1, r0, 16 + adds r0, r5, 0 + bl pokemon_has_move + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B2354 + movs r0, 0 + b _081B2356 +_081B2354: + movs r0, 0x2 +_081B2356: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81B22D8 + + thumb_func_start sub_81B2360 +sub_81B2360: @ 81B2360 + lsls r0, 24 + ldr r1, =gUnknown_0861500C + lsrs r0, 23 + adds r0, r1 + ldrh r0, [r0] + bx lr + .pool + thumb_func_end sub_81B2360 + + thumb_func_start sub_81B2370 +sub_81B2370: @ 81B2370 + push {lr} + lsls r0, 16 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_08615048 + lsrs r0, 14 + adds r0, r2 + movs r2, 0x1 + lsls r2, r1 + ldr r0, [r0] + ands r0, r2 + cmp r0, 0 + bne _081B2394 + movs r0, 0 + b _081B2396 + .pool +_081B2394: + movs r0, 0x1 +_081B2396: + pop {r1} + bx r1 + thumb_func_end sub_81B2370 + + thumb_func_start sub_81B239C +sub_81B239C: @ 81B239C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _081B23C4 + cmp r0, 0x1 + bgt _081B23B2 + cmp r0, 0 + beq _081B23B8 + b _081B23DC +_081B23B2: + cmp r1, 0x2 + beq _081B23D0 + b _081B23DC +_081B23B8: + ldr r0, =gUnknown_08615810 + bl InitWindows + b _081B23E2 + .pool +_081B23C4: + ldr r0, =gUnknown_08615850 + bl InitWindows + b _081B23E2 + .pool +_081B23D0: + ldr r0, =gUnknown_08615890 + bl InitWindows + b _081B23E2 + .pool +_081B23DC: + ldr r0, =gUnknown_086158D0 + bl InitWindows +_081B23E2: + bl DeactivateAllTextPrinters + movs r4, 0 +_081B23E8: + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B23E8 + movs r0, 0 + movs r1, 0x4F + movs r2, 0xD0 + bl sub_809882C + bl sub_8098C64 + movs r1, 0xE0 + movs r2, 0x20 + bl LoadPalette + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadPalette + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B239C + + thumb_func_start sub_81B2428 +sub_81B2428: @ 81B2428 + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B243E + b _081B2554 +_081B243E: + cmp r2, 0x1 + bne _081B24B4 + ldr r0, =gUnknown_08615918 + bl AddWindow + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_085E8CE3 + movs r0, 0 + adds r1, r5, 0 + movs r2, 0x30 + bl GetStringCenterAlignXOffset + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + ldr r0, =gUnknown_086157FC + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + str r5, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, =gUnknown_08615910 + bl AddWindow + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + b _081B24C0 + .pool +_081B24B4: + ldr r0, =gUnknown_08615908 + bl AddWindow + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0x3 +_081B24C0: + adds r0, r5, 0 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xA + beq _081B2514 + ldr r4, =gUnknown_085E8CF0 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x30 + bl GetStringCenterAlignXOffset + lsls r0, 24 + lsrs r2, r0, 24 + adds r2, r6 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_086157FC + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0 + movs r3, 0x1 + bl box_print + b _081B2540 + .pool +_081B2514: + ldr r4, =gUnknown_085E8CF7 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x30 + bl GetStringCenterAlignXOffset + lsls r0, 24 + lsrs r2, r0, 24 + adds r2, r6 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_086157FC + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0 + movs r3, 0x1 + bl box_print +_081B2540: + adds r0, r5, 0 + bl PutWindowTilemap + adds r0, r5, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram +_081B2554: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2428 + + thumb_func_start sub_81B2564 +sub_81B2564: @ 81B2564 + lsls r0, 24 + ldr r1, =gUnknown_0203CEC4 + lsrs r0, 23 + adds r0, 0x18 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .pool + thumb_func_end sub_81B2564 + + thumb_func_start sub_81B2578 +sub_81B2578: @ 81B2578 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + str r1, [sp, 0xC] + ldr r1, [sp, 0x4C] + ldr r4, [sp, 0x50] + ldr r5, [sp, 0x54] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + lsls r4, 24 + lsrs r6, r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r10, r5 + mov r0, r10 + muls r0, r6 + lsls r0, 5 + bl AllocZeroed + mov r9, r0 + cmp r0, 0 + beq _081B2646 + movs r5, 0 + ldr r0, [sp, 0x14] + lsls r0, 19 + str r0, [sp, 0x1C] + ldr r1, [sp, 0x18] + lsls r1, 19 + str r1, [sp, 0x20] + lsls r2, r6, 19 + str r2, [sp, 0x24] + mov r0, r10 + lsls r0, 19 + str r0, [sp, 0x28] + cmp r5, r10 + bcs _081B2624 +_081B25DA: + movs r4, 0 + adds r1, r5, 0x1 + mov r8, r1 + cmp r4, r6 + bcs _081B261A + ldr r2, [sp, 0x18] + adds r0, r2, r5 + ldr r2, [sp, 0x10] + adds r1, r0, 0 + muls r1, r2 + adds r7, r1, 0 +_081B25F0: + ldr r1, [sp, 0x14] + adds r0, r1, r4 + adds r0, r7 + ldr r2, [sp, 0xC] + adds r0, r2, r0 + ldrb r0, [r0] + bl sub_81B0DD4 + adds r1, r5, 0 + muls r1, r6 + adds r1, r4 + lsls r1, 5 + add r1, r9 + movs r2, 0x10 + bl CpuSet + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _081B25F0 +_081B261A: + mov r1, r8 + lsls r0, r1, 24 + lsrs r5, r0, 24 + cmp r5, r10 + bcc _081B25DA +_081B2624: + ldr r0, [sp, 0x1C] + lsrs r2, r0, 16 + ldr r1, [sp, 0x20] + lsrs r3, r1, 16 + ldr r1, [sp, 0x24] + lsrs r0, r1, 16 + str r0, [sp] + ldr r1, [sp, 0x28] + lsrs r0, r1, 16 + str r0, [sp, 0x4] + ldr r0, [sp, 0x8] + mov r1, r9 + bl BlitBitmapToWindow + mov r0, r9 + bl Free +_081B2646: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2578 + + thumb_func_start sub_81B2658 +sub_81B2658: @ 81B2658 + push {r4-r6,lr} + sub sp, 0xC + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + cmp r3, 0 + bne _081B2684 + cmp r4, 0 + bne _081B2684 + movs r3, 0xA + movs r4, 0x7 +_081B2684: + cmp r5, 0 + bne _081B26A0 + ldr r1, =gUnknown_08615988 + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0xA + adds r3, r6, 0 + bl sub_81B2578 + b _081B26B0 + .pool +_081B26A0: + ldr r1, =gUnknown_086159CE + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0xA + adds r3, r6, 0 + bl sub_81B2578 +_081B26B0: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2658 + + thumb_func_start sub_81B26BC +sub_81B26BC: @ 81B26BC + push {r4-r6,lr} + sub sp, 0xC + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + cmp r3, 0 + bne _081B26E8 + cmp r4, 0 + bne _081B26E8 + movs r3, 0x12 + movs r4, 0x3 +_081B26E8: + cmp r5, 0 + bne _081B2704 + ldr r1, =gUnknown_08615A14 + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0x12 + adds r3, r6, 0 + bl sub_81B2578 + b _081B2714 + .pool +_081B2704: + ldr r1, =gUnknown_08615A4A + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0x12 + adds r3, r6, 0 + bl sub_81B2578 +_081B2714: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B26BC + + thumb_func_start sub_81B2720 +sub_81B2720: @ 81B2720 + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_08615A80 + movs r2, 0 + str r2, [sp] + movs r2, 0x12 + str r2, [sp, 0x4] + movs r2, 0x3 + str r2, [sp, 0x8] + movs r2, 0x12 + movs r3, 0 + bl sub_81B2578 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2720 + + thumb_func_start sub_81B2748 +sub_81B2748: @ 81B2748 + push {r4-r7,lr} + lsls r1, 24 + lsrs r4, r1, 24 + adds r5, r4, 0 + ldrb r0, [r0, 0x8] + movs r1, 0x5 + bl GetWindowAttribute + lsls r0, 28 + lsrs r6, r0, 24 + adds r7, r6, 0 + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _081B277C + ldr r5, =gUnknown_08615AF1 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AC0 + b _081B297E + .pool +_081B277C: + movs r0, 0x20 + ands r0, r4 + cmp r0, 0 + beq _081B27D8 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B2794 + ldr r5, =gUnknown_08615ADF + b _081B2942 + .pool +_081B2794: + ldr r5, =gUnknown_08615ADF + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AEE + b _081B2976 + .pool +_081B27D8: + movs r0, 0x10 + ands r0, r4 + cmp r0, 0 + beq _081B2824 + ldr r5, =gUnknown_08615ADF + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AEE + b _081B2976 + .pool +_081B2824: + movs r0, 0x4 + ands r0, r4 + cmp r0, 0 + beq _081B2880 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B283C + ldr r5, =gUnknown_08615ADF + b _081B2942 + .pool +_081B283C: + ldr r5, =gUnknown_08615ADF + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AEE + b _081B2976 + .pool +_081B2880: + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _081B28DC + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B2898 + ldr r5, =gUnknown_08615ADC + b _081B2942 + .pool +_081B2898: + ldr r5, =gUnknown_08615AD3 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AE8 + b _081B2976 + .pool +_081B28DC: + movs r0, 0x8 + ands r0, r4 + cmp r0, 0 + beq _081B2938 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B28F4 + ldr r5, =gUnknown_08615AD9 + b _081B2942 + .pool +_081B28F4: + ldr r5, =gUnknown_08615AD0 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AE5 + b _081B2976 + .pool +_081B2938: + movs r0, 0x1 + ands r5, r0 + cmp r5, 0 + beq _081B29BC + ldr r5, =gUnknown_08615AD6 +_081B2942: + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AEB +_081B2976: + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABD +_081B297E: + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + b _081B2A24 + .pool +_081B29BC: + ldr r5, =gUnknown_08615ACD + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AE2 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABD + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette +_081B2A24: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2748 + + thumb_func_start sub_81B2A3C +sub_81B2A3C: @ 81B2A3C + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + ldrb r5, [r3] + ldrb r3, [r3, 0x1] + lsls r4, r2, 1 + adds r4, r2 + ldr r2, =gUnknown_086157FC + adds r4, r2 + str r4, [sp] + movs r2, 0 + str r2, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0 + adds r2, r5, 0 + bl box_print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2A3C + + thumb_func_start sub_81B2A70 +sub_81B2A70: @ 81B2A70 + push {r4-r7,lr} + sub sp, 0x14 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2AC0 + cmp r4, 0x1 + bne _081B2AAA + ldr r5, [r6] + ldrb r0, [r6, 0x8] + ldrb r1, [r5, 0x4] + lsrs r1, 3 + ldrb r2, [r5, 0x5] + lsrs r2, 3 + ldrb r3, [r5, 0x6] + lsrs r3, 3 + ldrb r4, [r5, 0x7] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2AAA: + adds r0, r7, 0 + add r1, sp, 0x8 + bl GetMonNickname + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x4 + add r1, sp, 0x8 + movs r2, 0 + bl sub_81B2A3C +_081B2AC0: + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2A70 + + thumb_func_start sub_81B2AC8 +sub_81B2AC8: @ 81B2AC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r6, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + mov r8, r4 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2B34 + adds r0, r6, 0 + bl sub_81B205C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B2AF6 + cmp r0, 0x6 + bne _081B2B34 +_081B2AF6: + cmp r4, 0 + beq _081B2B1C + ldr r5, [r7] + ldrb r0, [r7, 0x8] + ldrb r1, [r5, 0x8] + lsrs r1, 3 + ldrb r2, [r5, 0x9] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0xA] + lsrs r3, 3 + ldrb r4, [r5, 0xB] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2B1C: + mov r0, r8 + cmp r0, 0x2 + beq _081B2B34 + adds r0, r6, 0 + movs r1, 0x38 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + adds r1, r7, 0 + bl sub_81B2B40 +_081B2B34: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2AC8 + + thumb_func_start sub_81B2B40 +sub_81B2B40: @ 81B2B40 + push {r4-r6,lr} + adds r2, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r5, =gStringVar2 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar1 + ldr r1, =gUnknown_085E8D4D + adds r0, r4, 0 + bl StringCopy + adds r0, r4, 0 + adds r1, r5, 0 + bl StringAppend + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x8 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B2A3C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2B40 + + thumb_func_start sub_81B2B8C +sub_81B2B8C: @ 81B2B8C + push {r4-r7,lr} + sub sp, 0x14 + adds r6, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0x1 + bne _081B2BBE + ldr r5, [r7] + ldrb r0, [r7, 0x8] + ldrb r1, [r5, 0xC] + lsrs r1, 3 + ldrb r2, [r5, 0xD] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0xE] + lsrs r3, 3 + ldrb r4, [r5, 0xF] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2BBE: + adds r0, r6, 0 + add r1, sp, 0x8 + bl GetMonNickname + adds r0, r6, 0 + bl GetMonGender + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0xB + bl GetMonData + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + add r2, sp, 0x8 + adds r3, r7, 0 + bl sub_81B2BF4 + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2B8C + + thumb_func_start sub_81B2BF4 +sub_81B2BF4: @ 81B2BF4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r2 + adds r7, r3, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r5, r4, 0 + ldrb r0, [r7, 0x8] + movs r1, 0x5 + bl GetWindowAttribute + lsls r0, 28 + lsrs r6, r0, 24 + cmp r4, 0 + beq _081B2CBA + cmp r4, 0x20 + beq _081B2C24 + cmp r4, 0x1D + bne _081B2C38 +_081B2C24: + movs r0, 0xB + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + mov r0, r9 + bl StringCompare + cmp r0, 0 + beq _081B2CBA +_081B2C38: + mov r0, r8 + cmp r0, 0 + beq _081B2C48 + cmp r0, 0xFE + beq _081B2C88 + b _081B2CBA + .pool +_081B2C48: + ldr r5, =gUnknown_08615AC3 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AB6 + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r7, 0x8] + ldr r1, =gUnknown_085E8D49 + ldr r3, [r7] + adds r3, 0xC + movs r2, 0x2 + bl sub_81B2A3C + b _081B2CBA + .pool +_081B2C88: + ldr r5, =gUnknown_08615AC5 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AB6 + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r7, 0x8] + ldr r1, =gUnknown_085E8D4B + ldr r3, [r7] + adds r3, 0xC + movs r2, 0x2 + bl sub_81B2A3C +_081B2CBA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2BF4 + + thumb_func_start sub_81B2CD4 +sub_81B2CD4: @ 81B2CD4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + mov r8, r4 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2D2E + cmp r4, 0 + beq _081B2D16 + ldr r5, [r6] + ldrb r0, [r6, 0x8] + ldrb r1, [r5, 0x10] + lsrs r1, 3 + ldrb r2, [r5, 0x11] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0x12] + lsrs r3, 3 + ldrb r4, [r5, 0x13] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2D16: + mov r0, r8 + cmp r0, 0x2 + beq _081B2D2E + adds r0, r7, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl sub_81B2D3C +_081B2D2E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2CD4 + + thumb_func_start sub_81B2D3C +sub_81B2D3C: @ 81B2D3C + push {r4,r5,lr} + adds r2, r0, 0 + adds r4, r1, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r5, =gStringVar1 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + movs r1, 0xBA + strb r1, [r0] + movs r1, 0xFF + strb r1, [r0, 0x1] + ldrb r0, [r4, 0x8] + ldr r3, [r4] + adds r3, 0x10 + adds r1, r5, 0 + movs r2, 0 + bl sub_81B2A3C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2D3C + + thumb_func_start sub_81B2D74 +sub_81B2D74: @ 81B2D74 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + mov r8, r4 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2DD0 + cmp r4, 0 + beq _081B2DB8 + ldr r5, [r6] + ldrb r0, [r6, 0x8] + ldrb r1, [r5, 0x14] + lsrs r1, 3 + adds r1, 0x1 + ldrb r2, [r5, 0x15] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0x16] + lsrs r3, 3 + ldrb r4, [r5, 0x17] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2DB8: + mov r0, r8 + cmp r0, 0x2 + beq _081B2DD0 + adds r0, r7, 0 + movs r1, 0x3A + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl sub_81B2DDC +_081B2DD0: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2D74 + + thumb_func_start sub_81B2DDC +sub_81B2DDC: @ 81B2DDC + push {r4-r6,lr} + adds r2, r0, 0 + adds r6, r1, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r5, =gStringVar2 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar1 + ldr r1, =gUnknown_085E8D3E + adds r0, r4, 0 + bl StringCopy + adds r0, r4, 0 + adds r1, r5, 0 + bl StringAppend + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x14 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B2A3C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2DDC + + thumb_func_start sub_81B2E28 +sub_81B2E28: @ 81B2E28 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2E5C + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x3A + bl GetMonData + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + adds r2, r6, 0 + bl sub_81B2E64 +_081B2E5C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B2E28 + + thumb_func_start sub_81B2E64 +sub_81B2E64: @ 81B2E64 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r6, r2, 0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldrb r0, [r6, 0x8] + movs r1, 0x5 + bl GetWindowAttribute + lsls r0, 28 + lsrs r7, r0, 24 + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _081B2EB0 + cmp r0, 0x2 + blt _081B2EE0 + cmp r0, 0x4 + bgt _081B2EE0 + ldr r5, =gUnknown_08615AC7 + b _081B2EB2 + .pool +_081B2EB0: + ldr r5, =gUnknown_08615AC9 +_081B2EB2: + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AB8 + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + b _081B2F04 + .pool +_081B2EE0: + ldr r5, =gUnknown_08615ACB + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AB8 + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette +_081B2F04: + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + ldr r2, [r6] + ldrb r2, [r2, 0x1A] + bl sub_8075034 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r6, 0x8] + ldr r4, =gUnknown_08615AB8 + ldrb r1, [r4, 0x1] + ldr r3, [r6] + ldrb r2, [r3, 0x18] + ldrb r3, [r3, 0x19] + str r5, [sp] + movs r7, 0x1 + str r7, [sp, 0x4] + bl FillWindowPixelRect + ldrb r0, [r6, 0x8] + ldrb r1, [r4] + ldr r3, [r6] + ldrb r2, [r3, 0x18] + ldrb r3, [r3, 0x19] + adds r3, 0x1 + str r5, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + bl FillWindowPixelRect + ldr r1, [r6] + ldrb r0, [r1, 0x1A] + cmp r5, r0 + beq _081B2F88 + ldrb r0, [r6, 0x8] + ldrb r2, [r1, 0x18] + adds r2, r5 + ldrb r3, [r1, 0x19] + ldrb r1, [r1, 0x1A] + subs r1, r5 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + str r7, [sp, 0x4] + movs r1, 0xD + bl FillWindowPixelRect + ldrb r0, [r6, 0x8] + ldr r1, [r6] + ldrb r2, [r1, 0x18] + adds r2, r5 + ldrb r3, [r1, 0x19] + adds r3, 0x1 + ldrb r1, [r1, 0x1A] + subs r1, r5 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + str r4, [sp, 0x4] + movs r1, 0x2 + bl FillWindowPixelRect +_081B2F88: + ldrb r0, [r6, 0x8] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2E64 + + thumb_func_start sub_81B2FA8 +sub_81B2FA8: @ 81B2FA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r2, 24 + lsrs r7, r2, 24 + cmp r7, 0 + beq _081B2FF2 + ldr r5, [r6] + ldrb r1, [r5, 0x1C] + movs r4, 0x7 + adds r0, r1, 0 + ands r0, r4 + ldrb r2, [r5, 0x1E] + adds r0, r2 + adds r3, r0, 0x7 + asrs r3, 3 + ldrb r2, [r5, 0x1D] + adds r0, r2, 0 + ands r0, r4 + ldrb r4, [r5, 0x1F] + adds r0, r4 + adds r4, r0, 0x7 + ldrb r0, [r6, 0x8] + lsrs r1, 3 + lsrs r2, 3 + lsrs r4, 3 + str r4, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2FF2: + cmp r7, 0x2 + beq _081B3018 + ldrb r0, [r6, 0x8] + ldr r1, [r6] + ldrb r2, [r1, 0x1C] + ldrb r3, [r1, 0x1D] + ldr r1, =gUnknown_086157FC + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r4, =gUnknown_08615B60 + mov r5, r8 + lsls r1, r5, 2 + adds r1, r4 + ldr r1, [r1] + str r1, [sp, 0x8] + movs r1, 0x1 + bl box_print +_081B3018: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2FA8 + + thumb_func_start sub_81B302C +sub_81B302C: @ 81B302C + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081B304C + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram +_081B304C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B302C + + thumb_func_start display_pokemon_menu_message +display_pokemon_menu_message: @ 81B3054 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + ldr r0, =gUnknown_0203CEC4 + ldr r4, [r0] + adds r5, r4, 0 + adds r5, 0xD + ldrb r0, [r4, 0xD] + cmp r0, 0xFF + beq _081B306E + adds r0, r5, 0 + bl sub_81B302C +_081B306E: + cmp r6, 0x7F + beq _081B313C + adds r0, r6, 0 + subs r0, 0x15 + cmp r0, 0x5 + bhi _081B30D4 + lsls r0, 2 + ldr r1, =_081B308C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B308C: + .4byte _081B30A4 + .4byte _081B30BC + .4byte _081B30BC + .4byte _081B30AC + .4byte _081B30B4 + .4byte _081B30C4 +_081B30A4: + ldr r0, =gUnknown_08615928 + b _081B30C6 + .pool +_081B30AC: + ldr r0, =gUnknown_08615930 + b _081B30C6 + .pool +_081B30B4: + ldr r0, =gUnknown_08615938 + b _081B30C6 + .pool +_081B30BC: + ldr r0, =gUnknown_08615940 + b _081B30C6 + .pool +_081B30C4: + ldr r0, =gUnknown_08615948 +_081B30C6: + bl AddWindow + strb r0, [r5] + b _081B30DC + .pool +_081B30D4: + ldr r0, =gUnknown_08615920 + bl AddWindow + strb r0, [r4, 0xD] +_081B30DC: + cmp r6, 0 + bne _081B3104 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B30F8 + movs r6, 0x2 + b _081B3104 + .pool +_081B30F8: + bl sub_81B314C + lsls r0, 24 + cmp r0, 0 + bne _081B3104 + movs r6, 0x1 +_081B3104: + ldrb r0, [r5] + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + ldr r4, =gStringVar4 + ldr r1, =gUnknown_08615AF4 + lsls r0, r6, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl StringExpandPlaceholders + ldrb r0, [r5] + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl PrintTextOnWindow + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram +_081B313C: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end display_pokemon_menu_message + + thumb_func_start sub_81B314C +sub_81B314C: @ 81B314C + push {r4-r7,lr} + ldr r7, =gPlayerParty + movs r6, 0 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x1 + bne _081B3168 +_081B315A: + movs r0, 0x1 + b _081B31AA + .pool +_081B3168: + movs r5, 0 +_081B316A: + movs r0, 0x64 + muls r0, r5 + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B319A + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B3194 + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _081B319A +_081B3194: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081B319A: + cmp r6, 0x1 + bhi _081B315A + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081B316A + movs r0, 0 +_081B31AA: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81B314C + + thumb_func_start sub_81B31B0 +sub_81B31B0: @ 81B31B0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + beq _081B320C + cmp r4, 0x1 + bgt _081B31CC + cmp r4, 0 + beq _081B31D2 + b _081B321C +_081B31CC: + cmp r4, 0x2 + beq _081B3214 + b _081B321C +_081B31D2: + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldrb r0, [r1, 0x17] + lsls r0, 1 + movs r3, 0x13 + subs r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0xA + str r0, [sp] + ldrb r0, [r1, 0x17] + lsls r0, 25 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0xE + str r0, [sp, 0x8] + ldr r0, =0x000002e9 + str r0, [sp, 0xC] + add r0, sp, 0x14 + movs r1, 0x2 + movs r2, 0x13 + bl SetWindowTemplateFields + b _081B3226 + .pool +_081B320C: + ldr r0, =gUnknown_08615950 + b _081B321E + .pool +_081B3214: + ldr r0, =gUnknown_08615958 + b _081B321E + .pool +_081B321C: + ldr r0, =gUnknown_08615960 +_081B321E: + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x14] + str r1, [sp, 0x18] +_081B3226: + add r0, sp, 0x14 + bl AddWindow + ldr r6, =gUnknown_0203CEC4 + ldr r1, [r6] + strb r0, [r1, 0xC] + ldr r0, [r6] + ldrb r0, [r0, 0xC] + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + cmp r4, 0x3 + bne _081B3250 + ldr r0, [r6] + b _081B32E2 + .pool +_081B3250: + movs r0, 0x1 + movs r1, 0 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0x1 + movs r1, 0x2 + bl GetFontAttribute + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r0, [r6] + ldrb r0, [r0, 0x17] + cmp r5, r0 + bcs _081B32CA + adds r7, r6, 0 + movs r6, 0 +_081B327A: + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xF + adds r4, r0, r5 + ldrb r0, [r4] + movs r2, 0x3 + cmp r0, 0x12 + bls _081B328C + movs r2, 0x4 +_081B328C: + ldrb r0, [r1, 0xC] + lsls r3, r5, 4 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + mov r1, r8 + str r1, [sp] + str r6, [sp, 0x4] + lsls r1, r2, 1 + adds r1, r2 + ldr r2, =gUnknown_086157FC + adds r1, r2 + str r1, [sp, 0x8] + str r6, [sp, 0xC] + ldr r2, =gUnknown_08615C08 + ldrb r1, [r4] + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + str r1, [sp, 0x10] + movs r1, 0x1 + mov r2, r9 + bl AddTextPrinterParametrized2 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + ldrb r0, [r0, 0x17] + cmp r5, r0 + bcc _081B327A +_081B32CA: + ldr r4, =gUnknown_0203CEC4 + ldr r1, [r4] + ldrb r0, [r1, 0xC] + ldrb r1, [r1, 0x17] + movs r2, 0 + movs r3, 0x1 + bl InitMenuInUpperLeftCorner + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, [r4] +_081B32E2: + ldrb r0, [r0, 0xC] + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B31B0 + + thumb_func_start sub_81B3300 +sub_81B3300: @ 81B3300 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + movs r0, 0x6 + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + ldr r2, =gTextFlags + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0x6 + movs r1, 0x1 + adds r2, r4, 0 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3300 + + thumb_func_start sub_81B334C +sub_81B334C: @ 81B334C + push {lr} + ldr r0, =gUnknown_08615968 + movs r1, 0x4F + movs r2, 0xD + movs r3, 0 + bl CreateYesNoMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B334C + + thumb_func_start sub_81B3364 +sub_81B3364: @ 81B3364 + push {r4,lr} + ldr r0, =gUnknown_08615970 + bl AddWindow + ldr r4, =gUnknown_0203CEC4 + ldr r1, [r4] + strb r0, [r1, 0xC] + ldr r0, [r4] + ldrb r0, [r0, 0xC] + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + ldr r0, [r4] + ldrb r0, [r0, 0xC] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B3364 + + thumb_func_start sub_81B3394 +sub_81B3394: @ 81B3394 + push {r4,lr} + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + ldrb r0, [r0, 0xC] + bl ClearWindowTilemap + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3394 + + thumb_func_start sub_81B33B4 +sub_81B33B4: @ 81B33B4 + push {r4,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0 + bne _081B33C8 + bl sub_81B3414 + b _081B3400 +_081B33C8: + ldr r4, =gUnknown_0203CEC4 + ldr r1, [r4] + ldr r0, =gUnknown_08615D70 + adds r0, r2, r0 + ldrb r0, [r0] + strb r0, [r1, 0x17] + movs r3, 0 + ldr r0, [r4] + ldrb r0, [r0, 0x17] + cmp r3, r0 + bcs _081B3400 + ldr r1, =gUnknown_08615D38 + lsls r0, r2, 2 + adds r2, r0, r1 +_081B33E4: + ldr r1, [r4] + adds r1, 0xF + adds r1, r3 + ldr r0, [r2] + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r4] + ldrb r0, [r0, 0x17] + cmp r3, r0 + bcc _081B33E4 +_081B3400: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B33B4 + + thumb_func_start sub_81B3414 +sub_81B3414: @ 81B3414 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r9, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r2, =gUnknown_0203CEC4 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x17] + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0 + bl AppendToList + movs r7, 0 + ldr r0, =gUnknown_08615D7E + ldrh r0, [r0] + str r0, [sp] +_081B3446: + movs r4, 0 + adds r0, r7, 0x1 + mov r8, r0 + ldr r1, [sp] + cmp r1, 0xE + beq _081B34A0 + movs r0, 0x64 + mov r6, r10 + muls r6, r0 + ldr r5, =gUnknown_08615D7E +_081B345A: + mov r1, r9 + adds r0, r1, r6 + adds r1, r7, 0 + adds r1, 0xD + bl GetMonData + lsls r1, r4, 1 + adds r1, r5 + ldrh r1, [r1] + cmp r0, r1 + bne _081B3490 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + adds r2, r4, 0 + adds r2, 0x13 + lsls r2, 24 + lsrs r2, 24 + bl AppendToList + b _081B34A0 + .pool +_081B3490: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 1 + adds r0, r5 + ldrh r0, [r0] + cmp r0, 0xE + bne _081B345A +_081B34A0: + mov r1, r8 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _081B3446 + bl InBattlePike + lsls r0, 24 + cmp r0, 0 + bne _081B3518 + mov r0, r9 + adds r0, 0x64 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B34D2 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x1 + bl AppendToList +_081B34D2: + movs r0, 0x64 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + add r0, r9 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B3508 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x6 + bl AppendToList + b _081B3518 + .pool +_081B3508: + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x3 + bl AppendToList +_081B3518: + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x2 + bl AppendToList + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3414 + + thumb_func_start sub_81B353C +sub_81B353C: @ 81B353C + push {r4,lr} + adds r4, r0, 0 + ldr r1, =gUnknown_0203CEC8 + ldrb r0, [r1, 0x8] + lsls r0, 28 + lsrs r0, 28 + adds r2, r1, 0 + cmp r0, 0xC + bhi _081B35FE + lsls r0, 2 + ldr r1, =_081B3560 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B3560: + .4byte _081B3594 + .4byte _081B35B0 + .4byte _081B35FE + .4byte _081B35FE + .4byte _081B35BC + .4byte _081B35FE + .4byte _081B35DC + .4byte _081B35FE + .4byte _081B35EE + .4byte _081B35F2 + .4byte _081B35F6 + .4byte _081B35FE + .4byte _081B35FA +_081B3594: + bl InMultiBattleRoom + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B35AC + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _081B35FE +_081B35AC: + movs r1, 0x1 + b _081B3600 +_081B35B0: + adds r0, r4, 0 + bl sub_81B8A2C + lsls r0, 24 + lsrs r1, r0, 24 + b _081B3600 +_081B35BC: + movs r0, 0x9 + ldrsb r0, [r2, r0] + bl sub_81B856C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B35D4 + cmp r0, 0x1 + beq _081B35D8 + movs r1, 0x7 + b _081B3600 +_081B35D4: + movs r1, 0x4 + b _081B3600 +_081B35D8: + movs r1, 0x5 + b _081B3600 +_081B35DC: + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + movs r1, 0x6 + cmp r0, 0 + beq _081B3600 + movs r1, 0x7 + b _081B3600 +_081B35EE: + movs r1, 0xA + b _081B3600 +_081B35F2: + movs r1, 0xB + b _081B3600 +_081B35F6: + movs r1, 0xC + b _081B3600 +_081B35FA: + movs r1, 0xD + b _081B3600 +_081B35FE: + movs r1, 0 +_081B3600: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B353C + + thumb_func_start sub_81B3608 +sub_81B3608: @ 81B3608 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r4, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r0, r1 + ldr r7, =gPlayerParty + adds r5, r0, r7 + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xC + beq _081B3674 + ldrb r4, [r4, 0x9] + adds r0, r5, 0 + bl sub_81B353C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_81B33B4 + movs r0, 0 + bl sub_81B31B0 + movs r0, 0x15 + bl display_pokemon_menu_message + b _081B36EA + .pool +_081B3674: + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + bne _081B36C0 + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9980 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + str r1, [r0] + movs r0, 0 + b _081B36EC + .pool +_081B36C0: + ldrb r4, [r4, 0x9] + adds r0, r5, 0 + bl sub_81B353C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_81B33B4 + movs r0, 0x1 + bl sub_81B31B0 + ldr r1, =gStringVar2 + adds r0, r6, 0 + bl CopyItemName + movs r0, 0x1A + bl display_pokemon_menu_message +_081B36EA: + movs r0, 0x1 +_081B36EC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B3608 + + thumb_func_start sub_81B36FC +sub_81B36FC: @ 81B36FC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81B3608 + lsls r0, 24 + cmp r0, 0 + beq _081B3720 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, =sub_81B3730 + str r1, [r0] +_081B3720: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B36FC + + thumb_func_start sub_81B3730 +sub_81B3730: @ 81B3730 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B37EE + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B37EE + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x17] + cmp r0, 0x3 + bhi _081B3774 + bl ProcessMenuInputNoWrapAround_other + b _081B3778 + .pool +_081B3774: + bl ProcessMenuInput_other +_081B3778: + lsls r0, 24 + lsrs r4, r0, 24 + bl GetMenuCursorPos + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + lsls r0, r4, 24 + asrs r5, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _081B37EE + adds r0, 0x1 + cmp r5, r0 + bne _081B37CC + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xE + bl sub_81B302C + ldr r2, =gUnknown_08615C08 + ldr r0, [r4] + ldrb r1, [r0, 0x17] + adds r0, r1 + ldrb r0, [r0, 0xE] + lsls r0, 3 + adds r2, 0x4 + adds r0, r2 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 + b _081B37EE + .pool +_081B37CC: + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xE + bl sub_81B302C + ldr r1, =gUnknown_08615C08 + ldr r0, [r4] + adds r0, 0xF + adds r0, r5 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 +_081B37EE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3730 + + thumb_func_start sub_81B37FC +sub_81B37FC: @ 81B37FC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B3828 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B37FC + + thumb_func_start sub_81B3828 +sub_81B3828: @ 81B3828 + push {r4,lr} + sub sp, 0x4 + ldr r4, =gUnknown_0203CEC8 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B3868 + bl pokemon_change_order + ldr r1, =gPlayerParty + ldrb r2, [r4, 0x9] + ldr r0, =gPlayerPartyCount + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =sub_81B3894 + str r0, [sp] + movs r0, 0x1 + bl sub_81BF8EC + b _081B3880 + .pool +_081B3868: + ldr r1, =gPlayerParty + ldrb r2, [r4, 0x9] + ldr r0, =gPlayerPartyCount + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =sub_81B3894 + str r0, [sp] + movs r0, 0 + bl sub_81BF8EC +_081B3880: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3828 + + thumb_func_start sub_81B3894 +sub_81B3894: @ 81B3894 + push {lr} + sub sp, 0xC + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r3, =gUnknown_0203CEC8 + ldr r0, =gUnknown_0203CF20 + ldrb r0, [r0] + strb r0, [r3, 0x9] + ldrb r0, [r3, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r3, 0xB] + movs r1, 0x15 + str r1, [sp] + ldr r1, =sub_81B36FC + str r1, [sp, 0x4] + ldr r1, [r3] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3894 + + thumb_func_start brm_switch +brm_switch: @ 81B38DC + push {r4-r6,lr} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x5 + bl PlaySE + ldr r5, =gUnknown_0203CEC8 + movs r0, 0x8 + strb r0, [r5, 0xB] + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + movs r0, 0x3 + bl display_pokemon_menu_message + ldrb r0, [r5, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + ldrb r0, [r5, 0x9] + strb r0, [r5, 0xA] + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1370 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end brm_switch + + thumb_func_start sub_81B3938 +sub_81B3938: @ 81B3938 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r6, r0, r1 + ldr r3, =gUnknown_0203CEC8 + movs r1, 0xA + ldrsb r1, [r3, r1] + movs r0, 0x9 + ldrsb r0, [r3, r0] + cmp r1, r0 + bne _081B3968 + adds r0, r7, 0 + bl sub_81B407C + b _081B3ABA + .pool +_081B3968: + add r2, sp, 0x8 + movs r0, 0x9 + ldrsb r0, [r3, r0] + ldr r1, =gUnknown_0203CEDC + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + movs r4, 0 + strb r0, [r2] + adds r0, r2, 0 + ldrb r0, [r0] + movs r1, 0x1 + bl GetWindowAttribute + strh r0, [r6] + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x2 + bl GetWindowAttribute + strh r0, [r6, 0x2] + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x3 + bl GetWindowAttribute + strh r0, [r6, 0x4] + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x4 + bl GetWindowAttribute + strh r0, [r6, 0x6] + strh r4, [r6, 0x10] + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0xA + bne _081B39C4 + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 + b _081B39C6 + .pool +_081B39C4: + movs r0, 0x1 +_081B39C6: + strh r0, [r6, 0x14] + add r2, sp, 0x8 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xA] + lsls r0, 24 + asrs r0, 24 + ldr r1, =gUnknown_0203CEDC + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + movs r4, 0 + strb r0, [r2, 0x1] + adds r0, r2, 0 + ldrb r0, [r0, 0x1] + movs r1, 0x1 + bl GetWindowAttribute + strh r0, [r6, 0x8] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + movs r1, 0x2 + bl GetWindowAttribute + strh r0, [r6, 0xA] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + movs r1, 0x3 + bl GetWindowAttribute + strh r0, [r6, 0xC] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + movs r1, 0x4 + bl GetWindowAttribute + strh r0, [r6, 0xE] + strh r4, [r6, 0x12] + movs r1, 0xC + ldrsh r0, [r6, r1] + cmp r0, 0xA + bne _081B3A2C + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 + b _081B3A2E + .pool +_081B3A2C: + movs r0, 0x1 +_081B3A2E: + strh r0, [r6, 0x16] + ldr r4, =gUnknown_0203CEF0 + movs r0, 0x4 + ldrsh r1, [r6, r0] + movs r2, 0x6 + ldrsh r0, [r6, r2] + lsls r0, 1 + muls r0, r1 + bl Alloc + str r0, [r4] + ldr r5, =gUnknown_0203CEF4 + movs r0, 0xC + ldrsh r1, [r6, r0] + movs r2, 0xE + ldrsh r0, [r6, r2] + lsls r0, 1 + muls r0, r1 + bl Alloc + str r0, [r5] + ldr r1, [r4] + ldrb r2, [r6] + ldrb r3, [r6, 0x2] + ldrb r0, [r6, 0x4] + str r0, [sp] + ldrb r0, [r6, 0x6] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + ldr r1, [r5] + ldrb r2, [r6, 0x8] + ldrb r3, [r6, 0xA] + ldrb r0, [r6, 0xC] + str r0, [sp] + ldrb r0, [r6, 0xE] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + add r0, sp, 0x8 + ldrb r0, [r0] + bl ClearWindowTilemap + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + bl ClearWindowTilemap + ldr r4, =gUnknown_0203CEC8 + movs r0, 0x9 + strb r0, [r4, 0xB] + ldrb r0, [r4, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + ldrb r0, [r4, 0xA] + movs r1, 0x1 + bl sub_81B0FCC + adds r0, r7, 0 + bl sub_81B3CC0 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B3D48 + str r1, [r0] +_081B3ABA: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3938 + + thumb_func_start sub_81B3AD8 +sub_81B3AD8: @ 81B3AD8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r2, 0 + mov r12, r3 + ldr r7, [sp, 0x18] + lsls r0, 16 + lsrs r3, r0, 16 + adds r5, r3, 0 + lsls r1, 16 + lsrs r2, r1, 16 + mov r8, r2 + lsls r0, r3, 16 + asrs r1, r0, 16 + lsls r0, r2, 16 + asrs r0, 16 + adds r4, r1, r0 + cmp r4, 0 + blt _081B3B02 + cmp r1, 0x1F + ble _081B3B06 +_081B3B02: + movs r0, 0 + b _081B3B34 +_081B3B06: + cmp r1, 0 + bge _081B3B1A + negs r0, r1 + strb r0, [r6] + movs r0, 0 + mov r1, r12 + strb r0, [r1] + adds r0, r2, r3 + strb r0, [r7] + b _081B3B32 +_081B3B1A: + movs r0, 0 + strb r0, [r6] + mov r0, r12 + strb r5, [r0] + cmp r4, 0x1F + ble _081B3B2E + movs r0, 0x20 + subs r0, r5 + strb r0, [r7] + b _081B3B32 +_081B3B2E: + mov r1, r8 + strb r1, [r7] +_081B3B32: + movs r0, 0x1 +_081B3B34: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81B3AD8 + + thumb_func_start sub_81B3B40 +sub_81B3B40: @ 81B3B40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + str r0, [sp, 0x28] + ldr r0, [sp, 0x54] + ldr r4, [sp, 0x58] + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + lsls r3, 16 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r4, 16 + lsrs r4, 16 + str r4, [sp, 0x30] + lsls r1, 16 + asrs r7, r1, 16 + lsrs r0, r3, 16 + str r0, [sp, 0x2C] + asrs r3, 16 + mov r8, r3 + mov r5, sp + adds r5, 0x25 + mov r6, sp + adds r6, 0x26 + str r6, [sp] + adds r0, r7, 0 + mov r1, r8 + add r2, sp, 0x24 + adds r3, r5, 0 + bl sub_81B3AD8 + lsls r0, 24 + cmp r0, 0 + beq _081B3BFA + ldrb r2, [r5] + mov r1, r9 + lsls r0, r1, 24 + lsrs r0, 24 + mov r9, r0 + ldrb r0, [r6] + str r0, [sp] + mov r1, r10 + lsls r0, r1, 24 + lsrs r4, r0, 24 + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + mov r3, r9 + bl FillBgTilemapBufferRect_Palette0 + ldr r1, [sp, 0x30] + lsls r0, r1, 16 + asrs r0, 16 + adds r0, r7, r0 + lsls r0, 16 + asrs r0, 16 + str r6, [sp] + mov r1, r8 + add r2, sp, 0x24 + adds r3, r5, 0 + bl sub_81B3AD8 + lsls r0, 24 + cmp r0, 0 + beq _081B3BFA + add r0, sp, 0x24 + ldrb r2, [r0] + ldr r1, [sp, 0x2C] + lsls r0, r1, 24 + lsrs r0, 24 + str r0, [sp] + str r4, [sp, 0x4] + ldrb r0, [r5] + str r0, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + ldrb r0, [r6] + str r0, [sp, 0x10] + str r4, [sp, 0x14] + movs r0, 0x11 + str r0, [sp, 0x18] + movs r0, 0 + str r0, [sp, 0x1C] + str r0, [sp, 0x20] + ldr r1, [sp, 0x28] + movs r3, 0 + bl CopyRectToBgTilemapBufferRect +_081B3BFA: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B3B40 + + thumb_func_start sub_81B3C0C +sub_81B3C0C: @ 81B3C0C + push {r4,lr} + ldr r4, =gSprites + ldrb r2, [r0, 0xB] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r4 + lsls r1, 16 + asrs r1, 13 + ldrh r2, [r3, 0x24] + adds r2, r1 + strh r2, [r3, 0x24] + ldrb r3, [r0, 0xA] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r4 + ldrh r3, [r2, 0x24] + adds r3, r1 + strh r3, [r2, 0x24] + ldrb r3, [r0, 0x9] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r4 + ldrh r3, [r2, 0x24] + adds r3, r1 + strh r3, [r2, 0x24] + ldrb r2, [r0, 0xC] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r2, [r0, 0x24] + adds r2, r1 + strh r2, [r0, 0x24] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3C0C + + thumb_func_start sub_81B3C60 +sub_81B3C60: @ 81B3C60 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081B3C8E + ldr r2, =gUnknown_0203CEDC + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + movs r2, 0x14 + ldrsh r1, [r4, r2] + bl sub_81B3C0C +_081B3C8E: + movs r1, 0x16 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081B3CAC + ldr r2, =gUnknown_0203CEDC + ldr r0, =gUnknown_0203CEC8 + movs r1, 0xA + ldrsb r1, [r0, r1] + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + movs r2, 0x16 + ldrsh r1, [r4, r2] + bl sub_81B3C0C +_081B3CAC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3C60 + + thumb_func_start sub_81B3CC0 +sub_81B3CC0: @ 81B3CC0 + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r5, r1, r0 + movs r1, 0x14 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081B3D00 + ldr r0, =gUnknown_0203CEF0 + ldr r0, [r0] + ldrh r1, [r5, 0x10] + ldrh r2, [r5] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + movs r3, 0x2 + ldrsh r2, [r5, r3] + movs r4, 0x4 + ldrsh r3, [r5, r4] + movs r6, 0x6 + ldrsh r4, [r5, r6] + str r4, [sp] + movs r6, 0x14 + ldrsh r4, [r5, r6] + str r4, [sp, 0x4] + bl sub_81B3B40 +_081B3D00: + movs r1, 0x16 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081B3D2E + ldr r0, =gUnknown_0203CEF4 + ldr r0, [r0] + ldrh r1, [r5, 0x12] + ldrh r2, [r5, 0x8] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + movs r3, 0xA + ldrsh r2, [r5, r3] + movs r4, 0xC + ldrsh r3, [r5, r4] + movs r6, 0xE + ldrsh r4, [r5, r6] + str r4, [sp] + movs r6, 0x16 + ldrsh r4, [r5, r6] + str r4, [sp, 0x4] + bl sub_81B3B40 +_081B3D2E: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3CC0 + + thumb_func_start sub_81B3D48 +sub_81B3D48: @ 81B3D48 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r7, r0, 3 + ldr r0, =gTasks + 0x8 + mov r8, r0 + adds r6, r7, r0 + adds r0, r4, 0 + bl sub_81B3CC0 + adds r0, r4, 0 + bl sub_81B3C60 + ldrh r1, [r6, 0x14] + ldrh r2, [r6, 0x10] + adds r1, r2 + strh r1, [r6, 0x10] + ldrh r0, [r6, 0x16] + ldrh r3, [r6, 0x12] + adds r0, r3 + strh r0, [r6, 0x12] + add r2, sp, 0x8 + ldrh r0, [r6] + adds r0, r1 + strh r0, [r2] + adds r1, r2, 0 + ldrh r0, [r6, 0x12] + ldrh r3, [r6, 0x8] + adds r2, r0, r3 + strh r2, [r1, 0x2] + adds r0, r1, 0 + ldrh r0, [r0] + cmp r0, 0x21 + bls _081B3E3A + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0x21 + bls _081B3E3A + movs r1, 0x14 + ldrsh r0, [r6, r1] + negs r0, r0 + strh r0, [r6, 0x14] + movs r2, 0x16 + ldrsh r0, [r6, r2] + negs r0, r0 + strh r0, [r6, 0x16] + bl swap_pokemon_and_oams + ldr r4, =gUnknown_0203CEC8 + ldrb r0, [r4, 0x9] + bl sub_81B0948 + ldrb r0, [r4, 0xA] + bl sub_81B0948 + movs r0, 0x9 + ldrsb r0, [r4, r0] + ldr r5, =gUnknown_0203CEDC + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0xA + ldrsb r0, [r4, r0] + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + ldr r0, =gUnknown_0203CEF0 + ldr r1, [r0] + ldrb r2, [r6] + ldrb r3, [r6, 0x2] + ldrb r0, [r6, 0x4] + str r0, [sp] + ldrb r0, [r6, 0x6] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + ldr r0, =gUnknown_0203CEF4 + ldr r1, [r0] + ldrb r2, [r6, 0x8] + ldrb r3, [r6, 0xA] + ldrb r0, [r6, 0xC] + str r0, [sp] + ldrb r0, [r6, 0xE] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + movs r0, 0x9 + ldrsb r0, [r4, r0] + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl ClearWindowTilemap + movs r0, 0xA + ldrsb r0, [r4, r0] + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl ClearWindowTilemap + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =sub_81B3E60 + str r1, [r0] +_081B3E3A: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3D48 + + thumb_func_start sub_81B3E60 +sub_81B3E60: @ 81B3E60 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + adds r0, r6, 0 + bl sub_81B3CC0 + adds r0, r6, 0 + bl sub_81B3C60 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081B3EE4 + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081B3EE4 + ldr r5, =gUnknown_0203CEC8 + movs r0, 0x9 + ldrsb r0, [r5, r0] + ldr r4, =gUnknown_0203CEDC + ldr r1, [r4] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0xA + ldrsb r0, [r5, r0] + ldr r1, [r4] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gUnknown_0203CEF0 + ldr r0, [r0] + bl Free + ldr r0, =gUnknown_0203CEF4 + ldr r0, [r0] + bl Free + adds r0, r6, 0 + bl sub_81B407C + b _081B3F08 + .pool +_081B3EE4: + ldrh r1, [r4, 0x14] + ldrh r0, [r4, 0x10] + adds r1, r0 + strh r1, [r4, 0x10] + ldrh r0, [r4, 0x16] + ldrh r2, [r4, 0x12] + adds r0, r2 + strh r0, [r4, 0x12] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0 + bne _081B3EFE + strh r1, [r4, 0x14] +_081B3EFE: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081B3F08 + strh r0, [r4, 0x16] +_081B3F08: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B3E60 + + thumb_func_start oamt_swap_pos +oamt_swap_pos: @ 81B3F10 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + ldrb r3, [r0] + ldrb r2, [r1] + strb r2, [r0] + strb r3, [r1] + ldr r5, =gSprites + ldrb r2, [r0] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r5 + ldrh r6, [r3, 0x20] + ldrh r2, [r3, 0x22] + mov r8, r2 + ldrh r2, [r3, 0x24] + mov r9, r2 + ldrh r2, [r3, 0x26] + mov r10, r2 + ldrb r4, [r1] + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x20] + strh r2, [r3, 0x20] + ldrb r2, [r0] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r5 + ldrb r4, [r1] + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x22] + strh r2, [r3, 0x22] + ldrb r2, [r0] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r5 + ldrb r4, [r1] + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x24] + strh r2, [r3, 0x24] + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + ldrb r3, [r1] + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x26] + strh r0, [r2, 0x26] + ldrb r2, [r1] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x20] + ldrb r2, [r1] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + mov r2, r8 + strh r2, [r0, 0x22] + ldrb r2, [r1] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + mov r2, r9 + strh r2, [r0, 0x24] + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r10 + strh r1, [r0, 0x26] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end oamt_swap_pos + + thumb_func_start swap_pokemon_and_oams +swap_pokemon_and_oams: @ 81B3FDC + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, =gUnknown_0203CEDC + ldr r2, =gUnknown_0203CEC8 + movs r3, 0x9 + ldrsb r3, [r2, r3] + lsls r0, r3, 4 + ldr r1, [r1] + adds r0, r1, r0 + str r0, [sp] + ldrb r2, [r2, 0xA] + lsls r2, 24 + asrs r2, 24 + lsls r0, r2, 4 + adds r0, r1, r0 + str r0, [sp, 0x4] + movs r1, 0x64 + adds r4, r3, 0 + muls r4, r1 + ldr r0, =gPlayerParty + adds r4, r0 + adds r5, r2, 0 + muls r5, r1 + adds r5, r0 + movs r0, 0x64 + bl Alloc + adds r6, r0, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x64 + bl memcpy + adds r0, r6, 0 + bl Free + ldr r0, [sp] + adds r0, 0xB + ldr r1, [sp, 0x4] + adds r1, 0xB + bl oamt_swap_pos + ldr r0, [sp] + adds r0, 0xA + ldr r1, [sp, 0x4] + adds r1, 0xA + bl oamt_swap_pos + ldr r0, [sp] + adds r0, 0x9 + ldr r1, [sp, 0x4] + adds r1, 0x9 + bl oamt_swap_pos + ldr r0, [sp] + adds r0, 0xC + ldr r1, [sp, 0x4] + adds r1, 0xC + bl oamt_swap_pos + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end swap_pokemon_and_oams + + thumb_func_start sub_81B407C +sub_81B407C: @ 81B407C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + ldr r4, =gUnknown_0203CEC8 + movs r0, 0 + strb r0, [r4, 0xB] + ldrb r0, [r4, 0x9] + movs r1, 0 + bl sub_81B0FCC + ldrb r0, [r4, 0xA] + strb r0, [r4, 0x9] + ldrb r0, [r4, 0xA] + movs r1, 0x1 + bl sub_81B0FCC + movs r0, 0 + bl display_pokemon_menu_message + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1370 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B407C + + thumb_func_start brm_cancel_1 +brm_cancel_1: @ 81B40D4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x6 + bne _081B4110 + movs r0, 0xF + bl display_pokemon_menu_message + b _081B4116 + .pool +_081B4110: + movs r0, 0 + bl display_pokemon_menu_message +_081B4116: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end brm_cancel_1 + + thumb_func_start sub_81B4134 +sub_81B4134: @ 81B4134 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gPlayerParty + ldr r1, =gUnknown_0203CEC8 + ldrb r1, [r1, 0x9] + movs r2, 0x8 + bl sub_81B33B4 + movs r0, 0x1 + bl sub_81B31B0 + movs r0, 0x18 + bl display_pokemon_menu_message + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, =sub_81B3730 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4134 + + thumb_func_start sub_81B4198 +sub_81B4198: @ 81B4198 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B41C4 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4198 + + thumb_func_start sub_81B41C4 +sub_81B41C4: @ 81B41C4 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _081B41E0 + ldr r2, =c2_8123744 + movs r0, 0x2 + movs r1, 0x5 + bl GoToBagMenu + b _081B41E8 + .pool +_081B41E0: + ldr r1, =c2_8123744 + movs r0, 0x2 + bl sub_81C4F98 +_081B41E8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B41C4 + + thumb_func_start c2_8123744 +c2_8123744: @ 81B41F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r6, =gUnknown_0203CE7C + ldrh r0, [r6] + cmp r0, 0 + bne _081B4224 + ldr r3, =gUnknown_0203CEC8 + ldrb r0, [r3, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r3, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B36FC + str r1, [sp, 0x4] + ldr r1, [r3] + b _081B425A + .pool +_081B4224: + ldr r4, =gUnknown_0203CEFC + ldr r5, =gUnknown_0203CEC8 + movs r0, 0x9 + ldrsb r0, [r5, r0] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r7, =gPlayerParty + adds r0, r7 + movs r1, 0xC + bl GetMonData + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + beq _081B4278 + ldrb r0, [r5, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r5, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B4350 + str r1, [sp, 0x4] + ldr r1, [r5] +_081B425A: + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + b _081B42C0 + .pool +_081B4278: + ldrh r0, [r6] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B42A4 + ldrh r0, [r6] + movs r1, 0x1 + bl RemoveBagItem + movs r0, 0x9 + ldrsb r0, [r5, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + ldrh r1, [r6] + bl sub_81B1DB8 + bl sub_81B452C + b _081B42C0 +_081B42A4: + ldrb r0, [r5, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r5, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B42D0 + str r1, [sp, 0x4] + ldr r1, [r5] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 +_081B42C0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c2_8123744 + + thumb_func_start sub_81B42D0 +sub_81B42D0: @ 81B42D0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B432C + ldr r0, =gUnknown_0203CE7C + ldrh r4, [r0] + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r6, 0x64 + muls r0, r6 + ldr r5, =gPlayerParty + adds r0, r5 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B1C84 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r6 + adds r0, r5 + adds r1, r4, 0 + bl sub_81B1DB8 + adds r0, r4, 0 + movs r1, 0x1 + bl RemoveBagItem + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + str r1, [r0] +_081B432C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B42D0 + + thumb_func_start sub_81B4350 +sub_81B4350: @ 81B4350 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B4388 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gUnknown_0203CEFC + ldrh r1, [r1] + movs r2, 0x1 + bl sub_81B1D1C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B43A8 + str r1, [r0] +_081B4388: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4350 + + thumb_func_start sub_81B43A8 +sub_81B43A8: @ 81B43A8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B43CC + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B43DC + str r0, [r1] +_081B43CC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B43A8 + + thumb_func_start sub_81B43DC +sub_81B43DC: @ 81B43DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B4402 + cmp r1, 0 + bgt _081B43FC + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B44D8 + b _081B44EC +_081B43FC: + cmp r1, 0x1 + beq _081B44DE + b _081B44EC +_081B4402: + ldr r5, =gUnknown_0203CE7C + ldrh r0, [r5] + movs r1, 0x1 + bl RemoveBagItem + ldr r6, =gUnknown_0203CEFC + ldrh r0, [r6] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + cmp r0, 0 + bne _081B4458 + ldrh r0, [r5] + movs r1, 0x1 + bl AddBagItem + ldrh r0, [r6] + bl pokemon_item_not_removed + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] + b _081B44EC + .pool +_081B4458: + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B4498 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldrh r1, [r5] + bl sub_81B1DB8 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B44FC + str r1, [r0] + b _081B44EC + .pool +_081B4498: + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldrh r1, [r5] + bl sub_81B1DB8 + ldrh r0, [r5] + ldrh r1, [r6] + movs r2, 0x1 + bl sub_81B1D68 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + str r1, [r0] + b _081B44EC + .pool +_081B44D8: + movs r0, 0x5 + bl PlaySE +_081B44DE: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1C1C + str r0, [r1] +_081B44EC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B43DC + + thumb_func_start sub_81B44FC +sub_81B44FC: @ 81B44FC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B451C + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B452C + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 +_081B451C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B44FC + + thumb_func_start sub_81B452C +sub_81B452C: @ 81B452C + push {lr} + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x40 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSaveBlock1Ptr + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x00002be0 + adds r2, r0 + ldr r1, [r1] + adds r1, r2 + ldr r2, =sub_81B4578 + movs r0, 0x4 + movs r3, 0x3 + bl sub_811A20C + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B452C + + thumb_func_start sub_81B4578 +sub_81B4578: @ 81B4578 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =gScriptResult + ldrh r7, [r0] + cmp r7, 0 + bne _081B45F8 + adds r0, r5, 0 + bl sub_80D4680 + ldr r4, =gUnknown_0203CEFC + adds r0, r5, 0 + movs r1, 0xC + adds r2, r4, 0 + bl SetMonData + ldrh r0, [r4] + movs r1, 0x1 + bl RemoveBagItem + mov r0, r8 + movs r1, 0x1 + bl AddBagItem + ldrb r0, [r6, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r6, 0xB] + str r7, [sp] + ldr r1, =sub_81B36FC + str r1, [sp, 0x4] + ldr r1, [r6] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + b _081B4614 + .pool +_081B45F8: + ldrb r0, [r6, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r6, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B4624 + str r1, [sp, 0x4] + ldr r1, [r6] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 +_081B4614: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4578 + + thumb_func_start sub_81B4624 +sub_81B4624: @ 81B4624 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B468A + ldr r1, =gUnknown_0203CEFC + ldrh r0, [r1] + cmp r0, 0 + bne _081B4670 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gUnknown_0203CE7C + ldrh r1, [r1] + movs r2, 0 + movs r3, 0 + bl sub_81B1C84 + b _081B467C + .pool +_081B4670: + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldrh r1, [r1] + movs r2, 0 + bl sub_81B1D68 +_081B467C: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B469C + str r0, [r1] +_081B468A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4624 + + thumb_func_start sub_81B469C +sub_81B469C: @ 81B469C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r6, r1, r0 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B471C + ldr r5, =gUnknown_0203CEDC + movs r0, 0x9 + ldrsb r0, [r4, r0] + lsls r0, 4 + ldr r1, [r5] + adds r1, r0 + adds r0, r6, 0 + bl sub_81B5C94 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xC + bne _081B4716 + adds r0, r6, 0 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + beq _081B4704 + movs r0, 0x9 + ldrsb r0, [r4, r0] + lsls r0, 4 + ldr r1, [r5] + adds r1, r0 + movs r0, 0xB + movs r2, 0x1 + bl sub_81B2FA8 + b _081B4716 + .pool +_081B4704: + movs r0, 0x9 + ldrsb r0, [r4, r0] + lsls r0, 4 + ldr r1, [r5] + adds r1, r0 + movs r0, 0xC + movs r2, 0x1 + bl sub_81B2FA8 +_081B4716: + adds r0, r7, 0 + bl sub_81B1C1C +_081B471C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B469C + + thumb_func_start sub_81B4724 +sub_81B4724: @ 81B4724 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B1E00 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B4788 + cmp r0, 0x1 + beq _081B47AC + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + bl sub_81B1CD0 + b _081B47BA + .pool +_081B4788: + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9980 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + b _081B47B4 + .pool +_081B47AC: + adds r0, r6, 0 + bl pokemon_item_not_removed + ldr r0, =gStringVar4 +_081B47B4: + movs r1, 0x1 + bl sub_81B1B5C +_081B47BA: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gTasks + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B469C + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4724 + + thumb_func_start sub_81B47E0 +sub_81B47E0: @ 81B47E0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + cmp r5, 0 + bne _081B4864 + ldr r1, =gStringVar1 + adds r0, r7, 0 + bl GetMonNickname + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9980 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + b _081B488A + .pool +_081B4864: + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9E00 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B48A8 +_081B488A: + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B47E0 + + thumb_func_start sub_81B48A8 +sub_81B48A8: @ 81B48A8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B48CC + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B48DC + str r0, [r1] +_081B48CC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B48A8 + + thumb_func_start sub_81B48DC +sub_81B48DC: @ 81B48DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B491A + cmp r1, 0 + bgt _081B4914 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B4964 + b _081B4978 + .pool +_081B4914: + cmp r1, 0x1 + beq _081B496A + b _081B4978 +_081B491A: + adds r0, r4, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9E14 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B4988 + str r1, [r0] + b _081B4978 + .pool +_081B4964: + movs r0, 0x5 + bl PlaySE +_081B496A: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1C1C + str r0, [r1] +_081B4978: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B48DC + + thumb_func_start sub_81B4988 +sub_81B4988: @ 81B4988 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B49EC + movs r1, 0 + mov r0, sp + strh r1, [r0] + adds r0, r5, 0 + movs r1, 0xC + mov r2, sp + bl SetMonData + ldr r4, =gUnknown_0203CEDC + movs r0, 0x9 + ldrsb r0, [r6, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + adds r0, r5, 0 + bl sub_81B5C94 + movs r0, 0x9 + ldrsb r0, [r6, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + movs r0, 0xC + movs r2, 0x1 + bl sub_81B2FA8 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B49EC: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4988 + + thumb_func_start sub_81B4A08 +sub_81B4A08: @ 81B4A08 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gPlayerParty + ldr r1, =gUnknown_0203CEC8 + ldrb r1, [r1, 0x9] + movs r2, 0x9 + bl sub_81B33B4 + movs r0, 0x2 + bl sub_81B31B0 + movs r0, 0x19 + bl display_pokemon_menu_message + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, =sub_81B3730 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4A08 + + thumb_func_start sub_81B4A6C +sub_81B4A6C: @ 81B4A6C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B4A98 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4A6C + + thumb_func_start sub_81B4A98 +sub_81B4A98: @ 81B4A98 + push {lr} + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x40 + bl GetMonData + ldr r2, =gSaveBlock1Ptr + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x00002be0 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + ldr r1, =sub_81B4AE0 + movs r2, 0x1 + bl sub_8121478 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4A98 + + thumb_func_start sub_81B4AE0 +sub_81B4AE0: @ 81B4AE0 + push {lr} + sub sp, 0xC + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r3, =gUnknown_0203CEC8 + ldrb r0, [r3, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r3, 0xB] + movs r1, 0x15 + str r1, [sp] + ldr r1, =sub_81B36FC + str r1, [sp, 0x4] + ldr r1, [r3] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4AE0 + + thumb_func_start brm_take_2 +brm_take_2: @ 81B4B20 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + ldr r5, =gUnknown_0203CEC4 + ldr r0, [r5] + adds r0, 0xD + bl sub_81B302C + ldr r0, [r5] + adds r0, 0xC + bl sub_81B302C + ldr r0, =gUnknown_085E9855 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B4B6C + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end brm_take_2 + + thumb_func_start sub_81B4B6C +sub_81B4B6C: @ 81B4B6C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B4B90 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B4BA0 + str r0, [r1] +_081B4B90: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4B6C + + thumb_func_start sub_81B4BA0 +sub_81B4BA0: @ 81B4BA0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B4BC6 + cmp r1, 0 + bgt _081B4BC0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B4C30 + b _081B4C4C +_081B4BC0: + cmp r1, 0x1 + beq _081B4C36 + b _081B4C4C +_081B4BC6: + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_80D4700 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081B4C0C + ldr r0, =gUnknown_085E9877 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + b _081B4C4A + .pool +_081B4C0C: + ldr r0, =gUnknown_085E9897 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + b _081B4C4A + .pool +_081B4C30: + movs r0, 0x5 + bl PlaySE +_081B4C36: + ldr r0, =gUnknown_085E98B4 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B4C60 +_081B4C4A: + str r1, [r0] +_081B4C4C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4BA0 + + thumb_func_start sub_81B4C60 +sub_81B4C60: @ 81B4C60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B4C84 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B4C94 + str r0, [r1] +_081B4C84: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4C60 + + thumb_func_start sub_81B4C94 +sub_81B4C94: @ 81B4C94 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B4CBE + cmp r1, 0 + bgt _081B4CB8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B4D50 + b _081B4D64 +_081B4CB8: + cmp r1, 0x1 + beq _081B4D56 + b _081B4D64 +_081B4CBE: + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r7, 0x64 + muls r0, r7 + ldr r6, =gPlayerParty + adds r0, r6 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B4D24 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r7 + adds r0, r6 + bl sub_80D4680 + ldr r0, =gUnknown_085E99B8 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + str r1, [r0] + b _081B4D64 + .pool +_081B4D24: + adds r0, r4, 0 + bl pokemon_item_not_removed + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] + b _081B4D64 + .pool +_081B4D50: + movs r0, 0x5 + bl PlaySE +_081B4D56: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1C1C + str r0, [r1] +_081B4D64: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4C94 + + thumb_func_start sub_81B4D78 +sub_81B4D78: @ 81B4D78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r5, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r5, r1] + movs r0, 0x64 + muls r0, r1 + ldr r6, =gPlayerParty + adds r7, r0, r6 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldrb r4, [r5, 0x9] + adds r0, r7, 0 + bl sub_81B353C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81B33B4 + ldrb r1, [r5, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xC + beq _081B4DE4 + movs r0, 0 + bl sub_81B31B0 + movs r0, 0x15 + bl display_pokemon_menu_message + b _081B4E02 + .pool +_081B4DE4: + movs r0, 0x1 + bl sub_81B31B0 + adds r0, r7, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gStringVar2 + bl CopyItemName + movs r0, 0x1A + bl display_pokemon_menu_message +_081B4E02: + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, =sub_81B3730 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4D78 + + thumb_func_start brm_shift_sendout +brm_shift_sendout: @ 81B4E2C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r5, =gUnknown_0203CEC4 + ldr r0, [r5] + adds r0, 0xC + bl sub_81B302C + bl sub_81B8A7C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B4E5C + adds r0, r4, 0 + bl sub_81B12C0 + b _081B4E7A + .pool +_081B4E5C: + ldr r0, [r5] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gStringVar4 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B4E7A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end brm_shift_sendout + + thumb_func_start sub_81B4E8C +sub_81B4E8C: @ 81B4E8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + bl sub_81B8830 + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + cmp r5, r6 + bcs _081B4F36 + ldr r2, =gUnknown_0203CEC8 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + mov r8, r0 +_081B4EC6: + ldr r0, =gUnknown_0203CEF8 + adds r4, r5, r0 + ldrb r0, [r4] + cmp r0, 0 + bne _081B4F2C + movs r0, 0x5 + str r2, [sp] + bl PlaySE + ldr r2, [sp] + ldrb r0, [r2, 0x9] + adds r0, 0x1 + strb r0, [r4] + adds r0, r5, 0x2 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CEDC + ldrb r2, [r2, 0x9] + lsls r2, 24 + asrs r2, 24 + lsls r2, 4 + ldr r1, [r1] + adds r1, r2 + movs r2, 0x1 + bl sub_81B2FA8 + subs r0, r6, 0x1 + cmp r5, r0 + bne _081B4F04 + bl sub_81B4F88 +_081B4F04: + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =sub_81B1370 + mov r1, r8 + str r0, [r1] + b _081B4F68 + .pool +_081B4F2C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _081B4EC6 +_081B4F36: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9830 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x20 + bl PlaySE + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B4F68: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4E8C + + thumb_func_start sub_81B4F88 +sub_81B4F88: @ 81B4F88 + push {r4,lr} + ldr r4, =gUnknown_0203CEC8 + ldrb r0, [r4, 0x9] + movs r1, 0 + bl sub_81B0FCC + movs r0, 0x6 + strb r0, [r4, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4F88 + + thumb_func_start sub_81B4FA8 +sub_81B4FA8: @ 81B4FA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + bl sub_81B8830 + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _081B502A + ldr r6, =gUnknown_0203CEF8 + subs r2, r5, 0x1 + adds r7, r6, 0 + ldr r3, =gUnknown_0203CEC8 +_081B4FE2: + adds r0, r4, r6 + ldrb r1, [r0] + movs r0, 0x9 + ldrsb r0, [r3, r0] + adds r0, 0x1 + cmp r1, r0 + bne _081B5020 + adds r0, r4, 0 + adds r4, r2, 0 + cmp r0, r4 + bge _081B500C + adds r3, r7, 0 +_081B4FFA: + adds r2, r0, r3 + adds r1, r0, 0x1 + adds r0, r1, r3 + ldrb r0, [r0] + strb r0, [r2] + lsls r1, 24 + lsrs r0, r1, 24 + cmp r0, r4 + blt _081B4FFA +_081B500C: + adds r1, r0, r6 + movs r0, 0 + strb r0, [r1] + b _081B502A + .pool +_081B5020: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _081B4FE2 +_081B502A: + ldr r6, =gUnknown_0203CEDC + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + lsls r0, 4 + ldr r1, [r6] + adds r1, r0 + movs r0, 0x1 + movs r2, 0x1 + bl sub_81B2FA8 + movs r4, 0 + subs r5, 0x1 + mov r0, r8 + lsls r7, r0, 2 + cmp r4, r5 + bge _081B5078 +_081B504E: + ldr r0, =gUnknown_0203CEF8 + adds r1, r4, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _081B506E + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r1] + lsls r2, 4 + subs r2, 0x10 + ldr r1, [r6] + adds r1, r2 + movs r2, 0x1 + bl sub_81B2FA8 +_081B506E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + blt _081B504E +_081B5078: + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =gTasks + mov r2, r8 + adds r1, r7, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4FA8 + + thumb_func_start sub_81B50AC +sub_81B50AC: @ 81B50AC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B50AC + + thumb_func_start sub_81B50C8 +sub_81B50C8: @ 81B50C8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + mov r9, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r4, =gPlayerParty + adds r0, r4 + movs r1, 0x41 + bl GetMonData + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + mov r1, r9 + movs r0, 0x9 + ldrsb r0, [r1, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r4 + movs r1, 0xB + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r1, r9 + movs r0, 0x9 + ldrsb r0, [r1, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r4 + movs r1, 0x50 + bl GetMonData + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800F7DC + ldr r0, [r0] + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_807A8D0 + cmp r0, 0x1 + beq _081B515C + cmp r0, 0x2 + beq _081B5170 + movs r0, 0x5 + bl PlaySE + adds r0, r7, 0 + bl sub_81B12C0 + b _081B51B0 + .pool +_081B515C: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA210 + bl StringExpandPlaceholders + b _081B5178 + .pool +_081B5170: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA234 + bl StringExpandPlaceholders +_081B5178: + movs r0, 0x20 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EA1CA + adds r0, r4, 0 + bl StringAppend + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B51B0: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B50C8 + + thumb_func_start brm_trade_1 +brm_trade_1: @ 81B51D4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r6, 0x64 + muls r0, r6 + ldr r4, =gPlayerParty + adds r0, r4 + movs r1, 0x41 + bl GetMonData + mov r9, r0 + mov r1, r9 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r6 + adds r0, r4 + movs r1, 0xB + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r6 + adds r0, r4 + movs r1, 0x50 + bl GetMonData + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800F7DC + ldr r0, [r0] + ldr r1, =gUnknown_02022C38 + ldr r1, [r1] + ldr r2, =gUnknown_02022C3C + ldrh r3, [r2] + ldr r2, =gUnknown_02022C3E + ldrb r2, [r2] + str r2, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + mov r2, r9 + bl sub_807A7E0 + cmp r0, 0 + beq _081B52C8 + ldr r5, =gStringVar4 + ldr r1, =gUnknown_08615E0C + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl StringExpandPlaceholders + movs r0, 0x20 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r1, =gUnknown_085EA1CA + adds r0, r5, 0 + bl StringAppend + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] + b _081B52D4 + .pool +_081B52C8: + movs r0, 0x5 + bl PlaySE + adds r0, r7, 0 + bl sub_81B12C0 +_081B52D4: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end brm_trade_1 + + thumb_func_start sub_81B52E4 +sub_81B52E4: @ 81B52E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gPlayerParty + ldr r1, =gUnknown_0203CEC8 + ldrb r1, [r1, 0x9] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl sub_807A918 + cmp r0, 0x2 + beq _081B5340 + cmp r0, 0x2 + bgt _081B5328 + cmp r0, 0x1 + beq _081B532E + b _081B5368 + .pool +_081B5328: + cmp r0, 0x3 + beq _081B5354 + b _081B5368 +_081B532E: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA1E8 + bl StringExpandPlaceholders + b _081B53C0 + .pool +_081B5340: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA210 + bl StringExpandPlaceholders + b _081B53C0 + .pool +_081B5354: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA234 + bl StringExpandPlaceholders + b _081B53C0 + .pool +_081B5368: + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EA1CD + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B53FC + b _081B53E4 + .pool +_081B53C0: + movs r0, 0x20 + bl PlaySE + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EA1CA + adds r0, r4, 0 + bl StringAppend + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C +_081B53E4: + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B52E4 + + thumb_func_start sub_81B53FC +sub_81B53FC: @ 81B53FC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B5420 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B5430 + str r0, [r1] +_081B5420: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B53FC + + thumb_func_start sub_81B5430 +sub_81B5430: @ 81B5430 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B5456 + cmp r1, 0 + bgt _081B5450 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B545E + b _081B546A +_081B5450: + cmp r1, 0x1 + beq _081B5464 + b _081B546A +_081B5456: + adds r0, r4, 0 + bl sub_81B12C0 + b _081B546A +_081B545E: + movs r0, 0x5 + bl PlaySE +_081B5464: + adds r0, r4, 0 + bl sub_81B1C1C +_081B546A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5430 + + thumb_func_start sub_81B5470 +sub_81B5470: @ 81B5470 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl GetMenuCursorPos + ldr r5, =gUnknown_0203CEC4 + ldr r1, [r5] + lsls r0, 24 + lsrs r0, 24 + adds r1, 0xF + adds r1, r0 + ldrb r0, [r1] + subs r0, 0x13 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r1, =gUnknown_08615D9C + lsls r0, r4, 3 + adds r7, r0, r1 + ldr r0, [r7] + cmp r0, 0 + bne _081B54A2 + b _081B5664 +_081B54A2: + ldr r0, [r5] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r5] + adds r0, 0xD + bl sub_81B302C + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B54C6 + bl InUnionRoom + cmp r0, 0x1 + bne _081B54E8 +_081B54C6: + adds r0, r4, 0 + subs r0, 0xB + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B54E4 + movs r0, 0xD + bl display_pokemon_menu_message + b _081B5656 + .pool +_081B54E4: + ldrb r0, [r7, 0x4] + b _081B5652 +_081B54E8: + cmp r4, 0x7 + bhi _081B5524 + ldr r1, =0x00000867 + adds r0, r4, r1 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B5524 + ldr r0, =gUnknown_085E97FC + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] + b _081B5664 + .pool +_081B5524: + ldr r1, =gUnknown_08615D9C + lsls r0, r4, 3 + adds r5, r0, r1 + ldr r0, [r5] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B553A + b _081B563C +_081B553A: + subs r0, r4, 0x5 + cmp r0, 0x7 + bhi _081B5624 + lsls r0, 2 + ldr r1, =_081B5554 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B5554: + .4byte _081B5614 + .4byte _081B5624 + .4byte _081B5624 + .4byte _081B557C + .4byte _081B55B8 + .4byte _081B5624 + .4byte _081B5574 + .4byte _081B5574 +_081B5574: + adds r0, r6, 0 + bl sub_8161560 + b _081B5664 +_081B557C: + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + movs r0, 0x1C + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x1D] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r1, r0, 0 + ldr r0, =gStringVar1 + ldrb r1, [r1, 0x14] + bl sub_81245DC + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA196 + b _081B55E8 + .pool +_081B55B8: + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x24 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + adds r1, 0x25 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r1, r0, 0 + ldr r0, =gStringVar1 + ldrb r1, [r1, 0x14] + bl sub_81245DC + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA16B +_081B55E8: + bl StringExpandPlaceholders + adds r0, r6, 0 + bl sub_81B5674 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + strh r4, [r0] + b _081B5664 + .pool +_081B5614: + ldr r1, =gUnknown_0203CEC8 + ldr r0, =sub_8124690 + b _081B5628 + .pool +_081B5624: + ldr r1, =gUnknown_0203CEC8 + ldr r0, =c2_exit_to_overworld_2_switch +_081B5628: + str r0, [r1] + adds r0, r6, 0 + bl sub_81B12C0 + b _081B5664 + .pool +_081B563C: + cmp r4, 0x1 + beq _081B564A + cmp r4, 0x4 + bne _081B5650 + bl sub_81B5864 + b _081B5656 +_081B564A: + bl sub_81B57DC + b _081B5656 +_081B5650: + ldrb r0, [r5, 0x4] +_081B5652: + bl display_pokemon_menu_message +_081B5656: + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =task_brm_cancel_1_on_keypad_a_or_b + str r0, [r1] +_081B5664: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5470 + + thumb_func_start sub_81B5674 +sub_81B5674: @ 81B5674 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gStringVar4 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B56A4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5674 + + thumb_func_start sub_81B56A4 +sub_81B56A4: @ 81B56A4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B56C8 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B56D8 + str r0, [r1] +_081B56C8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B56A4 + + thumb_func_start sub_81B56D8 +sub_81B56D8: @ 81B56D8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B56FE + cmp r1, 0 + bgt _081B56F8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B5714 + b _081B572A +_081B56F8: + cmp r1, 0x1 + beq _081B571A + b _081B572A +_081B56FE: + ldr r1, =gUnknown_0203CEC8 + ldr r0, =c2_exit_to_overworld_2_switch + str r0, [r1] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B572A + .pool +_081B5714: + movs r0, 0x5 + bl PlaySE +_081B571A: + ldr r0, =gUnknown_03005DB0 + movs r1, 0 + str r1, [r0] + ldr r0, =gUnknown_0203CEEC + str r1, [r0] + adds r0, r4, 0 + bl sub_81B1C1C +_081B572A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B56D8 + + thumb_func_start hm_add_c3_launch_phase_2 +hm_add_c3_launch_phase_2: @ 81B5738 + push {lr} + bl pal_fill_black + ldr r0, =task_launch_hm_phase_2 + movs r1, 0x8 + bl CreateTask + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end hm_add_c3_launch_phase_2 + + thumb_func_start task_launch_hm_phase_2 +task_launch_hm_phase_2: @ 81B5750 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B577C + bl brm_get_selected_species + ldr r1, =gUnknown_02038C08 + lsls r0, 16 + lsrs r0, 16 + str r0, [r1] + ldr r0, =gUnknown_0203CEEC + ldr r0, [r0] + bl _call_via_r0 + adds r0, r4, 0 + bl DestroyTask +_081B577C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_launch_hm_phase_2 + + thumb_func_start brm_get_selected_species +brm_get_selected_species: @ 81B578C + push {lr} + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end brm_get_selected_species + + thumb_func_start task_brm_cancel_1_on_keypad_a_or_b +task_brm_cancel_1_on_keypad_a_or_b: @ 81B57B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B57CE + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B57D4 +_081B57CE: + adds r0, r2, 0 + bl brm_cancel_1 +_081B57D4: + pop {r0} + bx r0 + .pool + thumb_func_end task_brm_cancel_1_on_keypad_a_or_b + + thumb_func_start sub_81B57DC +sub_81B57DC: @ 81B57DC + push {lr} + ldr r0, =0x00000888 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B57F8 + movs r0, 0xC + bl display_pokemon_menu_message + b _081B57FE + .pool +_081B57F8: + movs r0, 0xD + bl display_pokemon_menu_message +_081B57FE: + pop {r0} + bx r0 + thumb_func_end sub_81B57DC + + thumb_func_start hm_surf_run_dp02scr +hm_surf_run_dp02scr: @ 81B5804 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x9 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end hm_surf_run_dp02scr + + thumb_func_start sub_81B5820 +sub_81B5820: @ 81B5820 + push {lr} + bl PartyHasMonWithSurf + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B585C + bl IsPlayerFacingSurfableFishableWater + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B585C + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =hm_surf_run_dp02scr + str r0, [r1] + movs r0, 0x1 + b _081B585E + .pool +_081B585C: + movs r0, 0 +_081B585E: + pop {r1} + bx r1 + thumb_func_end sub_81B5820 + + thumb_func_start sub_81B5864 +sub_81B5864: @ 81B5864 + push {lr} + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _081B587A + movs r0, 0x9 + bl display_pokemon_menu_message + b _081B5880 +_081B587A: + movs r0, 0x8 + bl display_pokemon_menu_message +_081B5880: + pop {r0} + bx r0 + thumb_func_end sub_81B5864 + + thumb_func_start sub_81B5884 +sub_81B5884: @ 81B5884 + push {lr} + ldr r0, =gMapHeader + ldrb r0, [r0, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B58A0 + movs r0, 0 + b _081B58A2 + .pool +_081B58A0: + movs r0, 0x1 +_081B58A2: + pop {r1} + bx r1 + thumb_func_end sub_81B5884 + + thumb_func_start sub_81B58A8 +sub_81B58A8: @ 81B58A8 + push {lr} + sub sp, 0xC + movs r0, 0 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_8086194 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B58A8 + + thumb_func_start hm2_waterfall +hm2_waterfall: @ 81B58D4 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x2B + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end hm2_waterfall + + thumb_func_start hm_prepare_waterfall +hm_prepare_waterfall: @ 81B58F0 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsWaterfall + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B594C + bl IsPlayerSurfingNorth + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B594C + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =hm2_waterfall + str r0, [r1] + movs r0, 0x1 + b _081B594E + .pool +_081B594C: + movs r0, 0 +_081B594E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end hm_prepare_waterfall + + thumb_func_start sub_81B5958 +sub_81B5958: @ 81B5958 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x2C + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5958 + + thumb_func_start sub_81B5974 +sub_81B5974: @ 81B5974 + push {lr} + bl sub_809D1E8 + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1, 0x4] + cmp r0, 0 + bne _081B5990 + movs r0, 0 + b _081B599E + .pool +_081B5990: + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =sub_81B5958 + str r0, [r1] + movs r0, 0x1 +_081B599E: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B5974 + + thumb_func_start party_menu_icon_anim +@ void party_menu_icon_anim(struct pokemon *mon, int a2, int a3) +party_menu_icon_anim: @ 81B59B4 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r7, r1, 0 + adds r4, r2, 0 + movs r6, 0x1 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B59EA + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B59EA + ldr r0, =gUnknown_08616020 + adds r0, r4, r0 + ldrb r1, [r0] + eors r1, r6 + negs r0, r1 + orrs r0, r1 + lsrs r6, r0, 31 +_081B59EA: + adds r0, r5, 0 + movs r1, 0x41 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0 + bl GetMonData + adds r1, r0, 0 + str r6, [sp] + adds r0, r4, 0 + adds r2, r7, 0 + movs r3, 0x1 + bl party_menu_link_mon_icon_anim + ldrb r0, [r7, 0x9] + adds r1, r5, 0 + bl sub_81B5B38 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_icon_anim + + thumb_func_start party_menu_link_mon_icon_anim +@ void party_menu_link_mon_icon_anim(u16 speciesId, u32 personality, int a3, char a4, int a5) +party_menu_link_mon_icon_anim: @ 81B5A2C + push {r4-r7,lr} + sub sp, 0xC + adds r6, r1, 0 + adds r4, r2, 0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r3, 24 + lsrs r7, r3, 24 + cmp r5, 0 + beq _081B5A7A + ldr r1, =sub_80D3014 + ldr r0, [r4, 0x4] + ldrb r2, [r0] + ldrb r3, [r0, 0x1] + movs r0, 0x4 + str r0, [sp] + str r6, [sp, 0x4] + ldr r0, [sp, 0x20] + str r0, [sp, 0x8] + adds r0, r5, 0 + bl sub_80D2CC4 + strb r0, [r4, 0x9] + ldr r2, =gSprites + ldrb r0, [r4, 0x9] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x3 + adds r2, r7, 0 + ands r2, r0 + lsls r2, 2 + ldrb r3, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_081B5A7A: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_link_mon_icon_anim + + thumb_func_start sub_81B5A8C +sub_81B5A8C: @ 81B5A8C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r0, r1, 0 + adds r1, r2, 0 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _081B5AEC + cmp r0, 0x2 + bgt _081B5AB4 + cmp r0, 0x1 + beq _081B5B04 + b _081B5B1C +_081B5AB4: + cmp r0, 0x3 + beq _081B5AD4 + cmp r0, 0x4 + bne _081B5B1C + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0 + bl sub_80D32C8 + b _081B5B2C + .pool +_081B5AD4: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x1 + bl sub_80D32C8 + b _081B5B2C + .pool +_081B5AEC: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x2 + bl sub_80D32C8 + b _081B5B2C + .pool +_081B5B04: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x3 + bl sub_80D32C8 + b _081B5B2C + .pool +_081B5B1C: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x4 + bl sub_80D32C8 +_081B5B2C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5A8C + + thumb_func_start sub_81B5B38 +sub_81B5B38: @ 81B5B38 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + movs r1, 0x39 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + movs r1, 0x3A + bl GetMonData + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B5A8C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B5B38 + + thumb_func_start sub_81B5B6C +sub_81B5B6C: @ 81B5B6C + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + ldr r5, =gSprites + lsls r0, r4, 4 + adds r0, r4 + lsls r6, r0, 2 + adds r2, r6, r5 + movs r7, 0 + movs r3, 0 + strh r3, [r2, 0x2E] + mov r12, r5 + cmp r1, 0 + bne _081B5BC4 + movs r1, 0x20 + ldrsh r0, [r2, r1] + cmp r0, 0x10 + bne _081B5BA4 + strh r3, [r2, 0x24] + ldr r0, =0x0000fffc + strh r0, [r2, 0x26] + b _081B5BAA + .pool +_081B5BA4: + ldr r0, =0x0000fffc + strh r0, [r2, 0x24] + strh r3, [r2, 0x26] +_081B5BAA: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + mov r1, r12 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_81B5C08 + b _081B5BD0 + .pool +_081B5BC4: + strh r3, [r2, 0x24] + strh r3, [r2, 0x26] + adds r0, r5, 0 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, =sub_81B5BDC +_081B5BD0: + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5B6C + + thumb_func_start sub_81B5BDC +sub_81B5BDC: @ 81B5BDC + push {r4,lr} + adds r4, r0, 0 + bl sub_80D30DC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B5C02 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081B5C00 + ldr r0, =0x0000fffd + strh r0, [r4, 0x26] + b _081B5C02 + .pool +_081B5C00: + strh r1, [r4, 0x26] +_081B5C02: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5BDC + + thumb_func_start sub_81B5C08 +sub_81B5C08: @ 81B5C08 + push {lr} + bl sub_80D30DC + pop {r0} + bx r0 + thumb_func_end sub_81B5C08 + + thumb_func_start party_menu_held_item_object +party_menu_held_item_object: @ 81B5C14 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B5C3C + ldr r0, =gUnknown_08615EC0 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x3] + movs r3, 0 + bl CreateSprite + strb r0, [r4, 0xA] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B5C94 +_081B5C3C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_held_item_object + + thumb_func_start party_menu_link_mon_held_item_object +party_menu_link_mon_held_item_object: @ 81B5C48 + push {r4,r5,lr} + adds r4, r2, 0 + lsls r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + cmp r0, 0 + beq _081B5C84 + ldr r0, =gUnknown_08615EC0 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x3] + movs r3, 0 + bl CreateSprite + strb r0, [r4, 0xA] + ldr r2, =gSprites + ldrb r0, [r4, 0xA] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B5CB0 +_081B5C84: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_link_mon_held_item_object + + thumb_func_start sub_81B5C94 +sub_81B5C94: @ 81B5C94 + push {r4,lr} + adds r4, r1, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl sub_81B5CB0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5C94 + + thumb_func_start sub_81B5CB0 +sub_81B5CB0: @ 81B5CB0 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _081B5CD8 + ldr r2, =gSprites + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081B5D24 + .pool +_081B5CD8: + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B5CFC + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x1 + bl StartSpriteAnim + b _081B5D0E + .pool +_081B5CFC: + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0 + bl StartSpriteAnim +_081B5D0E: + ldr r2, =gSprites + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081B5D24: + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5CB0 + + thumb_func_start sub_81B5D30 +sub_81B5D30: @ 81B5D30 + push {lr} + ldr r0, =gUnknown_08615EB0 + bl LoadSpriteSheet + ldr r0, =gUnknown_08615EB8 + bl LoadSpritePalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5D30 + + thumb_func_start sub_81B5D4C +sub_81B5D4C: @ 81B5D4C + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0 + beq _081B5D60 + cmp r2, 0x1 + beq _081B5DA8 + b _081B5DE4 +_081B5D60: + movs r5, 0 + ldrb r0, [r6] + cmp r5, r0 + bcs _081B5DE4 +_081B5D68: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _081B5D94 + adds r0, r7, r5 + ldrb r4, [r0] + adds r0, r1, 0 + bl itemid_is_mail + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B5DF0 +_081B5D94: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r0, [r6] + cmp r5, r0 + bcc _081B5D68 + b _081B5DE4 + .pool +_081B5DA8: + movs r5, 0 + b _081B5DDE +_081B5DAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _081B5DD8 + adds r0, r5, r7 + ldrb r4, [r0, 0x6] + adds r0, r1, 0 + bl itemid_is_mail + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B5DF0 +_081B5DD8: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_081B5DDE: + ldrb r0, [r6, 0x1] + cmp r5, r0 + bcc _081B5DAC +_081B5DE4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5D4C + + thumb_func_start sub_81B5DF0 +sub_81B5DF0: @ 81B5DF0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + adds r6, r0, 0 + mov r9, r1 + lsls r6, 24 + lsrs r6, 24 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, =gSprites + mov r8, r0 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + add r0, r8 + adds r0, 0x43 + ldrb r3, [r0] + ldr r0, =gUnknown_08615EC0 + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0xFA + movs r2, 0xAA + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + mov r0, r8 + adds r5, r4, r0 + movs r0, 0x4 + strh r0, [r5, 0x24] + movs r0, 0xA + strh r0, [r5, 0x26] + movs r0, 0x1C + add r8, r0 + add r4, r8 + ldr r0, =sub_81B5E74 + str r0, [r4] + strh r6, [r5, 0x3C] + adds r0, r5, 0 + mov r1, r9 + bl StartSpriteAnim + ldr r1, [r4] + adds r0, r5, 0 + bl _call_via_r1 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5DF0 + + thumb_func_start sub_81B5E74 +sub_81B5E74: @ 81B5E74 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x3C] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gSprites + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081B5EA8 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _081B5EC6 + .pool +_081B5EA8: + adds r3, r4, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldrh r0, [r2, 0x24] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x26] + ldrh r2, [r2, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] +_081B5EC6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5E74 + + thumb_func_start party_menu_pokeball_object +party_menu_pokeball_object: @ 81B5ECC + push {r4,lr} + adds r4, r1, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B5EEA + ldr r0, =gUnknown_08615F08 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x6] + ldrb r2, [r2, 0x7] + movs r3, 0x8 + bl CreateSprite + strb r0, [r4, 0xB] +_081B5EEA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_pokeball_object + + thumb_func_start party_menu_link_mon_pokeball_object +party_menu_link_mon_pokeball_object: @ 81B5EF4 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + cmp r0, 0 + beq _081B5F24 + ldr r0, =gUnknown_08615F08 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x6] + ldrb r2, [r2, 0x7] + movs r3, 0x8 + bl CreateSprite + strb r0, [r4, 0xB] + ldr r2, =gSprites + ldrb r0, [r4, 0xB] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] +_081B5F24: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_link_mon_pokeball_object + + thumb_func_start sub_81B5F34 +sub_81B5F34: @ 81B5F34 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 24 + lsrs r3, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08615F08 + adds r1, r3, 0 + movs r3, 0x8 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gSprites + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r3, [r1, 0x5] + movs r2, 0xD + negs r2, r2 + ands r2, r3 + movs r3, 0x8 + orrs r2, r3 + strb r2, [r1, 0x5] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B5F34 + + thumb_func_start sub_81B5F74 +sub_81B5F74: @ 81B5F74 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 24 + lsrs r3, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08615F78 + adds r1, r3, 0 + movs r3, 0x8 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B5F74 + + thumb_func_start sub_81B5F98 +sub_81B5F98: @ 81B5F98 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r2, =gSprites + adds r0, r2 + bl StartSpriteAnim + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5F98 + + thumb_func_start sub_81B5FBC +sub_81B5FBC: @ 81B5FBC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + cmp r6, 0 + bne _081B6000 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gSprites + mov r8, r0 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x2 + bl StartSpriteAnim + lsls r5, r7, 4 + adds r5, r7 + lsls r5, 2 + add r5, r8 + adds r0, r5, 0 + movs r1, 0x4 + bl StartSpriteAnim + strh r6, [r4, 0x26] + strh r6, [r5, 0x26] + b _081B602C + .pool +_081B6000: + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r0, =gSprites + mov r8, r0 + add r5, r8 + adds r0, r5, 0 + movs r1, 0x3 + bl StartSpriteAnim + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x5 + bl StartSpriteAnim + ldr r0, =0x0000fffc + strh r0, [r5, 0x26] + movs r0, 0x4 + strh r0, [r4, 0x26] +_081B602C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5FBC + + thumb_func_start sub_81B6040 +sub_81B6040: @ 81B6040 + push {lr} + ldr r0, =gUnknown_08615EF8 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08615F70 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08615F00 + bl LoadCompressedObjectPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6040 + + thumb_func_start party_menu_status_condition_object +party_menu_status_condition_object: @ 81B6064 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B608C + ldr r0, =gUnknown_08616008 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x4] + ldrb r2, [r2, 0x5] + movs r3, 0 + bl CreateSprite + strb r0, [r4, 0xC] + adds r0, r5, 0 + adds r1, r4, 0 + bl party_menu_get_status_condition_and_update_object +_081B608C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_status_condition_object + + thumb_func_start party_menu_link_mon_status_condition_object +party_menu_link_mon_status_condition_object: @ 81B6098 + push {r4,r5,lr} + adds r4, r2, 0 + lsls r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r0, 0 + beq _081B60D4 + ldr r0, =gUnknown_08616008 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x4] + ldrb r2, [r2, 0x5] + movs r3, 0 + bl CreateSprite + strb r0, [r4, 0xC] + adds r0, r5, 0 + adds r1, r4, 0 + bl party_menu_update_status_condition_object + ldr r2, =gSprites + ldrb r0, [r4, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] +_081B60D4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_link_mon_status_condition_object + + thumb_func_start party_menu_get_status_condition_and_update_object +@ void party_menu_get_status_condition_and_update_object(struct pokemon *mon, void *a2, void *a3) +party_menu_get_status_condition_and_update_object: @ 81B60E4 + push {r4,lr} + adds r4, r1, 0 + bl sub_81B205C + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl party_menu_update_status_condition_object + pop {r4} + pop {r0} + bx r0 + thumb_func_end party_menu_get_status_condition_and_update_object + + thumb_func_start party_menu_update_status_condition_object +@ void party_menu_update_status_condition_object(u8 a1, void *a2) +party_menu_update_status_condition_object: @ 81B60FC + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _081B610C + cmp r2, 0x6 + bne _081B6128 +_081B610C: + ldr r2, =gSprites + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081B6152 + .pool +_081B6128: + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + subs r1, r2, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl StartSpriteAnim + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081B6152: + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_update_status_condition_object + + thumb_func_start sub_81B6160 +sub_81B6160: @ 81B6160 + push {lr} + ldr r0, =gUnknown_08615FF8 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08616000 + bl LoadCompressedObjectPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6160 + + thumb_func_start sub_81B617C +sub_81B617C: @ 81B617C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r0, =c2_815ABFC + mov r8, r0 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B61BC + movs r7, 0x1 + bl sub_81B8984 + lsls r0, 24 + lsrs r6, r0, 24 + b _081B61C0 + .pool +_081B61B0: + ldr r0, =gUnknown_0203CEC8 + strb r5, [r0, 0x9] + b _081B6204 + .pool +_081B61BC: + movs r7, 0 + movs r6, 0 +_081B61C0: + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl GetItemEffectType + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA + bne _081B621C + ldr r1, =gUnknown_0203CEC8 + movs r0, 0 + strb r0, [r1, 0x9] + movs r5, 0 +_081B61D8: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B61FA + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081B61B0 +_081B61FA: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081B61D8 +_081B6204: + ldr r0, =sub_81B6280 + movs r1, 0x7F + b _081B6230 + .pool +_081B621C: + ldrh r0, [r4] + bl GetPocketByItemId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x5 + cmp r0, 0x3 + bne _081B622E + movs r1, 0x4 +_081B622E: + ldr r0, =sub_81B1370 +_081B6230: + str r1, [sp] + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B617C + + thumb_func_start c2_815ABFC +c2_815ABFC: @ 81B6254 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _081B626C + movs r0, 0xC + movs r1, 0x5 + movs r2, 0 + bl GoToBagMenu + b _081B6276 +_081B626C: + ldr r0, =gUnknown_0203CF30 + ldr r1, [r0] + movs r0, 0x4 + bl sub_81C4F98 +_081B6276: + pop {r0} + bx r0 + .pool + thumb_func_end c2_815ABFC + + thumb_func_start sub_81B6280 +sub_81B6280: @ 81B6280 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B62B2 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B62A6 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B9140 + str r0, [r1, 0x4] +_081B62A6: + ldr r0, =gUnknown_03006328 + ldr r1, =sub_81B6794 + ldr r2, [r0] + adds r0, r3, 0 + bl _call_via_r2 +_081B62B2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6280 + + thumb_func_start IsHPRecoveryItem +@ bool8 IsHPRecoveryItem(u16 itemId) +IsHPRecoveryItem: @ 81B62D0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _081B62EC + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003214 + adds r0, r1 + b _081B62F6 + .pool +_081B62EC: + ldr r1, =gItemEffectTable + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] +_081B62F6: + ldrb r1, [r0, 0x4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _081B6308 + movs r0, 0 + b _081B630A + .pool +_081B6308: + movs r0, 0x1 +_081B630A: + pop {r1} + bx r1 + thumb_func_end IsHPRecoveryItem + + thumb_func_start GetMedicineItemEffectMessage +@ void GetMedicineItemEffectMessage(u16 itemId) +GetMedicineItemEffectMessage: @ 81B6310 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl GetItemEffectType + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x3 + cmp r0, 0x12 + bls _081B6326 + b _081B64BC +_081B6326: + lsls r0, 2 + ldr r1, =_081B6334 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B6334: + .4byte _081B6380 + .4byte _081B6394 + .4byte _081B63A8 + .4byte _081B63BC + .4byte _081B63D0 + .4byte _081B63E4 + .4byte _081B63F8 + .4byte _081B64BC + .4byte _081B640C + .4byte _081B6430 + .4byte _081B6420 + .4byte _081B6460 + .4byte _081B6470 + .4byte _081B6450 + .4byte _081B6440 + .4byte _081B64BC + .4byte _081B6494 + .4byte _081B6494 + .4byte _081B64A8 +_081B6380: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9C3E + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B6394: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9C7C + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63A8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9C8A + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63BC: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9CA2 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63D0: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9C5F + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63E4: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9DBE + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63F8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9DE1 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B640C: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9CE0 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B6420: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085E96E3 + b _081B6474 + .pool +_081B6430: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085EA33C + b _081B6474 + .pool +_081B6440: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085EA343 + b _081B6474 + .pool +_081B6450: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085EA35B + b _081B6474 + .pool +_081B6460: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085E96E6 + b _081B6474 + .pool +_081B6470: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085E96EE +_081B6474: + bl StringCopy + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9D25 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B6494: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9CF5 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B64A8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9CB7 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B64BC: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E96F6 + bl StringExpandPlaceholders +_081B64C4: + pop {r0} + bx r0 + .pool + thumb_func_end GetMedicineItemEffectMessage + + thumb_func_start UsingHPEVItemOnShedinja +@ bool8 UsingHPEVItemOnShedinja(struct pokemon *mon, u16 itemId) +UsingHPEVItemOnShedinja: @ 81B64D0 + push {r4,lr} + adds r4, r0, 0 + lsls r0, r1, 16 + lsrs r0, 16 + bl GetItemEffectType + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD + bne _081B64FC + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + ldr r1, =0x0000012f + cmp r0, r1 + bne _081B64FC + movs r0, 0 + b _081B64FE + .pool +_081B64FC: + movs r0, 0x1 +_081B64FE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end UsingHPEVItemOnShedinja + + thumb_func_start IsBlueYellowRedFlute +@ bool8 IsBlueYellowRedFlute(u16 itemId) +IsBlueYellowRedFlute: @ 81B6504 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x27 + beq _081B6516 + cmp r0, 0x29 + beq _081B6516 + cmp r0, 0x28 + bne _081B651A +_081B6516: + movs r0, 0x1 + b _081B651C +_081B651A: + movs r0, 0 +_081B651C: + pop {r1} + bx r1 + thumb_func_end IsBlueYellowRedFlute + + thumb_func_start ExecuteTableBasedItemEffect__ +@ bool8 ExecuteTableBasedItemEffect__(u8 partyMonIndex, u16 itemId, u8 monMoveIndex) +ExecuteTableBasedItemEffect__: @ 81B6520 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081B6558 + movs r0, 0x64 + muls r0, r3 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r5, 0 + adds r2, r3, 0 + b _081B6572 + .pool +_081B6558: + movs r0, 0x64 + adds r4, r3, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r3, 0 + bl sub_81B8F38 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 +_081B6572: + adds r3, r6, 0 + bl ExecuteTableBasedItemEffect_ + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end ExecuteTableBasedItemEffect__ + + thumb_func_start ItemUseCB_Medicine +ItemUseCB_Medicine: @ 81B6588 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + str r1, [sp, 0x4] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0 + mov r10, r0 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + ldr r0, =gUnknown_0203CE7C + ldrh r6, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl UsingHPEVItemOnShedinja + lsls r0, 24 + cmp r0, 0 + beq _081B6600 + adds r0, r6, 0 + bl IsHPRecoveryItem + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x1 + bne _081B65EE + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + adds r0, r5, 0 + movs r1, 0x3A + bl GetMonData + cmp r10, r0 + bne _081B65EE + movs r1, 0 + mov r8, r1 +_081B65EE: + ldr r4, =gUnknown_0203CEC8 + ldrb r0, [r4, 0x9] + adds r1, r6, 0 + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B6624 +_081B6600: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_085E96F6 + b _081B66F4 + .pool +_081B6624: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + adds r0, r6, 0 + bl IsBlueYellowRedFlute + lsls r0, 24 + cmp r0, 0 + bne _081B6650 + movs r0, 0x1 + bl PlaySE + ldrb r0, [r4, 0xB] + cmp r0, 0xE + beq _081B6656 + adds r0, r6, 0 + movs r1, 0x1 + bl RemoveBagItem + b _081B6656 + .pool +_081B6650: + movs r0, 0x75 + bl PlaySE +_081B6656: + ldr r4, =gUnknown_0203CEDC + ldr r7, =gUnknown_0203CEC8 + movs r0, 0x9 + ldrsb r0, [r7, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + adds r0, r5, 0 + bl party_menu_get_status_condition_and_update_object + ldr r2, =gSprites + movs r0, 0x9 + ldrsb r0, [r7, r0] + ldr r1, [r4] + lsls r0, 4 + adds r3, r0, r1 + ldrb r1, [r3, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081B6694 + adds r0, r5, 0 + adds r1, r3, 0 + movs r2, 0x1 + bl sub_81B2AC8 +_081B6694: + mov r2, r8 + cmp r2, 0x1 + bne _081B66E4 + mov r0, r10 + cmp r0, 0 + bne _081B66A8 + ldrb r0, [r7, 0x9] + movs r1, 0x1 + bl sub_81B0FCC +_081B66A8: + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + adds r3, r0, 0 + mov r1, r10 + subs r3, r1 + lsls r3, 16 + asrs r3, 16 + ldrb r1, [r7, 0x9] + ldr r0, =sub_81B672C + str r0, [sp] + mov r0, r9 + movs r2, 0x1 + bl sub_81B1F18 + mov r0, r9 + movs r1, 0 + mov r2, r10 + bl sub_81B1FA8 + b _081B6710 + .pool +_081B66E4: + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + adds r0, r6, 0 + bl GetMedicineItemEffectMessage + ldr r0, =gStringVar4 +_081B66F4: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldr r1, [sp, 0x4] + str r1, [r0] +_081B6710: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseCB_Medicine + + thumb_func_start sub_81B672C +sub_81B672C: @ 81B672C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9C17 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + bl sub_805EAE8 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6794 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B672C + + thumb_func_start sub_81B6794 +sub_81B6794: @ 81B6794 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B67BA + ldr r0, =gUnknown_0203CEE8 + ldrb r1, [r0] + cmp r1, 0 + bne _081B67B4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + str r1, [r0, 0x4] +_081B67B4: + adds r0, r4, 0 + bl sub_81B12C0 +_081B67BA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6794 + + thumb_func_start sub_81B67C8 +sub_81B67C8: @ 81B67C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r1, [sp] + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r4, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + ldr r0, =gUnknown_0203CE7C + ldrh r6, [r0] + adds r0, r6, 0 + bl GetItemEffectType + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0 + movs r1, 0x20 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_81B691C + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + ldrb r0, [r4, 0x9] + adds r1, r6, 0 + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x20 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_81B691C + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r4, 0 + bne _081B6850 + ldr r0, [sp, 0x4] + cmp r0, r9 + bne _081B6874 + ldr r1, [sp, 0x8] + cmp r1, r8 + bne _081B6874 +_081B6850: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_085E96F6 + b _081B68E2 + .pool +_081B6874: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + bl PlaySE + adds r0, r6, 0 + movs r1, 0x1 + bl RemoveBagItem + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r1, =gStringVar2 + adds r0, r7, 0 + bl option_menu_get_string + ldr r2, [sp, 0x4] + cmp r2, r9 + beq _081B68D8 + ldr r0, [sp, 0x8] + cmp r0, r8 + beq _081B68C4 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9D45 + bl StringExpandPlaceholders + b _081B68E0 + .pool +_081B68C4: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9D90 + bl StringExpandPlaceholders + b _081B68E0 + .pool +_081B68D8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9D6D + bl StringExpandPlaceholders +_081B68E0: + ldr r0, =gStringVar4 +_081B68E2: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + ldr r1, [sp] + str r1, [r0] + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B67C8 + + thumb_func_start sub_81B691C +sub_81B691C: @ 81B691C + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r1, 0 + subs r0, 0xC + cmp r0, 0x5 + bhi _081B6992 + lsls r0, 2 + ldr r1, =_081B693C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B693C: + .4byte _081B696C + .4byte _081B6954 + .4byte _081B697E + .4byte _081B6984 + .4byte _081B6978 + .4byte _081B6972 +_081B6954: + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + ldr r1, =0x0000012f + cmp r0, r1 + beq _081B6992 + adds r0, r4, 0 + movs r1, 0x1A + b _081B6988 + .pool +_081B696C: + adds r0, r4, 0 + movs r1, 0x1B + b _081B6988 +_081B6972: + adds r0, r4, 0 + movs r1, 0x1C + b _081B6988 +_081B6978: + adds r0, r4, 0 + movs r1, 0x1D + b _081B6988 +_081B697E: + adds r0, r4, 0 + movs r1, 0x1E + b _081B6988 +_081B6984: + adds r0, r4, 0 + movs r1, 0x1F +_081B6988: + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + b _081B6994 +_081B6992: + movs r0, 0 +_081B6994: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B691C + + thumb_func_start option_menu_get_string +option_menu_get_string: @ 81B699C + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0xC + cmp r0, 0x5 + bhi _081B6A08 + lsls r0, 2 + ldr r1, =_081B69B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B69B8: + .4byte _081B69D8 + .4byte _081B69D0 + .4byte _081B69F0 + .4byte _081B6A00 + .4byte _081B69E8 + .4byte _081B69E0 +_081B69D0: + ldr r1, =gUnknown_085E96E3 + b _081B69F2 + .pool +_081B69D8: + ldr r1, =gUnknown_085EA33C + b _081B69F2 + .pool +_081B69E0: + ldr r1, =gUnknown_085EA343 + b _081B69F2 + .pool +_081B69E8: + ldr r1, =gUnknown_085EA35B + b _081B69F2 + .pool +_081B69F0: + ldr r1, =gUnknown_085E96E6 +_081B69F2: + adds r0, r2, 0 + bl StringCopy + b _081B6A08 + .pool +_081B6A00: + ldr r1, =gUnknown_085E96EE + adds r0, r2, 0 + bl StringCopy +_081B6A08: + pop {r0} + bx r0 + .pool + thumb_func_end option_menu_get_string + + thumb_func_start sub_81B6A10 +sub_81B6A10: @ 81B6A10 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r7, 0 + movs r0, 0x1 + mov r10, r0 + movs r0, 0x3 + bl sub_81B31B0 + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r0, 0x64 + adds r1, r4, 0 + muls r1, r0 + mov r8, r1 + ldr r0, =gPlayerParty + mov r9, r0 +_081B6A40: + adds r1, r5, 0 + adds r1, 0xD + mov r0, r8 + add r0, r9 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0xD + adds r2, r4, 0 + muls r2, r0 + ldr r0, =gMoveNames + adds r2, r0 + lsls r0, r5, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + mov r1, r10 + movs r3, 0x8 + bl PrintTextOnWindow + cmp r4, 0 + beq _081B6A82 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_081B6A82: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081B6A40 + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6A10 + + thumb_func_start ether_effect_related_3 +ether_effect_related_3: @ 81B6AB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl ProcessMenuInput + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081B6AF0 + adds r0, 0x1 + cmp r1, r0 + bne _081B6AE0 + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B6BB4 + b _081B6AF0 +_081B6AE0: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl ether_effect_related_2 +_081B6AF0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ether_effect_related_3 + + thumb_func_start dp05_ether +dp05_ether: @ 81B6AFC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + cmp r0, 0xAF + bne _081B6B20 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003214 + adds r0, r1 + b _081B6B2A + .pool +_081B6B20: + ldr r1, =gItemEffectTable + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] +_081B6B2A: + ldrb r1, [r0, 0x4] + movs r0, 0x10 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081B6B4C + ldr r0, =gUnknown_0203CEC8 + strh r1, [r0, 0xE] + adds r0, r4, 0 + bl ether_effect_related + b _081B6B6E + .pool +_081B6B4C: + movs r0, 0x5 + bl PlaySE + movs r0, 0x16 + bl display_pokemon_menu_message + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + bl sub_81B6A10 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =ether_effect_related_3 + str r1, [r0] +_081B6B6E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp05_ether + + thumb_func_start ether_effect_related_2 +ether_effect_related_2: @ 81B6B80 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xC + bl sub_81B302C + bl GetMenuCursorPos + ldr r1, =gUnknown_0203CEC8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0xE] + adds r0, r4, 0 + bl ether_effect_related + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ether_effect_related_2 + + thumb_func_start sub_81B6BB4 +sub_81B6BB4: @ 81B6BB4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_81B1370 + str r0, [r1] + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0 + str r1, [r0, 0x4] + adds r0, 0xC + bl sub_81B302C + movs r0, 0x5 + bl display_pokemon_menu_message + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6BB4 + + thumb_func_start ether_effect_related +ether_effect_related: @ 81B6BEC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + ldr r7, =gUnknown_0203CED6 + ldr r0, =gUnknown_0203CE7C + ldrh r5, [r0] + movs r0, 0xE + negs r0, r0 + adds r0, r7 + mov r8, r0 + ldrb r0, [r0, 0x9] + ldrb r2, [r7] + adds r1, r5, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B6C34 + ldr r0, =gUnknown_0203CEE8 + strb r4, [r0] + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_085E96F6 + b _081B6C7E + .pool +_081B6C34: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + mov r0, r8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + movs r0, 0x1 + bl PlaySE + adds r0, r5, 0 + movs r1, 0x1 + bl RemoveBagItem + movs r0, 0 + ldrsh r1, [r7, r0] + adds r1, 0xD + adds r0, r4, 0 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =gStringVar1 + movs r1, 0xD + muls r1, r4 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + adds r0, r5, 0 + bl GetMedicineItemEffectMessage + ldr r0, =gStringVar4 +_081B6C7E: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6794 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ether_effect_related + + thumb_func_start dp05_pp_up +dp05_pp_up: @ 81B6CC0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + movs r0, 0x17 + bl display_pokemon_menu_message + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + bl sub_81B6A10 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =ether_effect_related_3 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp05_pp_up + + thumb_func_start ItemIdToBattleMoveId +ItemIdToBattleMoveId: @ 81B6CFC + lsls r0, 16 + ldr r1, =0xfedf0000 + adds r0, r1 + ldr r1, =gUnknown_08616040 + lsrs r0, 15 + adds r0, r1 + ldrh r0, [r0] + bx lr + .pool + thumb_func_end ItemIdToBattleMoveId + + thumb_func_start sub_81B6D14 +sub_81B6D14: @ 81B6D14 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + ldr r3, =gUnknown_08616040 +_081B6D1E: + adds r0, r1, 0 + adds r0, 0x32 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _081B6D34 + movs r0, 0x1 + b _081B6D40 + .pool +_081B6D34: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x7 + bls _081B6D1E + movs r0, 0 +_081B6D40: + pop {r1} + bx r1 + thumb_func_end sub_81B6D14 + + thumb_func_start pokemon_has_move +pokemon_has_move: @ 81B6D44 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 +_081B6D4E: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r6, 0 + bl GetMonData + cmp r0, r5 + bne _081B6D60 + movs r0, 0x1 + b _081B6D6C +_081B6D60: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081B6D4E + movs r0, 0 +_081B6D6C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end pokemon_has_move + + thumb_func_start sub_81B6D74 +sub_81B6D74: @ 81B6D74 + push {r4,lr} + adds r1, r0, 0 + ldr r4, =gStringVar4 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6D74 + + thumb_func_start sub_81B6D98 +sub_81B6D98: @ 81B6D98 + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6794 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6D98 + + thumb_func_start sub_81B6DC4 +sub_81B6DC4: @ 81B6DC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r7, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + movs r0, 0xE + adds r0, r7 + mov r8, r0 + ldr r0, =gUnknown_0203CE7C + ldrh r4, [r0] + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + adds r0, r4, 0 + bl ItemIdToBattleMoveId + strh r0, [r7, 0xE] + ldr r0, =gStringVar2 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + movs r0, 0 + mov r1, r8 + strh r0, [r1, 0x2] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B22D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B6E70 + cmp r0, 0x2 + beq _081B6E78 + ldrh r1, [r7, 0xE] + adds r0, r5, 0 + bl GiveMoveToMon + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + beq _081B6E88 + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B6EB4 + str r0, [r1] + b _081B6E9C + .pool +_081B6E70: + ldr r1, =gUnknown_085E9AB4 + b _081B6E7A + .pool +_081B6E78: + ldr r1, =gUnknown_085E9C00 +_081B6E7A: + adds r0, r6, 0 + bl sub_81B6D98 + b _081B6E9C + .pool +_081B6E88: + ldr r0, =gUnknown_085E9AE9 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6FF4 + str r1, [r0] +_081B6E9C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6DC4 + + thumb_func_start sub_81B6EB4 +sub_81B6EB4: @ 81B6EB4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r2, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r6, r2, 0 + adds r6, 0xE + ldr r0, =gUnknown_0203CE7C + ldrh r4, [r0] + movs r1, 0x2 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081B6EF0 + adds r0, r5, 0 + movs r1, 0x4 + bl AdjustFriendship + movs r0, 0xA9 + lsls r0, 1 + cmp r4, r0 + bhi _081B6EF0 + adds r0, r4, 0 + movs r1, 0x1 + bl RemoveBagItem +_081B6EF0: + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0 + ldrsh r2, [r6, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9AA5 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6F60 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6EB4 + + thumb_func_start sub_81B6F60 +sub_81B6F60: @ 81B6F60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B6F86 + ldr r0, =0x0000016f + bl PlayFanfare + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6F98 + str r1, [r0] +_081B6F86: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6F60 + + thumb_func_start sub_81B6F98 +sub_81B6F98: @ 81B6F98 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl IsFanfareTaskInactive + lsls r0, 24 + cmp r0, 0 + beq _081B6FEA + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _081B6FC0 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B6FEA +_081B6FC0: + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x10 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _081B6FDC + adds r0, r4, 0 + bl sub_81B77AC + b _081B6FEA + .pool +_081B6FDC: + cmp r0, 0x2 + bne _081B6FE4 + ldr r0, =gScriptResult + strh r2, [r0] +_081B6FE4: + adds r0, r5, 0 + bl sub_81B12C0 +_081B6FEA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6F98 + + thumb_func_start sub_81B6FF4 +sub_81B6FF4: @ 81B6FF4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7018 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B7028 + str r0, [r1] +_081B7018: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6FF4 + + thumb_func_start sub_81B7028 +sub_81B7028: @ 81B7028 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B704E + cmp r1, 0 + bgt _081B7048 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B7074 + b _081B7080 +_081B7048: + cmp r1, 0x1 + beq _081B707A + b _081B7080 +_081B704E: + ldr r0, =gUnknown_085E9B96 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B7088 + str r1, [r0] + b _081B7080 + .pool +_081B7074: + movs r0, 0x5 + bl PlaySE +_081B707A: + adds r0, r4, 0 + bl sub_81B7230 +_081B7080: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B7028 + + thumb_func_start sub_81B7088 +sub_81B7088: @ 81B7088 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B70A8 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B70B8 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 +_081B70A8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7088 + + thumb_func_start sub_81B70B8 +sub_81B70B8: @ 81B70B8 + push {r4,lr} + sub sp, 0x4 + ldr r0, =gPlayerParty + ldr r4, =gUnknown_0203CEC8 + ldrb r1, [r4, 0x9] + ldr r2, =gPlayerPartyCount + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =sub_81B70F0 + ldrh r4, [r4, 0xE] + str r4, [sp] + bl sub_81BFA38 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B70B8 + + thumb_func_start sub_81B70F0 +sub_81B70F0: @ 81B70F0 + push {lr} + sub sp, 0xC + movs r0, 0x7F + str r0, [sp] + ldr r0, =sub_81B711C + str r0, [sp, 0x4] + ldr r0, =gUnknown_0203CEC8 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B70F0 + + thumb_func_start sub_81B711C +sub_81B711C: @ 81B711C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B714E + bl sub_81C1B94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _081B7148 + adds r0, r4, 0 + bl sub_81B7154 + b _081B714E + .pool +_081B7148: + adds r0, r5, 0 + bl sub_81B7230 +_081B714E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B711C + + thumb_func_start sub_81B7154 +sub_81B7154: @ 81B7154 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + adds r5, r1, 0 + muls r5, r0 + ldr r0, =gPlayerParty + adds r5, r0 + bl sub_81C1B94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r1, 0xD + adds r0, r5, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0xD + muls r1, r4 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r0, =gUnknown_085E9BB8 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B71D4 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7154 + + thumb_func_start sub_81B71D4 +sub_81B71D4: @ 81B71D4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7220 + ldr r5, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r5, r1] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + bl sub_81C1B94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl RemoveMonPPBonus + ldrh r5, [r5, 0xE] + bl sub_81C1B94 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl SetMonMoveSlot + adds r0, r6, 0 + bl sub_81B6EB4 +_081B7220: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B71D4 + + thumb_func_start sub_81B7230 +sub_81B7230: @ 81B7230 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gStringVar2 + ldr r1, =gUnknown_0203CEC8 + movs r3, 0xE + ldrsh r2, [r1, r3] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9B5D + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B7294 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7230 + + thumb_func_start sub_81B7294 +sub_81B7294: @ 81B7294 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B72B8 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B72C8 + str r0, [r1] +_081B72B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7294 + + thumb_func_start sub_81B72C8 +sub_81B72C8: @ 81B72C8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + bl sub_8198C58 + lsls r0, 24 + asrs r5, r0, 24 + cmp r5, 0 + beq _081B7306 + cmp r5, 0 + bgt _081B7300 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _081B738C + b _081B73C2 + .pool +_081B7300: + cmp r5, 0x1 + beq _081B7392 + b _081B73C2 +_081B7306: + ldr r1, =gStringVar1 + adds r0, r4, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9B76 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r3, 0x10 + ldrsh r0, [r7, r3] + cmp r0, 0x1 + bne _081B7368 + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B73E4 + str r0, [r1] + b _081B73C2 + .pool +_081B7368: + cmp r0, 0x2 + bne _081B7370 + ldr r0, =gScriptResult + strh r5, [r0] +_081B7370: + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B6794 + str r0, [r1] + b _081B73C2 + .pool +_081B738C: + movs r0, 0x5 + bl PlaySE +_081B7392: + ldr r1, =gStringVar1 + adds r0, r4, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + ldr r1, =gUnknown_0203CEC8 + movs r3, 0xE + ldrsh r2, [r1, r3] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r0, =gUnknown_085E9AE9 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6FF4 + str r1, [r0] +_081B73C2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B72C8 + + thumb_func_start sub_81B73E4 +sub_81B73E4: @ 81B73E4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B73FC + adds r0, r4, 0 + bl sub_81B77AC +_081B73FC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B73E4 + + thumb_func_start dp05_rare_candy +dp05_rare_candy: @ 81B7404 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + mov r9, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + ldr r0, =gUnknown_0203CEC4 + ldr r6, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r4, r6, r1 + ldr r2, =gUnknown_0203CE7C + mov r8, r2 + adds r0, r5, 0 + movs r1, 0x38 + bl GetMonData + cmp r0, 0x64 + beq _081B7478 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B79A0 + mov r1, r9 + ldrb r0, [r1, 0x9] + mov r2, r8 + ldrh r1, [r2] + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x89 + lsls r0, 2 + adds r1, r6, r0 + adds r0, r5, 0 + bl sub_81B79A0 + b _081B747A + .pool +_081B7478: + movs r4, 0x1 +_081B747A: + movs r0, 0x5 + bl PlaySE + cmp r4, 0 + beq _081B74B4 + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + ldr r0, =gUnknown_085E96F6 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + mov r1, r10 + b _081B7516 + .pool +_081B74B4: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0 + bl PlayFanfareByFanfareNum + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + adds r1, r5, 0 + bl sub_81B754C + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + movs r1, 0x1 + bl RemoveBagItem + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r4, =gStringVar2 + adds r0, r5, 0 + movs r1, 0x38 + bl GetMonData + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9D0A + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B75D4 +_081B7516: + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp05_rare_candy + + thumb_func_start sub_81B754C +sub_81B754C: @ 81B754C + push {r4-r7,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r6, =gUnknown_0203CEDC + lsls r4, r7, 4 + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + bl party_menu_get_status_condition_and_update_object + ldr r2, =gSprites + ldr r0, [r6] + adds r3, r4, r0 + ldrb r1, [r3, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081B7588 + adds r0, r5, 0 + adds r1, r3, 0 + movs r2, 0x1 + bl sub_81B2AC8 +_081B7588: + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_81B2CD4 + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_81B2D74 + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + bl sub_81B2E28 + ldr r0, [r6] + adds r0, r4, r0 + ldrb r0, [r0, 0x9] + adds r1, r5, 0 + bl sub_81B5B38 + adds r0, r7, 0 + movs r1, 0x1 + bl sub_81B0FCC + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B754C + + thumb_func_start sub_81B75D4 +sub_81B75D4: @ 81B75D4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + bl WaitFanfare + lsls r0, 24 + cmp r0, 0 + beq _081B7620 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7620 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B7606 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B7620 +_081B7606: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B767C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B7634 + str r0, [r1] +_081B7620: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B75D4 + + thumb_func_start sub_81B7634 +sub_81B7634: @ 81B7634 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B764E + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B7668 +_081B764E: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B76C8 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B7704 + str r0, [r1] +_081B7668: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7634 + + thumb_func_start sub_81B767C +sub_81B767C: @ 81B767C + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0203CEC4 + ldr r5, [r0] + movs r0, 0x86 + lsls r0, 2 + adds r4, r5, r0 + bl sub_81B3364 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x18] + ldrh r0, [r4, 0x18] + movs r1, 0x89 + lsls r1, 2 + adds r2, r5, r1 + movs r1, 0x2 + str r1, [sp] + movs r1, 0x3 + str r1, [sp, 0x4] + adds r1, r4, 0 + movs r3, 0x1 + bl sub_81D3640 + ldrb r0, [r4, 0x18] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B767C + + thumb_func_start sub_81B76C8 +sub_81B76C8: @ 81B76C8 + push {r4,lr} + sub sp, 0x4 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + movs r0, 0x86 + lsls r0, 2 + adds r4, r1, r0 + ldrh r0, [r4, 0x18] + movs r2, 0x89 + lsls r2, 2 + adds r1, r2 + movs r2, 0x3 + str r2, [sp] + movs r2, 0x1 + movs r3, 0x2 + bl sub_81D3784 + ldrb r0, [r4, 0x18] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B76C8 + + thumb_func_start sub_81B7704 +sub_81B7704: @ 81B7704 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0 + bl WaitFanfare + lsls r0, 24 + cmp r0, 0 + beq _081B77A6 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _081B772C + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B77A6 +_081B772C: + bl sub_81B3394 + ldr r4, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x1 + bl MonTryLearningNewMove + lsls r0, 16 + lsrs r1, r0, 16 + strh r6, [r4, 0x10] + ldr r0, =0x0000fffe + cmp r1, r0 + beq _081B7788 + cmp r1, r0 + bgt _081B776C + cmp r1, 0 + beq _081B7778 + b _081B77A0 + .pool +_081B776C: + ldr r0, =0x0000ffff + cmp r1, r0 + beq _081B7780 + b _081B77A0 + .pool +_081B7778: + adds r0, r5, 0 + bl sub_81B7810 + b _081B77A6 +_081B7780: + adds r0, r5, 0 + bl sub_81B787C + b _081B77A6 +_081B7788: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B77AC + str r0, [r1] + b _081B77A6 + .pool +_081B77A0: + adds r0, r5, 0 + bl sub_81B7910 +_081B77A6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B7704 + + thumb_func_start sub_81B77AC +sub_81B77AC: @ 81B77AC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0 + bl MonTryLearningNewMove + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x0000fffe + cmp r1, r0 + beq _081B780A + cmp r1, r0 + bgt _081B77E8 + cmp r1, 0 + beq _081B77F4 + b _081B7804 + .pool +_081B77E8: + ldr r0, =0x0000ffff + cmp r1, r0 + beq _081B77FC + b _081B7804 + .pool +_081B77F4: + adds r0, r4, 0 + bl sub_81B7810 + b _081B780A +_081B77FC: + adds r0, r4, 0 + bl sub_81B787C + b _081B780A +_081B7804: + adds r0, r4, 0 + bl sub_81B7910 +_081B780A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B77AC + + thumb_func_start sub_81B7810 +sub_81B7810: @ 81B7810 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0 + movs r2, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _081B7860 + bl sub_81B06F4 + ldr r0, =gUnknown_030061E8 + ldr r1, [r6] + str r1, [r0] + ldrb r3, [r6, 0x9] + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_813DA40 + adds r0, r5, 0 + bl DestroyTask + b _081B786E + .pool +_081B7860: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B6794 + str r0, [r1] +_081B786E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7810 + + thumb_func_start sub_81B787C +sub_81B787C: @ 81B787C + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r0, =gStringVar2 + ldr r6, =gMoveToLearn + ldrh r2, [r6] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9AE9 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldrh r0, [r6] + mov r1, r8 + strh r0, [r1, 0xE] + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6FF4 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B787C + + thumb_func_start sub_81B7910 +sub_81B7910: @ 81B7910 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r6, r0, 0 + adds r5, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0xD + muls r1, r5 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9AA5 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + mov r0, r8 + strh r5, [r0, 0xE] + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6F60 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7910 + + thumb_func_start sub_81B79A0 +sub_81B79A0: @ 81B79A0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r1, 0x3A + bl GetMonData + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x3B + bl GetMonData + strh r0, [r5, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl GetMonData + strh r0, [r5, 0x4] + adds r0, r4, 0 + movs r1, 0x3E + bl GetMonData + strh r0, [r5, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl GetMonData + strh r0, [r5, 0xA] + adds r0, r4, 0 + movs r1, 0x3D + bl GetMonData + strh r0, [r5, 0x6] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B79A0 + + thumb_func_start sub_81B79E8 +sub_81B79E8: @ 81B79E8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CEC4 + ldr r2, [r1] + movs r3, 0x86 + lsls r3, 2 + adds r1, r2, r3 + movs r3, 0 + strh r3, [r1] + ldr r4, =0x0000021a + adds r1, r2, r4 + strh r3, [r1] + ldr r1, =gUnknown_0203CEC8 + ldrb r1, [r1, 0x9] + lsls r1, 24 + asrs r1, 24 + movs r3, 0x87 + lsls r3, 2 + adds r2, r3 + strh r1, [r2] + bl sub_81B7A28 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B79E8 + + thumb_func_start sub_81B7A28 +sub_81B7A28: @ 81B7A28 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B7A6E + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r7, r0, 16 + ldrb r0, [r6, 0x9] + ldr r1, =gUnknown_0203CE7C + ldrh r1, [r1] + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B7A94 +_081B7A6E: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =task_intro_gamefreak + str r0, [r1] + b _081B7B2A + .pool +_081B7A94: + movs r0, 0x1 + bl PlaySE + ldr r4, =gUnknown_0203CEDC + movs r0, 0x9 + ldrsb r0, [r6, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + adds r0, r5, 0 + bl party_menu_get_status_condition_and_update_object + ldr r2, =gSprites + movs r0, 0x9 + ldrsb r0, [r6, r0] + ldr r1, [r4] + lsls r0, 4 + adds r3, r0, r1 + ldrb r1, [r3, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081B7AD6 + adds r0, r5, 0 + adds r1, r3, 0 + movs r2, 0x1 + bl sub_81B2AC8 +_081B7AD6: + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + movs r1, 0x87 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_81B0FCC + ldrb r0, [r6, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + adds r3, r0, 0 + subs r3, r7 + lsls r3, 16 + asrs r3, 16 + ldrb r1, [r6, 0x9] + ldr r0, =sub_81B7C10 + str r0, [sp] + mov r0, r8 + movs r2, 0x1 + bl sub_81B1F18 + mov r0, r8 + movs r1, 0 + adds r2, r7, 0 + bl sub_81B1FA8 + ldr r0, [r4] + movs r2, 0x86 + lsls r2, 2 + adds r1, r0, r2 + movs r2, 0x1 + strh r2, [r1] + ldr r1, =0x0000021a + adds r0, r1 + strh r2, [r0] +_081B7B2A: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7A28 + + thumb_func_start task_intro_gamefreak +task_intro_gamefreak: @ 81B7B4C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7C0A + ldr r5, =gUnknown_0203CEC4 + ldr r2, [r5] + movs r0, 0x86 + lsls r0, 2 + adds r1, r2, r0 + movs r3, 0 + ldrsh r0, [r1, r3] + ldr r3, =gUnknown_0203CEC8 + cmp r0, 0x1 + bne _081B7B82 + movs r0, 0 + strh r0, [r1] + movs r1, 0x9 + ldrsb r1, [r3, r1] + movs r6, 0x87 + lsls r6, 2 + adds r0, r2, r6 + strh r1, [r0] +_081B7B82: + ldrb r0, [r3, 0x9] + adds r0, 0x1 + strb r0, [r3, 0x9] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x6 + bne _081B7C04 + ldr r0, [r5] + ldr r1, =0x0000021a + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + cmp r1, 0 + bne _081B7BC8 + ldr r0, =gUnknown_0203CEE8 + strb r1, [r0] + ldr r0, =gUnknown_085E96F6 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + b _081B7BD8 + .pool +_081B7BC8: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + movs r1, 0x1 + bl RemoveBagItem +_081B7BD8: + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6794 + str r1, [r0] + ldr r1, =gUnknown_0203CEC8 + movs r0, 0 + strb r0, [r1, 0x9] + b _081B7C0A + .pool +_081B7C04: + adds r0, r4, 0 + bl sub_81B7A28 +_081B7C0A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end task_intro_gamefreak + + thumb_func_start sub_81B7C10 +sub_81B7C10: @ 81B7C10 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9C17 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_intro_gamefreak + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7C10 + + thumb_func_start sub_81B7C74 +sub_81B7C74: @ 81B7C74 + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r2, =gUnknown_030061E8 + ldr r1, =gUnknown_0203CEC8 + ldr r0, [r1] + str r0, [r2] + ldrb r0, [r1, 0x9] + ldr r4, =gUnknown_0203CE7C + ldrh r1, [r4] + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B7CD8 + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + ldr r0, =gUnknown_085E96F6 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + str r6, [r0] + b _081B7CE4 + .pool +_081B7CD8: + ldrh r0, [r4] + movs r1, 0x1 + bl RemoveBagItem + bl sub_81B06F4 +_081B7CE4: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B7C74 + + thumb_func_start GetItemEffectType +@ u8 GetItemEffectType(u16 itemId) +GetItemEffectType: @ 81B7CEC + push {r4,r5,lr} + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + subs r2, 0xD + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0xA5 + bls _081B7D00 + b _081B7E40 +_081B7D00: + cmp r1, 0xAF + bne _081B7D18 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003214 + adds r4, r0, r1 + b _081B7D20 + .pool +_081B7D18: + ldr r1, =gItemEffectTable + lsls r0, r2, 2 + adds r0, r1 + ldr r4, [r0] +_081B7D20: + ldrb r1, [r4] + movs r5, 0x3F + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _081B7D42 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _081B7D42 + ldrb r0, [r4, 0x2] + cmp r0, 0 + bne _081B7D42 + ldrb r3, [r4, 0x3] + movs r0, 0x80 + ands r0, r3 + cmp r0, 0 + beq _081B7D4C +_081B7D42: + movs r0, 0 + b _081B7E46 + .pool +_081B7D4C: + movs r2, 0x40 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081B7D5A + movs r0, 0xA + b _081B7E46 +_081B7D5A: + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _081B7D66 + movs r0, 0x1 + b _081B7E46 +_081B7D66: + adds r2, r5, 0 + ands r2, r3 + cmp r2, 0 + bne _081B7D74 + lsrs r0, r1, 7 + cmp r0, 0 + beq _081B7DB6 +_081B7D74: + cmp r2, 0x20 + bne _081B7D7C + movs r0, 0x4 + b _081B7E46 +_081B7D7C: + cmp r2, 0x10 + bne _081B7D84 + movs r0, 0x3 + b _081B7E46 +_081B7D84: + cmp r2, 0x8 + bne _081B7D8C + movs r0, 0x5 + b _081B7E46 +_081B7D8C: + cmp r2, 0x4 + bne _081B7D94 + movs r0, 0x6 + b _081B7E46 +_081B7D94: + cmp r2, 0x2 + bne _081B7D9C + movs r0, 0x7 + b _081B7E46 +_081B7D9C: + cmp r2, 0x1 + bne _081B7DA4 + movs r0, 0x8 + b _081B7E46 +_081B7DA4: + lsrs r0, r1, 7 + cmp r0, 0 + beq _081B7DB2 + cmp r2, 0 + bne _081B7DB2 + movs r0, 0x9 + b _081B7E46 +_081B7DB2: + movs r0, 0xB + b _081B7E46 +_081B7DB6: + ldrb r1, [r4, 0x4] + movs r0, 0x44 + ands r0, r1 + adds r2, r1, 0 + cmp r0, 0 + beq _081B7DC6 + movs r0, 0x2 + b _081B7E46 +_081B7DC6: + movs r5, 0x2 + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + beq _081B7DD4 + movs r0, 0xC + b _081B7E46 +_081B7DD4: + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r2 + cmp r0, 0 + beq _081B7DE2 + movs r0, 0xD + b _081B7E46 +_081B7DE2: + ldrb r1, [r4, 0x5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _081B7DF0 + movs r0, 0xE + b _081B7E46 +_081B7DF0: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081B7DFC + movs r0, 0xF + b _081B7E46 +_081B7DFC: + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _081B7E08 + movs r0, 0x10 + b _081B7E46 +_081B7E08: + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _081B7E14 + movs r0, 0x11 + b _081B7E46 +_081B7E14: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _081B7E20 + movs r0, 0x12 + b _081B7E46 +_081B7E20: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _081B7E2C + movs r0, 0x13 + b _081B7E46 +_081B7E2C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081B7E38 + movs r0, 0x14 + b _081B7E46 +_081B7E38: + movs r0, 0x18 + ands r0, r2 + cmp r0, 0 + bne _081B7E44 +_081B7E40: + movs r0, 0x16 + b _081B7E46 +_081B7E44: + movs r0, 0x15 +_081B7E46: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetItemEffectType + + thumb_func_start sub_81B7E4C +sub_81B7E4C: @ 81B7E4C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B7F1C + ldr r7, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + movs r0, 0xE + adds r0, r7 + mov r8, r0 + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r4, =gSpecialVar_0x8005 + ldrb r0, [r4] + bl sub_81B2360 + strh r0, [r7, 0xE] + ldr r0, =gStringVar2 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + movs r0, 0x2 + mov r1, r8 + strh r0, [r1, 0x2] + ldrb r2, [r4] + adds r0, r5, 0 + movs r1, 0 + bl sub_81B22D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7EF0 + cmp r0, 0x2 + beq _081B7EF8 + ldrh r1, [r7, 0xE] + adds r0, r5, 0 + bl GiveMoveToMon + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + beq _081B7F08 + adds r0, r6, 0 + bl sub_81B6EB4 + b _081B7F1C + .pool +_081B7EF0: + ldr r1, =gUnknown_085E9AB4 + b _081B7EFA + .pool +_081B7EF8: + ldr r1, =gUnknown_085E9C00 +_081B7EFA: + adds r0, r6, 0 + bl sub_81B6D98 + b _081B7F1C + .pool +_081B7F08: + ldr r0, =gUnknown_085E9AE9 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6FF4 + str r1, [r0] +_081B7F1C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7E4C + + thumb_func_start CB2_PartyMenuFromStartMenu +CB2_PartyMenuFromStartMenu: @ 81B7F34 + push {lr} + sub sp, 0xC + movs r0, 0 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_8086194 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end CB2_PartyMenuFromStartMenu + + thumb_func_start sub_81B7F60 +sub_81B7F60: @ 81B7F60 + push {lr} + sub sp, 0xC + bl InBattlePyramid + lsls r0, 24 + ldr r1, =sub_81C4F84 + cmp r0, 0 + bne _081B7F72 + ldr r1, =c2_815ABFC +_081B7F72: + movs r0, 0x6 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x5 + movs r3, 0 + bl sub_81B0038 + ldr r1, =gUnknown_0203CEC8 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + strh r0, [r1, 0xC] + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7F60 + + thumb_func_start sub_81B7FAC +sub_81B7FAC: @ 81B7FAC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r5, =gUnknown_0203CEFC + ldr r0, =gUnknown_0203CEC8 + mov r9, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r7, =gPlayerParty + adds r0, r7 + movs r1, 0xC + bl GetMonData + strh r0, [r5] + lsls r0, 16 + cmp r0, 0 + bne _081B7FF8 + adds r0, r4, 0 + bl sub_81B8044 + b _081B8030 + .pool +_081B7FF8: + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B800C + adds r0, r4, 0 + bl sub_81B83B8 + b _081B8030 +_081B800C: + mov r1, r9 + movs r0, 0x9 + ldrsb r0, [r1, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + ldrh r1, [r5] + movs r2, 0x1 + bl sub_81B1D1C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B82A0 + str r1, [r0] +_081B8030: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7FAC + + thumb_func_start sub_81B8044 +sub_81B8044: @ 81B8044 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gUnknown_0203CEC8 + ldrh r0, [r5, 0xC] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B807C + ldrh r0, [r5, 0xC] + bl sub_81B83F0 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B814C + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B8082 + .pool +_081B807C: + adds r0, r4, 0 + bl sub_81B8088 +_081B8082: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B8044 + + thumb_func_start sub_81B8088 +sub_81B8088: @ 81B8088 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B80E4 + ldr r4, =gUnknown_0203CEC8 + ldrh r5, [r4, 0xC] + movs r0, 0x9 + ldrsb r0, [r4, r0] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r6, =gPlayerParty + adds r0, r6 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81B1C84 + movs r0, 0x9 + ldrsb r0, [r4, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + adds r1, r5, 0 + bl sub_81B1DB8 + adds r0, r5, 0 + bl sub_81B83F0 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B8104 + str r1, [r0] +_081B80E4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8088 + + thumb_func_start sub_81B8104 +sub_81B8104: @ 81B8104 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r4, [r0, 0x9] + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B8138 + lsls r2, r4, 24 + asrs r2, 24 + movs r0, 0x64 + muls r0, r2 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gUnknown_0203CEDC + lsls r2, 4 + ldr r1, [r1] + adds r1, r2 + bl sub_81B5C94 + adds r0, r5, 0 + bl sub_81B12C0 +_081B8138: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8104 + + thumb_func_start sub_81B814C +sub_81B814C: @ 81B814C + push {r4-r6,lr} + ldr r4, =gUnknown_0203CEC8 + movs r0, 0x9 + ldrsb r0, [r4, r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =gPlayerParty + adds r0, r5 + ldrh r1, [r4, 0xC] + bl sub_81B1DB8 + movs r0, 0x9 + ldrsb r0, [r4, r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x40 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSaveBlock1Ptr + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x00002be0 + adds r2, r0 + ldr r1, [r1] + adds r1, r2 + ldr r2, =sub_81B81A8 + movs r0, 0x4 + movs r3, 0x3 + bl sub_811A20C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B814C + + thumb_func_start sub_81B81A8 +sub_81B81A8: @ 81B81A8 + push {r4-r7,lr} + sub sp, 0xC + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =gScriptResult + ldrh r0, [r0] + cmp r0, 0 + bne _081B8208 + adds r0, r5, 0 + bl sub_80D4680 + ldr r4, =gUnknown_0203CEFC + adds r0, r5, 0 + movs r1, 0xC + adds r2, r4, 0 + bl SetMonData + ldrh r0, [r4] + movs r1, 0x1 + bl RemoveBagItem + adds r0, r7, 0 + bl sub_81B841C + ldr r0, [r6] + bl SetMainCallback2 + b _081B8224 + .pool +_081B8208: + ldrb r0, [r6, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r6, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B8230 + str r1, [sp, 0x4] + ldr r1, [r6] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 +_081B8224: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B81A8 + + thumb_func_start sub_81B8230 +sub_81B8230: @ 81B8230 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B828A + ldr r1, =gUnknown_0203CEFC + ldrh r0, [r1] + cmp r0, 0 + beq _081B8264 + ldr r0, =gUnknown_0203CEC8 + ldrh r0, [r0, 0xC] + ldrh r1, [r1] + movs r2, 0 + bl sub_81B1D68 + b _081B827C + .pool +_081B8264: + ldr r2, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r2, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldrh r1, [r2, 0xC] + movs r2, 0 + movs r3, 0x1 + bl sub_81B1C84 +_081B827C: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B8104 + str r0, [r1] +_081B828A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8230 + + thumb_func_start sub_81B82A0 +sub_81B82A0: @ 81B82A0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B82C4 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B82D4 + str r0, [r1] +_081B82C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B82A0 + + thumb_func_start sub_81B82D4 +sub_81B82D4: @ 81B82D4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B82FA + cmp r1, 0 + bgt _081B82F4 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B8394 + b _081B83A8 +_081B82F4: + cmp r1, 0x1 + beq _081B839A + b _081B83A8 +_081B82FA: + ldr r7, =gUnknown_0203CEC8 + ldrh r4, [r7, 0xC] + adds r0, r4, 0 + bl sub_81B83F0 + ldr r6, =gUnknown_0203CEFC + ldrh r0, [r6] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + cmp r0, 0 + bne _081B8338 + adds r0, r4, 0 + bl sub_81B841C + ldrh r0, [r6] + bl pokemon_item_not_removed + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81B1B5C + b _081B8378 + .pool +_081B8338: + adds r0, r4, 0 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B835C + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B814C + str r0, [r1, 0x4] + adds r0, r5, 0 + bl sub_81B12C0 + b _081B83A8 + .pool +_081B835C: + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r4, 0 + bl sub_81B1DB8 + ldrh r1, [r6] + adds r0, r4, 0 + movs r2, 0x1 + bl sub_81B1D68 +_081B8378: + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B8104 + str r1, [r0] + b _081B83A8 + .pool +_081B8394: + movs r0, 0x5 + bl PlaySE +_081B839A: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B8104 + str r0, [r1] +_081B83A8: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B82D4 + + thumb_func_start sub_81B83B8 +sub_81B83B8: @ 81B83B8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085E98EC + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B8104 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B83B8 + + thumb_func_start sub_81B83F0 +sub_81B83F0: @ 81B83F0 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x6 + bne _081B8410 + lsls r0, r1, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_80D6E48 + b _081B8418 + .pool +_081B8410: + adds r0, r1, 0 + movs r1, 0x1 + bl RemoveBagItem +_081B8418: + pop {r0} + bx r0 + thumb_func_end sub_81B83F0 + + thumb_func_start sub_81B841C +sub_81B841C: @ 81B841C + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x5 + beq _081B8438 + adds r0, r1, 0 + movs r1, 0x1 + bl sub_80D6D70 + b _081B8440 + .pool +_081B8438: + adds r0, r1, 0 + movs r1, 0x1 + bl AddBagItem +_081B8440: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81B841C + + thumb_func_start sub_81B8448 +sub_81B8448: @ 81B8448 + push {lr} + sub sp, 0xC + movs r0, 0x6 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_816BB28 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x7 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8448 + + thumb_func_start sub_81B8474 +sub_81B8474: @ 81B8474 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + ldr r2, =gSaveBlock1Ptr + ldr r0, =gUnknown_0203BCB8 + ldrh r1, [r0] + adds r1, 0x6 + ldrh r0, [r0, 0x2] + adds r1, r0 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x00002be0 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + beq _081B84DC + ldr r0, =gUnknown_085E9A08 + movs r1, 0x1 + bl sub_81B1B5C + b _081B84F2 + .pool +_081B84DC: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80D460C + adds r0, r4, 0 + bl sub_80D439C + ldr r0, =gUnknown_085E9A40 + movs r1, 0x1 + bl sub_81B1B5C +_081B84F2: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B8104 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8474 + + thumb_func_start sub_81B8518 +sub_81B8518: @ 81B8518 + push {lr} + sub sp, 0xC + bl sub_81B8558 + movs r0, 0 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =gMain + ldr r0, [r0, 0x8] + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + ldr r1, =gUnknown_0203CEC8 + ldr r0, =sub_81B879C + str r0, [r1, 0x4] + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8518 + + thumb_func_start sub_81B8558 +sub_81B8558: @ 81B8558 + push {lr} + ldr r0, =gUnknown_0203CEF8 + movs r1, 0 + movs r2, 0x4 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8558 + + thumb_func_start sub_81B856C +sub_81B856C: @ 81B856C + push {r4,lr} + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_81B85AC + lsls r0, 24 + cmp r0, 0 + bne _081B858C + movs r0, 0x2 + b _081B85A4 + .pool +_081B858C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 + bl sub_81B8770 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B85A2 + movs r0, 0 + b _081B85A4 +_081B85A2: + movs r0, 0x1 +_081B85A4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B856C + + thumb_func_start sub_81B85AC +sub_81B85AC: @ 81B85AC + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081B8608 + adds r0, r5, 0 + movs r1, 0x38 + bl GetMonData + adds r4, r0, 0 + bl sub_81B8888 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bhi _081B8608 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x0000191a + cmp r1, r0 + bne _081B85EA + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + bne _081B8608 +_081B85EA: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B864A + cmp r0, 0x9 + bne _081B8618 + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B864A +_081B8608: + movs r0, 0 + b _081B864C + .pool +_081B8618: + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r3, =gUnknown_08611C9A + lsls r1, r6, 1 + adds r0, r1, r3 + ldrh r0, [r0] + ldr r2, =0x0000ffff + cmp r0, r2 + beq _081B864A +_081B8632: + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, r4 + beq _081B8608 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, r6, 1 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _081B8632 +_081B864A: + movs r0, 0x1 +_081B864C: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B85AC + + thumb_func_start sub_81B865C +sub_81B865C: @ 81B865C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + bl sub_81B885C + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, r2, 0 + ldr r3, =gUnknown_0203CEF8 + adds r0, r2, r3 + subs r0, 0x1 + ldrb r0, [r0] + cmp r0, 0 + bne _081B869C + cmp r2, 0x1 + bne _081B8688 + movs r0, 0xE + b _081B8758 + .pool +_081B8688: + ldr r0, =gStringVar1 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalStringN + movs r0, 0x11 + b _081B8758 + .pool +_081B869C: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + movs r1, 0xF8 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B86C0 + b _081B8756 + .pool +_081B86B8: + movs r0, 0x12 + b _081B8758 +_081B86BC: + movs r0, 0x13 + b _081B8758 +_081B86C0: + bl sub_81B8830 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + b _081B8750 +_081B86CE: + ldr r3, =gUnknown_0203CEF8 + adds r4, r3, r5 + ldrb r0, [r4] + movs r1, 0x64 + muls r0, r1 + subs r0, 0x64 + ldr r3, =gPlayerParty + adds r0, r3, r0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + ldrb r0, [r4] + movs r1, 0x64 + muls r0, r1 + subs r0, 0x64 + ldr r3, =gPlayerParty + adds r0, r3, r0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + adds r1, r5, 0x1 + lsls r0, r1, 24 + lsrs r4, r0, 24 + mov r9, r1 + cmp r4, r8 + bcs _081B8748 + movs r7, 0x64 +_081B870E: + ldr r0, =gUnknown_0203CEF8 + adds r5, r0, r4 + ldrb r0, [r5] + muls r0, r7 + subs r0, 0x64 + ldr r1, =gPlayerParty + adds r0, r1, r0 + movs r1, 0xB + bl GetMonData + cmp r10, r0 + beq _081B86B8 + cmp r6, 0 + beq _081B873E + ldrb r0, [r5] + muls r0, r7 + subs r0, 0x64 + ldr r3, =gPlayerParty + adds r0, r3, r0 + movs r1, 0xC + bl GetMonData + cmp r6, r0 + beq _081B86BC +_081B873E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r8 + bcc _081B870E +_081B8748: + mov r1, r9 + lsls r0, r1, 24 + lsrs r5, r0, 24 + mov r0, r8 +_081B8750: + subs r0, 0x1 + cmp r5, r0 + blt _081B86CE +_081B8756: + movs r0, 0xFF +_081B8758: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B865C + + thumb_func_start sub_81B8770 +sub_81B8770: @ 81B8770 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, =gUnknown_0203CEF8 +_081B877A: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081B878C + movs r0, 0x1 + b _081B8798 + .pool +_081B878C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _081B877A + movs r0, 0 +_081B8798: + pop {r1} + bx r1 + thumb_func_end sub_81B8770 + + thumb_func_start sub_81B879C +sub_81B879C: @ 81B879C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81B865C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xFF + beq _081B87D4 + movs r0, 0x20 + bl PlaySE + adds r0, r4, 0 + bl display_pokemon_menu_message + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B87E8 + str r0, [r1] + b _081B87E0 + .pool +_081B87D4: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81B12C0 +_081B87E0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B879C + + thumb_func_start sub_81B87E8 +sub_81B87E8: @ 81B87E8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B8802 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B881C +_081B8802: + movs r0, 0x5 + bl PlaySE + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 + str r0, [r1] +_081B881C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B87E8 + + thumb_func_start sub_81B8830 +sub_81B8830: @ 81B8830 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B884C + cmp r0, 0x9 + bne _081B8850 + movs r0, 0x3 + b _081B8854 + .pool +_081B884C: + movs r0, 0x2 + b _081B8854 +_081B8850: + ldr r0, =gSpecialVar_0x8005 + ldrb r0, [r0] +_081B8854: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B8830 + + thumb_func_start sub_81B885C +sub_81B885C: @ 81B885C + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B8878 + cmp r0, 0x9 + bne _081B887C + movs r0, 0x1 + b _081B8880 + .pool +_081B8878: + movs r0, 0x2 + b _081B8880 +_081B887C: + ldr r0, =gSpecialVar_0x8005 + ldrb r0, [r0] +_081B8880: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B885C + + thumb_func_start sub_81B8888 +sub_81B8888: @ 81B8888 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B88A4 + cmp r0, 0x9 + bne _081B88A8 +_081B889C: + movs r0, 0x64 + b _081B88B2 + .pool +_081B88A4: + movs r0, 0x1E + b _081B88B2 +_081B88A8: + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + cmp r0, 0 + bne _081B889C + movs r0, 0x32 +_081B88B2: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B8888 + + thumb_func_start sub_81B88BC +sub_81B88BC: @ 81B88BC + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xF8 + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B88E0 + ldr r0, =gUnknown_085EA126 + b _081B88FA + .pool +_081B88E0: + cmp r1, 0x1 + bne _081B88F8 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x2 + bne _081B88F8 + ldr r0, =gUnknown_085EA139 + b _081B88FA + .pool +_081B88F8: + ldr r0, =gUnknown_085EA155 +_081B88FA: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B88BC + + thumb_func_start sub_81B8904 +sub_81B8904: @ 81B8904 + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + str r2, [sp] + ldr r2, =sub_81B1370 + str r2, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8904 + + thumb_func_start sub_81B892C +sub_81B892C: @ 81B892C + push {lr} + sub sp, 0xC + movs r0, 0x4 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0xC + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B892C + + thumb_func_start sub_81B8958 +sub_81B8958: @ 81B8958 + push {lr} + sub sp, 0xC + movs r0, 0x1 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + str r0, [sp, 0x8] + movs r0, 0xB + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8958 + + thumb_func_start sub_81B8984 +sub_81B8984: @ 81B8984 + push {lr} + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _081B8994 + movs r0, 0 + b _081B89A6 +_081B8994: + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B89A4 + movs r0, 0x1 + b _081B89A6 +_081B89A4: + movs r0, 0x2 +_081B89A6: + pop {r1} + bx r1 + thumb_func_end sub_81B8984 + + thumb_func_start sub_81B89AC +sub_81B89AC: @ 81B89AC + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81B8984 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_8059D40 + str r0, [sp, 0x8] + movs r0, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl sub_81B0038 + bl nullsub_35 + bl pokemon_change_order + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B89AC + + thumb_func_start sub_81B89F0 +sub_81B89F0: @ 81B89F0 + push {lr} + sub sp, 0xC + bl sub_81B8984 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x5 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =c2_815ABFC + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x3 + movs r3, 0 + bl sub_81B0038 + bl nullsub_35 + bl pokemon_change_order + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B89F0 + + thumb_func_start sub_81B8A2C +sub_81B8A2C: @ 81B8A2C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gPlayerParty + 0x64 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B8A74 + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081B8A74 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x1 + bne _081B8A5C + movs r0, 0x3 + b _081B8A76 + .pool +_081B8A5C: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + bne _081B8A74 + movs r0, 0x2 + b _081B8A76 + .pool +_081B8A74: + movs r0, 0x7 +_081B8A76: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B8A2C + + thumb_func_start sub_81B8A7C +sub_81B8A7C: @ 81B8A7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B8AC4 + cmp r5, 0x1 + beq _081B8AA2 + cmp r5, 0x4 + beq _081B8AA2 + cmp r5, 0x5 + bne _081B8AC4 +_081B8AA2: + ldr r4, =gStringVar1 + bl sub_806EBF8 + adds r1, r0, 0 + adds r0, r4, 0 + bl StringCopy + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E97B2 + b _081B8C42 + .pool +_081B8AC4: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B8AF8 + ldr r1, =gStringVar1 + adds r0, r4, 0 + bl GetMonNickname + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E978F + b _081B8C42 + .pool +_081B8AF8: + movs r4, 0 + b _081B8B24 +_081B8AFC: + adds r0, r4, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _081B8B1E + adds r0, r5, 0 + bl sub_81B8F38 + lsls r0, 24 + ldr r2, =gBattlePartyID + lsls r1, r4, 1 + adds r1, r2 + lsrs r0, 24 + ldrh r1, [r1] + cmp r0, r1 + beq _081B8BFC +_081B8B1E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B8B24: + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r4, r0 + bcc _081B8AFC + movs r7, 0x64 + adds r0, r5, 0 + muls r0, r7 + ldr r1, =gPlayerParty + mov r8, r1 + adds r6, r0, r1 + adds r0, r6, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _081B8B60 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E97E5 + b _081B8C42 + .pool +_081B8B60: + adds r0, r5, 0 + bl sub_81B8F38 + ldr r1, =gBattleStruct + ldr r1, [r1] + adds r1, 0x8B + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _081B8B94 + ldr r1, =gStringVar1 + adds r0, r6, 0 + bl GetMonNickname + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E976F + b _081B8C42 + .pool +_081B8B94: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x4 + bne _081B8BA8 + bl sub_806E994 + b _081B8C46 + .pool +_081B8BA8: + cmp r0, 0x2 + beq _081B8C20 + adds r0, r5, 0 + bl sub_81B8F38 + ldr r1, =gUnknown_0203CEE9 + strb r0, [r1] + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + ldr r1, =gBattlePartyID + ldr r0, =gUnknown_020244B8 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B8FB0 + adds r0, r4, 0 + muls r0, r7 + add r0, r8 + adds r1, r6, 0 + bl sub_81B1288 + movs r0, 0x1 + b _081B8C48 + .pool +_081B8BFC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9754 + b _081B8C42 + .pool +_081B8C20: + ldr r0, =gUnknown_020244B8 + ldrb r0, [r0] + ldr r1, =gBattlePartyID + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + add r0, r8 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9738 +_081B8C42: + bl StringExpandPlaceholders +_081B8C46: + movs r0, 0 +_081B8C48: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B8A7C + + thumb_func_start sub_81B8C68 +sub_81B8C68: @ 81B8C68 + push {r4,lr} + ldr r4, =gUnknown_0203CF00 + bl sub_806D7EC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B8C88 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8C68 + + thumb_func_start sub_81B8C88 +sub_81B8C88: @ 81B8C88 + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B8CBE + cmp r4, 0 + beq _081B8CB0 + movs r0, 0x30 + strb r0, [r6] + movs r0, 0x45 + strb r0, [r6, 0x1] + movs r0, 0x12 + strb r0, [r6, 0x2] + b _081B8D58 +_081B8CB0: + movs r0, 0x3 + strb r0, [r6] + movs r0, 0x12 + strb r0, [r6, 0x1] + movs r0, 0x45 + strb r0, [r6, 0x2] + b _081B8D58 +_081B8CBE: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _081B8CFC + movs r5, 0x1 + movs r0, 0 + bl GetBankByPlayerAI + mov r2, sp + ldr r1, =gBattlePartyID + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r0, [r0] + strb r0, [r2] + movs r4, 0 + mov r1, sp +_081B8CE2: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8CF0 + mov r2, sp + adds r0, r2, r5 + strb r4, [r0] + adds r5, 0x1 +_081B8CF0: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8CE2 + b _081B8D40 + .pool +_081B8CFC: + movs r5, 0x2 + movs r0, 0 + bl GetBankByPlayerAI + mov r1, sp + ldr r4, =gBattlePartyID + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r0, [r0] + strb r0, [r1] + movs r0, 0x2 + bl GetBankByPlayerAI + mov r1, sp + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r0, [r0] + strb r0, [r1, 0x1] + movs r4, 0 +_081B8D26: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8D3A + ldrb r0, [r1, 0x1] + cmp r4, r0 + beq _081B8D3A + mov r2, sp + adds r0, r2, r5 + strb r4, [r0] + adds r5, 0x1 +_081B8D3A: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8D26 +_081B8D40: + movs r4, 0 + mov r3, sp +_081B8D44: + adds r0, r6, r4 + ldrb r1, [r3] + lsls r1, 4 + ldrb r2, [r3, 0x1] + orrs r1, r2 + strb r1, [r0] + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _081B8D44 +_081B8D58: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8C88 + + thumb_func_start sub_81B8D64 +sub_81B8D64: @ 81B8D64 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =gBattleStruct + lsls r3, r2, 1 + adds r3, r2 + adds r3, 0x60 + ldr r0, [r0] + adds r0, r3 + bl sub_81B8D88 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8D64 + + thumb_func_start sub_81B8D88 +sub_81B8D88: @ 81B8D88 + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r0, r2, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r0, 24 + lsrs r0, 24 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _081B8DB0 + movs r0, 0 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + b _081B8DBC +_081B8DB0: + movs r0, 0x1 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x3 +_081B8DBC: + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B8DF0 + cmp r7, 0 + beq _081B8DE2 + movs r0, 0x30 + strb r0, [r5] + movs r0, 0x45 + strb r0, [r5, 0x1] + movs r0, 0x12 + strb r0, [r5, 0x2] + b _081B8E72 +_081B8DE2: + movs r0, 0x3 + strb r0, [r5] + movs r0, 0x12 + strb r0, [r5, 0x1] + movs r0, 0x45 + strb r0, [r5, 0x2] + b _081B8E72 +_081B8DF0: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _081B8E28 + movs r3, 0x1 + mov r2, sp + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + strb r0, [r2] + movs r4, 0 + mov r1, sp +_081B8E0C: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8E1A + mov r2, sp + adds r0, r2, r3 + strb r4, [r0] + adds r3, 0x1 +_081B8E1A: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8E0C + b _081B8E5A + .pool +_081B8E28: + movs r3, 0x2 + mov r1, sp + ldr r2, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + lsls r0, r6, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x1] + movs r4, 0 +_081B8E40: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8E54 + ldrb r0, [r1, 0x1] + cmp r4, r0 + beq _081B8E54 + mov r2, sp + adds r0, r2, r3 + strb r4, [r0] + adds r3, 0x1 +_081B8E54: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8E40 +_081B8E5A: + movs r4, 0 + mov r3, sp +_081B8E5E: + adds r0, r5, r4 + ldrb r1, [r3] + lsls r1, 4 + ldrb r2, [r3, 0x1] + orrs r1, r2 + strb r1, [r0] + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _081B8E5E +_081B8E72: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8D88 + + thumb_func_start sub_81B8E80 +sub_81B8E80: @ 81B8E80 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + movs r7, 0 + bl sub_81B1250 + lsls r0, 24 + cmp r0, 0 + beq _081B8F2E + ldr r0, =gBattleStruct + lsls r1, r4, 1 + adds r1, r4 + adds r1, 0x60 + ldr r0, [r0] + adds r4, r0, r1 + movs r2, 0 + add r6, sp + mov r12, r6 + movs r6, 0xF + mov r3, sp +_081B8EB2: + adds r1, r4, r2 + ldrb r0, [r1] + lsrs r0, 4 + strb r0, [r3] + adds r3, 0x1 + ldrb r1, [r1] + adds r0, r6, 0 + ands r0, r1 + strb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + cmp r2, 0x2 + ble _081B8EB2 + mov r0, r12 + ldrb r3, [r0] + movs r2, 0 + mov r0, sp + ldrb r0, [r0] + cmp r0, r5 + bne _081B8EE8 + mov r0, sp + ldrb r7, [r0] + strb r3, [r0] + b _081B8EFC + .pool +_081B8EE8: + adds r2, 0x1 + cmp r2, 0x5 + bgt _081B8EFC + mov r0, sp + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, r5 + bne _081B8EE8 + adds r7, r0, 0 + strb r3, [r1] +_081B8EFC: + cmp r2, 0x6 + beq _081B8F2E + mov r0, r12 + strb r7, [r0] + mov r0, sp + ldrb r0, [r0] + lsls r0, 4 + mov r1, sp + ldrb r1, [r1, 0x1] + orrs r0, r1 + strb r0, [r4] + mov r0, sp + ldrb r0, [r0, 0x2] + lsls r0, 4 + mov r1, sp + ldrb r1, [r1, 0x3] + orrs r0, r1 + strb r0, [r4, 0x1] + mov r0, sp + ldrb r0, [r0, 0x4] + lsls r0, 4 + mov r1, sp + ldrb r1, [r1, 0x5] + orrs r0, r1 + strb r0, [r4, 0x2] +_081B8F2E: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B8E80 + + thumb_func_start sub_81B8F38 +sub_81B8F38: @ 81B8F38 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0x1 + ands r1, r2 + lsrs r2, r0, 25 + cmp r1, 0 + beq _081B8F58 + ldr r0, =gUnknown_0203CF00 + adds r0, r2, r0 + ldrb r0, [r0] + movs r1, 0xF + ands r1, r0 + b _081B8F60 + .pool +_081B8F58: + ldr r0, =gUnknown_0203CF00 + adds r0, r2, r0 + ldrb r0, [r0] + lsrs r1, r0, 4 +_081B8F60: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B8F38 + + thumb_func_start sub_81B8F6C +sub_81B8F6C: @ 81B8F6C + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + movs r1, 0x1 + ands r1, r3 + lsrs r3, r0, 25 + cmp r1, 0 + beq _081B8F94 + ldr r0, =gUnknown_0203CF00 + adds r0, r3, r0 + ldrb r2, [r0] + movs r1, 0xF0 + ands r1, r2 + orrs r1, r4 + strb r1, [r0] + b _081B8FA4 + .pool +_081B8F94: + ldr r2, =gUnknown_0203CF00 + adds r2, r3, r2 + ldrb r1, [r2] + movs r0, 0xF + ands r0, r1 + lsls r1, r4, 4 + orrs r0, r1 + strb r0, [r2] +_081B8FA4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8F6C + + thumb_func_start sub_81B8FB0 +sub_81B8FB0: @ 81B8FB0 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + adds r0, r5, 0 + bl sub_81B8F38 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + bl sub_81B8F38 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_81B8F6C + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81B8F6C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B8FB0 + + thumb_func_start pokemon_order_func +pokemon_order_func: @ 81B8FEC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r3, 0 + movs r2, 0 + ldr r5, =gUnknown_0203CF00 +_081B8FF8: + adds r0, r3, r5 + ldrb r1, [r0] + lsrs r0, r1, 4 + cmp r0, r4 + beq _081B9010 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0xF + ands r0, r1 + cmp r0, r4 + bne _081B9018 +_081B9010: + adds r0, r2, 0 + b _081B902A + .pool +_081B9018: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _081B8FF8 + movs r0, 0 +_081B902A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end pokemon_order_func + + thumb_func_start pokemon_change_order +pokemon_change_order: @ 81B9030 + push {r4-r6,lr} + movs r4, 0x96 + lsls r4, 2 + adds r0, r4, 0 + bl Alloc + adds r5, r0, 0 + ldr r1, =gPlayerParty + adds r2, r4, 0 + bl memcpy + movs r4, 0 + movs r6, 0x64 +_081B904A: + adds r0, r4, 0 + bl pokemon_order_func + lsls r0, 24 + lsrs r0, 24 + muls r0, r6 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r4, 0 + muls r1, r6 + adds r1, r5 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B904A + adds r0, r5, 0 + bl Free + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end pokemon_change_order + + thumb_func_start sub_81B9080 +sub_81B9080: @ 81B9080 + push {r4-r6,lr} + movs r4, 0x96 + lsls r4, 2 + adds r0, r4, 0 + bl Alloc + adds r5, r0, 0 + ldr r1, =gPlayerParty + adds r2, r4, 0 + bl memcpy + movs r4, 0 + movs r6, 0x64 +_081B909A: + adds r0, r4, 0 + bl sub_81B8F38 + lsls r0, 24 + lsrs r0, 24 + muls r0, r6 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r4, 0 + muls r1, r6 + adds r1, r5 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B909A + adds r0, r5, 0 + bl Free + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9080 + + thumb_func_start sub_81B90D0 +sub_81B90D0: @ 81B90D0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0x1 + movs r7, 0x64 + ldr r0, =gPlayerParty + mov r8, r0 +_081B90DE: + adds r0, r6, 0 + bl sub_81B8F38 + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + mov r1, r8 + adds r5, r0, r1 + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B912C + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081B912C + movs r0, 0 + bl sub_81B8F38 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + adds r1, r6, 0 + bl sub_81B8FB0 + adds r0, r4, 0 + muls r0, r7 + add r0, r8 + adds r1, r5, 0 + bl sub_81B1288 + b _081B9136 + .pool +_081B912C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _081B90DE +_081B9136: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B90D0 + + thumb_func_start sub_81B9140 +sub_81B9140: @ 81B9140 + push {lr} + ldr r0, =sub_8059D40 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9140 + + thumb_func_start sub_81B9150 +sub_81B9150: @ 81B9150 + push {lr} + sub sp, 0xC + movs r0, 0x7F + str r0, [sp] + ldr r0, =sub_81B917C + str r0, [sp, 0x4] + ldr r0, =gMain + ldr r0, [r0, 0x8] + str r0, [sp, 0x8] + movs r0, 0x5 + movs r1, 0x3 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9150 + + thumb_func_start sub_81B917C +sub_81B917C: @ 81B917C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gTasks + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r1, 0x80 + lsls r1, 1 + strh r1, [r4, 0x8] + bl sub_81B9294 + movs r1, 0x80 + lsls r1, 9 + movs r0, 0x2 + movs r2, 0 + bl ChangeBgX + ldr r0, =sub_81B91B4 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B917C + + thumb_func_start sub_81B91B4 +sub_81B91B4: @ 81B91B4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r6, r5, 2 + adds r0, r6, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B9220 + ldrh r0, [r4] + subs r0, 0x8 + strh r0, [r4] + adds r0, r5, 0 + bl sub_81B9294 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081B9220 + movs r4, 0x3 + ldr r7, =gUnknown_02022FF8 +_081B91E8: + subs r0, r4, 0x3 + lsls r0, 5 + adds r0, r7 + ldrh r0, [r0] + cmp r0, 0 + beq _081B9204 + ldr r0, =gUnknown_0203CEDC + ldr r1, [r0] + lsls r0, r4, 4 + adds r0, r1 + ldrb r0, [r0, 0x9] + movs r1, 0 + bl sub_81B5B6C +_081B9204: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B91E8 + movs r0, 0x78 + bl PlaySE + ldr r0, =gTasks + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B9240 + str r0, [r1] +_081B9220: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B91B4 + + thumb_func_start sub_81B9240 +sub_81B9240: @ 81B9240 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + movs r0, 0x80 + lsls r0, 17 + cmp r1, r0 + bne _081B9266 + adds r0, r2, 0 + bl sub_81B12C0 +_081B9266: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9240 + + thumb_func_start sub_81B9270 +sub_81B9270: @ 81B9270 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 16 + lsrs r3, r1, 16 + cmp r1, 0 + blt _081B928A + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + strh r3, [r0, 0x24] +_081B928A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9270 + + thumb_func_start sub_81B9294 +sub_81B9294: @ 81B9294 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r5, r1, r0 + movs r6, 0x3 + ldr r7, =gUnknown_0203CEDC +_081B92A8: + ldr r0, =gUnknown_02022FF8 + subs r1, r6, 0x3 + lsls r1, 5 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _081B9300 + ldr r0, [r7] + lsls r4, r6, 4 + adds r0, r4, r0 + ldrb r0, [r0, 0x9] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 + ldr r0, [r7] + adds r0, r4, r0 + ldrb r0, [r0, 0xA] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 + ldr r0, [r7] + adds r0, r4, r0 + ldrb r0, [r0, 0xB] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 + ldr r0, [r7] + adds r4, r0 + ldrb r0, [r4, 0xC] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 +_081B9300: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _081B92A8 + movs r1, 0x80 + lsls r1, 4 + movs r0, 0x2 + movs r2, 0x1 + bl ChangeBgX + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9294 + + thumb_func_start sub_81B9328 +sub_81B9328: @ 81B9328 + push {lr} + sub sp, 0xC + movs r0, 0xF + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9390 + str r0, [sp, 0x8] + movs r0, 0x6 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9328 + + thumb_func_start sub_81B9354 +sub_81B9354: @ 81B9354 + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_03005DB0 + ldr r1, =hm_add_c3_without_phase_2 + str r1, [r2] + movs r1, 0 + str r1, [sp] + ldr r1, =sub_81B1370 + str r1, [sp, 0x4] + ldr r1, =c2_exit_to_overworld_2_switch + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9354 + + thumb_func_start sub_81B9390 +sub_81B9390: @ 81B9390 + push {r4,lr} + ldr r4, =gSpecialVar_0x8004 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + cmp r0, 0x5 + bls _081B93A6 + movs r0, 0xFF + strh r0, [r4] +_081B93A6: + ldr r0, =gUnknown_03005DB0 + ldr r1, =hm_add_c3_without_phase_2 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9390 + + thumb_func_start hm_add_c3_without_phase_2 +hm_add_c3_without_phase_2: @ 81B93C8 + push {lr} + bl pal_fill_black + ldr r0, =task_hm_without_phase_2 + movs r1, 0xA + bl CreateTask + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end hm_add_c3_without_phase_2 + + thumb_func_start task_hm_without_phase_2 +task_hm_without_phase_2: @ 81B93E0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _081B93FE + adds r0, r4, 0 + bl DestroyTask + bl ScriptContext2_Disable + bl EnableBothScriptContexts +_081B93FE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task_hm_without_phase_2 + + thumb_func_start sub_81B9404 +sub_81B9404: @ 81B9404 + push {lr} + bl ScriptContext2_Enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81B9424 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9404 + + thumb_func_start sub_81B9424 +sub_81B9424: @ 81B9424 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B945C + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9470 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl DestroyTask +_081B945C: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9424 + + thumb_func_start sub_81B9470 +sub_81B9470: @ 81B9470 + push {lr} + bl brm_get_pokemon_selection + ldr r2, =gUnknown_02039F24 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _081B9486 + movs r0, 0xFF + strb r0, [r2] +_081B9486: + ldr r1, =gSpecialVar_0x8004 + ldrb r0, [r2] + strh r0, [r1] + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_without_phase_2 + str r0, [r1] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9470 + + thumb_func_start sub_81B94B0 +sub_81B94B0: @ 81B94B0 + push {lr} + bl ScriptContext2_Enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81B94D0 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B94B0 + + thumb_func_start sub_81B94D0 +sub_81B94D0: @ 81B94D0 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B9508 + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9390 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl DestroyTask +_081B9508: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B94D0 + + thumb_func_start sub_81B951C +sub_81B951C: @ 81B951C + push {lr} + bl ScriptContext2_Enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81B953C + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B951C + + thumb_func_start sub_81B953C +sub_81B953C: @ 81B953C + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B9574 + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9588 + str r0, [sp, 0x8] + movs r0, 0x7 + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl DestroyTask +_081B9574: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B953C + + thumb_func_start sub_81B9588 +sub_81B9588: @ 81B9588 + push {r4,r5,lr} + ldr r5, =gSpecialVar_0x8004 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + cmp r0, 0x5 + bls _081B95A4 + movs r0, 0xFF + strh r0, [r5] + b _081B95BA + .pool +_081B95A4: + ldr r4, =gSpecialVar_0x8005 + ldrh r1, [r5] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + bl GetNumberOfRelearnableMoves + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] +_081B95BA: + ldr r0, =gUnknown_03005DB0 + ldr r1, =hm_add_c3_without_phase_2 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9588 + + thumb_func_start sub_81B95E0 +sub_81B95E0: @ 81B95E0 + push {r4,r5,lr} + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + movs r4, 0 + adds r5, r1, 0 + b _081B95FA + .pool +_081B95F4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B95FA: + cmp r4, 0x2 + bhi _081B9614 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + beq _081B95F4 + movs r0, 0x1 + strh r0, [r5] +_081B9614: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B95E0 + + thumb_func_start sub_81B9620 +sub_81B9620: @ 81B9620 + push {lr} + bl ScriptContext2_Enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81B9640 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9620 + + thumb_func_start sub_81B9640 +sub_81B9640: @ 81B9640 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B9678 + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9390 + str r0, [sp, 0x8] + movs r0, 0xC + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl DestroyTask +_081B9678: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9640 + + thumb_func_start sub_81B968C +sub_81B968C: @ 81B968C + push {lr} + sub sp, 0x4 + ldr r1, =gPlayerParty + ldr r0, =gSpecialVar_0x8004 + ldrb r2, [r0] + ldr r0, =gPlayerPartyCount + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =c2_exit_to_overworld_2_switch + str r0, [sp] + movs r0, 0x3 + bl sub_81BF8EC + ldr r1, =gUnknown_03005DAC + ldr r0, =sub_80AF168 + str r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B968C + + thumb_func_start sub_81B96D0 +sub_81B96D0: @ 81B96D0 + push {r4,r5,lr} + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + movs r4, 0 + adds r5, r1, 0 +_081B96DC: + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r4, 0 + adds r1, 0xD + bl GetMonData + cmp r0, 0 + beq _081B96FA + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_081B96FA: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081B96DC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B96D0 + + thumb_func_start sub_81B9718 +sub_81B9718: @ 81B9718 + push {r4,r5,lr} + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + adds r5, r1, 0 + muls r5, r0 + ldr r0, =gPlayerParty + adds r5, r0 + ldr r0, =gSpecialVar_0x8005 + ldrh r1, [r0] + adds r1, 0xD + adds r0, r5, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0xD + muls r1, r4 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9718 + + thumb_func_start sub_81B9770 +sub_81B9770: @ 81B9770 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gSpecialVar_0x8004 + mov r8, r0 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =gPlayerParty + adds r0, r5 + ldr r4, =gSpecialVar_0x8005 + ldrb r2, [r4] + movs r1, 0 + bl SetMonMoveSlot + mov r1, r8 + ldrh r0, [r1] + muls r0, r6 + adds r0, r5 + ldrb r1, [r4] + bl RemoveMonPPBonus + ldrh r4, [r4] + cmp r4, 0x2 + bhi _081B97C4 +_081B97A2: + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + lsls r1, r4, 24 + lsrs r1, 24 + adds r4, 0x1 + lsls r2, r4, 24 + lsrs r2, 24 + bl sub_81B97DC + lsls r4, 16 + lsrs r4, 16 + cmp r4, 0x2 + bls _081B97A2 +_081B97C4: + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9770 + + thumb_func_start sub_81B97DC +sub_81B97DC: @ 81B97DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + mov r8, r0 + adds r5, r1, 0 + adds r4, r2, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r0, 0xD + str r0, [sp, 0x8] + mov r0, r8 + ldr r1, [sp, 0x8] + bl GetMonData + mov r1, sp + adds r1, 0x2 + str r1, [sp, 0x14] + strh r0, [r1] + adds r3, r4, 0 + adds r3, 0xD + str r3, [sp, 0xC] + mov r0, r8 + adds r1, r3, 0 + bl GetMonData + mov r1, sp + strh r0, [r1] + adds r7, r5, 0 + adds r7, 0x11 + str r7, [sp, 0x10] + mov r0, r8 + adds r1, r7, 0 + bl GetMonData + mov r1, sp + adds r1, 0x5 + str r1, [sp, 0x18] + strb r0, [r1] + adds r3, r4, 0 + adds r3, 0x11 + str r3, [sp, 0x1C] + mov r0, r8 + adds r1, r3, 0 + bl GetMonData + add r7, sp, 0x4 + mov r10, r7 + strb r0, [r7] + mov r0, r8 + movs r1, 0x15 + bl GetMonData + mov r6, sp + adds r6, 0x6 + strb r0, [r6] + ldr r1, =gUnknown_08329D22 + adds r0, r5, r1 + ldrb r0, [r0] + mov r9, r0 + ldrb r0, [r6] + adds r2, r0, 0 + mov r3, r9 + ands r2, r3 + lsls r5, 1 + asrs r2, r5 + lsls r2, 24 + lsrs r2, 24 + adds r1, r4, r1 + ldrb r3, [r1] + adds r1, r0, 0 + ands r1, r3 + lsls r4, 1 + asrs r1, r4 + lsls r1, 24 + lsrs r1, 24 + mov r7, r9 + bics r0, r7 + strb r0, [r6] + ldrb r0, [r6] + bics r0, r3 + strb r0, [r6] + lsls r2, r4 + lsls r1, r5 + adds r2, r1 + ldrb r0, [r6] + orrs r0, r2 + strb r0, [r6] + mov r0, r8 + ldr r1, [sp, 0x8] + mov r2, sp + bl SetMonData + mov r0, r8 + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x14] + bl SetMonData + mov r0, r8 + ldr r1, [sp, 0x10] + mov r2, r10 + bl SetMonData + mov r0, r8 + ldr r1, [sp, 0x1C] + ldr r2, [sp, 0x18] + bl SetMonData + mov r0, r8 + movs r1, 0x15 + adds r2, r6, 0 + bl SetMonData + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B97DC + + thumb_func_start sub_81B98DC +sub_81B98DC: @ 81B98DC + push {lr} + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2D + bl GetMonData + adds r1, r0, 0 + cmp r1, 0 + beq _081B990C + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + b _081B9910 + .pool +_081B990C: + ldr r0, =gScriptResult + strh r1, [r0] +_081B9910: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B98DC + + thumb_func_start sub_81B9918 +sub_81B9918: @ 81B9918 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + adds r1, 0xD + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x39 + bne _081B999C + movs r6, 0 + b _081B9980 + .pool +_081B9958: + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + cmp r6, r0 + beq _081B997E + movs r4, 0 + movs r0, 0x64 + adds r5, r6, 0 + muls r5, r0 + ldr r7, =gPlayerParty +_081B996A: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, r7 + bl GetMonData + cmp r0, 0x39 + beq _081B999C + adds r4, 0x1 + cmp r4, 0x3 + bls _081B996A +_081B997E: + adds r6, 0x1 +_081B9980: + bl CalculatePlayerPartyCount + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bcc _081B9958 + mov r0, r8 + bl sub_80D23A8 + cmp r0, 0x1 + beq _081B999C + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] +_081B999C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9918 + + thumb_func_start sub_81B99B4 +sub_81B99B4: @ 81B99B4 + push {lr} + ldr r1, =gUnknown_086160B4 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B99B4 + + thumb_func_start sub_81B99D4 +sub_81B99D4: @ 81B99D4 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B99D4 + + thumb_func_start sub_81B9A28 +sub_81B9A28: @ 81B9A28 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e6a + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81B9A28 + + thumb_func_start sub_81B9A44 +sub_81B9A44: @ 81B9A44 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000e6a + adds r0, r2 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81B9A44 + + thumb_func_start sub_81B9A60 +sub_81B9A60: @ 81B9A60 + push {r4,lr} + ldr r4, =gTrainerBattleOpponent_A + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xFF + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsrs r1, 6 + strh r1, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9A60 + + thumb_func_start sub_81B9A90 +sub_81B9A90: @ 81B9A90 + push {lr} + ldr r3, =gTrainerBattleOpponent_A + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _081B9AAC + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString +_081B9AAC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9A90 + + thumb_func_start sub_81B9ABC +sub_81B9ABC: @ 81B9ABC + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9ABC + + thumb_func_start sub_81B9B00 +sub_81B9B00: @ 81B9B00 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r5, =gUnknown_086160D4 + bl Random + ldrh r0, [r5] + ldr r1, =0x00000e6a + adds r4, r1 + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9B00 + + thumb_func_start sub_81B9B28 +sub_81B9B28: @ 81B9B28 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000e6a + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081B9B70 + ldr r0, [r4] + ldr r1, =0x00000e6a + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000e6a + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081B9B76 + .pool +_081B9B70: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081B9B76: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9B28 + + thumb_func_start sub_81B9B80 +sub_81B9B80: @ 81B9B80 + push {lr} + ldr r1, =gUnknown_086160D8 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9B80 + + thumb_func_start sub_81B9BA0 +sub_81B9BA0: @ 81B9BA0 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9BA0 + + thumb_func_start sub_81B9BF4 +sub_81B9BF4: @ 81B9BF4 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e6c + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81B9BF4 + + thumb_func_start sub_81B9C10 +sub_81B9C10: @ 81B9C10 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000e6c + adds r0, r2 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81B9C10 + + thumb_func_start sub_81B9C2C +sub_81B9C2C: @ 81B9C2C + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9C2C + + thumb_func_start sub_81B9C70 +sub_81B9C70: @ 81B9C70 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r5, =gUnknown_086160F4 + bl Random + ldrh r0, [r5] + ldr r1, =0x00000e6c + adds r4, r1 + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9C70 + + thumb_func_start sub_81B9C98 +sub_81B9C98: @ 81B9C98 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000e6c + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081B9CE0 + ldr r0, [r4] + ldr r1, =0x00000e6c + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000e6c + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081B9CE6 + .pool +_081B9CE0: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081B9CE6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9C98 + + thumb_func_start sub_81B9CF0 +sub_81B9CF0: @ 81B9CF0 + push {lr} + ldr r0, =gStringVar1 + ldr r1, =gTrainerBattleOpponent_A + ldrh r1, [r1] + bl sub_8162E20 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9CF0 + + thumb_func_start sub_81B9D08 +sub_81B9D08: @ 81B9D08 + push {lr} + ldr r1, =gUnknown_086160F8 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9D08 + + thumb_func_start sub_81B9D28 +sub_81B9D28: @ 81B9D28 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9D28 + + thumb_func_start sub_81B9D7C +sub_81B9D7C: @ 81B9D7C + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e6e + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81B9D7C + + thumb_func_start sub_81B9D98 +sub_81B9D98: @ 81B9D98 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000e6e + adds r0, r2 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81B9D98 + + thumb_func_start sub_81B9DB4 +sub_81B9DB4: @ 81B9DB4 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9DB4 + + thumb_func_start sub_81B9DF8 +sub_81B9DF8: @ 81B9DF8 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r5, =gUnknown_08616120 + bl Random + ldrh r0, [r5] + ldr r1, =0x00000e6e + adds r4, r1 + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9DF8 + + thumb_func_start sub_81B9E20 +sub_81B9E20: @ 81B9E20 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000e6e + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081B9E68 + ldr r0, [r4] + ldr r1, =0x00000e6e + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000e6e + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081B9E6E + .pool +_081B9E68: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081B9E6E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9E20 + + thumb_func_start sub_81B9E78 +sub_81B9E78: @ 81B9E78 + push {lr} + bl ZeroPlayerPartyMons + bl sub_819A4F8 + pop {r0} + bx r0 + thumb_func_end sub_81B9E78 + + thumb_func_start sub_81B9E88 +sub_81B9E88: @ 81B9E88 + push {lr} + bl sub_819DC00 + pop {r0} + bx r0 + thumb_func_end sub_81B9E88 + + thumb_func_start sub_81B9E94 +sub_81B9E94: @ 81B9E94 + push {lr} + movs r2, 0 + ldr r1, =gMapHeader + ldrb r0, [r1, 0x14] + cmp r0, 0x8 + bne _081B9EB2 + ldr r3, =0xfffffe7f + adds r0, r3, 0 + ldrh r1, [r1, 0x12] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _081B9EB2 + movs r2, 0x1 +_081B9EB2: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B9E94 + + thumb_func_start sub_81B9EC0 +sub_81B9EC0: @ 81B9EC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + ldr r1, =gUnknown_0203BC88 + ldr r0, =gSlateportBattleTentTrainers + str r0, [r1] + add r0, sp, 0xC + mov r9, r0 + mov r1, sp + adds r1, 0x18 + str r1, [sp, 0x2C] + ldr r5, =gUnknown_0203BC8C + ldr r4, =gSlateportBattleTentMons + movs r2, 0 + adds r3, r1, 0 + mov r1, r9 + mov r0, sp + movs r6, 0x5 + mov r8, r6 +_081B9EEC: + strh r2, [r0] + strh r2, [r1] + strh r2, [r3] + adds r3, 0x2 + adds r1, 0x2 + adds r0, 0x2 + movs r7, 0x1 + negs r7, r7 + add r8, r7 + mov r6, r8 + cmp r6, 0 + bge _081B9EEC + str r4, [r5] + movs r7, 0 + mov r10, r7 + movs r0, 0 + mov r8, r0 + ldr r1, [sp, 0x2C] + str r1, [sp, 0x30] + mov r2, sp + str r2, [sp, 0x34] + lsls r6, r0, 1 + str r6, [sp, 0x24] + add r6, r9 + str r6, [sp, 0x28] +_081B9F1E: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x46 + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + movs r2, 0 + mov r7, r8 + adds r6, r2, r7 + cmp r2, r6 + bge _081B9F7C + ldr r1, [sp, 0x28] + ldrh r0, [r1] + cmp r0, r5 + beq _081B9F7C + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + lsls r0, r5, 4 + adds r4, r0, r1 + ldrh r7, [r4] + mov r12, r7 + lsls r3, r2, 1 + ldr r1, [sp, 0x24] + add r1, sp + str r6, [sp, 0x38] +_081B9F56: + ldrh r0, [r1] + cmp r0, r12 + bne _081B9F66 + mov r0, r10 + cmp r0, 0 + bne _081B9F7C + ldrh r7, [r4] + mov r10, r7 +_081B9F66: + adds r3, 0x2 + adds r1, 0x2 + adds r2, 0x1 + ldr r0, [sp, 0x38] + cmp r2, r0 + bge _081B9F7C + mov r7, r9 + adds r0, r7, r3 + ldrh r0, [r0] + cmp r0, r5 + bne _081B9F56 +_081B9F7C: + cmp r2, r6 + bne _081BA01C + movs r2, 0 + cmp r2, r6 + bge _081B9FD4 + ldr r0, =gBattleFrontierHeldItems + mov r12, r0 + ldr r7, =gUnknown_0203BC8C + ldr r1, [sp, 0x24] + ldr r0, [sp, 0x2C] + adds r4, r1, r0 +_081B9F92: + ldrh r3, [r4] + cmp r3, 0 + beq _081B9FCC + ldr r1, [r7] + lsls r0, r5, 4 + adds r1, r0, r1 + ldrb r0, [r1, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r3, r0 + bne _081B9FCC + ldrh r0, [r1] + cmp r0, r10 + bne _081B9FD4 + movs r1, 0 + mov r10, r1 + b _081B9FD4 + .pool +_081B9FCC: + adds r4, 0x2 + adds r2, 0x1 + cmp r2, r6 + blt _081B9F92 +_081B9FD4: + cmp r2, r6 + bne _081BA01C + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r2, r8 + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r1, r0 + movs r6, 0xE7 + lsls r6, 4 + adds r1, r6 + strh r5, [r1] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, r5, 4 + adds r1, r0 + ldrh r0, [r1] + ldr r7, [sp, 0x34] + strh r0, [r7] + ldr r2, =gBattleFrontierHeldItems + ldrb r0, [r1, 0xA] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + ldr r1, [sp, 0x30] + strh r0, [r1] + add r3, r9 + strh r5, [r3] + adds r1, 0x2 + str r1, [sp, 0x30] + adds r2, r7, 0 + adds r2, 0x2 + str r2, [sp, 0x34] + movs r6, 0x1 + add r8, r6 +_081BA01C: + mov r7, r8 + cmp r7, 0x6 + beq _081BA024 + b _081B9F1E +_081BA024: + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9EC0 + + thumb_func_start sub_81BA040 +sub_81BA040: @ 81BA040 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r0, 0 + mov r10, r0 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gSlateportBattleTentTrainers + str r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons + str r0, [r1] + ldr r7, =gSaveBlock2Ptr + ldr r1, =0x0000ffff + mov r8, r1 +_081BA062: + mov r2, r10 + lsls r6, r2, 1 +_081BA066: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + movs r5, 0 + ldr r1, [r7] + ldr r4, =0x00000cb2 + adds r0, r1, r4 + ldrh r0, [r0] + cmp r5, r0 + bge _081BA0AA + ldr r2, =0x00000cb4 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r3 + beq _081BA0AA + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r1, r4 + ldrh r2, [r0] + adds r4, 0x2 + adds r1, r4 +_081BA09C: + adds r1, 0x2 + adds r5, 0x1 + cmp r5, r2 + bge _081BA0AA + ldrh r0, [r1] + cmp r0, r3 + bne _081BA09C +_081BA0AA: + ldr r0, [r7] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + bne _081BA066 + ldr r2, =gTrainerBattleOpponent_A + strh r3, [r2] + ldrh r3, [r2] + ldr r4, =gUnknown_0203BC88 + ldr r1, [r4] + movs r0, 0x34 + muls r0, r3 + adds r0, r1 + ldr r0, [r0, 0x30] + adds r1, r6, r0 + ldrh r0, [r1] + cmp r0, r8 + beq _081BA0DE + ldr r3, =0x0000ffff +_081BA0D2: + adds r1, 0x2 + movs r6, 0x1 + add r10, r6 + ldrh r0, [r1] + cmp r0, r3 + bne _081BA0D2 +_081BA0DE: + mov r0, r10 + cmp r0, 0x8 + bgt _081BA110 + movs r1, 0 + mov r10, r1 + b _081BA062 + .pool +_081BA110: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r6, =0x00000cb2 + adds r3, r1, r6 + ldrh r0, [r3] + cmp r0, 0x1 + bhi _081BA12A + lsls r0, 1 + ldr r3, =0x00000cb4 + adds r1, r3 + adds r1, r0 + ldrh r0, [r2] + strh r0, [r1] +_081BA12A: + ldrh r1, [r2] + ldr r2, [r4] + movs r0, 0x34 + muls r0, r1 + adds r0, r2 + ldr r0, [r0, 0x30] + mov r9, r0 + movs r5, 0 + ldr r7, =gUnknown_03001298 + mov r8, sp +_081BA13E: + bl Random + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __modsi3 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + strh r0, [r7] + movs r2, 0 + ldrh r0, [r7] + ldr r4, =gUnknown_0203BC8C + ldr r3, [r4] + lsls r0, 4 + adds r0, r3 + ldr r1, =gSaveBlock2Ptr + ldrh r6, [r0] + ldr r1, [r1] +_081BA166: + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r0, [r0] + lsls r0, 4 + adds r0, r3 + ldrh r0, [r0] + cmp r6, r0 + beq _081BA180 + adds r1, 0xC + adds r2, 0x1 + cmp r2, 0x5 + ble _081BA166 +_081BA180: + cmp r2, 0x6 + bne _081BA220 + movs r4, 0 + cmp r4, r5 + bge _081BA1B0 + mov r0, sp + ldrh r0, [r0] + cmp r0, r6 + beq _081BA1B0 + ldr r6, =gUnknown_03001298 + ldr r3, =gUnknown_0203BC8C + mov r2, sp +_081BA198: + adds r2, 0x2 + adds r4, 0x1 + cmp r4, r5 + bge _081BA1B0 + ldrh r0, [r6] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrh r1, [r2] + ldrh r0, [r0] + cmp r1, r0 + bne _081BA198 +_081BA1B0: + cmp r4, r5 + bne _081BA220 + movs r4, 0 + cmp r4, r5 + bge _081BA1E6 + ldr r6, =gBattleFrontierHeldItems + mov r12, r6 + add r3, sp, 0x8 +_081BA1C0: + ldrh r2, [r3] + cmp r2, 0 + beq _081BA1DE + ldr r1, =gUnknown_03001298 + ldrh r0, [r1] + ldr r6, =gUnknown_0203BC8C + ldr r1, [r6] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r2, r0 + beq _081BA1E6 +_081BA1DE: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, r5 + blt _081BA1C0 +_081BA1E6: + cmp r4, r5 + bne _081BA220 + lsls r2, r5, 1 + ldrh r0, [r7] + ldr r1, =gUnknown_0203BC8C + ldr r4, [r1] + lsls r0, 4 + adds r0, r4 + ldrh r0, [r0] + mov r3, r8 + strh r0, [r3] + add r1, sp, 0x8 + adds r1, r2 + ldr r3, =gBattleFrontierHeldItems + ldrh r0, [r7] + lsls r0, 4 + adds r0, r4 + ldrb r0, [r0, 0xA] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + ldr r0, =gUnknown_03006298 + adds r2, r0 + ldrh r0, [r7] + strh r0, [r2] + movs r4, 0x2 + add r8, r4 + adds r5, 0x1 +_081BA220: + cmp r5, 0x3 + bne _081BA13E + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BA040 + + thumb_func_start Font6Func +@ int Font6Func(struct TextPrinter *x) +Font6Func: @ 81BA250 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r6, 0 + adds r4, 0x14 + ldrb r0, [r6, 0x1C] + cmp r0, 0x6 + bls _081BA260 + b _081BA660 +_081BA260: + lsls r0, 2 + ldr r1, =_081BA270 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BA270: + .4byte _081BA28C + .4byte _081BA554 + .4byte _081BA566 + .4byte _081BA590 + .4byte _081BA5C8 + .4byte _081BA63C + .4byte _081BA64E +_081BA28C: + ldr r2, =gMain + ldrh r1, [r2, 0x2C] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081BA2A6 + ldrb r1, [r4] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081BA2A6 + movs r0, 0 + strb r0, [r6, 0x1E] +_081BA2A6: + ldrb r1, [r6, 0x1E] + cmp r1, 0 + beq _081BA2E8 + ldrb r0, [r6, 0x1D] + cmp r0, 0 + beq _081BA2E8 + subs r0, r1, 0x1 + strb r0, [r6, 0x1E] + ldr r0, =gTextFlags + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081BA2C4 + b _081BA50E +_081BA2C4: + ldrh r1, [r2, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081BA2D0 + b _081BA50E +_081BA2D0: + ldrb r0, [r4] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r4] + movs r0, 0 + strb r0, [r6, 0x1E] + b _081BA50E + .pool +_081BA2E8: + ldr r2, =gTextFlags + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081BA2FC + movs r0, 0x3 + b _081BA2FE + .pool +_081BA2FC: + ldrb r0, [r6, 0x1D] +_081BA2FE: + strb r0, [r6, 0x1E] + ldr r0, [r6] + ldrb r3, [r0] + adds r0, 0x1 + str r0, [r6] + adds r0, r3, 0 + subs r0, 0xF8 + cmp r0, 0x7 + bls _081BA312 + b _081BA52E +_081BA312: + lsls r0, 2 + ldr r1, =_081BA320 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BA320: + .4byte _081BA524 + .4byte _081BA512 + .4byte _081BA504 + .4byte _081BA500 + .4byte _081BA36E + .4byte _081BA368 + .4byte _081BA340 + .4byte _081BA660 +_081BA340: + ldrb r0, [r6, 0x6] + strb r0, [r6, 0x8] + ldrb r1, [r6, 0x5] + ldr r0, =gFonts + ldr r2, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r6, 0xB] + ldrb r0, [r0, 0x5] + adds r1, r0 + ldrb r0, [r6, 0x9] + adds r0, r1 + strb r0, [r6, 0x9] +_081BA35E: + movs r0, 0x2 + b _081BA662 + .pool +_081BA368: + ldr r0, [r6] + adds r0, 0x1 + b _081BA4C4 +_081BA36E: + ldr r0, [r6] + ldrb r3, [r0] + adds r0, 0x1 + str r0, [r6] + subs r0, r3, 0x1 + cmp r0, 0xF + bls _081BA37E + b _081BA52E +_081BA37E: + lsls r0, 2 + ldr r1, =_081BA38C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BA38C: + .4byte _081BA3CC + .4byte _081BA3EE + .4byte _081BA412 + .4byte _081BA42C + .4byte _081BA478 + .4byte _081BA47E + .4byte _081BA35E + .4byte _081BA498 + .4byte _081BA4A8 + .4byte _081BA4BC + .4byte _081BA4C0 + .4byte _081BA4C8 + .4byte _081BA4D2 + .4byte _081BA4DE + .4byte _081BA4EE + .4byte _081BA4C0 +_081BA3CC: + ldr r2, [r6] + ldrb r1, [r2] + lsls r1, 4 + ldrb r3, [r6, 0xC] + movs r0, 0xF + ands r0, r3 + orrs r0, r1 + strb r0, [r6, 0xC] + adds r2, 0x1 + str r2, [r6] + lsls r0, 24 + lsrs r0, 28 + ldrb r2, [r6, 0xD] + lsls r1, r2, 28 + lsrs r1, 28 + lsrs r2, 4 + b _081BA472 +_081BA3EE: + ldr r1, [r6] + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + ldrb r3, [r6, 0xD] + movs r2, 0x10 + negs r2, r2 + ands r2, r3 + orrs r2, r0 + strb r2, [r6, 0xD] + adds r1, 0x1 + str r1, [r6] + ldrb r0, [r6, 0xC] + lsrs r0, 4 + lsls r1, r2, 28 + lsrs r1, 28 + lsrs r2, 4 + b _081BA472 +_081BA412: + ldr r1, [r6] + ldrb r0, [r1] + lsls r0, 4 + ldrb r3, [r6, 0xD] + movs r2, 0xF + ands r2, r3 + orrs r2, r0 + strb r2, [r6, 0xD] + adds r1, 0x1 + str r1, [r6] + ldrb r0, [r6, 0xC] + lsrs r0, 4 + b _081BA46A +_081BA42C: + ldr r3, [r6] + ldrb r1, [r3] + lsls r1, 4 + ldrb r4, [r6, 0xC] + movs r2, 0xF + adds r0, r2, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r6, 0xC] + adds r5, r3, 0x1 + str r5, [r6] + ldrb r3, [r3, 0x1] + adds r1, r2, 0 + ands r1, r3 + ldrb r4, [r6, 0xD] + movs r3, 0x10 + negs r3, r3 + ands r3, r4 + orrs r3, r1 + strb r3, [r6, 0xD] + adds r4, r5, 0x1 + str r4, [r6] + ldrb r1, [r5, 0x1] + lsls r1, 4 + ands r2, r3 + orrs r2, r1 + strb r2, [r6, 0xD] + adds r4, 0x1 + str r4, [r6] + lsls r0, 24 + lsrs r0, 28 +_081BA46A: + lsls r1, r2, 28 + lsrs r1, 28 + lsls r2, 24 + lsrs r2, 28 +_081BA472: + bl GenerateFontHalfRowLookupTable + b _081BA35E +_081BA478: + ldr r0, [r6] + adds r0, 0x1 + b _081BA4C4 +_081BA47E: + ldr r0, [r6] + ldrb r0, [r0] + movs r1, 0xF + ands r1, r0 + ldrb r2, [r4] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + ldr r0, [r6] + adds r0, 0x1 + b _081BA4C4 +_081BA498: + ldr r0, [r6] + ldrb r1, [r0] + strb r1, [r6, 0x1E] + adds r0, 0x1 + str r0, [r6] + movs r0, 0x6 + strb r0, [r6, 0x1C] + b _081BA35E +_081BA4A8: + movs r0, 0x1 + strb r0, [r6, 0x1C] + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081BA50E + movs r0, 0 + strb r0, [r4, 0x2] + b _081BA50E +_081BA4BC: + movs r0, 0x5 + b _081BA64A +_081BA4C0: + ldr r0, [r6] + adds r0, 0x2 +_081BA4C4: + str r0, [r6] + b _081BA35E +_081BA4C8: + ldr r1, [r6] + adds r0, r1, 0x1 + str r0, [r6] + ldrb r3, [r1, 0x1] + b _081BA52E +_081BA4D2: + ldr r1, [r6] + ldrb r0, [r1] + ldrb r2, [r6, 0x6] + adds r0, r2 + strb r0, [r6, 0x8] + b _081BA4E8 +_081BA4DE: + ldr r1, [r6] + ldrb r0, [r1] + ldrb r2, [r6, 0x7] + adds r0, r2 + strb r0, [r6, 0x9] +_081BA4E8: + adds r1, 0x1 + str r1, [r6] + b _081BA35E +_081BA4EE: + ldrb r0, [r6, 0x4] + ldrb r2, [r6, 0xD] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl FillWindowPixelBuffer + b _081BA35E +_081BA500: + movs r0, 0x2 + b _081BA506 +_081BA504: + movs r0, 0x3 +_081BA506: + strb r0, [r6, 0x1C] + adds r0, r6, 0 + bl TextPrinterInitDownArrowCounters +_081BA50E: + movs r0, 0x3 + b _081BA662 +_081BA512: + ldr r0, [r6] + ldrb r3, [r0] + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + orrs r3, r1 + adds r0, 0x1 + str r0, [r6] + b _081BA52E +_081BA524: + ldr r0, [r6] + adds r0, 0x1 + str r0, [r6] + movs r0, 0 + b _081BA662 +_081BA52E: + adds r0, r3, 0 + bl DecompressGlyphFont6 + adds r0, r6, 0 + bl CopyGlyphToWindow + ldr r0, =gUnknown_03002F90 + adds r0, 0x80 + ldrb r1, [r6, 0xA] + ldrb r0, [r0] + adds r1, r0 + ldrb r0, [r6, 0x8] + adds r0, r1 + strb r0, [r6, 0x8] + movs r0, 0 + b _081BA662 + .pool +_081BA554: + adds r0, r6, 0 + bl TextPrinterWait + lsls r0, 16 + cmp r0, 0 + beq _081BA50E + movs r0, 0 + strb r0, [r6, 0x1C] + b _081BA50E +_081BA566: + adds r0, r6, 0 + bl TextPrinterWaitWithDownArrow + lsls r0, 16 + cmp r0, 0 + beq _081BA50E + ldrb r0, [r6, 0x4] + ldrb r2, [r6, 0xD] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl FillWindowPixelBuffer + ldrb r0, [r6, 0x6] + movs r1, 0 + strb r0, [r6, 0x8] + ldrb r0, [r6, 0x7] + strb r0, [r6, 0x9] + strb r1, [r6, 0x1C] + b _081BA50E +_081BA590: + adds r0, r6, 0 + bl TextPrinterWaitWithDownArrow + lsls r0, 16 + cmp r0, 0 + beq _081BA50E + adds r0, r6, 0 + bl TextPrinterClearDownArrow + ldrb r1, [r6, 0x5] + ldr r0, =gFonts + ldr r2, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r6, 0xB] + ldrb r0, [r0, 0x5] + adds r1, r0 + strb r1, [r6, 0x1F] + ldrb r0, [r6, 0x6] + strb r0, [r6, 0x8] + movs r0, 0x4 + strb r0, [r6, 0x1C] + b _081BA50E + .pool +_081BA5C8: + ldrb r2, [r6, 0x1F] + cmp r2, 0 + beq _081BA638 + ldr r4, =gUnknown_08616124 + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldrb r0, [r0, 0x14] + lsls r1, r0, 29 + lsrs r0, r1, 29 + adds r0, r4 + ldrb r0, [r0] + cmp r2, r0 + bcs _081BA604 + ldrb r0, [r6, 0x4] + ldrb r1, [r6, 0xD] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0 + bl ScrollWindow + movs r0, 0 + strb r0, [r6, 0x1F] + b _081BA62E + .pool +_081BA604: + ldrb r0, [r6, 0x4] + lsrs r1, 29 + adds r1, r4 + ldrb r2, [r1] + ldrb r1, [r6, 0xD] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0 + bl ScrollWindow + ldr r0, [r5] + ldrb r0, [r0, 0x14] + lsls r0, 29 + lsrs r0, 29 + adds r0, r4 + ldrb r1, [r6, 0x1F] + ldrb r0, [r0] + subs r1, r0 + strb r1, [r6, 0x1F] +_081BA62E: + ldrb r0, [r6, 0x4] + movs r1, 0x2 + bl CopyWindowToVram + b _081BA50E +_081BA638: + strb r2, [r6, 0x1C] + b _081BA50E +_081BA63C: + bl IsSEPlaying + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081BA64A + b _081BA50E +_081BA64A: + strb r0, [r6, 0x1C] + b _081BA50E +_081BA64E: + ldrb r0, [r6, 0x1E] + adds r1, r0, 0 + cmp r1, 0 + beq _081BA65C + subs r0, 0x1 + strb r0, [r6, 0x1E] + b _081BA50E +_081BA65C: + strb r1, [r6, 0x1C] + b _081BA50E +_081BA660: + movs r0, 0x1 +_081BA662: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end Font6Func + + thumb_func_start DecompressGlyphFont6 +DecompressGlyphFont6: @ 81BA668 + push {r4,r5,lr} + lsls r0, 16 + lsrs r2, r0, 19 + lsls r2, 9 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + lsrs r1, 11 + ldr r0, =gFont6BrailleGlyphs + adds r1, r0 + adds r5, r2, r1 + ldr r4, =gUnknown_03002F90 + adds r0, r5, 0 + adds r1, r4, 0 + bl DecompressGlyphTile + adds r0, r5, 0 + adds r0, 0x10 + adds r1, r4, 0 + adds r1, 0x20 + bl DecompressGlyphTile + movs r1, 0x80 + lsls r1, 1 + adds r0, r5, r1 + adds r1, r4, 0 + adds r1, 0x40 + bl DecompressGlyphTile + movs r1, 0x88 + lsls r1, 1 + adds r0, r5, r1 + adds r1, r4, 0 + adds r1, 0x60 + bl DecompressGlyphTile + adds r0, r4, 0 + adds r0, 0x80 + movs r1, 0x10 + strb r1, [r0] + adds r0, 0x1 + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DecompressGlyphFont6 + + thumb_func_start GetGlyphWidthFont6 +GetGlyphWidthFont6: @ 81BA6CC + movs r0, 0x10 + bx lr + thumb_func_end GetGlyphWidthFont6 + + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_81BE66C.s b/asm/rom_81BE66C.s index 7b3b695e3..46d95ac40 100644 --- a/asm/rom_81BE66C.s +++ b/asm/rom_81BE66C.s @@ -266,7 +266,7 @@ sub_81BE808: @ 81BE808 blt _081BE882 adds r0, r5, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _081BE882: add sp, 0x4 pop {r4,r5} @@ -459,7 +459,7 @@ sub_81BEA00: @ 81BEA00 bl FreeSpriteTilesByTag adds r0, r4, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r4} pop {r0} bx r0 @@ -839,7 +839,7 @@ _081BED1C: bl CreateTask adds r0, r5, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _081BED40: add sp, 0xC pop {r4,r5} @@ -1159,7 +1159,7 @@ _081BEFF0: _081BEFF8: mov r0, r10 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _081BF002: ldr r0, =gTasks mov r2, r10 @@ -1404,7 +1404,7 @@ _081BF1CC: b _081BF228 .pool _081BF224: - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _081BF228: ldr r0, =gTasks lsls r1, r7, 2 @@ -5475,26 +5475,26 @@ sub_81C15EC: @ 81C15EC adds r1, 0xD adds r0, r7, 0 mov r2, sp - bl SetMonData_encrypted + bl SetBoxMonData adds r1, r6, 0 adds r1, 0xD adds r0, r7, 0 ldr r2, [sp, 0x1C] - bl SetMonData_encrypted + bl SetBoxMonData adds r4, 0x11 adds r0, r7, 0 adds r1, r4, 0 ldr r2, [sp, 0x20] - bl SetMonData_encrypted + bl SetBoxMonData adds r6, 0x11 adds r0, r7, 0 adds r1, r6, 0 ldr r2, [sp, 0x24] - bl SetMonData_encrypted + bl SetBoxMonData adds r0, r7, 0 movs r1, 0x15 adds r2, r5, 0 - bl SetMonData_encrypted + bl SetBoxMonData mov r0, sp ldrh r0, [r0] ldr r1, [sp, 0x8] @@ -6828,13 +6828,13 @@ sub_81C2228: @ 81C2228 push {r4,lr} adds r4, r0, 0 movs r1, 0 - bl sub_806DD7C + bl CheckPartyPokerus lsls r0, 24 cmp r0, 0 bne _081C225C adds r0, r4, 0 movs r1, 0 - bl sub_806DDE4 + bl CheckPartyHasHadPokerus lsls r0, 24 cmp r0, 0 beq _081C225C @@ -7332,7 +7332,7 @@ sub_81C2628: @ 81C2628 adds r7, r0, 0 adds r7, 0x70 ldrh r0, [r7] - bl sub_806E3C0 + bl SpeciesToPokedexNum lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x0000ffff @@ -7352,7 +7352,7 @@ sub_81C2628: @ 81C2628 adds r1, r4, 0 bl StringAppend mov r0, r8 - bl sub_806EBA4 + bl IsMonShiny lsls r0, 24 lsrs r0, 24 cmp r0, 0 @@ -7389,7 +7389,7 @@ _081C26CE: movs r0, 0x11 bl ClearWindowTilemap mov r0, r8 - bl sub_806EBA4 + bl IsMonShiny lsls r0, 24 cmp r0, 0 bne _081C26E8 @@ -7508,7 +7508,7 @@ sub_81C27DC: @ 81C27DC beq _081C282C cmp r1, 0x1D beq _081C282C - bl pokemon_get_gender + bl GetMonGender lsls r0, 24 lsrs r0, 24 cmp r0, 0 @@ -8403,7 +8403,7 @@ sub_81C2FD8: @ 81C2FD8 ldrh r0, [r0] adds r1, 0x78 ldrb r1, [r1] - bl sub_806B694 + bl GetAbilityBySpecies adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -8441,7 +8441,7 @@ sub_81C302C: @ 81C302C ldrh r0, [r0] adds r1, 0x78 ldrb r1, [r1] - bl sub_806B694 + bl GetAbilityBySpecies adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -8656,12 +8656,12 @@ sub_81C3220: @ 81C3220 ldr r0, =gEnemyParty cmp r1, r0 bne _081C326C - bl link_get_multiplayer_id + bl GetMultiplayerId movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers lsls r1, r0, 3 subs r1, r0 lsls r1, 2 @@ -9683,7 +9683,7 @@ sub_81C3B08: @ 81C3B08 ldrb r1, [r0] adds r0, r5, 0 adds r2, r7, 0 - bl CalcPPWithPPUps + bl CalculatePPWithBonus adds r6, r0, 0 lsls r6, 24 lsrs r6, 24 @@ -12035,7 +12035,7 @@ sub_81C4F10: @ 81C4F10 thumb_func_start sub_81C4F24 sub_81C4F24: @ 81C4F24 push {lr} - bl script_env_2_enable + bl ScriptContext2_Enable movs r0, 0x1 movs r1, 0 bl fade_screen @@ -14443,7 +14443,7 @@ sub_81C6404: @ 81C6404 movs r0, 0x3 movs r1, 0x1 adds r2, r4, 0 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r4} pop {r0} @@ -14481,7 +14481,7 @@ sub_81C645C: @ 81C645C movs r0, 0x3 movs r1, 0x1 adds r2, r4, 0 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r4} pop {r0} @@ -16242,7 +16242,7 @@ _081C73C6: lsrs r1, 24 lsrs r0, r6, 24 movs r2, 0x52 - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox cmp r0, 0 beq _081C73EC _081C73E2: @@ -18385,7 +18385,7 @@ _081C8434: str r6, [sp, 0x8] adds r2, r7, 0 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldrh r0, [r4, 0xC] adds r0, 0x1 strh r0, [r4, 0xC] @@ -19595,7 +19595,7 @@ sub_81C8D4C: @ 81C8D4C str r2, [sp, 0x8] adds r2, r5, 0 movs r3, 0x8 - bl Print + bl PrintTextOnWindow adds r0, r4, 0 movs r1, 0 bl sub_81C8C64 @@ -19723,7 +19723,7 @@ sub_81C8E54: @ 81C8E54 movs r1, 0x7 adds r2, r5, 0 movs r3, 0x2 - bl Print + bl PrintTextOnWindow ldrh r0, [r7, 0x8] ldrb r1, [r7, 0x4] str r1, [sp] @@ -25899,7 +25899,7 @@ sub_81CBE88: @ 81CBE88 movs r1, 0x7 adds r2, r3, 0 movs r3, 0x2 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r0} bx r0 @@ -25934,7 +25934,7 @@ sub_81CBEB4: @ 81CBEB4 adds r0, r5, 0 movs r1, 0x7 adds r2, r6, 0 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r4-r6} pop {r0} @@ -25982,7 +25982,7 @@ _081CBF24: movs r1, 0x7 add r2, sp, 0xC adds r3, r4, 0 - bl Print + bl PrintTextOnWindow add sp, 0x2C pop {r4,r5} pop {r0} @@ -26016,7 +26016,7 @@ _081CBF76: str r1, [sp, 0x8] movs r1, 0x7 movs r3, 0x10 - bl Print + bl PrintTextOnWindow movs r0, 0x80 lsls r0, 21 adds r6, r0 @@ -26201,7 +26201,7 @@ sub_81CC0E0: @ 81CC0E0 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x20 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r0} bx r0 @@ -26235,7 +26235,7 @@ sub_81CC11C: @ 81CC11C str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r0} bx r0 @@ -26278,7 +26278,7 @@ sub_81CC158: @ 81CC158 adds r0, r2, 0 adds r2, r5, 0 movs r3, 0x20 - bl Print + bl PrintTextOnWindow add sp, 0xC pop {r4,r5} pop {r0} @@ -27520,7 +27520,7 @@ _081CCB44: str r1, [sp, 0x8] movs r1, 0x7 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrh r1, [r5] ldrb r2, [r5, 0x3] adds r0, r4, 0 @@ -27552,7 +27552,7 @@ _081CCB8E: str r1, [sp, 0x8] movs r1, 0x7 movs r3, 0 - bl Print + bl PrintTextOnWindow ldr r1, =0x00001041 movs r0, 0xC str r0, [sp] @@ -27582,7 +27582,7 @@ _081CCBDC: str r1, [sp, 0x8] movs r1, 0x7 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrh r1, [r5] ldrb r2, [r5, 0x3] adds r0, r4, 0 @@ -27861,7 +27861,7 @@ _081CCE08: movs r1, 0x7 adds r2, r6, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0x80 lsls r0, 21 adds r4, r0 @@ -28270,7 +28270,7 @@ _081CD174: adds r1, r3, 0 movs r2, 0x8 mov r3, sp - bl set_pokemon_data_from_any_box + bl SetBoxMonDataFromAnyBox _081CD180: ldr r0, =0x00006304 adds r1, r6, r0 @@ -28938,7 +28938,7 @@ _081CD690: lsrs r0, 16 mov r8, r0 adds r0, r4, 0 - bl pokemon_get_gender + bl GetMonGender lsls r0, 24 lsrs r6, r0, 24 b _081CD6FE @@ -28948,11 +28948,11 @@ _081CD6E0: mov r1, r9 bl get_pokemon_by_box_and_pos adds r4, r0, 0 - bl pokemon_roll_gender + bl GetBoxMonGender lsls r0, 24 lsrs r6, r0, 24 adds r0, r4, 0 - bl sub_80690C0 + bl GetLevelFromBoxMonExp lsls r0, 24 lsrs r0, 24 mov r8, r0 @@ -29304,7 +29304,7 @@ _081CD9BE: lsls r0, 16 lsrs r4, r0, 16 _081CD9C4: - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -30977,7 +30977,7 @@ _081CE7DA: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow b _081CE924 _081CE800: bl sub_81CDD5C @@ -31002,7 +31002,7 @@ _081CE80C: str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow add r1, sp, 0xC movs r0, 0xFC strb r0, [r1] @@ -31028,7 +31028,7 @@ _081CE80C: movs r1, 0x1 add r2, sp, 0xC movs r3, 0x4 - bl Print + bl PrintTextOnWindow bl sub_81CDD48 adds r1, r0, 0 lsls r1, 16 @@ -31044,7 +31044,7 @@ _081CE80C: movs r1, 0x1 add r2, sp, 0xC movs r3, 0x1C - bl Print + bl PrintTextOnWindow b _081CE924 .pool _081CE89C: @@ -32218,7 +32218,7 @@ _081CF1FC: str r0, [sp] ldr r2, [r6, 0x14] adds r0, r7, 0 - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox lsls r0, 16 ldr r2, =0x0000ffff ldr r1, [sp] @@ -33024,7 +33024,7 @@ sub_81CF7F4: @ 81CF7F4 movs r1, 0x1 adds r2, r5, 0 movs r3, 0x4 - bl Print + bl PrintTextOnWindow adds r0, r4, 0 adds r1, r7, 0 movs r2, 0x1 @@ -33040,7 +33040,7 @@ sub_81CF7F4: @ 81CF7F4 movs r1, 0x1 adds r2, r4, 0 movs r3, 0x22 - bl Print + bl PrintTextOnWindow mov r1, r8 ldrb r0, [r1, 0x8] movs r1, 0x2 @@ -33112,11 +33112,11 @@ sub_81CF8E4: @ 81CF8E4 ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 - bl pokemon_get_gender + bl GetMonGender lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 - bl level_by_exp + bl GetLevelFromMonExp lsls r0, 24 lsrs r7, r0, 24 ldr r2, =gStringVar3 @@ -33130,17 +33130,17 @@ _081CF924: ldrb r1, [r2, 0x1] bl get_pokemon_by_box_and_pos adds r4, r0, 0 - bl pokemon_roll_gender + bl GetBoxMonGender lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 - bl sub_80690C0 + bl GetLevelFromBoxMonExp lsls r0, 24 lsrs r7, r0, 24 ldr r2, =gStringVar3 adds r0, r4, 0 movs r1, 0x2 - bl pokemon_getattr_encrypted + bl GetBoxMonData _081CF94A: ldr r4, =gStringVar3 adds r0, r4, 0 @@ -33571,7 +33571,7 @@ _081CFC60: adds r0, r5, 0 adds r1, r4, 0 movs r2, 0x52 - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox adds r3, r0, 0 cmp r3, 0 beq _081CFCA6 @@ -33733,7 +33733,7 @@ _081CFD96: lsrs r1, 24 lsrs r0, r6, 24 movs r2, 0x53 - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox cmp r0, 0 beq _081CFDBC _081CFDB2: @@ -34423,7 +34423,7 @@ sub_81D02B0: @ 81D02B0 adds r0, r4, 0 movs r1, 0x1 add r2, sp, 0xC - bl Print + bl PrintTextOnWindow add sp, 0x1C pop {r4,r5} pop {r0} @@ -34488,11 +34488,11 @@ sub_81D035C: @ 81D035C ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 - bl pokemon_get_gender + bl GetMonGender lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 - bl level_by_exp + bl GetLevelFromMonExp lsls r0, 24 lsrs r0, 24 mov r8, r0 @@ -34507,18 +34507,18 @@ _081D03A4: ldrb r1, [r7, 0x1] bl get_pokemon_by_box_and_pos adds r4, r0, 0 - bl pokemon_roll_gender + bl GetBoxMonGender lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 - bl sub_80690C0 + bl GetLevelFromBoxMonExp lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r2, =gStringVar3 adds r0, r4, 0 movs r1, 0x2 - bl pokemon_getattr_encrypted + bl GetBoxMonData _081D03CC: ldr r4, =gStringVar3 adds r0, r4, 0 @@ -34982,10 +34982,10 @@ sub_81D06E4: @ 81D06E4 adds r2, r5, 0 bl GetMonData adds r0, r4, 0 - bl level_by_exp + bl GetLevelFromMonExp strb r0, [r7] adds r0, r4, 0 - bl pokemon_get_gender + bl GetMonGender strb r0, [r6] b _081D0752 .pool @@ -34994,15 +34994,15 @@ _081D0730: ldrb r1, [r1, 0x1] bl get_pokemon_by_box_and_pos adds r4, r0, 0 - bl pokemon_roll_gender + bl GetBoxMonGender strb r0, [r6] adds r0, r4, 0 - bl sub_80690C0 + bl GetLevelFromBoxMonExp strb r0, [r7] adds r0, r4, 0 movs r1, 0x2 adds r2, r5, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData _081D0752: adds r0, r5, 0 bl StringGetEnd10 @@ -35052,15 +35052,15 @@ _081D07AC: bl get_pokemon_by_box_and_pos adds r4, r0, 0 movs r1, 0xB - bl pokemon_getattr_encrypted + bl GetBoxMonData strh r0, [r5] adds r0, r4, 0 movs r1, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData str r0, [r6] adds r0, r4, 0 movs r1, 0x1 - bl pokemon_getattr_encrypted + bl GetBoxMonData _081D07D0: str r0, [r7] pop {r4-r7} @@ -35083,7 +35083,7 @@ sub_81D07D8: @ 81D07D8 beq _081D07FA ldrb r1, [r1, 0x1] movs r2, 0x52 - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox b _081D080A _081D07FA: ldrb r1, [r1, 0x1] @@ -35128,7 +35128,7 @@ _081D0848: ldrb r0, [r1] ldrb r1, [r1, 0x1] movs r2, 0x53 - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox _081D0852: mov r12, r0 movs r0, 0 @@ -36086,7 +36086,7 @@ sub_81D0FF0: @ 81D0FF0 movs r1, 0x1 adds r2, r4, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r6] cmp r0, 0 beq _081D1040 @@ -36131,7 +36131,7 @@ _081D104A: movs r1, 0x1 adds r2, r5, 0 movs r3, 0x3C - bl Print + bl PrintTextOnWindow adds r0, r4, 0 movs r1, 0x2 bl CopyWindowToVram @@ -36205,7 +36205,7 @@ sub_81D10D0: @ 81D10D0 str r1, [sp, 0x8] movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow mov r1, r8 ldrb r0, [r1, 0xC] movs r1, 0x2 @@ -39489,7 +39489,7 @@ sub_81D28FC: @ 81D28FC movs r0, 0 movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow ldr r5, =gUnknown_085EFA52 movs r1, 0x29 mov r10, r1 @@ -39501,7 +39501,7 @@ sub_81D28FC: @ 81D28FC movs r1, 0x1 adds r2, r5, 0 movs r3, 0x4 - bl Print + bl PrintTextOnWindow ldr r5, =gUnknown_085EFA56 movs r0, 0x1 adds r1, r5, 0 @@ -39518,7 +39518,7 @@ sub_81D28FC: @ 81D28FC movs r0, 0 movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow ldr r5, =gUnknown_085EFA5D movs r0, 0x1 adds r1, r5, 0 @@ -39535,7 +39535,7 @@ sub_81D28FC: @ 81D28FC movs r0, 0 movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow movs r0, 0x2 negs r0, r0 cmp r9, r0 @@ -39566,7 +39566,7 @@ _081D29C4: movs r1, 0x1 adds r2, r5, 0 movs r3, 0x4 - bl Print + bl PrintTextOnWindow ldr r1, =gUnknown_085EFA52 movs r0, 0x1 movs r2, 0 @@ -39587,7 +39587,7 @@ _081D29C4: movs r0, 0 movs r1, 0x1 add r2, sp, 0xC - bl Print + bl PrintTextOnWindow ldrb r0, [r6, 0x1] cmp r0, 0x1 bhi _081D2A3C @@ -39611,7 +39611,7 @@ _081D2A4A: movs r1, 0x1 adds r2, r5, 0 movs r3, 0x6A - bl Print + bl PrintTextOnWindow ldrb r0, [r6, 0x3] cmp r0, 0 bne _081D2A70 @@ -39636,7 +39636,7 @@ _081D2A7E: movs r1, 0x1 adds r2, r5, 0 movs r3, 0x6A - bl Print + bl PrintTextOnWindow ldr r1, =gMoveDescriptionPointers mov r0, r9 subs r0, 0x1 @@ -39651,7 +39651,7 @@ _081D2A7E: movs r1, 0x7 adds r2, r5, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow _081D2AB6: add sp, 0x2C pop {r3-r5} @@ -39690,7 +39690,7 @@ sub_81D2ACC: @ 81D2ACC str r6, [sp, 0x8] movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow ldr r5, =gUnknown_085EFA67 movs r0, 0x1 adds r1, r5, 0 @@ -39706,7 +39706,7 @@ sub_81D2ACC: @ 81D2ACC movs r0, 0x1 movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow ldr r5, =gUnknown_085EFA6E movs r0, 0x1 adds r1, r5, 0 @@ -39721,7 +39721,7 @@ sub_81D2ACC: @ 81D2ACC movs r0, 0x1 movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow movs r0, 0x2 negs r0, r0 cmp r4, r0 @@ -39749,7 +39749,7 @@ _081D2B6C: movs r1, 0x1 adds r2, r5, 0 movs r3, 0x4 - bl Print + bl PrintTextOnWindow ldr r1, =gContestEffectDescriptionPointers ldrb r0, [r4] lsls r0, 2 @@ -39763,7 +39763,7 @@ _081D2B6C: movs r1, 0x7 adds r2, r5, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0x1 movs r1, 0x2 bl CopyWindowToVram @@ -39899,14 +39899,14 @@ _081D2CB0: lsrs r0, 24 lsls r1, 24 lsrs r1, 24 - bl sub_80D1ED0 + bl GetAndCopyBoxMonDataFromAnyBox b _081D2CCA _081D2CBE: lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 - bl get_pokemon_data_from_any_box + bl GetBoxMonDataFromAnyBox _081D2CCA: pop {r1} bx r1 @@ -39980,7 +39980,7 @@ _081D2D20: lsrs r0, 16 mov r8, r0 adds r0, r4, 0 - bl pokemon_get_gender + bl GetMonGender lsls r0, 24 lsrs r6, r0, 24 b _081D2D92 @@ -39992,11 +39992,11 @@ _081D2D70: lsrs r1, 24 bl get_pokemon_by_box_and_pos adds r4, r0, 0 - bl pokemon_roll_gender + bl GetBoxMonGender lsls r0, 24 lsrs r6, r0, 24 adds r0, r4, 0 - bl sub_80690C0 + bl GetLevelFromBoxMonExp lsls r0, 24 lsrs r0, 24 mov r8, r0 @@ -46461,7 +46461,7 @@ sub_81D61E8: @ 81D61E8 lsls r0, 25 lsrs r4, r0, 24 movs r3, 0 - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A mov r8, r0 ldr r6, =gSaveBlock2Ptr ldr r1, =gBitTable @@ -46505,7 +46505,7 @@ _081D624A: cmp r0, 0 beq _081D62A2 movs r3, 0 - ldr r5, =gUnknown_02038BCC + ldr r5, =gTrainerBattleOpponent_B ldr r0, =gBitTable mov r8, r0 _081D6260: @@ -46656,7 +46656,7 @@ _081D636A: sub_81D6384: @ 81D6384 push {lr} bl ZeroEnemyPartyMons - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r0, [r0] movs r1, 0 bl sub_81D62CC @@ -46669,11 +46669,11 @@ sub_81D6384: @ 81D6384 sub_81D639C: @ 81D639C push {lr} bl ZeroEnemyPartyMons - ldr r0, =gUnknown_02038BCA + ldr r0, =gTrainerBattleOpponent_A ldrh r0, [r0] movs r1, 0 bl sub_81D62CC - ldr r0, =gUnknown_02038BCC + ldr r0, =gTrainerBattleOpponent_B ldrh r0, [r0] movs r1, 0x3 bl sub_81D62CC @@ -46777,7 +46777,7 @@ sub_81D642C: @ 81D642C mov r2, sp bl SetMonData adds r0, r4, 0 - bl pokemon_calc_effective_stats + bl CalculateMonStats add sp, 0x8 pop {r4,r5} pop {r0} @@ -53887,7 +53887,7 @@ _081DA02A: ldrb r0, [r4] cmp r0, 0x4 beq _081DA0B8 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _081DA0B8 @@ -54088,7 +54088,7 @@ _081DA1D4: ldrb r0, [r0] cmp r5, r0 bge _081DA214 - ldr r6, =gUnknown_020229E8 + ldr r6, =gLinkPlayers _081DA1EC: lsls r4, r5, 6 ldr r0, =gUnknown_02039E00 @@ -54157,7 +54157,7 @@ sub_81DA244: @ 81DA244 b _081DA2D4 .pool _081DA284: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _081DA2CE @@ -54437,7 +54437,7 @@ sub_81DA488: @ 81DA488 b _081DA55C .pool _081DA4CC: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _081DA4FA @@ -54485,7 +54485,7 @@ _081DA50C: bgt _081DA54C lsls r0, r4, 6 adds r5, r0, r5 - ldr r7, =gUnknown_020229E8 + ldr r7, =gLinkPlayers _081DA53C: ldrh r1, [r7, 0x1A] adds r0, r5, 0 diff --git a/asm/roulette.s b/asm/roulette.s index 5332c4a46..5742e089f 100644 --- a/asm/roulette.s +++ b/asm/roulette.s @@ -519,7 +519,7 @@ _081406E0: str r5, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r4] movs r1, 0x3 bl CopyWindowToVram @@ -751,7 +751,7 @@ sub_8140914: @ 8140914 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r5] movs r1, 0x3 bl CopyWindowToVram @@ -2655,7 +2655,7 @@ _08141902: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r4] movs r1, 0x3 bl CopyWindowToVram @@ -2678,7 +2678,7 @@ _08141928: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r4] movs r1, 0x3 bl CopyWindowToVram @@ -2816,7 +2816,7 @@ sub_8141A18: @ 8141A18 movs r1, 0x1 mov r2, r8 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r5] movs r1, 0x3 bl CopyWindowToVram @@ -3012,7 +3012,7 @@ _08141BB0: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r4] movs r1, 0x3 bl CopyWindowToVram @@ -3039,7 +3039,7 @@ _08141C58: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r4] movs r1, 0x3 bl CopyWindowToVram @@ -3071,7 +3071,7 @@ _08141CBC: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r4] movs r1, 0x3 bl CopyWindowToVram @@ -3158,7 +3158,7 @@ _08141D44: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r4] movs r1, 0x3 bl CopyWindowToVram @@ -4590,7 +4590,7 @@ sub_814297C: @ 814297C movs r1, 0 bl sub_819746C bl HideCoinsWindow - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r4, 0 bl DestroyTask pop {r4} @@ -4624,7 +4624,7 @@ sub_81429A0: @ 81429A0 movs r0, 0 movs r1, 0x1 bl sub_819746C - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r4, 0 bl DestroyTask _081429DE: @@ -4676,7 +4676,7 @@ sub_81429F0: @ 81429F0 movs r1, 0x1 adds r2, r4, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -4753,7 +4753,7 @@ sub_8142A88: @ 8142A88 str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -4778,7 +4778,7 @@ _08142B28: movs r1, 0x1 adds r2, r4, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -4808,7 +4808,7 @@ _08142B78: movs r1, 0x1 adds r2, r5, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -4829,7 +4829,7 @@ _08142BB0: thumb_func_start sub_8142BC8 sub_8142BC8: @ 8142BC8 push {r4,lr} - bl script_env_2_enable + bl ScriptContext2_Enable bl GetCoins lsls r0, 16 lsrs r0, 16 diff --git a/asm/safari_zone.s b/asm/safari_zone.s deleted file mode 100644 index 9d6e73021..000000000 --- a/asm/safari_zone.s +++ /dev/null @@ -1,524 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start GetSafariZoneFlag -GetSafariZoneFlag: @ 80FC0A0 - push {lr} - ldr r0, =0x0000088c - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end GetSafariZoneFlag - - thumb_func_start SetSafariZoneFlag -SetSafariZoneFlag: @ 80FC0B4 - push {lr} - ldr r0, =0x0000088c - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end SetSafariZoneFlag - - thumb_func_start ResetSafariZoneFlag -ResetSafariZoneFlag: @ 80FC0C4 - push {lr} - ldr r0, =0x0000088c - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end ResetSafariZoneFlag - - thumb_func_start sub_80FC0D4 -sub_80FC0D4: @ 80FC0D4 - push {lr} - movs r0, 0x11 - bl IncrementGameStat - bl SetSafariZoneFlag - bl sub_80FC244 - ldr r1, =gUnknown_0203A04C - movs r0, 0x1E - strb r0, [r1] - ldr r1, =gUnknown_0203A04E - movs r2, 0xFA - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A050 - movs r1, 0 - strb r1, [r0] - ldr r0, =gUnknown_0203A051 - strb r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC0D4 - - thumb_func_start sub_80FC114 -sub_80FC114: @ 80FC114 - push {lr} - ldr r0, =gUnknown_0203A050 - ldrb r0, [r0] - ldr r1, =gUnknown_0203A051 - ldrb r1, [r1] - bl sub_80EE44C - bl ResetSafariZoneFlag - bl sub_80FC244 - ldr r1, =gUnknown_0203A04C - movs r0, 0 - strb r0, [r1] - ldr r1, =gUnknown_0203A04E - movs r0, 0 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC114 - - thumb_func_start safari_step -safari_step: @ 80FC14C - push {lr} - bl GetSafariZoneFlag - cmp r0, 0 - beq _080FC168 - bl sub_80FC480 - ldr r1, =gUnknown_0203A04E - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - beq _080FC170 -_080FC168: - movs r0, 0 - b _080FC178 - .pool -_080FC170: - ldr r0, =gUnknown_082A4B8A - bl script_env_1_execute_new_script - movs r0, 0x1 -_080FC178: - pop {r1} - bx r1 - .pool - thumb_func_end safari_step - - thumb_func_start sub_80FC180 -sub_80FC180: @ 80FC180 - push {lr} - ldr r0, =gUnknown_082A4B6F - bl script_env_1_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC180 - - thumb_func_start sub_80FC190 -sub_80FC190: @ 80FC190 - push {lr} - ldr r1, =gUnknown_0203A051 - ldr r0, =gUnknown_03005D10 - ldrb r0, [r0, 0x1F] - ldrb r2, [r1] - adds r0, r2 - strb r0, [r1] - ldr r2, =gBattleOutcome - ldrb r0, [r2] - cmp r0, 0x7 - bne _080FC1AE - ldr r1, =gUnknown_0203A050 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080FC1AE: - ldr r0, =gUnknown_0203A04C - ldrb r0, [r0] - cmp r0, 0 - beq _080FC1D8 - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - b _080FC21C - .pool -_080FC1D8: - ldrb r0, [r2] - cmp r0, 0x8 - bne _080FC208 - ldr r0, =gUnknown_082A4B4C - bl ScriptContext2_RunNewScript - bl warp_in - ldr r1, =gUnknown_03005DAC - ldr r0, =sub_80AF6F0 - str r0, [r1] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - b _080FC21C - .pool -_080FC208: - cmp r0, 0x7 - bne _080FC21C - ldr r0, =gUnknown_082A4B9B - bl script_env_1_execute_new_script - bl script_env_2_set_ctx_paused - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 -_080FC21C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC190 - - thumb_func_start sub_80FC228 -sub_80FC228: @ 80FC228 - push {lr} - lsls r0, 24 - lsrs r0, 20 - ldr r1, =gUnknown_0203A054 - adds r0, r1 - movs r1, 0 - movs r2, 0x10 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC228 - - thumb_func_start sub_80FC244 -sub_80FC244: @ 80FC244 - push {lr} - ldr r0, =gUnknown_0203A054 - movs r1, 0 - movs r2, 0xA0 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC244 - - thumb_func_start sub_80FC258 -sub_80FC258: @ 80FC258 - push {r4,r5,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - movs r5, 0 -_080FC26A: - ldr r0, =gSaveBlock1Ptr - ldr r2, [r0] - ldr r1, =gUnknown_0203A054 - lsls r0, r5, 4 - adds r3, r0, r1 - movs r1, 0x5 - ldrsb r1, [r2, r1] - movs r0, 0x4 - ldrsb r0, [r3, r0] - cmp r1, r0 - bne _080FC2C4 - mov r0, sp - movs r2, 0 - ldrsh r1, [r3, r2] - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r1, r0 - bne _080FC2C4 - movs r0, 0x2 - ldrsh r1, [r3, r0] - movs r2, 0 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _080FC2C4 - ldr r0, =gScriptResult - strh r5, [r0] - ldr r1, =gUnknown_085B262C - ldrb r0, [r3, 0x8] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, =gStringVar1 - bl StringCopy - b _080FC2D6 - .pool -_080FC2C4: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x9 - bls _080FC26A - ldr r1, =gScriptResult - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] -_080FC2D6: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC258 - - thumb_func_start sub_80FC2E8 -sub_80FC2E8: @ 80FC2E8 - push {r4-r7,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - movs r5, 0 - adds r6, r4, 0 - ldr r0, =gSaveBlock1Ptr - ldr r7, [r0] - mov r4, sp - ldr r0, =gUnknown_0203A054 - mov r12, r0 -_080FC306: - lsls r0, r5, 4 - mov r1, r12 - adds r3, r0, r1 - movs r1, 0x5 - ldrsb r1, [r7, r1] - movs r0, 0x4 - ldrsb r0, [r3, r0] - cmp r1, r0 - bne _080FC364 - ldrh r0, [r4] - ldrh r1, [r3] - subs r0, r1 - strh r0, [r4] - adds r2, r6, 0 - ldrh r0, [r2] - ldrh r1, [r3, 0x2] - subs r0, r1 - strh r0, [r2] - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _080FC336 - negs r0, r0 - strh r0, [r4] -_080FC336: - movs r1, 0 - ldrsh r0, [r2, r1] - cmp r0, 0 - bge _080FC342 - negs r0, r0 - strh r0, [r2] -_080FC342: - movs r2, 0 - ldrsh r0, [r4, r2] - movs r2, 0 - ldrsh r1, [r6, r2] - adds r0, r1 - cmp r0, 0x5 - bgt _080FC364 - ldr r0, =gScriptResult - strh r5, [r0] - b _080FC376 - .pool -_080FC364: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x9 - bls _080FC306 - ldr r1, =gScriptResult - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] -_080FC376: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC2E8 - - thumb_func_start sub_80FC388 -sub_80FC388: @ 80FC388 - push {lr} - bl sub_80FC258 - ldr r2, =gScriptResult - ldrh r1, [r2] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _080FC3B0 - adds r0, r1, 0 - lsls r0, 4 - ldr r1, =gUnknown_0203A05C - adds r0, r1 - b _080FC3B2 - .pool -_080FC3B0: - movs r0, 0 -_080FC3B2: - pop {r1} - bx r1 - thumb_func_end sub_80FC388 - - thumb_func_start sub_80FC3B8 -sub_80FC3B8: @ 80FC3B8 - push {lr} - bl sub_80FC2E8 - ldr r2, =gScriptResult - ldrh r1, [r2] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _080FC3E0 - adds r0, r1, 0 - lsls r0, 4 - ldr r1, =gUnknown_0203A05C - adds r0, r1 - b _080FC3E2 - .pool -_080FC3E0: - movs r0, 0 -_080FC3E2: - pop {r1} - bx r1 - thumb_func_end sub_80FC3B8 - - thumb_func_start sub_80FC3E8 -sub_80FC3E8: @ 80FC3E8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r1, 0 - ldr r2, =gUnknown_0203A054 - mov r6, sp - adds r6, 0x2 - movs r0, 0x8 - adds r0, r2 - mov r9, r0 - ldr r7, =gSaveBlock1Ptr -_080FC408: - lsls r5, r1, 4 - adds r4, r5, r2 - movs r0, 0x4 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _080FC468 - movs r3, 0 - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _080FC468 - movs r3, 0x2 - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _080FC468 - mov r0, sp - adds r1, r6, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - ldr r0, [r7] - ldrb r0, [r0, 0x5] - strb r0, [r4, 0x4] - mov r0, r9 - adds r2, r5, r0 - ldr r0, [r7] - mov r3, r8 - lsls r1, r3, 3 - ldr r3, =0x00000848 - adds r0, r3 - adds r0, r1 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - movs r0, 0x64 - strb r0, [r4, 0x5] - mov r0, sp - ldrh r0, [r0] - strh r0, [r4] - ldrh r0, [r6] - strh r0, [r4, 0x2] - b _080FC472 - .pool -_080FC468: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9 - bls _080FC408 -_080FC472: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80FC3E8 - - thumb_func_start sub_80FC480 -sub_80FC480: @ 80FC480 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =gUnknown_0203A054 -_080FC486: - lsls r0, r4, 4 - adds r1, r0, r5 - ldrb r0, [r1, 0x5] - cmp r0, 0 - beq _080FC4A0 - subs r0, 0x1 - strb r0, [r1, 0x5] - lsls r0, 24 - cmp r0, 0 - bne _080FC4A0 - adds r0, r4, 0 - bl sub_80FC228 -_080FC4A0: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _080FC486 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC480 - - thumb_func_start sub_80FC4B4 -sub_80FC4B4: @ 80FC4B4 - push {lr} - bl sub_80FC258 - ldr r3, =gScriptResult - ldrh r1, [r3] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _080FC4EC - ldr r0, =gStringVar2 - ldr r2, =gUnknown_0203A054 - lsls r1, 4 - adds r1, r2 - ldrb r1, [r1, 0x5] - movs r2, 0x2 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - b _080FC4EE - .pool -_080FC4EC: - movs r0, 0 -_080FC4EE: - pop {r1} - bx r1 - thumb_func_end sub_80FC4B4 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/scrcmd.s b/asm/scrcmd.s index c2332e73c..ccfa0074a 100644 --- a/asm/scrcmd.s +++ b/asm/scrcmd.s @@ -20,7 +20,7 @@ s01_nop: @ 80992D0 thumb_func_start s02_end s02_end: @ 80992D4 push {lr} - bl script_stop + bl StopScript movs r0, 0 pop {r1} bx r1 @@ -30,10 +30,10 @@ s02_end: @ 80992D4 s24_execute_ASM_2: @ 80992E0 push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord adds r1, r0, 0 adds r0, r4, 0 - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r4} pop {r1} @@ -43,7 +43,7 @@ s24_execute_ASM_2: @ 80992E0 thumb_func_start s25_extended_cmd s25_extended_cmd: @ 80992F8 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 ldr r1, =gUnknown_081DBA64 lsrs r0, 14 @@ -60,14 +60,14 @@ s25_extended_cmd: @ 80992F8 s26_extended_cmd_setvar: @ 8099318 push {r4-r6,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl GetVarPointer adds r6, r0, 0 ldr r4, =gUnknown_081DBA64 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 14 adds r0, r4 @@ -84,7 +84,7 @@ s26_extended_cmd_setvar: @ 8099318 thumb_func_start s23_execute_ASM s23_execute_ASM: @ 809934C push {lr} - bl script_read_word + bl ScriptReadWord bl _call_via_r0 movs r0, 0 pop {r1} @@ -94,7 +94,7 @@ s23_execute_ASM: @ 809934C thumb_func_start s27_set_to_waitstate s27_set_to_waitstate: @ 809935C push {lr} - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 pop {r1} bx r1 @@ -104,10 +104,10 @@ s27_set_to_waitstate: @ 809935C s05_goto: @ 8099368 push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord adds r1, r0, 0 adds r0, r4, 0 - bl script_jump + bl ScriptJump movs r0, 0 pop {r4} pop {r1} @@ -117,7 +117,7 @@ s05_goto: @ 8099368 thumb_func_start s03_return s03_return: @ 8099380 push {lr} - bl script_return + bl ScriptReturn movs r0, 0 pop {r1} bx r1 @@ -127,10 +127,10 @@ s03_return: @ 8099380 s04_call: @ 809938C push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord adds r1, r0, 0 adds r0, r4, 0 - bl script_call + bl ScriptCall movs r0, 0 pop {r4} pop {r1} @@ -147,7 +147,7 @@ s06_if_jump: @ 80993A4 adds r0, 0x1 str r0, [r5, 0x8] adds r0, r5, 0 - bl script_read_word + bl ScriptReadWord adds r2, r0, 0 ldr r1, =gUnknown_085102C0 lsls r0, r4, 1 @@ -160,7 +160,7 @@ s06_if_jump: @ 80993A4 bne _080993D2 adds r0, r5, 0 adds r1, r2, 0 - bl script_jump + bl ScriptJump _080993D2: movs r0, 0 pop {r4,r5} @@ -178,7 +178,7 @@ s07_if_call: @ 80993E0 adds r0, 0x1 str r0, [r5, 0x8] adds r0, r5, 0 - bl script_read_word + bl ScriptReadWord adds r2, r0, 0 ldr r1, =gUnknown_085102C0 lsls r0, r4, 1 @@ -191,7 +191,7 @@ s07_if_call: @ 80993E0 bne _0809940E adds r0, r5, 0 adds r1, r2, 0 - bl script_call + bl ScriptCall _0809940E: movs r0, 0 pop {r4,r5} @@ -206,7 +206,7 @@ sB8_set_virtual_address: @ 809941C push {r4,lr} ldr r4, [r0, 0x8] subs r4, 0x1 - bl script_read_word + bl ScriptReadWord ldr r1, =gUnknown_020375C4 subs r0, r4 str r0, [r1] @@ -222,13 +222,13 @@ sB8_set_virtual_address: @ 809941C sB9_virtual_jump: @ 8099438 push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord adds r1, r0, 0 ldr r0, =gUnknown_020375C4 ldr r0, [r0] subs r1, r0 adds r0, r4, 0 - bl script_jump + bl ScriptJump movs r0, 0 pop {r4} pop {r1} @@ -240,13 +240,13 @@ sB9_virtual_jump: @ 8099438 sBA_virtual_call: @ 809945C push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord adds r1, r0, 0 ldr r0, =gUnknown_020375C4 ldr r0, [r0] subs r1, r0 adds r0, r4, 0 - bl script_call + bl ScriptCall movs r0, 0 pop {r4} pop {r1} @@ -263,7 +263,7 @@ sBB_virtual_if_jump: @ 8099480 adds r0, 0x1 str r0, [r5, 0x8] adds r0, r5, 0 - bl script_read_word + bl ScriptReadWord ldr r1, =gUnknown_020375C4 ldr r1, [r1] subs r2, r0, r1 @@ -278,7 +278,7 @@ sBB_virtual_if_jump: @ 8099480 bne _080994B2 adds r0, r5, 0 adds r1, r2, 0 - bl script_jump + bl ScriptJump _080994B2: movs r0, 0 pop {r4,r5} @@ -296,7 +296,7 @@ sBC_virtual_if_call: @ 80994C4 adds r0, 0x1 str r0, [r5, 0x8] adds r0, r5, 0 - bl script_read_word + bl ScriptReadWord ldr r1, =gUnknown_020375C4 ldr r1, [r1] subs r2, r0, r1 @@ -311,7 +311,7 @@ sBC_virtual_if_call: @ 80994C4 bne _080994F6 adds r0, r5, 0 adds r1, r2, 0 - bl script_call + bl ScriptCall _080994F6: movs r0, 0 pop {r4,r5} @@ -336,7 +336,7 @@ s08_jumpstd: @ 8099508 bcs _08099528 ldr r1, [r1] adds r0, r2, 0 - bl script_jump + bl ScriptJump _08099528: movs r0, 0 pop {r1} @@ -360,7 +360,7 @@ s09_callstd: @ 8099538 bcs _08099558 ldr r1, [r1] adds r0, r2, 0 - bl script_call + bl ScriptCall _08099558: movs r0, 0 pop {r1} @@ -396,7 +396,7 @@ s0A_jumpstd_if: @ 8099568 bcs _080995A0 ldr r1, [r1] adds r0, r3, 0 - bl script_jump + bl ScriptJump _080995A0: movs r0, 0 pop {r4} @@ -433,7 +433,7 @@ s0B_callstd_if: @ 80995B4 bcs _080995EC ldr r1, [r1] adds r0, r3, 0 - bl script_call + bl ScriptCall _080995EC: movs r0, 0 pop {r4} @@ -447,7 +447,7 @@ s0C_restore_execution_after_sCF: @ 8099600 push {lr} ldr r1, =gUnknown_020375C0 ldr r1, [r1] - bl script_jump + bl ScriptJump movs r0, 0 pop {r1} bx r1 @@ -458,9 +458,9 @@ s0C_restore_execution_after_sCF: @ 8099600 s0D_endscript_killram: @ 8099614 push {r4,lr} adds r4, r0, 0 - bl killram + bl ClearRamScript adds r0, r4, 0 - bl script_stop + bl StopScript movs r0, 0x1 pop {r4} pop {r1} @@ -491,7 +491,7 @@ s0F_u32_var_to_const: @ 8099644 adds r0, 0x1 str r0, [r4, 0x8] adds r0, r4, 0 - bl script_read_word + bl ScriptReadWord lsls r5, 2 adds r4, 0x64 adds r4, r5 @@ -512,7 +512,7 @@ s12_u32_var_to_ptr: @ 8099668 adds r0, 0x1 str r0, [r4, 0x8] adds r0, r4, 0 - bl script_read_word + bl ScriptReadWord lsls r5, 2 adds r4, 0x64 adds r4, r5 @@ -532,7 +532,7 @@ s11_u8_ptr_to_const: @ 809968C ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_word + bl ScriptReadWord strb r4, [r0] movs r0, 0 pop {r4} @@ -569,7 +569,7 @@ s13_u8_var_to_ptr: @ 80996C0 adds r0, 0x1 str r0, [r4, 0x8] adds r0, r4, 0 - bl script_read_word + bl ScriptReadWord lsls r5, 2 adds r4, 0x64 adds r4, r5 @@ -605,10 +605,10 @@ s14_u32_var_to_var: @ 80996E4 s15_u8_ptr_to_ptr: @ 8099704 push {r4,r5,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord adds r5, r0, 0 adds r0, r4, 0 - bl script_read_word + bl ScriptReadWord ldrb r0, [r0] strb r0, [r5] movs r0, 0 @@ -621,13 +621,13 @@ s15_u8_ptr_to_ptr: @ 8099704 s16_u16_gvar_to_const: @ 8099720 push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl GetVarPointer adds r4, r0, 0 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword strh r0, [r4] movs r0, 0 pop {r4,r5} @@ -639,13 +639,13 @@ s16_u16_gvar_to_const: @ 8099720 s19_u16_gvar_gvar: @ 8099744 push {r4,r5,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl GetVarPointer adds r5, r0, 0 adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl GetVarPointer @@ -661,13 +661,13 @@ s19_u16_gvar_gvar: @ 8099744 s1A_u16_gvar_gvar: @ 8099770 push {r4,r5,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl GetVarPointer adds r5, r0, 0 adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -764,7 +764,7 @@ s1D_cmp_u8_var_ptr: @ 8099814 adds r2, 0x1 str r2, [r4, 0x8] adds r0, r4, 0 - bl script_read_word + bl ScriptReadWord ldrb r1, [r0] adds r0, r5, 0 bl compare_012 @@ -779,7 +779,7 @@ s1D_cmp_u8_var_ptr: @ 8099814 s1E_cmp_u8_ptr_var: @ 8099840 push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord ldrb r0, [r0] ldr r3, [r4, 0x8] ldrb r2, [r3] @@ -802,7 +802,7 @@ s1E_cmp_u8_ptr_var: @ 8099840 s1F_cmp_u8_ptr_const: @ 809986C push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord ldrb r0, [r0] ldr r2, [r4, 0x8] ldrb r1, [r2] @@ -820,10 +820,10 @@ s1F_cmp_u8_ptr_const: @ 809986C s20_cmp_u8_ptr_ptr: @ 809988C push {r4,r5,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord ldrb r5, [r0] adds r0, r4, 0 - bl script_read_word + bl ScriptReadWord ldrb r1, [r0] adds r0, r5, 0 bl compare_012 @@ -838,13 +838,13 @@ s20_cmp_u8_ptr_ptr: @ 809988C s21_cmp_u16_gvar_const: @ 80998B0 push {r4,r5,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl GetVarPointer ldrh r5, [r0] adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -861,13 +861,13 @@ s21_cmp_u16_gvar_const: @ 80998B0 s22_cmp_u16_gvar_gvar: @ 80998E0 push {r4,r5,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl GetVarPointer adds r5, r0, 0 adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl GetVarPointer @@ -886,13 +886,13 @@ s22_cmp_u16_gvar_gvar: @ 80998E0 s17_u16_gvar_add_const: @ 8099914 push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl GetVarPointer adds r4, r0, 0 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword ldrh r1, [r4] adds r0, r1 strh r0, [r4] @@ -906,13 +906,13 @@ s17_u16_gvar_add_const: @ 8099914 sub_809993C: @ 809993C push {r4,r5,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl GetVarPointer adds r5, r0, 0 adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -928,7 +928,7 @@ sub_809993C: @ 809993C thumb_func_start s8F_get_random_val s8F_get_random_val: @ 809996C push {r4,r5,lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -953,7 +953,7 @@ s8F_get_random_val: @ 809996C sub_80999A0: @ 80999A0 push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -961,7 +961,7 @@ sub_80999A0: @ 80999A0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -985,7 +985,7 @@ sub_80999A0: @ 80999A0 sub_80999E4: @ 80999E4 push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -993,7 +993,7 @@ sub_80999E4: @ 80999E4 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1017,7 +1017,7 @@ sub_80999E4: @ 80999E4 sub_8099A28: @ 8099A28 push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1025,7 +1025,7 @@ sub_8099A28: @ 8099A28 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1049,7 +1049,7 @@ sub_8099A28: @ 8099A28 sub_8099A6C: @ 8099A6C push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1057,7 +1057,7 @@ sub_8099A6C: @ 8099A6C lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1080,7 +1080,7 @@ sub_8099A6C: @ 8099A6C thumb_func_start s48_get_item_type s48_get_item_type: @ 8099AB0 push {r4,lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1102,7 +1102,7 @@ s48_get_item_type: @ 8099AB0 sub_8099ADC: @ 8099ADC push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1110,7 +1110,7 @@ sub_8099ADC: @ 8099ADC lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1134,7 +1134,7 @@ sub_8099ADC: @ 8099ADC sub_8099B20: @ 8099B20 push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1142,7 +1142,7 @@ sub_8099B20: @ 8099B20 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1165,14 +1165,14 @@ sub_8099B20: @ 8099B20 thumb_func_start sub_8099B64 sub_8099B64: @ 8099B64 push {r4,lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet ldr r4, =gScriptResult lsls r0, 24 lsrs r0, 24 - bl IsThereStorageSpaceForDecoration + bl DecorationAdd lsls r0, 24 lsrs r0, 24 strh r0, [r4] @@ -1186,14 +1186,14 @@ sub_8099B64: @ 8099B64 thumb_func_start sub_8099B90 sub_8099B90: @ 8099B90 push {r4,lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet ldr r4, =gScriptResult lsls r0, 24 lsrs r0, 24 - bl sub_81619DC + bl DecorationRemove lsls r0, 24 asrs r0, 24 strh r0, [r4] @@ -1207,14 +1207,14 @@ sub_8099B90: @ 8099B90 thumb_func_start sub_8099BBC sub_8099BBC: @ 8099BBC push {r4,lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet ldr r4, =gScriptResult lsls r0, 24 lsrs r0, 24 - bl sub_81619A8 + bl DecorationCheckSpace lsls r0, 24 lsrs r0, 24 strh r0, [r4] @@ -1228,7 +1228,7 @@ sub_8099BBC: @ 8099BBC thumb_func_start sub_8099BE8 sub_8099BE8: @ 8099BE8 push {r4,lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1250,7 +1250,7 @@ sub_8099BE8: @ 8099BE8 @ int s29_flag_set(script_env *env) s29_flag_set: @ 8099C14 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl FlagSet @@ -1263,7 +1263,7 @@ s29_flag_set: @ 8099C14 @ int s2A_flag_clear(script_env *env) s2A_flag_clear: @ 8099C28 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl FlagReset @@ -1277,7 +1277,7 @@ s2A_flag_clear: @ 8099C28 s2B_flag_check: @ 8099C3C push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl FlagGet @@ -1313,7 +1313,7 @@ s9A_unknown: @ 8099C70 str r1, [r0, 0x8] adds r0, r2, 0 bl sub_80B009C - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 pop {r1} bx r1 @@ -1323,7 +1323,7 @@ s9A_unknown: @ 8099C70 @ int s99_unknown(script_env *env) s99_unknown: @ 8099C8C push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1367,7 +1367,7 @@ s97_screen_special_effect: @ 8099CC8 bl fade_screen ldr r1, =sub_8099CA8 adds r0, r4, 0 - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r4} pop {r1} @@ -1392,7 +1392,7 @@ s98_refade_with_timer: @ 8099CF0 bl fade_screen ldr r1, =sub_8099CA8 adds r0, r4, 0 - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r4} pop {r1} @@ -1421,7 +1421,7 @@ _08099D3A: beq _08099D60 _08099D3E: ldr r0, =gPlttBufferUnfaded - ldr r1, =sPaletteDecompressionBuffer + ldr r1, =gPaletteDecompressionBuffer ldr r2, =0x04000100 bl CpuSet adds r0, r4, 0 @@ -1430,7 +1430,7 @@ _08099D3E: b _08099D72 .pool _08099D60: - ldr r0, =sPaletteDecompressionBuffer + ldr r0, =gPaletteDecompressionBuffer ldr r1, =gPlttBufferUnfaded ldr r2, =0x04000100 bl CpuSet @@ -1440,7 +1440,7 @@ _08099D60: _08099D72: ldr r1, =sub_8099CA8 adds r0, r5, 0 - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r4,r5} pop {r1} @@ -1473,12 +1473,12 @@ _08099DAE: s28_pause: @ 8099DB4 push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword ldr r1, =gUnknown_020375C8 strh r0, [r1] ldr r1, =s28_pause_asm adds r0, r4, 0 - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r4} pop {r1} @@ -1491,7 +1491,7 @@ s28_pause: @ 8099DB4 s2C_unknown: @ 8099DD8 push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1499,7 +1499,7 @@ s2C_unknown: @ 8099DD8 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1552,7 +1552,7 @@ s2E_unknown: @ 8099E1C @ int sA4_set_weather_data(script_env *env) sA4_set_weather_data: @ 8099E54 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1603,7 +1603,7 @@ sA6_activate_per_step_callback_eg_ash: @ 8099E88 @ int sA7_set_new_map_footer(script_env *env) sA7_set_new_map_footer: @ 8099EA0 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1637,7 +1637,7 @@ s39_warp_sfx: @ 8099EBC adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1645,7 +1645,7 @@ s39_warp_sfx: @ 8099EBC lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1702,7 +1702,7 @@ s3A_warp_new_music: @ 8099F44 adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1710,7 +1710,7 @@ s3A_warp_new_music: @ 8099F44 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1767,7 +1767,7 @@ s3B_warp_keep_music: @ 8099FCC adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1775,7 +1775,7 @@ s3B_warp_keep_music: @ 8099FCC lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1890,7 +1890,7 @@ s3D_warp_v4: @ 809A0C8 adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1898,7 +1898,7 @@ s3D_warp_v4: @ 809A0C8 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1954,7 +1954,7 @@ sub_809A150: @ 809A150 adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -1962,7 +1962,7 @@ sub_809A150: @ 809A150 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2018,7 +2018,7 @@ s3E_set_new_map: @ 809A1D8 adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2026,7 +2026,7 @@ s3E_set_new_map: @ 809A1D8 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2080,7 +2080,7 @@ s3F_set_new_map_DMA: @ 809A258 adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2088,7 +2088,7 @@ s3F_set_new_map_DMA: @ 809A258 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2144,7 +2144,7 @@ sub_809A2DC: @ 809A2DC adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2152,7 +2152,7 @@ sub_809A2DC: @ 809A2DC lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2206,7 +2206,7 @@ sub_809A35C: @ 809A35C adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2214,7 +2214,7 @@ sub_809A35C: @ 809A35C lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2268,7 +2268,7 @@ sC4_unknown: @ 809A3DC adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2276,7 +2276,7 @@ sC4_unknown: @ 809A3DC lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2314,13 +2314,13 @@ sC4_unknown: @ 809A3DC s42_get_map_camera_pos: @ 809A45C push {r4,r5,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl GetVarPointer adds r5, r0, 0 adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl GetVarPointer @@ -2342,7 +2342,7 @@ s42_get_map_camera_pos: @ 809A45C s43_get_player_party_count: @ 809A498 push {r4,lr} ldr r4, =gScriptResult - bl calc_player_party_count + bl CalculatePlayerPartyCount lsls r0, 24 lsrs r0, 24 strh r0, [r4] @@ -2356,7 +2356,7 @@ s43_get_player_party_count: @ 809A498 thumb_func_start s2F_music_play s2F_music_play: @ 809A4B4 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl PlaySE @@ -2385,7 +2385,7 @@ _0809A4DA: s30_music_check: @ 809A4E0 push {lr} ldr r1, =s30_music_check_asm - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r1} bx r1 @@ -2395,7 +2395,7 @@ s30_music_check: @ 809A4E0 thumb_func_start s31_PlayFanfare s31_PlayFanfare: @ 809A4F4 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl PlayFanfare @@ -2418,7 +2418,7 @@ s32_fanfare_wait_asm: @ 809A508 s32_fanfare_wait: @ 809A518 push {lr} ldr r1, =s32_fanfare_wait_asm - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r1} bx r1 @@ -2430,7 +2430,7 @@ s32_fanfare_wait: @ 809A518 s33_play_music: @ 809A52C push {r4,r5,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r2, r0, 16 adds r5, r2, 0 @@ -2454,7 +2454,7 @@ _0809A54C: thumb_func_start s34_unknown s34_unknown: @ 809A55C push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl sav1_set_battle_music_maybe @@ -2475,7 +2475,7 @@ s35_fade_to_default: @ 809A570 thumb_func_start s36_fade_to_music s36_fade_to_music: @ 809A57C push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl sub_80858C4 @@ -2504,7 +2504,7 @@ _0809A5AA: _0809A5B0: ldr r1, =IsBGMPausedOrStopped adds r0, r4, 0 - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r4} pop {r1} @@ -2538,7 +2538,7 @@ _0809A5E2: s4F_execute_movement: @ 809A5E8 push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2546,7 +2546,7 @@ s4F_execute_movement: @ 809A5E8 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_word + bl ScriptReadWord adds r3, r0, 0 lsls r0, r4, 24 lsrs r0, 24 @@ -2568,7 +2568,7 @@ s4F_execute_movement: @ 809A5E8 s50_execute_movement_remote: @ 809A62C push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2576,7 +2576,7 @@ s50_execute_movement_remote: @ 809A62C lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_word + bl ScriptReadWord adds r3, r0, 0 ldr r0, [r5, 0x8] ldrb r2, [r0] @@ -2618,7 +2618,7 @@ s51a_0806B288: @ 809A670 s51_waitmove: @ 809A698 push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2641,7 +2641,7 @@ _0809A6B4: strh r0, [r1] ldr r1, =s51a_0806B288 adds r0, r4, 0 - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r4} pop {r1} @@ -2653,7 +2653,7 @@ _0809A6B4: s52_waitmove_remote: @ 809A6EC push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2677,7 +2677,7 @@ _0809A708: strh r1, [r0] ldr r1, =s51a_0806B288 adds r0, r4, 0 - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r4} pop {r1} @@ -2688,7 +2688,7 @@ _0809A708: thumb_func_start s53_hide_sprite s53_hide_sprite: @ 809A740 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2709,7 +2709,7 @@ s53_hide_sprite: @ 809A740 s54_hide_sprite_set_coords: @ 809A768 push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2732,7 +2732,7 @@ s54_hide_sprite_set_coords: @ 809A768 thumb_func_start s55_show_sprite s55_show_sprite: @ 809A798 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2753,7 +2753,7 @@ s55_show_sprite: @ 809A798 s56_show_sprite_set_coords: @ 809A7C0 push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2778,7 +2778,7 @@ s57_move_sprites: @ 809A7F0 push {r4-r6,lr} sub sp, 0x4 adds r6, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2786,7 +2786,7 @@ s57_move_sprites: @ 809A7F0 lsls r5, 16 lsrs r5, 16 adds r0, r6, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2794,7 +2794,7 @@ s57_move_sprites: @ 809A7F0 lsls r4, 16 lsrs r4, 16 adds r0, r6, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2824,7 +2824,7 @@ s57_move_sprites: @ 809A7F0 s63_new_sprite_location_permanent: @ 809A858 push {r4-r6,lr} adds r6, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2832,7 +2832,7 @@ s63_new_sprite_location_permanent: @ 809A858 lsls r5, 16 lsrs r5, 16 adds r0, r6, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2840,7 +2840,7 @@ s63_new_sprite_location_permanent: @ 809A858 lsls r4, 16 lsrs r4, 16 adds r0, r6, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2863,7 +2863,7 @@ s63_new_sprite_location_permanent: @ 809A858 thumb_func_start s64_set_sprite_top_left_corner s64_set_sprite_top_left_corner: @ 809A8B0 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2884,7 +2884,7 @@ s64_set_sprite_top_left_corner: @ 809A8B0 s58_npc_f1_clear_x20: @ 809A8D8 push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2909,7 +2909,7 @@ s58_npc_f1_clear_x20: @ 809A8D8 s59_npc_f1_set_x20: @ 809A908 push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2934,7 +2934,7 @@ s59_npc_f1_set_x20: @ 809A908 sA8_unknown: @ 809A938 push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -2964,7 +2964,7 @@ sA8_unknown: @ 809A938 sA9_unknown: @ 809A974 push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -3016,7 +3016,7 @@ _0809A9CC: s5B_npc_set_direction: @ 809A9DC push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -3042,7 +3042,7 @@ s5B_npc_set_direction: @ 809A9DC s65_set_sprite_behaviour: @ 809AA10 push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -3075,7 +3075,7 @@ sAA_create_new_sprite: @ 809AA38 adds r0, 0x1 str r0, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -3083,7 +3083,7 @@ sAA_create_new_sprite: @ 809AA38 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -3141,7 +3141,7 @@ sub_809AAC4: @ 809AAC4 bl sub_80983E8 ldr r1, =sub_80983C4 adds r0, r4, 0 - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 b _0809AAE6 .pool @@ -3177,14 +3177,14 @@ _0809AAFC: bl sub_80984A0 ldr r1, =sub_809847C adds r0, r4, 0 - bl script_setup_asm_script + bl SetupNativeScript b _0809AB38 .pool _0809AB2C: bl sub_80983E8 ldr r1, =sub_80983C4 adds r0, r4, 0 - bl script_setup_asm_script + bl SetupNativeScript _0809AB38: movs r0, 0x1 _0809AB3A: @@ -3262,7 +3262,7 @@ _0809AB9E: s67_execute_box: @ 809ABD4 push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord cmp r0, 0 bne _0809ABE2 ldr r0, [r4, 0x64] @@ -3278,7 +3278,7 @@ _0809ABE2: sub_809ABF0: @ 809ABF0 push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord cmp r0, 0 bne _0809ABFE ldr r0, [r4, 0x64] @@ -3294,7 +3294,7 @@ _0809ABFE: s9B_unknown: @ 809AC0C push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord adds r3, r0, 0 cmp r3, 0 bne _0809AC1C @@ -3321,7 +3321,7 @@ sub_809AC3C: @ 809AC3C push {r4,r5,lr} sub sp, 0xC adds r5, r0, 0 - bl script_read_word + bl ScriptReadWord adds r4, r0, 0 cmp r4, 0 bne _0809AC4E @@ -3339,7 +3339,7 @@ _0809AC4E: movs r1, 0x1 adds r2, r4, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 add sp, 0xC pop {r4,r5} @@ -3351,7 +3351,7 @@ _0809AC4E: sub_809AC78: @ 809AC78 push {lr} ldr r1, =sub_809833C - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r1} bx r1 @@ -3394,7 +3394,7 @@ _0809ACBA: sub_809ACC0: @ 809ACC0 push {lr} ldr r1, =sub_809AC98 - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r1} bx r1 @@ -3420,7 +3420,7 @@ s6E_yes_no: @ 809ACD4 movs r0, 0 b _0809ACFC _0809ACF6: - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 _0809ACFC: pop {r1} @@ -3452,7 +3452,7 @@ s6F_multichoice: @ 809AD00 movs r0, 0 b _0809AD34 _0809AD2E: - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 _0809AD34: pop {r4,r5} @@ -3493,7 +3493,7 @@ sub_809AD3C: @ 809AD3C movs r0, 0 b _0809AD80 _0809AD7A: - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 _0809AD80: add sp, 0x4 @@ -3543,7 +3543,7 @@ sub_809AD90: @ 809AD90 movs r0, 0 b _0809ADD4 _0809ADCE: - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 _0809ADD4: add sp, 0x4 @@ -3576,7 +3576,7 @@ sub_809ADEC: @ 809ADEC sub_809ADF8: @ 809ADF8 push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -3605,7 +3605,7 @@ s76_close_picture_box: @ 809AE28 cmp r1, 0 beq _0809AE40 adds r0, r4, 0 - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 b _0809AE42 _0809AE40: @@ -3629,7 +3629,7 @@ sub_809AE48: @ 809AE48 bl sub_812FDA8 _0809AE5C: bl sub_80F8ADC - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 pop {r1} bx r1 @@ -3641,7 +3641,7 @@ sub_809AE6C: @ 809AE6C mov r7, r8 push {r7} sub sp, 0x20 - bl script_read_word + bl ScriptReadWord adds r1, r0, 0 ldr r4, =gStringVar4 adds r1, 0x6 @@ -3763,7 +3763,7 @@ _0809AEC6: str r1, [sp, 0x8] movs r1, 0x6 adds r3, r6, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r5] movs r1, 0x3 bl CopyWindowToVram @@ -3789,7 +3789,7 @@ sub_809AF94: @ 809AF94 thumb_func_start sBD_virtual_message sBD_virtual_message: @ 809AFA0 push {lr} - bl script_read_word + bl ScriptReadWord ldr r1, =gUnknown_020375C4 ldr r1, [r1] subs r0, r1 @@ -3807,7 +3807,7 @@ s7D_load_pokename: @ 809AFBC ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -3871,7 +3871,7 @@ s7F_load_pokename_team: @ 809B048 ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -3904,7 +3904,7 @@ s80_load_item_name: @ 809B090 ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -3931,7 +3931,7 @@ sub_809B0C4: @ 809B0C4 adds r0, 0x1 str r0, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -3939,7 +3939,7 @@ sub_809B0C4: @ 809B0C4 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -3966,7 +3966,7 @@ sub_809B114: @ 809B114 ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -3994,7 +3994,7 @@ s82_load_item_name: @ 809B150 ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4024,7 +4024,7 @@ s83_load_textvar_var: @ 809B190 ldrb r5, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4057,7 +4057,7 @@ s84_load_textvar_std_expression: @ 809B1D4 ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4086,7 +4086,7 @@ sub_809B214: @ 809B214 ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4112,7 +4112,7 @@ s85_load_textvar_pointer: @ 809B248 ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_word + bl ScriptReadWord adds r1, r0, 0 ldr r0, =gUnknown_085102D4 lsls r4, 2 @@ -4129,7 +4129,7 @@ s85_load_textvar_pointer: @ 809B248 thumb_func_start sBE_virtual_load_text sBE_virtual_load_text: @ 809B270 push {lr} - bl script_read_word + bl ScriptReadWord adds r1, r0, 0 ldr r0, =gUnknown_020375C4 ldr r0, [r0] @@ -4149,7 +4149,7 @@ sBF_virtual_load_textbuffer: @ 809B294 ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_word + bl ScriptReadWord adds r1, r0, 0 ldr r0, =gUnknown_020375C4 ldr r0, [r0] @@ -4173,7 +4173,7 @@ sC6_load_textvar_box_label: @ 809B2C8 ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4202,7 +4202,7 @@ s79_give_pokemon: @ 809B304 push {r5,r6} sub sp, 0x8 adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4215,7 +4215,7 @@ s79_give_pokemon: @ 809B304 adds r0, 0x1 str r0, [r4, 0x8] adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4223,10 +4223,10 @@ s79_give_pokemon: @ 809B304 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 - bl script_read_word + bl ScriptReadWord mov r8, r0 adds r0, r4, 0 - bl script_read_word + bl ScriptReadWord ldr r1, [r4, 0x8] ldrb r2, [r1] adds r1, 0x1 @@ -4256,7 +4256,7 @@ s79_give_pokemon: @ 809B304 thumb_func_start s7A_create_egg s7A_create_egg: @ 809B384 push {r4,lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4284,7 +4284,7 @@ s7B_change_pokedata_AP: @ 809B3B0 ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -4300,7 +4300,7 @@ s7B_change_pokedata_AP: @ 809B3B0 thumb_func_start sub_809B3DC sub_809B3DC: @ 809B3DC push {r4-r7,lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r7, r0, 16 ldr r1, =gScriptResult @@ -4356,12 +4356,12 @@ _0809B44A: .pool thumb_func_end sub_809B3DC - thumb_func_start s90_add_money -@ int s90_add_money(script_env *env) -s90_add_money: @ 809B458 + thumb_func_start s90_AddMoney +@ int s90_AddMoney(script_env *env) +s90_AddMoney: @ 809B458 push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord adds r2, r0, 0 ldr r0, [r4, 0x8] ldrb r1, [r0] @@ -4375,21 +4375,21 @@ s90_add_money: @ 809B458 lsls r1, 3 adds r0, r1 adds r1, r2, 0 - bl add_money + bl AddMoney _0809B47E: movs r0, 0 pop {r4} pop {r1} bx r1 .pool - thumb_func_end s90_add_money + thumb_func_end s90_AddMoney - thumb_func_start s91_subtract_money -@ int s91_subtract_money(script_env *env) -s91_subtract_money: @ 809B48C + thumb_func_start s91_SubtractMoney +@ int s91_SubtractMoney(script_env *env) +s91_SubtractMoney: @ 809B48C push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord adds r2, r0, 0 ldr r0, [r4, 0x8] ldrb r1, [r0] @@ -4403,21 +4403,21 @@ s91_subtract_money: @ 809B48C lsls r1, 3 adds r0, r1 adds r1, r2, 0 - bl subtract_money + bl SubtractMoney _0809B4B2: movs r0, 0 pop {r4} pop {r1} bx r1 .pool - thumb_func_end s91_subtract_money + thumb_func_end s91_SubtractMoney thumb_func_start s92_check_money @ int s92_check_money(script_env *env) s92_check_money: @ 809B4C0 push {r4,lr} adds r4, r0, 0 - bl script_read_word + bl ScriptReadWord adds r2, r0, 0 ldr r0, [r4, 0x8] ldrb r1, [r0] @@ -4465,7 +4465,7 @@ s93_display_money: @ 809B500 movs r1, 0x92 lsls r1, 3 adds r0, r1 - bl DecryptMoney + bl GetMoney adds r1, r5, 0 adds r2, r4, 0 bl sub_80E52EC @@ -4504,7 +4504,7 @@ s95_update_money: @ 809B548 movs r1, 0x92 lsls r1, 3 adds r0, r1 - bl DecryptMoney + bl GetMoney bl sub_80E52D4 _0809B56E: movs r0, 0 @@ -4613,7 +4613,7 @@ sub_809B604: @ 809B604 s60_check_trainer_flag: @ 809B618 push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4630,7 +4630,7 @@ s60_check_trainer_flag: @ 809B618 thumb_func_start s61_set_trainer_flag s61_set_trainer_flag: @ 809B63C push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4645,7 +4645,7 @@ s61_set_trainer_flag: @ 809B63C thumb_func_start s62_unset_trainer_flag s62_unset_trainer_flag: @ 809B658 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4661,7 +4661,7 @@ s62_unset_trainer_flag: @ 809B658 sB6_load_battle: @ 809B674 push {r4-r6,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 @@ -4670,7 +4670,7 @@ sB6_load_battle: @ 809B674 adds r0, 0x1 str r0, [r4, 0x8] adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword adds r2, r0, 0 lsls r2, 16 lsrs r2, 16 @@ -4687,7 +4687,7 @@ sB6_load_battle: @ 809B674 sub_809B6A8: @ 809B6A8 push {lr} bl sub_80B08A8 - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 pop {r1} bx r1 @@ -4696,9 +4696,9 @@ sub_809B6A8: @ 809B6A8 thumb_func_start s86_pokemart s86_pokemart: @ 809B6B8 push {lr} - bl script_read_word + bl ScriptReadWord bl CreatePokemartMenu - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 pop {r1} bx r1 @@ -4707,9 +4707,9 @@ s86_pokemart: @ 809B6B8 thumb_func_start s87_pokemartdecor s87_pokemartdecor: @ 809B6CC push {lr} - bl script_read_word + bl ScriptReadWord bl CreateDecorationShop1Menu - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 pop {r1} bx r1 @@ -4718,9 +4718,9 @@ s87_pokemartdecor: @ 809B6CC thumb_func_start s88_pokemartbp s88_pokemartbp: @ 809B6E0 push {lr} - bl script_read_word + bl ScriptReadWord bl CreateDecorationShop2Menu - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 pop {r1} bx r1 @@ -4729,7 +4729,7 @@ s88_pokemartbp: @ 809B6E0 thumb_func_start s89_open_casino_game1 s89_open_casino_game1: @ 809B6F4 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4737,7 +4737,7 @@ s89_open_casino_game1: @ 809B6F4 lsrs r0, 24 ldr r1, =c2_exit_to_overworld_1_continue_scripts_restart_music bl sub_812A540 - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 pop {r1} bx r1 @@ -4782,7 +4782,7 @@ _0809B750: thumb_func_start sub_809B758 sub_809B758: @ 809B758 push {r4,lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4804,7 +4804,7 @@ sub_809B758: @ 809B758 sub_809B784: @ 809B784 push {lr} bl sub_81B9404 - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 pop {r1} bx r1 @@ -4814,7 +4814,7 @@ sub_809B784: @ 809B784 sub_809B794: @ 809B794 push {lr} bl sub_80F840C - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 pop {r1} bx r1 @@ -4824,7 +4824,7 @@ sub_809B794: @ 809B794 sub_809B7A4: @ 809B7A4 push {lr} bl sub_80F8484 - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 pop {r1} bx r1 @@ -4836,7 +4836,7 @@ sub_809B7B4: @ 809B7B4 ldr r0, =gUnknown_02039F2C ldrb r0, [r0] bl sub_80F84C4 - bl script_env_2_set_ctx_paused + bl ScriptContext1_Stop movs r0, 0x1 pop {r1} bx r1 @@ -4846,7 +4846,7 @@ sub_809B7B4: @ 809B7B4 thumb_func_start s9C_execute_HM s9C_execute_HM: @ 809B7CC push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4870,7 +4870,7 @@ s9D_set_HM_animation_data: @ 809B7F4 ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4910,7 +4910,7 @@ _0809B83E: s9E_checkarray_HM_animation: @ 809B844 push {r4,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4918,7 +4918,7 @@ s9E_checkarray_HM_animation: @ 809B844 strh r0, [r1] ldr r1, =sub_809B824 adds r0, r4, 0 - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r4} pop {r1} @@ -4929,7 +4929,7 @@ s9E_checkarray_HM_animation: @ 809B844 thumb_func_start s9F_changeposition_fly s9F_changeposition_fly: @ 809B870 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4957,7 +4957,7 @@ sA0_check_gender: @ 809B88C sA1_play_cry: @ 809B8A4 push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4965,7 +4965,7 @@ sA1_play_cry: @ 809B8A4 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -4984,7 +4984,7 @@ sA1_play_cry: @ 809B8A4 sub_809B8DC: @ 809B8DC push {lr} ldr r1, =IsCryFinished - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r1} bx r1 @@ -4995,28 +4995,28 @@ sub_809B8DC: @ 809B8DC sA2_setmaptile: @ 809B8F0 push {r4-r7,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet lsls r0, 16 lsrs r6, r0, 16 adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet lsls r0, 16 lsrs r7, r0, 16 adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5054,7 +5054,7 @@ _0809B966: sAC_open_door: @ 809B970 push {r4,r5,lr} adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5062,7 +5062,7 @@ sAC_open_door: @ 809B970 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5094,7 +5094,7 @@ sAC_open_door: @ 809B970 sub_809B9C8: @ 809B9C8 push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5102,7 +5102,7 @@ sub_809B9C8: @ 809B9C8 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5143,7 +5143,7 @@ _0809BA1E: sub_809BA24: @ 809BA24 push {lr} ldr r1, =sub_809BA0C - bl script_setup_asm_script + bl SetupNativeScript movs r0, 0x1 pop {r1} bx r1 @@ -5154,7 +5154,7 @@ sub_809BA24: @ 809BA24 sub_809BA38: @ 809BA38 push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5162,7 +5162,7 @@ sub_809BA38: @ 809BA38 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5187,7 +5187,7 @@ sub_809BA38: @ 809BA38 sub_809BA7C: @ 809BA7C push {r4,r5,lr} adds r5, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5195,7 +5195,7 @@ sub_809BA7C: @ 809BA7C lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5224,17 +5224,17 @@ sub_809BAC0: @ 809BAC0 adds r0, 0x1 str r0, [r4, 0x8] adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet adds r0, r4, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5253,7 +5253,7 @@ sub_809BAFC: @ 809BAFC thumb_func_start sB3_get_coin_amount sB3_get_coin_amount: @ 809BB00 push {r4,lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl GetVarPointer @@ -5269,7 +5269,7 @@ sB3_get_coin_amount: @ 809BB00 thumb_func_start sub_809BB20 sub_809BB20: @ 809BB20 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5298,7 +5298,7 @@ _0809BB4C: thumb_func_start sub_809BB58 sub_809BB58: @ 809BB58 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5327,7 +5327,7 @@ _0809BB84: thumb_func_start sub_809BB90 sub_809BB90: @ 809BB90 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5354,7 +5354,7 @@ sub_809BBB4: @ 809BBB4 thumb_func_start ScrCmd_MossdeepGymSwitch ScrCmd_MossdeepGymSwitch: @ 809BBC0 push {lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5411,7 +5411,7 @@ _0809BC0C: bl sub_8098630 ldr r1, =sub_8098734 adds r0, r4, 0 - bl script_setup_asm_script + bl SetupNativeScript _0809BC2E: movs r0, 0x1 _0809BC30: @@ -5428,7 +5428,7 @@ sCD_set_obedient_bit: @ 809BC44 movs r2, 0x1 mov r1, sp strb r2, [r1] - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5451,7 +5451,7 @@ sCD_set_obedient_bit: @ 809BC44 thumb_func_start sCE_check_obedient_bit sCE_check_obedient_bit: @ 809BC7C push {r4,lr} - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5486,7 +5486,7 @@ sCF_execute_RAM_script_DMA: @ 809BCB4 str r0, [r1] adds r0, r4, 0 adds r1, r2, 0 - bl script_jump + bl ScriptJump _0809BCD0: movs r0, 0 pop {r4} @@ -5516,7 +5516,7 @@ sD1_warp_v5: @ 809BCDC adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5524,7 +5524,7 @@ sD1_warp_v5: @ 809BCDC lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5568,7 +5568,7 @@ sub_809BD70: @ 809BD70 push {r4,lr} sub sp, 0x4 adds r4, r0, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5620,7 +5620,7 @@ sub_809BDD0: @ 809BDD0 ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5648,7 +5648,7 @@ sub_809BE0C: @ 809BE0C ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5698,7 +5698,7 @@ sub_809BE54: @ 809BE54 adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet @@ -5706,7 +5706,7 @@ sub_809BE54: @ 809BE54 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl script_read_halfword + bl ScriptReadHalfword lsls r0, 16 lsrs r0, 16 bl VarGet diff --git a/asm/script.s b/asm/script.s deleted file mode 100644 index b55b27eca..000000000 --- a/asm/script.s +++ /dev/null @@ -1,879 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start script_env_init -@ void script_env_init(script_env *env, int a2, int a3) -script_env_init: @ 8098CB8 - push {lr} - adds r3, r0, 0 - movs r0, 0 - strb r0, [r3, 0x1] - str r0, [r3, 0x8] - strb r0, [r3] - str r0, [r3, 0x4] - str r1, [r3, 0x5C] - str r2, [r3, 0x60] - movs r2, 0 - movs r1, 0x3 - adds r0, r3, 0 - adds r0, 0x70 -_08098CD2: - str r2, [r0] - subs r0, 0x4 - subs r1, 0x1 - cmp r1, 0 - bge _08098CD2 - adds r1, r3, 0 - adds r1, 0xC - movs r2, 0 - adds r0, r3, 0 - adds r0, 0x58 -_08098CE6: - str r2, [r0] - subs r0, 0x4 - cmp r0, r1 - bge _08098CE6 - pop {r0} - bx r0 - thumb_func_end script_env_init - - thumb_func_start script_setup_bytecode_script -@ int script_setup_bytecode_script(script_env *env, void *script_ptr) -script_setup_bytecode_script: @ 8098CF4 - str r1, [r0, 0x8] - movs r1, 0x1 - strb r1, [r0, 0x1] - movs r0, 0x1 - bx lr - thumb_func_end script_setup_bytecode_script - - thumb_func_start script_setup_asm_script -script_setup_asm_script: @ 8098D00 - movs r2, 0x2 - strb r2, [r0, 0x1] - str r1, [r0, 0x4] - bx lr - thumb_func_end script_setup_asm_script - - thumb_func_start script_stop -@ void script_stop(script_env *env) -script_stop: @ 8098D08 - movs r1, 0 - strb r1, [r0, 0x1] - str r1, [r0, 0x8] - bx lr - thumb_func_end script_stop - - thumb_func_start script_main_handler -@ int script_main_handler(script_env *env) -script_main_handler: @ 8098D10 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _08098D1E -_08098D1A: - movs r0, 0 - b _08098D90 -_08098D1E: - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - beq _08098D56 - cmp r0, 0x1 - bgt _08098D2E - cmp r0, 0 - beq _08098D1A - b _08098D8E -_08098D2E: - cmp r0, 0x2 - bne _08098D8E - ldr r0, [r4, 0x4] - cmp r0, 0 - beq _08098D52 - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08098D8E - strb r0, [r4, 0x1] - b _08098D8E -_08098D48: - strb r2, [r4, 0x1] - b _08098D1A -_08098D4C: - movs r0, 0 - strb r0, [r4, 0x1] - b _08098D90 -_08098D52: - movs r0, 0x1 - strb r0, [r4, 0x1] -_08098D56: - ldr r2, [r4, 0x8] - cmp r2, 0 - beq _08098D48 - ldr r0, =gUnknown_085102BC - ldr r0, [r0] - cmp r2, r0 - bne _08098D6C -_08098D64: - swi 0x2 - b _08098D64 - .pool -_08098D6C: - ldrb r1, [r2] - adds r0, r2, 0x1 - str r0, [r4, 0x8] - lsls r1, 2 - ldr r0, [r4, 0x5C] - adds r1, r0, r1 - ldr r0, [r4, 0x60] - cmp r1, r0 - bcs _08098D4C - ldr r1, [r1] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08098D56 -_08098D8E: - movs r0, 0x1 -_08098D90: - pop {r4} - pop {r1} - bx r1 - thumb_func_end script_main_handler - - thumb_func_start script_stack_push -@ int script_stack_push(script_env *env, int value) -script_stack_push: @ 8098D98 - push {lr} - adds r2, r0, 0 - adds r3, r1, 0 - ldrb r1, [r2] - adds r0, r1, 0x1 - cmp r0, 0x13 - bgt _08098DBA - lsls r0, r1, 2 - adds r1, r2, 0 - adds r1, 0xC - adds r1, r0 - str r3, [r1] - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - movs r0, 0 - b _08098DBC -_08098DBA: - movs r0, 0x1 -_08098DBC: - pop {r1} - bx r1 - thumb_func_end script_stack_push - - thumb_func_start script_stack_pop -@ int script_stack_pop(script_env *env) -script_stack_pop: @ 8098DC0 - push {lr} - adds r2, r0, 0 - ldrb r0, [r2] - cmp r0, 0 - beq _08098DDC - subs r0, 0x1 - strb r0, [r2] - ldrb r1, [r2] - lsls r1, 2 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1 - ldr r0, [r0] - b _08098DDE -_08098DDC: - movs r0, 0 -_08098DDE: - pop {r1} - bx r1 - thumb_func_end script_stack_pop - - thumb_func_start script_jump -@ void script_jump(script_env *env, int address) -script_jump: @ 8098DE4 - str r1, [r0, 0x8] - bx lr - thumb_func_end script_jump - - thumb_func_start script_call -@ void script_call(script_env *env, int address) -script_call: @ 8098DE8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, [r4, 0x8] - bl script_stack_push - str r5, [r4, 0x8] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end script_call - - thumb_func_start script_return -@ void script_return(script_env *env) -script_return: @ 8098DFC - push {r4,lr} - adds r4, r0, 0 - bl script_stack_pop - str r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - thumb_func_end script_return - - thumb_func_start script_read_halfword -@ int script_read_halfword(script_env *env) -script_read_halfword: @ 8098E0C - adds r3, r0, 0 - ldr r2, [r3, 0x8] - ldrb r0, [r2] - adds r2, 0x1 - str r2, [r3, 0x8] - ldrb r1, [r2] - lsls r1, 8 - orrs r0, r1 - adds r2, 0x1 - str r2, [r3, 0x8] - bx lr - thumb_func_end script_read_halfword - - thumb_func_start script_read_word -@ int script_read_word(script_env *env) -script_read_word: @ 8098E24 - push {r4-r6,lr} - adds r3, r0, 0 - ldr r0, [r3, 0x8] - ldrb r6, [r0] - adds r0, 0x1 - str r0, [r3, 0x8] - ldrb r5, [r0] - adds r2, r0, 0x1 - str r2, [r3, 0x8] - ldrb r4, [r0, 0x1] - adds r1, r2, 0x1 - str r1, [r3, 0x8] - ldrb r0, [r2, 0x1] - adds r1, 0x1 - str r1, [r3, 0x8] - lsls r0, 8 - adds r0, r4 - lsls r0, 8 - adds r0, r5 - lsls r0, 8 - adds r0, r6 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end script_read_word - - thumb_func_start script_env_2_enable -script_env_2_enable: @ 8098E54 - ldr r1, =gUnknown_03000F2C - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end script_env_2_enable - - thumb_func_start script_env_2_disable -@ void script_env_2_disable() -script_env_2_disable: @ 8098E60 - ldr r1, =gUnknown_03000F2C - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end script_env_2_disable - - thumb_func_start script_env_2_is_enabled -@ int script_env_2_is_enabled() -script_env_2_is_enabled: @ 8098E6C - ldr r0, =gUnknown_03000F2C - ldrb r0, [r0] - bx lr - .pool - thumb_func_end script_env_2_is_enabled - - thumb_func_start script_env_context_is_running -@ int script_env_context_is_running() -script_env_context_is_running: @ 8098E78 - push {lr} - ldr r0, =gUnknown_03000E38 - ldrb r0, [r0] - cmp r0, 0 - beq _08098E8C - movs r0, 0 - b _08098E8E - .pool -_08098E8C: - movs r0, 0x1 -_08098E8E: - pop {r1} - bx r1 - thumb_func_end script_env_context_is_running - - thumb_func_start script_env_1_init -script_env_1_init: @ 8098E94 - push {lr} - ldr r0, =gUnknown_03000E40 - ldr r1, =gEventScriptCommandFunctionTable - ldr r2, =gUnknown_081DBA08 - bl script_env_init - ldr r1, =gUnknown_03000E38 - movs r0, 0x2 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end script_env_1_init - - thumb_func_start script_env_2_run_current_script -script_env_2_run_current_script: @ 8098EBC - push {r4,lr} - ldr r4, =gUnknown_03000E38 - ldrb r0, [r4] - cmp r0, 0x2 - beq _08098EF0 - cmp r0, 0x1 - beq _08098EF0 - bl script_env_2_enable - ldr r0, =gUnknown_03000E40 - bl script_main_handler - lsls r0, 24 - cmp r0, 0 - beq _08098EE8 - movs r0, 0x1 - b _08098EF2 - .pool -_08098EE8: - movs r0, 0x2 - strb r0, [r4] - bl script_env_2_disable -_08098EF0: - movs r0, 0 -_08098EF2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end script_env_2_run_current_script - - thumb_func_start script_env_1_execute_new_script -script_env_1_execute_new_script: @ 8098EF8 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gUnknown_03000E40 - ldr r1, =gEventScriptCommandFunctionTable - ldr r2, =gUnknown_081DBA08 - adds r0, r4, 0 - bl script_env_init - adds r0, r4, 0 - adds r1, r5, 0 - bl script_setup_bytecode_script - bl script_env_2_enable - ldr r1, =gUnknown_03000E38 - movs r0, 0 - strb r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end script_env_1_execute_new_script - - thumb_func_start script_env_2_set_ctx_paused -script_env_2_set_ctx_paused: @ 8098F30 - ldr r1, =gUnknown_03000E38 - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end script_env_2_set_ctx_paused - - thumb_func_start script_env_2_enable_and_set_ctx_running -script_env_2_enable_and_set_ctx_running: @ 8098F3C - push {lr} - ldr r1, =gUnknown_03000E38 - movs r0, 0 - strb r0, [r1] - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end script_env_2_enable_and_set_ctx_running - - thumb_func_start ScriptContext2_RunNewScript -@ void ScriptContext2_RunNewScript(void *script_ptr) -ScriptContext2_RunNewScript: @ 8098F50 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gUnknown_03000EB8 - ldr r1, =gEventScriptCommandFunctionTable - ldr r2, =gUnknown_081DBA08 - adds r0, r4, 0 - bl script_env_init - adds r0, r4, 0 - adds r1, r5, 0 - bl script_setup_bytecode_script -_08098F68: - ldr r0, =gUnknown_03000EB8 - bl script_main_handler - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08098F68 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ScriptContext2_RunNewScript - - thumb_func_start mapheader_get_tagged_pointer -mapheader_get_tagged_pointer: @ 8098F88 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =gMapHeader - ldr r2, [r0, 0x8] - cmp r2, 0 - beq _08098F9C -_08098F96: - ldrb r0, [r2] - cmp r0, 0 - bne _08098FA4 -_08098F9C: - movs r0, 0 - b _08098FC2 - .pool -_08098FA4: - cmp r0, r1 - beq _08098FAC - adds r2, 0x5 - b _08098F96 -_08098FAC: - adds r2, 0x1 - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - ldrb r1, [r2, 0x2] - lsls r1, 16 - adds r0, r1 - ldrb r1, [r2, 0x3] - lsls r1, 24 - adds r0, r1 -_08098FC2: - pop {r1} - bx r1 - thumb_func_end mapheader_get_tagged_pointer - - thumb_func_start mapheader_run_script_by_tag -mapheader_run_script_by_tag: @ 8098FC8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl mapheader_get_tagged_pointer - cmp r0, 0 - beq _08098FDA - bl ScriptContext2_RunNewScript -_08098FDA: - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_by_tag - - thumb_func_start mapheader_get_first_match_from_tagged_ptr_list -@ int mapheader_get_first_match_from_tagged_ptr_list(int tag) -mapheader_get_first_match_from_tagged_ptr_list: @ 8098FE0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - bl mapheader_get_tagged_pointer - adds r6, r0, 0 - cmp r6, 0 - beq _08098FFC -_08098FF0: - ldrb r1, [r6] - ldrb r0, [r6, 0x1] - lsls r0, 8 - orrs r1, r0 - cmp r1, 0 - bne _08099000 -_08098FFC: - movs r0, 0 - b _0809903A -_08099000: - adds r6, 0x2 - ldrb r5, [r6] - ldrb r0, [r6, 0x1] - lsls r0, 8 - orrs r5, r0 - adds r6, 0x2 - adds r0, r1, 0 - bl VarGet - adds r4, r0, 0 - adds r0, r5, 0 - bl VarGet - lsls r4, 16 - lsls r0, 16 - cmp r4, r0 - beq _08099026 - adds r6, 0x4 - b _08098FF0 -_08099026: - ldrb r0, [r6] - ldrb r1, [r6, 0x1] - lsls r1, 8 - adds r0, r1 - ldrb r1, [r6, 0x2] - lsls r1, 16 - adds r0, r1 - ldrb r1, [r6, 0x3] - lsls r1, 24 - adds r0, r1 -_0809903A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end mapheader_get_first_match_from_tagged_ptr_list - - thumb_func_start mapheader_run_script_with_tag_x1 -mapheader_run_script_with_tag_x1: @ 8099040 - push {lr} - movs r0, 0x1 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x1 - - thumb_func_start mapheader_run_script_with_tag_x3 -mapheader_run_script_with_tag_x3: @ 809904C - push {lr} - movs r0, 0x3 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x3 - - thumb_func_start mapheader_run_script_with_tag_x5 -mapheader_run_script_with_tag_x5: @ 8099058 - push {lr} - movs r0, 0x5 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x5 - - thumb_func_start mapheader_run_script_with_tag_x7 -mapheader_run_script_with_tag_x7: @ 8099064 - push {lr} - movs r0, 0x7 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x7 - - thumb_func_start mapheader_run_script_with_tag_x6 -mapheader_run_script_with_tag_x6: @ 8099070 - push {lr} - movs r0, 0x6 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x6 - - thumb_func_start mapheader_run_first_tag2_script_list_match -@ int mapheader_run_first_tag2_script_list_match() -mapheader_run_first_tag2_script_list_match: @ 809907C - push {lr} - movs r0, 0x2 - bl mapheader_get_first_match_from_tagged_ptr_list - cmp r0, 0 - beq _08099090 - bl script_env_1_execute_new_script - movs r0, 0x1 - b _08099092 -_08099090: - movs r0, 0 -_08099092: - pop {r1} - bx r1 - thumb_func_end mapheader_run_first_tag2_script_list_match - - thumb_func_start mapheader_run_first_tag4_script_list_match -@ void mapheader_run_first_tag4_script_list_match() -mapheader_run_first_tag4_script_list_match: @ 8099098 - push {lr} - movs r0, 0x4 - bl mapheader_get_first_match_from_tagged_ptr_list - cmp r0, 0 - beq _080990A8 - bl ScriptContext2_RunNewScript -_080990A8: - pop {r0} - bx r0 - thumb_func_end mapheader_run_first_tag4_script_list_match - - thumb_func_start sub_80990AC -sub_80990AC: @ 80990AC - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x0000372c - adds r0, r1 - movs r1, 0xFA - lsls r1, 2 - bl CalcCRC16WithTable - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80990AC - - thumb_func_start killram -killram: @ 80990D0 - push {lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =0x00003728 - adds r1, r0 - ldr r2, =0x050000fb - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end killram - - thumb_func_start sub_80990FC -sub_80990FC: @ 80990FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - str r0, [sp] - ldr r0, [sp, 0x24] - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gSaveBlock1Ptr - mov r10, r0 - ldr r5, [r0] - ldr r1, =0x0000372c - adds r4, r5, r1 - bl killram - ldr r0, =0x000003e3 - cmp r8, r0 - bhi _08099174 - movs r0, 0x33 - strb r0, [r4] - mov r2, r9 - strb r2, [r4, 0x1] - strb r7, [r4, 0x2] - strb r6, [r4, 0x3] - ldr r1, =0x00003730 - adds r0, r5, r1 - ldr r1, [sp] - mov r2, r8 - bl memcpy - bl sub_80990AC - mov r2, r10 - ldr r1, [r2] - ldr r2, =0x00003728 - adds r1, r2 - str r0, [r1] - movs r0, 0x1 - b _08099176 - .pool -_08099174: - movs r0, 0 -_08099176: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80990FC - - thumb_func_start sub_8099188 -@ u32 sub_8099188(u8 a1, u32 script) -sub_8099188: @ 8099188 - push {r4-r7,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r6, =gSaveBlock1Ptr - ldr r5, [r6] - ldr r0, =0x0000372c - adds r2, r5, r0 - ldr r7, =gUnknown_020375C0 - movs r0, 0 - str r0, [r7] - ldrb r0, [r2] - cmp r0, 0x33 - bne _080991F0 - ldrb r1, [r2, 0x1] - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r1, r0 - bne _080991F0 - ldrb r1, [r2, 0x2] - movs r0, 0x5 - ldrsb r0, [r5, r0] - cmp r1, r0 - bne _080991F0 - ldrb r0, [r2, 0x3] - cmp r0, r3 - bne _080991F0 - bl sub_80990AC - ldr r1, [r6] - ldr r2, =0x00003728 - adds r1, r2 - ldr r1, [r1] - cmp r0, r1 - bne _080991EC - str r4, [r7] - ldr r1, =0x00003730 - adds r0, r5, r1 - b _080991F2 - .pool -_080991EC: - bl killram -_080991F0: - adds r0, r4, 0 -_080991F2: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8099188 - - thumb_func_start sub_80991F8 -sub_80991F8: @ 80991F8 - push {r4,lr} - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - ldr r2, =0x0000372c - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x33 - bne _0809923C - ldrb r0, [r1, 0x1] - cmp r0, 0xFF - bne _0809923C - ldrb r0, [r1, 0x2] - cmp r0, 0xFF - bne _0809923C - ldrb r0, [r1, 0x3] - cmp r0, 0xFF - bne _0809923C - bl sub_80990AC - ldr r1, [r4] - ldr r2, =0x00003728 - adds r1, r2 - ldr r1, [r1] - cmp r0, r1 - bne _0809923C - movs r0, 0x1 - b _0809923E - .pool -_0809923C: - movs r0, 0 -_0809923E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80991F8 - - thumb_func_start sub_8099244 -sub_8099244: @ 8099244 - push {r4-r6,lr} - ldr r6, =gSaveBlock1Ptr - ldr r5, [r6] - ldr r0, =0x0000372c - adds r4, r5, r0 - bl sub_801B27C - cmp r0, 0 - beq _08099298 - ldrb r0, [r4] - cmp r0, 0x33 - bne _08099298 - ldrb r0, [r4, 0x1] - cmp r0, 0xFF - bne _08099298 - ldrb r0, [r4, 0x2] - cmp r0, 0xFF - bne _08099298 - ldrb r0, [r4, 0x3] - cmp r0, 0xFF - bne _08099298 - bl sub_80990AC - ldr r1, [r6] - ldr r2, =0x00003728 - adds r1, r2 - ldr r1, [r1] - cmp r0, r1 - bne _08099294 - ldr r1, =0x00003730 - adds r0, r5, r1 - b _0809929A - .pool -_08099294: - bl killram -_08099298: - movs r0, 0 -_0809929A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8099244 - - thumb_func_start sub_80992A0 -sub_80992A0: @ 80992A0 - push {lr} - sub sp, 0x4 - adds r2, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x000003e3 - cmp r1, r0 - bls _080992B2 - adds r1, r0, 0 -_080992B2: - movs r0, 0xFF - str r0, [sp] - adds r0, r2, 0 - movs r2, 0xFF - movs r3, 0xFF - bl sub_80990FC - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80992A0 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/script_menu.s b/asm/script_menu.s index 0562b9aeb..6c5e6d2bd 100644 --- a/asm/script_menu.s +++ b/asm/script_menu.s @@ -371,7 +371,7 @@ _080E20EC: bl sub_80E2A78 adds r0, r6, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _080E20FC: pop {r4-r6} pop {r0} @@ -477,7 +477,7 @@ _080E21B8: _080E21BA: adds r0, r4, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _080E21C4: pop {r4} pop {r0} @@ -668,7 +668,7 @@ _080E2350: bl sub_80E2A78 adds r0, r4, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _080E2360: pop {r4,r5} pop {r0} @@ -761,7 +761,7 @@ _080E23D4: adds r0, r6, 0 movs r1, 0x1 adds r3, r7, 0 - bl Print + bl PrintTextOnWindow ldr r2, =gUnknown_085EB198 movs r0, 0x31 str r0, [sp] @@ -770,7 +770,7 @@ _080E23D4: adds r0, r6, 0 movs r1, 0x1 adds r3, r7, 0 - bl Print + bl PrintTextOnWindow b _080E247A .pool _080E2448: @@ -795,7 +795,7 @@ _080E2448: adds r0, r6, 0 movs r1, 0x1 adds r3, r7, 0 - bl Print + bl PrintTextOnWindow _080E247A: ldr r0, =0x000008ab bl FlagGet @@ -813,7 +813,7 @@ _080E247A: adds r0, r6, 0 movs r1, 0x1 adds r3, r7, 0 - bl Print + bl PrintTextOnWindow b _080E24C6 .pool _080E24B0: @@ -826,7 +826,7 @@ _080E24B0: adds r0, r6, 0 movs r1, 0x1 adds r3, r7, 0 - bl Print + bl PrintTextOnWindow _080E24C6: ldr r4, =gStringVar4 ldr r1, =gUnknown_085EB183 @@ -1228,7 +1228,7 @@ _080E2802: adds r0, r6, 0 movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @@ -1687,7 +1687,7 @@ CreateStartMenu: @ 80E2BAC adds r0, r4, 0 movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r2, =gUnknown_085EB264 movs r0, 0x19 str r0, [sp] @@ -1696,7 +1696,7 @@ CreateStartMenu: @ 80E2BAC adds r0, r4, 0 movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r2, =gUnknown_085EB26C movs r0, 0x29 str r0, [sp] @@ -1705,7 +1705,7 @@ CreateStartMenu: @ 80E2BAC adds r0, r4, 0 movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r2, =gUnknown_085EB270 movs r0, 0x39 str r0, [sp] @@ -1714,7 +1714,7 @@ CreateStartMenu: @ 80E2BAC adds r0, r4, 0 movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r0, =gSaveBlock2Ptr ldr r2, [r0] movs r0, 0x49 @@ -1724,7 +1724,7 @@ CreateStartMenu: @ 80E2BAC adds r0, r4, 0 movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r2, =gUnknown_085EB279 movs r0, 0x59 str r0, [sp] @@ -1733,7 +1733,7 @@ CreateStartMenu: @ 80E2BAC adds r0, r4, 0 movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r2, =gUnknown_085EB27E movs r0, 0x69 str r0, [sp] @@ -1742,7 +1742,7 @@ CreateStartMenu: @ 80E2BAC adds r0, r4, 0 movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldr r2, =gUnknown_085EB285 movs r0, 0x79 str r0, [sp] @@ -1751,7 +1751,7 @@ CreateStartMenu: @ 80E2BAC adds r0, r4, 0 movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow movs r0, 0x10 str r0, [sp] movs r0, 0x8 diff --git a/asm/script_pokemon_util_80F87D8.s b/asm/script_pokemon_util_80F87D8.s index d207e287b..e5193c4d2 100644 --- a/asm/script_pokemon_util_80F87D8.s +++ b/asm/script_pokemon_util_80F87D8.s @@ -427,7 +427,7 @@ sub_80F8AFC: @ 80F8AFC cmp r3, r0 bge _080F8B50 adds r2, r5, 0 - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers _080F8B1C: ldrb r0, [r1] subs r0, 0x1 @@ -524,7 +524,7 @@ _080F8BBA: ands r0, r2 orrs r0, r6 strb r0, [r1, 0x5] - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers adds r1, r7, r0 ldrb r0, [r1] subs r0, 0x1 @@ -953,7 +953,7 @@ sub_80F8FA0: @ 80F8FA0 cmp r0, 0 bne _080F8FD8 ldr r4, =gScriptResult - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 strh r0, [r4] @@ -1063,7 +1063,7 @@ sub_80F9088: @ 80F9088 lsrs r0, 24 cmp r0, 0x1 bne _080F90D4 - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r5, 0 bl DestroyTask b _080F90D4 @@ -1225,7 +1225,7 @@ _080F91D4: lsrs r0, 16 adds r1, r7, 0 adds r2, r5, 0 - bl CalcPPWithPPUps + bl CalculatePPWithBonus strb r0, [r6] adds r1, r5, 0 adds r1, 0x11 @@ -1296,7 +1296,7 @@ sub_80F9244: @ 80F9244 adds r1, r5, 0 adds r2, r3, 0 movs r3, 0x20 - bl create_pokemon_set_level + bl CreateMon add r0, sp, 0x10 mov r1, r8 strb r1, [r0] @@ -1307,7 +1307,7 @@ sub_80F9244: @ 80F9244 add r2, sp, 0x10 bl SetMonData adds r0, r6, 0 - bl pokemon_catch + bl GiveMonToPlayer lsls r0, 24 lsrs r4, r0, 24 adds r0, r5, 0 @@ -1351,7 +1351,7 @@ sub_80F92C8: @ 80F92C8 movs r1, 0x2D bl SetMonData mov r0, sp - bl pokemon_catch + bl GiveMonToPlayer lsls r0, 24 lsrs r0, 24 add sp, 0x68 @@ -1362,7 +1362,7 @@ sub_80F92C8: @ 80F92C8 thumb_func_start sub_80F92F8 sub_80F92F8: @ 80F92F8 push {lr} - bl sub_806B5C4 + bl GetMonsStateToDoubles lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x1 @@ -1476,7 +1476,7 @@ sub_80F93A0: @ 80F93A0 adds r1, r4, 0 adds r2, r5, 0 movs r3, 0x20 - bl create_pokemon_set_level + bl CreateMon cmp r6, 0 beq _080F93EE add r0, sp, 0x10 @@ -1520,7 +1520,7 @@ _080F941C: ldr r1, =gPlayerParty adds r0, r1 adds r1, r4, 0 - bl sub_80691F4 + bl SetMonMoveSlot pop {r4} pop {r0} bx r0 @@ -1656,7 +1656,7 @@ _080F9538: adds r4, 0x64 cmp r5, r6 ble _080F9538 - bl calc_player_party_count + bl CalculatePlayerPartyCount add sp, 0x198 pop {r4-r7} pop {r0} diff --git a/asm/secret_base.s b/asm/secret_base.s index e67212350..77e71580a 100644 --- a/asm/secret_base.s +++ b/asm/secret_base.s @@ -765,7 +765,7 @@ sub_80E90C8: @ 80E90C8 lsrs r0, 24 cmp r0, 0x1 bne _080E90F8 - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r4, 0 bl DestroyTask _080E90F8: @@ -779,7 +779,7 @@ _080E90F8: sub_80E9108: @ 80E9108 push {r4,lr} sub sp, 0x4 - bl script_env_2_enable + bl ScriptContext2_Enable bl HideMapNamePopUpWindow mov r4, sp adds r4, 0x2 @@ -956,7 +956,7 @@ _080E927A: lsrs r0, 24 cmp r0, 0x77 bhi _080E92AC - ldr r0, =gUnknown_085A5C08 + ldr r0, =gDecorations ldrb r3, [r1] lsls r1, r3, 5 adds r1, r0 @@ -1094,7 +1094,7 @@ _080E93BE: mov r1, r10 ldrb r0, [r1] lsls r0, 5 - ldr r2, =gUnknown_085A5C08 + ldr r2, =gDecorations adds r0, r2 ldrb r1, [r0, 0x11] ldrb r0, [r0, 0x13] @@ -1417,7 +1417,7 @@ sub_80E9668: @ 80E9668 bl sub_80E9608 bl sub_80E8B6C ldr r0, =gUnknown_08275BB7 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript pop {r0} bx r0 .pool @@ -1467,7 +1467,7 @@ _080E96CC: beq _080E96F4 b _080E9714 _080E96D2: - bl script_env_2_enable + bl ScriptContext2_Enable movs r0, 0x1 strh r0, [r4, 0x8] b _080E9714 @@ -1491,7 +1491,7 @@ _080E96F4: str r1, [r0] ldr r0, =c2_load_new_map bl SetMainCallback2 - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r5, 0 bl DestroyTask _080E9714: @@ -2171,7 +2171,7 @@ sub_80E9C9C: @ 80E9C9C ldr r0, =gTasks + 0x8 mov r8, r0 adds r5, r7, r0 - bl script_env_2_enable + bl ScriptContext2_Enable bl sub_80E9BA8 lsls r0, 24 lsrs r0, 24 @@ -2770,12 +2770,12 @@ task_pc_turn_off: @ 80EA1D0 cmp r0, 0 bne _080EA1F4 ldr r0, =gUnknown_0823B4E8 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript b _080EA1FA .pool _080EA1F4: ldr r0, =gUnknown_0823B5E9 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript _080EA1FA: adds r0, r4, 0 bl DestroyTask @@ -2894,7 +2894,7 @@ sub_80EA2E4: @ 80EA2E4 push {lr} movs r0, 0x1 bl sub_813BADC - ldr r1, =gUnknown_02038BCA + ldr r1, =gTrainerBattleOpponent_A movs r2, 0x80 lsls r2, 3 adds r0, r2, 0 @@ -4539,7 +4539,7 @@ _080EAFE4: _080EAFEE: adds r0, r6, r5 str r0, [sp] - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers movs r3, 0xFF ldrb r0, [r4, 0x1C] str r0, [sp, 0x4] @@ -4573,7 +4573,7 @@ _080EB030: lsls r2, r5, 1 adds r0, r6, r2 str r0, [sp] - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers ldrh r3, [r4, 0x38] movs r1, 0xFF adds r0, r1, 0 @@ -4608,7 +4608,7 @@ _080EB074: adds r0, r5 adds r0, r6, r0 str r0, [sp] - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers adds r0, r1, 0 adds r0, 0x54 ldrb r0, [r0] @@ -4631,7 +4631,7 @@ _080EB074: .pool _080EB0A8: str r6, [sp] - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers ldrb r0, [r1] str r0, [sp, 0x4] ldrh r0, [r1, 0x1A] diff --git a/asm/shop.s b/asm/shop.s index d8074a41e..268f5911a 100644 --- a/asm/shop.s +++ b/asm/shop.s @@ -13,7 +13,7 @@ CreateShopMenu: @ 80DFA78 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r5, =gUnknown_02039F60 strb r4, [r5, 0xF] cmp r4, 0 @@ -251,7 +251,7 @@ HandleShopMenuQuit: @ 80DFC68 ldrb r0, [r5, 0xE] bl RemoveWindow bl SaveRecordedItemPurchasesForTVShow - bl script_env_2_disable + bl ScriptContext2_Disable adds r0, r4, 0 bl DestroyTask ldr r5, [r5] @@ -740,7 +740,7 @@ _080E008A: b _080E00EA .pool _080E00D8: - ldr r0, =gUnknown_085A5C08 + ldr r0, =gDecorations lsls r1, r7, 5 adds r0, 0x18 adds r1, r0 @@ -808,7 +808,7 @@ BuyMenuPrintPriceInList: @ 80E0114 .pool _080E0164: ldr r0, =gStringVar1 - ldr r2, =gUnknown_085A5C08 + ldr r2, =gDecorations lsls r1, 5 adds r1, r2 ldrh r1, [r1, 0x14] @@ -1254,7 +1254,7 @@ BuyMenuDrawGraphics: @ 80E0524 movs r1, 0x92 lsls r1, 3 adds r0, r1 - bl DecryptMoney + bl GetMoney adds r3, r0, 0 movs r0, 0 movs r1, 0x1 @@ -2038,7 +2038,7 @@ _080E0B80: movs r3, 0x80 lsls r3, 6 adds r1, r3 - ldr r2, =gUnknown_085A5C08 + ldr r2, =gDecorations lsls r0, r5, 5 adds r0, r2 ldrh r0, [r0, 0x14] @@ -2198,7 +2198,7 @@ Task_BuyHowManyDialogueInit: @ 80E0CA4 movs r1, 0x92 lsls r1, 3 adds r0, r1 - bl DecryptMoney + bl GetMoney ldr r1, =gUnknown_02039F70 ldr r4, [r1] movs r2, 0x80 @@ -2415,7 +2415,7 @@ _080E0F30: .pool _080E0F40: ldrb r0, [r4, 0xA] - bl IsThereStorageSpaceForDecoration + bl DecorationAdd lsls r0, 24 cmp r0, 0 beq _080E0F70 @@ -2465,12 +2465,12 @@ BuyMenuSubtractMoney: @ 80E0F88 lsls r2, 6 adds r1, r2 ldr r1, [r1] - bl subtract_money + bl SubtractMoney movs r0, 0x5F bl PlaySE ldr r0, [r5] adds r0, r4 - bl DecryptMoney + bl GetMoney adds r1, r0, 0 movs r0, 0 movs r2, 0 @@ -2812,7 +2812,7 @@ CreatePokemartMenu: @ 80E1284 adds r0, r4, 0 bl SetShopItemsForSale bl ClearItemPurchases - ldr r0, =script_env_2_enable_and_set_ctx_running + ldr r0, =EnableBothScriptContexts bl SetShopMenuCallback pop {r4} pop {r0} @@ -2829,7 +2829,7 @@ CreateDecorationShop1Menu: @ 80E12A8 bl CreateShopMenu adds r0, r4, 0 bl SetShopItemsForSale - ldr r0, =script_env_2_enable_and_set_ctx_running + ldr r0, =EnableBothScriptContexts bl SetShopMenuCallback pop {r4} pop {r0} @@ -2846,7 +2846,7 @@ CreateDecorationShop2Menu: @ 80E12C8 bl CreateShopMenu adds r0, r4, 0 bl SetShopItemsForSale - ldr r0, =script_env_2_enable_and_set_ctx_running + ldr r0, =EnableBothScriptContexts bl SetShopMenuCallback pop {r4} pop {r0} diff --git a/asm/slot_machine.s b/asm/slot_machine.s index 688cefb36..6fdd1a214 100644 --- a/asm/slot_machine.s +++ b/asm/slot_machine.s @@ -984,7 +984,7 @@ sub_812ACF4: @ 812ACF4 str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -1552,7 +1552,7 @@ sub_812B158: @ 812B158 str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -1642,7 +1642,7 @@ sub_812B214: @ 812B214 str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -1695,7 +1695,7 @@ sub_812B280: @ 812B280 str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 movs r1, 0x3 bl CopyWindowToVram diff --git a/asm/start_menu.s b/asm/start_menu.s index 713923c79..f71df1046 100644 --- a/asm/start_menu.s +++ b/asm/start_menu.s @@ -5,386 +5,6 @@ .text - thumb_func_start BuildStartMenuActions -BuildStartMenuActions: @ 809F440 - push {lr} - ldr r0, =gUnknown_0203760F - movs r1, 0 - strb r1, [r0] - bl is_c1_link_related_active - cmp r0, 0x1 - bne _0809F45C - bl BuildStartMenuActions_LinkMode - b _0809F4AC - .pool -_0809F45C: - bl InUnionRoom - cmp r0, 0x1 - bne _0809F46A - bl BuildStartMenuActions_UnionRoom - b _0809F4AC -_0809F46A: - bl GetSafariZoneFlag - cmp r0, 0x1 - bne _0809F478 - bl BuildStartMenuActions_SafariZone - b _0809F4AC -_0809F478: - bl InBattlePike - lsls r0, 24 - cmp r0, 0 - beq _0809F488 - bl BuildStartMenuActions_BattlePike - b _0809F4AC -_0809F488: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0809F498 - bl BuildStartMenuActions_BattlePyramid - b _0809F4AC -_0809F498: - bl in_multi_battle_room_with_var_condition - lsls r0, 24 - cmp r0, 0 - beq _0809F4A8 - bl BuildStartMenuActions_MultiBattleRoom - b _0809F4AC -_0809F4A8: - bl BuildStartMenuActions_Normal -_0809F4AC: - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions - - thumb_func_start AddStartMenuAction -@ void AddStartMenuAction(u8 entry) -AddStartMenuAction: @ 809F4B0 - push {lr} - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_02037610 - ldr r1, =gUnknown_0203760F - bl append_byte - pop {r0} - bx r0 - .pool - thumb_func_end AddStartMenuAction - - thumb_func_start BuildStartMenuActions_Normal -BuildStartMenuActions_Normal: @ 809F4CC - push {lr} - ldr r0, =0x00000861 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F4E2 - movs r0, 0 - bl AddStartMenuAction -_0809F4E2: - movs r0, 0x86 - lsls r0, 4 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F4F8 - movs r0, 0x1 - bl AddStartMenuAction -_0809F4F8: - movs r0, 0x2 - bl AddStartMenuAction - ldr r0, =0x00000862 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F512 - movs r0, 0x3 - bl AddStartMenuAction -_0809F512: - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x5 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - .pool - thumb_func_end BuildStartMenuActions_Normal - - thumb_func_start BuildStartMenuActions_SafariZone -BuildStartMenuActions_SafariZone: @ 809F538 - push {lr} - movs r0, 0x8 - bl AddStartMenuAction - movs r0, 0 - bl AddStartMenuAction - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x2 - bl AddStartMenuAction - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions_SafariZone - - thumb_func_start BuildStartMenuActions_LinkMode -BuildStartMenuActions_LinkMode: @ 809F568 - push {lr} - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x2 - bl AddStartMenuAction - ldr r0, =0x00000862 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F58A - movs r0, 0x3 - bl AddStartMenuAction -_0809F58A: - movs r0, 0x9 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - .pool - thumb_func_end BuildStartMenuActions_LinkMode - - thumb_func_start BuildStartMenuActions_UnionRoom -BuildStartMenuActions_UnionRoom: @ 809F5A4 - push {lr} - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x2 - bl AddStartMenuAction - ldr r0, =0x00000862 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F5C6 - movs r0, 0x3 - bl AddStartMenuAction -_0809F5C6: - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - .pool - thumb_func_end BuildStartMenuActions_UnionRoom - - thumb_func_start BuildStartMenuActions_BattlePike -BuildStartMenuActions_BattlePike: @ 809F5E0 - push {lr} - movs r0, 0 - bl AddStartMenuAction - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions_BattlePike - - thumb_func_start BuildStartMenuActions_BattlePyramid -BuildStartMenuActions_BattlePyramid: @ 809F604 - push {lr} - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0xC - bl AddStartMenuAction - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0xA - bl AddStartMenuAction - movs r0, 0xB - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions_BattlePyramid - - thumb_func_start BuildStartMenuActions_MultiBattleRoom -BuildStartMenuActions_MultiBattleRoom: @ 809F634 - push {lr} - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions_MultiBattleRoom - - thumb_func_start sub_809F654 -sub_809F654: @ 809F654 - push {r4,r5,lr} - sub sp, 0xC - ldr r4, =gUnknown_0203760C - ldr r0, =gUnknown_08510508 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldr r0, =gStringVar1 - ldr r1, =gUnknown_0203A04C - ldrb r1, [r1] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r5, =gStringVar4 - ldr r1, =gUnknown_085EE6FF - adds r0, r5, 0 - bl StringExpandPlaceholders - ldrb r0, [r4] - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl Print - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F654 - - thumb_func_start sub_809F6C8 -sub_809F6C8: @ 809F6C8 - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0x7 - bne _0809F6F0 - ldr r4, =gUnknown_0203760D - ldr r0, =gUnknown_08510538 - b _0809F6F4 - .pool -_0809F6F0: - ldr r4, =gUnknown_0203760D - ldr r0, =gUnknown_08510530 -_0809F6F4: - bl AddWindow - strb r0, [r4] - ldr r4, =gUnknown_0203760D - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldr r0, =gStringVar1 - ldr r2, =gUnknown_08510510 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r1, r3 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - ldr r5, =gStringVar4 - ldr r1, =gUnknown_085EE716 - adds r0, r5, 0 - bl StringExpandPlaceholders - ldrb r0, [r4] - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl Print - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F6C8 - - thumb_func_start RemoveExtraStartMenuWindows -RemoveExtraStartMenuWindows: @ 809F774 - push {r4,lr} - bl GetSafariZoneFlag - cmp r0, 0 - beq _0809F796 - ldr r4, =gUnknown_0203760C - ldrb r0, [r4] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - ldrb r0, [r4] - bl RemoveWindow -_0809F796: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0809F7B0 - ldr r4, =gUnknown_0203760D - ldrb r0, [r4] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl RemoveWindow -_0809F7B0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveExtraStartMenuWindows thumb_func_start PrintStartMenuActions PrintStartMenuActions: @ 809F7C0 @@ -397,12 +17,12 @@ PrintStartMenuActions: @ 809F7C0 mov r8, r0 adds r6, r1, 0 ldrb r2, [r0] - ldr r0, =gUnknown_08510540 + ldr r0, =sStartMenuItems mov r9, r0 ldr r1, =gStringVar4 mov r10, r1 _0809F7DA: - ldr r0, =gUnknown_02037610 + ldr r0, =sCurrentStartMenuActions lsls r2, 24 asrs r4, r2, 24 adds r5, r4, r0 @@ -416,7 +36,7 @@ _0809F7DA: adds r7, r2, 0 cmp r1, r0 bne _0809F828 - bl get_start_menu_window_id_maybe + bl GetStartMenuWindowId lsls r0, 24 lsrs r0, 24 ldrb r1, [r5] @@ -437,7 +57,7 @@ _0809F828: ldr r1, [r0] mov r0, r10 bl StringExpandPlaceholders - bl get_start_menu_window_id_maybe + bl GetStartMenuWindowId lsls r0, 24 lsrs r0, 24 lsls r1, r4, 4 @@ -452,14 +72,14 @@ _0809F828: movs r1, 0x1 mov r2, r10 movs r3, 0x8 - bl Print + bl PrintTextOnWindow _0809F858: movs r0, 0x80 lsls r0, 17 adds r1, r7, r0 lsrs r2, r1, 24 asrs r1, 24 - ldr r0, =gUnknown_0203760F + ldr r0, =sNumStartMenuActions ldrb r0, [r0] cmp r1, r0 bge _0809F87C @@ -522,7 +142,7 @@ _0809F8D8: .pool _0809F8E4: bl sub_81973A4 - ldr r0, =gUnknown_0203760F + ldr r0, =sNumStartMenuActions ldrb r0, [r0] bl sub_81979C4 lsls r0, 24 @@ -538,13 +158,13 @@ _0809F90C: bl GetSafariZoneFlag cmp r0, 0 beq _0809F918 - bl sub_809F654 + bl DisplaySafariBallsWindow _0809F918: bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq _0809F926 - bl sub_809F6C8 + bl DisplayPyramidFloorWindow _0809F926: ldr r1, =gUnknown_02037619 b _0809F940 @@ -564,15 +184,15 @@ _0809F940: b _0809F98C .pool _0809F94C: - bl get_start_menu_window_id_maybe + bl GetStartMenuWindowId lsls r0, 24 lsrs r0, 24 movs r1, 0x10 str r1, [sp] - ldr r1, =gUnknown_0203760F + ldr r1, =sNumStartMenuActions ldrb r1, [r1] str r1, [sp, 0x4] - ldr r4, =gUnknown_0203760E + ldr r4, =sStartMenuCursorPos ldrb r1, [r4] str r1, [sp, 0x8] movs r1, 0x1 @@ -580,7 +200,7 @@ _0809F94C: movs r3, 0x9 bl sub_81983AC strb r0, [r4] - bl get_start_menu_window_id_maybe + bl GetStartMenuWindowId lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -742,7 +362,7 @@ sub_809FA9C: @ 809FA9C _0809FAB2: ldr r0, =sub_809FA34 bl sub_809F9D0 - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 .pool @@ -762,7 +382,7 @@ HandleStartMenuInput: @ 809FAC4 movs r0, 0x1 negs r0, r0 bl MoveMenuCursor - ldr r1, =gUnknown_0203760E + ldr r1, =sStartMenuCursorPos strb r0, [r1] _0809FAE4: ldrh r1, [r4, 0x2E] @@ -774,7 +394,7 @@ _0809FAE4: bl PlaySE movs r0, 0x1 bl MoveMenuCursor - ldr r1, =gUnknown_0203760E + ldr r1, =sStartMenuCursorPos strb r0, [r1] _0809FAFE: ldrh r1, [r4, 0x2E] @@ -784,9 +404,9 @@ _0809FAFE: beq _0809FB98 movs r0, 0x5 bl PlaySE - ldr r1, =gUnknown_08510540 - ldr r2, =gUnknown_02037610 - ldr r0, =gUnknown_0203760E + ldr r1, =sStartMenuItems + ldr r2, =sCurrentStartMenuActions + ldr r0, =sStartMenuCursorPos ldrb r0, [r0] adds r0, r2 ldrb r0, [r0] @@ -804,9 +424,9 @@ _0809FAFE: beq _0809FBA0 _0809FB34: ldr r3, =gUnknown_03005DF4 - ldr r1, =gUnknown_08510540 - ldr r2, =gUnknown_02037610 - ldr r0, =gUnknown_0203760E + ldr r1, =sStartMenuItems + ldr r2, =sCurrentStartMenuActions + ldr r0, =sStartMenuCursorPos ldrb r0, [r0] adds r0, r2 ldrb r0, [r0] @@ -1060,7 +680,7 @@ StartMenu_SafariZoneRetire: @ 809FD74 push {lr} bl RemoveExtraStartMenuWindows bl sub_80A0934 - bl sub_80FC180 + bl SafariZoneRetirePrompt movs r0, 0x1 pop {r1} bx r1 @@ -1111,7 +731,7 @@ sub_809FDD4: @ 809FDD4 bl sub_80984F4 ldr r0, =sub_809FA34 bl sub_809F9D0 - bl script_env_2_enable + bl ScriptContext2_Enable pop {r0} bx r0 .pool @@ -1185,7 +805,7 @@ _0809FE7C: movs r1, 0x1 bl sub_8197DF8 bl sub_80984F4 - bl script_env_2_disable + bl ScriptContext2_Disable bl sub_81A9EC8 movs r0, 0x1 b _0809FE96 @@ -1247,9 +867,9 @@ _0809FF00: movs r1, 0x1 bl sub_8197DF8 bl sub_80984F4 - bl script_env_2_disable + bl ScriptContext2_Disable ldr r0, =gUnknown_08252C88 - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript movs r0, 0x1 b _0809FF22 .pool @@ -1365,7 +985,7 @@ _0809FFFC: _080A0000: adds r0, r4, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _080A000A: pop {r4} pop {r0} @@ -1458,7 +1078,7 @@ _080A009A: thumb_func_start sub_80A00A0 sub_80A00A0: @ 80A00A0 push {lr} - bl get_start_menu_window_id_maybe + bl GetStartMenuWindowId lsls r0, 24 lsrs r0, 24 movs r1, 0 @@ -1789,7 +1409,7 @@ sub_80A0340: @ 80A0340 thumb_func_start sub_80A035C sub_80A035C: @ 80A035C push {lr} - bl get_start_menu_window_id_maybe + bl GetStartMenuWindowId lsls r0, 24 lsrs r0, 24 movs r1, 0 @@ -2239,7 +1859,7 @@ _080A0710: movs r1, 0x1 adds r2, r5, 0 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r4, 0x11 ldrb r0, [r6] ldr r2, =gUnknown_085EED26 @@ -2249,7 +1869,7 @@ _080A0710: str r7, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 adds r1, r5, 0 mov r2, r9 @@ -2274,7 +1894,7 @@ _080A0710: str r7, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0x4 adds r1, r5, 0 mov r2, r9 @@ -2293,7 +1913,7 @@ _080A0710: str r7, [sp, 0x8] movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow mov r0, r10 bl FlagGet lsls r0, 24 @@ -2309,7 +1929,7 @@ _080A0710: str r7, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0x1 adds r1, r5, 0 mov r2, r9 @@ -2328,7 +1948,7 @@ _080A0710: str r7, [sp, 0x8] movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow _080A0802: adds r4, 0x10 ldrb r0, [r6] @@ -2341,7 +1961,7 @@ _080A0802: str r7, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0x2 adds r1, r5, 0 mov r2, r9 @@ -2360,7 +1980,7 @@ _080A0802: str r7, [sp, 0x8] movs r1, 0x1 adds r2, r5, 0 - bl Print + bl PrintTextOnWindow ldrb r0, [r6] movs r1, 0x2 bl CopyWindowToVram @@ -2402,7 +2022,7 @@ sub_80A08A4: @ 80A08A4 bne _080A08C0 adds r0, r4, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts _080A08C0: pop {r4} pop {r0} @@ -2445,14 +2065,14 @@ sub_80A08CC: @ 80A08CC thumb_func_start sub_80A0914 sub_80A0914: @ 80A0914 push {lr} - bl get_start_menu_window_id_maybe + bl GetStartMenuWindowId lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl sub_819746C bl remove_start_menu_window_maybe bl sub_80984F4 - bl script_env_2_disable + bl ScriptContext2_Disable pop {r0} bx r0 thumb_func_end sub_80A0914 @@ -2467,8 +2087,8 @@ sub_80A0934: @ 80A0934 bx r0 thumb_func_end sub_80A0934 - thumb_func_start append_byte -append_byte: @ 80A0944 + thumb_func_start AppendToList +AppendToList: @ 80A0944 ldrb r3, [r1] adds r0, r3 strb r2, [r0] @@ -2476,6 +2096,6 @@ append_byte: @ 80A0944 adds r0, 0x1 strb r0, [r1] bx lr - thumb_func_end append_byte + thumb_func_end AppendToList .align 2, 0 @ Don't pad with nop. diff --git a/asm/starter_choose.s b/asm/starter_choose.s index 87db69132..0f8f5d464 100644 --- a/asm/starter_choose.s +++ b/asm/starter_choose.s @@ -336,7 +336,7 @@ sub_81341FC: @ 81341FC str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 bl PutWindowTilemap movs r0, 0 @@ -515,7 +515,7 @@ sub_8134390: @ 8134390 str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 bl schedule_bg_copy_tilemap_to_vram ldr r0, =gUnknown_085B1DDC diff --git a/asm/trade.s b/asm/trade.s index 3758541bf..6a46acb8c 100644 --- a/asm/trade.s +++ b/asm/trade.s @@ -389,7 +389,7 @@ _080774B2: movs r1, 0 movs r2, 0 movs r3, 0x20 - bl create_pokemon_set_level + bl CreateMon adds r6, 0x1 cmp r6, 0x5 ble _080774B2 @@ -518,7 +518,7 @@ _080775F2: b _08077B46 _08077600: bl sub_8011BD0 - bl calc_player_party_count + bl CalculatePlayerPartyCount ldr r1, =gMain movs r7, 0x87 lsls r7, 3 @@ -586,7 +586,7 @@ _08077694: b _08077B22 .pool _080776A8: - bl calc_enemy_party_count + bl CalculateEnemyPartyCount movs r0, 0 movs r1, 0 bl SetGpuReg @@ -762,7 +762,7 @@ _08077834: movs r2, 0 movs r3, 0 bl sub_80C6D80 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 movs r1, 0x80 lsls r1, 17 @@ -771,7 +771,7 @@ _08077834: lsls r0, r1, 3 subs r0, r1 lsls r0, 2 - ldr r1, =gUnknown_020229F0 + ldr r1, =gLinkPlayers + 8 adds r0, r1 ldr r1, [r5, 0xC] str r4, [sp] @@ -842,7 +842,7 @@ _080778DE: adds r6, 0x1 cmp r6, 0x2 ble _080778DE - bl link_get_multiplayer_id + bl GetMultiplayerId movs r1, 0x1 eors r0, r1 lsls r0, 24 @@ -850,7 +850,7 @@ _080778DE: lsls r1, r0, 3 subs r1, r0 lsls r1, 2 - ldr r0, =gUnknown_020229F0 + ldr r0, =gLinkPlayers + 8 adds r1, r0 movs r0, 0x1 movs r2, 0x78 @@ -1174,7 +1174,7 @@ _08077C20: adds r1, r2, r0 b _080780D8 _08077C28: - bl calc_player_party_count + bl CalculatePlayerPartyCount ldr r1, =gMain movs r2, 0x87 lsls r2, 3 @@ -1203,7 +1203,7 @@ _08077C64: adds r1, r2, r5 b _080780D8 _08077C6C: - bl calc_enemy_party_count + bl CalculateEnemyPartyCount ldr r4, =gUnknown_0203229C ldr r0, [r4] ldr r1, =gPlayerPartyCount @@ -1380,7 +1380,7 @@ _08077DFC: movs r2, 0 movs r3, 0 bl sub_80C6D80 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 movs r1, 0x80 lsls r1, 17 @@ -1389,7 +1389,7 @@ _08077DFC: lsls r0, r1, 3 subs r0, r1 lsls r0, 2 - ldr r1, =gUnknown_020229F0 + ldr r1, =gLinkPlayers + 8 adds r0, r1 ldr r1, [r5, 0xC] str r4, [sp] @@ -1466,7 +1466,7 @@ _08077EB4: adds r6, 0x1 cmp r6, 0x2 ble _08077EB4 - bl link_get_multiplayer_id + bl GetMultiplayerId movs r1, 0x1 eors r0, r1 lsls r0, 24 @@ -1474,7 +1474,7 @@ _08077EB4: lsls r1, r0, 3 subs r1, r0 lsls r1, 2 - ldr r0, =gUnknown_020229F0 + ldr r0, =gLinkPlayers + 8 adds r1, r0 movs r0, 0x1 movs r2, 0x78 @@ -2100,7 +2100,7 @@ _08078452: shedinja_maker_maybe: @ 8078458 push {r4-r6,lr} sub sp, 0xC - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r5, r0, 24 ldr r0, =gUnknown_0203229C @@ -2209,7 +2209,7 @@ _08078552: .pool _0807857C: ldr r0, =gUnknown_020228C4 - ldr r1, =gUnknown_020245B4 + ldr r1, =gPlayerParty + 200 movs r2, 0xC8 bl sub_8078438 ldr r0, =gUnknown_0203229C @@ -2232,7 +2232,7 @@ _080785AC: beq _080785B6 b _080787AA _080785B6: - ldr r0, =gUnknown_0202480C + ldr r0, =gEnemyParty + 200 movs r2, 0x1 adds r1, r5, 0 eors r1, r2 @@ -2248,7 +2248,7 @@ _080785B6: .pool _080785E0: ldr r0, =gUnknown_020228C4 - ldr r1, =gUnknown_0202467C + ldr r1, =gPlayerParty + 400 movs r2, 0xC8 bl sub_8078438 ldr r0, =gUnknown_0203229C @@ -2271,7 +2271,7 @@ _08078610: beq _0807861A b _080787AA _0807861A: - ldr r0, =gUnknown_020248D4 + ldr r0, =gEnemyParty + 400 movs r2, 0x1 adds r1, r5, 0 eors r1, r2 @@ -2977,7 +2977,7 @@ sub_8078C10: @ 8078C10 thumb_func_start sub_8078C34 sub_8078C34: @ 8078C34 push {r4,lr} - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r4, r0, 24 bl sub_8077200 @@ -3146,7 +3146,7 @@ sub_8078D78: @ 8078D78 adds r0, 0x6F movs r1, 0x64 strb r1, [r0] - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -3851,7 +3851,7 @@ _08079356: thumb_func_start sub_807935C sub_807935C: @ 807935C push {r4,lr} - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _08079384 @@ -4419,7 +4419,7 @@ _08079772: lsls r0, 2 add r0, r8 ldr r1, =sub_80D3014 - bl oamt_set_x3A_32 + bl StoreSpriteCallbackInData6 ldr r2, =gUnknown_0203229C ldr r1, [r2] adds r1, 0x74 @@ -5078,7 +5078,7 @@ _08079D94: ldr r0, =gPlayerParty adds r4, r0 adds r0, r4, 0 - bl pokemon_get_gender + bl GetMonGender lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 @@ -5094,7 +5094,7 @@ _08079DC0: ldr r0, =gEnemyParty adds r4, r0 adds r0, r4, 0 - bl pokemon_get_gender + bl GetMonGender lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 @@ -5598,7 +5598,7 @@ sub_807A19C: @ 807A19C str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 movs r1, 0x14 movs r2, 0xC @@ -6165,7 +6165,7 @@ _0807A64C: movs r0, 0x2 b _0807A718 _0807A65C: - bl link_get_multiplayer_id + bl GetMultiplayerId movs r1, 0x1 eors r0, r1 lsls r0, 24 @@ -6173,7 +6173,7 @@ _0807A65C: lsls r1, r0, 3 subs r1, r0 lsls r1, 2 - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers adds r1, r0 ldrb r0, [r1] subs r0, 0x1 @@ -6284,8 +6284,8 @@ sub_807A728: @ 807A728 cmp r0, 0 beq _0807A7B4 movs r4, 0 - bl link_get_multiplayer_id - ldr r5, =gUnknown_020229E8 + bl GetMultiplayerId + ldr r5, =gLinkPlayers movs r7, 0x1 eors r0, r7 lsls r0, 24 @@ -6309,7 +6309,7 @@ sub_807A728: @ 807A728 _0807A762: cmp r4, 0 ble _0807A7B4 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -6324,7 +6324,7 @@ _0807A762: beq _0807A7B0 cmp r4, 0x2 bne _0807A7B4 - bl link_get_multiplayer_id + bl GetMultiplayerId eors r0, r7 lsls r0, 24 lsrs r0, 24 @@ -6586,7 +6586,7 @@ _0807A95A: movs r7, 0 movs r6, 0x1 movs r5, 0 - ldr r4, =gUnknown_020229E8 + ldr r4, =gLinkPlayers b _0807A980 .pool _0807A96C: @@ -6612,7 +6612,7 @@ _0807A980: movs r4, 0 b _0807A9B4 _0807A992: - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers adds r2, r4, r0 ldrb r1, [r2, 0x10] movs r0, 0xF @@ -7062,7 +7062,7 @@ sub_807ACDC: @ 807ACDC b _0807ACF8 .pool _0807ACF0: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 lsrs r0, 24 _0807ACF8: @@ -7700,7 +7700,7 @@ _0807B2D0: strb r0, [r1] movs r0, 0x6 strb r0, [r1, 0x1] - ldr r4, =gUnknown_020229F0 + ldr r4, =gLinkPlayers + 8 ldr r0, =gSaveBlock2Ptr ldr r1, [r0] adds r0, r4, 0 @@ -7900,7 +7900,7 @@ _0807B4B8: thumb_func_start sub_807B4C4 sub_807B4C4: @ 807B4C4 push {lr} - bl link_get_multiplayer_id + bl GetMultiplayerId pop {r0} bx r0 thumb_func_end sub_807B4C4 @@ -8521,7 +8521,7 @@ sub_807BAD8: @ 807BAD8 ldrb r0, [r0] cmp r0, 0 beq _0807BB68 - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 ldr r3, =gStringVar1 movs r2, 0x80 @@ -8531,7 +8531,7 @@ sub_807BAD8: @ 807BAD8 lsls r1, r2, 3 subs r1, r2 lsls r1, 2 - ldr r0, =gUnknown_020229F0 + ldr r0, =gLinkPlayers + 8 adds r1, r0 adds r0, r3, 0 bl StringCopy @@ -13276,7 +13276,7 @@ sub_807E7E8: @ 807E7E8 str r0, [sp, 0xC] adds r0, r6, 0 movs r3, 0x20 - bl create_pokemon_set_level + bl CreateMon adds r2, r5, 0 adds r2, 0xE adds r0, r6, 0 @@ -13401,7 +13401,7 @@ _0807E954: bl SetMonData _0807E960: ldr r0, =gEnemyParty - bl pokemon_calc_effective_stats + bl CalculateMonStats add sp, 0x38 pop {r4-r7} pop {r0} @@ -13835,8 +13835,8 @@ _0807EDCE: ldrb r0, [r0] cmp r0, 0 beq _0807EDF6 - ldr r4, =gUnknown_020229E8 - bl link_get_multiplayer_id + ldr r4, =gLinkPlayers + bl GetMultiplayerId movs r1, 0x1 eors r0, r1 lsls r0, 24 @@ -13930,7 +13930,7 @@ _0807EE9C: bhi _0807EEAC b _0807F03A _0807EEAC: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _0807EED4 @@ -14165,7 +14165,7 @@ _0807F0BE: sub_807F0E4: @ 807F0E4 push {lr} sub sp, 0x4 - bl script_env_2_enable + bl ScriptContext2_Enable ldr r0, =sub_807F110 movs r1, 0xA bl CreateTask @@ -14751,7 +14751,7 @@ _0807F5D0: bhi _0807F5E0 b _0807F70C _0807F5E0: - bl link_get_multiplayer_id + bl GetMultiplayerId lsls r0, 24 cmp r0, 0 bne _0807F608 diff --git a/asm/trader.s b/asm/trader.s index 024ee3307..bddf53324 100644 --- a/asm/trader.s +++ b/asm/trader.s @@ -165,7 +165,7 @@ _08133B3C: movs r1, 0x1 ldr r2, =gUnknown_085E8D38 movs r3, 0x8 - bl Print + bl PrintTextOnWindow b _08133B94 .pool _08133B70: @@ -185,7 +185,7 @@ _08133B70: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow _08133B94: adds r0, r5, 0x1 lsls r0, 24 @@ -205,7 +205,7 @@ _08133B94: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 - bl Print + bl PrintTextOnWindow ldrb r0, [r7, 0x6] movs r1, 0x5 movs r2, 0 @@ -257,7 +257,7 @@ _08133C18: bl schedule_bg_copy_tilemap_to_vram adds r0, r5, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r4,r5} pop {r0} bx r0 @@ -381,7 +381,7 @@ sub_8133D2C: @ 8133D2C ldr r6, =gScriptResult movs r0, 0 strh r0, [r6] - ldr r4, =gUnknown_085A5C08 + ldr r4, =gDecorations ldr r5, =gSpecialVar_0x8004 ldrh r0, [r5] lsls r0, 5 @@ -468,7 +468,7 @@ _08133DFC: _08133E04: adds r0, r6, 0 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r4-r6} pop {r0} bx r0 @@ -484,7 +484,7 @@ sub_8133E1C: @ 8133E1C movs r1, 0 strh r1, [r2] bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r0} bx r0 .pool @@ -502,10 +502,10 @@ sub_8133E38: @ 8133E38 ldr r1, =gSpecialVar_0x8006 mov r8, r1 ldrb r0, [r1] - bl sub_81619DC + bl DecorationRemove ldr r0, =gSpecialVar_0x8004 ldrb r0, [r0] - bl IsThereStorageSpaceForDecoration + bl DecorationAdd ldr r4, =gSpecialVar_0x8005 ldrh r1, [r4] movs r0, 0xB diff --git a/asm/trainer_card.s b/asm/trainer_card.s index e8ee8b154..202c4f75e 100644 --- a/asm/trainer_card.s +++ b/asm/trainer_card.s @@ -419,7 +419,7 @@ _080C2A2C: str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -998,7 +998,7 @@ _080C2F14: movs r1, 0x92 lsls r1, 3 adds r0, r1 - bl DecryptMoney + bl GetMoney str r0, [r5, 0x24] movs r2, 0 adds r7, r5, 0 @@ -4585,7 +4585,7 @@ sub_80C4E74: @ 80C4E74 movs r2, 0x64 bl memcpy ldr r1, [r5] - ldr r2, =gUnknown_020229E8 + ldr r2, =gLinkPlayers lsls r0, r4, 3 subs r0, r4 lsls r0, 2 diff --git a/asm/trainer_see.s b/asm/trainer_see.s index 1b3e33e98..ac2528cd8 100644 --- a/asm/trainer_see.s +++ b/asm/trainer_see.s @@ -44,7 +44,7 @@ _080B3C12: adds r5, r0, 0 cmp r1, 0x1 bhi _080B3C88 - bl CheckPlayerPartySize + bl GetMonsStateToDoubles_2 lsls r0, 24 cmp r0, 0 bne _080B3C42 @@ -196,7 +196,7 @@ _080B3D56: cmp r0, 0x6 bne _080B3D8A _080B3D7C: - bl CheckPlayerPartySize + bl GetMonsStateToDoubles_2 lsls r0, 24 cmp r0, 0 bne _080B3DE0 @@ -1282,7 +1282,7 @@ sub_80B45BC: @ 80B45BC lsls r0, 24 lsrs r0, 24 bl DestroyTask - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts pop {r0} bx r0 thumb_func_end sub_80B45BC diff --git a/asm/truck_scene.s b/asm/truck_scene.s index b9e9f1b35..bc3388cb6 100644 --- a/asm/truck_scene.s +++ b/asm/truck_scene.s @@ -503,7 +503,7 @@ _080FB492: bl PlaySE adds r0, r5, 0 bl DestroyTask - bl script_env_2_disable + bl ScriptContext2_Disable _080FB4D8: pop {r4,r5} pop {r0} @@ -527,7 +527,7 @@ sub_80FB4E0: @ 80FB4E0 movs r1, 0xA bl MapGridSetMetatileIdAt bl DrawWholeMapView - bl script_env_2_enable + bl ScriptContext2_Enable movs r0, 0 str r0, [sp] ldr r1, =gPlttBufferFaded diff --git a/asm/tv.s b/asm/tv.s index 7c80b85a6..12f1852ff 100644 --- a/asm/tv.s +++ b/asm/tv.s @@ -542,7 +542,7 @@ GabbyAndTyBeforeInterview: @ 80EC31C push {r4,lr} ldr r3, =gSaveBlock1Ptr ldr r2, [r3] - ldr r0, =gUnknown_03005D10 + ldr r0, =gBattleResults mov r12, r0 ldrh r1, [r0, 0x6] ldr r4, =0x00002ba4 @@ -1032,7 +1032,7 @@ sub_80EC728: @ 80EC728 movs r4, 0 bl sub_80EED88 bl sub_80ED718 - ldr r5, =gUnknown_03005D10 + ldr r5, =gBattleResults ldrh r0, [r5, 0x28] cmp r0, 0 bne _080EC74C @@ -1133,7 +1133,7 @@ _080EC7CA: .pool _080EC81C: movs r2, 0 - ldr r0, =gUnknown_02024208 + ldr r0, =gLastUsedItem mov r12, r0 adds r3, r6, 0 adds r3, 0x13 @@ -1216,7 +1216,7 @@ _080EC8CA: ldrh r0, [r4, 0x2] adds r0, 0x1 strh r0, [r4, 0x2] - ldr r1, =gUnknown_03005D10 + ldr r1, =gBattleResults ldrh r0, [r1, 0x28] strh r0, [r4, 0x4] ldrh r0, [r1, 0x6] @@ -1300,7 +1300,7 @@ _080EC940: movs r0, 0x17 strb r0, [r4] strb r1, [r4, 0x1] - ldr r1, =gUnknown_03005D10 + ldr r1, =gBattleResults ldrh r0, [r1, 0x6] strh r0, [r4, 0xC] ldrh r0, [r1, 0x20] @@ -1538,7 +1538,7 @@ _080ECBA4: lsls r0, r7, 3 subs r0, r7 lsls r5, r0, 2 - ldr r6, =gUnknown_020229F0 + ldr r6, =gLinkPlayers + 8 adds r1, r5, r6 mov r0, sp bl StringCopy @@ -1919,7 +1919,7 @@ sub_80ECEB4: @ 80ECEB4 ldrb r0, [r0] cmp r1, r0 ble _080ECF30 - ldr r0, =gUnknown_020229E8 + ldr r0, =gLinkPlayers ldrh r0, [r0, 0x1A] b _080ECF4A .pool @@ -1928,7 +1928,7 @@ _080ECF30: ldrb r0, [r0] cmp r0, 0x1 beq _080ECF48 - ldr r1, =gUnknown_020229E8 + ldr r1, =gLinkPlayers lsls r0, r6, 3 subs r0, r6 lsls r0, 2 @@ -4048,7 +4048,7 @@ _080EE1B6: strb r0, [r4] strb r1, [r4, 0x1] movs r5, 0 - ldr r6, =gUnknown_03005D10 + ldr r6, =gBattleResults ldr r3, =gMapHeader ldr r7, =gSaveBlock2Ptr adds r2, r6, 0 @@ -4122,7 +4122,7 @@ _080EE27E: _080EE280: strb r0, [r4, 0x5] _080EE282: - ldr r1, =gUnknown_03005D10 + ldr r1, =gBattleResults ldrh r0, [r1, 0x20] strh r0, [r4, 0x2] ldrb r0, [r4, 0x5] @@ -7510,7 +7510,7 @@ sub_80EFDDC: @ 80EFDDC muls r1, r0 adds r0, r1, 0 adds r0, r6 - bl pokemon_get_gender + bl GetMonGender adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -7574,29 +7574,29 @@ sub_80EFEC4: @ 80EFEC4 adds r6, r0, 0 ldr r2, =gStringVar3 movs r1, 0x2 - bl pokemon_getattr_encrypted + bl GetBoxMonData ldr r0, =gStringVar2 mov r8, r0 adds r0, r6, 0 movs r1, 0x2 mov r2, r8 - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r0, r6, 0 movs r1, 0xB movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r6, 0 - bl pokemon_roll_gender + bl GetBoxMonGender adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 movs r1, 0 movs r2, 0 - bl pokemon_getattr_encrypted + bl GetBoxMonData str r0, [sp] ldr r0, =sub_80EFF48 str r0, [sp, 0x4] @@ -7622,7 +7622,7 @@ sub_80EFF48: @ 80EFF48 ldr r1, =gSpecialVar_0x8013 ldrb r1, [r1] ldr r2, =gStringVar2 - bl sub_80D1E90 + bl SetBoxMonNickFromAnyBox bl c2_exit_to_overworld_1_continue_scripts_restart_music pop {r0} bx r0 @@ -7956,7 +7956,7 @@ _080F0208: bls _080F0208 mov r5, r8 movs r4, 0 - ldr r7, =gUnknown_020229E8 + ldr r7, =gLinkPlayers b _080F0276 .pool _080F0238: diff --git a/asm/util.s b/asm/util.s deleted file mode 100644 index 73342f136..000000000 --- a/asm/util.s +++ /dev/null @@ -1,466 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start CreateInvisibleSpriteWithCallback -CreateInvisibleSpriteWithCallback: @ 806F640 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r0, =gUnknown_0832A3A8 - movs r1, 0xF8 - movs r2, 0xA8 - movs r3, 0xE - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gSprites - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r3, r2, r5 - adds r3, 0x3E - ldrb r1, [r3] - movs r4, 0x4 - orrs r1, r4 - strb r1, [r3] - adds r5, 0x1C - adds r2, r5 - str r6, [r2] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end CreateInvisibleSpriteWithCallback - - thumb_func_start StoreWordInTwoHalfwords -StoreWordInTwoHalfwords: @ 806F67C - strh r1, [r0] - lsrs r1, 16 - strh r1, [r0, 0x2] - bx lr - thumb_func_end StoreWordInTwoHalfwords - - thumb_func_start LoadWordFromTwoHalfwords -LoadWordFromTwoHalfwords: @ 806F684 - ldrh r2, [r0] - movs r3, 0x2 - ldrsh r0, [r0, r3] - lsls r0, 16 - orrs r2, r0 - str r2, [r1] - bx lr - thumb_func_end LoadWordFromTwoHalfwords - - thumb_func_start SetBgAffineStruct -SetBgAffineStruct: @ 806F694 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, [sp, 0x18] - ldr r5, [sp, 0x1C] - ldr r6, [sp, 0x20] - ldr r7, [sp, 0x24] - mov r8, r7 - str r1, [r0] - str r2, [r0, 0x4] - strh r3, [r0, 0x8] - strh r4, [r0, 0xA] - strh r5, [r0, 0xC] - strh r6, [r0, 0xE] - mov r1, r8 - strh r1, [r0, 0x10] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end SetBgAffineStruct - - thumb_func_start DoBgAffineSet -DoBgAffineSet: @ 806F6C0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x24 - mov r8, r0 - ldr r0, [sp, 0x38] - ldr r4, [sp, 0x3C] - ldr r5, [sp, 0x40] - ldr r6, [sp, 0x44] - lsls r6, 16 - lsrs r6, 16 - lsls r3, 16 - asrs r3, 16 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - lsls r4, 16 - asrs r4, 16 - str r4, [sp, 0x4] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x8] - str r6, [sp, 0xC] - add r0, sp, 0x10 - bl SetBgAffineStruct - add r0, sp, 0x10 - mov r1, r8 - movs r2, 0x1 - bl BgAffineSet - add sp, 0x24 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end DoBgAffineSet - - thumb_func_start CopySpriteTiles -CopySpriteTiles: @ 806F70C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x38 - str r2, [sp, 0x20] - adds r4, r3, 0 - ldr r7, [sp, 0x58] - lsls r0, 24 - lsls r1, 24 - ldr r2, =gUnknown_0832A3C0 - lsrs r1, 23 - lsrs r0, 21 - adds r1, r0 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - str r0, [sp, 0x24] - adds r1, r2 - ldrb r1, [r1] - str r1, [sp, 0x28] - movs r0, 0 - b _0806F88C - .pool -_0806F740: - movs r5, 0 - adds r0, 0x1 - str r0, [sp, 0x30] - b _0806F874 -_0806F748: - ldrh r0, [r4] - ldr r2, =0x000003ff - adds r1, r2, 0 - ands r1, r0 - lsls r1, 5 - mov r8, r1 - movs r2, 0xC0 - lsls r2, 4 - adds r1, r2, 0 - ands r1, r0 - mov r2, sp - strh r0, [r2, 0x34] - cmp r1, 0 - bne _0806F788 - ldr r0, [sp, 0x20] - add r0, r8 - adds r1, r7, 0 - ldr r2, =0x04000008 - bl CpuSet - adds r4, 0x2 - str r4, [sp, 0x2C] - adds r7, 0x20 - mov r10, r7 - adds r5, 0x1 - mov r9, r5 - b _0806F86A - .pool -_0806F788: - movs r0, 0x80 - lsls r0, 4 - cmp r1, r0 - bne _0806F7CC - movs r1, 0 - adds r4, 0x2 - str r4, [sp, 0x2C] - movs r2, 0x20 - adds r2, r7 - mov r10, r2 - adds r5, 0x1 - mov r9, r5 -_0806F7A0: - lsls r4, r1, 24 - asrs r4, 24 - movs r0, 0x7 - subs r0, r4 - lsls r0, 2 - add r0, r8 - ldr r1, [sp, 0x20] - adds r0, r1, r0 - lsls r1, r4, 2 - adds r1, r7, r1 - ldr r2, =0x04000001 - bl CpuSet - adds r4, 0x1 - lsls r4, 24 - lsrs r1, r4, 24 - asrs r4, 24 - cmp r4, 0x7 - ble _0806F7A0 - b _0806F86A - .pool -_0806F7CC: - movs r1, 0 - adds r4, 0x2 - str r4, [sp, 0x2C] - movs r2, 0x20 - adds r2, r7 - mov r10, r2 - adds r5, 0x1 - mov r9, r5 - movs r0, 0xF - mov r12, r0 -_0806F7E0: - movs r2, 0 - lsls r4, r1, 24 - lsls r0, r4, 2 - lsrs r0, 24 - adds r6, r0, 0x3 - mov r1, r8 - adds r5, r1, r0 -_0806F7EE: - lsls r1, r2, 24 - asrs r1, 24 - subs r0, r6, r1 - mov r2, sp - adds r3, r2, r0 - adds r0, r5, r1 - ldr r2, [sp, 0x20] - adds r0, r2, r0 - ldrb r2, [r0] - mov r0, r12 - ands r0, r2 - lsls r0, 4 - lsrs r2, 4 - orrs r0, r2 - strb r0, [r3] - adds r1, 0x1 - lsls r1, 24 - lsrs r2, r1, 24 - asrs r1, 24 - cmp r1, 0x3 - ble _0806F7EE - movs r1, 0x80 - lsls r1, 17 - adds r0, r4, r1 - lsrs r1, r0, 24 - asrs r0, 24 - cmp r0, 0x7 - ble _0806F7E0 - mov r2, sp - ldrh r0, [r2, 0x34] - movs r2, 0x80 - lsls r2, 4 - ands r0, r2 - cmp r0, 0 - beq _0806F860 - movs r1, 0 -_0806F836: - lsls r4, r1, 24 - asrs r4, 24 - movs r0, 0x7 - subs r0, r4 - lsls r0, 2 - add r0, sp - lsls r1, r4, 2 - adds r1, r7, r1 - ldr r2, =0x04000001 - bl CpuSet - adds r4, 0x1 - lsls r4, 24 - lsrs r1, r4, 24 - asrs r4, 24 - cmp r4, 0x7 - ble _0806F836 - b _0806F86A - .pool -_0806F860: - mov r0, sp - adds r1, r7, 0 - ldr r2, =0x04000008 - bl CpuSet -_0806F86A: - ldr r4, [sp, 0x2C] - mov r7, r10 - mov r1, r9 - lsls r0, r1, 24 - lsrs r5, r0, 24 -_0806F874: - ldr r2, [sp, 0x28] - cmp r5, r2 - bcs _0806F87C - b _0806F748 -_0806F87C: - movs r0, 0x20 - ldr r1, [sp, 0x28] - subs r0, r1 - lsls r0, 1 - adds r4, r0 - ldr r2, [sp, 0x30] - lsls r0, r2, 24 - lsrs r0, 24 -_0806F88C: - ldr r1, [sp, 0x24] - cmp r0, r1 - bcs _0806F894 - b _0806F740 -_0806F894: - add sp, 0x38 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end CopySpriteTiles - - thumb_func_start CountTrailingZeroBits -CountTrailingZeroBits: @ 806F8A8 - push {lr} - adds r2, r0, 0 - movs r1, 0 - movs r3, 0x1 -_0806F8B0: - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _0806F8BC - adds r0, r1, 0 - b _0806F8CA -_0806F8BC: - lsrs r2, 1 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1F - bls _0806F8B0 - movs r0, 0 -_0806F8CA: - pop {r1} - bx r1 - thumb_func_end CountTrailingZeroBits - - thumb_func_start CalcCRC16 -CalcCRC16: @ 806F8D0 - push {r4-r7,lr} - adds r7, r0, 0 - adds r4, r1, 0 - ldr r2, =0x00001121 - movs r3, 0 - cmp r3, r4 - bge _0806F91C - movs r6, 0x1 - ldr r0, =0x00008408 - adds r5, r0, 0 -_0806F8E4: - adds r0, r7, r3 - ldrb r0, [r0] - eors r2, r0 - movs r1, 0 - adds r3, 0x1 -_0806F8EE: - adds r0, r2, 0 - ands r0, r6 - cmp r0, 0 - beq _0806F908 - lsrs r0, r2, 1 - eors r0, r5 - lsls r0, 16 - lsrs r2, r0, 16 - b _0806F90A - .pool -_0806F908: - lsrs r2, 1 -_0806F90A: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x7 - bls _0806F8EE - lsls r0, r3, 16 - lsrs r3, r0, 16 - cmp r3, r4 - blt _0806F8E4 -_0806F91C: - mvns r0, r2 - lsls r0, 16 - lsrs r0, 16 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end CalcCRC16 - - thumb_func_start CalcCRC16WithTable -CalcCRC16WithTable: @ 806F928 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldr r2, =0x00001121 - movs r3, 0 - cmp r3, r4 - bcs _0806F956 - ldr r6, =gUnknown_0832A3D8 -_0806F938: - lsrs r1, r2, 8 - adds r0, r5, r3 - ldrb r0, [r0] - eors r2, r0 - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r6 - ldrh r0, [r0] - adds r2, r0, 0 - eors r2, r1 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r4 - bcc _0806F938 -_0806F956: - mvns r0, r2 - lsls r0, 16 - lsrs r0, 16 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end CalcCRC16WithTable - - thumb_func_start CalcByteArraySum -CalcByteArraySum: @ 806F96C - push {r4,lr} - adds r4, r0, 0 - movs r3, 0 - movs r2, 0 - cmp r3, r1 - bcs _0806F984 -_0806F978: - adds r0, r4, r2 - ldrb r0, [r0] - adds r3, r0 - adds r2, 0x1 - cmp r2, r1 - bcc _0806F978 -_0806F984: - adds r0, r3, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end CalcByteArraySum - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/wallclock.s b/asm/wallclock.s index b74ac29b2..0d6f05a23 100644 --- a/asm/wallclock.s +++ b/asm/wallclock.s @@ -361,7 +361,7 @@ Cb2_StartWallClock: @ 81349F4 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0x1 bl PutWindowTilemap movs r0, 0x2 @@ -508,7 +508,7 @@ _08134BA4: str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0x1 bl PutWindowTilemap movs r0, 0x2 @@ -691,7 +691,7 @@ sub_8134DC4: @ 8134DC4 str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0 - bl Print + bl PrintTextOnWindow movs r0, 0 bl PutWindowTilemap movs r0, 0 diff --git a/asm/weather.s b/asm/weather.s index 769d77c6b..6612fd66c 100644 --- a/asm/weather.s +++ b/asm/weather.s @@ -3127,7 +3127,7 @@ _080AC910: strh r0, [r4, 0x8] b _080AC922 _080AC918: - bl script_env_2_enable_and_set_ctx_running + bl EnableBothScriptContexts adds r0, r5, 0 bl DestroyTask _080AC922: diff --git a/asm/wild_encounter.s b/asm/wild_encounter.s index 79222e3a9..2c628a5e4 100644 --- a/asm/wild_encounter.s +++ b/asm/wild_encounter.s @@ -670,7 +670,7 @@ sub_80B4D78: @ 80B4D78 lsrs r0, 16 cmp r0, 0x4F bhi _080B4E0E - bl sub_80FC3B8 + bl SafariZoneGetActivePokeblock adds r7, r0, 0 cmp r7, 0 beq _080B4E0E @@ -835,7 +835,7 @@ _080B4E98: bl GetMonData adds r1, r0, 0 adds r0, r4, 0 - bl pokemon_species_get_gender_info + bl GetGenderFromSpeciesAndPersonality lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xFE @@ -858,7 +858,7 @@ _080B4F02: adds r1, r6, 0 adds r2, r7, 0 movs r3, 0x20 - bl sub_8067EF8 + bl CreateMonWithGenderNatureLetter b _080B4F40 .pool _080B4F28: @@ -871,7 +871,7 @@ _080B4F28: adds r1, r6, 0 adds r2, r7, 0 movs r3, 0x20 - bl pokemon_make_with_nature + bl CreateMonWithNature _080B4F40: add sp, 0xC pop {r4-r7} @@ -1063,7 +1063,7 @@ _080B50A2: lsls r2, r4, 24 lsrs r2, 24 ldr r0, =gEnemyParty - bl sub_80691F4 + bl SetMonMoveSlot adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 @@ -1464,7 +1464,7 @@ _080B53D4: beq _080B53F2 b _080B54FE _080B53F2: - bl sub_8161EDC + bl TryStartRoamerEncounter lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1550,7 +1550,7 @@ _080B5492: lsrs r0, 24 cmp r0, 0x1 bne _080B54FE - bl sub_8161EDC + bl TryStartRoamerEncounter lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1643,8 +1643,8 @@ _080B556E: .pool thumb_func_end rock_smash_wild_pokemon_encounter - thumb_func_start sub_80B5578 -sub_80B5578: @ 80B5578 + thumb_func_start SweetScentWildEncounter +SweetScentWildEncounter: @ 80B5578 push {r4,r5,lr} sub sp, 0x4 mov r5, sp @@ -1740,7 +1740,7 @@ _080B562C: ldr r4, [r0] cmp r4, 0 beq _080B56F2 - bl sub_8161EDC + bl TryStartRoamerEncounter lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1788,7 +1788,7 @@ _080B568C: ldr r4, [r0] cmp r4, 0 beq _080B56F2 - bl sub_8161EDC + bl TryStartRoamerEncounter lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -1814,7 +1814,7 @@ _080B56F4: pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_80B5578 + thumb_func_end SweetScentWildEncounter thumb_func_start GetFishingWildMonListHeader GetFishingWildMonListHeader: @ 80B56FC @@ -2027,7 +2027,7 @@ sub_80B5870: @ 80B5870 cmp r4, 0 bne _080B58C4 ldr r0, =gUnknown_082A4B2A - bl script_env_1_execute_new_script + bl ScriptContext1_SetupScript movs r0, 0x1 b _080B58C6 .pool diff --git a/charmap.txt b/charmap.txt index e9919584b..f698701c4 100644 --- a/charmap.txt +++ b/charmap.txt @@ -144,7 +144,6 @@ RIGHT_ARROW = 7C 'ä' = F4 'ö' = F5 'ü' = F6 -@ Arrows at F7-FA are duplicates of 79-7C. Unused? TALL_PLUS = FC 0C FB '$' = FF @@ -340,19 +339,68 @@ MAXIE = FD 0B KYOGRE = FD 0C GROUDON = FD 0D -@ battle macros +@ battle string placeholders -UNKNOWN_STR = FD 00 - -ATTACKING_TRAINER = FD 08 -DEFENDING_TRAINER = FD 09 - -ATTACKING_MON = FD 0C -DEFENDING_MON = FD 0D +B_BUFF1 = FD 00 +B_BUFF2 = FD 01 +B_COPY_VAR_1 = FD 02 +B_COPY_VAR_2 = FD 03 +B_COPY_VAR_3 = FD 04 +B_PLAYER_MON1_NAME = FD 05 +B_OPPONENT_MON1_NAME = FD 06 +B_PLAYER_MON2_NAME = FD 07 +B_OPPONENT_MON2_NAME = FD 08 +B_LINK_PLAYER_MON1_NAME = FD 09 +B_LINK_OPPONENT_MON1_NAME = FD 0A +B_LINK_PLAYER_MON2_NAME = FD 0B +B_LINK_OPPONENT_MON2_NAME = FD 0C +B_ATK_NAME_WITH_PREFIX_MON1 = FD 0D +B_ATK_NAME = FD 0E +B_ATK_NAME_WITH_PREFIX = FD 0F +B_DEF_NAME_WITH_PREFIX = FD 10 +B_EFF_NAME_WITH_PREFIX = FD 11 @ EFF = short for gEffectBank +B_SCR_ACTIVE_NAME_WITH_PREFIX = FD 12 +B_ACTIVE_NAME_WITH_PREFIX = FD 13 +B_CURRENT_MOVE = FD 14 +B_LAST_MOVE = FD 15 +B_LAST_ITEM = FD 16 +B_LAST_ABILITY = FD 17 +B_ATK_ABILITY = FD 18 +B_DEF_ABILITY = FD 19 +B_SCR_ACTIVE_ABILITY = FD 1A +B_EFF_ABILITY = FD 1B +B_TRAINER1_CLASS = FD 1C +B_TRAINER1_NAME = FD 1D +B_1E = FD 1E @ trainer name for a link player +B_1F = FD 1F @ trainer name for a link player +B_20 = FD 20 @ trainer name for a link player +B_21 = FD 21 @ trainer name for a link player +B_22 = FD 22 @ trainer name for a link player +B_PLAYER_NAME = FD 23 +B_TRAINER1_LOSE_TEXT = FD 24 +B_TRAINER1_WIN_TEXT = FD 25 +B_26 = FD 26 +B_PC_CREATOR_NAME = FD 27 +B_ATK_PREFIX1 = FD 28 +B_DEF_PREFIX1 = FD 29 +B_ATK_PREFIX2 = FD 2A +B_DEF_PREFIX2 = FD 2B +B_ATK_PREFIX3 = FD 2C +B_DEF_PREFIX3 = FD 2D +B_TRAINER2_CLASS = FD 2E +B_TRAINER2_NAME = FD 2F +B_TRAINER2_LOSE_TEXT = FD 30 +B_TRAINER2_WIN_TEXT = FD 31 +B_PARTNER_CLASS = FD 32 +B_PARTNER_NAME = FD 33 +B_BUFF3 = FD 34 @ indicates the end of a town/city name (before " TOWN" or " CITY") NAME_END = FC 00 +@ special 0xF7 character +SPECIAL_F7 = F7 + @ more text functions COLOR = FC 01 @ use a color listed below right after diff --git a/common_syms/bg.txt b/common_syms/bg.txt new file mode 100644 index 000000000..2495d1646 --- /dev/null +++ b/common_syms/bg.txt @@ -0,0 +1 @@ +gUnneededFireRedVariable diff --git a/data/battle_4.s b/data/battle_4.s new file mode 100644 index 000000000..1c8fb5384 --- /dev/null +++ b/data/battle_4.s @@ -0,0 +1,50 @@ +@ the second big chunk of data + + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + +gMoveEffectBS_Ptrs:: @ 831C224 + .incbin "baserom.gba", 0x31c224, 0xa4 + +gUnknown_0831C2C8:: @ 831C2C8 + .incbin "baserom.gba", 0x31c2c8, 0x20 + +gUnknown_0831C2E8:: @ 831C2E8 + .incbin "baserom.gba", 0x31c2e8, 0xd8 + +gUnknown_0831C3C0:: @ 831C3C0 + .incbin "baserom.gba", 0x31c3c0, 0x18 + +sProtectSuccessRates:: @ 831C3D8 + .incbin "baserom.gba", 0x31c3d8, 0x8 + +gUnknown_0831C3E0:: @ 831C3E0 + .incbin "baserom.gba", 0x31c3e0, 0x28 + +gUnknown_0831C408:: @ 831C408 + .incbin "baserom.gba", 0x31c408, 0xc + +gUnknown_0831C414:: @ 831C414 + .incbin "baserom.gba", 0x31c414, 0x14 + +gUnknown_0831C428:: @ 831C428 + .incbin "baserom.gba", 0x31c428, 0x18 + +@ 831C440 + .include "data/pickup_items.inc" + +sTerrainToType:: @ 831C483 + .incbin "baserom.gba", 0x31c483, 0xa + +sBallCatchBonuses:: @ 831C48D + .incbin "baserom.gba", 0x31c48d, 0x7 + +gUnknown_0831C494:: @ 831C494 + .incbin "baserom.gba", 0x31c494, 0x64 + +gUnknown_0831C4F8:: @ 831C4F8 + .incbin "baserom.gba", 0x31c4f8, 0x1c + diff --git a/data/battle_ai_scripts.s b/data/battle_ai_scripts.s index dfcda5397..0cb225ef5 100644 --- a/data/battle_ai_scripts.s +++ b/data/battle_ai_scripts.s @@ -4,5 +4,5 @@ .section script_data, "aw", %progbits .align 2 -gUnknown_082DBEF8:: @ 82DBEF8 +gBattleAI_ScriptsTable:: @ 82DBEF8 .incbin "baserom.gba", 0x2dbef8, 0x2458 diff --git a/data/battle_controller_link_opponent.s b/data/battle_controller_link_opponent.s new file mode 100644 index 000000000..71b1f5438 --- /dev/null +++ b/data/battle_controller_link_opponent.s @@ -0,0 +1,8 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + +gLinkOpponentBufferCommands:: @ 831C7B4 + .incbin "baserom.gba", 0x31c7b4, 0xe4 diff --git a/data/battle_controller_link_partner.s b/data/battle_controller_link_partner.s new file mode 100644 index 000000000..25bcb970b --- /dev/null +++ b/data/battle_controller_link_partner.s @@ -0,0 +1,9 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + +gLinkPartnerBufferCommands:: @ 85C9A94 + .incbin "baserom.gba", 0x5c9a94, 0xe4 + diff --git a/data/battle_controller_opponent.s b/data/battle_controller_opponent.s new file mode 100644 index 000000000..7f159fb54 --- /dev/null +++ b/data/battle_controller_opponent.s @@ -0,0 +1,9 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + +gOpponentBufferCommands:: @ 831C6C8 + .incbin "baserom.gba", 0x31c6c8, 0xec + diff --git a/data/battle_controller_player.s b/data/battle_controller_player.s new file mode 100644 index 000000000..1c7ff56fe --- /dev/null +++ b/data/battle_controller_player.s @@ -0,0 +1,8 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + +gPlayerBufferCommands:: @ 831C514 + .incbin "baserom.gba", 0x31c514, 0xe4 diff --git a/data/battle_controller_player_partner.s b/data/battle_controller_player_partner.s new file mode 100644 index 000000000..bc00258ae --- /dev/null +++ b/data/battle_controller_player_partner.s @@ -0,0 +1,10 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gPlayerPartnerBufferCommands:: @ 8617170 + .incbin "baserom.gba", 0x617170, 0xE4 + + @ apparently unused data + .incbin "baserom.gba", 0x617254, 32 diff --git a/data/battle_controller_recorded_opponent.s b/data/battle_controller_recorded_opponent.s new file mode 100644 index 000000000..72544fdab --- /dev/null +++ b/data/battle_controller_recorded_opponent.s @@ -0,0 +1,8 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gRecordedOpponentBufferCommands:: @ 860AE90 + .incbin "baserom.gba", 0x60ae90, 0xe4 + diff --git a/data/battle_controller_recorded_player.s b/data/battle_controller_recorded_player.s new file mode 100644 index 000000000..2710a869b --- /dev/null +++ b/data/battle_controller_recorded_player.s @@ -0,0 +1,8 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + +gRecordedPlayerBufferCommands:: @ 860AF74 + .incbin "baserom.gba", 0x60af74, 0xe4 diff --git a/data/battle_controller_safari.s b/data/battle_controller_safari.s new file mode 100644 index 000000000..7c6e251c7 --- /dev/null +++ b/data/battle_controller_safari.s @@ -0,0 +1,8 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + + gSafariBufferCommands:: @ 85CDF20 + .incbin "baserom.gba", 0x5cdf20, 0x380 diff --git a/data/lottery_corner.s b/data/battle_controller_wally.s similarity index 50% rename from data/lottery_corner.s rename to data/battle_controller_wally.s index 498e0f692..41c40f9eb 100644 --- a/data/lottery_corner.s +++ b/data/battle_controller_wally.s @@ -2,6 +2,8 @@ .include "constants/constants.inc" .section .rodata + + +gWallyBufferCommands:: @ 85DFDC0 + .incbin "baserom.gba", 0x5dfdc0, 0xe4 -gUnknown_085E7080:: @ 85E7080 - .incbin "baserom.gba", 0x5e7080, 0x8 diff --git a/data/battle_message.s b/data/battle_message.s index 1d8fde5d6..34a2ad3c8 100644 --- a/data/battle_message.s +++ b/data/battle_message.s @@ -3,178 +3,547 @@ .section .rodata - .incbin "baserom.gba", 0x5c9b78, 0x8ac + +.string "{STRING 36}$" +.string "{STRING 0} gained{PLAYER}\n{STRING 52} EXP. Points!\p$" +.string "$" +.string " a boosted$" +.string "{STRING 0} grew to\nLV. {PLAYER}!{UNKNOWN_A}\p$" +.string "{STRING 0} learned\n{PLAYER}!{UNKNOWN_A}\p$" +.string "{STRING 0} is trying to\nlearn {PLAYER}.\p$" +.string "But, {STRING 0} can’t learn\nmore than four moves.\p$" +.string "Delete a move to make\nroom for {PLAYER}?$" +.string "{STRING 0} forgot\n{PLAYER}.\p$" +.string "{PAUSE 32}Stop learning\n{PLAYER}?$" +.string "{STRING 0} did not learn\n{PLAYER}.\p$" +.string "Use next POKéMON?$" +.string "{STRING 15}’s\nattack missed!$" +.string "{STRING 16}\nprotected itself!$" +.string "{STRING 16} avoided\ndamage with {STRING 25}!$" +.string "{STRING 16} makes GROUND\nmoves miss with {STRING 25}!$" +.string "{STRING 16} avoided\nthe attack!$" +.string "It doesn’t affect\n{STRING 16}‥$" +.string "{STRING 15}\nfainted!\p$" +.string "{STRING 16}\nfainted!\p$" +.string "{STRING 35} got ¥{STRING 0}\nfor winning!\p$" +.string "{STRING 35} is out of\nusable POKéMON!\p$" +.string "{STRING 35} whited out!{PAUSE_UNTIL_PRESS}$" +.string "{STRING 19} prevents\nescape with {STRING 26}!\p$" +.string "Can’t escape!\p$" +.string "{STRING 15} can’t escape!$" +.string "Hit {STRING 0} time(s)!$" +.string "{STRING 17}\nfell asleep!$" +.string "{STRING 19}’s {STRING 26}\nmade {STRING 17} sleep!$" +.string "{STRING 16} is\nalready asleep!$" +.string "{STRING 15} is\nalready asleep!$" +.string "{STRING 16}\nwasn’t affected!$" +.string "{STRING 17}\nwas poisoned!$" +.string "{STRING 19}’s {STRING 26}\npoisoned {STRING 17}!$" +.string "{STRING 15} is hurt\nby poison!$" +.string "{STRING 16} is already\npoisoned.$" +.string "{STRING 17} is badly\npoisoned!$" +.string "{STRING 16} had its\nenergy drained!$" +.string "{STRING 17} was burned!$" +.string "{STRING 19}’s {STRING 26}\nburned {STRING 17}!$" +.string "{STRING 15} is hurt\nby its burn!$" +.string "{STRING 16} already\nhas a burn.$" +.string "{STRING 17} was\nfrozen solid!$" +.string "{STRING 19}’s {STRING 26}\nfroze {STRING 17} solid!$" +.string "{STRING 15} is\nfrozen solid!$" +.string "{STRING 16} was\ndefrosted!$" +.string "{STRING 15} was\ndefrosted!$" +.string "{STRING 15} was\ndefrosted by {STRING 20}!$" +.string "{STRING 17} is paralyzed!\nIt may be unable to move!$" +.string "{STRING 19}’s {STRING 26}\nparalyzed {STRING 17}!\lIt may be unable to move!$" +.string "{STRING 15} is paralyzed!\nIt can’t move!$" +.string "{STRING 16} is\nalready paralyzed!$" +.string "{STRING 16} was\nhealed of paralysis!$" +.string "{STRING 16}’s\ndream was eaten!$" +.string "{STRING 15}’s {STRING 0}\nwon’t go higher!$" +.string "{STRING 16}’s {STRING 0}\nwon’t go lower!$" +.string "Your team’s {STRING 0}\nstopped working!$" +.string "The foe’s {STRING 0}\nstopped working!$" +.string "{STRING 15} is\nconfused!$" +.string "{STRING 15} snapped\nout of confusion!$" +.string "{STRING 17} became\nconfused!$" +.string "{STRING 16} is\nalready confused!$" +.string "{STRING 16}\nfell in love!$" +.string "{STRING 15} is in love\nwith {STRING 19}!$" +.string "{STRING 15} is\nimmobilized by love!$" +.string "{STRING 16} was\nblown away!$" +.string "{STRING 15} transformed\ninto the {STRING 0} type!$" +.string "{STRING 15} flinched!$" +.string "{STRING 16} regained\nhealth!$" +.string "{STRING 16}’s\nHP is full!$" +.string "{STRING 42}’s {STRING 20}\nraised SP. DEF!$" +.string "{STRING 42}’s {STRING 20}\nraised SP. DEF a little!$" +.string "{STRING 42}’s {STRING 20}\nraised DEFENSE!$" +.string "{STRING 42}’s {STRING 20}\nraised DEFENSE a little!$" +.string "{STRING 42}’s party is covered\nby a veil!$" +.string "{STRING 16}’s party is protected\nby SAFEGUARD!$" +.string "{STRING 44}’s party is no longer\nprotected by SAFEGUARD!$" +.string "{STRING 15} went\nto sleep!$" +.string "{STRING 15} slept and\nbecame healthy!$" +.string "{STRING 15} whipped\nup a whirlwind!$" +.string "{STRING 15} took\nin sunlight!$" +.string "{STRING 15} lowered\nits head!$" +.string "{STRING 15} is glowing!$" +.string "{STRING 15} flew\nup high!$" +.string "{STRING 15} dug a hole!$" +.string "{STRING 15} hid\nunderwater!$" +.string "{STRING 15} sprang up!$" +.string "{STRING 16} was squeezed by\n{STRING 15}’s BIND!$" +.string "{STRING 16} was trapped\nin the vortex!$" +.string "{STRING 16} was trapped\nby SAND TOMB!$" +.string "{STRING 16} was WRAPPED by\n{STRING 15}!$" +.string "{STRING 15} CLAMPED\n{STRING 16}!$" +.string "{STRING 15} is hurt\nby {STRING 0}!$" +.string "{STRING 15} was freed\nfrom {STRING 0}!$" +.string "{STRING 15} kept going\nand crashed!$" gUnknown_085CA424:: @ 85CA424 - .incbin "baserom.gba", 0x5ca424, 0x35 + +.string "{STRING 42} became\nshrouded in MIST!$" +.string "{STRING 19} is protected\nby MIST!$" gUnknown_085CA459:: @ 85CA459 - .incbin "baserom.gba", 0x5ca459, 0xe48 + +.string "{STRING 15} is getting\npumped!$" +.string "{STRING 15} is hit\nwith recoil!$" +.string "{STRING 15} protected\nitself!$" +.string "{STRING 15} is buffeted\nby the sandstorm!$" +.string "{STRING 15} is pelted\nby HAIL!$" +.string "{STRING 40}’s {STRING 0}\nwore off!$" +.string "{STRING 16} was seeded!$" +.string "{STRING 16} evaded\nthe attack!$" +.string "{STRING 15}’s health is\nsapped by LEECH SEED!$" +.string "{STRING 15} is fast\nasleep.$" +.string "{STRING 15} woke up!$" +.string "But {STRING 19}’s UPROAR\nkept it awake!$" +.string "{STRING 15} woke up\nin the UPROAR!$" +.string "{STRING 15} caused\nan UPROAR!$" +.string "{STRING 15} is making\nan UPROAR!$" +.string "{STRING 15} calmed down.$" +.string "But {STRING 16} can’t\nsleep in an UPROAR!$" +.string "{STRING 15} STOCKPILED\n{STRING 0}!$" +.string "{STRING 15} can’t\nSTOCKPILE any more!$" +.string "But {STRING 16} can’t\nsleep in an UPROAR!$" +.string "But the UPROAR kept\n{STRING 16} awake!$" +.string "{STRING 16} stayed awake\nusing its {STRING 25}!$" +.string "{STRING 15} is storing\nenergy!$" +.string "{STRING 15} unleashed\nenergy!$" +.string "{STRING 15} became\nconfused due to fatigue!$" +.string "{STRING 35} picked up\n¥{STRING 0}!\p$" +.string "{STRING 16} is\nunaffected!$" +.string "{STRING 15} transformed\ninto {STRING 0}!$" +.string "{STRING 15} made\na SUBSTITUTE!$" +.string "{STRING 15} already\nhas a SUBSTITUTE!$" +.string "The SUBSTITUTE took damage\nfor {STRING 16}!\p$" +.string "{STRING 16}’s\nSUBSTITUTE faded!\p$" +.string "{STRING 15} must\nrecharge!$" +.string "{STRING 16}’s RAGE\nis building!$" +.string "{STRING 16}’s {STRING 0}\nwas disabled!$" +.string "{STRING 15} is disabled\nno more!$" +.string "{STRING 16} got\nan ENCORE!$" +.string "{STRING 15}’s ENCORE\nended!$" +.string "{STRING 15} took aim\nat {STRING 16}!$" +.string "{STRING 15} SKETCHED\n{STRING 0}!$" +.string "{STRING 15} is trying\nto take its foe with it!$" +.string "{STRING 16} took\n{STRING 15} with it!$" +.string "Reduced {STRING 16}’s\n{STRING 0} by {PLAYER}!$" +.string "{STRING 15} stole\n{STRING 16}’s {STRING 22}!$" +.string "{STRING 16} can’t\nescape now!$" +.string "{STRING 16} fell into\na NIGHTMARE!$" +.string "{STRING 15} is locked\nin a NIGHTMARE!$" +.string "{STRING 15} cut its own HP and\nlaid a CURSE on {STRING 16}!$" +.string "{STRING 15} is afflicted\nby the CURSE!$" +.string "SPIKES were scattered all around\nthe opponent’s side!$" +.string "{STRING 19} is hurt\nby SPIKES!$" +.string "{STRING 15} identified\n{STRING 16}!$" +.string "{STRING 15}’s PERISH count\nfell to {STRING 0}!$" +.string "{STRING 15} braced\nitself!$" +.string "{STRING 16} ENDURED\nthe hit!$" +.string "MAGNITUDE {STRING 0}!$" +.string "{STRING 15} cut its own HP\nand maximized ATTACK!$" +.string "{STRING 15} copied\n{STRING 16}’s stat changes!$" +.string "{STRING 15} got free of\n{STRING 16}’s {STRING 0}!$" +.string "{STRING 15} shed\nLEECH SEED!$" +.string "{STRING 15} blew away\nSPIKES!$" +.string "{STRING 15} fled from\nbattle!$" +.string "{STRING 15} foresaw\nan attack!$" +.string "{STRING 16} took the\n{STRING 0} attack!$" +.string "{STRING 15} chose\n{STRING 20} as its destiny!$" +.string "{STRING 0}’s attack!$" +.string "{STRING 15} became the\ncenter of attention!$" +.string "{STRING 15} began\ncharging power!$" +.string "NATURE POWER turned into\n{STRING 20}!$" +.string "{STRING 15}’s status\nreturned to normal!$" +.string "{STRING 16} was subjected\nto TORMENT!$" +.string "{STRING 15} is tightening\nits focus!$" +.string "{STRING 16} fell for\nthe TAUNT!$" +.string "{STRING 15} is ready to\nhelp {STRING 16}!$" +.string "{STRING 15} switched\nitems with its opponent!$" +.string "{STRING 15} obtained\n{STRING 0}.$" +.string "{STRING 16} obtained\n{PLAYER}.$" +.string "{STRING 15} obtained\n{STRING 0}.\p{STRING 16} obtained\n{PLAYER}.$" +.string "{STRING 15} copied\n{STRING 16}’s {STRING 25}!$" +.string "{STRING 15} made a WISH!$" +.string "{STRING 0}’s WISH\ncame true!$" +.string "{STRING 15} planted its roots!$" +.string "{STRING 15} absorbed\nnutrients with its roots!$" +.string "{STRING 16} anchored\nitself with its roots!$" +.string "{STRING 15} made\n{STRING 16} drowsy!$" +.string "{STRING 15} knocked off\n{STRING 16}’s {STRING 22}!$" +.string "{STRING 15} swapped abilities\nwith its opponent!$" +.string "{STRING 15} sealed the\nopponent’s move(s)!$" +.string "{STRING 15} wants the\nopponent to bear a GRUDGE!$" +.string "{STRING 15}’s {STRING 0} lost\nall its PP due to the GRUDGE!$" +.string "{STRING 15} shrouded\nitself in {STRING 20}!$" +.string "{STRING 15}’s {STRING 20}\nwas bounced back by MAGIC COAT!$" +.string "{STRING 15} waits for a target\nto make a move!$" +.string "{STRING 16} SNATCHED\n{STRING 19}’s move!$" +.string "Electricity’s power was\nweakened!$" +.string "Fire’s power was\nweakened!$" +.string "{STRING 15} found\none {STRING 22}!$" +.string "A soothing aroma wafted\nthrough the area!$" +.string "Items can’t be used now.{PAUSE 64}$" +.string "For {STRING 19},\n{STRING 22} {STRING 0}$" +.string "{STRING 19} used\n{STRING 22} to get pumped!$" +.string "{STRING 15} lost its\nfocus and couldn’t move!$" +.string "{STRING 16} was\ndragged out!\p$" +.string "The wall shattered!$" +.string "But it had no effect!$" +.string "{STRING 18} has no\nmoves left!\p$" +.string "{STRING 18}’s {STRING 20}\nis disabled!\p$" +.string "{STRING 18} can’t use the same\nmove in a row due to the TORMENT!\p$" +.string "{STRING 18} can’t use\n{STRING 20} after the TAUNT!\p$" +.string "{STRING 18} can’t use the\nsealed {STRING 20}!\p$" +.string "{STRING 19}’s {STRING 26}\nmade it rain!$" +.string "{STRING 19}’s {STRING 26}\nraised its SPEED!$" +.string "{STRING 16} was protected\nby {STRING 25}!$" +.string "{STRING 16}’s {STRING 25}\nprevents {STRING 15}\lfrom using {STRING 20}!$" +.string "{STRING 16} restored HP\nusing its {STRING 25}!$" +.string "{STRING 16}’s {STRING 25}\nmade {STRING 20} useless!$" +.string "{STRING 16}’s {STRING 25}\nmade it the {STRING 0} type!$" +.string "{STRING 17}’s {STRING 25}\nprevents paralysis!$" +.string "{STRING 16}’s {STRING 25}\nprevents romance!$" +.string "{STRING 17}’s {STRING 25}\nprevents poisoning!$" +.string "{STRING 16}’s {STRING 25}\nprevents confusion!$" +.string "{STRING 16}’s {STRING 25}\nraised its FIRE power!$" +.string "{STRING 16} anchors\nitself with {STRING 25}!$" +.string "{STRING 19}’s {STRING 26}\ncuts {STRING 16}’s ATTACK!$" +.string "{STRING 19}’s {STRING 26}\nprevents stat loss!$" +.string "{STRING 16}’s {STRING 25}\nhurt {STRING 15}!$" +.string "{STRING 19} TRACED\n{STRING 0}’s {PLAYER}!$" +.string "{STRING 17}’s {STRING 27}\nprevents burns!$" +.string "{STRING 16}’s {STRING 25}\nblocks {STRING 20}!$" +.string "{STRING 19}’s {STRING 26}\nblocks {STRING 20}!$" +.string "{STRING 15}’s {STRING 24}\nrestored its HP a little!$" +.string "{STRING 19}’s {STRING 26}\nwhipped up a sandstorm!$" +.string "{STRING 19}’s {STRING 26}\nintensified the sun’s rays!$" +.string "{STRING 19}’s {STRING 26}\nprevents {STRING 0} loss!$" +.string "{STRING 16}’s {STRING 25}\ninfatuated {STRING 15}!$" +.string "{STRING 16}’s {STRING 25}\nmade {STRING 20} ineffective!$" +.string "{STRING 19}’s {STRING 26}\ncured its {STRING 0} problem!$" +.string "It sucked up the\nLIQUID OOZE!$" +.string "{STRING 19} transformed!$" +.string "{STRING 16}’s {STRING 25}\ntook the attack!$" gUnknown_085CB2A1:: @ 85CB2A1 - .incbin "baserom.gba", 0x5cb2a1, 0xe9 + +.string "{STRING 0}’s {STRING 23}\nprevents switching!\p$" +.string "{STRING 16}’s {STRING 25}\nprevented {STRING 19}’s\l{STRING 0} from working!$" +.string "{STRING 19}’s {STRING 26}\nmade it ineffective!$" +.string "{STRING 17}’s {STRING 27}\nprevents flinching!$" +.string "{STRING 15}’s {STRING 24}\nprevents {STRING 16}’s\l{STRING 25} from working!$" +.string "{STRING 19}’s {STRING 26}\ncured its {STRING 0} problem!$" +.string "{STRING 19}’s {STRING 26}\nhad no effect on {STRING 17}!$" +.string "sharply $" gUnknown_085CB38A:: @ 85CB38A - .incbin "baserom.gba", 0x5cb38a, 0x20 + +.string "rose!$" +.string "harshly $" +.string "fell!$" +.string "{STRING 15}’s {STRING 0}\n{PLAYER}$" gUnknown_085CB3AA:: @ 85CB3AA - .incbin "baserom.gba", 0x5cb3aa, 0x120 + +.string "{STRING 16}’s {STRING 0}\n{PLAYER}$" +.string "Using {STRING 22}, the {STRING 0}\nof {STRING 19} {PLAYER}$" +.string "{STRING 15}’s {STRING 0}\n{PLAYER}$" +.string "{STRING 16}’s {STRING 0}\n{PLAYER}$" +.string "{STRING 15}’s stats won’t\ngo any higher!$" +.string "{STRING 16}’s stats won’t\ngo any lower!$" +.string "A critical hit!$" +.string "It’s a one-hit KO!$" +.string "{PAUSE 32}1, {PAUSE 15}2, and{PAUSE 15}‥ {PAUSE 15}‥ {PAUSE 15}‥ {PAUSE 15}{PLAY_SE 0x0038}Poof!\p$" +.string "And‥\p$" +.string "HM moves can’t be\nforgotten now.\p$" +.string "It’s not very effective‥$" +.string "It’s super effective!$" gUnknown_085CB4CA:: @ 85CB4CA - .incbin "baserom.gba", 0x5cb4ca, 0x5a + +.string "{PLAY_SE 0x0011}Got away safely!\p$" +.string "{PLAY_SE 0x0011}{STRING 15} fled\nusing its {STRING 22}!\p$" +.string "{PLAY_SE 0x0011}{STRING 15} fled\nusing {STRING 24}!\p$" +.string "{PLAY_SE 0x0011}Wild {STRING 0} fled!$" gUnknown_085CB524:: @ 85CB524 - .incbin "baserom.gba", 0x5cb524, 0x14 + +.string "Player defeated\n{STRING 32}!$" gUnknown_085CB538:: @ 85CB538 - .incbin "baserom.gba", 0x5cb538, 0x17 + +.string "Player beat {STRING 32}\nand {STRING 33}!$" gUnknown_085CB54F:: @ 85CB54F - .incbin "baserom.gba", 0x5cb54f, 0x18 + +.string "Player lost against\n{STRING 32}!$" gUnknown_085CB567:: @ 85CB567 - .incbin "baserom.gba", 0x5cb567, 0x1a + +.string "Player lost to {STRING 32}\nand {STRING 33}!$" gUnknown_085CB581:: @ 85CB581 - .incbin "baserom.gba", 0x5cb581, 0x25 + +.string "Player battled to a draw against\n{STRING 32}!$" gUnknown_085CB5A6:: @ 85CB5A6 - .incbin "baserom.gba", 0x5cb5a6, 0x2c + +.string "Player battled to a draw against\n{STRING 32} and {STRING 33}!$" gUnknown_085CB5D2:: @ 85CB5D2 - .incbin "baserom.gba", 0x5cb5d2, 0xd + +.string "{PLAY_SE 0x0011}{STRING 32} fled!$" gUnknown_085CB5DF:: @ 85CB5DF - .incbin "baserom.gba", 0x5cb5df, 0x44f + +.string "{PLAY_SE 0x0011}{STRING 32} and\n{STRING 33} fled!$" +.string "No! There’s no running\nfrom a TRAINER battle!\p$" +.string "Can’t escape!\p$" +.string "PROF. BIRCH: Don’t leave me like this!\p$" +.string "But nothing happened!$" +.string "But it failed!$" +.string "It hurt itself in its\nconfusion!$" +.string "The MIRROR MOVE failed!$" +.string "It started to rain!$" +.string "A downpour started!$" +.string "Rain continues to fall.$" +.string "The downpour continues.$" +.string "The rain stopped.$" +.string "A sandstorm brewed!$" +.string "The sandstorm rages.$" +.string "The sandstorm subsided.$" +.string "The sunlight got bright!$" +.string "The sunlight is strong.$" +.string "The sunlight faded.$" +.string "It started to hail!$" +.string "Hail continues to fall.$" +.string "The hail stopped.$" +.string "But it failed to SPIT UP\na thing!$" +.string "But it failed to SWALLOW\na thing!$" +.string "The wind turned into a\nHEAT WAVE!$" +.string "All stat changes were\neliminated!$" +.string "Coins scattered everywhere!$" +.string "It was too weak to make\na SUBSTITUTE!$" +.string "The battlers shared\ntheir pain!$" +.string "A bell chimed!$" +.string "All affected POKéMON will\nfaint in three turns!$" +.string "There’s no PP left for\nthis move!\p$" +.string "But there was no PP left\nfor the move!$" +.string "{STRING 15} ignored\norders while asleep!$" +.string "{STRING 15} ignored\norders!$" +.string "{STRING 15} began to nap!$" +.string "{STRING 15} is\nloafing around!$" +.string "{STRING 15} won’t\nobey!$" +.string "{STRING 15} turned away!$" +.string "{STRING 15} pretended\nnot to notice!$" +.string "{STRING 28} {STRING 29} is\nabout to use {PLAYER}.\pWill {STRING 35} change\nPOKéMON?$" +.string "{STRING 15} learned\n{STRING 0}!$" gUnknown_085CBA2E:: @ 85CBA2E - .incbin "baserom.gba", 0x5cba2e, 0x119 + +.string "Player defeated\n{STRING 28} {STRING 29}!\p$" +.string "{STRING 35} crept closer to\n{RIVAL}!$" +.string "{STRING 35} can’t get any closer!$" +.string "{RIVAL} is watching\ncarefully!$" +.string "{RIVAL} is curious about\nthe {STRING 0}!$" +.string "{RIVAL} is enthralled by\nthe {STRING 0}!$" +.string "{RIVAL} completely ignored\nthe {STRING 0}!$" +.string "{STRING 35} threw a {POKEBLOCK}\nat the {RIVAL}!$" +.string "{PLAY_SE 0x0049}ANNOUNCER: You’re out of\nSAFARI BALLS! Game over!\p$" +.string "{RIVAL} appeared!\p$" gUnknown_085CBB47:: @ 85CBB47 - .incbin "baserom.gba", 0x5cbb47, 0x13 + +.string "Wild {RIVAL} appeared!\p$" gUnknown_085CBB5A:: @ 85CBB5A - .incbin "baserom.gba", 0x5cbb5a, 0x13 + +.string "Wild {RIVAL} appeared!\p$" gUnknown_085CBB6D:: @ 85CBB6D - .incbin "baserom.gba", 0x5cbb6d, 0x15 + +.string "Wild {RIVAL} appeared!{PAUSE 127}$" gUnknown_085CBB82:: @ 85CBB82 - .incbin "baserom.gba", 0x5cbb82, 0x1a + +.string "Wild {RIVAL} and\n{AQUA} appeared!\p$" gUnknown_085CBB9C:: @ 85CBB9C - .incbin "baserom.gba", 0x5cbb9c, 0x1d + +.string "{STRING 28} {STRING 29}\nwould like to battle!\p$" gUnknown_085CBBB9:: @ 85CBBB9 - .incbin "baserom.gba", 0x5cbbb9, 0x14 + +.string "{STRING 32}\nwants to battle!$" gUnknown_085CBBCD:: @ 85CBBCD - .incbin "baserom.gba", 0x5cbbcd, 0x1a + +.string "{STRING 32} and {STRING 33}\nwant to battle!$" gUnknown_085CBBE7:: @ 85CBBE7 - .incbin "baserom.gba", 0x5cbbe7, 0x13 + +.string "{STRING 28} {STRING 29} sent\nout {RIVAL}!$" gUnknown_085CBBFA:: @ 85CBBFA - .incbin "baserom.gba", 0x5cbbfa, 0x1a + +.string "{STRING 28} {STRING 29} sent\nout {RIVAL} and {AQUA}!$" gUnknown_085CBC14:: @ 85CBC14 - .incbin "baserom.gba", 0x5cbc14, 0x13 + +.string "{STRING 28} {STRING 29} sent\nout {STRING 0}!$" gUnknown_085CBC27:: @ 85CBC27 - .incbin "baserom.gba", 0x5cbc27, 0x10 + +.string "{STRING 32} sent out\n{RIVAL}!$" gUnknown_085CBC37:: @ 85CBC37 - .incbin "baserom.gba", 0x5cbc37, 0x17 + +.string "{STRING 32} sent out\n{RIVAL} and {AQUA}!$" gUnknown_085CBC4E:: @ 85CBC4E - .incbin "baserom.gba", 0x5cbc4e, 0x20 + +.string "{STRING 32} sent out {STRING 10}!\n{STRING 33} sent out {STRING 12}!$" gUnknown_085CBC6E:: @ 85CBC6E - .incbin "baserom.gba", 0x5cbc6e, 0x10 + +.string "{STRING 32} sent out\n{STRING 0}!$" gUnknown_085CBC7E:: @ 85CBC7E - .incbin "baserom.gba", 0x5cbc7e, 0x10 + +.string "{STRING 34} sent out\n{STRING 0}!$" gUnknown_085CBC8E:: @ 85CBC8E - .incbin "baserom.gba", 0x5cbc8e, 0x8 + +.string "Go! {STRING 5}!$" gUnknown_085CBC96:: @ 85CBC96 - .incbin "baserom.gba", 0x5cbc96, 0xf + +.string "Go! {STRING 5} and\n{VERSION}!$" gUnknown_085CBCA5:: @ 85CBCA5 - .incbin "baserom.gba", 0x5cbca5, 0x8 + +.string "Go! {STRING 0}!$" gUnknown_085CBCAD:: @ 85CBCAD - .incbin "baserom.gba", 0x5cbcad, 0xb + +.string "Do it! {STRING 0}!$" gUnknown_085CBCB8:: @ 85CBCB8 - .incbin "baserom.gba", 0x5cbcb8, 0xf + +.string "Go for it, {STRING 0}!$" gUnknown_085CBCC7:: @ 85CBCC7 - .incbin "baserom.gba", 0x5cbcc7, 0x1e + +.string "Your foe’s weak!\nGet ’em, {STRING 0}!$" gUnknown_085CBCE5:: @ 85CBCE5 - .incbin "baserom.gba", 0x5cbce5, 0x18 + +.string "{STRING 31} sent out {STRING 11}!\nGo! {STRING 9}!$" gUnknown_085CBCFD:: @ 85CBCFD - .incbin "baserom.gba", 0x5cbcfd, 0x1e + +.string "{STRING 0}, that’s enough!\nCome back!$" gUnknown_085CBD1B:: @ 85CBD1B - .incbin "baserom.gba", 0x5cbd1b, 0xf + +.string "{STRING 0}, come back!$" gUnknown_085CBD2A:: @ 85CBD2A - .incbin "baserom.gba", 0x5cbd2a, 0x13 + +.string "{STRING 0}, OK!\nCome back!$" gUnknown_085CBD3D:: @ 85CBD3D - .incbin "baserom.gba", 0x5cbd3d, 0x15 + +.string "{STRING 0}, good!\nCome back!$" gUnknown_085CBD52:: @ 85CBD52 - .incbin "baserom.gba", 0x5cbd52, 0x13 + +.string "{STRING 28} {STRING 29}\nwithdrew {STRING 0}!$" gUnknown_085CBD65:: @ 85CBD65 - .incbin "baserom.gba", 0x5cbd65, 0x10 + +.string "{STRING 32} withdrew\n{STRING 0}!$" gUnknown_085CBD75:: @ 85CBD75 - .incbin "baserom.gba", 0x5cbd75, 0x10 + +.string "{STRING 34} withdrew\n{STRING 0}!$" gUnknown_085CBD85:: @ 85CBD85 - .incbin "baserom.gba", 0x5cbd85, 0x6 + +.string "Wild $" gUnknown_085CBD8B:: @ 85CBD8B - .incbin "baserom.gba", 0x5cbd8b, 0x6 + +.string "Foe $" +.string "$" gUnknown_085CBD91:: @ 85CBD91 - .incbin "baserom.gba", 0x5cbd91, 0x4 + +.string "Foe$" gUnknown_085CBD95:: @ 85CBD95 - .incbin "baserom.gba", 0x5cbd95, 0x5 + +.string "Ally$" gUnknown_085CBD9A:: @ 85CBD9A - .incbin "baserom.gba", 0x5cbd9a, 0x4 + +.string "Foe$" gUnknown_085CBD9E:: @ 85CBD9E - .incbin "baserom.gba", 0x5cbd9e, 0x5 + +.string "Ally$" gUnknown_085CBDA3:: @ 85CBDA3 - .incbin "baserom.gba", 0x5cbda3, 0x4 + +.string "Foe$" gUnknown_085CBDA7:: @ 85CBDA7 - .incbin "baserom.gba", 0x5cbda7, 0x5 + +.string "Ally$" gUnknown_085CBDAC:: @ 85CBDAC - .incbin "baserom.gba", 0x5cbdac, 0xb + +.string "{STRING 15} used\n{PLAYER}$" gUnknown_085CBDB7:: @ 85CBDB7 - .incbin "baserom.gba", 0x5cbdb7, 0x2 + +.string "!$" gUnknown_085CBDB9:: @ 85CBDB9 - .incbin "baserom.gba", 0x5cbdb9, 0x2 + +.string "!$" gUnknown_085CBDBB:: @ 85CBDBB - .incbin "baserom.gba", 0x5cbdbb, 0x2 + +.string "!$" gUnknown_085CBDBD:: @ 85CBDBD - .incbin "baserom.gba", 0x5cbdbd, 0x2 + +.string "!$" gUnknown_085CBDBF:: @ 85CBDBF .incbin "baserom.gba", 0x5cbdbf, 0x41 @@ -184,21 +553,45 @@ gUnknown_085CBE00:: @ 85CBE00 gUnknown_085CBE6C:: @ 85CBE6C .incbin "baserom.gba", 0x5cbe6c, 0x1a9 - + gUnknown_085CC015:: @ 85CC015 - .incbin "baserom.gba", 0x5cc015, 0xa + +.string "someone’s$" gUnknown_085CC01F:: @ 85CC01F - .incbin "baserom.gba", 0x5cc01f, 0x81 + +.string "LANETTE’s$" +.string "{RIVAL}’s data was\nadded to the POKéDEX.\p$" +.string "It is raining.$" +.string "A sandstorm is raging.$" +.string "The BOX is full!\nYou can’t catch any more!\p$" gUnknown_085CC0A0:: @ 85CC0A0 - .incbin "baserom.gba", 0x5cc0a0, 0xd + +.string "ENIGMA BERRY$" gUnknown_085CC0AD:: @ 85CC0AD - .incbin "baserom.gba", 0x5cc0ad, 0x191 + +.string " BERRY$" +.string "{STRING 19}’s {STRING 22}\ncured paralysis!$" +.string "{STRING 19}’s {STRING 22}\ncured poison!$" +.string "{STRING 19}’s {STRING 22}\nhealed its burn!$" +.string "{STRING 19}’s {STRING 22}\ndefrosted it!$" +.string "{STRING 19}’s {STRING 22}\nwoke it from its sleep!$" +.string "{STRING 19}’s {STRING 22}\nsnapped it out of confusion!$" +.string "{STRING 19}’s {STRING 22}\ncured its {STRING 0} problem!$" +.string "{STRING 19}’s {STRING 22}\nnormalized its status!$" +.string "{STRING 19}’s {STRING 22}\nrestored health!$" +.string "{STRING 19}’s {STRING 22}\nrestored {STRING 0}’s PP!$" +.string "{STRING 19}’s {STRING 22}\nrestored its status!$" +.string "{STRING 19}’s {STRING 22}\nrestored its HP a little!$" +.string "{STRING 22} allows the\nuse of only {STRING 20}!\p$" +.string "{STRING 16} hung on\nusing its {STRING 22}!$" gUnknown_085CC23E:: @ 85CC23E - .incbin "baserom.gba", 0x5cc23e, 0x32 + +.string "$" +.string "You throw a BALL now, right?\nI‥ I’ll do my best!$" gUnknown_085CC270:: @ 85CC270 .incbin "baserom.gba", 0x5cc270, 0x5c4 @@ -210,28 +603,36 @@ gUnknown_085CC982:: @ 85CC982 .incbin "baserom.gba", 0x5cc982, 0xe gUnknown_085CC990:: @ 85CC990 - .incbin "baserom.gba", 0x5cc990, 0x16 + +.string "What?\n{STR_VAR_1} is evolving!$" gUnknown_085CC9A6:: @ 85CC9A6 - .incbin "baserom.gba", 0x5cc9a6, 0x2d + +.string "Congratulations! Your {STR_VAR_1}\nevolved into {STR_VAR_2}!{UNKNOWN_A}\p$" gUnknown_085CC9D3:: @ 85CC9D3 - .incbin "baserom.gba", 0x5cc9d3, 0x1b + +.string "Huh? {STR_VAR_1}\nstopped evolving!\p$" gUnknown_085CC9EE:: @ 85CC9EE - .incbin "baserom.gba", 0x5cc9ee, 0x5 + +.string "‥‥?\p$" gUnknown_085CC9F3:: @ 85CC9F3 - .incbin "baserom.gba", 0x5cc9f3, 0x11 + +.string "What will\n{STRING 18} do?$" gUnknown_085CCA04:: @ 85CCA04 - .incbin "baserom.gba", 0x5cca04, 0x11 + +.string "What will\n{STRING 35} do?$" gUnknown_085CCA15:: @ 85CCA15 - .incbin "baserom.gba", 0x5cca15, 0x14 + +.string "What will\nWALLY do?$" gUnknown_085CCA29:: @ 85CCA29 - .incbin "baserom.gba", 0x5cca29, 0x11 + +.string "{PAUSE 16}Link standby‥$" gUnknown_085CCA3A:: @ 85CCA3A .incbin "baserom.gba", 0x5cca3a, 0x1a @@ -376,3 +777,4 @@ gUnknown_085CD660:: @ 85CD660 gUnknown_085CD668:: @ 85CD668 .incbin "baserom.gba", 0x5cd668, 0x4 + diff --git a/data/data2b.s b/data/data2b.s index 6517d2724..19bab9c20 100644 --- a/data/data2b.s +++ b/data/data2b.s @@ -257,436 +257,3 @@ gUnknown_0831BCF3:: @ 831BCF3 gUnknown_0831BCF8:: @ 831BCF8 .incbin "baserom.gba", 0x31bcf8, 0x18 - .align 2, 0 -gBattleScriptingCommandsTable:: @ 831BD10 - .4byte atk00_attackcanceler - .4byte atk01_accuracycheck - .4byte atk02_attackstring - .4byte atk03_ppreduce - .4byte atk04_critcalc - .4byte atk05_cmd5 - .4byte sub_8047038 - .4byte atk07_cmd7 - .4byte atk08_cmd8 - .4byte atk09_attackanimation - .4byte sub_8047DC8 - .4byte atk0B_graphicalhpupdate - .4byte atk0C_datahpupdate - .4byte atk0D_critmessage - .4byte atk0E_missmessage - .4byte atk0F_resultmessage - .4byte atk10_printstring - .4byte atk11_printstring2 - .4byte atk12_waitmessage - .4byte atk13_printfromtable - .4byte atk14_printfromtable2 - .4byte atk15_seteffectwithchancetarget - .4byte sub_8049AC0 - .4byte sub_8049AD0 - .4byte sub_8049AE0 - .4byte atk19_faintpokemon - .4byte sub_8049E40 - .4byte sub_8049E7C - .4byte atk1C_jumpifstatus - .4byte atk1D_jumpifsecondarystatus - .4byte atk1E_jumpifability - .4byte sub_804A0DC - .4byte sub_804A154 - .4byte atk21_jumpifspecialstatusflag - .4byte sub_804A2D0 - .4byte sub_804A32C - .4byte sub_804ACD0 - .4byte atk25_cmd25 - .4byte atk26_80225F0_storebyteforjump - .4byte atk27_cmd27 - .4byte atk28_goto - .4byte atk29_jumpifbyte - .4byte sub_804B0A8 - .4byte sub_804B150 - .4byte sub_804B204 - .4byte sub_804B28C - .4byte sub_804B310 - .4byte sub_804B338 - .4byte sub_804B364 - .4byte atk31_copyarray - .4byte atk32_memcpy_with_offset - .4byte atk33_orbyte - .4byte atk34_orhalfword - .4byte atk35_orword - .4byte atk36_bicbyte - .4byte atk37_bichalfword - .4byte atk38_bicword - .4byte atk39_pause - .4byte sub_804B5E0 - .4byte atk3B_8022C68 - .4byte atk3C_return - .4byte sub_804B664 - .4byte atk3E_end2 - .4byte atk3F_end3 - .4byte atk40_801DBA0 - .4byte atk41_call - .4byte atk42_jumpiftype2 - .4byte sub_804B784 - .4byte sub_804B7D0 - .4byte atk46_cmd46 - .4byte sub_804B8B0 - .4byte sub_804B97C - .4byte atk48_playstatchangeanimation - .4byte sub_804BBCC - .4byte atk4A_damagecalc2 - .4byte atk4B_cmd4b - .4byte atk4C_switch1 - .4byte sub_804C904 - .4byte atk4E_switch3 - .4byte atk4F_jumpifcannotswitch - .4byte atk50_openpartyscreen - .4byte atk51_cmd51 - .4byte atk52_cmd52 - .4byte sub_804DDA8 - .4byte atk54_802511C - .4byte sub_804DE14 - .4byte atk56_8025194 - .4byte atk57_80251C4_flee - .4byte atk58_cmd58 - .4byte atk59_8025230 - .4byte sub_804E038 - .4byte atk5B_80256E0 - .4byte atk5C_cmd5c - .4byte sub_804E6D8 - .4byte atk5E_8025A70 - .4byte atk5F_8025B24 - .4byte atk60_cmd60 - .4byte atk61_8025BA4 - .4byte atk62_08025C6C - .4byte atk63_jumptoattack - .4byte atk64_statusanimation - .4byte atk65_8025D90 - .4byte atk66_8025E38 - .4byte atk67_8025ECC - .4byte sub_804ECA4 - .4byte atk69_8025FE0 - .4byte atk6A_stash_item_for_side - .4byte atk6B_end_battle_80261CC - .4byte atk6C_8026208 - .4byte sub_804F4D4 - .4byte atk6E_state0_side_becomes_attacker - .4byte atk6F_8026810 - .4byte atk70_record_ability_usage_of_side - .4byte atk71_80268A0 - .4byte atk72_flee - .4byte atk73_cmd73 - .4byte atk74_hp_tresholds_2 - .4byte atk75_8026A58 - .4byte sub_804F7AC - .4byte atk77_setprotect - .4byte atk78_faintifabilitynotdamp - .4byte atk79_setuserhptozero - .4byte sub_8050044 - .4byte sub_80500E8 - .4byte sub_8050164 - .4byte sub_80502C8 - .4byte atk7E_setreflect - .4byte sub_80503E8 - .4byte atk80_manipulatedamage - .4byte atk81_setrest - .4byte atk82_jumpifnotfirstturn - .4byte sub_8050640 - .4byte sub_80506EC - .4byte sub_8050768 - .4byte atk86_stockpiletobasedamage - .4byte atk87_stockpiletohprecovery - .4byte atk88_negativedamage - .4byte atk89_statbuffchange - .4byte atk8A_normalisebuffs - .4byte atk8B_setbide - .4byte atk8C_confuseifrepeatingattackends - .4byte atk8D_setloopcounter - .4byte atk8E_cmd8e - .4byte sub_805112C - .4byte sub_8051424 - .4byte atk91_givemoney - .4byte atk92_setlightscreen - .4byte atk93_ko_move - .4byte atk94_gethalfcurrentenemyhp - .4byte sub_8051AC0 - .4byte sub_8051B18 - .4byte atk97_tryinfatuatetarget - .4byte sub_8051E48 - .4byte atk99_setmisteffect - .4byte atk9A_setincreasedcriticalchance - .4byte atk9B_transformdataexecution - .4byte sub_80521FC - .4byte atk9D_copyattack - .4byte sub_80524DC - .4byte atk9F_nightshadedamageeffect - .4byte atkA0_psywavedamageeffect - .4byte atkA1_counterdamagecalculator - .4byte atkA2_mirrorcoatdamagecalculator - .4byte atkA3_disablelastusedattack - .4byte atkA4_setencore - .4byte sub_8052A70 - .4byte atkA6_settypetorandomresistance - .4byte atkA7_setalwayshitflag - .4byte atkA8_copymovepermanently - .4byte sub_8053018 - .4byte atkAA_destinybondeffect - .4byte atkAB_802A458 - .4byte atkAC_remaininghptopower - .4byte atkAD_reducepprandom - .4byte atkAE_clearstatusifnotsoundproofed - .4byte atkAF_cursetarget - .4byte atkB0_setspikes - .4byte atkB1_setforesight - .4byte atkB2_setperishsong - .4byte atkB3_rolloutdamagecalculation - .4byte atkB4_jumpifconfusedandattackmaxed - .4byte sub_8053AF8 - .4byte atkB6_happinesstodamagecalculation - .4byte atkB7_presentdamagecalculation - .4byte atkB8_setsafeguard - .4byte atkB9_magnitudedamagecalculation - .4byte atkBA_802B140 - .4byte sub_805405C - .4byte atkBC_maxattackhalvehp - .4byte atkBD_copyfoestats - .4byte atkBE_breakfree - .4byte atkBF_setcurled - .4byte atkC0_recoverbasedonsunlight - .4byte sub_8054400 - .4byte atkC2_selectnexttarget - .4byte atkC3_setfutureattack - .4byte atkC4_802B910 - .4byte atkC5_hidepreattack - .4byte atkC6_unhidepostattack - .4byte atkC7_setminimize - .4byte sub_8054A48 - .4byte atkC9_jumpifattackandspecialattackcannotfall - .4byte atkCA_setforcedtarget - .4byte atkCB_setcharge - .4byte atkCC_callterrainattack - .4byte atkCD_cureifburnedparalysedorpoisoned - .4byte atkCE_settorment - .4byte atkCF_jumpifnodamage - .4byte atkD0_settaunt - .4byte atkD1_sethelpinghand - .4byte sub_8054EB4 - .4byte sub_8055148 - .4byte atkD4_802C408 - .4byte sub_8055294 - .4byte atkD6_doubledamagedealtifdamaged - .4byte sub_805534C - .4byte atkD8_setdamagetohealthdifference - .4byte atkD9_scaledamagebyhealthratio - .4byte atkDA_abilityswap - .4byte atkDB_imprisoneffect - .4byte atkDC_setgrudge - .4byte atkDD_weightdamagecalculation - .4byte atkDE_asistattackselect - .4byte atkDF_setmagiccoat - .4byte atkE0_setstealstatchange - .4byte atkE1_802CBE4 - .4byte atkE2_cmde2 - .4byte atkE3_jumpiffainted - .4byte sub_8055B48 - .4byte atkE5_pickupitemcalculation - .4byte atkE6_castform_transform - .4byte atkE7_castform_switch - .4byte atkE8_settypebasedhalvers - .4byte atkE9_seteffectbyweather - .4byte atkEA_recycleitem - .4byte atkEB_settypetoterrain - .4byte atkEC_802D2A0 - .4byte atkED_802D364 - .4byte atkEE_removereflectlightscreen - .4byte sub_8056300 - .4byte atkF0_catch_pokemon - .4byte atkF1_802D95C - .4byte sub_80568CC - .4byte atkF3_receive_new_pokemon_maybe - .4byte sub_8056E78 - .4byte atkF5_reset_attacker_bd_x4C - .4byte sub_8056ED0 - .4byte sub_8056EDC - .4byte sub_8056EF8 - -gUnknown_0831C0F4:: @ 831C0F4 - .incbin "baserom.gba", 0x31c0f4, 0x34 - -gUnknown_0831C128:: @ 831C128 - .incbin "baserom.gba", 0x31c128, 0xc - -gUnknown_0831C134:: @ 831C134 - .incbin "baserom.gba", 0x31c134, 0xf0 - -gUnknown_0831C224:: @ 831C224 - .incbin "baserom.gba", 0x31c224, 0xa4 - -gUnknown_0831C2C8:: @ 831C2C8 - .incbin "baserom.gba", 0x31c2c8, 0x20 - -gUnknown_0831C2E8:: @ 831C2E8 - .incbin "baserom.gba", 0x31c2e8, 0xd8 - -gUnknown_0831C3C0:: @ 831C3C0 - .incbin "baserom.gba", 0x31c3c0, 0x18 - -gUnknown_0831C3D8:: @ 831C3D8 - .incbin "baserom.gba", 0x31c3d8, 0x8 - -gUnknown_0831C3E0:: @ 831C3E0 - .incbin "baserom.gba", 0x31c3e0, 0x28 - -gUnknown_0831C408:: @ 831C408 - .incbin "baserom.gba", 0x31c408, 0xc - -gUnknown_0831C414:: @ 831C414 - .incbin "baserom.gba", 0x31c414, 0x14 - -gUnknown_0831C428:: @ 831C428 - .incbin "baserom.gba", 0x31c428, 0x18 - -@ 831C440 - .include "data/pickup_items.inc" - -gUnknown_0831C483:: @ 831C483 - .incbin "baserom.gba", 0x31c483, 0xa - -gUnknown_0831C48D:: @ 831C48D - .incbin "baserom.gba", 0x31c48d, 0x7 - -gUnknown_0831C494:: @ 831C494 - .incbin "baserom.gba", 0x31c494, 0x64 - -gUnknown_0831C4F8:: @ 831C4F8 - .incbin "baserom.gba", 0x31c4f8, 0x1c - -gPlayerBufferCommands:: @ 831C514 - .incbin "baserom.gba", 0x31c514, 0xe4 - -gUnknown_0831C5F8:: @ 831C5F8 - .incbin "baserom.gba", 0x31c5f8, 0xc - -gUnknown_0831C604:: @ 831C604 - .incbin "baserom.gba", 0x31c604, 0x1c - -gUnknown_0831C620:: @ 831C620 - .incbin "baserom.gba", 0x31c620, 0x8 - -gUnknown_0831C628:: @ 831C628 - .incbin "baserom.gba", 0x31c628, 0x60 - -gUnknown_0831C688:: @ 831C688 - .incbin "baserom.gba", 0x31c688, 0x18 - -gUnknown_0831C6A0:: @ 831C6A0 - .incbin "baserom.gba", 0x31c6a0, 0x10 - -gUnknown_0831C6B0:: @ 831C6B0 - .incbin "baserom.gba", 0x31c6b0, 0x18 - -gOpponentBufferCommands:: @ 831C6C8 - .incbin "baserom.gba", 0x31c6c8, 0xec - -gUnknown_0831C7B4:: @ 831C7B4 - .incbin "baserom.gba", 0x31c7b4, 0xe4 - -@ 831C898 - .include "data/battle_moves.inc" - - .incbin "baserom.gba", 0x31d93c, 0x10 - -@ 831D94C - .include "data/pokedex_order.inc" - -@ 831E2F0 - .include "data/spinda_spot_graphics.inc" - -@ 831E380 - .include "data/item_effect_info.inc" - -@ 831E818 - .include "data/nature_stat_table.inc" - -@ 831E898 - .include "data/tm_hm_learnsets.inc" - -@ 831F578 - .include "data/trainer_pic_indices.inc" - -@ 831F5CA - .include "data/trainer_class_name_indices.inc" - -@ 831F61C - .include "data/cry_id_table.inc" - -@ 831F72C - .include "data/experience_tables.inc" - -@ 83203CC - .include "data/base_stats.inc" - -@ 83230DC - .include "data/level_up_learnsets.inc" - -@ 832531C - .include "data/evolution_table.inc" - -@ 832937C - .include "data/level_up_learnset_pointers.inc" - -gUnknown_083299EC:: @ 83299EC - .incbin "baserom.gba", 0x3299ec, 0x19b - -gUnknown_08329B87:: @ 8329B87 - .incbin "baserom.gba", 0x329b87, 0x19b - -gUnknown_08329D22:: @ 8329D22 - .incbin "baserom.gba", 0x329d22, 0x4 - -gUnknown_08329D26:: @ 8329D26 - .incbin "baserom.gba", 0x329d26, 0x4 - -gUnknown_08329D2A:: @ 8329D2A - .incbin "baserom.gba", 0x329d2a, 0x4 - -gUnknown_08329D2E:: @ 8329D2E - .incbin "baserom.gba", 0x329d2e, 0x1a - -gUnknown_08329D48:: @ 8329D48 - .incbin "baserom.gba", 0x329d48, 0xc - -gUnknown_08329D54:: @ 8329D54 - .incbin "baserom.gba", 0x329d54, 0x20 - -gHoldEffectToType:: @ 8329D74 - .incbin "baserom.gba", 0x329d74, 0x24 - -gUnknown_08329D98:: @ 8329D98 - .incbin "baserom.gba", 0x329d98, 0x60 - -gUnknown_08329DF8:: @ 8329DF8 - .incbin "baserom.gba", 0x329df8, 0xc0 - -gUnknown_08329EB8:: @ 8329EB8 - .incbin "baserom.gba", 0x329eb8, 0xa - -gUnknown_08329EC2:: @ 8329EC2 - .incbin "baserom.gba", 0x329ec2, 0x6 - -gUnknown_08329EC8:: @ 8329EC8 - .incbin "baserom.gba", 0x329ec8, 0x6 - -gUnknown_08329ECE:: @ 8329ECE - .incbin "baserom.gba", 0x329ece, 0x1c - -gUnknown_08329EEA:: @ 8329EEA - .incbin "baserom.gba", 0x329eea, 0x12 - -gUnknown_08329EFC:: @ 8329EFC - .incbin "baserom.gba", 0x329efc, 0x2 - -gUnknown_08329EFE:: @ 8329EFE - .incbin "baserom.gba", 0x329efe, 0x2a - -gUnknown_08329F28:: @ 8329F28 - .incbin "baserom.gba", 0x329f28, 0x18 diff --git a/data/data2b_2.s b/data/data2b_2.s new file mode 100644 index 000000000..a1088768e --- /dev/null +++ b/data/data2b_2.s @@ -0,0 +1,30 @@ +@ the second big chunk of data + + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + .align 2 + + +gUnknown_0831C5F8:: @ 831C5F8 + .incbin "baserom.gba", 0x31c5f8, 0xc + +gUnknown_0831C604:: @ 831C604 + .incbin "baserom.gba", 0x31c604, 0x1c + +gUnknown_0831C620:: @ 831C620 + .incbin "baserom.gba", 0x31c620, 0x8 + +gUnknown_0831C628:: @ 831C628 + .incbin "baserom.gba", 0x31c628, 0x60 + +gUnknown_0831C688:: @ 831C688 + .incbin "baserom.gba", 0x31c688, 0x18 + +gUnknown_0831C6A0:: @ 831C6A0 + .incbin "baserom.gba", 0x31c6a0, 0x10 + +gUnknown_0831C6B0:: @ 831C6B0 + .incbin "baserom.gba", 0x31c6b0, 0x18 diff --git a/data/data2c.s b/data/data2c.s new file mode 100644 index 000000000..94d9c30e8 --- /dev/null +++ b/data/data2c.s @@ -0,0 +1,111 @@ +@ the second big chunk of data + + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + .align 2 + + +@ 831C898 + .include "data/battle_moves.inc" + + @ 0x31d93c unreferenced unknown data +.byte 0x34, 0x00, 0x10, 0x00, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 + +@ 831D94C + .include "data/pokedex_order.inc" + +@ 831E2F0 + .include "data/spinda_spot_graphics.inc" + +@ 831E380 + .include "data/item_effect_info.inc" + +@ 831E818 + .include "data/nature_stat_table.inc" + +@ 831E898 + .include "data/tm_hm_learnsets.inc" + +@ 831F578 + .include "data/trainer_pic_indices.inc" + +@ 831F5CA + .include "data/trainer_class_name_indices.inc" + +@ 831F61C + .include "data/cry_id_table.inc" + +@ 831F72C + .include "data/experience_tables.inc" + +@ 83203CC + .include "data/base_stats.inc" + +@ 83230DC + .include "data/level_up_learnsets.inc" + +@ 832531C + .include "data/evolution_table.inc" + +@ 832937C + .include "data/level_up_learnset_pointers.inc" + +gUnknown_083299EC:: @ 83299EC + .incbin "baserom.gba", 0x3299ec, 0x19b + +gUnknown_08329B87:: @ 8329B87 + .incbin "baserom.gba", 0x329b87, 0x19b + +gUnknown_08329D22:: @ 8329D22 + .incbin "baserom.gba", 0x329d22, 0x4 + +gUnknown_08329D26:: @ 8329D26 + .incbin "baserom.gba", 0x329d26, 0x4 + +gUnknown_08329D2A:: @ 8329D2A + .incbin "baserom.gba", 0x329d2a, 0x4 + +gStatStageRatios:: @ 8329D2E + .incbin "baserom.gba", 0x329d2e, 0x1a + +gUnknown_08329D48:: @ 8329D48 + .incbin "baserom.gba", 0x329d48, 0xc + +gUnknown_08329D54:: @ 8329D54 + .incbin "baserom.gba", 0x329d54, 0x20 + +gHoldEffectToType:: @ 8329D74 + .incbin "baserom.gba", 0x329d74, 0x24 + +gUnknown_08329D98:: @ 8329D98 + .incbin "baserom.gba", 0x329d98, 0x60 + +gUnknown_08329DF8:: @ 8329DF8 + .incbin "baserom.gba", 0x329df8, 0xc0 + +gSecretBaseTrainerClasses:: @ 8329EB8 + .incbin "baserom.gba", 0x329eb8, 0xa + +gUnknown_08329EC2:: @ 8329EC2 + .incbin "baserom.gba", 0x329ec2, 0x6 + +gUnknown_08329EC8:: @ 8329EC8 + .incbin "baserom.gba", 0x329ec8, 0x6 + +gUnknown_08329ECE:: @ 8329ECE + .incbin "baserom.gba", 0x329ece, 0x1c + +gHMMoves:: @ 8329EEA + .incbin "baserom.gba", 0x329eea, 0x12 + +gUnknown_08329EFC:: @ 8329EFC + .incbin "baserom.gba", 0x329efc, 0x2 + +gAlteringCaveWildMonHeldItems:: @ 8329EFE + .incbin "baserom.gba", 0x329efe, 0x2a + +gUnknown_08329F28:: @ 8329F28 + .incbin "baserom.gba", 0x329f28, 0x18 diff --git a/data/data3.s b/data/data3.s index 01f23aa12..aa51f1d5f 100644 --- a/data/data3.s +++ b/data/data3.s @@ -5,17 +5,7 @@ .section .rodata -gBitTable:: @ 832A328 - .incbin "baserom.gba", 0x32a328, 0x80 -gUnknown_0832A3A8:: @ 832A3A8 - .incbin "baserom.gba", 0x32a3a8, 0x18 - -gUnknown_0832A3C0:: @ 832A3C0 - .incbin "baserom.gba", 0x32a3c0, 0x18 - -gUnknown_0832A3D8:: @ 832A3D8 - .incbin "baserom.gba", 0x32a3d8, 0xa00 @ 832ADD8 .include "data/egg_moves.inc" @@ -1213,7 +1203,7 @@ gUnknown_0851017C:: @ 851017C gUnknown_0851021C:: @ 851021C .incbin "baserom.gba", 0x51021c, 0xa0 -gUnknown_085102BC:: @ 85102BC +gNullScriptPtr:: @ 85102BC .incbin "baserom.gba", 0x5102bc, 0x4 gUnknown_085102C0:: @ 85102C0 @@ -1261,19 +1251,19 @@ gUnknown_085104C4:: @ 85104C4 gUnknown_085104F0:: @ 85104F0 .incbin "baserom.gba", 0x5104f0, 0x18 -gUnknown_08510508:: @ 8510508 +gSafariBallsWindowTemplate:: @ 8510508 .incbin "baserom.gba", 0x510508, 0x8 gUnknown_08510510:: @ 8510510 .incbin "baserom.gba", 0x510510, 0x20 -gUnknown_08510530:: @ 8510530 +gPyramidFloorWindowTemplate_2:: @ 8510530 .incbin "baserom.gba", 0x510530, 0x8 -gUnknown_08510538:: @ 8510538 +gPyramidFloorWindowTemplate_1:: @ 8510538 .incbin "baserom.gba", 0x510538, 0x8 -gUnknown_08510540:: @ 8510540 +sStartMenuItems:: @ 8510540 .incbin "baserom.gba", 0x510540, 0x68 gUnknown_085105A8:: @ 85105A8 @@ -3042,2023 +3032,3 @@ gUnknown_0858D8E8:: @ 858D8E8 gUnknown_0858D8EC:: @ 858D8EC .incbin "baserom.gba", 0x58d8ec, 0x4 - -gUnknown_0858D8F0:: @ 858D8F0 - .incbin "baserom.gba", 0x58d8f0, 0x80 - -gUnknown_0858D970:: @ 858D970 - .incbin "baserom.gba", 0x58d970, 0x2a8 - - .align 2 -gFieldEffectObjectPalette7:: @ 858DC18 - .incbin "graphics/map_objects/palettes/field_effect_object_palette_07.gbapal" - - .incbin "baserom.gba", 0x58dc38, 0x580 - - .align 2 -gFieldEffectObjectPalette8:: @ 858E1B8 - .incbin "graphics/map_objects/palettes/field_effect_object_palette_08.gbapal" - - .incbin "baserom.gba", 0x58e1d8, 0x428 - -gUnknown_0858E600:: @ 858E600 - .incbin "baserom.gba", 0x58e600, 0x18 - -gUnknown_0858E618:: @ 858E618 - .incbin "baserom.gba", 0x58e618, 0x18 - -gUnknown_0858E630:: @ 858E630 - .incbin "baserom.gba", 0x58e630, 0x18 - - .align 2 -gFieldEffectObjectPaletteInfo7:: @ 858E648 - obj_pal gFieldEffectObjectPalette7, 0x1003 - - .align 2 -gFieldEffectObjectPaletteInfo8:: @ 858E650 - obj_pal gFieldEffectObjectPalette8, 0x1008 - - .incbin "baserom.gba", 0x58e658, 0x34 - -gUnknown_0858E68C:: @ 858E68C - .incbin "baserom.gba", 0x58e68c, 0x18 - - .align 2 -@ This uses one of the secret base palettes, so there is no -@ "field_effect_object_palette_09.pal" file. -gFieldEffectObjectPaletteInfo9:: @ 858E6A4 - obj_pal gTilesetPalettes_SecretBase + 5 * 0x20, 0x100E - - .incbin "baserom.gba", 0x58e6ac, 0x1b8 - -gUnknown_0858E864:: @ 858E864 - .incbin "baserom.gba", 0x58e864, 0x1c - -gUnknown_0858E880:: @ 858E880 - .incbin "baserom.gba", 0x58e880, 0x18 - -gUnknown_0858E898:: @ 858E898 - .incbin "baserom.gba", 0x58e898, 0x13 - -gUnknown_0858E8AB:: @ 858E8AB - .incbin "baserom.gba", 0x58e8ab, 0x2 - -gUnknown_0858E8AD:: @ 858E8AD - .incbin "baserom.gba", 0x58e8ad, 0x3 - -gUnknown_0858E8B0:: @ 858E8B0 - .incbin "baserom.gba", 0x58e8b0, 0x40 - -gUnknown_0858E8F0:: @ 858E8F0 - .incbin "baserom.gba", 0x58e8f0, 0x3468 - -gUnknown_08591D58:: @ 8591D58 - .incbin "baserom.gba", 0x591d58, 0x270 - -gUnknown_08591FC8:: @ 8591FC8 - .incbin "baserom.gba", 0x591fc8, 0x18 - -gUnknown_08591FE0:: @ 8591FE0 - .incbin "baserom.gba", 0x591fe0, 0x18 - -gUnknown_08591FF8:: @ 8591FF8 - .incbin "baserom.gba", 0x591ff8, 0x10 - -gUnknown_08592008:: @ 8592008 - .incbin "baserom.gba", 0x592008, 0x10 - -gUnknown_08592018:: @ 8592018 - .incbin "baserom.gba", 0x592018, 0x10 - -gUnknown_08592028:: @ 8592028 - .incbin "baserom.gba", 0x592028, 0x10 - -gUnknown_08592038:: @ 8592038 - .incbin "baserom.gba", 0x592038, 0x20 - -gUnknown_08592058:: @ 8592058 - .incbin "baserom.gba", 0x592058, 0x20 - -gUnknown_08592078:: @ 8592078 - .incbin "baserom.gba", 0x592078, 0x60 - -gUnknown_085920D8:: @ 85920D8 - .incbin "baserom.gba", 0x5920d8, 0xc - -gUnknown_085920E4:: @ 85920E4 - .incbin "baserom.gba", 0x5920e4, 0x4 - -gUnknown_085920E8:: @ 85920E8 - .incbin "baserom.gba", 0x5920e8, 0x128 - -gUnknown_08592210:: @ 8592210 - .incbin "baserom.gba", 0x592210, 0x4f0 - -gUnknown_08592700:: @ 8592700 - .incbin "baserom.gba", 0x592700, 0x78 - -gUnknown_08592778:: @ 8592778 - .incbin "baserom.gba", 0x592778, 0x100 - -gUnknown_08592878:: @ 8592878 - .incbin "baserom.gba", 0x592878, 0x458 - -gUnknown_08592CD0:: @ 8592CD0 - .incbin "baserom.gba", 0x592cd0, 0x1ec - -gUnknown_08592EBC:: @ 8592EBC - .incbin "baserom.gba", 0x592ebc, 0x30 - -gUnknown_08592EEC:: @ 8592EEC - .incbin "baserom.gba", 0x592eec, 0x134 - -gUnknown_08593020:: @ 8593020 - .incbin "baserom.gba", 0x593020, 0xf4 - -gUnknown_08593114:: @ 8593114 - .incbin "baserom.gba", 0x593114, 0x29c - -gUnknown_085933B0:: @ 85933B0 - .incbin "baserom.gba", 0x5933b0, 0xf0 - -gUnknown_085934A0:: @ 85934A0 - .incbin "baserom.gba", 0x5934a0, 0x148 - -gUnknown_085935E8:: @ 85935E8 - .incbin "baserom.gba", 0x5935e8, 0x20 - -gUnknown_08593608:: @ 8593608 - .incbin "baserom.gba", 0x593608, 0x9c - -gUnknown_085936A4:: @ 85936A4 - .incbin "baserom.gba", 0x5936a4, 0x20c - -gUnknown_085938B0:: @ 85938B0 - .incbin "baserom.gba", 0x5938b0, 0x2c - -gUnknown_085938DC:: @ 85938DC - .incbin "baserom.gba", 0x5938dc, 0x18 - -gUnknown_085938F4:: @ 85938F4 - .incbin "baserom.gba", 0x5938f4, 0x5c - -gUnknown_08593950:: @ 8593950 - .incbin "baserom.gba", 0x593950, 0x38 - -gUnknown_08593988:: @ 8593988 - .incbin "baserom.gba", 0x593988, 0x210 - -gUnknown_08593B98:: @ 8593B98 - .incbin "baserom.gba", 0x593b98, 0x1488 - -gUnknown_08595020:: @ 8595020 - .incbin "baserom.gba", 0x595020, 0x248 - -gUnknown_08595268:: @ 8595268 - .incbin "baserom.gba", 0x595268, 0xa8 - -gUnknown_08595310:: @ 8595310 - .incbin "baserom.gba", 0x595310, 0x2a4 - -gUnknown_085955B4:: @ 85955B4 - .incbin "baserom.gba", 0x5955b4, 0x18 - -gUnknown_085955CC:: @ 85955CC - .incbin "baserom.gba", 0x5955cc, 0x2 - -gUnknown_085955CE:: @ 85955CE - .incbin "baserom.gba", 0x5955ce, 0xb6 - -gUnknown_08595684:: @ 8595684 - .incbin "baserom.gba", 0x595684, 0x10 - -gUnknown_08595694:: @ 8595694 - .incbin "baserom.gba", 0x595694, 0x2c - -gUnknown_085956C0:: @ 85956C0 - .incbin "baserom.gba", 0x5956c0, 0x168 - -gUnknown_08595828:: @ 8595828 - .incbin "baserom.gba", 0x595828, 0x18 - -gUnknown_08595840:: @ 8595840 - .incbin "baserom.gba", 0x595840, 0x18 - -gUnknown_08595858:: @ 8595858 - .incbin "baserom.gba", 0x595858, 0x50 - -gUnknown_085958A8:: @ 85958A8 - .incbin "baserom.gba", 0x5958a8, 0x158 - -gUnknown_08595A00:: @ 8595A00 - .incbin "baserom.gba", 0x595a00, 0x30 - -gUnknown_08595A30:: @ 8595A30 - .incbin "baserom.gba", 0x595a30, 0x138 - -gUnknown_08595B68:: @ 8595B68 - .incbin "baserom.gba", 0x595b68, 0xf4 - -gUnknown_08595C5C:: @ 8595C5C - .incbin "baserom.gba", 0x595c5c, 0x2c - -gUnknown_08595C88:: @ 8595C88 - .incbin "baserom.gba", 0x595c88, 0x2c - -gUnknown_08595CB4:: @ 8595CB4 - .incbin "baserom.gba", 0x595cb4, 0x78 - -gUnknown_08595D2C:: @ 8595D2C - .incbin "baserom.gba", 0x595d2c, 0xa14 - -gUnknown_08596740:: @ 8596740 - .incbin "baserom.gba", 0x596740, 0x1c - -gUnknown_0859675C:: @ 859675C - .incbin "baserom.gba", 0x59675c, 0x20 - -gUnknown_0859677C:: @ 859677C - .incbin "baserom.gba", 0x59677c, 0x18 - -gUnknown_08596794:: @ 8596794 - .incbin "baserom.gba", 0x596794, 0xd0 - -gUnknown_08596864:: @ 8596864 - .incbin "baserom.gba", 0x596864, 0x35c - -gUnknown_08596BC0:: @ 8596BC0 - .incbin "baserom.gba", 0x596bc0, 0x50 - -gUnknown_08596C10:: @ 8596C10 - .incbin "baserom.gba", 0x596c10, 0x18 - -gUnknown_08596C28:: @ 8596C28 - .incbin "baserom.gba", 0x596c28, 0x18 - -gUnknown_08596C40:: @ 8596C40 - .incbin "baserom.gba", 0x596c40, 0x178 - -gUnknown_08596DB8:: @ 8596DB8 - .incbin "baserom.gba", 0x596db8, 0x78 - -gUnknown_08596E30:: @ 8596E30 - .incbin "baserom.gba", 0x596e30, 0x528 - -gUnknown_08597358:: @ 8597358 - .incbin "baserom.gba", 0x597358, 0x30 - -gUnknown_08597388:: @ 8597388 - .incbin "baserom.gba", 0x597388, 0x60 - -gUnknown_085973E8:: @ 85973E8 - .incbin "baserom.gba", 0x5973e8, 0x30 - -gUnknown_08597418:: @ 8597418 - .incbin "baserom.gba", 0x597418, 0x2 - -gUnknown_0859741A:: @ 859741A - .incbin "baserom.gba", 0x59741a, 0x4 - -gUnknown_0859741E:: @ 859741E - .incbin "baserom.gba", 0x59741e, 0x6 - -gUnknown_08597424:: @ 8597424 - .incbin "baserom.gba", 0x597424, 0x28 - -gUnknown_0859744C:: @ 859744C - .incbin "baserom.gba", 0x59744c, 0x10 - -gUnknown_0859745C:: @ 859745C - .incbin "baserom.gba", 0x59745c, 0xc - -gUnknown_08597468:: @ 8597468 - .incbin "baserom.gba", 0x597468, 0x34 - -gUnknown_0859749C:: @ 859749C - .incbin "baserom.gba", 0x59749c, 0x1c - -gUnknown_085974B8:: @ 85974B8 - .incbin "baserom.gba", 0x5974b8, 0x8 - -gUnknown_085974C0:: @ 85974C0 - .incbin "baserom.gba", 0x5974c0, 0x70 - -gUnknown_08597530:: @ 8597530 - .incbin "baserom.gba", 0x597530, 0x20 - -gUnknown_08597550:: @ 8597550 - .incbin "baserom.gba", 0x597550, 0x1f8 - -gUnknown_08597748:: @ 8597748 - .incbin "baserom.gba", 0x597748, 0x1c - -gUnknown_08597764:: @ 8597764 - .incbin "baserom.gba", 0x597764, 0x8 - -gUnknown_0859776C:: @ 859776C - .incbin "baserom.gba", 0x59776c, 0x3a8 - -gUnknown_08597B14:: @ 8597B14 - .incbin "baserom.gba", 0x597b14, 0x20 - -gUnknown_08597B34:: @ 8597B34 - .incbin "baserom.gba", 0x597b34, 0x20 - -gUnknown_08597B54:: @ 8597B54 - .incbin "baserom.gba", 0x597b54, 0xc8 - -gUnknown_08597C1C:: @ 8597C1C - .incbin "baserom.gba", 0x597c1c, 0x8 - -gUnknown_08597C24:: @ 8597C24 - .incbin "baserom.gba", 0x597c24, 0xc - -gUnknown_08597C30:: @ 8597C30 - .incbin "baserom.gba", 0x597c30, 0x24 - -gUnknown_08597C54:: @ 8597C54 - .incbin "baserom.gba", 0x597c54, 0x10 - -gUnknown_08597C64:: @ 8597C64 - .incbin "baserom.gba", 0x597c64, 0x20 - -gUnknown_08597C84:: @ 8597C84 - .incbin "baserom.gba", 0x597c84, 0x8 - -gUnknown_08597C8C:: @ 8597C8C - .incbin "baserom.gba", 0x597c8c, 0x4 - -gUnknown_08597C90:: @ 8597C90 - .incbin "baserom.gba", 0x597c90, 0x10 - -gUnknown_08597CA0:: @ 8597CA0 - .incbin "baserom.gba", 0x597ca0, 0x20 - -gUnknown_08597CC0:: @ 8597CC0 - .incbin "baserom.gba", 0x597cc0, 0x28 - -gUnknown_08597CE8:: @ 8597CE8 - .incbin "baserom.gba", 0x597ce8, 0x20 - -gUnknown_08597D08:: @ 8597D08 - .incbin "baserom.gba", 0x597d08, 0x10 - -gUnknown_08597D18:: @ 8597D18 - .incbin "baserom.gba", 0x597d18, 0x50 - -gUnknown_08597D68:: @ 8597D68 - .incbin "baserom.gba", 0x597d68, 0x68 - -gUnknown_08597DD0:: @ 8597DD0 - .incbin "baserom.gba", 0x597dd0, 0x20 - -gUnknown_08597DF0:: @ 8597DF0 - .incbin "baserom.gba", 0x597df0, 0x40 - -gUnknown_08597E30:: @ 8597E30 - .incbin "baserom.gba", 0x597e30, 0x18 - -gUnknown_08597E48:: @ 8597E48 - .incbin "baserom.gba", 0x597e48, 0x18 - -gUnknown_08597E60:: @ 8597E60 - .incbin "baserom.gba", 0x597e60, 0xc - -gUnknown_08597E6C:: @ 8597E6C - .incbin "baserom.gba", 0x597e6c, 0x30 - -@ 8597E9C - .include "data/text/easy_chat/easy_chat_groups.inc" - -@ 859D0B4 - .include "data/text/easy_chat/easy_chat_words_by_letter.inc" - -@ 859E5D4 - .include "data/text/easy_chat/easy_chat_group_name_pointers.inc" - -gUnknown_0859E62C:: @ 859E62C - .incbin "baserom.gba", 0x59e62c, 0x8 - -gUnknown_0859E634:: @ 859E634 - .incbin "baserom.gba", 0x59e634, 0xc - -gUnknown_0859E640:: @ 859E640 - .incbin "baserom.gba", 0x59e640, 0xc - -gUnknown_0859E64C:: @ 859E64C - .incbin "baserom.gba", 0x59e64c, 0xc - -gUnknown_0859E658:: @ 859E658 - .incbin "baserom.gba", 0x59e658, 0x4 - -gUnknown_0859E65C:: @ 859E65C - .incbin "baserom.gba", 0x59e65c, 0x20 - -gUnknown_0859E67C:: @ 859E67C - .incbin "baserom.gba", 0x59e67c, 0x800 - -gUnknown_0859EE7C:: @ 859EE7C - .incbin "baserom.gba", 0x59ee7c, 0x8 - -gUnknown_0859EE84:: @ 859EE84 - .incbin "baserom.gba", 0x59ee84, 0x58 - -gUnknown_0859EEDC:: @ 859EEDC - .incbin "baserom.gba", 0x59eedc, 0x38 - -gUnknown_0859EF14:: @ 859EF14 - .incbin "baserom.gba", 0x59ef14, 0x8 - -gUnknown_0859EF1C:: @ 859EF1C - .incbin "baserom.gba", 0x59ef1c, 0x88 - -gUnknown_0859EFA4:: @ 859EFA4 - .incbin "baserom.gba", 0x59efa4, 0x40 - -gUnknown_0859EFE4:: @ 859EFE4 - .incbin "baserom.gba", 0x59efe4, 0xc - -gUnknown_0859EFF0:: @ 859EFF0 - .incbin "baserom.gba", 0x59eff0, 0x20 - -gUnknown_0859F010:: @ 859F010 - .incbin "baserom.gba", 0x59f010, 0x20 - -gUnknown_0859F030:: @ 859F030 - .incbin "baserom.gba", 0x59f030, 0x18 - -gUnknown_0859F048:: @ 859F048 - .incbin "baserom.gba", 0x59f048, 0x230 - -gUnknown_0859F278:: @ 859F278 - .incbin "baserom.gba", 0x59f278, 0x10 - -gUnknown_0859F288:: @ 859F288 - .incbin "baserom.gba", 0x59f288, 0x8 - -gUnknown_0859F290:: @ 859F290 - .incbin "baserom.gba", 0x59f290, 0xc - -gUnknown_0859F29C:: @ 859F29C - .incbin "baserom.gba", 0x59f29c, 0x10 - -gUnknown_0859F2AC:: @ 859F2AC - .incbin "baserom.gba", 0x59f2ac, 0x4 - -gUnknown_0859F2B0:: @ 859F2B0 - .incbin "baserom.gba", 0x59f2b0, 0x8 - -gUnknown_0859F2B8:: @ 859F2B8 - .incbin "baserom.gba", 0x59f2b8, 0xfc - -gUnknown_0859F3B4:: @ 859F3B4 - .incbin "baserom.gba", 0x59f3b4, 0xa4 - -gUnknown_0859F458:: @ 859F458 - .incbin "baserom.gba", 0x59f458, 0xbc - -gUnknown_0859F514:: @ 859F514 - .incbin "baserom.gba", 0x59f514, 0x8 - -gUnknown_0859F51C:: @ 859F51C - .incbin "baserom.gba", 0x59f51c, 0x8 - -gUnknown_0859F524:: @ 859F524 - .incbin "baserom.gba", 0x59f524, 0x10 - -gUnknown_0859F534:: @ 859F534 - .incbin "baserom.gba", 0x59f534, 0x8 - -gUnknown_0859F53C:: @ 859F53C - .incbin "baserom.gba", 0x59f53c, 0xd0 - -gUnknown_0859F60C:: @ 859F60C - .incbin "baserom.gba", 0x59f60c, 0x44 - -gUnknown_0859F650:: @ 859F650 - .incbin "baserom.gba", 0x59f650, 0xec - -gUnknown_0859F73C:: @ 859F73C - .incbin "baserom.gba", 0x59f73c, 0x40 - -gUnknown_0859F77C:: @ 859F77C - .incbin "baserom.gba", 0x59f77c, 0xd64 - -gUnknown_085A04E0:: @ 85A04E0 - .incbin "baserom.gba", 0x5a04e0, 0x34c - -gUnknown_085A082C:: @ 85A082C - .incbin "baserom.gba", 0x5a082c, 0x20 - -gUnknown_085A084C:: @ 85A084C - .incbin "baserom.gba", 0x5a084c, 0x80 - -gUnknown_085A08CC:: @ 85A08CC - .incbin "baserom.gba", 0x5a08cc, 0x20 - -gUnknown_085A08EC:: @ 85A08EC - .incbin "baserom.gba", 0x5a08ec, 0x80 - -gUnknown_085A096C:: @ 85A096C - .incbin "baserom.gba", 0x5a096c, 0x1a4 - -@ 85A0B10 - .include "data/region_map_entries.inc" - -gUnknown_085A1B24:: @ 85A1B24 - .incbin "baserom.gba", 0x5a1b24, 0x60 - -gUnknown_085A1B84:: @ 85A1B84 - .incbin "baserom.gba", 0x5a1b84, 0x6 - -gUnknown_085A1B8A:: @ 85A1B8A - .incbin "baserom.gba", 0x5a1b8a, 0x22 - -gUnknown_085A1BAC:: @ 85A1BAC - .incbin "baserom.gba", 0x5a1bac, 0x20 - -gUnknown_085A1BCC:: @ 85A1BCC - .incbin "baserom.gba", 0x5a1bcc, 0x34 - -gUnknown_085A1C00:: @ 85A1C00 - .incbin "baserom.gba", 0x5a1c00, 0x8 - -gUnknown_085A1C08:: @ 85A1C08 - .incbin "baserom.gba", 0x5a1c08, 0x18 - -gUnknown_085A1C20:: @ 85A1C20 - .incbin "baserom.gba", 0x5a1c20, 0x10 - -gUnknown_085A1C30:: @ 85A1C30 - .incbin "baserom.gba", 0x5a1c30, 0x4 - -gUnknown_085A1C34:: @ 85A1C34 - .incbin "baserom.gba", 0x5a1c34, 0x4 - -gUnknown_085A1C38:: @ 85A1C38 - .incbin "baserom.gba", 0x5a1c38, 0x20 - -gUnknown_085A1C58:: @ 85A1C58 - .incbin "baserom.gba", 0x5a1c58, 0x38 - -gUnknown_085A1C90:: @ 85A1C90 - .incbin "baserom.gba", 0x5a1c90, 0xd8 - -gUnknown_085A1D68:: @ 85A1D68 - .incbin "baserom.gba", 0x5a1d68, 0xd4 - -gUnknown_085A1E3C:: @ 85A1E3C - .incbin "baserom.gba", 0x5a1e3c, 0xa0 - -gUnknown_085A1EDC:: @ 85A1EDC - .incbin "baserom.gba", 0x5a1edc, 0x8 - -gUnknown_085A1EE4:: @ 85A1EE4 - .incbin "baserom.gba", 0x5a1ee4, 0xc - -gUnknown_085A1EF0:: @ 85A1EF0 - .incbin "baserom.gba", 0x5a1ef0, 0x20 - -gUnknown_085A1F10:: @ 85A1F10 - .incbin "baserom.gba", 0x5a1f10, 0x8 - -gUnknown_085A1F18:: @ 85A1F18 - .incbin "baserom.gba", 0x5a1f18, 0x64 - -gUnknown_085A1F7C:: @ 85A1F7C - .incbin "baserom.gba", 0x5a1f7c, 0x18 - -gUnknown_085A1F94:: @ 85A1F94 - .incbin "baserom.gba", 0x5a1f94, 0x3c74 - -gUnknown_085A5C08:: @ 85A5C08 - .incbin "baserom.gba", 0x5a5c08, 0x1 - -gUnknown_085A5C09:: @ 85A5C09 - .incbin "baserom.gba", 0x5a5c09, 0x1b - -gUnknown_085A5C24:: @ 85A5C24 - .incbin "baserom.gba", 0x5a5c24, 0xf04 - -gUnknown_085A6B28:: @ 85A6B28 - .incbin "baserom.gba", 0x5a6b28, 0x20 - -gUnknown_085A6B48:: @ 85A6B48 - .incbin "baserom.gba", 0x5a6b48, 0x20 - -gUnknown_085A6B68:: @ 85A6B68 - .incbin "baserom.gba", 0x5a6b68, 0x10 - -gUnknown_085A6B78:: @ 85A6B78 - .incbin "baserom.gba", 0x5a6b78, 0x18 - -gUnknown_085A6B90:: @ 85A6B90 - .incbin "baserom.gba", 0x5a6b90, 0x20 - -gUnknown_085A6BB0:: @ 85A6BB0 - .incbin "baserom.gba", 0x5a6bb0, 0x20 - -gUnknown_085A6BD0:: @ 85A6BD0 - .incbin "baserom.gba", 0x5a6bd0, 0x18 - -gUnknown_085A6BE8:: @ 85A6BE8 - .incbin "baserom.gba", 0x5a6be8, 0x5c8 - -gUnknown_085A71B0:: @ 85A71B0 - .incbin "baserom.gba", 0x5a71b0, 0xa0 - -gUnknown_085A7250:: @ 85A7250 - .incbin "baserom.gba", 0x5a7250, 0x3c - -gUnknown_085A728C:: @ 85A728C - .incbin "baserom.gba", 0x5a728c, 0x18 - -gUnknown_085A72A4:: @ 85A72A4 - .incbin "baserom.gba", 0x5a72a4, 0x18 - -gUnknown_085A72BC:: @ 85A72BC - .incbin "baserom.gba", 0x5a72bc, 0x8 - -gUnknown_085A72C4:: @ 85A72C4 - .incbin "baserom.gba", 0x5a72c4, 0x8 - -gUnknown_085A72CC:: @ 85A72CC - .incbin "baserom.gba", 0x5a72cc, 0x8 - -gUnknown_085A72D4:: @ 85A72D4 - .incbin "baserom.gba", 0x5a72d4, 0x10 - -gUnknown_085A72E4:: @ 85A72E4 - .incbin "baserom.gba", 0x5a72e4, 0x8 - -gUnknown_085A72EC:: @ 85A72EC - .incbin "baserom.gba", 0x5a72ec, 0x8 - -gUnknown_085A72F4:: @ 85A72F4 - .incbin "baserom.gba", 0x5a72f4, 0x54 - -gUnknown_085A7348:: @ 85A7348 - .incbin "baserom.gba", 0x5a7348, 0x8 - -gUnknown_085A7350:: @ 85A7350 - .incbin "baserom.gba", 0x5a7350, 0x88 - -gUnknown_085A73D8:: @ 85A73D8 - .incbin "baserom.gba", 0x5a73d8, 0x8 - -gUnknown_085A73E0:: @ 85A73E0 - .incbin "baserom.gba", 0x5a73e0, 0x24 - -gUnknown_085A7404:: @ 85A7404 - .incbin "baserom.gba", 0x5a7404, 0x18 - -gUnknown_085A741C:: @ 85A741C - .incbin "baserom.gba", 0x5a741c, 0x8 - -gUnknown_085A7424:: @ 85A7424 - .incbin "baserom.gba", 0x5a7424, 0x10 - -gUnknown_085A7434:: @ 85A7434 - .incbin "baserom.gba", 0x5a7434, 0x10 - -gUnknown_085A7444:: @ 85A7444 - .incbin "baserom.gba", 0x5a7444, 0x8 - -gUnknown_085A744C:: @ 85A744C - .incbin "baserom.gba", 0x5a744c, 0x4 - -gUnknown_085A7450:: @ 85A7450 - .incbin "baserom.gba", 0x5a7450, 0x74 - -gUnknown_085A74C4:: @ 85A74C4 - .incbin "baserom.gba", 0x5a74c4, 0xc - -gUnknown_085A74D0:: @ 85A74D0 - .incbin "baserom.gba", 0x5a74d0, 0x14 - -gUnknown_085A74E4:: @ 85A74E4 - .incbin "baserom.gba", 0x5a74e4, 0xc - -gUnknown_085A74F0:: @ 85A74F0 - .incbin "baserom.gba", 0x5a74f0, 0xc - -gUnknown_085A74FC:: @ 85A74FC - .incbin "baserom.gba", 0x5a74fc, 0xc - -gUnknown_085A7508:: @ 85A7508 - .incbin "baserom.gba", 0x5a7508, 0xc - -gUnknown_085A7514:: @ 85A7514 - .incbin "baserom.gba", 0x5a7514, 0xc - -gUnknown_085A7520:: @ 85A7520 - .incbin "baserom.gba", 0x5a7520, 0xc - -gUnknown_085A752C:: @ 85A752C - .incbin "baserom.gba", 0x5a752c, 0xc - -gUnknown_085A7538:: @ 85A7538 - .incbin "baserom.gba", 0x5a7538, 0xc - -gUnknown_085A7544:: @ 85A7544 - .incbin "baserom.gba", 0x5a7544, 0xc - -gUnknown_085A7550:: @ 85A7550 - .incbin "baserom.gba", 0x5a7550, 0x8 - -gUnknown_085A7558:: @ 85A7558 - .incbin "baserom.gba", 0x5a7558, 0x10 - -gUnknown_085A7568:: @ 85A7568 - .incbin "baserom.gba", 0x5a7568, 0x2 - -gUnknown_085A756A:: @ 85A756A - .incbin "baserom.gba", 0x5a756a, 0xa - -gUnknown_085A7574:: @ 85A7574 - .incbin "baserom.gba", 0x5a7574, 0x4c - -gUnknown_085A75C0:: @ 85A75C0 - .incbin "baserom.gba", 0x5a75c0, 0x4 - -gUnknown_085A75C4:: @ 85A75C4 - .incbin "baserom.gba", 0x5a75c4, 0x8 - -gUnknown_085A75CC:: @ 85A75CC - .incbin "baserom.gba", 0x5a75cc, 0x8 - -gUnknown_085A75D4:: @ 85A75D4 - .incbin "baserom.gba", 0x5a75d4, 0x3c - -gUnknown_085A7610:: @ 85A7610 - .incbin "baserom.gba", 0x5a7610, 0x4 - -gUnknown_085A7614:: @ 85A7614 - .incbin "baserom.gba", 0x5a7614, 0x2 - -gUnknown_085A7616:: @ 85A7616 - .incbin "baserom.gba", 0x5a7616, 0x8 - -gUnknown_085A761E:: @ 85A761E - .incbin "baserom.gba", 0x5a761e, 0x8 - -gUnknown_085A7626:: @ 85A7626 - .incbin "baserom.gba", 0x5a7626, 0x8 - -gUnknown_085A762E:: @ 85A762E - .incbin "baserom.gba", 0x5a762e, 0x10 - -gUnknown_085A763E:: @ 85A763E - .incbin "baserom.gba", 0x5a763e, 0x10 - -gUnknown_085A764E:: @ 85A764E - .incbin "baserom.gba", 0x5a764e, 0x10 - -gUnknown_085A765E:: @ 85A765E - .incbin "baserom.gba", 0x5a765e, 0x10 - -gUnknown_085A766E:: @ 85A766E - .incbin "baserom.gba", 0x5a766e, 0x3f - -gUnknown_085A76AD:: @ 85A76AD - .incbin "baserom.gba", 0x5a76ad, 0x7 - -gUnknown_085A76B4:: @ 85A76B4 - .incbin "baserom.gba", 0x5a76b4, 0xc - -gUnknown_085A76C0:: @ 85A76C0 - .incbin "baserom.gba", 0x5a76c0, 0x12 - -gUnknown_085A76D2:: @ 85A76D2 - .incbin "baserom.gba", 0x5a76d2, 0x12 - -gUnknown_085A76E4:: @ 85A76E4 - .incbin "baserom.gba", 0x5a76e4, 0x1e - -gUnknown_085A7702:: @ 85A7702 - .incbin "baserom.gba", 0x5a7702, 0x66 - -gUnknown_085A7768:: @ 85A7768 - .incbin "baserom.gba", 0x5a7768, 0x66 - -gUnknown_085A77CE:: @ 85A77CE - .incbin "baserom.gba", 0x5a77ce, 0xa - -gUnknown_085A77D8:: @ 85A77D8 - .incbin "baserom.gba", 0x5a77d8, 0x14 - -gUnknown_085A77EC:: @ 85A77EC - .incbin "baserom.gba", 0x5a77ec, 0xa - -gUnknown_085A77F6:: @ 85A77F6 - .incbin "baserom.gba", 0x5a77f6, 0x8 - -gUnknown_085A77FE:: @ 85A77FE - .incbin "baserom.gba", 0x5a77fe, 0x6 - -gUnknown_085A7804:: @ 85A7804 - .incbin "baserom.gba", 0x5a7804, 0xa - -gUnknown_085A780E:: @ 85A780E - .incbin "baserom.gba", 0x5a780e, 0x8 - -gUnknown_085A7816:: @ 85A7816 - .incbin "baserom.gba", 0x5a7816, 0x12 - -gUnknown_085A7828:: @ 85A7828 - .incbin "baserom.gba", 0x5a7828, 0x12 - -gUnknown_085A783A:: @ 85A783A - .incbin "baserom.gba", 0x5a783a, 0x8e - -gUnknown_085A78C8:: @ 85A78C8 - .incbin "baserom.gba", 0x5a78c8, 0x13c - -gUnknown_085A7A04:: @ 85A7A04 - .incbin "baserom.gba", 0x5a7a04, 0x1c - -gUnknown_085A7A20:: @ 85A7A20 - .incbin "baserom.gba", 0x5a7a20, 0x2c0 - -gUnknown_085A7CE0:: @ 85A7CE0 - .incbin "baserom.gba", 0x5a7ce0, 0x18 - -gUnknown_085A7CF8:: @ 85A7CF8 - .incbin "baserom.gba", 0x5a7cf8, 0x18 - -gUnknown_085A7D10:: @ 85A7D10 - .incbin "baserom.gba", 0x5a7d10, 0x18 - -gUnknown_085A7D28:: @ 85A7D28 - .incbin "baserom.gba", 0x5a7d28, 0x18 - -gUnknown_085A7D40:: @ 85A7D40 - .incbin "baserom.gba", 0x5a7d40, 0x18 - -gUnknown_085A7D58:: @ 85A7D58 - .incbin "baserom.gba", 0x5a7d58, 0x18 - -gUnknown_085A7D70:: @ 85A7D70 - .incbin "baserom.gba", 0x5a7d70, 0x18 - -gUnknown_085A7D88:: @ 85A7D88 - .incbin "baserom.gba", 0x5a7d88, 0x18 - -gUnknown_085A7DA0:: @ 85A7DA0 - .incbin "baserom.gba", 0x5a7da0, 0x18 - -gUnknown_085A7DB8:: @ 85A7DB8 - .incbin "baserom.gba", 0x5a7db8, 0x18 - -gUnknown_085A7DD0:: @ 85A7DD0 - .incbin "baserom.gba", 0x5a7dd0, 0x18 - -gUnknown_085A7DE8:: @ 85A7DE8 - .incbin "baserom.gba", 0x5a7de8, 0x18 - -gUnknown_085A7E00:: @ 85A7E00 - .incbin "baserom.gba", 0x5a7e00, 0x18 - -gUnknown_085A7E18:: @ 85A7E18 - .incbin "baserom.gba", 0x5a7e18, 0x18 - -gUnknown_085A7E30:: @ 85A7E30 - .incbin "baserom.gba", 0x5a7e30, 0x168 - -gUnknown_085A7F98:: @ 85A7F98 - .incbin "baserom.gba", 0x5a7f98, 0x28 - -gUnknown_085A7FC0:: @ 85A7FC0 - .incbin "baserom.gba", 0x5a7fc0, 0x20 - -gUnknown_085A7FE0:: @ 85A7FE0 - .incbin "baserom.gba", 0x5a7fe0, 0x14 - -gUnknown_085A7FF4:: @ 85A7FF4 - .incbin "baserom.gba", 0x5a7ff4, 0x1c - -gUnknown_085A8010:: @ 85A8010 - .incbin "baserom.gba", 0x5a8010, 0x18 - -gUnknown_085A8028:: @ 85A8028 - .incbin "baserom.gba", 0x5a8028, 0x14 - -gUnknown_085A803C:: @ 85A803C - .incbin "baserom.gba", 0x5a803c, 0x228 - -gUnknown_085A8264:: @ 85A8264 - .incbin "baserom.gba", 0x5a8264, 0x68 - -gUnknown_085A82CC:: @ 85A82CC - .incbin "baserom.gba", 0x5a82cc, 0x68 - -gUnknown_085A8334:: @ 85A8334 - .incbin "baserom.gba", 0x5a8334, 0xb0 - -gUnknown_085A83E4:: @ 85A83E4 - .incbin "baserom.gba", 0x5a83e4, 0x24 - -gUnknown_085A8408:: @ 85A8408 - .incbin "baserom.gba", 0x5a8408, 0x14 - -gUnknown_085A841C:: @ 85A841C - .incbin "baserom.gba", 0x5a841c, 0x14 - -gUnknown_085A8430:: @ 85A8430 - .incbin "baserom.gba", 0x5a8430, 0x5 - -gUnknown_085A8435:: @ 85A8435 - .incbin "baserom.gba", 0x5a8435, 0x6 - -gUnknown_085A843B:: @ 85A843B - .incbin "baserom.gba", 0x5a843b, 0x65 - -gUnknown_085A84A0:: @ 85A84A0 - .incbin "baserom.gba", 0x5a84a0, 0xc - -gUnknown_085A84AC:: @ 85A84AC - .incbin "baserom.gba", 0x5a84ac, 0x64 - -gUnknown_085A8510:: @ 85A8510 - .incbin "baserom.gba", 0x5a8510, 0x10 - -gUnknown_085A8520:: @ 85A8520 - .incbin "baserom.gba", 0x5a8520, 0x4 - -gUnknown_085A8524:: @ 85A8524 - .incbin "baserom.gba", 0x5a8524, 0x20 - -gUnknown_085A8544:: @ 85A8544 - .incbin "baserom.gba", 0x5a8544, 0x48 - -gUnknown_085A858C:: @ 85A858C - .incbin "baserom.gba", 0x5a858c, 0x1154 - -gUnknown_085A96E0:: @ 85A96E0 - .incbin "baserom.gba", 0x5a96e0, 0x1b8 - -gUnknown_085A9898:: @ 85A9898 - .incbin "baserom.gba", 0x5a9898, 0x4 - -gUnknown_085A989C:: @ 85A989C - .incbin "baserom.gba", 0x5a989c, 0x200 - -gUnknown_085A9A9C:: @ 85A9A9C - .incbin "baserom.gba", 0x5a9a9c, 0x1084 - -gUnknown_085AAB20:: @ 85AAB20 - .incbin "baserom.gba", 0x5aab20, 0xc30 - -gUnknown_085AB750:: @ 85AB750 - .incbin "baserom.gba", 0x5ab750, 0xb38 - -gUnknown_085AC288:: @ 85AC288 - .incbin "baserom.gba", 0x5ac288, 0xfb8 - -gUnknown_085AD240:: @ 85AD240 - .incbin "baserom.gba", 0x5ad240, 0x1130 - -gUnknown_085AE370:: @ 85AE370 - .incbin "baserom.gba", 0x5ae370, 0x604 - -gUnknown_085AE974:: @ 85AE974 - .incbin "baserom.gba", 0x5ae974, 0x50c - -gUnknown_085AEE80:: @ 85AEE80 - .incbin "baserom.gba", 0x5aee80, 0x50c - -gUnknown_085AF38C:: @ 85AF38C - .incbin "baserom.gba", 0x5af38c, 0x50c - -gUnknown_085AF898:: @ 85AF898 - .incbin "baserom.gba", 0x5af898, 0x50c - -gUnknown_085AFDA4:: @ 85AFDA4 - .incbin "baserom.gba", 0x5afda4, 0x50c - -gUnknown_085B02B0:: @ 85B02B0 - .incbin "baserom.gba", 0x5b02b0, 0x524 - -gUnknown_085B07D4:: @ 85B07D4 - .incbin "baserom.gba", 0x5b07d4, 0x14 - -gUnknown_085B07E8:: @ 85B07E8 - .incbin "baserom.gba", 0x5b07e8, 0x4 - -gUnknown_085B07EC:: @ 85B07EC - .incbin "baserom.gba", 0x5b07ec, 0x8 - -gUnknown_085B07F4:: @ 85B07F4 - .incbin "baserom.gba", 0x5b07f4, 0x3c - -gUnknown_085B0830:: @ 85B0830 - .incbin "baserom.gba", 0x5b0830, 0x8 - -gUnknown_085B0838:: @ 85B0838 - .incbin "baserom.gba", 0x5b0838, 0x4 - - @ todo, label functions from battle_ai.c -sBattleAICmdTable:: @ 85B083C - .4byte 0x08131179 - .4byte 0x081311b9 - .4byte 0x081311f9 - .4byte 0x08131239 - .4byte 0x08131279 - .4byte 0x081312bd - .4byte 0x08131325 - .4byte 0x0813138d - .4byte 0x081313f5 - .4byte 0x0813145d - .4byte 0x081314d1 - .4byte 0x08131545 - .4byte 0x081315b9 - .4byte 0x0813162d - .4byte 0x0813169d - .4byte 0x0813170d - .4byte 0x08131789 - .4byte 0x08131805 - .4byte 0x08131841 - .4byte 0x0813187d - .4byte 0x081318b9 - .4byte 0x081318f5 - .4byte 0x08131949 - .4byte 0x0813199d - .4byte 0x081319f1 - .4byte 0x08131a45 - .4byte 0x08131a89 - .4byte 0x08131acd - .4byte 0x08131b35 - .4byte 0x08131ba1 - .4byte 0x08131c0d - .4byte 0x08131c7d - .4byte 0x08131ced - .4byte 0x08131d5d - .4byte 0x08131d81 - .4byte 0x08131f1d - .4byte 0x08131f49 - .4byte 0x0813214d - .4byte 0x081321a5 - .4byte 0x081321e1 - .4byte 0x0813221d - .4byte 0x08132269 - .4byte 0x081322b5 - .4byte 0x081322b9 - .4byte 0x081322bd - .4byte 0x081323b9 - .4byte 0x081323d5 - .4byte 0x08132401 - .4byte 0x08132615 - .4byte 0x08132701 - .4byte 0x081327d1 - .4byte 0x081327d5 - .4byte 0x081327d9 - .4byte 0x081328b9 - .4byte 0x08132995 - .4byte 0x08132a01 - .4byte 0x08132a4d - .4byte 0x08132a99 - .4byte 0x08132b01 - .4byte 0x08132b69 - .4byte 0x08132bd1 - .4byte 0x08132c39 - .4byte 0x08132d35 - .4byte 0x08132e19 - .4byte 0x08132f49 - .4byte 0x08133021 - .4byte 0x08133119 - .4byte 0x081331fd - .4byte 0x08133285 - .4byte 0x08133315 - .4byte 0x08133329 - .4byte 0x08133389 - .4byte 0x0813339d - .4byte 0x08133495 - .4byte 0x081334ed - .4byte 0x08133539 - .4byte 0x08133585 - .4byte 0x081335ad - .4byte 0x081335f9 - .4byte 0x08133625 - .4byte 0x08133651 - .4byte 0x0813367d - .4byte 0x081336c9 - .4byte 0x081336cd - .4byte 0x081336d1 - .4byte 0x081336d5 - .4byte 0x081336d9 - .4byte 0x081336dd - .4byte 0x081336e1 - .4byte 0x08133711 - .4byte 0x08133731 - .4byte 0x08133755 - .4byte 0x0813382d - .4byte 0x0813387d - .4byte 0x081338cd - .4byte 0x08131eb5 - .4byte 0x0813251d - .4byte 0x0813391d - .4byte 0x08133415 - -gUnknown_085B09C8:: @ 85B09C8 - .incbin "baserom.gba", 0x5b09c8, 0x1c - -gUnknown_085B09E4:: @ 85B09E4 - .incbin "baserom.gba", 0x5b09e4, 0x10 - -gUnknown_085B09F4:: @ 85B09F4 - .incbin "baserom.gba", 0x5b09f4, 0x4 - -gUnknown_085B09F8:: @ 85B09F8 - .incbin "baserom.gba", 0x5b09f8, 0x8 - -gUnknown_085B0A00:: @ 85B0A00 - .incbin "baserom.gba", 0x5b0a00, 0x2 - -gUnknown_085B0A02:: @ 85B0A02 - .incbin "baserom.gba", 0x5b0a02, 0x7e - -gUnknown_085B0A80:: @ 85B0A80 - .incbin "baserom.gba", 0x5b0a80, 0x18c - -gUnknown_085B0C0C:: @ 85B0C0C - .incbin "baserom.gba", 0x5b0c0c, 0x1f8 - -gUnknown_085B0E04:: @ 85B0E04 - .incbin "baserom.gba", 0x5b0e04, 0xfc8 - -gUnknown_085B1DCC:: @ 85B1DCC - .incbin "baserom.gba", 0x5b1dcc, 0x10 - -gUnknown_085B1DDC:: @ 85B1DDC - .incbin "baserom.gba", 0x5b1ddc, 0x8 - -gUnknown_085B1DE4:: @ 85B1DE4 - .incbin "baserom.gba", 0x5b1de4, 0x8 - -gUnknown_085B1DEC:: @ 85B1DEC - .incbin "baserom.gba", 0x5b1dec, 0x6 - -gUnknown_085B1DF2:: @ 85B1DF2 - .incbin "baserom.gba", 0x5b1df2, 0x6 - -gUnknown_085B1DF8:: @ 85B1DF8 - .incbin "baserom.gba", 0x5b1df8, 0x8 - -gUnknown_085B1E00:: @ 85B1E00 - .incbin "baserom.gba", 0x5b1e00, 0xc - -gUnknown_085B1E0C:: @ 85B1E0C - .incbin "baserom.gba", 0x5b1e0c, 0x1c - -gUnknown_085B1E28:: @ 85B1E28 - .incbin "baserom.gba", 0x5b1e28, 0xa8 - -gUnknown_085B1ED0:: @ 85B1ED0 - .incbin "baserom.gba", 0x5b1ed0, 0x8 - -gUnknown_085B1ED8:: @ 85B1ED8 - .incbin "baserom.gba", 0x5b1ed8, 0x10 - -gUnknown_085B1EE8:: @ 85B1EE8 - .incbin "baserom.gba", 0x5b1ee8, 0x10 - -gUnknown_085B1EF8:: @ 85B1EF8 - .incbin "baserom.gba", 0x5b1ef8, 0x18 - -gUnknown_085B1F10:: @ 85B1F10 - .incbin "baserom.gba", 0x5b1f10, 0x18 - -gUnknown_085B1F28:: @ 85B1F28 - .incbin "baserom.gba", 0x5b1f28, 0x18 - -gUnknown_085B1F40:: @ 85B1F40 - .incbin "baserom.gba", 0x5b1f40, 0x294 - -gUnknown_085B21D4:: @ 85B21D4 - .incbin "baserom.gba", 0x5b21d4, 0x8 - -gUnknown_085B21DC:: @ 85B21DC - .incbin "baserom.gba", 0x5b21dc, 0x18 - -gUnknown_085B21F4:: @ 85B21F4 - .incbin "baserom.gba", 0x5b21f4, 0x8 - -gUnknown_085B21FC:: @ 85B21FC - .incbin "baserom.gba", 0x5b21fc, 0xc - -gUnknown_085B2208:: @ 85B2208 - .incbin "baserom.gba", 0x5b2208, 0x10 - -gUnknown_085B2218:: @ 85B2218 - .incbin "baserom.gba", 0x5b2218, 0x38 - -gUnknown_085B2250:: @ 85B2250 - .incbin "baserom.gba", 0x5b2250, 0x18 - -gUnknown_085B2268:: @ 85B2268 - .incbin "baserom.gba", 0x5b2268, 0x38 - -gUnknown_085B22A0:: @ 85B22A0 - .incbin "baserom.gba", 0x5b22a0, 0x18 - -gUnknown_085B22B8:: @ 85B22B8 - .incbin "baserom.gba", 0x5b22b8, 0x18 - -gUnknown_085B22D0:: @ 85B22D0 - .incbin "baserom.gba", 0x5b22d0, 0x2d0 - -gUnknown_085B25A0:: @ 85B25A0 - .incbin "baserom.gba", 0x5b25a0, 0x80 - -gUnknown_085B2620:: @ 85B2620 - .incbin "baserom.gba", 0x5b2620, 0xc - -gUnknown_085B262C:: @ 85B262C - .incbin "baserom.gba", 0x5b262c, 0x3c - -gUnknown_085B2668:: @ 85B2668 - .incbin "baserom.gba", 0x5b2668, 0x30 - -gUnknown_085B2698:: @ 85B2698 - .incbin "baserom.gba", 0x5b2698, 0x3 - -gUnknown_085B269B:: @ 85B269B - .incbin "baserom.gba", 0x5b269b, 0x2 - -gUnknown_085B269D:: @ 85B269D - .incbin "baserom.gba", 0x5b269d, 0x2 - -gUnknown_085B269F:: @ 85B269F - .incbin "baserom.gba", 0x5b269f, 0x5 - -gUnknown_085B26A4:: @ 85B26A4 - .incbin "baserom.gba", 0x5b26a4, 0x4c - -gUnknown_085B26F0:: @ 85B26F0 - .incbin "baserom.gba", 0x5b26f0, 0x4 - -gUnknown_085B26F4:: @ 85B26F4 - .incbin "baserom.gba", 0x5b26f4, 0x8 - -gUnknown_085B26FC:: @ 85B26FC - .incbin "baserom.gba", 0x5b26fc, 0x8 - -gUnknown_085B2704:: @ 85B2704 - .incbin "baserom.gba", 0x5b2704, 0x18 - -gUnknown_085B271C:: @ 85B271C - .incbin "baserom.gba", 0x5b271c, 0x4 - -gUnknown_085B2720:: @ 85B2720 - .incbin "baserom.gba", 0x5b2720, 0x28 - -gUnknown_085B2748:: @ 85B2748 - .incbin "baserom.gba", 0x5b2748, 0x60 - -gUnknown_085B27A8:: @ 85B27A8 - .incbin "baserom.gba", 0x5b27a8, 0x8 - -gUnknown_085B27B0:: @ 85B27B0 - .incbin "baserom.gba", 0x5b27b0, 0x18 - -gUnknown_085B27C8:: @ 85B27C8 - .incbin "baserom.gba", 0x5b27c8, 0x88 - -gUnknown_085B2850:: @ 85B2850 - .incbin "baserom.gba", 0x5b2850, 0x20 - -gUnknown_085B2870:: @ 85B2870 - .incbin "baserom.gba", 0x5b2870, 0x20 - -gUnknown_085B2890:: @ 85B2890 - .incbin "baserom.gba", 0x5b2890, 0x10 - -gUnknown_085B28A0:: @ 85B28A0 - .incbin "baserom.gba", 0x5b28a0, 0x10 - -gUnknown_085B28B0:: @ 85B28B0 - .incbin "baserom.gba", 0x5b28b0, 0x1e0 - -gUnknown_085B2A90:: @ 85B2A90 - .incbin "baserom.gba", 0x5b2a90, 0xb4 - -gUnknown_085B2B44:: @ 85B2B44 - .incbin "baserom.gba", 0x5b2b44, 0x18 - -gUnknown_085B2B5C:: @ 85B2B5C - .incbin "baserom.gba", 0x5b2b5c, 0x4 - -gUnknown_085B2B60:: @ 85B2B60 - .incbin "baserom.gba", 0x5b2b60, 0x8 - -gUnknown_085B2B68:: @ 85B2B68 - .incbin "baserom.gba", 0x5b2b68, 0x10 - -gUnknown_085B2B78:: @ 85B2B78 - .incbin "baserom.gba", 0x5b2b78, 0x6 - -gUnknown_085B2B7E:: @ 85B2B7E - .incbin "baserom.gba", 0x5b2b7e, 0xa - -gUnknown_085B2B88:: @ 85B2B88 - .incbin "baserom.gba", 0x5b2b88, 0xc - -gUnknown_085B2B94:: @ 85B2B94 - .incbin "baserom.gba", 0x5b2b94, 0xc - -gUnknown_085B2BA0:: @ 85B2BA0 - .incbin "baserom.gba", 0x5b2ba0, 0xc - -gUnknown_085B2BAC:: @ 85B2BAC - .incbin "baserom.gba", 0x5b2bac, 0x8 - -gUnknown_085B2BB4:: @ 85B2BB4 - .incbin "baserom.gba", 0x5b2bb4, 0x40 - -gUnknown_085B2BF4:: @ 85B2BF4 - .incbin "baserom.gba", 0x5b2bf4, 0x12 - -gUnknown_085B2C06:: @ 85B2C06 - .incbin "baserom.gba", 0x5b2c06, 0x12 - -gUnknown_085B2C18:: @ 85B2C18 - .incbin "baserom.gba", 0x5b2c18, 0x9 - -gUnknown_085B2C21:: @ 85B2C21 - .incbin "baserom.gba", 0x5b2c21, 0x9 - -gUnknown_085B2C2A:: @ 85B2C2A - .incbin "baserom.gba", 0x5b2c2a, 0x26 - -gUnknown_085B2C50:: @ 85B2C50 - .incbin "baserom.gba", 0x5b2c50, 0x78 - -gUnknown_085B2CC8:: @ 85B2CC8 - .incbin "baserom.gba", 0x5b2cc8, 0x14 - -gUnknown_085B2CDC:: @ 85B2CDC - .incbin "baserom.gba", 0x5b2cdc, 0x14 - -gUnknown_085B2CF0:: @ 85B2CF0 - .incbin "baserom.gba", 0x5b2cf0, 0x340 - -gUnknown_085B3030:: @ 85B3030 - .incbin "baserom.gba", 0x5b3030, 0x10 - -gUnknown_085B3040:: @ 85B3040 - .incbin "baserom.gba", 0x5b3040, 0x64 - -gUnknown_085B30A4:: @ 85B30A4 - .incbin "baserom.gba", 0x5b30a4, 0x30 - -gUnknown_085B30D4:: @ 85B30D4 - .incbin "baserom.gba", 0x5b30d4, 0x30 - -gUnknown_085B3104:: @ 85B3104 - .incbin "baserom.gba", 0x5b3104, 0x18 - -gUnknown_085B311C:: @ 85B311C - .incbin "baserom.gba", 0x5b311c, 0x8 - -gUnknown_085B3124:: @ 85B3124 - .incbin "baserom.gba", 0x5b3124, 0x8 - -gUnknown_085B312C:: @ 85B312C - .incbin "baserom.gba", 0x5b312c, 0x16 - -gUnknown_085B3142:: @ 85B3142 - .incbin "baserom.gba", 0x5b3142, 0xc - -gUnknown_085B314E:: @ 85B314E - .incbin "baserom.gba", 0x5b314e, 0xe - -gUnknown_085B315C:: @ 85B315C - .incbin "baserom.gba", 0x5b315c, 0x14 - -gUnknown_085B3170:: @ 85B3170 - .incbin "baserom.gba", 0x5b3170, 0x2c - -gUnknown_085B319C:: @ 85B319C - .incbin "baserom.gba", 0x5b319c, 0x18 - -gUnknown_085B31B4:: @ 85B31B4 - .incbin "baserom.gba", 0x5b31b4, 0x1c - -gUnknown_085B31D0:: @ 85B31D0 - .incbin "baserom.gba", 0x5b31d0, 0x28 - -gUnknown_085B31F8:: @ 85B31F8 - .incbin "baserom.gba", 0x5b31f8, 0x14 - -gUnknown_085B320C:: @ 85B320C - .incbin "baserom.gba", 0x5b320c, 0x14 - -gUnknown_085B3220:: @ 85B3220 - .incbin "baserom.gba", 0x5b3220, 0x8 - -gUnknown_085B3228:: @ 85B3228 - .incbin "baserom.gba", 0x5b3228, 0x2c - -gUnknown_085B3254:: @ 85B3254 - .incbin "baserom.gba", 0x5b3254, 0x2c - -gUnknown_085B3280:: @ 85B3280 - .incbin "baserom.gba", 0x5b3280, 0x160 - -gUnknown_085B33E0:: @ 85B33E0 - .incbin "baserom.gba", 0x5b33e0, 0x16 - -gUnknown_085B33F6:: @ 85B33F6 - .incbin "baserom.gba", 0x5b33f6, 0xa - -gUnknown_085B3400:: @ 85B3400 - .incbin "baserom.gba", 0x5b3400, 0x10 - -gUnknown_085B3410:: @ 85B3410 - .incbin "baserom.gba", 0x5b3410, 0x10 - -gUnknown_085B3420:: @ 85B3420 - .incbin "baserom.gba", 0x5b3420, 0x24 - -gUnknown_085B3444:: @ 85B3444 - .incbin "baserom.gba", 0x5b3444, 0x2c - -gUnknown_085B3470:: @ 85B3470 - .incbin "baserom.gba", 0x5b3470, 0x4 - -gUnknown_085B3474:: @ 85B3474 - .incbin "baserom.gba", 0x5b3474, 0x8 - -gUnknown_085B347C:: @ 85B347C - .incbin "baserom.gba", 0x5b347c, 0x8 - -gUnknown_085B3484:: @ 85B3484 - .incbin "baserom.gba", 0x5b3484, 0xc0 - -gUnknown_085B3544:: @ 85B3544 - .incbin "baserom.gba", 0x5b3544, 0x20 - -gUnknown_085B3564:: @ 85B3564 - .incbin "baserom.gba", 0x5b3564, 0x800 - -gUnknown_085B3D64:: @ 85B3D64 - .incbin "baserom.gba", 0x5b3d64, 0x8 - -gUnknown_085B3D6C:: @ 85B3D6C - .incbin "baserom.gba", 0x5b3d6c, 0x10 - -gUnknown_085B3D7C:: @ 85B3D7C - .incbin "baserom.gba", 0x5b3d7c, 0x8 - -gUnknown_085B3D84:: @ 85B3D84 - .incbin "baserom.gba", 0x5b3d84, 0x8 - -gUnknown_085B3D8C:: @ 85B3D8C - .incbin "baserom.gba", 0x5b3d8c, 0x8 - -gUnknown_085B3D94:: @ 85B3D94 - .incbin "baserom.gba", 0x5b3d94, 0x20 - -gUnknown_085B3DB4:: @ 85B3DB4 - .incbin "baserom.gba", 0x5b3db4, 0x134 - -gUnknown_085B3EE8:: @ 85B3EE8 - .incbin "baserom.gba", 0x5b3ee8, 0x2 - -gUnknown_085B3EEA:: @ 85B3EEA - .incbin "baserom.gba", 0x5b3eea, 0x6 - -gUnknown_085B3EF0:: @ 85B3EF0 - .incbin "baserom.gba", 0x5b3ef0, 0xc - -gUnknown_085B3EFC:: @ 85B3EFC - .incbin "baserom.gba", 0x5b3efc, 0x1c - -gUnknown_085B3F18:: @ 85B3F18 - .incbin "baserom.gba", 0x5b3f18, 0x100 - -gUnknown_085B4018:: @ 85B4018 - .incbin "baserom.gba", 0x5b4018, 0x4 - -gUnknown_085B401C:: @ 85B401C - .incbin "baserom.gba", 0x5b401c, 0x8 - -gUnknown_085B4024:: @ 85B4024 - .incbin "baserom.gba", 0x5b4024, 0x10 - -gUnknown_085B4034:: @ 85B4034 - .incbin "baserom.gba", 0x5b4034, 0xb8 - -gUnknown_085B40EC:: @ 85B40EC - .incbin "baserom.gba", 0x5b40ec, 0x10 - -gUnknown_085B40FC:: @ 85B40FC - .incbin "baserom.gba", 0x5b40fc, 0x38 - -gUnknown_085B4134:: @ 85B4134 - .incbin "baserom.gba", 0x5b4134, 0x6f8 - -gUnknown_085B482C:: @ 85B482C - .incbin "baserom.gba", 0x5b482c, 0x4e4 - -gUnknown_085B4D10:: @ 85B4D10 - .incbin "baserom.gba", 0x5b4d10, 0x4d4 - -gUnknown_085B51E4:: @ 85B51E4 - .incbin "baserom.gba", 0x5b51e4, 0x6a0 - -gUnknown_085B5884:: @ 85B5884 - .incbin "baserom.gba", 0x5b5884, 0x40 - -gUnknown_085B58C4:: @ 85B58C4 - .incbin "baserom.gba", 0x5b58c4, 0x5 - -gUnknown_085B58C9:: @ 85B58C9 - .incbin "baserom.gba", 0x5b58c9, 0x10 - -gUnknown_085B58D9:: @ 85B58D9 - .incbin "baserom.gba", 0x5b58d9, 0x323 - -gUnknown_085B5BFC:: @ 85B5BFC - .incbin "baserom.gba", 0x5b5bfc, 0x200 - -gUnknown_085B5DFC:: @ 85B5DFC - .incbin "baserom.gba", 0x5b5dfc, 0x1a4 - -gUnknown_085B5FA0:: @ 85B5FA0 - .incbin "baserom.gba", 0x5b5fa0, 0x1a0 - -gUnknown_085B6140:: @ 85B6140 - .incbin "baserom.gba", 0x5b6140, 0xc - -gUnknown_085B614C:: @ 85B614C - .incbin "baserom.gba", 0x5b614c, 0x8 - -gUnknown_085B6154:: @ 85B6154 - .incbin "baserom.gba", 0x5b6154, 0xc - -gUnknown_085B6160:: @ 85B6160 - .incbin "baserom.gba", 0x5b6160, 0x184 - -gUnknown_085B62E4:: @ 85B62E4 - .incbin "baserom.gba", 0x5b62e4, 0x4 - -gUnknown_085B62E8:: @ 85B62E8 - .incbin "baserom.gba", 0x5b62e8, 0x5c - -gUnknown_085B6344:: @ 85B6344 - .incbin "baserom.gba", 0x5b6344, 0x4 - -gUnknown_085B6348:: @ 85B6348 - .incbin "baserom.gba", 0x5b6348, 0x40 - -gUnknown_085B6388:: @ 85B6388 - .incbin "baserom.gba", 0x5b6388, 0x68 - -gUnknown_085B63F0:: @ 85B63F0 - .incbin "baserom.gba", 0x5b63f0, 0x18 - -gUnknown_085B6408:: @ 85B6408 - .incbin "baserom.gba", 0x5b6408, 0x8 - -gUnknown_085B6410:: @ 85B6410 - .incbin "baserom.gba", 0x5b6410, 0x8 - -gUnknown_085B6418:: @ 85B6418 - .incbin "baserom.gba", 0x5b6418, 0x6 - -gUnknown_085B641E:: @ 85B641E - .incbin "baserom.gba", 0x5b641e, 0x4 - -gUnknown_085B6422:: @ 85B6422 - .incbin "baserom.gba", 0x5b6422, 0xa - -gUnknown_085B642C:: @ 85B642C - .incbin "baserom.gba", 0x5b642c, 0x10 - -gUnknown_085B643C:: @ 85B643C - .incbin "baserom.gba", 0x5b643c, 0xc - -gUnknown_085B6448:: @ 85B6448 - .incbin "baserom.gba", 0x5b6448, 0xf3c - -gUnknown_085B7384:: @ 85B7384 - .incbin "baserom.gba", 0x5b7384, 0x98 - -gUnknown_085B741C:: @ 85B741C - .incbin "baserom.gba", 0x5b741c, 0x6c - -gUnknown_085B7488:: @ 85B7488 - .incbin "baserom.gba", 0x5b7488, 0x8 - -gUnknown_085B7490:: @ 85B7490 - .incbin "baserom.gba", 0x5b7490, 0x78 - -gUnknown_085B7508:: @ 85B7508 - .incbin "baserom.gba", 0x5b7508, 0x60 - -gUnknown_085B7568:: @ 85B7568 - .incbin "baserom.gba", 0x5b7568, 0x48 - -gUnknown_085B75B0:: @ 85B75B0 - .incbin "baserom.gba", 0x5b75b0, 0x60 - -gUnknown_085B7610:: @ 85B7610 - .incbin "baserom.gba", 0x5b7610, 0x140 - -gUnknown_085B7750:: @ 85B7750 - .incbin "baserom.gba", 0x5b7750, 0x94 - -gUnknown_085B77E4:: @ 85B77E4 - .incbin "baserom.gba", 0x5b77e4, 0x18 - -gUnknown_085B77FC:: @ 85B77FC - .incbin "baserom.gba", 0x5b77fc, 0x18 - -gUnknown_085B7814:: @ 85B7814 - .incbin "baserom.gba", 0x5b7814, 0x18 - -gUnknown_085B782C:: @ 85B782C - .incbin "baserom.gba", 0x5b782c, 0x18 - -gUnknown_085B7844:: @ 85B7844 - .incbin "baserom.gba", 0x5b7844, 0x20 - -gUnknown_085B7864:: @ 85B7864 - .incbin "baserom.gba", 0x5b7864, 0xc4 - -gUnknown_085B7928:: @ 85B7928 - .incbin "baserom.gba", 0x5b7928, 0x20 - -gUnknown_085B7948:: @ 85B7948 - .incbin "baserom.gba", 0x5b7948, 0x8 - -gUnknown_085B7950:: @ 85B7950 - .incbin "baserom.gba", 0x5b7950, 0x28 - -gUnknown_085B7978:: @ 85B7978 - .incbin "baserom.gba", 0x5b7978, 0x80 - -gUnknown_085B79F8:: @ 85B79F8 - .incbin "baserom.gba", 0x5b79f8, 0x18 - -gUnknown_085B7A10:: @ 85B7A10 - .incbin "baserom.gba", 0x5b7a10, 0x30 - -gUnknown_085B7A40:: @ 85B7A40 - .incbin "baserom.gba", 0x5b7a40, 0x7c - -gUnknown_085B7ABC:: @ 85B7ABC - .incbin "baserom.gba", 0x5b7abc, 0x30 - -gUnknown_085B7AEC:: @ 85B7AEC - .incbin "baserom.gba", 0x5b7aec, 0x18 - -gUnknown_085B7B04:: @ 85B7B04 - .incbin "baserom.gba", 0x5b7b04, 0x6 - -gUnknown_085B7B0A:: @ 85B7B0A - .incbin "baserom.gba", 0x5b7b0a, 0x8 - -gUnknown_085B7B12:: @ 85B7B12 - .incbin "baserom.gba", 0x5b7b12, 0x8 - -gUnknown_085B7B1A:: @ 85B7B1A - .incbin "baserom.gba", 0x5b7b1a, 0x14 - -gUnknown_085B7B2E:: @ 85B7B2E - .incbin "baserom.gba", 0x5b7b2e, 0x18 - -gUnknown_085B7B46:: @ 85B7B46 - .incbin "baserom.gba", 0x5b7b46, 0x2 - -gUnknown_085B7B48:: @ 85B7B48 - .incbin "baserom.gba", 0x5b7b48, 0x8d0 - -gUnknown_085B8418:: @ 85B8418 - .incbin "baserom.gba", 0x5b8418, 0x20 - -gUnknown_085B8438:: @ 85B8438 - .incbin "baserom.gba", 0x5b8438, 0x338 - -gUnknown_085B8770:: @ 85B8770 - .incbin "baserom.gba", 0x5b8770, 0x480 - -gUnknown_085B8BF0:: @ 85B8BF0 - .incbin "baserom.gba", 0x5b8bf0, 0x20 - -gUnknown_085B8C10:: @ 85B8C10 - .incbin "baserom.gba", 0x5b8c10, 0x20 - -gUnknown_085B8C30:: @ 85B8C30 - .incbin "baserom.gba", 0x5b8c30, 0x2 - -gUnknown_085B8C32:: @ 85B8C32 - .incbin "baserom.gba", 0x5b8c32, 0x36 - -gUnknown_085B8C68:: @ 85B8C68 - .incbin "baserom.gba", 0x5b8c68, 0x18 - -gUnknown_085B8C80:: @ 85B8C80 - .incbin "baserom.gba", 0x5b8c80, 0x10 - -gUnknown_085B8C90:: @ 85B8C90 - .incbin "baserom.gba", 0x5b8c90, 0x528 - -gUnknown_085B91B8:: @ 85B91B8 - .incbin "baserom.gba", 0x5b91b8, 0x178 - -gUnknown_085B9330:: @ 85B9330 - .incbin "baserom.gba", 0x5b9330, 0x580 - -gUnknown_085B98B0:: @ 85B98B0 - .incbin "baserom.gba", 0x5b98b0, 0x240 - -gUnknown_085B9AF0:: @ 85B9AF0 - .incbin "baserom.gba", 0x5b9af0, 0x11e0 - -gUnknown_085BACD0:: @ 85BACD0 - .incbin "baserom.gba", 0x5bacd0, 0x1e0 - -gUnknown_085BAEB0:: @ 85BAEB0 - .incbin "baserom.gba", 0x5baeb0, 0x20 - -gUnknown_085BAED0:: @ 85BAED0 - .incbin "baserom.gba", 0x5baed0, 0x378 - -gUnknown_085BB248:: @ 85BB248 - .incbin "baserom.gba", 0x5bb248, 0x25c - -gUnknown_085BB4A4:: @ 85BB4A4 - .incbin "baserom.gba", 0x5bb4a4, 0x48c - -gUnknown_085BB930:: @ 85BB930 - .incbin "baserom.gba", 0x5bb930, 0x2e4 - -gUnknown_085BBC14:: @ 85BBC14 - .incbin "baserom.gba", 0x5bbc14, 0x6a0 - -gUnknown_085BC2B4:: @ 85BC2B4 - .incbin "baserom.gba", 0x5bc2b4, 0x20 - -gUnknown_085BC2D4:: @ 85BC2D4 - .incbin "baserom.gba", 0x5bc2d4, 0x20 - -gUnknown_085BC2F4:: @ 85BC2F4 - .incbin "baserom.gba", 0x5bc2f4, 0x20 - -gUnknown_085BC314:: @ 85BC314 - .incbin "baserom.gba", 0x5bc314, 0x800 - -gUnknown_085BCB14:: @ 85BCB14 - .incbin "baserom.gba", 0x5bcb14, 0x800 - -gUnknown_085BD314:: @ 85BD314 - .incbin "baserom.gba", 0x5bd314, 0x820 - -gUnknown_085BDB34:: @ 85BDB34 - .incbin "baserom.gba", 0x5bdb34, 0x6b4 - -gUnknown_085BE1E8:: @ 85BE1E8 - .incbin "baserom.gba", 0x5be1e8, 0x334 - -gUnknown_085BE51C:: @ 85BE51C - .incbin "baserom.gba", 0x5be51c, 0x56c - -gUnknown_085BEA88:: @ 85BEA88 - .incbin "baserom.gba", 0x5bea88, 0x318 - -gUnknown_085BEDA0:: @ 85BEDA0 - .incbin "baserom.gba", 0x5beda0, 0x140 - -gUnknown_085BEEE0:: @ 85BEEE0 - .incbin "baserom.gba", 0x5beee0, 0x1c0 - -gUnknown_085BF0A0:: @ 85BF0A0 - .incbin "baserom.gba", 0x5bf0a0, 0x200 - -gUnknown_085BF2A0:: @ 85BF2A0 - .incbin "baserom.gba", 0x5bf2a0, 0x200 - -gUnknown_085BF4A0:: @ 85BF4A0 - .incbin "baserom.gba", 0x5bf4a0, 0xa0 - -gUnknown_085BF540:: @ 85BF540 - .incbin "baserom.gba", 0x5bf540, 0x160 - -gUnknown_085BF6A0:: @ 85BF6A0 - .incbin "baserom.gba", 0x5bf6a0, 0x7540 - -gUnknown_085C6BE0:: @ 85C6BE0 - .incbin "baserom.gba", 0x5c6be0, 0x1000 - -gUnknown_085C7BE0:: @ 85C7BE0 - .incbin "baserom.gba", 0x5c7be0, 0x20 - -gUnknown_085C7C00:: @ 85C7C00 - .incbin "baserom.gba", 0x5c7c00, 0x68c - -gUnknown_085C828C:: @ 85C828C - .incbin "baserom.gba", 0x5c828c, 0x2ec - -gUnknown_085C8578:: @ 85C8578 - .incbin "baserom.gba", 0x5c8578, 0x20 - -gUnknown_085C8598:: @ 85C8598 - .incbin "baserom.gba", 0x5c8598, 0x15c - -gUnknown_085C86F4:: @ 85C86F4 - .incbin "baserom.gba", 0x5c86f4, 0x100 - -gUnknown_085C87F4:: @ 85C87F4 - .incbin "baserom.gba", 0x5c87f4, 0xb0 - -gUnknown_085C88A4:: @ 85C88A4 - .incbin "baserom.gba", 0x5c88a4, 0x84 - -gUnknown_085C8928:: @ 85C8928 - .incbin "baserom.gba", 0x5c8928, 0x20 - -gUnknown_085C8948:: @ 85C8948 - .incbin "baserom.gba", 0x5c8948, 0xa8 - -gUnknown_085C89F0:: @ 85C89F0 - .incbin "baserom.gba", 0x5c89f0, 0xa8 - -gUnknown_085C8A98:: @ 85C8A98 - .incbin "baserom.gba", 0x5c8a98, 0x10 - -gUnknown_085C8AA8:: @ 85C8AA8 - .incbin "baserom.gba", 0x5c8aa8, 0xc - -gUnknown_085C8AB4:: @ 85C8AB4 - .incbin "baserom.gba", 0x5c8ab4, 0x8 - -gUnknown_085C8ABC:: @ 85C8ABC - .incbin "baserom.gba", 0x5c8abc, 0x8 - -gUnknown_085C8AC4:: @ 85C8AC4 - .incbin "baserom.gba", 0x5c8ac4, 0x1c - -gUnknown_085C8AE0:: @ 85C8AE0 - .incbin "baserom.gba", 0x5c8ae0, 0x1c - -gUnknown_085C8AFC:: @ 85C8AFC - .incbin "baserom.gba", 0x5c8afc, 0x18 - -gUnknown_085C8B14:: @ 85C8B14 - .incbin "baserom.gba", 0x5c8b14, 0x18 - -gUnknown_085C8B2C:: @ 85C8B2C - .incbin "baserom.gba", 0x5c8b2c, 0x18 - -gUnknown_085C8B44:: @ 85C8B44 - .incbin "baserom.gba", 0x5c8b44, 0x18 - -gUnknown_085C8B5C:: @ 85C8B5C - .incbin "baserom.gba", 0x5c8b5c, 0x20 - -gUnknown_085C8B7C:: @ 85C8B7C - .incbin "baserom.gba", 0x5c8b7c, 0xc - -gUnknown_085C8B88:: @ 85C8B88 - .incbin "baserom.gba", 0x5c8b88, 0x4 - -gUnknown_085C8B8C:: @ 85C8B8C - .incbin "baserom.gba", 0x5c8b8c, 0xa - -gUnknown_085C8B96:: @ 85C8B96 - .incbin "baserom.gba", 0x5c8b96, 0x6 - -gUnknown_085C8B9C:: @ 85C8B9C - .incbin "baserom.gba", 0x5c8b9c, 0x1c - -gUnknown_085C8BB8:: @ 85C8BB8 - .incbin "baserom.gba", 0x5c8bb8, 0x8 - -gUnknown_085C8BC0:: @ 85C8BC0 - .incbin "baserom.gba", 0x5c8bc0, 0xc - -gUnknown_085C8BCC:: @ 85C8BCC - .incbin "baserom.gba", 0x5c8bcc, 0x28 - -gUnknown_085C8BF4:: @ 85C8BF4 - .incbin "baserom.gba", 0x5c8bf4, 0x6 - -gUnknown_085C8BFA:: @ 85C8BFA - .incbin "baserom.gba", 0x5c8bfa, 0x14 - -gUnknown_085C8C0E:: @ 85C8C0E - .incbin "baserom.gba", 0x5c8c0e, 0x16 - -gUnknown_085C8C24:: @ 85C8C24 - .incbin "baserom.gba", 0x5c8c24, 0x1c - -gUnknown_085C8C40:: @ 85C8C40 - .incbin "baserom.gba", 0x5c8c40, 0x4 - -gUnknown_085C8C44:: @ 85C8C44 - .incbin "baserom.gba", 0x5c8c44, 0x4 - -gUnknown_085C8C48:: @ 85C8C48 - .incbin "baserom.gba", 0x5c8c48, 0xc - -gUnknown_085C8C54:: @ 85C8C54 - .incbin "baserom.gba", 0x5c8c54, 0x10 - -gUnknown_085C8C64:: @ 85C8C64 - .incbin "baserom.gba", 0x5c8c64, 0x2 - -gUnknown_085C8C66:: @ 85C8C66 - .incbin "baserom.gba", 0x5c8c66, 0x6 - -gUnknown_085C8C6C:: @ 85C8C6C - .incbin "baserom.gba", 0x5c8c6c, 0xc - -gUnknown_085C8C78:: @ 85C8C78 - .incbin "baserom.gba", 0x5c8c78, 0x8 - -gUnknown_085C8C80:: @ 85C8C80 - .incbin "baserom.gba", 0x5c8c80, 0x4 - -gUnknown_085C8C84:: @ 85C8C84 - .incbin "baserom.gba", 0x5c8c84, 0xb4 - -gUnknown_085C8D38:: @ 85C8D38 - .incbin "baserom.gba", 0x5c8d38, 0x8 - -gUnknown_085C8D40:: @ 85C8D40 - .incbin "baserom.gba", 0x5c8d40, 0x20 - -gUnknown_085C8D60:: @ 85C8D60 - .incbin "baserom.gba", 0x5c8d60, 0x2c - -gUnknown_085C8D8C:: @ 85C8D8C - .incbin "baserom.gba", 0x5c8d8c, 0x14 - -gUnknown_085C8DA0:: @ 85C8DA0 - .incbin "baserom.gba", 0x5c8da0, 0x10 - -gUnknown_085C8DB0:: @ 85C8DB0 - .incbin "baserom.gba", 0x5c8db0, 0xc - -gUnknown_085C8DBC:: @ 85C8DBC - .incbin "baserom.gba", 0x5c8dbc, 0x14 - -gUnknown_085C8DD0:: @ 85C8DD0 - .incbin "baserom.gba", 0x5c8dd0, 0x46 - -gUnknown_085C8E16:: @ 85C8E16 - .incbin "baserom.gba", 0x5c8e16, 0xe - -gUnknown_085C8E24:: @ 85C8E24 - .incbin "baserom.gba", 0x5c8e24, 0x44 - -gUnknown_085C8E68:: @ 85C8E68 - .incbin "baserom.gba", 0x5c8e68, 0x6c - - .align 2 -gFieldEffectObjectPalette10:: @ 85C8ED4 - .incbin "graphics/map_objects/palettes/field_effect_object_palette_10.gbapal" - - .align 2 -gFieldEffectObjectPaletteInfo10:: @ 85C8EF4 - obj_pal gFieldEffectObjectPalette10, 0x1009 - - .incbin "baserom.gba", 0x5c8efc, 0xe0 - -gUnknown_085C8FDC:: @ 85C8FDC - .incbin "baserom.gba", 0x5c8fdc, 0x14 - -gUnknown_085C8FF0:: @ 85C8FF0 - .incbin "baserom.gba", 0x5c8ff0, 0x30 - -gUnknown_085C9020:: @ 85C9020 - .incbin "baserom.gba", 0x5c9020, 0x4b0 - -gUnknown_085C94D0:: @ 85C94D0 - .incbin "baserom.gba", 0x5c94d0, 0x500 - -gUnknown_085C99D0:: @ 85C99D0 - .incbin "baserom.gba", 0x5c99d0, 0x18 - -gUnknown_085C99E8:: @ 85C99E8 - .incbin "baserom.gba", 0x5c99e8, 0x10 - -gUnknown_085C99F8:: @ 85C99F8 - .incbin "baserom.gba", 0x5c99f8, 0x10 - -gUnknown_085C9A08:: @ 85C9A08 - .incbin "baserom.gba", 0x5c9a08, 0x14 - -gUnknown_085C9A1C:: @ 85C9A1C - .incbin "baserom.gba", 0x5c9a1c, 0x14 - -gUnknown_085C9A30:: @ 85C9A30 - .incbin "baserom.gba", 0x5c9a30, 0x23 - -gUnknown_085C9A53:: @ 85C9A53 - .incbin "baserom.gba", 0x5c9a53, 0x41 - -gLinkPartnerBufferCommands:: @ 85C9A94 - .incbin "baserom.gba", 0x5c9a94, 0xe4 diff --git a/data/bg.s b/data/data3a.s similarity index 51% rename from data/bg.s rename to data/data3a.s index 2881d4347..0b5595241 100644 --- a/data/bg.s +++ b/data/data3a.s @@ -3,5 +3,6 @@ .section .rodata -gZeroedBgControlStruct:: @ 82E9580 - .4byte 0 + @ unknown unreferenced data + + .incbin "baserom.gba", 0x58d977, 0x2a1 diff --git a/data/data3b.s b/data/data3b.s new file mode 100644 index 000000000..71d189254 --- /dev/null +++ b/data/data3b.s @@ -0,0 +1,1014 @@ +@ the third big chunk of data + + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + .align 2 +gFieldEffectObjectPalette7:: @ 858DC18 + .incbin "graphics/map_objects/palettes/field_effect_object_palette_07.gbapal" + + .incbin "baserom.gba", 0x58dc38, 0x580 + + .align 2 +gFieldEffectObjectPalette8:: @ 858E1B8 + .incbin "graphics/map_objects/palettes/field_effect_object_palette_08.gbapal" + + .incbin "baserom.gba", 0x58e1d8, 0x428 + +gUnknown_0858E600:: @ 858E600 + .incbin "baserom.gba", 0x58e600, 0x18 + +gUnknown_0858E618:: @ 858E618 + .incbin "baserom.gba", 0x58e618, 0x18 + +gUnknown_0858E630:: @ 858E630 + .incbin "baserom.gba", 0x58e630, 0x18 + + .align 2 +gFieldEffectObjectPaletteInfo7:: @ 858E648 + obj_pal gFieldEffectObjectPalette7, 0x1003 + + .align 2 +gFieldEffectObjectPaletteInfo8:: @ 858E650 + obj_pal gFieldEffectObjectPalette8, 0x1008 + + .incbin "baserom.gba", 0x58e658, 0x34 + +gUnknown_0858E68C:: @ 858E68C + .incbin "baserom.gba", 0x58e68c, 0x18 + + .align 2 +@ This uses one of the secret base palettes, so there is no +@ "field_effect_object_palette_09.pal" file. +gFieldEffectObjectPaletteInfo9:: @ 858E6A4 + obj_pal gTilesetPalettes_SecretBase + 5 * 0x20, 0x100E + + .incbin "baserom.gba", 0x58e6ac, 0x1b8 + +gUnknown_0858E864:: @ 858E864 + .incbin "baserom.gba", 0x58e864, 0x1c + +gUnknown_0858E880:: @ 858E880 + .incbin "baserom.gba", 0x58e880, 0x18 + +gUnknown_0858E898:: @ 858E898 + .incbin "baserom.gba", 0x58e898, 0x13 + +gUnknown_0858E8AB:: @ 858E8AB + .incbin "baserom.gba", 0x58e8ab, 0x2 + +gUnknown_0858E8AD:: @ 858E8AD + .incbin "baserom.gba", 0x58e8ad, 0x3 + +gUnknown_0858E8B0:: @ 858E8B0 + .incbin "baserom.gba", 0x58e8b0, 0x40 + +gUnknown_0858E8F0:: @ 858E8F0 + .incbin "baserom.gba", 0x58e8f0, 0x3468 + +gUnknown_08591D58:: @ 8591D58 + .incbin "baserom.gba", 0x591d58, 0x270 + +gUnknown_08591FC8:: @ 8591FC8 + .incbin "baserom.gba", 0x591fc8, 0x18 + +gUnknown_08591FE0:: @ 8591FE0 + .incbin "baserom.gba", 0x591fe0, 0x18 + +gUnknown_08591FF8:: @ 8591FF8 + .incbin "baserom.gba", 0x591ff8, 0x10 + +gUnknown_08592008:: @ 8592008 + .incbin "baserom.gba", 0x592008, 0x10 + +gUnknown_08592018:: @ 8592018 + .incbin "baserom.gba", 0x592018, 0x10 + +gUnknown_08592028:: @ 8592028 + .incbin "baserom.gba", 0x592028, 0x10 + +gUnknown_08592038:: @ 8592038 + .incbin "baserom.gba", 0x592038, 0x20 + +gUnknown_08592058:: @ 8592058 + .incbin "baserom.gba", 0x592058, 0x20 + +gUnknown_08592078:: @ 8592078 + .incbin "baserom.gba", 0x592078, 0x60 + +gUnknown_085920D8:: @ 85920D8 + .incbin "baserom.gba", 0x5920d8, 0xc + +gUnknown_085920E4:: @ 85920E4 + .incbin "baserom.gba", 0x5920e4, 0x4 + +gUnknown_085920E8:: @ 85920E8 + .incbin "baserom.gba", 0x5920e8, 0x128 + +gUnknown_08592210:: @ 8592210 + .incbin "baserom.gba", 0x592210, 0x4f0 + +gUnknown_08592700:: @ 8592700 + .incbin "baserom.gba", 0x592700, 0x78 + +gUnknown_08592778:: @ 8592778 + .incbin "baserom.gba", 0x592778, 0x100 + +gUnknown_08592878:: @ 8592878 + .incbin "baserom.gba", 0x592878, 0x458 + +gUnknown_08592CD0:: @ 8592CD0 + .incbin "baserom.gba", 0x592cd0, 0x1ec + +gUnknown_08592EBC:: @ 8592EBC + .incbin "baserom.gba", 0x592ebc, 0x30 + +gUnknown_08592EEC:: @ 8592EEC + .incbin "baserom.gba", 0x592eec, 0x134 + +gUnknown_08593020:: @ 8593020 + .incbin "baserom.gba", 0x593020, 0xf4 + +gUnknown_08593114:: @ 8593114 + .incbin "baserom.gba", 0x593114, 0x29c + +gUnknown_085933B0:: @ 85933B0 + .incbin "baserom.gba", 0x5933b0, 0xf0 + +gUnknown_085934A0:: @ 85934A0 + .incbin "baserom.gba", 0x5934a0, 0x148 + +gUnknown_085935E8:: @ 85935E8 + .incbin "baserom.gba", 0x5935e8, 0x20 + +gUnknown_08593608:: @ 8593608 + .incbin "baserom.gba", 0x593608, 0x9c + +gUnknown_085936A4:: @ 85936A4 + .incbin "baserom.gba", 0x5936a4, 0x20c + +gUnknown_085938B0:: @ 85938B0 + .incbin "baserom.gba", 0x5938b0, 0x2c + +gUnknown_085938DC:: @ 85938DC + .incbin "baserom.gba", 0x5938dc, 0x18 + +gUnknown_085938F4:: @ 85938F4 + .incbin "baserom.gba", 0x5938f4, 0x5c + +gUnknown_08593950:: @ 8593950 + .incbin "baserom.gba", 0x593950, 0x38 + +gUnknown_08593988:: @ 8593988 + .incbin "baserom.gba", 0x593988, 0x210 + +gUnknown_08593B98:: @ 8593B98 + .incbin "baserom.gba", 0x593b98, 0x1488 + +gUnknown_08595020:: @ 8595020 + .incbin "baserom.gba", 0x595020, 0x248 + +gUnknown_08595268:: @ 8595268 + .incbin "baserom.gba", 0x595268, 0xa8 + +gUnknown_08595310:: @ 8595310 + .incbin "baserom.gba", 0x595310, 0x2a4 + +gUnknown_085955B4:: @ 85955B4 + .incbin "baserom.gba", 0x5955b4, 0x18 + +gUnknown_085955CC:: @ 85955CC + .incbin "baserom.gba", 0x5955cc, 0x2 + +gUnknown_085955CE:: @ 85955CE + .incbin "baserom.gba", 0x5955ce, 0xb6 + +gUnknown_08595684:: @ 8595684 + .incbin "baserom.gba", 0x595684, 0x10 + +gUnknown_08595694:: @ 8595694 + .incbin "baserom.gba", 0x595694, 0x2c + +gUnknown_085956C0:: @ 85956C0 + .incbin "baserom.gba", 0x5956c0, 0x168 + +gUnknown_08595828:: @ 8595828 + .incbin "baserom.gba", 0x595828, 0x18 + +gUnknown_08595840:: @ 8595840 + .incbin "baserom.gba", 0x595840, 0x18 + +gUnknown_08595858:: @ 8595858 + .incbin "baserom.gba", 0x595858, 0x50 + +gUnknown_085958A8:: @ 85958A8 + .incbin "baserom.gba", 0x5958a8, 0x158 + +gUnknown_08595A00:: @ 8595A00 + .incbin "baserom.gba", 0x595a00, 0x30 + +gUnknown_08595A30:: @ 8595A30 + .incbin "baserom.gba", 0x595a30, 0x138 + +gUnknown_08595B68:: @ 8595B68 + .incbin "baserom.gba", 0x595b68, 0xf4 + +gUnknown_08595C5C:: @ 8595C5C + .incbin "baserom.gba", 0x595c5c, 0x2c + +gUnknown_08595C88:: @ 8595C88 + .incbin "baserom.gba", 0x595c88, 0x2c + +gUnknown_08595CB4:: @ 8595CB4 + .incbin "baserom.gba", 0x595cb4, 0x78 + +gUnknown_08595D2C:: @ 8595D2C + .incbin "baserom.gba", 0x595d2c, 0xa14 + +gUnknown_08596740:: @ 8596740 + .incbin "baserom.gba", 0x596740, 0x1c + +gUnknown_0859675C:: @ 859675C + .incbin "baserom.gba", 0x59675c, 0x20 + +gUnknown_0859677C:: @ 859677C + .incbin "baserom.gba", 0x59677c, 0x18 + +gUnknown_08596794:: @ 8596794 + .incbin "baserom.gba", 0x596794, 0xd0 + +gUnknown_08596864:: @ 8596864 + .incbin "baserom.gba", 0x596864, 0x35c + +gUnknown_08596BC0:: @ 8596BC0 + .incbin "baserom.gba", 0x596bc0, 0x50 + +gUnknown_08596C10:: @ 8596C10 + .incbin "baserom.gba", 0x596c10, 0x18 + +gUnknown_08596C28:: @ 8596C28 + .incbin "baserom.gba", 0x596c28, 0x18 + +gUnknown_08596C40:: @ 8596C40 + .incbin "baserom.gba", 0x596c40, 0x178 + +gUnknown_08596DB8:: @ 8596DB8 + .incbin "baserom.gba", 0x596db8, 0x78 + +gUnknown_08596E30:: @ 8596E30 + .incbin "baserom.gba", 0x596e30, 0x528 + +gUnknown_08597358:: @ 8597358 + .incbin "baserom.gba", 0x597358, 0x30 + +gUnknown_08597388:: @ 8597388 + .incbin "baserom.gba", 0x597388, 0x60 + +gUnknown_085973E8:: @ 85973E8 + .incbin "baserom.gba", 0x5973e8, 0x30 + +gUnknown_08597418:: @ 8597418 + .incbin "baserom.gba", 0x597418, 0x2 + +gUnknown_0859741A:: @ 859741A + .incbin "baserom.gba", 0x59741a, 0x4 + +gUnknown_0859741E:: @ 859741E + .incbin "baserom.gba", 0x59741e, 0x6 + +gUnknown_08597424:: @ 8597424 + .incbin "baserom.gba", 0x597424, 0x28 + +gUnknown_0859744C:: @ 859744C + .incbin "baserom.gba", 0x59744c, 0x10 + +gUnknown_0859745C:: @ 859745C + .incbin "baserom.gba", 0x59745c, 0xc + +gUnknown_08597468:: @ 8597468 + .incbin "baserom.gba", 0x597468, 0x34 + +gUnknown_0859749C:: @ 859749C + .incbin "baserom.gba", 0x59749c, 0x1c + +gUnknown_085974B8:: @ 85974B8 + .incbin "baserom.gba", 0x5974b8, 0x8 + +gUnknown_085974C0:: @ 85974C0 + .incbin "baserom.gba", 0x5974c0, 0x70 + +gUnknown_08597530:: @ 8597530 + .incbin "baserom.gba", 0x597530, 0x20 + +gUnknown_08597550:: @ 8597550 + .incbin "baserom.gba", 0x597550, 0x1f8 + +gUnknown_08597748:: @ 8597748 + .incbin "baserom.gba", 0x597748, 0x1c + +gUnknown_08597764:: @ 8597764 + .incbin "baserom.gba", 0x597764, 0x8 + +gUnknown_0859776C:: @ 859776C + .incbin "baserom.gba", 0x59776c, 0x3a8 + +gUnknown_08597B14:: @ 8597B14 + .incbin "baserom.gba", 0x597b14, 0x20 + +gUnknown_08597B34:: @ 8597B34 + .incbin "baserom.gba", 0x597b34, 0x20 + +gUnknown_08597B54:: @ 8597B54 + .incbin "baserom.gba", 0x597b54, 0xc8 + +gUnknown_08597C1C:: @ 8597C1C + .incbin "baserom.gba", 0x597c1c, 0x8 + +gUnknown_08597C24:: @ 8597C24 + .incbin "baserom.gba", 0x597c24, 0xc + +gUnknown_08597C30:: @ 8597C30 + .incbin "baserom.gba", 0x597c30, 0x24 + +gUnknown_08597C54:: @ 8597C54 + .incbin "baserom.gba", 0x597c54, 0x10 + +gUnknown_08597C64:: @ 8597C64 + .incbin "baserom.gba", 0x597c64, 0x20 + +gUnknown_08597C84:: @ 8597C84 + .incbin "baserom.gba", 0x597c84, 0x8 + +gUnknown_08597C8C:: @ 8597C8C + .incbin "baserom.gba", 0x597c8c, 0x4 + +gUnknown_08597C90:: @ 8597C90 + .incbin "baserom.gba", 0x597c90, 0x10 + +gUnknown_08597CA0:: @ 8597CA0 + .incbin "baserom.gba", 0x597ca0, 0x20 + +gUnknown_08597CC0:: @ 8597CC0 + .incbin "baserom.gba", 0x597cc0, 0x28 + +gUnknown_08597CE8:: @ 8597CE8 + .incbin "baserom.gba", 0x597ce8, 0x20 + +gUnknown_08597D08:: @ 8597D08 + .incbin "baserom.gba", 0x597d08, 0x10 + +gUnknown_08597D18:: @ 8597D18 + .incbin "baserom.gba", 0x597d18, 0x50 + +gUnknown_08597D68:: @ 8597D68 + .incbin "baserom.gba", 0x597d68, 0x68 + +gUnknown_08597DD0:: @ 8597DD0 + .incbin "baserom.gba", 0x597dd0, 0x20 + +gUnknown_08597DF0:: @ 8597DF0 + .incbin "baserom.gba", 0x597df0, 0x40 + +gUnknown_08597E30:: @ 8597E30 + .incbin "baserom.gba", 0x597e30, 0x18 + +gUnknown_08597E48:: @ 8597E48 + .incbin "baserom.gba", 0x597e48, 0x18 + +gUnknown_08597E60:: @ 8597E60 + .incbin "baserom.gba", 0x597e60, 0xc + +gUnknown_08597E6C:: @ 8597E6C + .incbin "baserom.gba", 0x597e6c, 0x30 + +@ 8597E9C + .include "data/text/easy_chat/easy_chat_groups.inc" + +@ 859D0B4 + .include "data/text/easy_chat/easy_chat_words_by_letter.inc" + +@ 859E5D4 + .include "data/text/easy_chat/easy_chat_group_name_pointers.inc" + +gUnknown_0859E62C:: @ 859E62C + .incbin "baserom.gba", 0x59e62c, 0x8 + +gUnknown_0859E634:: @ 859E634 + .incbin "baserom.gba", 0x59e634, 0xc + +gUnknown_0859E640:: @ 859E640 + .incbin "baserom.gba", 0x59e640, 0xc + +gUnknown_0859E64C:: @ 859E64C + .incbin "baserom.gba", 0x59e64c, 0xc + +gUnknown_0859E658:: @ 859E658 + .incbin "baserom.gba", 0x59e658, 0x4 + +gUnknown_0859E65C:: @ 859E65C + .incbin "baserom.gba", 0x59e65c, 0x20 + +gUnknown_0859E67C:: @ 859E67C + .incbin "baserom.gba", 0x59e67c, 0x800 + +gUnknown_0859EE7C:: @ 859EE7C + .incbin "baserom.gba", 0x59ee7c, 0x8 + +gUnknown_0859EE84:: @ 859EE84 + .incbin "baserom.gba", 0x59ee84, 0x58 + +gUnknown_0859EEDC:: @ 859EEDC + .incbin "baserom.gba", 0x59eedc, 0x38 + +gUnknown_0859EF14:: @ 859EF14 + .incbin "baserom.gba", 0x59ef14, 0x8 + +gUnknown_0859EF1C:: @ 859EF1C + .incbin "baserom.gba", 0x59ef1c, 0x88 + +gUnknown_0859EFA4:: @ 859EFA4 + .incbin "baserom.gba", 0x59efa4, 0x40 + +gUnknown_0859EFE4:: @ 859EFE4 + .incbin "baserom.gba", 0x59efe4, 0xc + +gUnknown_0859EFF0:: @ 859EFF0 + .incbin "baserom.gba", 0x59eff0, 0x20 + +gUnknown_0859F010:: @ 859F010 + .incbin "baserom.gba", 0x59f010, 0x20 + +gUnknown_0859F030:: @ 859F030 + .incbin "baserom.gba", 0x59f030, 0x18 + +gUnknown_0859F048:: @ 859F048 + .incbin "baserom.gba", 0x59f048, 0x230 + +gUnknown_0859F278:: @ 859F278 + .incbin "baserom.gba", 0x59f278, 0x10 + +gUnknown_0859F288:: @ 859F288 + .incbin "baserom.gba", 0x59f288, 0x8 + +gUnknown_0859F290:: @ 859F290 + .incbin "baserom.gba", 0x59f290, 0xc + +gUnknown_0859F29C:: @ 859F29C + .incbin "baserom.gba", 0x59f29c, 0x10 + +gUnknown_0859F2AC:: @ 859F2AC + .incbin "baserom.gba", 0x59f2ac, 0x4 + +gUnknown_0859F2B0:: @ 859F2B0 + .incbin "baserom.gba", 0x59f2b0, 0x8 + +gUnknown_0859F2B8:: @ 859F2B8 + .incbin "baserom.gba", 0x59f2b8, 0xfc + +gUnknown_0859F3B4:: @ 859F3B4 + .incbin "baserom.gba", 0x59f3b4, 0xa4 + +gUnknown_0859F458:: @ 859F458 + .incbin "baserom.gba", 0x59f458, 0xbc + +gUnknown_0859F514:: @ 859F514 + .incbin "baserom.gba", 0x59f514, 0x8 + +gUnknown_0859F51C:: @ 859F51C + .incbin "baserom.gba", 0x59f51c, 0x8 + +gUnknown_0859F524:: @ 859F524 + .incbin "baserom.gba", 0x59f524, 0x10 + +gUnknown_0859F534:: @ 859F534 + .incbin "baserom.gba", 0x59f534, 0x8 + +gUnknown_0859F53C:: @ 859F53C + .incbin "baserom.gba", 0x59f53c, 0xd0 + +gUnknown_0859F60C:: @ 859F60C + .incbin "baserom.gba", 0x59f60c, 0x44 + +gUnknown_0859F650:: @ 859F650 + .incbin "baserom.gba", 0x59f650, 0xec + +gUnknown_0859F73C:: @ 859F73C + .incbin "baserom.gba", 0x59f73c, 0x40 + +gUnknown_0859F77C:: @ 859F77C + .incbin "baserom.gba", 0x59f77c, 0xd64 + +gUnknown_085A04E0:: @ 85A04E0 + .incbin "baserom.gba", 0x5a04e0, 0x34c + +gUnknown_085A082C:: @ 85A082C + .incbin "baserom.gba", 0x5a082c, 0x20 + +gUnknown_085A084C:: @ 85A084C + .incbin "baserom.gba", 0x5a084c, 0x80 + +gUnknown_085A08CC:: @ 85A08CC + .incbin "baserom.gba", 0x5a08cc, 0x20 + +gUnknown_085A08EC:: @ 85A08EC + .incbin "baserom.gba", 0x5a08ec, 0x80 + +gUnknown_085A096C:: @ 85A096C + .incbin "baserom.gba", 0x5a096c, 0x1a4 + +@ 85A0B10 + .include "data/region_map_entries.inc" + +gUnknown_085A1B24:: @ 85A1B24 + .incbin "baserom.gba", 0x5a1b24, 0x60 + +gUnknown_085A1B84:: @ 85A1B84 + .incbin "baserom.gba", 0x5a1b84, 0x6 + +gUnknown_085A1B8A:: @ 85A1B8A + .incbin "baserom.gba", 0x5a1b8a, 0x22 + +gUnknown_085A1BAC:: @ 85A1BAC + .incbin "baserom.gba", 0x5a1bac, 0x20 + +gUnknown_085A1BCC:: @ 85A1BCC + .incbin "baserom.gba", 0x5a1bcc, 0x34 + +gUnknown_085A1C00:: @ 85A1C00 + .incbin "baserom.gba", 0x5a1c00, 0x8 + +gUnknown_085A1C08:: @ 85A1C08 + .incbin "baserom.gba", 0x5a1c08, 0x18 + +gUnknown_085A1C20:: @ 85A1C20 + .incbin "baserom.gba", 0x5a1c20, 0x10 + +gUnknown_085A1C30:: @ 85A1C30 + .incbin "baserom.gba", 0x5a1c30, 0x4 + +gUnknown_085A1C34:: @ 85A1C34 + .incbin "baserom.gba", 0x5a1c34, 0x4 + +gUnknown_085A1C38:: @ 85A1C38 + .incbin "baserom.gba", 0x5a1c38, 0x20 + +gUnknown_085A1C58:: @ 85A1C58 + .incbin "baserom.gba", 0x5a1c58, 0x38 + +gUnknown_085A1C90:: @ 85A1C90 + .incbin "baserom.gba", 0x5a1c90, 0xd8 + +gUnknown_085A1D68:: @ 85A1D68 + .incbin "baserom.gba", 0x5a1d68, 0xd4 + +gUnknown_085A1E3C:: @ 85A1E3C + .incbin "baserom.gba", 0x5a1e3c, 0xa0 + +gUnknown_085A1EDC:: @ 85A1EDC + .incbin "baserom.gba", 0x5a1edc, 0x8 + +gUnknown_085A1EE4:: @ 85A1EE4 + .incbin "baserom.gba", 0x5a1ee4, 0xc + +gUnknown_085A1EF0:: @ 85A1EF0 + .incbin "baserom.gba", 0x5a1ef0, 0x20 + +gUnknown_085A1F10:: @ 85A1F10 + .incbin "baserom.gba", 0x5a1f10, 0x8 + +gUnknown_085A1F18:: @ 85A1F18 + .incbin "baserom.gba", 0x5a1f18, 0x64 + +gUnknown_085A1F7C:: @ 85A1F7C + .incbin "baserom.gba", 0x5a1f7c, 0x18 + +gUnknown_085A1F94:: @ 85A1F94 + .incbin "baserom.gba", 0x5a1f94, 0x3c74 + +gDecorations:: @ 85A5C08 + .incbin "baserom.gba", 0x5a5c08, 0x1 + +gUnknown_085A5C09:: @ 85A5C09 + .incbin "baserom.gba", 0x5a5c09, 0x1b + +gUnknown_085A5C24:: @ 85A5C24 + .incbin "baserom.gba", 0x5a5c24, 0xf04 + +gUnknown_085A6B28:: @ 85A6B28 + .incbin "baserom.gba", 0x5a6b28, 0x20 + +gUnknown_085A6B48:: @ 85A6B48 + .incbin "baserom.gba", 0x5a6b48, 0x20 + +gUnknown_085A6B68:: @ 85A6B68 + .incbin "baserom.gba", 0x5a6b68, 0x10 + +gUnknown_085A6B78:: @ 85A6B78 + .incbin "baserom.gba", 0x5a6b78, 0x18 + +gUnknown_085A6B90:: @ 85A6B90 + .incbin "baserom.gba", 0x5a6b90, 0x20 + +gUnknown_085A6BB0:: @ 85A6BB0 + .incbin "baserom.gba", 0x5a6bb0, 0x20 + +gUnknown_085A6BD0:: @ 85A6BD0 + .incbin "baserom.gba", 0x5a6bd0, 0x18 + +gUnknown_085A6BE8:: @ 85A6BE8 + .incbin "baserom.gba", 0x5a6be8, 0x5c8 + +gUnknown_085A71B0:: @ 85A71B0 + .incbin "baserom.gba", 0x5a71b0, 0xa0 + +gUnknown_085A7250:: @ 85A7250 + .incbin "baserom.gba", 0x5a7250, 0x3c + +gUnknown_085A728C:: @ 85A728C + .incbin "baserom.gba", 0x5a728c, 0x18 + +gUnknown_085A72A4:: @ 85A72A4 + .incbin "baserom.gba", 0x5a72a4, 0x18 + +gUnknown_085A72BC:: @ 85A72BC + .incbin "baserom.gba", 0x5a72bc, 0x8 + +gUnknown_085A72C4:: @ 85A72C4 + .incbin "baserom.gba", 0x5a72c4, 0x8 + +gUnknown_085A72CC:: @ 85A72CC + .incbin "baserom.gba", 0x5a72cc, 0x8 + +gUnknown_085A72D4:: @ 85A72D4 + .incbin "baserom.gba", 0x5a72d4, 0x10 + +gUnknown_085A72E4:: @ 85A72E4 + .incbin "baserom.gba", 0x5a72e4, 0x8 + +gUnknown_085A72EC:: @ 85A72EC + .incbin "baserom.gba", 0x5a72ec, 0x8 + +gUnknown_085A72F4:: @ 85A72F4 + .incbin "baserom.gba", 0x5a72f4, 0x54 + +gUnknown_085A7348:: @ 85A7348 + .incbin "baserom.gba", 0x5a7348, 0x8 + +gUnknown_085A7350:: @ 85A7350 + .incbin "baserom.gba", 0x5a7350, 0x88 + +gUnknown_085A73D8:: @ 85A73D8 + .incbin "baserom.gba", 0x5a73d8, 0x8 + +gUnknown_085A73E0:: @ 85A73E0 + .incbin "baserom.gba", 0x5a73e0, 0x24 + +gUnknown_085A7404:: @ 85A7404 + .incbin "baserom.gba", 0x5a7404, 0x18 + +gUnknown_085A741C:: @ 85A741C + .incbin "baserom.gba", 0x5a741c, 0x8 + +gUnknown_085A7424:: @ 85A7424 + .incbin "baserom.gba", 0x5a7424, 0x10 + +gUnknown_085A7434:: @ 85A7434 + .incbin "baserom.gba", 0x5a7434, 0x10 + +gUnknown_085A7444:: @ 85A7444 + .incbin "baserom.gba", 0x5a7444, 0x8 + +gUnknown_085A744C:: @ 85A744C + .incbin "baserom.gba", 0x5a744c, 0x4 + +gUnknown_085A7450:: @ 85A7450 + .incbin "baserom.gba", 0x5a7450, 0x74 + +gUnknown_085A74C4:: @ 85A74C4 + .incbin "baserom.gba", 0x5a74c4, 0xc + +gUnknown_085A74D0:: @ 85A74D0 + .incbin "baserom.gba", 0x5a74d0, 0x14 + +gUnknown_085A74E4:: @ 85A74E4 + .incbin "baserom.gba", 0x5a74e4, 0xc + +gUnknown_085A74F0:: @ 85A74F0 + .incbin "baserom.gba", 0x5a74f0, 0xc + +gUnknown_085A74FC:: @ 85A74FC + .incbin "baserom.gba", 0x5a74fc, 0xc + +gUnknown_085A7508:: @ 85A7508 + .incbin "baserom.gba", 0x5a7508, 0xc + +gUnknown_085A7514:: @ 85A7514 + .incbin "baserom.gba", 0x5a7514, 0xc + +gUnknown_085A7520:: @ 85A7520 + .incbin "baserom.gba", 0x5a7520, 0xc + +gUnknown_085A752C:: @ 85A752C + .incbin "baserom.gba", 0x5a752c, 0xc + +gUnknown_085A7538:: @ 85A7538 + .incbin "baserom.gba", 0x5a7538, 0xc + +gUnknown_085A7544:: @ 85A7544 + .incbin "baserom.gba", 0x5a7544, 0xc + +gUnknown_085A7550:: @ 85A7550 + .incbin "baserom.gba", 0x5a7550, 0x8 + +gUnknown_085A7558:: @ 85A7558 + .incbin "baserom.gba", 0x5a7558, 0x10 + +gUnknown_085A7568:: @ 85A7568 + .incbin "baserom.gba", 0x5a7568, 0x2 + +gUnknown_085A756A:: @ 85A756A + .incbin "baserom.gba", 0x5a756a, 0xa + +gUnknown_085A7574:: @ 85A7574 + .incbin "baserom.gba", 0x5a7574, 0x4c + +gUnknown_085A75C0:: @ 85A75C0 + .incbin "baserom.gba", 0x5a75c0, 0x4 + +gUnknown_085A75C4:: @ 85A75C4 + .incbin "baserom.gba", 0x5a75c4, 0x8 + +gUnknown_085A75CC:: @ 85A75CC + .incbin "baserom.gba", 0x5a75cc, 0x8 + +gUnknown_085A75D4:: @ 85A75D4 + .incbin "baserom.gba", 0x5a75d4, 0x3c + +gUnknown_085A7610:: @ 85A7610 + .incbin "baserom.gba", 0x5a7610, 0x4 + +gUnknown_085A7614:: @ 85A7614 + .incbin "baserom.gba", 0x5a7614, 0x2 + +gUnknown_085A7616:: @ 85A7616 + .incbin "baserom.gba", 0x5a7616, 0x8 + +gUnknown_085A761E:: @ 85A761E + .incbin "baserom.gba", 0x5a761e, 0x8 + +gUnknown_085A7626:: @ 85A7626 + .incbin "baserom.gba", 0x5a7626, 0x8 + +gUnknown_085A762E:: @ 85A762E + .incbin "baserom.gba", 0x5a762e, 0x10 + +gUnknown_085A763E:: @ 85A763E + .incbin "baserom.gba", 0x5a763e, 0x10 + +gUnknown_085A764E:: @ 85A764E + .incbin "baserom.gba", 0x5a764e, 0x10 + +gUnknown_085A765E:: @ 85A765E + .incbin "baserom.gba", 0x5a765e, 0x10 + +gUnknown_085A766E:: @ 85A766E + .incbin "baserom.gba", 0x5a766e, 0x3f + +gUnknown_085A76AD:: @ 85A76AD + .incbin "baserom.gba", 0x5a76ad, 0x7 + +gUnknown_085A76B4:: @ 85A76B4 + .incbin "baserom.gba", 0x5a76b4, 0xc + +gUnknown_085A76C0:: @ 85A76C0 + .incbin "baserom.gba", 0x5a76c0, 0x12 + +gUnknown_085A76D2:: @ 85A76D2 + .incbin "baserom.gba", 0x5a76d2, 0x12 + +gUnknown_085A76E4:: @ 85A76E4 + .incbin "baserom.gba", 0x5a76e4, 0x1e + +gUnknown_085A7702:: @ 85A7702 + .incbin "baserom.gba", 0x5a7702, 0x66 + +gUnknown_085A7768:: @ 85A7768 + .incbin "baserom.gba", 0x5a7768, 0x66 + +gUnknown_085A77CE:: @ 85A77CE + .incbin "baserom.gba", 0x5a77ce, 0xa + +gUnknown_085A77D8:: @ 85A77D8 + .incbin "baserom.gba", 0x5a77d8, 0x14 + +gUnknown_085A77EC:: @ 85A77EC + .incbin "baserom.gba", 0x5a77ec, 0xa + +gUnknown_085A77F6:: @ 85A77F6 + .incbin "baserom.gba", 0x5a77f6, 0x8 + +gUnknown_085A77FE:: @ 85A77FE + .incbin "baserom.gba", 0x5a77fe, 0x6 + +gUnknown_085A7804:: @ 85A7804 + .incbin "baserom.gba", 0x5a7804, 0xa + +gUnknown_085A780E:: @ 85A780E + .incbin "baserom.gba", 0x5a780e, 0x8 + +gUnknown_085A7816:: @ 85A7816 + .incbin "baserom.gba", 0x5a7816, 0x12 + +gUnknown_085A7828:: @ 85A7828 + .incbin "baserom.gba", 0x5a7828, 0x12 + +gUnknown_085A783A:: @ 85A783A + .incbin "baserom.gba", 0x5a783a, 0x8e + +gUnknown_085A78C8:: @ 85A78C8 + .incbin "baserom.gba", 0x5a78c8, 0x13c + +gUnknown_085A7A04:: @ 85A7A04 + .incbin "baserom.gba", 0x5a7a04, 0x1c + +gUnknown_085A7A20:: @ 85A7A20 + .incbin "baserom.gba", 0x5a7a20, 0x2c0 + +gUnknown_085A7CE0:: @ 85A7CE0 + .incbin "baserom.gba", 0x5a7ce0, 0x18 + +gUnknown_085A7CF8:: @ 85A7CF8 + .incbin "baserom.gba", 0x5a7cf8, 0x18 + +gUnknown_085A7D10:: @ 85A7D10 + .incbin "baserom.gba", 0x5a7d10, 0x18 + +gUnknown_085A7D28:: @ 85A7D28 + .incbin "baserom.gba", 0x5a7d28, 0x18 + +gUnknown_085A7D40:: @ 85A7D40 + .incbin "baserom.gba", 0x5a7d40, 0x18 + +gUnknown_085A7D58:: @ 85A7D58 + .incbin "baserom.gba", 0x5a7d58, 0x18 + +gUnknown_085A7D70:: @ 85A7D70 + .incbin "baserom.gba", 0x5a7d70, 0x18 + +gUnknown_085A7D88:: @ 85A7D88 + .incbin "baserom.gba", 0x5a7d88, 0x18 + +gUnknown_085A7DA0:: @ 85A7DA0 + .incbin "baserom.gba", 0x5a7da0, 0x18 + +gUnknown_085A7DB8:: @ 85A7DB8 + .incbin "baserom.gba", 0x5a7db8, 0x18 + +gUnknown_085A7DD0:: @ 85A7DD0 + .incbin "baserom.gba", 0x5a7dd0, 0x18 + +gUnknown_085A7DE8:: @ 85A7DE8 + .incbin "baserom.gba", 0x5a7de8, 0x18 + +gUnknown_085A7E00:: @ 85A7E00 + .incbin "baserom.gba", 0x5a7e00, 0x18 + +gUnknown_085A7E18:: @ 85A7E18 + .incbin "baserom.gba", 0x5a7e18, 0x18 + +gUnknown_085A7E30:: @ 85A7E30 + .incbin "baserom.gba", 0x5a7e30, 0x168 + +gUnknown_085A7F98:: @ 85A7F98 + .incbin "baserom.gba", 0x5a7f98, 0x28 + +gUnknown_085A7FC0:: @ 85A7FC0 + .incbin "baserom.gba", 0x5a7fc0, 0x20 + +gUnknown_085A7FE0:: @ 85A7FE0 + .incbin "baserom.gba", 0x5a7fe0, 0x14 + +gUnknown_085A7FF4:: @ 85A7FF4 + .incbin "baserom.gba", 0x5a7ff4, 0x1c + +gUnknown_085A8010:: @ 85A8010 + .incbin "baserom.gba", 0x5a8010, 0x18 + +gUnknown_085A8028:: @ 85A8028 + .incbin "baserom.gba", 0x5a8028, 0x14 + +gUnknown_085A803C:: @ 85A803C + .incbin "baserom.gba", 0x5a803c, 0x228 + +gUnknown_085A8264:: @ 85A8264 + .incbin "baserom.gba", 0x5a8264, 0x68 + +gUnknown_085A82CC:: @ 85A82CC + .incbin "baserom.gba", 0x5a82cc, 0x68 + +gUnknown_085A8334:: @ 85A8334 + .incbin "baserom.gba", 0x5a8334, 0xb0 + +gUnknown_085A83E4:: @ 85A83E4 + .incbin "baserom.gba", 0x5a83e4, 0x24 + +gUnknown_085A8408:: @ 85A8408 + .incbin "baserom.gba", 0x5a8408, 0x14 + +gUnknown_085A841C:: @ 85A841C + .incbin "baserom.gba", 0x5a841c, 0x14 + +gUnknown_085A8430:: @ 85A8430 + .incbin "baserom.gba", 0x5a8430, 0x5 + +gUnknown_085A8435:: @ 85A8435 + .incbin "baserom.gba", 0x5a8435, 0x6 + +gUnknown_085A843B:: @ 85A843B + .incbin "baserom.gba", 0x5a843b, 0x65 + +gUnknown_085A84A0:: @ 85A84A0 + .incbin "baserom.gba", 0x5a84a0, 0xc + +gUnknown_085A84AC:: @ 85A84AC + .incbin "baserom.gba", 0x5a84ac, 0x64 + +gUnknown_085A8510:: @ 85A8510 + .incbin "baserom.gba", 0x5a8510, 0x10 + +gUnknown_085A8520:: @ 85A8520 + .incbin "baserom.gba", 0x5a8520, 0x4 + +gUnknown_085A8524:: @ 85A8524 + .incbin "baserom.gba", 0x5a8524, 0x20 + +gUnknown_085A8544:: @ 85A8544 + .incbin "baserom.gba", 0x5a8544, 0x48 + +gUnknown_085A858C:: @ 85A858C + .incbin "baserom.gba", 0x5a858c, 0x1154 + +gUnknown_085A96E0:: @ 85A96E0 + .incbin "baserom.gba", 0x5a96e0, 0x1b8 + +gUnknown_085A9898:: @ 85A9898 + .incbin "baserom.gba", 0x5a9898, 0x4 + +gUnknown_085A989C:: @ 85A989C + .incbin "baserom.gba", 0x5a989c, 0x200 + +gUnknown_085A9A9C:: @ 85A9A9C + .incbin "baserom.gba", 0x5a9a9c, 0x1084 + +gUnknown_085AAB20:: @ 85AAB20 + .incbin "baserom.gba", 0x5aab20, 0xc30 + +gUnknown_085AB750:: @ 85AB750 + .incbin "baserom.gba", 0x5ab750, 0xb38 + +gUnknown_085AC288:: @ 85AC288 + .incbin "baserom.gba", 0x5ac288, 0xfb8 + +gUnknown_085AD240:: @ 85AD240 + .incbin "baserom.gba", 0x5ad240, 0x1130 + +gUnknown_085AE370:: @ 85AE370 + .incbin "baserom.gba", 0x5ae370, 0x604 + +gUnknown_085AE974:: @ 85AE974 + .incbin "baserom.gba", 0x5ae974, 0x50c + +gUnknown_085AEE80:: @ 85AEE80 + .incbin "baserom.gba", 0x5aee80, 0x50c + +gUnknown_085AF38C:: @ 85AF38C + .incbin "baserom.gba", 0x5af38c, 0x50c + +gUnknown_085AF898:: @ 85AF898 + .incbin "baserom.gba", 0x5af898, 0x50c + +gUnknown_085AFDA4:: @ 85AFDA4 + .incbin "baserom.gba", 0x5afda4, 0x50c + +gUnknown_085B02B0:: @ 85B02B0 + .incbin "baserom.gba", 0x5b02b0, 0x524 + +gUnknown_085B07D4:: @ 85B07D4 + .incbin "baserom.gba", 0x5b07d4, 0x14 + +gUnknown_085B07E8:: @ 85B07E8 + .incbin "baserom.gba", 0x5b07e8, 0x4 + +gUnknown_085B07EC:: @ 85B07EC + .incbin "baserom.gba", 0x5b07ec, 0x8 + +gUnknown_085B07F4:: @ 85B07F4 + .incbin "baserom.gba", 0x5b07f4, 0x3c + +gUnknown_085B0830:: @ 85B0830 + .incbin "baserom.gba", 0x5b0830, 0x8 + +gUnknown_085B0838:: @ 85B0838 + .incbin "baserom.gba", 0x5b0838, 0x4 diff --git a/data/data4.s b/data/data4.s new file mode 100644 index 000000000..202b1ffe7 --- /dev/null +++ b/data/data4.s @@ -0,0 +1,905 @@ +@ the fourth big chunk of data + + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_085B09E4:: @ 85B09E4 + .incbin "baserom.gba", 0x5b09e4, 0x10 + +gUnknown_085B09F4:: @ 85B09F4 + .incbin "baserom.gba", 0x5b09f4, 0x4 + +gUnknown_085B09F8:: @ 85B09F8 + .incbin "baserom.gba", 0x5b09f8, 0x8 + +gUnknown_085B0A00:: @ 85B0A00 + .incbin "baserom.gba", 0x5b0a00, 0x2 + +gUnknown_085B0A02:: @ 85B0A02 + .incbin "baserom.gba", 0x5b0a02, 0x7e + +gUnknown_085B0A80:: @ 85B0A80 + .incbin "baserom.gba", 0x5b0a80, 0x18c + +gUnknown_085B0C0C:: @ 85B0C0C + .incbin "baserom.gba", 0x5b0c0c, 0x1f8 + +gUnknown_085B0E04:: @ 85B0E04 + .incbin "baserom.gba", 0x5b0e04, 0xfc8 + +gUnknown_085B1DCC:: @ 85B1DCC + .incbin "baserom.gba", 0x5b1dcc, 0x10 + +gUnknown_085B1DDC:: @ 85B1DDC + .incbin "baserom.gba", 0x5b1ddc, 0x8 + +gUnknown_085B1DE4:: @ 85B1DE4 + .incbin "baserom.gba", 0x5b1de4, 0x8 + +gUnknown_085B1DEC:: @ 85B1DEC + .incbin "baserom.gba", 0x5b1dec, 0x6 + +gUnknown_085B1DF2:: @ 85B1DF2 + .incbin "baserom.gba", 0x5b1df2, 0x6 + +gUnknown_085B1DF8:: @ 85B1DF8 + .incbin "baserom.gba", 0x5b1df8, 0x8 + +gUnknown_085B1E00:: @ 85B1E00 + .incbin "baserom.gba", 0x5b1e00, 0xc + +gUnknown_085B1E0C:: @ 85B1E0C + .incbin "baserom.gba", 0x5b1e0c, 0x1c + +gUnknown_085B1E28:: @ 85B1E28 + .incbin "baserom.gba", 0x5b1e28, 0xa8 + +gUnknown_085B1ED0:: @ 85B1ED0 + .incbin "baserom.gba", 0x5b1ed0, 0x8 + +gUnknown_085B1ED8:: @ 85B1ED8 + .incbin "baserom.gba", 0x5b1ed8, 0x10 + +gUnknown_085B1EE8:: @ 85B1EE8 + .incbin "baserom.gba", 0x5b1ee8, 0x10 + +gUnknown_085B1EF8:: @ 85B1EF8 + .incbin "baserom.gba", 0x5b1ef8, 0x18 + +gUnknown_085B1F10:: @ 85B1F10 + .incbin "baserom.gba", 0x5b1f10, 0x18 + +gUnknown_085B1F28:: @ 85B1F28 + .incbin "baserom.gba", 0x5b1f28, 0x18 + +gUnknown_085B1F40:: @ 85B1F40 + .incbin "baserom.gba", 0x5b1f40, 0x294 + +gUnknown_085B21D4:: @ 85B21D4 + .incbin "baserom.gba", 0x5b21d4, 0x8 + +gUnknown_085B21DC:: @ 85B21DC + .incbin "baserom.gba", 0x5b21dc, 0x18 + +gUnknown_085B21F4:: @ 85B21F4 + .incbin "baserom.gba", 0x5b21f4, 0x8 + +gUnknown_085B21FC:: @ 85B21FC + .incbin "baserom.gba", 0x5b21fc, 0xc + +gUnknown_085B2208:: @ 85B2208 + .incbin "baserom.gba", 0x5b2208, 0x10 + +gUnknown_085B2218:: @ 85B2218 + .incbin "baserom.gba", 0x5b2218, 0x38 + +gUnknown_085B2250:: @ 85B2250 + .incbin "baserom.gba", 0x5b2250, 0x18 + +gUnknown_085B2268:: @ 85B2268 + .incbin "baserom.gba", 0x5b2268, 0x38 + +gUnknown_085B22A0:: @ 85B22A0 + .incbin "baserom.gba", 0x5b22a0, 0x18 + +gUnknown_085B22B8:: @ 85B22B8 + .incbin "baserom.gba", 0x5b22b8, 0x18 + +gUnknown_085B22D0:: @ 85B22D0 + .incbin "baserom.gba", 0x5b22d0, 0x2d0 + +gPokeblockFlavorCompatibilityTable:: @ 85B25A0 + .incbin "baserom.gba", 0x5b25a0, 0x80 + +gUnknown_085B2620:: @ 85B2620 + .incbin "baserom.gba", 0x5b2620, 0xc + +gPokeblockNames:: @ 85B262C + .incbin "baserom.gba", 0x5b262c, 0x3c + +gUnknown_085B2668:: @ 85B2668 + .incbin "baserom.gba", 0x5b2668, 0x30 + +gUnknown_085B2698:: @ 85B2698 + .incbin "baserom.gba", 0x5b2698, 0x3 + +gUnknown_085B269B:: @ 85B269B + .incbin "baserom.gba", 0x5b269b, 0x2 + +gUnknown_085B269D:: @ 85B269D + .incbin "baserom.gba", 0x5b269d, 0x2 + +gUnknown_085B269F:: @ 85B269F + .incbin "baserom.gba", 0x5b269f, 0x5 + +gUnknown_085B26A4:: @ 85B26A4 + .incbin "baserom.gba", 0x5b26a4, 0x4c + +gUnknown_085B26F0:: @ 85B26F0 + .incbin "baserom.gba", 0x5b26f0, 0x4 + +gUnknown_085B26F4:: @ 85B26F4 + .incbin "baserom.gba", 0x5b26f4, 0x8 + +gUnknown_085B26FC:: @ 85B26FC + .incbin "baserom.gba", 0x5b26fc, 0x8 + +gUnknown_085B2704:: @ 85B2704 + .incbin "baserom.gba", 0x5b2704, 0x18 + +gUnknown_085B271C:: @ 85B271C + .incbin "baserom.gba", 0x5b271c, 0x4 + +gUnknown_085B2720:: @ 85B2720 + .incbin "baserom.gba", 0x5b2720, 0x28 + +gUnknown_085B2748:: @ 85B2748 + .incbin "baserom.gba", 0x5b2748, 0x60 + +gUnknown_085B27A8:: @ 85B27A8 + .incbin "baserom.gba", 0x5b27a8, 0x8 + +gUnknown_085B27B0:: @ 85B27B0 + .incbin "baserom.gba", 0x5b27b0, 0x18 + +gUnknown_085B27C8:: @ 85B27C8 + .incbin "baserom.gba", 0x5b27c8, 0x88 + +gUnknown_085B2850:: @ 85B2850 + .incbin "baserom.gba", 0x5b2850, 0x20 + +gUnknown_085B2870:: @ 85B2870 + .incbin "baserom.gba", 0x5b2870, 0x20 + +gUnknown_085B2890:: @ 85B2890 + .incbin "baserom.gba", 0x5b2890, 0x10 + +gUnknown_085B28A0:: @ 85B28A0 + .incbin "baserom.gba", 0x5b28a0, 0x10 + +gUnknown_085B28B0:: @ 85B28B0 + .incbin "baserom.gba", 0x5b28b0, 0x1e0 + +gUnknown_085B2A90:: @ 85B2A90 + .incbin "baserom.gba", 0x5b2a90, 0xb4 + +gUnknown_085B2B44:: @ 85B2B44 + .incbin "baserom.gba", 0x5b2b44, 0x18 + +gUnknown_085B2B5C:: @ 85B2B5C + .incbin "baserom.gba", 0x5b2b5c, 0x4 + +gUnknown_085B2B60:: @ 85B2B60 + .incbin "baserom.gba", 0x5b2b60, 0x8 + +gUnknown_085B2B68:: @ 85B2B68 + .incbin "baserom.gba", 0x5b2b68, 0x10 + +gUnknown_085B2B78:: @ 85B2B78 + .incbin "baserom.gba", 0x5b2b78, 0x6 + +gUnknown_085B2B7E:: @ 85B2B7E + .incbin "baserom.gba", 0x5b2b7e, 0xa + +gUnknown_085B2B88:: @ 85B2B88 + .incbin "baserom.gba", 0x5b2b88, 0xc + +gUnknown_085B2B94:: @ 85B2B94 + .incbin "baserom.gba", 0x5b2b94, 0xc + +gUnknown_085B2BA0:: @ 85B2BA0 + .incbin "baserom.gba", 0x5b2ba0, 0xc + +gUnknown_085B2BAC:: @ 85B2BAC + .incbin "baserom.gba", 0x5b2bac, 0x8 + +gUnknown_085B2BB4:: @ 85B2BB4 + .incbin "baserom.gba", 0x5b2bb4, 0x40 + +gUnknown_085B2BF4:: @ 85B2BF4 + .incbin "baserom.gba", 0x5b2bf4, 0x12 + +gUnknown_085B2C06:: @ 85B2C06 + .incbin "baserom.gba", 0x5b2c06, 0x12 + +gUnknown_085B2C18:: @ 85B2C18 + .incbin "baserom.gba", 0x5b2c18, 0x9 + +gUnknown_085B2C21:: @ 85B2C21 + .incbin "baserom.gba", 0x5b2c21, 0x9 + +gUnknown_085B2C2A:: @ 85B2C2A + .incbin "baserom.gba", 0x5b2c2a, 0x26 + +gUnknown_085B2C50:: @ 85B2C50 + .incbin "baserom.gba", 0x5b2c50, 0x78 + +gUnknown_085B2CC8:: @ 85B2CC8 + .incbin "baserom.gba", 0x5b2cc8, 0x14 + +gUnknown_085B2CDC:: @ 85B2CDC + .incbin "baserom.gba", 0x5b2cdc, 0x14 + +gUnknown_085B2CF0:: @ 85B2CF0 + .incbin "baserom.gba", 0x5b2cf0, 0x340 + +gUnknown_085B3030:: @ 85B3030 + .incbin "baserom.gba", 0x5b3030, 0x10 + +gUnknown_085B3040:: @ 85B3040 + .incbin "baserom.gba", 0x5b3040, 0x64 + +gUnknown_085B30A4:: @ 85B30A4 + .incbin "baserom.gba", 0x5b30a4, 0x30 + +gUnknown_085B30D4:: @ 85B30D4 + .incbin "baserom.gba", 0x5b30d4, 0x30 + +gUnknown_085B3104:: @ 85B3104 + .incbin "baserom.gba", 0x5b3104, 0x18 + +gUnknown_085B311C:: @ 85B311C + .incbin "baserom.gba", 0x5b311c, 0x8 + +gUnknown_085B3124:: @ 85B3124 + .incbin "baserom.gba", 0x5b3124, 0x8 + +gUnknown_085B312C:: @ 85B312C + .incbin "baserom.gba", 0x5b312c, 0x16 + +gUnknown_085B3142:: @ 85B3142 + .incbin "baserom.gba", 0x5b3142, 0xc + +gUnknown_085B314E:: @ 85B314E + .incbin "baserom.gba", 0x5b314e, 0xe + +gUnknown_085B315C:: @ 85B315C + .incbin "baserom.gba", 0x5b315c, 0x14 + +gUnknown_085B3170:: @ 85B3170 + .incbin "baserom.gba", 0x5b3170, 0x2c + +gUnknown_085B319C:: @ 85B319C + .incbin "baserom.gba", 0x5b319c, 0x18 + +gUnknown_085B31B4:: @ 85B31B4 + .incbin "baserom.gba", 0x5b31b4, 0x1c + +gUnknown_085B31D0:: @ 85B31D0 + .incbin "baserom.gba", 0x5b31d0, 0x28 + +gUnknown_085B31F8:: @ 85B31F8 + .incbin "baserom.gba", 0x5b31f8, 0x14 + +gUnknown_085B320C:: @ 85B320C + .incbin "baserom.gba", 0x5b320c, 0x14 + +gUnknown_085B3220:: @ 85B3220 + .incbin "baserom.gba", 0x5b3220, 0x8 + +gUnknown_085B3228:: @ 85B3228 + .incbin "baserom.gba", 0x5b3228, 0x2c + +gUnknown_085B3254:: @ 85B3254 + .incbin "baserom.gba", 0x5b3254, 0x2c + +gUnknown_085B3280:: @ 85B3280 + .incbin "baserom.gba", 0x5b3280, 0x160 + +gUnknown_085B33E0:: @ 85B33E0 + .incbin "baserom.gba", 0x5b33e0, 0x16 + +gUnknown_085B33F6:: @ 85B33F6 + .incbin "baserom.gba", 0x5b33f6, 0xa + +gUnknown_085B3400:: @ 85B3400 + .incbin "baserom.gba", 0x5b3400, 0x10 + +gUnknown_085B3410:: @ 85B3410 + .incbin "baserom.gba", 0x5b3410, 0x10 + +gUnknown_085B3420:: @ 85B3420 + .incbin "baserom.gba", 0x5b3420, 0x24 + +gUnknown_085B3444:: @ 85B3444 + .incbin "baserom.gba", 0x5b3444, 0x2c + +gUnknown_085B3470:: @ 85B3470 + .incbin "baserom.gba", 0x5b3470, 0x4 + +gUnknown_085B3474:: @ 85B3474 + .incbin "baserom.gba", 0x5b3474, 0x8 + +gUnknown_085B347C:: @ 85B347C + .incbin "baserom.gba", 0x5b347c, 0x8 + +gUnknown_085B3484:: @ 85B3484 + .incbin "baserom.gba", 0x5b3484, 0xc0 + +gUnknown_085B3544:: @ 85B3544 + .incbin "baserom.gba", 0x5b3544, 0x20 + +gUnknown_085B3564:: @ 85B3564 + .incbin "baserom.gba", 0x5b3564, 0x800 + +gUnknown_085B3D64:: @ 85B3D64 + .incbin "baserom.gba", 0x5b3d64, 0x8 + +gUnknown_085B3D6C:: @ 85B3D6C + .incbin "baserom.gba", 0x5b3d6c, 0x10 + +gUnknown_085B3D7C:: @ 85B3D7C + .incbin "baserom.gba", 0x5b3d7c, 0x8 + +gUnknown_085B3D84:: @ 85B3D84 + .incbin "baserom.gba", 0x5b3d84, 0x8 + +gUnknown_085B3D8C:: @ 85B3D8C + .incbin "baserom.gba", 0x5b3d8c, 0x8 + +gUnknown_085B3D94:: @ 85B3D94 + .incbin "baserom.gba", 0x5b3d94, 0x20 + +gUnknown_085B3DB4:: @ 85B3DB4 + .incbin "baserom.gba", 0x5b3db4, 0x134 + +gUnknown_085B3EE8:: @ 85B3EE8 + .incbin "baserom.gba", 0x5b3ee8, 0x2 + +gUnknown_085B3EEA:: @ 85B3EEA + .incbin "baserom.gba", 0x5b3eea, 0x6 + +gUnknown_085B3EF0:: @ 85B3EF0 + .incbin "baserom.gba", 0x5b3ef0, 0xc + +gUnknown_085B3EFC:: @ 85B3EFC + .incbin "baserom.gba", 0x5b3efc, 0x1c + +gUnknown_085B3F18:: @ 85B3F18 + .incbin "baserom.gba", 0x5b3f18, 0x100 + +gUnknown_085B4018:: @ 85B4018 + .incbin "baserom.gba", 0x5b4018, 0x4 + +gUnknown_085B401C:: @ 85B401C + .incbin "baserom.gba", 0x5b401c, 0x8 + +gUnknown_085B4024:: @ 85B4024 + .incbin "baserom.gba", 0x5b4024, 0x10 + +gUnknown_085B4034:: @ 85B4034 + .incbin "baserom.gba", 0x5b4034, 0xb8 + +gUnknown_085B40EC:: @ 85B40EC + .incbin "baserom.gba", 0x5b40ec, 0x10 + +gUnknown_085B40FC:: @ 85B40FC + .incbin "baserom.gba", 0x5b40fc, 0x38 + +gUnknown_085B4134:: @ 85B4134 + .incbin "baserom.gba", 0x5b4134, 0x6f8 + +gUnknown_085B482C:: @ 85B482C + .incbin "baserom.gba", 0x5b482c, 0x4e4 + +gUnknown_085B4D10:: @ 85B4D10 + .incbin "baserom.gba", 0x5b4d10, 0x4d4 + +gUnknown_085B51E4:: @ 85B51E4 + .incbin "baserom.gba", 0x5b51e4, 0x6a0 + +gUnknown_085B5884:: @ 85B5884 + .incbin "baserom.gba", 0x5b5884, 0x40 + +gUnknown_085B58C4:: @ 85B58C4 + .incbin "baserom.gba", 0x5b58c4, 0x5 + +gUnknown_085B58C9:: @ 85B58C9 + .incbin "baserom.gba", 0x5b58c9, 0x10 + +gUnknown_085B58D9:: @ 85B58D9 + .incbin "baserom.gba", 0x5b58d9, 0x323 + +gUnknown_085B5BFC:: @ 85B5BFC + .incbin "baserom.gba", 0x5b5bfc, 0x200 + +gUnknown_085B5DFC:: @ 85B5DFC + .incbin "baserom.gba", 0x5b5dfc, 0x1a4 + +gUnknown_085B5FA0:: @ 85B5FA0 + .incbin "baserom.gba", 0x5b5fa0, 0x1a0 + +gUnknown_085B6140:: @ 85B6140 + .incbin "baserom.gba", 0x5b6140, 0xc + +gUnknown_085B614C:: @ 85B614C + .incbin "baserom.gba", 0x5b614c, 0x8 + +gUnknown_085B6154:: @ 85B6154 + .incbin "baserom.gba", 0x5b6154, 0xc + +gUnknown_085B6160:: @ 85B6160 + .incbin "baserom.gba", 0x5b6160, 0x184 + +gUnknown_085B62E4:: @ 85B62E4 + .incbin "baserom.gba", 0x5b62e4, 0x4 + +gUnknown_085B62E8:: @ 85B62E8 + .incbin "baserom.gba", 0x5b62e8, 0x5c + +gUnknown_085B6344:: @ 85B6344 + .incbin "baserom.gba", 0x5b6344, 0x4 + +gUnknown_085B6348:: @ 85B6348 + .incbin "baserom.gba", 0x5b6348, 0x40 + +gUnknown_085B6388:: @ 85B6388 + .incbin "baserom.gba", 0x5b6388, 0x68 + +gUnknown_085B63F0:: @ 85B63F0 + .incbin "baserom.gba", 0x5b63f0, 0x18 + +gUnknown_085B6408:: @ 85B6408 + .incbin "baserom.gba", 0x5b6408, 0x8 + +gUnknown_085B6410:: @ 85B6410 + .incbin "baserom.gba", 0x5b6410, 0x8 + +gUnknown_085B6418:: @ 85B6418 + .incbin "baserom.gba", 0x5b6418, 0x6 + +gUnknown_085B641E:: @ 85B641E + .incbin "baserom.gba", 0x5b641e, 0x4 + +gUnknown_085B6422:: @ 85B6422 + .incbin "baserom.gba", 0x5b6422, 0xa + +gUnknown_085B642C:: @ 85B642C + .incbin "baserom.gba", 0x5b642c, 0x10 + +gUnknown_085B643C:: @ 85B643C + .incbin "baserom.gba", 0x5b643c, 0xc + +gUnknown_085B6448:: @ 85B6448 + .incbin "baserom.gba", 0x5b6448, 0xf3c + +gUnknown_085B7384:: @ 85B7384 + .incbin "baserom.gba", 0x5b7384, 0x98 + +gUnknown_085B741C:: @ 85B741C + .incbin "baserom.gba", 0x5b741c, 0x6c + +gUnknown_085B7488:: @ 85B7488 + .incbin "baserom.gba", 0x5b7488, 0x8 + +gUnknown_085B7490:: @ 85B7490 + .incbin "baserom.gba", 0x5b7490, 0x78 + +gUnknown_085B7508:: @ 85B7508 + .incbin "baserom.gba", 0x5b7508, 0x60 + +gUnknown_085B7568:: @ 85B7568 + .incbin "baserom.gba", 0x5b7568, 0x48 + +gUnknown_085B75B0:: @ 85B75B0 + .incbin "baserom.gba", 0x5b75b0, 0x60 + +gUnknown_085B7610:: @ 85B7610 + .incbin "baserom.gba", 0x5b7610, 0x140 + +gUnknown_085B7750:: @ 85B7750 + .incbin "baserom.gba", 0x5b7750, 0x94 + +gUnknown_085B77E4:: @ 85B77E4 + .incbin "baserom.gba", 0x5b77e4, 0x18 + +gUnknown_085B77FC:: @ 85B77FC + .incbin "baserom.gba", 0x5b77fc, 0x18 + +gUnknown_085B7814:: @ 85B7814 + .incbin "baserom.gba", 0x5b7814, 0x18 + +gUnknown_085B782C:: @ 85B782C + .incbin "baserom.gba", 0x5b782c, 0x18 + +gUnknown_085B7844:: @ 85B7844 + .incbin "baserom.gba", 0x5b7844, 0x20 + +gUnknown_085B7864:: @ 85B7864 + .incbin "baserom.gba", 0x5b7864, 0xc4 + +gUnknown_085B7928:: @ 85B7928 + .incbin "baserom.gba", 0x5b7928, 0x20 + +gUnknown_085B7948:: @ 85B7948 + .incbin "baserom.gba", 0x5b7948, 0x8 + +gUnknown_085B7950:: @ 85B7950 + .incbin "baserom.gba", 0x5b7950, 0x28 + +gUnknown_085B7978:: @ 85B7978 + .incbin "baserom.gba", 0x5b7978, 0x80 + +gUnknown_085B79F8:: @ 85B79F8 + .incbin "baserom.gba", 0x5b79f8, 0x18 + +gUnknown_085B7A10:: @ 85B7A10 + .incbin "baserom.gba", 0x5b7a10, 0x30 + +gUnknown_085B7A40:: @ 85B7A40 + .incbin "baserom.gba", 0x5b7a40, 0x7c + +gUnknown_085B7ABC:: @ 85B7ABC + .incbin "baserom.gba", 0x5b7abc, 0x30 + +gUnknown_085B7AEC:: @ 85B7AEC + .incbin "baserom.gba", 0x5b7aec, 0x18 + +gUnknown_085B7B04:: @ 85B7B04 + .incbin "baserom.gba", 0x5b7b04, 0x6 + +gUnknown_085B7B0A:: @ 85B7B0A + .incbin "baserom.gba", 0x5b7b0a, 0x8 + +gUnknown_085B7B12:: @ 85B7B12 + .incbin "baserom.gba", 0x5b7b12, 0x8 + +gUnknown_085B7B1A:: @ 85B7B1A + .incbin "baserom.gba", 0x5b7b1a, 0x14 + +gUnknown_085B7B2E:: @ 85B7B2E + .incbin "baserom.gba", 0x5b7b2e, 0x18 + +gUnknown_085B7B46:: @ 85B7B46 + .incbin "baserom.gba", 0x5b7b46, 0x2 + +gUnknown_085B7B48:: @ 85B7B48 + .incbin "baserom.gba", 0x5b7b48, 0x8d0 + +gUnknown_085B8418:: @ 85B8418 + .incbin "baserom.gba", 0x5b8418, 0x20 + +gUnknown_085B8438:: @ 85B8438 + .incbin "baserom.gba", 0x5b8438, 0x338 + +gUnknown_085B8770:: @ 85B8770 + .incbin "baserom.gba", 0x5b8770, 0x480 + +gUnknown_085B8BF0:: @ 85B8BF0 + .incbin "baserom.gba", 0x5b8bf0, 0x20 + +gUnknown_085B8C10:: @ 85B8C10 + .incbin "baserom.gba", 0x5b8c10, 0x20 + +gUnknown_085B8C30:: @ 85B8C30 + .incbin "baserom.gba", 0x5b8c30, 0x2 + +gUnknown_085B8C32:: @ 85B8C32 + .incbin "baserom.gba", 0x5b8c32, 0x36 + +gUnknown_085B8C68:: @ 85B8C68 + .incbin "baserom.gba", 0x5b8c68, 0x18 + +gUnknown_085B8C80:: @ 85B8C80 + .incbin "baserom.gba", 0x5b8c80, 0x10 + +gUnknown_085B8C90:: @ 85B8C90 + .incbin "baserom.gba", 0x5b8c90, 0x528 + +gUnknown_085B91B8:: @ 85B91B8 + .incbin "baserom.gba", 0x5b91b8, 0x178 + +gUnknown_085B9330:: @ 85B9330 + .incbin "baserom.gba", 0x5b9330, 0x580 + +gUnknown_085B98B0:: @ 85B98B0 + .incbin "baserom.gba", 0x5b98b0, 0x240 + +gUnknown_085B9AF0:: @ 85B9AF0 + .incbin "baserom.gba", 0x5b9af0, 0x11e0 + +gUnknown_085BACD0:: @ 85BACD0 + .incbin "baserom.gba", 0x5bacd0, 0x1e0 + +gUnknown_085BAEB0:: @ 85BAEB0 + .incbin "baserom.gba", 0x5baeb0, 0x20 + +gUnknown_085BAED0:: @ 85BAED0 + .incbin "baserom.gba", 0x5baed0, 0x378 + +gUnknown_085BB248:: @ 85BB248 + .incbin "baserom.gba", 0x5bb248, 0x25c + +gUnknown_085BB4A4:: @ 85BB4A4 + .incbin "baserom.gba", 0x5bb4a4, 0x48c + +gUnknown_085BB930:: @ 85BB930 + .incbin "baserom.gba", 0x5bb930, 0x2e4 + +gUnknown_085BBC14:: @ 85BBC14 + .incbin "baserom.gba", 0x5bbc14, 0x6a0 + +gUnknown_085BC2B4:: @ 85BC2B4 + .incbin "baserom.gba", 0x5bc2b4, 0x20 + +gUnknown_085BC2D4:: @ 85BC2D4 + .incbin "baserom.gba", 0x5bc2d4, 0x20 + +gUnknown_085BC2F4:: @ 85BC2F4 + .incbin "baserom.gba", 0x5bc2f4, 0x20 + +gUnknown_085BC314:: @ 85BC314 + .incbin "baserom.gba", 0x5bc314, 0x800 + +gUnknown_085BCB14:: @ 85BCB14 + .incbin "baserom.gba", 0x5bcb14, 0x800 + +gUnknown_085BD314:: @ 85BD314 + .incbin "baserom.gba", 0x5bd314, 0x820 + +gUnknown_085BDB34:: @ 85BDB34 + .incbin "baserom.gba", 0x5bdb34, 0x6b4 + +gUnknown_085BE1E8:: @ 85BE1E8 + .incbin "baserom.gba", 0x5be1e8, 0x334 + +gUnknown_085BE51C:: @ 85BE51C + .incbin "baserom.gba", 0x5be51c, 0x56c + +gUnknown_085BEA88:: @ 85BEA88 + .incbin "baserom.gba", 0x5bea88, 0x318 + +gUnknown_085BEDA0:: @ 85BEDA0 + .incbin "baserom.gba", 0x5beda0, 0x140 + +gUnknown_085BEEE0:: @ 85BEEE0 + .incbin "baserom.gba", 0x5beee0, 0x1c0 + +gUnknown_085BF0A0:: @ 85BF0A0 + .incbin "baserom.gba", 0x5bf0a0, 0x200 + +gUnknown_085BF2A0:: @ 85BF2A0 + .incbin "baserom.gba", 0x5bf2a0, 0x200 + +gUnknown_085BF4A0:: @ 85BF4A0 + .incbin "baserom.gba", 0x5bf4a0, 0xa0 + +gUnknown_085BF540:: @ 85BF540 + .incbin "baserom.gba", 0x5bf540, 0x160 + +gUnknown_085BF6A0:: @ 85BF6A0 + .incbin "baserom.gba", 0x5bf6a0, 0x7540 + +gUnknown_085C6BE0:: @ 85C6BE0 + .incbin "baserom.gba", 0x5c6be0, 0x1000 + +gUnknown_085C7BE0:: @ 85C7BE0 + .incbin "baserom.gba", 0x5c7be0, 0x20 + +gUnknown_085C7C00:: @ 85C7C00 + .incbin "baserom.gba", 0x5c7c00, 0x68c + +gUnknown_085C828C:: @ 85C828C + .incbin "baserom.gba", 0x5c828c, 0x2ec + +gUnknown_085C8578:: @ 85C8578 + .incbin "baserom.gba", 0x5c8578, 0x20 + +gUnknown_085C8598:: @ 85C8598 + .incbin "baserom.gba", 0x5c8598, 0x15c + +gUnknown_085C86F4:: @ 85C86F4 + .incbin "baserom.gba", 0x5c86f4, 0x100 + +gUnknown_085C87F4:: @ 85C87F4 + .incbin "baserom.gba", 0x5c87f4, 0xb0 + +gUnknown_085C88A4:: @ 85C88A4 + .incbin "baserom.gba", 0x5c88a4, 0x84 + +gUnknown_085C8928:: @ 85C8928 + .incbin "baserom.gba", 0x5c8928, 0x20 + +gUnknown_085C8948:: @ 85C8948 + .incbin "baserom.gba", 0x5c8948, 0xa8 + +gUnknown_085C89F0:: @ 85C89F0 + .incbin "baserom.gba", 0x5c89f0, 0xa8 + +gUnknown_085C8A98:: @ 85C8A98 + .incbin "baserom.gba", 0x5c8a98, 0x10 + +gUnknown_085C8AA8:: @ 85C8AA8 + .incbin "baserom.gba", 0x5c8aa8, 0xc + +gUnknown_085C8AB4:: @ 85C8AB4 + .incbin "baserom.gba", 0x5c8ab4, 0x8 + +gUnknown_085C8ABC:: @ 85C8ABC + .incbin "baserom.gba", 0x5c8abc, 0x8 + +gUnknown_085C8AC4:: @ 85C8AC4 + .incbin "baserom.gba", 0x5c8ac4, 0x1c + +gUnknown_085C8AE0:: @ 85C8AE0 + .incbin "baserom.gba", 0x5c8ae0, 0x1c + +gUnknown_085C8AFC:: @ 85C8AFC + .incbin "baserom.gba", 0x5c8afc, 0x18 + +gUnknown_085C8B14:: @ 85C8B14 + .incbin "baserom.gba", 0x5c8b14, 0x18 + +gUnknown_085C8B2C:: @ 85C8B2C + .incbin "baserom.gba", 0x5c8b2c, 0x18 + +gUnknown_085C8B44:: @ 85C8B44 + .incbin "baserom.gba", 0x5c8b44, 0x18 + +gUnknown_085C8B5C:: @ 85C8B5C + .incbin "baserom.gba", 0x5c8b5c, 0x20 + +gUnknown_085C8B7C:: @ 85C8B7C + .incbin "baserom.gba", 0x5c8b7c, 0xc + +gUnknown_085C8B88:: @ 85C8B88 + .incbin "baserom.gba", 0x5c8b88, 0x4 + +gUnknown_085C8B8C:: @ 85C8B8C + .incbin "baserom.gba", 0x5c8b8c, 0xa + +gUnknown_085C8B96:: @ 85C8B96 + .incbin "baserom.gba", 0x5c8b96, 0x6 + +gUnknown_085C8B9C:: @ 85C8B9C + .incbin "baserom.gba", 0x5c8b9c, 0x1c + +gUnknown_085C8BB8:: @ 85C8BB8 + .incbin "baserom.gba", 0x5c8bb8, 0x8 + +gUnknown_085C8BC0:: @ 85C8BC0 + .incbin "baserom.gba", 0x5c8bc0, 0xc + +gUnknown_085C8BCC:: @ 85C8BCC + .incbin "baserom.gba", 0x5c8bcc, 0x28 + +gUnknown_085C8BF4:: @ 85C8BF4 + .incbin "baserom.gba", 0x5c8bf4, 0x6 + +gUnknown_085C8BFA:: @ 85C8BFA + .incbin "baserom.gba", 0x5c8bfa, 0x14 + +gUnknown_085C8C0E:: @ 85C8C0E + .incbin "baserom.gba", 0x5c8c0e, 0x16 + +gUnknown_085C8C24:: @ 85C8C24 + .incbin "baserom.gba", 0x5c8c24, 0x1c + +gUnknown_085C8C40:: @ 85C8C40 + .incbin "baserom.gba", 0x5c8c40, 0x4 + +gUnknown_085C8C44:: @ 85C8C44 + .incbin "baserom.gba", 0x5c8c44, 0x4 + +gUnknown_085C8C48:: @ 85C8C48 + .incbin "baserom.gba", 0x5c8c48, 0xc + +gUnknown_085C8C54:: @ 85C8C54 + .incbin "baserom.gba", 0x5c8c54, 0x10 + +gUnknown_085C8C64:: @ 85C8C64 + .incbin "baserom.gba", 0x5c8c64, 0x2 + +gUnknown_085C8C66:: @ 85C8C66 + .incbin "baserom.gba", 0x5c8c66, 0x6 + +gUnknown_085C8C6C:: @ 85C8C6C + .incbin "baserom.gba", 0x5c8c6c, 0xc + +gUnknown_085C8C78:: @ 85C8C78 + .incbin "baserom.gba", 0x5c8c78, 0x8 + +gUnknown_085C8C80:: @ 85C8C80 + .incbin "baserom.gba", 0x5c8c80, 0x4 + +gUnknown_085C8C84:: @ 85C8C84 + .incbin "baserom.gba", 0x5c8c84, 0xb4 + +gUnknown_085C8D38:: @ 85C8D38 + .incbin "baserom.gba", 0x5c8d38, 0x8 + +gUnknown_085C8D40:: @ 85C8D40 + .incbin "baserom.gba", 0x5c8d40, 0x20 + +gUnknown_085C8D60:: @ 85C8D60 + .incbin "baserom.gba", 0x5c8d60, 0x2c + +gUnknown_085C8D8C:: @ 85C8D8C + .incbin "baserom.gba", 0x5c8d8c, 0x14 + +gUnknown_085C8DA0:: @ 85C8DA0 + .incbin "baserom.gba", 0x5c8da0, 0x10 + +gUnknown_085C8DB0:: @ 85C8DB0 + .incbin "baserom.gba", 0x5c8db0, 0xc + +gUnknown_085C8DBC:: @ 85C8DBC + .incbin "baserom.gba", 0x5c8dbc, 0x14 + +gUnknown_085C8DD0:: @ 85C8DD0 + .incbin "baserom.gba", 0x5c8dd0, 0x46 + +gUnknown_085C8E16:: @ 85C8E16 + .incbin "baserom.gba", 0x5c8e16, 0xe + +gUnknown_085C8E24:: @ 85C8E24 + .incbin "baserom.gba", 0x5c8e24, 0x44 + +gUnknown_085C8E68:: @ 85C8E68 + .incbin "baserom.gba", 0x5c8e68, 0x6c + + .align 2 +gFieldEffectObjectPalette10:: @ 85C8ED4 + .incbin "graphics/map_objects/palettes/field_effect_object_palette_10.gbapal" + + .align 2 +gFieldEffectObjectPaletteInfo10:: @ 85C8EF4 + obj_pal gFieldEffectObjectPalette10, 0x1009 + + .incbin "baserom.gba", 0x5c8efc, 0xe0 + +gUnknown_085C8FDC:: @ 85C8FDC + .incbin "baserom.gba", 0x5c8fdc, 0x14 + +gUnknown_085C8FF0:: @ 85C8FF0 + .incbin "baserom.gba", 0x5c8ff0, 0x30 + +gUnknown_085C9020:: @ 85C9020 + .incbin "baserom.gba", 0x5c9020, 0x4b0 + +gUnknown_085C94D0:: @ 85C94D0 + .incbin "baserom.gba", 0x5c94d0, 0x500 + +gUnknown_085C99D0:: @ 85C99D0 + .incbin "baserom.gba", 0x5c99d0, 0x18 + +gUnknown_085C99E8:: @ 85C99E8 + .incbin "baserom.gba", 0x5c99e8, 0x10 + +gUnknown_085C99F8:: @ 85C99F8 + .incbin "baserom.gba", 0x5c99f8, 0x10 + +gUnknown_085C9A08:: @ 85C9A08 + .incbin "baserom.gba", 0x5c9a08, 0x14 + +gUnknown_085C9A1C:: @ 85C9A1C + .incbin "baserom.gba", 0x5c9a1c, 0x14 + +gUnknown_085C9A30:: @ 85C9A30 + .incbin "baserom.gba", 0x5c9a30, 0x23 + +gUnknown_085C9A53:: @ 85C9A53 + .incbin "baserom.gba", 0x5c9a53, 0x41 + diff --git a/data/data_860A4AC.s b/data/data_860A4AC.s index 5bb627449..bac17590d 100644 --- a/data/data_860A4AC.s +++ b/data/data_860A4AC.s @@ -48,1936 +48,3 @@ gUnknown_0860AE7C:: @ 860AE7C gUnknown_0860AE88:: @ 860AE88 .incbin "baserom.gba", 0x60ae88, 0x8 -gRecordedOpponentBufferCommands:: @ 860AE90 - .incbin "baserom.gba", 0x60ae90, 0xe4 - -gRecordedPlayerBufferCommands:: @ 860AF74 - .incbin "baserom.gba", 0x60af74, 0xe4 - -gUnknown_0860B058:: @ 860B058 - .incbin "baserom.gba", 0x60b058, 0xc - -gUnknown_0860B064:: @ 860B064 - .incbin "baserom.gba", 0x60b064, 0x8 - -gUnknown_0860B06C:: @ 860B06C - .incbin "baserom.gba", 0x60b06c, 0x8 - -gUnknown_0860B074:: @ 860B074 - .incbin "baserom.gba", 0x60b074, 0xa - -gUnknown_0860B07E:: @ 860B07E - .incbin "baserom.gba", 0x60b07e, 0x126 - -gUnknown_0860B1A4:: @ 860B1A4 - .incbin "baserom.gba", 0x60b1a4, 0x40 - -gUnknown_0860B1E4:: @ 860B1E4 - .incbin "baserom.gba", 0x60b1e4, 0x20 - -gUnknown_0860B204:: @ 860B204 - .incbin "baserom.gba", 0x60b204, 0x20 - -gUnknown_0860B224:: @ 860B224 - .incbin "baserom.gba", 0x60b224, 0xc8 - -gUnknown_0860B2EC:: @ 860B2EC - .incbin "baserom.gba", 0x60b2ec, 0x18 - -gUnknown_0860B304:: @ 860B304 - .incbin "baserom.gba", 0x60b304, 0xc - -gUnknown_0860B310:: @ 860B310 - .incbin "baserom.gba", 0x60b310, 0x14 - -gUnknown_0860B324:: @ 860B324 - .incbin "baserom.gba", 0x60b324, 0x14 - -gUnknown_0860B338:: @ 860B338 - .incbin "baserom.gba", 0x60b338, 0x14 - -gUnknown_0860B34C:: @ 860B34C - .incbin "baserom.gba", 0x60b34c, 0xc - -gUnknown_0860B358:: @ 860B358 - .incbin "baserom.gba", 0x60b358, 0x1630 - -gUnknown_0860C988:: @ 860C988 - .incbin "baserom.gba", 0x60c988, 0x269 - -gUnknown_0860CBF1:: @ 860CBF1 - .incbin "baserom.gba", 0x60cbf1, 0x283 - -gUnknown_0860CE74:: @ 860CE74 - .incbin "baserom.gba", 0x60ce74, 0x10 - -gUnknown_0860CE84:: @ 860CE84 - .incbin "baserom.gba", 0x60ce84, 0x10 - -gUnknown_0860CE94:: @ 860CE94 - .incbin "baserom.gba", 0x60ce94, 0x20 - -gUnknown_0860CEB4:: @ 860CEB4 - .incbin "baserom.gba", 0x60ceb4, 0x90 - -gUnknown_0860CF44:: @ 860CF44 - .incbin "baserom.gba", 0x60cf44, 0xc - -gUnknown_0860CF50:: @ 860CF50 - .incbin "baserom.gba", 0x60cf50, 0x58 - -gUnknown_0860CFA8:: @ 860CFA8 - .incbin "baserom.gba", 0x60cfa8, 0x30 - -gUnknown_0860CFD8:: @ 860CFD8 - .incbin "baserom.gba", 0x60cfd8, 0x30 - -gUnknown_0860D008:: @ 860D008 - .incbin "baserom.gba", 0x60d008, 0x48 - -gUnknown_0860D050:: @ 860D050 - .incbin "baserom.gba", 0x60d050, 0x18 - -gUnknown_0860D068:: @ 860D068 - .incbin "baserom.gba", 0x60d068, 0x18 - -gUnknown_0860D080:: @ 860D080 - .incbin "baserom.gba", 0x60d080, 0x10 - -gUnknown_0860D090:: @ 860D090 - .incbin "baserom.gba", 0x60d090, 0x5c - -gUnknown_0860D0EC:: @ 860D0EC - .incbin "baserom.gba", 0x60d0ec, 0x10 - -gUnknown_0860D0FC:: @ 860D0FC - .incbin "baserom.gba", 0x60d0fc, 0x10 - -gUnknown_0860D10C:: @ 860D10C - .incbin "baserom.gba", 0x60d10c, 0x40 - -gUnknown_0860D14C:: @ 860D14C - .incbin "baserom.gba", 0x60d14c, 0x10 - -gUnknown_0860D15C:: @ 860D15C - .incbin "baserom.gba", 0x60d15c, 0x40 - -gUnknown_0860D19C:: @ 860D19C - .incbin "baserom.gba", 0x60d19c, 0x4 - -gUnknown_0860D1A0:: @ 860D1A0 - .incbin "baserom.gba", 0x60d1a0, 0x20 - -gUnknown_0860D1C0:: @ 860D1C0 - .incbin "baserom.gba", 0x60d1c0, 0x10 - -gUnknown_0860D1D0:: @ 860D1D0 - .incbin "baserom.gba", 0x60d1d0, 0x44 - -gUnknown_0860D214:: @ 860D214 - .incbin "baserom.gba", 0x60d214, 0x80 - -gUnknown_0860D294:: @ 860D294 - .incbin "baserom.gba", 0x60d294, 0xac - -gUnknown_0860D340:: @ 860D340 - .incbin "baserom.gba", 0x60d340, 0x3 - -gUnknown_0860D343:: @ 860D343 - .incbin "baserom.gba", 0x60d343, 0x3 - -gUnknown_0860D346:: @ 860D346 - .incbin "baserom.gba", 0x60d346, 0x3 - -gUnknown_0860D349:: @ 860D349 - .incbin "baserom.gba", 0x60d349, 0x7 - -gUnknown_0860D350:: @ 860D350 - .incbin "baserom.gba", 0x60d350, 0x3c - -gUnknown_0860D38C:: @ 860D38C - .incbin "baserom.gba", 0x60d38c, 0x1c - -gUnknown_0860D3A8:: @ 860D3A8 - .incbin "baserom.gba", 0x60d3a8, 0x3 - -gUnknown_0860D3AB:: @ 860D3AB - .incbin "baserom.gba", 0x60d3ab, 0x3 - -gUnknown_0860D3AE:: @ 860D3AE - .incbin "baserom.gba", 0x60d3ae, 0x3 - -gUnknown_0860D3B1:: @ 860D3B1 - .incbin "baserom.gba", 0x60d3b1, 0x3 - -gUnknown_0860D3B4:: @ 860D3B4 - .incbin "baserom.gba", 0x60d3b4, 0x10 - -gUnknown_0860D3C4:: @ 860D3C4 - .incbin "baserom.gba", 0x60d3c4, 0x2 - -gUnknown_0860D3C6:: @ 860D3C6 - .incbin "baserom.gba", 0x60d3c6, 0x2b - -gUnknown_0860D3F1:: @ 860D3F1 - .incbin "baserom.gba", 0x60d3f1, 0x1 - -gUnknown_0860D3F2:: @ 860D3F2 - .incbin "baserom.gba", 0x60d3f2, 0x1f - -gUnknown_0860D411:: @ 860D411 - .incbin "baserom.gba", 0x60d411, 0x8ff - -gUnknown_0860DD10:: @ 860DD10 - .incbin "baserom.gba", 0x60dd10, 0x100 - -gUnknown_0860DE10:: @ 860DE10 - .incbin "baserom.gba", 0x60de10, 0x40 - -gUnknown_0860DE50:: @ 860DE50 - .incbin "baserom.gba", 0x60de50, 0x28 - -gUnknown_0860DE78:: @ 860DE78 - .incbin "baserom.gba", 0x60de78, 0xc - -gUnknown_0860DE84:: @ 860DE84 - .incbin "baserom.gba", 0x60de84, 0x14 - -gUnknown_0860DE98:: @ 860DE98 - .incbin "baserom.gba", 0x60de98, 0x10 - -gUnknown_0860DEA8:: @ 860DEA8 - .incbin "baserom.gba", 0x60dea8, 0x10 - -gUnknown_0860DEB8:: @ 860DEB8 - .incbin "baserom.gba", 0x60deb8, 0xb68 - -gUnknown_0860EA20:: @ 860EA20 - .incbin "baserom.gba", 0x60ea20, 0xc - -gUnknown_0860EA2C:: @ 860EA2C - .incbin "baserom.gba", 0x60ea2c, 0x8 - -gUnknown_0860EA34:: @ 860EA34 - .incbin "baserom.gba", 0x60ea34, 0x18 - -gUnknown_0860EA4C:: @ 860EA4C - .incbin "baserom.gba", 0x60ea4c, 0x20 - -gUnknown_0860EA6C:: @ 860EA6C - .incbin "baserom.gba", 0x60ea6c, 0x100 - -gUnknown_0860EB6C:: @ 860EB6C - .incbin "baserom.gba", 0x60eb6c, 0x20 - -gUnknown_0860EB8C:: @ 860EB8C - .incbin "baserom.gba", 0x60eb8c, 0x3e4 - -gUnknown_0860EF70:: @ 860EF70 - .incbin "baserom.gba", 0x60ef70, 0x8 - -gUnknown_0860EF78:: @ 860EF78 - .incbin "baserom.gba", 0x60ef78, 0x20 - -gUnknown_0860EF98:: @ 860EF98 - .incbin "baserom.gba", 0x60ef98, 0x8 - -gUnknown_0860EFA0:: @ 860EFA0 - .incbin "baserom.gba", 0x60efa0, 0xc - -gUnknown_0860EFAC:: @ 860EFAC - .incbin "baserom.gba", 0x60efac, 0x18 - -gUnknown_0860EFC4:: @ 860EFC4 - .incbin "baserom.gba", 0x60efc4, 0x30 - -gUnknown_0860EFF4:: @ 860EFF4 - .incbin "baserom.gba", 0x60eff4, 0x1c - -gUnknown_0860F010:: @ 860F010 - .incbin "baserom.gba", 0x60f010, 0x10 - -gUnknown_0860F020:: @ 860F020 - .incbin "baserom.gba", 0x60f020, 0x54 - -gUnknown_0860F074:: @ 860F074 - .incbin "baserom.gba", 0x60f074, 0x20 - -gUnknown_0860F094:: @ 860F094 - .incbin "baserom.gba", 0x60f094, 0x4 - -gUnknown_0860F098:: @ 860F098 - .incbin "baserom.gba", 0x60f098, 0x10 - -gUnknown_0860F0A8:: @ 860F0A8 - .incbin "baserom.gba", 0x60f0a8, 0x8 - -gUnknown_0860F0B0:: @ 860F0B0 - .incbin "baserom.gba", 0x60f0b0, 0x20 - -gUnknown_0860F0D0:: @ 860F0D0 - .incbin "baserom.gba", 0x60f0d0, 0x4 - -gUnknown_0860F0D4:: @ 860F0D4 - .incbin "baserom.gba", 0x60f0d4, 0x68 - -gUnknown_0860F13C:: @ 860F13C - .incbin "baserom.gba", 0x60f13c, 0x1100 - -gUnknown_0861023C:: @ 861023C - .incbin "baserom.gba", 0x61023c, 0x100 - -gUnknown_0861033C:: @ 861033C - .incbin "baserom.gba", 0x61033c, 0x60 - -gUnknown_0861039C:: @ 861039C - .incbin "baserom.gba", 0x61039c, 0x20 - -gUnknown_086103BC:: @ 86103BC - .incbin "baserom.gba", 0x6103bc, 0x28 - -gUnknown_086103E4:: @ 86103E4 - .incbin "baserom.gba", 0x6103e4, 0x10 - -gUnknown_086103F4:: @ 86103F4 - .incbin "baserom.gba", 0x6103f4, 0x28 - -gUnknown_0861041C:: @ 861041C - .incbin "baserom.gba", 0x61041c, 0xc - -gUnknown_08610428:: @ 8610428 - .incbin "baserom.gba", 0x610428, 0xc - -gUnknown_08610434:: @ 8610434 - .incbin "baserom.gba", 0x610434, 0x38 - -gUnknown_0861046C:: @ 861046C - .incbin "baserom.gba", 0x61046c, 0xa - -gUnknown_08610476:: @ 8610476 - .incbin "baserom.gba", 0x610476, 0x3 - -gUnknown_08610479:: @ 8610479 - .incbin "baserom.gba", 0x610479, 0x15f - -gUnknown_086105D8:: @ 86105D8 - .incbin "baserom.gba", 0x6105d8, 0x18 - -gUnknown_086105F0:: @ 86105F0 - .incbin "baserom.gba", 0x6105f0, 0x18 - -gUnknown_08610608:: @ 8610608 - .incbin "baserom.gba", 0x610608, 0x18 - -gUnknown_08610620:: @ 8610620 - .incbin "baserom.gba", 0x610620, 0x18 - -gUnknown_08610638:: @ 8610638 - .incbin "baserom.gba", 0x610638, 0x18 - -gUnknown_08610650:: @ 8610650 - .incbin "baserom.gba", 0x610650, 0x50 - -gUnknown_086106A0:: @ 86106A0 - .incbin "baserom.gba", 0x6106a0, 0x10 - -gUnknown_086106B0:: @ 86106B0 - .incbin "baserom.gba", 0x6106b0, 0x184 - -gUnknown_08610834:: @ 8610834 - .incbin "baserom.gba", 0x610834, 0x18 - -gUnknown_0861084C:: @ 861084C - .incbin "baserom.gba", 0x61084c, 0x18 - -gUnknown_08610864:: @ 8610864 - .incbin "baserom.gba", 0x610864, 0x18 - -gUnknown_0861087C:: @ 861087C - .incbin "baserom.gba", 0x61087c, 0x18 - -gUnknown_08610894:: @ 8610894 - .incbin "baserom.gba", 0x610894, 0x18 - -gUnknown_086108AC:: @ 86108AC - .incbin "baserom.gba", 0x6108ac, 0xc - -gUnknown_086108B8:: @ 86108B8 - .incbin "baserom.gba", 0x6108b8, 0x10 - -gUnknown_086108C8:: @ 86108C8 - .incbin "baserom.gba", 0x6108c8, 0x50 - -gUnknown_08610918:: @ 8610918 - .incbin "baserom.gba", 0x610918, 0xa - -gUnknown_08610922:: @ 8610922 - .incbin "baserom.gba", 0x610922, 0x3 - -gUnknown_08610925:: @ 8610925 - .incbin "baserom.gba", 0x610925, 0x3 - -gUnknown_08610928:: @ 8610928 - .incbin "baserom.gba", 0x610928, 0x20 - -gUnknown_08610948:: @ 8610948 - .incbin "baserom.gba", 0x610948, 0x28 - -gUnknown_08610970:: @ 8610970 - .incbin "baserom.gba", 0x610970, 0x34 - -gUnknown_086109A4:: @ 86109A4 - .incbin "baserom.gba", 0x6109a4, 0x16 - -gUnknown_086109BA:: @ 86109BA - .incbin "baserom.gba", 0x6109ba, 0x536 - -gUnknown_08610EF0:: @ 8610EF0 - .incbin "baserom.gba", 0x610ef0, 0x100 - -gUnknown_08610FF0:: @ 8610FF0 - .incbin "baserom.gba", 0x610ff0, 0x80 - -gUnknown_08611070:: @ 8611070 - .incbin "baserom.gba", 0x611070, 0x140 - -gUnknown_086111B0:: @ 86111B0 - .incbin "baserom.gba", 0x6111b0, 0x80 - -gUnknown_08611230:: @ 8611230 - .incbin "baserom.gba", 0x611230, 0x80 - -gUnknown_086112B0:: @ 86112B0 - .incbin "baserom.gba", 0x6112b0, 0x80 - -gUnknown_08611330:: @ 8611330 - .incbin "baserom.gba", 0x611330, 0x40 - -gUnknown_08611370:: @ 8611370 - .incbin "baserom.gba", 0x611370, 0x163 - -gUnknown_086114D3:: @ 86114D3 - .incbin "baserom.gba", 0x6114d3, 0xd - -gUnknown_086114E0:: @ 86114E0 - .incbin "baserom.gba", 0x6114e0, 0x68 - -gUnknown_08611548:: @ 8611548 - .incbin "baserom.gba", 0x611548, 0x8 - -gUnknown_08611550:: @ 8611550 - .incbin "baserom.gba", 0x611550, 0x1c - -gUnknown_0861156C:: @ 861156C - .incbin "baserom.gba", 0x61156c, 0xc - -gUnknown_08611578:: @ 8611578 - .incbin "baserom.gba", 0x611578, 0x33c - -gUnknown_086118B4:: @ 86118B4 - .incbin "baserom.gba", 0x6118b4, 0x348 - -gUnknown_08611BFC:: @ 8611BFC - .incbin "baserom.gba", 0x611bfc, 0x1c - -gUnknown_08611C18:: @ 8611C18 - .incbin "baserom.gba", 0x611c18, 0x5c - -gUnknown_08611C74:: @ 8611C74 - .incbin "baserom.gba", 0x611c74, 0x8 - -gUnknown_08611C7C:: @ 8611C7C - .incbin "baserom.gba", 0x611c7c, 0x8 - -gUnknown_08611C84:: @ 8611C84 - .incbin "baserom.gba", 0x611c84, 0x8 - -gUnknown_08611C8C:: @ 8611C8C - .incbin "baserom.gba", 0x611c8c, 0xe - -gUnknown_08611C9A:: @ 8611C9A - .incbin "baserom.gba", 0x611c9a, 0x16 - -gUnknown_08611CB0:: @ 8611CB0 - .incbin "baserom.gba", 0x611cb0, 0x50 - -gUnknown_08611D00:: @ 8611D00 - .incbin "baserom.gba", 0x611d00, 0x8 - -gUnknown_08611D08:: @ 8611D08 - .incbin "baserom.gba", 0x611d08, 0x28 - -gUnknown_08611D30:: @ 8611D30 - .incbin "baserom.gba", 0x611d30, 0x80 - -gUnknown_08611DB0:: @ 8611DB0 - .incbin "baserom.gba", 0x611db0, 0x8 - -gUnknown_08611DB8:: @ 8611DB8 - .incbin "baserom.gba", 0x611db8, 0x8 - -@ 8611DC0 - .include "data/battle_frontier/battle_arena_move_mind_ratings.inc" - - .align 2 -@ 8611F24 - .incbin "baserom.gba", 0x611f24, 0x38 - -gUnknown_08611F5C:: @ 8611F5C - .incbin "baserom.gba", 0x611f5c, 0x18 - -gUnknown_08611F74:: @ 8611F74 - .incbin "baserom.gba", 0x611f74, 0x10 - -gUnknown_08611F84:: @ 8611F84 - .incbin "baserom.gba", 0x611f84, 0x1c - -gUnknown_08611FA0:: @ 8611FA0 - .incbin "baserom.gba", 0x611fa0, 0xc - -gUnknown_08611FAC:: @ 8611FAC - .incbin "baserom.gba", 0x611fac, 0x14 - -@ 8611FC0 - .include "data/battle_frontier/battle_factory_style_move_lists.inc" - -gUnknown_08612120:: @ 8612120 - .incbin "baserom.gba", 0x612120, 0x44 - -gUnknown_08612164:: @ 8612164 - .incbin "baserom.gba", 0x612164, 0x10 - -gUnknown_08612174:: @ 8612174 - .incbin "baserom.gba", 0x612174, 0x10 - -gUnknown_08612184:: @ 8612184 - .incbin "baserom.gba", 0x612184, 0x10 - -gUnknown_08612194:: @ 8612194 - .incbin "baserom.gba", 0x612194, 0x180 - -gUnknown_08612314:: @ 8612314 - .incbin "baserom.gba", 0x612314, 0x8 - -gUnknown_0861231C:: @ 861231C - .incbin "baserom.gba", 0x61231c, 0xc8 - -gUnknown_086123E4:: @ 86123E4 - .incbin "baserom.gba", 0x6123e4, 0x1f8 - -gUnknown_086125DC:: @ 86125DC - .incbin "baserom.gba", 0x6125dc, 0x1c - -gUnknown_086125F8:: @ 86125F8 - .incbin "baserom.gba", 0x6125f8, 0x74 - -gUnknown_0861266C:: @ 861266C - .incbin "baserom.gba", 0x61266c, 0x9 - -gUnknown_08612675:: @ 8612675 - .incbin "baserom.gba", 0x612675, 0x13 - -gUnknown_08612688:: @ 8612688 - .incbin "baserom.gba", 0x612688, 0x8 - -gUnknown_08612690:: @ 8612690 - .incbin "baserom.gba", 0x612690, 0x8 - -gUnknown_08612698:: @ 8612698 - .incbin "baserom.gba", 0x612698, 0x4 - -gUnknown_0861269C:: @ 861269C - .incbin "baserom.gba", 0x61269c, 0x4 - -gUnknown_086126A0:: @ 86126A0 - .incbin "baserom.gba", 0x6126a0, 0x4 - -gUnknown_086126A4:: @ 86126A4 - .incbin "baserom.gba", 0x6126a4, 0x4 - -gUnknown_086126A8:: @ 86126A8 - .incbin "baserom.gba", 0x6126a8, 0x2 - -gUnknown_086126AA:: @ 86126AA - .incbin "baserom.gba", 0x6126aa, 0x2 - -gUnknown_086126AC:: @ 86126AC - .incbin "baserom.gba", 0x6126ac, 0x2 - -gUnknown_086126AE:: @ 86126AE - .incbin "baserom.gba", 0x6126ae, 0x2 - -@ 86126B0 - .include "data/battle_frontier/battle_pyramid_level_50_wild_mons.inc" - -@ 8612E80 - .include "data/battle_frontier/battle_pyramid_open_level_wild_mons.inc" - -gUnknown_08613650:: @ 8613650 - .incbin "baserom.gba", 0x613650, 0x5 - -gUnknown_08613655:: @ 8613655 - .incbin "baserom.gba", 0x613655, 0xfb - -gUnknown_08613750:: @ 8613750 - .incbin "baserom.gba", 0x613750, 0x44 - -gUnknown_08613794:: @ 8613794 - .incbin "baserom.gba", 0x613794, 0x8 - -gUnknown_0861379C:: @ 861379C - .incbin "baserom.gba", 0x61379c, 0x190 - -gUnknown_0861392C:: @ 861392C - .incbin "baserom.gba", 0x61392c, 0x190 - -gUnknown_08613ABC:: @ 8613ABC - .incbin "baserom.gba", 0x613abc, 0x7e - -gUnknown_08613B3A:: @ 8613B3A - .incbin "baserom.gba", 0x613b3a, 0xa - -gUnknown_08613B44:: @ 8613B44 - .incbin "baserom.gba", 0x613b44, 0xd8 - -gUnknown_08613C1C:: @ 8613C1C - .incbin "baserom.gba", 0x613c1c, 0x2a4 - -gUnknown_08613EC0:: @ 8613EC0 - .incbin "baserom.gba", 0x613ec0, 0x18 - -gUnknown_08613ED8:: @ 8613ED8 - .incbin "baserom.gba", 0x613ed8, 0x8 - -gUnknown_08613EE0:: @ 8613EE0 - .incbin "baserom.gba", 0x613ee0, 0x48 - -gUnknown_08613F28:: @ 8613F28 - .incbin "baserom.gba", 0x613f28, 0xc - -gUnknown_08613F34:: @ 8613F34 - .incbin "baserom.gba", 0x613f34, 0x12 - -gUnknown_08613F46:: @ 8613F46 - .incbin "baserom.gba", 0x613f46, 0x40 - -gUnknown_08613F86:: @ 8613F86 - .incbin "baserom.gba", 0x613f86, 0xa - -gUnknown_08613F90:: @ 8613F90 - .incbin "baserom.gba", 0x613f90, 0xc - -gUnknown_08613F9C:: @ 8613F9C - .incbin "baserom.gba", 0x613f9c, 0x18 - -gUnknown_08613FB4:: @ 8613FB4 - .incbin "baserom.gba", 0x613fb4, 0x78 - -gUnknown_0861402C:: @ 861402C - .incbin "baserom.gba", 0x61402c, 0x4 - -gUnknown_08614030:: @ 8614030 - .incbin "baserom.gba", 0x614030, 0x4 - -gUnknown_08614034:: @ 8614034 - .incbin "baserom.gba", 0x614034, 0x4 - -gUnknown_08614038:: @ 8614038 - .incbin "baserom.gba", 0x614038, 0x4 - -gUnknown_0861403C:: @ 861403C - .incbin "baserom.gba", 0x61403c, 0x6 - -gUnknown_08614042:: @ 8614042 - .incbin "baserom.gba", 0x614042, 0x2 - -gUnknown_08614044:: @ 8614044 - .incbin "baserom.gba", 0x614044, 0x2 - -gUnknown_08614046:: @ 8614046 - .incbin "baserom.gba", 0x614046, 0x1 - -gUnknown_08614047:: @ 8614047 - .incbin "baserom.gba", 0x614047, 0x4 - -gUnknown_0861404B:: @ 861404B - .incbin "baserom.gba", 0x61404b, 0x2 - -gUnknown_0861404D:: @ 861404D - .incbin "baserom.gba", 0x61404d, 0x2 - -gUnknown_0861404F:: @ 861404F - .incbin "baserom.gba", 0x61404f, 0x5 - -gUnknown_08614054:: @ 8614054 - .incbin "baserom.gba", 0x614054, 0x30 - -gUnknown_08614084:: @ 8614084 - .incbin "baserom.gba", 0x614084, 0x8 - -gUnknown_0861408C:: @ 861408C - .incbin "baserom.gba", 0x61408c, 0x8 - -gUnknown_08614094:: @ 8614094 - .incbin "baserom.gba", 0x614094, 0x10 - -gUnknown_086140A4:: @ 86140A4 - .incbin "baserom.gba", 0x6140a4, 0xc0 - -gUnknown_08614164:: @ 8614164 - .incbin "baserom.gba", 0x614164, 0x10 - -gUnknown_08614174:: @ 8614174 - .incbin "baserom.gba", 0x614174, 0x38 - -gUnknown_086141AC:: @ 86141AC - .incbin "baserom.gba", 0x6141ac, 0x50 - -gUnknown_086141FC:: @ 86141FC - .incbin "baserom.gba", 0x6141fc, 0x48 - -gUnknown_08614244:: @ 8614244 - .incbin "baserom.gba", 0x614244, 0x18 - -gUnknown_0861425C:: @ 861425C - .incbin "baserom.gba", 0x61425c, 0x4 - -gUnknown_08614260:: @ 8614260 - .incbin "baserom.gba", 0x614260, 0x4 - -gUnknown_08614264:: @ 8614264 - .incbin "baserom.gba", 0x614264, 0x4 - -gUnknown_08614268:: @ 8614268 - .incbin "baserom.gba", 0x614268, 0x4 - -gUnknown_0861426C:: @ 861426C - .incbin "baserom.gba", 0x61426c, 0x4 - -gUnknown_08614270:: @ 8614270 - .incbin "baserom.gba", 0x614270, 0x4 - -gUnknown_08614274:: @ 8614274 - .incbin "baserom.gba", 0x614274, 0x4 - -gUnknown_08614278:: @ 8614278 - .incbin "baserom.gba", 0x614278, 0x18 - -gUnknown_08614290:: @ 8614290 - .incbin "baserom.gba", 0x614290, 0x18 - -gUnknown_086142A8:: @ 86142A8 - .incbin "baserom.gba", 0x6142a8, 0x20 - -gUnknown_086142C8:: @ 86142C8 - .incbin "baserom.gba", 0x6142c8, 0x70 - -gUnknown_08614338:: @ 8614338 - .incbin "baserom.gba", 0x614338, 0x40 - -gUnknown_08614378:: @ 8614378 - .incbin "baserom.gba", 0x614378, 0x44 - -gUnknown_086143BC:: @ 86143BC - .incbin "baserom.gba", 0x6143bc, 0x4e - -gUnknown_0861440A:: @ 861440A - .incbin "baserom.gba", 0x61440a, 0x4 - -gUnknown_0861440E:: @ 861440E - .incbin "baserom.gba", 0x61440e, 0x2 - -@ 8614410 - .include "data/graphics/items/item_icon_table.inc" - -@ 8614FE0 - .incbin "baserom.gba", 0x614fe0, 0x14 - -gUnknown_08614FF4:: @ 8614FF4 - .incbin "baserom.gba", 0x614ff4, 0x18 - -gUnknown_0861500C:: @ 861500C - .incbin "baserom.gba", 0x61500c, 0x3c - -gUnknown_08615048:: @ 8615048 - .incbin "baserom.gba", 0x615048, 0x670 - -gUnknown_086156B8:: @ 86156B8 - .incbin "baserom.gba", 0x6156b8, 0x2c - -gUnknown_086156E4:: @ 86156E4 - .incbin "baserom.gba", 0x6156e4, 0x20 - -gUnknown_08615704:: @ 8615704 - .incbin "baserom.gba", 0x615704, 0xc0 - -gUnknown_086157C4:: @ 86157C4 - .incbin "baserom.gba", 0x6157c4, 0x1c - -gUnknown_086157E0:: @ 86157E0 - .incbin "baserom.gba", 0x6157e0, 0x1c - -gUnknown_086157FC:: @ 86157FC - .incbin "baserom.gba", 0x6157fc, 0x14 - -gUnknown_08615810:: @ 8615810 - .incbin "baserom.gba", 0x615810, 0x40 - -gUnknown_08615850:: @ 8615850 - .incbin "baserom.gba", 0x615850, 0x40 - -gUnknown_08615890:: @ 8615890 - .incbin "baserom.gba", 0x615890, 0x40 - -gUnknown_086158D0:: @ 86158D0 - .incbin "baserom.gba", 0x6158d0, 0x38 - -gUnknown_08615908:: @ 8615908 - .incbin "baserom.gba", 0x615908, 0x8 - -gUnknown_08615910:: @ 8615910 - .incbin "baserom.gba", 0x615910, 0x8 - -gUnknown_08615918:: @ 8615918 - .incbin "baserom.gba", 0x615918, 0x8 - -gUnknown_08615920:: @ 8615920 - .incbin "baserom.gba", 0x615920, 0x8 - -gUnknown_08615928:: @ 8615928 - .incbin "baserom.gba", 0x615928, 0x8 - -gUnknown_08615930:: @ 8615930 - .incbin "baserom.gba", 0x615930, 0x8 - -gUnknown_08615938:: @ 8615938 - .incbin "baserom.gba", 0x615938, 0x8 - -gUnknown_08615940:: @ 8615940 - .incbin "baserom.gba", 0x615940, 0x8 - -gUnknown_08615948:: @ 8615948 - .incbin "baserom.gba", 0x615948, 0x8 - -gUnknown_08615950:: @ 8615950 - .incbin "baserom.gba", 0x615950, 0x8 - -gUnknown_08615958:: @ 8615958 - .incbin "baserom.gba", 0x615958, 0x8 - -gUnknown_08615960:: @ 8615960 - .incbin "baserom.gba", 0x615960, 0x8 - -gUnknown_08615968:: @ 8615968 - .incbin "baserom.gba", 0x615968, 0x8 - -gUnknown_08615970:: @ 8615970 - .incbin "baserom.gba", 0x615970, 0x18 - -gUnknown_08615988:: @ 8615988 - .incbin "baserom.gba", 0x615988, 0x46 - -gUnknown_086159CE:: @ 86159CE - .incbin "baserom.gba", 0x6159ce, 0x46 - -gUnknown_08615A14:: @ 8615A14 - .incbin "baserom.gba", 0x615a14, 0x36 - -gUnknown_08615A4A:: @ 8615A4A - .incbin "baserom.gba", 0x615a4a, 0x36 - -gUnknown_08615A80:: @ 8615A80 - .incbin "baserom.gba", 0x615a80, 0x36 - -gUnknown_08615AB6:: @ 8615AB6 - .incbin "baserom.gba", 0x615ab6, 0x2 - -gUnknown_08615AB8:: @ 8615AB8 - .incbin "baserom.gba", 0x615ab8, 0x2 - -gUnknown_08615ABA:: @ 8615ABA - .incbin "baserom.gba", 0x615aba, 0x3 - -gUnknown_08615ABD:: @ 8615ABD - .incbin "baserom.gba", 0x615abd, 0x3 - -gUnknown_08615AC0:: @ 8615AC0 - .incbin "baserom.gba", 0x615ac0, 0x3 - -gUnknown_08615AC3:: @ 8615AC3 - .incbin "baserom.gba", 0x615ac3, 0x2 - -gUnknown_08615AC5:: @ 8615AC5 - .incbin "baserom.gba", 0x615ac5, 0x2 - -gUnknown_08615AC7:: @ 8615AC7 - .incbin "baserom.gba", 0x615ac7, 0x2 - -gUnknown_08615AC9:: @ 8615AC9 - .incbin "baserom.gba", 0x615ac9, 0x2 - -gUnknown_08615ACB:: @ 8615ACB - .incbin "baserom.gba", 0x615acb, 0x2 - -gUnknown_08615ACD:: @ 8615ACD - .incbin "baserom.gba", 0x615acd, 0x3 - -gUnknown_08615AD0:: @ 8615AD0 - .incbin "baserom.gba", 0x615ad0, 0x3 - -gUnknown_08615AD3:: @ 8615AD3 - .incbin "baserom.gba", 0x615ad3, 0x3 - -gUnknown_08615AD6:: @ 8615AD6 - .incbin "baserom.gba", 0x615ad6, 0x3 - -gUnknown_08615AD9:: @ 8615AD9 - .incbin "baserom.gba", 0x615ad9, 0x3 - -gUnknown_08615ADC:: @ 8615ADC - .incbin "baserom.gba", 0x615adc, 0x3 - -gUnknown_08615ADF:: @ 8615ADF - .incbin "baserom.gba", 0x615adf, 0x3 - -gUnknown_08615AE2:: @ 8615AE2 - .incbin "baserom.gba", 0x615ae2, 0x3 - -gUnknown_08615AE5:: @ 8615AE5 - .incbin "baserom.gba", 0x615ae5, 0x3 - -gUnknown_08615AE8:: @ 8615AE8 - .incbin "baserom.gba", 0x615ae8, 0x3 - -gUnknown_08615AEB:: @ 8615AEB - .incbin "baserom.gba", 0x615aeb, 0x3 - -gUnknown_08615AEE:: @ 8615AEE - .incbin "baserom.gba", 0x615aee, 0x3 - -gUnknown_08615AF1:: @ 8615AF1 - .incbin "baserom.gba", 0x615af1, 0x3 - -gUnknown_08615AF4:: @ 8615AF4 - .incbin "baserom.gba", 0x615af4, 0x6c - -gUnknown_08615B60:: @ 8615B60 - .incbin "baserom.gba", 0x615b60, 0xa8 - -gUnknown_08615C08:: @ 8615C08 - .incbin "baserom.gba", 0x615c08, 0x130 - -gUnknown_08615D38:: @ 8615D38 - .incbin "baserom.gba", 0x615d38, 0x38 - -gUnknown_08615D70:: @ 8615D70 - .incbin "baserom.gba", 0x615d70, 0xe - -gUnknown_08615D7E:: @ 8615D7E - .incbin "baserom.gba", 0x615d7e, 0x1e - -gUnknown_08615D9C:: @ 8615D9C - .incbin "baserom.gba", 0x615d9c, 0x70 - -gUnknown_08615E0C:: @ 8615E0C - .incbin "baserom.gba", 0x615e0c, 0xa4 - -gUnknown_08615EB0:: @ 8615EB0 - .incbin "baserom.gba", 0x615eb0, 0x8 - -gUnknown_08615EB8:: @ 8615EB8 - .incbin "baserom.gba", 0x615eb8, 0x8 - -gUnknown_08615EC0:: @ 8615EC0 - .incbin "baserom.gba", 0x615ec0, 0x38 - -gUnknown_08615EF8:: @ 8615EF8 - .incbin "baserom.gba", 0x615ef8, 0x8 - -gUnknown_08615F00:: @ 8615F00 - .incbin "baserom.gba", 0x615f00, 0x8 - -gUnknown_08615F08:: @ 8615F08 - .incbin "baserom.gba", 0x615f08, 0x68 - -gUnknown_08615F70:: @ 8615F70 - .incbin "baserom.gba", 0x615f70, 0x8 - -gUnknown_08615F78:: @ 8615F78 - .incbin "baserom.gba", 0x615f78, 0x80 - -gUnknown_08615FF8:: @ 8615FF8 - .incbin "baserom.gba", 0x615ff8, 0x8 - -gUnknown_08616000:: @ 8616000 - .incbin "baserom.gba", 0x616000, 0x8 - -gUnknown_08616008:: @ 8616008 - .incbin "baserom.gba", 0x616008, 0x18 - -gUnknown_08616020:: @ 8616020 - .incbin "baserom.gba", 0x616020, 0x20 - -gUnknown_08616040:: @ 8616040 - .incbin "baserom.gba", 0x616040, 0x74 - -gUnknown_086160B4:: @ 86160B4 - .incbin "baserom.gba", 0x6160b4, 0x20 - -gUnknown_086160D4:: @ 86160D4 - .incbin "baserom.gba", 0x6160d4, 0x4 - -gUnknown_086160D8:: @ 86160D8 - .incbin "baserom.gba", 0x6160d8, 0x1c - -gUnknown_086160F4:: @ 86160F4 - .incbin "baserom.gba", 0x6160f4, 0x4 - -gUnknown_086160F8:: @ 86160F8 - .incbin "baserom.gba", 0x6160f8, 0x28 - -gUnknown_08616120:: @ 8616120 - .incbin "baserom.gba", 0x616120, 0x4 - -gUnknown_08616124:: @ 8616124 - .incbin "baserom.gba", 0x616124, 0x4 - - .align 2 -gFont6BrailleGlyphs:: @ 8616128 - .incbin "data/graphics/fonts/font6.fwjpnfont" - -gUnknown_08617128:: @ 8617128 - .incbin "baserom.gba", 0x617128, 0x48 - -gPlayerPartnerBufferCommands:: @ 8617170 - .incbin "baserom.gba", 0x617170, 0x104 - -gUnknown_08617274:: @ 8617274 - .incbin "baserom.gba", 0x617274, 0x920 - -gUnknown_08617B94:: @ 8617B94 - .incbin "baserom.gba", 0x617b94, 0xb0 - -gUnknown_08617C44:: @ 8617C44 - .incbin "baserom.gba", 0x617c44, 0x120 - -gUnknown_08617D64:: @ 8617D64 - .incbin "baserom.gba", 0x617d64, 0x30 - -gUnknown_08617D94:: @ 8617D94 - .incbin "baserom.gba", 0x617d94, 0x10 - -gUnknown_08617DA4:: @ 8617DA4 - .incbin "baserom.gba", 0x617da4, 0x5c - -gUnknown_08617E00:: @ 8617E00 - .incbin "baserom.gba", 0x617e00, 0x18 - -gUnknown_08617E18:: @ 8617E18 - .incbin "baserom.gba", 0x617e18, 0x1c - -gUnknown_08617E34:: @ 8617E34 - .incbin "baserom.gba", 0x617e34, 0x2c - -gUnknown_08617E60:: @ 8617E60 - .incbin "baserom.gba", 0x617e60, 0x18 - -gUnknown_08617E78:: @ 8617E78 - .incbin "baserom.gba", 0x617e78, 0x15 - -gUnknown_08617E8D:: @ 8617E8D - .incbin "baserom.gba", 0x617e8d, 0xe - -gUnknown_08617E9B:: @ 8617E9B - .incbin "baserom.gba", 0x617e9b, 0x26d - -gUnknown_08618108:: @ 8618108 - .incbin "baserom.gba", 0x618108, 0x8 - -gUnknown_08618110:: @ 8618110 - .incbin "baserom.gba", 0x618110, 0x28 - -gUnknown_08618138:: @ 8618138 - .incbin "baserom.gba", 0x618138, 0x20 - -gUnknown_08618158:: @ 8618158 - .incbin "baserom.gba", 0x618158, 0x3 - -gUnknown_0861815B:: @ 861815B - .incbin "baserom.gba", 0x61815b, 0x5 - -gUnknown_08618160:: @ 8618160 - .incbin "baserom.gba", 0x618160, 0x18 - -gUnknown_08618178:: @ 8618178 - .incbin "baserom.gba", 0x618178, 0x49 - -@ 86181C1 - .include "data/text/move_descriptions.inc" - -@ 861CAAC - .include "data/text/nature_names.inc" - -gUnknown_0861CBB4:: @ 861CBB4 - .incbin "baserom.gba", 0x61cbb4, 0x38 - -gUnknown_0861CBEC:: @ 861CBEC - .incbin "baserom.gba", 0x61cbec, 0xc - -gUnknown_0861CBF8:: @ 861CBF8 - .incbin "baserom.gba", 0x61cbf8, 0xc - -gUnknown_0861CC04:: @ 861CC04 - .incbin "baserom.gba", 0x61cc04, 0xc - -gUnknown_0861CC10:: @ 861CC10 - .incbin "baserom.gba", 0x61cc10, 0xc - -gUnknown_0861CC1C:: @ 861CC1C - .incbin "baserom.gba", 0x61cc1c, 0x8 - -gUnknown_0861CC24:: @ 861CC24 - .incbin "baserom.gba", 0x61cc24, 0xa8 - -gUnknown_0861CCCC:: @ 861CCCC - .incbin "baserom.gba", 0x61cccc, 0x20 - -gUnknown_0861CCEC:: @ 861CCEC - .incbin "baserom.gba", 0x61ccec, 0x28 - -gUnknown_0861CD14:: @ 861CD14 - .incbin "baserom.gba", 0x61cd14, 0x18 - -gUnknown_0861CD2C:: @ 861CD2C - .incbin "baserom.gba", 0x61cd2c, 0xa7 - -gUnknown_0861CDD3:: @ 861CDD3 - .incbin "baserom.gba", 0x61cdd3, 0x81 - -gUnknown_0861CE54:: @ 861CE54 - .incbin "baserom.gba", 0x61ce54, 0x10 - -gUnknown_0861CE64:: @ 861CE64 - .incbin "baserom.gba", 0x61ce64, 0x10 - -gUnknown_0861CE74:: @ 861CE74 - .incbin "baserom.gba", 0x61ce74, 0x7 - -gUnknown_0861CE7B:: @ 861CE7B - .incbin "baserom.gba", 0x61ce7b, 0x7 - -gUnknown_0861CE82:: @ 861CE82 - .incbin "baserom.gba", 0x61ce82, 0xc - -gUnknown_0861CE8E:: @ 861CE8E - .incbin "baserom.gba", 0x61ce8e, 0x9 - -gUnknown_0861CE97:: @ 861CE97 - .incbin "baserom.gba", 0x61ce97, 0x125 - -gUnknown_0861CFBC:: @ 861CFBC - .incbin "baserom.gba", 0x61cfbc, 0x8 - -gUnknown_0861CFC4:: @ 861CFC4 - .incbin "baserom.gba", 0x61cfc4, 0x18 - -gUnknown_0861CFDC:: @ 861CFDC - .incbin "baserom.gba", 0x61cfdc, 0x98 - -gUnknown_0861D074:: @ 861D074 - .incbin "baserom.gba", 0x61d074, 0x8 - -gUnknown_0861D07C:: @ 861D07C - .incbin "baserom.gba", 0x61d07c, 0x8 - -gUnknown_0861D084:: @ 861D084 - .incbin "baserom.gba", 0x61d084, 0x74 - -gUnknown_0861D0F8:: @ 861D0F8 - .incbin "baserom.gba", 0x61d0f8, 0x8 - -gUnknown_0861D100:: @ 861D100 - .incbin "baserom.gba", 0x61d100, 0x8 - -gUnknown_0861D108:: @ 861D108 - .incbin "baserom.gba", 0x61d108, 0x18 - -gUnknown_0861D120:: @ 861D120 - .incbin "baserom.gba", 0x61d120, 0x20 - -gUnknown_0861D140:: @ 861D140 - .incbin "baserom.gba", 0x61d140, 0x60 - -gUnknown_0861D1A0:: @ 861D1A0 - .incbin "baserom.gba", 0x61d1a0, 0xd54 - -gUnknown_0861DEF4:: @ 861DEF4 - .incbin "baserom.gba", 0x61def4, 0x314 - -gUnknown_0861E208:: @ 861E208 - .incbin "baserom.gba", 0x61e208, 0xd5c - -gUnknown_0861EF64:: @ 861EF64 - .incbin "baserom.gba", 0x61ef64, 0x350 - -gUnknown_0861F2B4:: @ 861F2B4 - .incbin "baserom.gba", 0x61f2b4, 0xc - -gUnknown_0861F2C0:: @ 861F2C0 - .incbin "baserom.gba", 0x61f2c0, 0x18 - -gUnknown_0861F2D8:: @ 861F2D8 - .incbin "baserom.gba", 0x61f2d8, 0x30 - -gUnknown_0861F308:: @ 861F308 - .incbin "baserom.gba", 0x61f308, 0x4 - -gUnknown_0861F30C:: @ 861F30C - .incbin "baserom.gba", 0x61f30c, 0x2 - -gUnknown_0861F30E:: @ 861F30E - .incbin "baserom.gba", 0x61f30e, 0x2 - -gUnknown_0861F310:: @ 861F310 - .incbin "baserom.gba", 0x61f310, 0x4 - -gUnknown_0861F314:: @ 861F314 - .incbin "baserom.gba", 0x61f314, 0x8 - -gUnknown_0861F31C:: @ 861F31C - .incbin "baserom.gba", 0x61f31c, 0xc - -gUnknown_0861F328:: @ 861F328 - .incbin "baserom.gba", 0x61f328, 0x28 - -gUnknown_0861F350:: @ 861F350 - .incbin "baserom.gba", 0x61f350, 0x20 - -gUnknown_0861F370:: @ 861F370 - .incbin "baserom.gba", 0x61f370, 0x5c - -gUnknown_0861F3CC:: @ 861F3CC - .incbin "baserom.gba", 0x61f3cc, 0x8 - -gUnknown_0861F3D4:: @ 861F3D4 - .incbin "baserom.gba", 0x61f3d4, 0x18 - -gUnknown_0861F3EC:: @ 861F3EC - .incbin "baserom.gba", 0x61f3ec, 0x618 - -gUnknown_0861FA04:: @ 861FA04 - .incbin "baserom.gba", 0x61fa04, 0x4 - -gUnknown_0861FA08:: @ 861FA08 - .incbin "baserom.gba", 0x61fa08, 0x10 - -gUnknown_0861FA18:: @ 861FA18 - .incbin "baserom.gba", 0x61fa18, 0x30 - -gUnknown_0861FA48:: @ 861FA48 - .incbin "baserom.gba", 0x61fa48, 0x4 - -gUnknown_0861FA4C:: @ 861FA4C - .incbin "baserom.gba", 0x61fa4c, 0x8 - -gUnknown_0861FA54:: @ 861FA54 - .incbin "baserom.gba", 0x61fa54, 0x10 - -gUnknown_0861FA64:: @ 861FA64 - .incbin "baserom.gba", 0x61fa64, 0x8 - -gUnknown_0861FA6C:: @ 861FA6C - .incbin "baserom.gba", 0x61fa6c, 0x30 - -gUnknown_0861FA9C:: @ 861FA9C - .incbin "baserom.gba", 0x61fa9c, 0x68 - -gUnknown_0861FB04:: @ 861FB04 - .incbin "baserom.gba", 0x61fb04, 0x28 - -gUnknown_0861FB2C:: @ 861FB2C - .incbin "baserom.gba", 0x61fb2c, 0x18 - -gUnknown_0861FB44:: @ 861FB44 - .incbin "baserom.gba", 0x61fb44, 0xa0 - -gUnknown_0861FBE4:: @ 861FBE4 - .incbin "baserom.gba", 0x61fbe4, 0x4 - -gUnknown_0861FBE8:: @ 861FBE8 - .incbin "baserom.gba", 0x61fbe8, 0xc - -gUnknown_0861FBF4:: @ 861FBF4 - .incbin "baserom.gba", 0x61fbf4, 0x3 - -gUnknown_0861FBF7:: @ 861FBF7 - .incbin "baserom.gba", 0x61fbf7, 0x5 - -gUnknown_0861FBFC:: @ 861FBFC - .incbin "baserom.gba", 0x61fbfc, 0x8 - -gUnknown_0861FC04:: @ 861FC04 - .incbin "baserom.gba", 0x61fc04, 0x18 - -gUnknown_0861FC1C:: @ 861FC1C - .incbin "baserom.gba", 0x61fc1c, 0x20 - -gUnknown_0861FC3C:: @ 861FC3C - .incbin "baserom.gba", 0x61fc3c, 0x18 - -gUnknown_0861FC54:: @ 861FC54 - .incbin "baserom.gba", 0x61fc54, 0x5 - -gUnknown_0861FC59:: @ 861FC59 - .incbin "baserom.gba", 0x61fc59, 0x1f - -gUnknown_0861FC78:: @ 861FC78 - .incbin "baserom.gba", 0x61fc78, 0x2 - -gUnknown_0861FC7A:: @ 861FC7A - .incbin "baserom.gba", 0x61fc7a, 0xc - -gUnknown_0861FC86:: @ 861FC86 - .incbin "baserom.gba", 0x61fc86, 0x12 - -gUnknown_0861FC98:: @ 861FC98 - .incbin "baserom.gba", 0x61fc98, 0x14 - -gUnknown_0861FCAC:: @ 861FCAC - .incbin "baserom.gba", 0x61fcac, 0xa0 - -gUnknown_0861FD4C:: @ 861FD4C - .incbin "baserom.gba", 0x61fd4c, 0x20 - -gUnknown_0861FD6C:: @ 861FD6C - .incbin "baserom.gba", 0x61fd6c, 0x288 - -gUnknown_0861FFF4:: @ 861FFF4 - .incbin "baserom.gba", 0x61fff4, 0x1a0 - -gUnknown_08620194:: @ 8620194 - .incbin "baserom.gba", 0x620194, 0xc - -gUnknown_086201A0:: @ 86201A0 - .incbin "baserom.gba", 0x6201a0, 0x24 - -gUnknown_086201C4:: @ 86201C4 - .incbin "baserom.gba", 0x6201c4, 0x10 - -gUnknown_086201D4:: @ 86201D4 - .incbin "baserom.gba", 0x6201d4, 0x6c - -gUnknown_08620240:: @ 8620240 - .incbin "baserom.gba", 0x620240, 0x4 - -gUnknown_08620244:: @ 8620244 - .incbin "baserom.gba", 0x620244, 0x88 - -gUnknown_086202CC:: @ 86202CC - .incbin "baserom.gba", 0x6202cc, 0x8 - -gUnknown_086202D4:: @ 86202D4 - .incbin "baserom.gba", 0x6202d4, 0x38 - -gUnknown_0862030C:: @ 862030C - .incbin "baserom.gba", 0x62030c, 0x3 - -gUnknown_0862030F:: @ 862030F - .incbin "baserom.gba", 0x62030f, 0x3d - -gUnknown_0862034C:: @ 862034C - .incbin "baserom.gba", 0x62034c, 0x20 - -gUnknown_0862036C:: @ 862036C - .incbin "baserom.gba", 0x62036c, 0x18 - -gUnknown_08620384:: @ 8620384 - .incbin "baserom.gba", 0x620384, 0x1ca4 - -gUnknown_08622028:: @ 8622028 - .incbin "baserom.gba", 0x622028, 0x4e0 - -gUnknown_08622508:: @ 8622508 - .incbin "baserom.gba", 0x622508, 0x2 - -gUnknown_0862250A:: @ 862250A - .incbin "baserom.gba", 0x62250a, 0x6 - -gUnknown_08622510:: @ 8622510 - .incbin "baserom.gba", 0x622510, 0x20 - -gUnknown_08622530:: @ 8622530 - .incbin "baserom.gba", 0x622530, 0xa4 - -gUnknown_086225D4:: @ 86225D4 - .incbin "baserom.gba", 0x6225d4, 0x10c - -gUnknown_086226E0:: @ 86226E0 - .incbin "baserom.gba", 0x6226e0, 0x20 - -gUnknown_08622700:: @ 8622700 - .incbin "baserom.gba", 0x622700, 0x20 - -gUnknown_08622720:: @ 8622720 - .incbin "baserom.gba", 0x622720, 0x40 - -gUnknown_08622760:: @ 8622760 - .incbin "baserom.gba", 0x622760, 0x2c - -gUnknown_0862278C:: @ 862278C - .incbin "baserom.gba", 0x62278c, 0x8 - -gUnknown_08622794:: @ 8622794 - .incbin "baserom.gba", 0x622794, 0x4 - -gUnknown_08622798:: @ 8622798 - .incbin "baserom.gba", 0x622798, 0x40 - -gUnknown_086227D8:: @ 86227D8 - .incbin "baserom.gba", 0x6227d8, 0x8 - -gUnknown_086227E0:: @ 86227E0 - .incbin "baserom.gba", 0x6227e0, 0x8 - -gUnknown_086227E8:: @ 86227E8 - .incbin "baserom.gba", 0x6227e8, 0xc - -gUnknown_086227F4:: @ 86227F4 - .incbin "baserom.gba", 0x6227f4, 0x14 - -gUnknown_08622808:: @ 8622808 - .incbin "baserom.gba", 0x622808, 0x8 - -gUnknown_08622810:: @ 8622810 - .incbin "baserom.gba", 0x622810, 0x8 - -gUnknown_08622818:: @ 8622818 - .incbin "baserom.gba", 0x622818, 0x18 - -gUnknown_08622830:: @ 8622830 - .incbin "baserom.gba", 0x622830, 0x20 - -gUnknown_08622850:: @ 8622850 - .incbin "baserom.gba", 0x622850, 0x18 - -gUnknown_08622868:: @ 8622868 - .incbin "baserom.gba", 0x622868, 0x20 - -gUnknown_08622888:: @ 8622888 - .incbin "baserom.gba", 0x622888, 0x850 - -gUnknown_086230D8:: @ 86230D8 - .incbin "baserom.gba", 0x6230d8, 0xc - -gUnknown_086230E4:: @ 86230E4 - .incbin "baserom.gba", 0x6230e4, 0x14 - -gUnknown_086230F8:: @ 86230F8 - .incbin "baserom.gba", 0x6230f8, 0x8 - -gUnknown_08623100:: @ 8623100 - .incbin "baserom.gba", 0x623100, 0x10 - -gUnknown_08623110:: @ 8623110 - .incbin "baserom.gba", 0x623110, 0x8 - -gUnknown_08623118:: @ 8623118 - .incbin "baserom.gba", 0x623118, 0xb8 - -gUnknown_086231D0:: @ 86231D0 - .incbin "baserom.gba", 0x6231d0, 0x18 - -gUnknown_086231E8:: @ 86231E8 - .incbin "baserom.gba", 0x6231e8, 0x20 - -gUnknown_08623208:: @ 8623208 - .incbin "baserom.gba", 0x623208, 0x20 - -gUnknown_08623228:: @ 8623228 - .incbin "baserom.gba", 0x623228, 0x14 - -gUnknown_0862323C:: @ 862323C - .incbin "baserom.gba", 0x62323c, 0xfc - -gUnknown_08623338:: @ 8623338 - .incbin "baserom.gba", 0x623338, 0x20 - -gUnknown_08623358:: @ 8623358 - .incbin "baserom.gba", 0x623358, 0xc - -gUnknown_08623364:: @ 8623364 - .incbin "baserom.gba", 0x623364, 0x8 - -gUnknown_0862336C:: @ 862336C - .incbin "baserom.gba", 0x62336c, 0x8 - -gUnknown_08623374:: @ 8623374 - .incbin "baserom.gba", 0x623374, 0x8 - -gUnknown_0862337C:: @ 862337C - .incbin "baserom.gba", 0x62337c, 0x8 - -gUnknown_08623384:: @ 8623384 - .incbin "baserom.gba", 0x623384, 0x1c - -gUnknown_086233A0:: @ 86233A0 - .incbin "baserom.gba", 0x6233a0, 0x14 - -gUnknown_086233B4:: @ 86233B4 - .incbin "baserom.gba", 0x6233b4, 0x10 - -gUnknown_086233C4:: @ 86233C4 - .incbin "baserom.gba", 0x6233c4, 0x20 - -gUnknown_086233E4:: @ 86233E4 - .incbin "baserom.gba", 0x6233e4, 0xc8 - -gUnknown_086234AC:: @ 86234AC - .incbin "baserom.gba", 0x6234ac, 0xc4 - -gUnknown_08623570:: @ 8623570 - .incbin "baserom.gba", 0x623570, 0x20 - -gUnknown_08623590:: @ 8623590 - .incbin "baserom.gba", 0x623590, 0x4 - -gUnknown_08623594:: @ 8623594 - .incbin "baserom.gba", 0x623594, 0x4 - -gUnknown_08623598:: @ 8623598 - .incbin "baserom.gba", 0x623598, 0x1c - -gUnknown_086235B4:: @ 86235B4 - .incbin "baserom.gba", 0x6235b4, 0x8 - -gUnknown_086235BC:: @ 86235BC - .incbin "baserom.gba", 0x6235bc, 0xc - -gUnknown_086235C8:: @ 86235C8 - .incbin "baserom.gba", 0x6235c8, 0xc - -gUnknown_086235D4:: @ 86235D4 - .incbin "baserom.gba", 0x6235d4, 0x4 - -gUnknown_086235D8:: @ 86235D8 - .incbin "baserom.gba", 0x6235d8, 0xc - -gUnknown_086235E4:: @ 86235E4 - .incbin "baserom.gba", 0x6235e4, 0x20 - -gUnknown_08623604:: @ 8623604 - .incbin "baserom.gba", 0x623604, 0xc8 - -gUnknown_086236CC:: @ 86236CC - .incbin "baserom.gba", 0x6236cc, 0xc4 - -gUnknown_08623790:: @ 8623790 - .incbin "baserom.gba", 0x623790, 0x20 - -gUnknown_086237B0:: @ 86237B0 - .incbin "baserom.gba", 0x6237b0, 0x4 - -gUnknown_086237B4:: @ 86237B4 - .incbin "baserom.gba", 0x6237b4, 0x4 - -gUnknown_086237B8:: @ 86237B8 - .incbin "baserom.gba", 0x6237b8, 0x1c - -gUnknown_086237D4:: @ 86237D4 - .incbin "baserom.gba", 0x6237d4, 0x8 - -gUnknown_086237DC:: @ 86237DC - .incbin "baserom.gba", 0x6237dc, 0xc - -gUnknown_086237E8:: @ 86237E8 - .incbin "baserom.gba", 0x6237e8, 0xc - -gUnknown_086237F4:: @ 86237F4 - .incbin "baserom.gba", 0x6237f4, 0x4 - -gUnknown_086237F8:: @ 86237F8 - .incbin "baserom.gba", 0x6237f8, 0x44 - -@ 862383C - .include "data/text/ribbon_descriptions.inc" - -@ 8623A74 - .include "data/text/gift_ribbon_descriptions.inc" - -gUnknown_08623FF8:: @ 8623FF8 - .incbin "baserom.gba", 0x623ff8, 0xa0 - -gUnknown_08624098:: @ 8624098 - .incbin "baserom.gba", 0x624098, 0x20 - -gUnknown_086240B8:: @ 86240B8 - .incbin "baserom.gba", 0x6240b8, 0xae0 - -gUnknown_08624B98:: @ 8624B98 - .incbin "baserom.gba", 0x624b98, 0x8 - -gUnknown_08624BA0:: @ 8624BA0 - .incbin "baserom.gba", 0x624ba0, 0x18 - -gUnknown_08624BB8:: @ 8624BB8 - .incbin "baserom.gba", 0x624bb8, 0x8 - -gUnknown_08624BC0:: @ 8624BC0 - .incbin "baserom.gba", 0x624bc0, 0x4 - -gUnknown_08624BC4:: @ 8624BC4 - .incbin "baserom.gba", 0x624bc4, 0x8 - -gUnknown_08624BCC:: @ 8624BCC - .incbin "baserom.gba", 0x624bcc, 0xc - -gUnknown_08624BD8:: @ 8624BD8 - .incbin "baserom.gba", 0x624bd8, 0xc - -gUnknown_08624BE4:: @ 8624BE4 - .incbin "baserom.gba", 0x624be4, 0x4 - -gUnknown_08624BE8:: @ 8624BE8 - .incbin "baserom.gba", 0x624be8, 0x10 - -gUnknown_08624BF8:: @ 8624BF8 - .incbin "baserom.gba", 0x624bf8, 0x80 - -gUnknown_08624C78:: @ 8624C78 - .incbin "baserom.gba", 0x624c78, 0x8 - -gUnknown_08624C80:: @ 8624C80 - .incbin "baserom.gba", 0x624c80, 0x84 - -gUnknown_08624D04:: @ 8624D04 - .incbin "baserom.gba", 0x624d04, 0x5a4 - -gUnknown_086252A8:: @ 86252A8 - .incbin "baserom.gba", 0x6252a8, 0x54 - -gUnknown_086252FC:: @ 86252FC - .incbin "baserom.gba", 0x6252fc, 0x14 - -gUnknown_08625310:: @ 8625310 - .incbin "baserom.gba", 0x625310, 0x14 - -gUnknown_08625324:: @ 8625324 - .incbin "baserom.gba", 0x625324, 0x14 - -gUnknown_08625338:: @ 8625338 - .incbin "baserom.gba", 0x625338, 0x14 - -gUnknown_0862534C:: @ 862534C - .incbin "baserom.gba", 0x62534c, 0x14 - -gUnknown_08625360:: @ 8625360 - .incbin "baserom.gba", 0x625360, 0x14 - -gUnknown_08625374:: @ 8625374 - .incbin "baserom.gba", 0x625374, 0x14 - -gUnknown_08625388:: @ 8625388 - .incbin "baserom.gba", 0x625388, 0x60 - -gUnknown_086253E8:: @ 86253E8 - .incbin "baserom.gba", 0x6253e8, 0x18 - -gUnknown_08625400:: @ 8625400 - .incbin "baserom.gba", 0x625400, 0x3 - -gUnknown_08625403:: @ 8625403 - .incbin "baserom.gba", 0x625403, 0x1 - -gUnknown_08625404:: @ 8625404 - .incbin "baserom.gba", 0x625404, 0xc - -gUnknown_08625410:: @ 8625410 - .incbin "baserom.gba", 0x625410, 0x100 - -gUnknown_08625510:: @ 8625510 - .incbin "baserom.gba", 0x625510, 0x30 - -gUnknown_08625540:: @ 8625540 - .incbin "baserom.gba", 0x625540, 0x8 - -gUnknown_08625548:: @ 8625548 - .incbin "baserom.gba", 0x625548, 0x500 - -gUnknown_08625A48:: @ 8625A48 - .incbin "baserom.gba", 0x625a48, 0x8 - -gUnknown_08625A50:: @ 8625A50 - .incbin "baserom.gba", 0x625a50, 0x18 - -gUnknown_08625A68:: @ 8625A68 - .incbin "baserom.gba", 0x625a68, 0x8 - -gUnknown_08625A70:: @ 8625A70 - .incbin "baserom.gba", 0x625a70, 0x20 - -gUnknown_08625A90:: @ 8625A90 - .incbin "baserom.gba", 0x625a90, 0x18 - -gUnknown_08625AA8:: @ 8625AA8 - .incbin "baserom.gba", 0x625aa8, 0x18 - -gUnknown_08625AC0:: @ 8625AC0 - .incbin "baserom.gba", 0x625ac0, 0x8 - -gUnknown_08625AC8:: @ 8625AC8 - .incbin "baserom.gba", 0x625ac8, 0x4c - -gUnknown_08625B14:: @ 8625B14 - .incbin "baserom.gba", 0x625b14, 0x18 - -gUnknown_08625B2C:: @ 8625B2C - .incbin "baserom.gba", 0x625b2c, 0x28 - -gUnknown_08625B54:: @ 8625B54 - .incbin "baserom.gba", 0x625b54, 0x18 - -gUnknown_08625B6C:: @ 8625B6C - .incbin "baserom.gba", 0x625b6c, 0x520 - -gUnknown_0862608C:: @ 862608C - .incbin "baserom.gba", 0x62608c, 0x2 - -gUnknown_0862608E:: @ 862608E - .incbin "baserom.gba", 0x62608e, 0x4326 - -gUnknown_0862A3B4:: @ 862A3B4 - .incbin "baserom.gba", 0x62a3b4, 0x218 - -gUnknown_0862A5CC:: @ 862A5CC - .incbin "baserom.gba", 0x62a5cc, 0x8 - -gUnknown_0862A5D4:: @ 862A5D4 - .incbin "baserom.gba", 0x62a5d4, 0x20 - -gUnknown_0862A5F4:: @ 862A5F4 - .incbin "baserom.gba", 0x62a5f4, 0x4 - -gUnknown_0862A5F8:: @ 862A5F8 - .incbin "baserom.gba", 0x62a5f8, 0x20 - -gUnknown_0862A618:: @ 862A618 - .incbin "baserom.gba", 0x62a618, 0x48 - -gUnknown_0862A660:: @ 862A660 - .incbin "baserom.gba", 0x62a660, 0x10 - -gUnknown_0862A670:: @ 862A670 - .incbin "baserom.gba", 0x62a670, 0x18 - -gUnknown_0862A688:: @ 862A688 - .incbin "baserom.gba", 0x62a688, 0x10 - -gUnknown_0862A698:: @ 862A698 - .incbin "baserom.gba", 0x62a698, 0x8 - -gUnknown_0862A6A0:: @ 862A6A0 - .incbin "baserom.gba", 0x62a6a0, 0x8c - -gUnknown_0862A72C:: @ 862A72C - .incbin "baserom.gba", 0x62a72c, 0x24 - -gUnknown_0862A750:: @ 862A750 - .incbin "baserom.gba", 0x62a750, 0x24 - -gUnknown_0862A774:: @ 862A774 - .incbin "baserom.gba", 0x62a774, 0xa8 - -gUnknown_0862A81C:: @ 862A81C - .incbin "baserom.gba", 0x62a81c, 0x30 - -gUnknown_0862A84C:: @ 862A84C - .incbin "baserom.gba", 0x62a84c, 0x18 - -gUnknown_0862A864:: @ 862A864 - .incbin "baserom.gba", 0x62a864, 0x18 - -gUnknown_0862A87C:: @ 862A87C - .incbin "baserom.gba", 0x62a87c, 0xc - -gUnknown_0862A888:: @ 862A888 - .incbin "baserom.gba", 0x62a888, 0x3c - -gUnknown_0862A8C4:: @ 862A8C4 - .incbin "baserom.gba", 0x62a8c4, 0x8 - -gUnknown_0862A8CC:: @ 862A8CC - .incbin "baserom.gba", 0x62a8cc, 0x8 - -gUnknown_0862A8D4:: @ 862A8D4 - .incbin "baserom.gba", 0x62a8d4, 0x24 - -gUnknown_0862A8F8:: @ 862A8F8 - .incbin "baserom.gba", 0x62a8f8, 0x8 - -gUnknown_0862A900:: @ 862A900 - .incbin "baserom.gba", 0x62a900, 0x24 - -gUnknown_0862A924:: @ 862A924 - .incbin "baserom.gba", 0x62a924, 0x8 - -gUnknown_0862A92C:: @ 862A92C - .incbin "baserom.gba", 0x62a92c, 0xa8 - -gUnknown_0862A9D4:: @ 862A9D4 - .incbin "baserom.gba", 0x62a9d4, 0x8 - -gUnknown_0862A9DC:: @ 862A9DC - .incbin "baserom.gba", 0x62a9dc, 0x8 - -gUnknown_0862A9E4:: @ 862A9E4 - .incbin "baserom.gba", 0x62a9e4, 0x30 - -gUnknown_0862AA14:: @ 862AA14 - .incbin "baserom.gba", 0x62aa14, 0x8 - -gUnknown_0862AA1C:: @ 862AA1C - .incbin "baserom.gba", 0x62aa1c, 0x18 - -gUnknown_0862AA34:: @ 862AA34 - .incbin "baserom.gba", 0x62aa34, 0x8 - -gUnknown_0862AA3C:: @ 862AA3C - .incbin "baserom.gba", 0x62aa3c, 0x18 - -gUnknown_0862AA54:: @ 862AA54 - .incbin "baserom.gba", 0x62aa54, 0x3c - -gUnknown_0862AA90:: @ 862AA90 - .incbin "baserom.gba", 0x62aa90, 0x8 - -gUnknown_0862AA98:: @ 862AA98 - .incbin "baserom.gba", 0x62aa98, 0x8 - -gUnknown_0862AAA0:: @ 862AAA0 - .incbin "baserom.gba", 0x62aaa0, 0x18 - -gUnknown_0862AAB8:: @ 862AAB8 - .incbin "baserom.gba", 0x62aab8, 0x14 - -gUnknown_0862AACC:: @ 862AACC - .incbin "baserom.gba", 0x62aacc, 0x30 - -gUnknown_0862AAFC:: @ 862AAFC - .incbin "baserom.gba", 0x62aafc, 0x8 - -gUnknown_0862AB04:: @ 862AB04 - .incbin "baserom.gba", 0x62ab04, 0x8 - -gUnknown_0862AB0C:: @ 862AB0C - .incbin "baserom.gba", 0x62ab0c, 0x8 - -gUnknown_0862AB14:: @ 862AB14 - .incbin "baserom.gba", 0x62ab14, 0x18 - -gUnknown_0862AB2C:: @ 862AB2C - .incbin "baserom.gba", 0x62ab2c, 0x18 - -gUnknown_0862AB44:: @ 862AB44 - .incbin "baserom.gba", 0x62ab44, 0xe4 - -gUnknown_0862AC28:: @ 862AC28 - .incbin "baserom.gba", 0x62ac28, 0x8 - -gUnknown_0862AC30:: @ 862AC30 - .incbin "baserom.gba", 0x62ac30, 0x8 - -gUnknown_0862AC38:: @ 862AC38 - .incbin "baserom.gba", 0x62ac38, 0x8 - -gUnknown_0862AC40:: @ 862AC40 - .incbin "baserom.gba", 0x62ac40, 0x8 - -gUnknown_0862AC48:: @ 862AC48 - .incbin "baserom.gba", 0x62ac48, 0x8 - -gUnknown_0862AC50:: @ 862AC50 - .incbin "baserom.gba", 0x62ac50, 0x8 - -gUnknown_0862AC58:: @ 862AC58 - .incbin "baserom.gba", 0x62ac58, 0x8 - -gUnknown_0862AC60:: @ 862AC60 - .incbin "baserom.gba", 0x62ac60, 0x8 - -gUnknown_0862AC68:: @ 862AC68 - .incbin "baserom.gba", 0x62ac68, 0x8 - -gUnknown_0862AC70:: @ 862AC70 - .incbin "baserom.gba", 0x62ac70, 0x8 - -gUnknown_0862AC78:: @ 862AC78 - .incbin "baserom.gba", 0x62ac78, 0x18 - -gUnknown_0862AC90:: @ 862AC90 - .incbin "baserom.gba", 0x62ac90, 0x18 - -gUnknown_0862ACA8:: @ 862ACA8 - .incbin "baserom.gba", 0x62aca8, 0x18 - -gUnknown_0862ACC0:: @ 862ACC0 - .incbin "baserom.gba", 0x62acc0, 0x18 - -gUnknown_0862ACD8:: @ 862ACD8 - .incbin "baserom.gba", 0x62acd8, 0x18 - -gUnknown_0862ACF0:: @ 862ACF0 - .incbin "baserom.gba", 0x62acf0, 0x18 - -gUnknown_0862AD08:: @ 862AD08 - .incbin "baserom.gba", 0x62ad08, 0xc - -gUnknown_0862AD14:: @ 862AD14 - .incbin "baserom.gba", 0x62ad14, 0x20 - -gUnknown_0862AD34:: @ 862AD34 - .incbin "baserom.gba", 0x62ad34, 0x10 - -gUnknown_0862AD44:: @ 862AD44 - .incbin "baserom.gba", 0x62ad44, 0x10 - -gUnknown_0862AD54:: @ 862AD54 - .incbin "baserom.gba", 0x62ad54, 0x1dc - -gUnknown_0862AF30:: @ 862AF30 - .incbin "baserom.gba", 0x62af30, 0x60c - -gUnknown_0862B53C:: @ 862B53C - .incbin "baserom.gba", 0x62b53c, 0x1e8 - -gUnknown_0862B724:: @ 862B724 - .incbin "baserom.gba", 0x62b724, 0x8 - -gUnknown_0862B72C:: @ 862B72C - .incbin "baserom.gba", 0x62b72c, 0x2c - -gUnknown_0862B758:: @ 862B758 - .incbin "baserom.gba", 0x62b758, 0x18 - -gUnknown_0862B770:: @ 862B770 - .incbin "baserom.gba", 0x62b770, 0x14 - -gUnknown_0862B784:: @ 862B784 - .incbin "baserom.gba", 0x62b784, 0x14 - -gUnknown_0862B798:: @ 862B798 - .incbin "baserom.gba", 0x62b798, 0x14 - -gUnknown_0862B7AC:: @ 862B7AC - .incbin "baserom.gba", 0x62b7ac, 0x14 - -gUnknown_0862B7C0:: @ 862B7C0 - .incbin "baserom.gba", 0x62b7c0, 0x14 - -gUnknown_0862B7D4:: @ 862B7D4 - .incbin "baserom.gba", 0x62b7d4, 0x14 - -gUnknown_0862B7E8:: @ 862B7E8 - .incbin "baserom.gba", 0x62b7e8, 0x14 - -gUnknown_0862B7FC:: @ 862B7FC - .incbin "baserom.gba", 0x62b7fc, 0x2e8 diff --git a/data/data_emerald.s b/data/data_emerald.s new file mode 100644 index 000000000..54bda4a0e --- /dev/null +++ b/data/data_emerald.s @@ -0,0 +1,999 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_0860B058:: @ 860B058 + .incbin "baserom.gba", 0x60b058, 0xc + +gUnknown_0860B064:: @ 860B064 + .incbin "baserom.gba", 0x60b064, 0x8 + +gUnknown_0860B06C:: @ 860B06C + .incbin "baserom.gba", 0x60b06c, 0x8 + +gUnknown_0860B074:: @ 860B074 + .incbin "baserom.gba", 0x60b074, 0xa + +gUnknown_0860B07E:: @ 860B07E + .incbin "baserom.gba", 0x60b07e, 0x126 + +gUnknown_0860B1A4:: @ 860B1A4 + .incbin "baserom.gba", 0x60b1a4, 0x40 + +gUnknown_0860B1E4:: @ 860B1E4 + .incbin "baserom.gba", 0x60b1e4, 0x20 + +gUnknown_0860B204:: @ 860B204 + .incbin "baserom.gba", 0x60b204, 0x20 + +gUnknown_0860B224:: @ 860B224 + .incbin "baserom.gba", 0x60b224, 0xc8 + +gUnknown_0860B2EC:: @ 860B2EC + .incbin "baserom.gba", 0x60b2ec, 0x18 + +gUnknown_0860B304:: @ 860B304 + .incbin "baserom.gba", 0x60b304, 0xc + +gUnknown_0860B310:: @ 860B310 + .incbin "baserom.gba", 0x60b310, 0x14 + +gUnknown_0860B324:: @ 860B324 + .incbin "baserom.gba", 0x60b324, 0x14 + +gUnknown_0860B338:: @ 860B338 + .incbin "baserom.gba", 0x60b338, 0x14 + +gUnknown_0860B34C:: @ 860B34C + .incbin "baserom.gba", 0x60b34c, 0xc + +gUnknown_0860B358:: @ 860B358 + .incbin "baserom.gba", 0x60b358, 0x1630 + +gUnknown_0860C988:: @ 860C988 + .incbin "baserom.gba", 0x60c988, 0x269 + +gUnknown_0860CBF1:: @ 860CBF1 + .incbin "baserom.gba", 0x60cbf1, 0x283 + +gUnknown_0860CE74:: @ 860CE74 + .incbin "baserom.gba", 0x60ce74, 0x10 + +gUnknown_0860CE84:: @ 860CE84 + .incbin "baserom.gba", 0x60ce84, 0x10 + +gUnknown_0860CE94:: @ 860CE94 + .incbin "baserom.gba", 0x60ce94, 0x20 + +gUnknown_0860CEB4:: @ 860CEB4 + .incbin "baserom.gba", 0x60ceb4, 0x90 + +gUnknown_0860CF44:: @ 860CF44 + .incbin "baserom.gba", 0x60cf44, 0xc + +gUnknown_0860CF50:: @ 860CF50 + .incbin "baserom.gba", 0x60cf50, 0x58 + +gUnknown_0860CFA8:: @ 860CFA8 + .incbin "baserom.gba", 0x60cfa8, 0x30 + +gUnknown_0860CFD8:: @ 860CFD8 + .incbin "baserom.gba", 0x60cfd8, 0x30 + +gUnknown_0860D008:: @ 860D008 + .incbin "baserom.gba", 0x60d008, 0x48 + +gUnknown_0860D050:: @ 860D050 + .incbin "baserom.gba", 0x60d050, 0x18 + +gUnknown_0860D068:: @ 860D068 + .incbin "baserom.gba", 0x60d068, 0x18 + +gUnknown_0860D080:: @ 860D080 + .incbin "baserom.gba", 0x60d080, 0x10 + +gUnknown_0860D090:: @ 860D090 + .incbin "baserom.gba", 0x60d090, 0x5c + +gUnknown_0860D0EC:: @ 860D0EC + .incbin "baserom.gba", 0x60d0ec, 0x10 + +gUnknown_0860D0FC:: @ 860D0FC + .incbin "baserom.gba", 0x60d0fc, 0x10 + +gUnknown_0860D10C:: @ 860D10C + .incbin "baserom.gba", 0x60d10c, 0x40 + +gUnknown_0860D14C:: @ 860D14C + .incbin "baserom.gba", 0x60d14c, 0x10 + +gUnknown_0860D15C:: @ 860D15C + .incbin "baserom.gba", 0x60d15c, 0x40 + +gUnknown_0860D19C:: @ 860D19C + .incbin "baserom.gba", 0x60d19c, 0x4 + +gUnknown_0860D1A0:: @ 860D1A0 + .incbin "baserom.gba", 0x60d1a0, 0x20 + +gUnknown_0860D1C0:: @ 860D1C0 + .incbin "baserom.gba", 0x60d1c0, 0x10 + +gUnknown_0860D1D0:: @ 860D1D0 + .incbin "baserom.gba", 0x60d1d0, 0x44 + +gUnknown_0860D214:: @ 860D214 + .incbin "baserom.gba", 0x60d214, 0x80 + +gUnknown_0860D294:: @ 860D294 + .incbin "baserom.gba", 0x60d294, 0xac + +gUnknown_0860D340:: @ 860D340 + .incbin "baserom.gba", 0x60d340, 0x3 + +gUnknown_0860D343:: @ 860D343 + .incbin "baserom.gba", 0x60d343, 0x3 + +gUnknown_0860D346:: @ 860D346 + .incbin "baserom.gba", 0x60d346, 0x3 + +gUnknown_0860D349:: @ 860D349 + .incbin "baserom.gba", 0x60d349, 0x7 + +gUnknown_0860D350:: @ 860D350 + .incbin "baserom.gba", 0x60d350, 0x3c + +gUnknown_0860D38C:: @ 860D38C + .incbin "baserom.gba", 0x60d38c, 0x1c + +gUnknown_0860D3A8:: @ 860D3A8 + .incbin "baserom.gba", 0x60d3a8, 0x3 + +gUnknown_0860D3AB:: @ 860D3AB + .incbin "baserom.gba", 0x60d3ab, 0x3 + +gUnknown_0860D3AE:: @ 860D3AE + .incbin "baserom.gba", 0x60d3ae, 0x3 + +gUnknown_0860D3B1:: @ 860D3B1 + .incbin "baserom.gba", 0x60d3b1, 0x3 + +gUnknown_0860D3B4:: @ 860D3B4 + .incbin "baserom.gba", 0x60d3b4, 0x10 + +gUnknown_0860D3C4:: @ 860D3C4 + .incbin "baserom.gba", 0x60d3c4, 0x2 + +gUnknown_0860D3C6:: @ 860D3C6 + .incbin "baserom.gba", 0x60d3c6, 0x2b + +gUnknown_0860D3F1:: @ 860D3F1 + .incbin "baserom.gba", 0x60d3f1, 0x1 + +gUnknown_0860D3F2:: @ 860D3F2 + .incbin "baserom.gba", 0x60d3f2, 0x1f + +gUnknown_0860D411:: @ 860D411 + .incbin "baserom.gba", 0x60d411, 0x8ff + +gUnknown_0860DD10:: @ 860DD10 + .incbin "baserom.gba", 0x60dd10, 0x100 + +gUnknown_0860DE10:: @ 860DE10 + .incbin "baserom.gba", 0x60de10, 0x40 + +gUnknown_0860DE50:: @ 860DE50 + .incbin "baserom.gba", 0x60de50, 0x28 + +gUnknown_0860DE78:: @ 860DE78 + .incbin "baserom.gba", 0x60de78, 0xc + +gUnknown_0860DE84:: @ 860DE84 + .incbin "baserom.gba", 0x60de84, 0x14 + +gUnknown_0860DE98:: @ 860DE98 + .incbin "baserom.gba", 0x60de98, 0x10 + +gUnknown_0860DEA8:: @ 860DEA8 + .incbin "baserom.gba", 0x60dea8, 0x10 + +gUnknown_0860DEB8:: @ 860DEB8 + .incbin "baserom.gba", 0x60deb8, 0xb68 + +gUnknown_0860EA20:: @ 860EA20 + .incbin "baserom.gba", 0x60ea20, 0xc + +gUnknown_0860EA2C:: @ 860EA2C + .incbin "baserom.gba", 0x60ea2c, 0x8 + +gUnknown_0860EA34:: @ 860EA34 + .incbin "baserom.gba", 0x60ea34, 0x18 + +gUnknown_0860EA4C:: @ 860EA4C + .incbin "baserom.gba", 0x60ea4c, 0x20 + +gUnknown_0860EA6C:: @ 860EA6C + .incbin "baserom.gba", 0x60ea6c, 0x100 + +gUnknown_0860EB6C:: @ 860EB6C + .incbin "baserom.gba", 0x60eb6c, 0x20 + +gUnknown_0860EB8C:: @ 860EB8C + .incbin "baserom.gba", 0x60eb8c, 0x3e4 + +gUnknown_0860EF70:: @ 860EF70 + .incbin "baserom.gba", 0x60ef70, 0x8 + +gUnknown_0860EF78:: @ 860EF78 + .incbin "baserom.gba", 0x60ef78, 0x20 + +gUnknown_0860EF98:: @ 860EF98 + .incbin "baserom.gba", 0x60ef98, 0x8 + +gUnknown_0860EFA0:: @ 860EFA0 + .incbin "baserom.gba", 0x60efa0, 0xc + +gUnknown_0860EFAC:: @ 860EFAC + .incbin "baserom.gba", 0x60efac, 0x18 + +gUnknown_0860EFC4:: @ 860EFC4 + .incbin "baserom.gba", 0x60efc4, 0x30 + +gUnknown_0860EFF4:: @ 860EFF4 + .incbin "baserom.gba", 0x60eff4, 0x1c + +gUnknown_0860F010:: @ 860F010 + .incbin "baserom.gba", 0x60f010, 0x10 + +gUnknown_0860F020:: @ 860F020 + .incbin "baserom.gba", 0x60f020, 0x54 + +gUnknown_0860F074:: @ 860F074 + .incbin "baserom.gba", 0x60f074, 0x20 + +gUnknown_0860F094:: @ 860F094 + .incbin "baserom.gba", 0x60f094, 0x4 + +gUnknown_0860F098:: @ 860F098 + .incbin "baserom.gba", 0x60f098, 0x10 + +gUnknown_0860F0A8:: @ 860F0A8 + .incbin "baserom.gba", 0x60f0a8, 0x8 + +gUnknown_0860F0B0:: @ 860F0B0 + .incbin "baserom.gba", 0x60f0b0, 0x20 + +gUnknown_0860F0D0:: @ 860F0D0 + .incbin "baserom.gba", 0x60f0d0, 0x4 + +gUnknown_0860F0D4:: @ 860F0D4 + .incbin "baserom.gba", 0x60f0d4, 0x68 + +gUnknown_0860F13C:: @ 860F13C + .incbin "baserom.gba", 0x60f13c, 0x1100 + +gUnknown_0861023C:: @ 861023C + .incbin "baserom.gba", 0x61023c, 0x100 + +gUnknown_0861033C:: @ 861033C + .incbin "baserom.gba", 0x61033c, 0x60 + +gUnknown_0861039C:: @ 861039C + .incbin "baserom.gba", 0x61039c, 0x20 + +gUnknown_086103BC:: @ 86103BC + .incbin "baserom.gba", 0x6103bc, 0x28 + +gUnknown_086103E4:: @ 86103E4 + .incbin "baserom.gba", 0x6103e4, 0x10 + +gUnknown_086103F4:: @ 86103F4 + .incbin "baserom.gba", 0x6103f4, 0x28 + +gUnknown_0861041C:: @ 861041C + .incbin "baserom.gba", 0x61041c, 0xc + +gUnknown_08610428:: @ 8610428 + .incbin "baserom.gba", 0x610428, 0xc + +gUnknown_08610434:: @ 8610434 + .incbin "baserom.gba", 0x610434, 0x38 + +gUnknown_0861046C:: @ 861046C + .incbin "baserom.gba", 0x61046c, 0xa + +gUnknown_08610476:: @ 8610476 + .incbin "baserom.gba", 0x610476, 0x3 + +gUnknown_08610479:: @ 8610479 + .incbin "baserom.gba", 0x610479, 0x15f + +gUnknown_086105D8:: @ 86105D8 + .incbin "baserom.gba", 0x6105d8, 0x18 + +gUnknown_086105F0:: @ 86105F0 + .incbin "baserom.gba", 0x6105f0, 0x18 + +gUnknown_08610608:: @ 8610608 + .incbin "baserom.gba", 0x610608, 0x18 + +gUnknown_08610620:: @ 8610620 + .incbin "baserom.gba", 0x610620, 0x18 + +gUnknown_08610638:: @ 8610638 + .incbin "baserom.gba", 0x610638, 0x18 + +gUnknown_08610650:: @ 8610650 + .incbin "baserom.gba", 0x610650, 0x50 + +gUnknown_086106A0:: @ 86106A0 + .incbin "baserom.gba", 0x6106a0, 0x10 + +gUnknown_086106B0:: @ 86106B0 + .incbin "baserom.gba", 0x6106b0, 0x184 + +gUnknown_08610834:: @ 8610834 + .incbin "baserom.gba", 0x610834, 0x18 + +gUnknown_0861084C:: @ 861084C + .incbin "baserom.gba", 0x61084c, 0x18 + +gUnknown_08610864:: @ 8610864 + .incbin "baserom.gba", 0x610864, 0x18 + +gUnknown_0861087C:: @ 861087C + .incbin "baserom.gba", 0x61087c, 0x18 + +gUnknown_08610894:: @ 8610894 + .incbin "baserom.gba", 0x610894, 0x18 + +gUnknown_086108AC:: @ 86108AC + .incbin "baserom.gba", 0x6108ac, 0xc + +gUnknown_086108B8:: @ 86108B8 + .incbin "baserom.gba", 0x6108b8, 0x10 + +gUnknown_086108C8:: @ 86108C8 + .incbin "baserom.gba", 0x6108c8, 0x50 + +gUnknown_08610918:: @ 8610918 + .incbin "baserom.gba", 0x610918, 0xa + +gUnknown_08610922:: @ 8610922 + .incbin "baserom.gba", 0x610922, 0x3 + +gUnknown_08610925:: @ 8610925 + .incbin "baserom.gba", 0x610925, 0x3 + +gUnknown_08610928:: @ 8610928 + .incbin "baserom.gba", 0x610928, 0x20 + +gUnknown_08610948:: @ 8610948 + .incbin "baserom.gba", 0x610948, 0x28 + +gUnknown_08610970:: @ 8610970 + .incbin "baserom.gba", 0x610970, 0x34 + +gUnknown_086109A4:: @ 86109A4 + .incbin "baserom.gba", 0x6109a4, 0x16 + +gUnknown_086109BA:: @ 86109BA + .incbin "baserom.gba", 0x6109ba, 0x536 + +gUnknown_08610EF0:: @ 8610EF0 + .incbin "baserom.gba", 0x610ef0, 0x100 + +gUnknown_08610FF0:: @ 8610FF0 + .incbin "baserom.gba", 0x610ff0, 0x80 + +gUnknown_08611070:: @ 8611070 + .incbin "baserom.gba", 0x611070, 0x140 + +gUnknown_086111B0:: @ 86111B0 + .incbin "baserom.gba", 0x6111b0, 0x80 + +gUnknown_08611230:: @ 8611230 + .incbin "baserom.gba", 0x611230, 0x80 + +gUnknown_086112B0:: @ 86112B0 + .incbin "baserom.gba", 0x6112b0, 0x80 + +gUnknown_08611330:: @ 8611330 + .incbin "baserom.gba", 0x611330, 0x40 + +gUnknown_08611370:: @ 8611370 + .incbin "baserom.gba", 0x611370, 0x163 + +gUnknown_086114D3:: @ 86114D3 + .incbin "baserom.gba", 0x6114d3, 0xd + +gUnknown_086114E0:: @ 86114E0 + .incbin "baserom.gba", 0x6114e0, 0x68 + +gUnknown_08611548:: @ 8611548 + .incbin "baserom.gba", 0x611548, 0x8 + +gUnknown_08611550:: @ 8611550 + .incbin "baserom.gba", 0x611550, 0x1c + +gUnknown_0861156C:: @ 861156C + .incbin "baserom.gba", 0x61156c, 0xc + +gUnknown_08611578:: @ 8611578 + .incbin "baserom.gba", 0x611578, 0x33c + +gUnknown_086118B4:: @ 86118B4 + .incbin "baserom.gba", 0x6118b4, 0x348 + +gUnknown_08611BFC:: @ 8611BFC + .incbin "baserom.gba", 0x611bfc, 0x1c + +gUnknown_08611C18:: @ 8611C18 + .incbin "baserom.gba", 0x611c18, 0x5c + +gUnknown_08611C74:: @ 8611C74 + .incbin "baserom.gba", 0x611c74, 0x8 + +gUnknown_08611C7C:: @ 8611C7C + .incbin "baserom.gba", 0x611c7c, 0x8 + +gUnknown_08611C84:: @ 8611C84 + .incbin "baserom.gba", 0x611c84, 0x8 + +gUnknown_08611C8C:: @ 8611C8C + .incbin "baserom.gba", 0x611c8c, 0xe + +gUnknown_08611C9A:: @ 8611C9A + .incbin "baserom.gba", 0x611c9a, 0x16 + +gUnknown_08611CB0:: @ 8611CB0 + .incbin "baserom.gba", 0x611cb0, 0x50 + +gUnknown_08611D00:: @ 8611D00 + .incbin "baserom.gba", 0x611d00, 0x8 + +gUnknown_08611D08:: @ 8611D08 + .incbin "baserom.gba", 0x611d08, 0x28 + +gUnknown_08611D30:: @ 8611D30 + .incbin "baserom.gba", 0x611d30, 0x80 + +gUnknown_08611DB0:: @ 8611DB0 + .incbin "baserom.gba", 0x611db0, 0x8 + +gUnknown_08611DB8:: @ 8611DB8 + .incbin "baserom.gba", 0x611db8, 0x8 + +@ 8611DC0 + .include "data/battle_frontier/battle_arena_move_mind_ratings.inc" + + .align 2 +@ 8611F24 + .incbin "baserom.gba", 0x611f24, 0x38 + +gUnknown_08611F5C:: @ 8611F5C + .incbin "baserom.gba", 0x611f5c, 0x18 + +gUnknown_08611F74:: @ 8611F74 + .incbin "baserom.gba", 0x611f74, 0x10 + +gUnknown_08611F84:: @ 8611F84 + .incbin "baserom.gba", 0x611f84, 0x1c + +gUnknown_08611FA0:: @ 8611FA0 + .incbin "baserom.gba", 0x611fa0, 0xc + +gUnknown_08611FAC:: @ 8611FAC + .incbin "baserom.gba", 0x611fac, 0x14 + +@ 8611FC0 + .include "data/battle_frontier/battle_factory_style_move_lists.inc" + +gUnknown_08612120:: @ 8612120 + .incbin "baserom.gba", 0x612120, 0x44 + +gUnknown_08612164:: @ 8612164 + .incbin "baserom.gba", 0x612164, 0x10 + +gUnknown_08612174:: @ 8612174 + .incbin "baserom.gba", 0x612174, 0x10 + +gUnknown_08612184:: @ 8612184 + .incbin "baserom.gba", 0x612184, 0x10 + +gUnknown_08612194:: @ 8612194 + .incbin "baserom.gba", 0x612194, 0x180 + +gUnknown_08612314:: @ 8612314 + .incbin "baserom.gba", 0x612314, 0x8 + +gUnknown_0861231C:: @ 861231C + .incbin "baserom.gba", 0x61231c, 0xc8 + +gUnknown_086123E4:: @ 86123E4 + .incbin "baserom.gba", 0x6123e4, 0x1f8 + +gUnknown_086125DC:: @ 86125DC + .incbin "baserom.gba", 0x6125dc, 0x1c + +gUnknown_086125F8:: @ 86125F8 + .incbin "baserom.gba", 0x6125f8, 0x74 + +gUnknown_0861266C:: @ 861266C + .incbin "baserom.gba", 0x61266c, 0x9 + +gUnknown_08612675:: @ 8612675 + .incbin "baserom.gba", 0x612675, 0x13 + +gUnknown_08612688:: @ 8612688 + .incbin "baserom.gba", 0x612688, 0x8 + +gUnknown_08612690:: @ 8612690 + .incbin "baserom.gba", 0x612690, 0x8 + +gUnknown_08612698:: @ 8612698 + .incbin "baserom.gba", 0x612698, 0x4 + +gUnknown_0861269C:: @ 861269C + .incbin "baserom.gba", 0x61269c, 0x4 + +gUnknown_086126A0:: @ 86126A0 + .incbin "baserom.gba", 0x6126a0, 0x4 + +gUnknown_086126A4:: @ 86126A4 + .incbin "baserom.gba", 0x6126a4, 0x4 + +gUnknown_086126A8:: @ 86126A8 + .incbin "baserom.gba", 0x6126a8, 0x2 + +gUnknown_086126AA:: @ 86126AA + .incbin "baserom.gba", 0x6126aa, 0x2 + +gUnknown_086126AC:: @ 86126AC + .incbin "baserom.gba", 0x6126ac, 0x2 + +gUnknown_086126AE:: @ 86126AE + .incbin "baserom.gba", 0x6126ae, 0x2 + +@ 86126B0 + .include "data/battle_frontier/battle_pyramid_level_50_wild_mons.inc" + +@ 8612E80 + .include "data/battle_frontier/battle_pyramid_open_level_wild_mons.inc" + +gUnknown_08613650:: @ 8613650 + .incbin "baserom.gba", 0x613650, 0x5 + +gUnknown_08613655:: @ 8613655 + .incbin "baserom.gba", 0x613655, 0xfb + +gUnknown_08613750:: @ 8613750 + .incbin "baserom.gba", 0x613750, 0x44 + +gUnknown_08613794:: @ 8613794 + .incbin "baserom.gba", 0x613794, 0x8 + +gUnknown_0861379C:: @ 861379C + .incbin "baserom.gba", 0x61379c, 0x190 + +gUnknown_0861392C:: @ 861392C + .incbin "baserom.gba", 0x61392c, 0x190 + +gUnknown_08613ABC:: @ 8613ABC + .incbin "baserom.gba", 0x613abc, 0x7e + +gUnknown_08613B3A:: @ 8613B3A + .incbin "baserom.gba", 0x613b3a, 0xa + +gUnknown_08613B44:: @ 8613B44 + .incbin "baserom.gba", 0x613b44, 0xd8 + +gUnknown_08613C1C:: @ 8613C1C + .incbin "baserom.gba", 0x613c1c, 0x2a4 + +gUnknown_08613EC0:: @ 8613EC0 + .incbin "baserom.gba", 0x613ec0, 0x18 + +gUnknown_08613ED8:: @ 8613ED8 + .incbin "baserom.gba", 0x613ed8, 0x8 + +gUnknown_08613EE0:: @ 8613EE0 + .incbin "baserom.gba", 0x613ee0, 0x48 + +gUnknown_08613F28:: @ 8613F28 + .incbin "baserom.gba", 0x613f28, 0xc + +gUnknown_08613F34:: @ 8613F34 + .incbin "baserom.gba", 0x613f34, 0x12 + +gUnknown_08613F46:: @ 8613F46 + .incbin "baserom.gba", 0x613f46, 0x40 + +gUnknown_08613F86:: @ 8613F86 + .incbin "baserom.gba", 0x613f86, 0xa + +gUnknown_08613F90:: @ 8613F90 + .incbin "baserom.gba", 0x613f90, 0xc + +gUnknown_08613F9C:: @ 8613F9C + .incbin "baserom.gba", 0x613f9c, 0x18 + +gUnknown_08613FB4:: @ 8613FB4 + .incbin "baserom.gba", 0x613fb4, 0x78 + +gUnknown_0861402C:: @ 861402C + .incbin "baserom.gba", 0x61402c, 0x4 + +gUnknown_08614030:: @ 8614030 + .incbin "baserom.gba", 0x614030, 0x4 + +gUnknown_08614034:: @ 8614034 + .incbin "baserom.gba", 0x614034, 0x4 + +gUnknown_08614038:: @ 8614038 + .incbin "baserom.gba", 0x614038, 0x4 + +gUnknown_0861403C:: @ 861403C + .incbin "baserom.gba", 0x61403c, 0x6 + +gUnknown_08614042:: @ 8614042 + .incbin "baserom.gba", 0x614042, 0x2 + +gUnknown_08614044:: @ 8614044 + .incbin "baserom.gba", 0x614044, 0x2 + +gUnknown_08614046:: @ 8614046 + .incbin "baserom.gba", 0x614046, 0x1 + +gUnknown_08614047:: @ 8614047 + .incbin "baserom.gba", 0x614047, 0x4 + +gUnknown_0861404B:: @ 861404B + .incbin "baserom.gba", 0x61404b, 0x2 + +gUnknown_0861404D:: @ 861404D + .incbin "baserom.gba", 0x61404d, 0x2 + +gUnknown_0861404F:: @ 861404F + .incbin "baserom.gba", 0x61404f, 0x5 + +gUnknown_08614054:: @ 8614054 + .incbin "baserom.gba", 0x614054, 0x30 + +gUnknown_08614084:: @ 8614084 + .incbin "baserom.gba", 0x614084, 0x8 + +gUnknown_0861408C:: @ 861408C + .incbin "baserom.gba", 0x61408c, 0x8 + +gUnknown_08614094:: @ 8614094 + .incbin "baserom.gba", 0x614094, 0x10 + +gUnknown_086140A4:: @ 86140A4 + .incbin "baserom.gba", 0x6140a4, 0xc0 + +gUnknown_08614164:: @ 8614164 + .incbin "baserom.gba", 0x614164, 0x10 + +gUnknown_08614174:: @ 8614174 + .incbin "baserom.gba", 0x614174, 0x38 + +gUnknown_086141AC:: @ 86141AC + .incbin "baserom.gba", 0x6141ac, 0x50 + +gUnknown_086141FC:: @ 86141FC + .incbin "baserom.gba", 0x6141fc, 0x48 + +gUnknown_08614244:: @ 8614244 + .incbin "baserom.gba", 0x614244, 0x18 + +gUnknown_0861425C:: @ 861425C + .incbin "baserom.gba", 0x61425c, 0x4 + +gUnknown_08614260:: @ 8614260 + .incbin "baserom.gba", 0x614260, 0x4 + +gUnknown_08614264:: @ 8614264 + .incbin "baserom.gba", 0x614264, 0x4 + +gUnknown_08614268:: @ 8614268 + .incbin "baserom.gba", 0x614268, 0x4 + +gUnknown_0861426C:: @ 861426C + .incbin "baserom.gba", 0x61426c, 0x4 + +gUnknown_08614270:: @ 8614270 + .incbin "baserom.gba", 0x614270, 0x4 + +gUnknown_08614274:: @ 8614274 + .incbin "baserom.gba", 0x614274, 0x4 + +gUnknown_08614278:: @ 8614278 + .incbin "baserom.gba", 0x614278, 0x18 + +gUnknown_08614290:: @ 8614290 + .incbin "baserom.gba", 0x614290, 0x18 + +gUnknown_086142A8:: @ 86142A8 + .incbin "baserom.gba", 0x6142a8, 0x20 + +gUnknown_086142C8:: @ 86142C8 + .incbin "baserom.gba", 0x6142c8, 0x70 + +gUnknown_08614338:: @ 8614338 + .incbin "baserom.gba", 0x614338, 0x40 + +gUnknown_08614378:: @ 8614378 + .incbin "baserom.gba", 0x614378, 0x44 + +gUnknown_086143BC:: @ 86143BC + .incbin "baserom.gba", 0x6143bc, 0x4e + +gUnknown_0861440A:: @ 861440A + .incbin "baserom.gba", 0x61440a, 0x4 + +gUnknown_0861440E:: @ 861440E + .incbin "baserom.gba", 0x61440e, 0x2 + +@ 8614410 + .include "data/graphics/items/item_icon_table.inc" + +@ 8614FE0 + .incbin "baserom.gba", 0x614fe0, 0x14 + +gUnknown_08614FF4:: @ 8614FF4 + .incbin "baserom.gba", 0x614ff4, 0x18 + +gUnknown_0861500C:: @ 861500C + .incbin "baserom.gba", 0x61500c, 0x3c + +gUnknown_08615048:: @ 8615048 + .incbin "baserom.gba", 0x615048, 0x670 + +gUnknown_086156B8:: @ 86156B8 + .incbin "baserom.gba", 0x6156b8, 0x2c + +gUnknown_086156E4:: @ 86156E4 + .incbin "baserom.gba", 0x6156e4, 0x20 + +gUnknown_08615704:: @ 8615704 + .incbin "baserom.gba", 0x615704, 0xc0 + +gUnknown_086157C4:: @ 86157C4 + .incbin "baserom.gba", 0x6157c4, 0x1c + +gUnknown_086157E0:: @ 86157E0 + .incbin "baserom.gba", 0x6157e0, 0x1c + +gUnknown_086157FC:: @ 86157FC + .incbin "baserom.gba", 0x6157fc, 0x14 + +gUnknown_08615810:: @ 8615810 + .incbin "baserom.gba", 0x615810, 0x40 + +gUnknown_08615850:: @ 8615850 + .incbin "baserom.gba", 0x615850, 0x40 + +gUnknown_08615890:: @ 8615890 + .incbin "baserom.gba", 0x615890, 0x40 + +gUnknown_086158D0:: @ 86158D0 + .incbin "baserom.gba", 0x6158d0, 0x38 + +gUnknown_08615908:: @ 8615908 + .incbin "baserom.gba", 0x615908, 0x8 + +gUnknown_08615910:: @ 8615910 + .incbin "baserom.gba", 0x615910, 0x8 + +gUnknown_08615918:: @ 8615918 + .incbin "baserom.gba", 0x615918, 0x8 + +gUnknown_08615920:: @ 8615920 + .incbin "baserom.gba", 0x615920, 0x8 + +gUnknown_08615928:: @ 8615928 + .incbin "baserom.gba", 0x615928, 0x8 + +gUnknown_08615930:: @ 8615930 + .incbin "baserom.gba", 0x615930, 0x8 + +gUnknown_08615938:: @ 8615938 + .incbin "baserom.gba", 0x615938, 0x8 + +gUnknown_08615940:: @ 8615940 + .incbin "baserom.gba", 0x615940, 0x8 + +gUnknown_08615948:: @ 8615948 + .incbin "baserom.gba", 0x615948, 0x8 + +gUnknown_08615950:: @ 8615950 + .incbin "baserom.gba", 0x615950, 0x8 + +gUnknown_08615958:: @ 8615958 + .incbin "baserom.gba", 0x615958, 0x8 + +gUnknown_08615960:: @ 8615960 + .incbin "baserom.gba", 0x615960, 0x8 + +gUnknown_08615968:: @ 8615968 + .incbin "baserom.gba", 0x615968, 0x8 + +gUnknown_08615970:: @ 8615970 + .incbin "baserom.gba", 0x615970, 0x18 + +gUnknown_08615988:: @ 8615988 + .incbin "baserom.gba", 0x615988, 0x46 + +gUnknown_086159CE:: @ 86159CE + .incbin "baserom.gba", 0x6159ce, 0x46 + +gUnknown_08615A14:: @ 8615A14 + .incbin "baserom.gba", 0x615a14, 0x36 + +gUnknown_08615A4A:: @ 8615A4A + .incbin "baserom.gba", 0x615a4a, 0x36 + +gUnknown_08615A80:: @ 8615A80 + .incbin "baserom.gba", 0x615a80, 0x36 + +gUnknown_08615AB6:: @ 8615AB6 + .incbin "baserom.gba", 0x615ab6, 0x2 + +gUnknown_08615AB8:: @ 8615AB8 + .incbin "baserom.gba", 0x615ab8, 0x2 + +gUnknown_08615ABA:: @ 8615ABA + .incbin "baserom.gba", 0x615aba, 0x3 + +gUnknown_08615ABD:: @ 8615ABD + .incbin "baserom.gba", 0x615abd, 0x3 + +gUnknown_08615AC0:: @ 8615AC0 + .incbin "baserom.gba", 0x615ac0, 0x3 + +gUnknown_08615AC3:: @ 8615AC3 + .incbin "baserom.gba", 0x615ac3, 0x2 + +gUnknown_08615AC5:: @ 8615AC5 + .incbin "baserom.gba", 0x615ac5, 0x2 + +gUnknown_08615AC7:: @ 8615AC7 + .incbin "baserom.gba", 0x615ac7, 0x2 + +gUnknown_08615AC9:: @ 8615AC9 + .incbin "baserom.gba", 0x615ac9, 0x2 + +gUnknown_08615ACB:: @ 8615ACB + .incbin "baserom.gba", 0x615acb, 0x2 + +gUnknown_08615ACD:: @ 8615ACD + .incbin "baserom.gba", 0x615acd, 0x3 + +gUnknown_08615AD0:: @ 8615AD0 + .incbin "baserom.gba", 0x615ad0, 0x3 + +gUnknown_08615AD3:: @ 8615AD3 + .incbin "baserom.gba", 0x615ad3, 0x3 + +gUnknown_08615AD6:: @ 8615AD6 + .incbin "baserom.gba", 0x615ad6, 0x3 + +gUnknown_08615AD9:: @ 8615AD9 + .incbin "baserom.gba", 0x615ad9, 0x3 + +gUnknown_08615ADC:: @ 8615ADC + .incbin "baserom.gba", 0x615adc, 0x3 + +gUnknown_08615ADF:: @ 8615ADF + .incbin "baserom.gba", 0x615adf, 0x3 + +gUnknown_08615AE2:: @ 8615AE2 + .incbin "baserom.gba", 0x615ae2, 0x3 + +gUnknown_08615AE5:: @ 8615AE5 + .incbin "baserom.gba", 0x615ae5, 0x3 + +gUnknown_08615AE8:: @ 8615AE8 + .incbin "baserom.gba", 0x615ae8, 0x3 + +gUnknown_08615AEB:: @ 8615AEB + .incbin "baserom.gba", 0x615aeb, 0x3 + +gUnknown_08615AEE:: @ 8615AEE + .incbin "baserom.gba", 0x615aee, 0x3 + +gUnknown_08615AF1:: @ 8615AF1 + .incbin "baserom.gba", 0x615af1, 0x3 + +gUnknown_08615AF4:: @ 8615AF4 + .incbin "baserom.gba", 0x615af4, 0x6c + +gUnknown_08615B60:: @ 8615B60 + .incbin "baserom.gba", 0x615b60, 0xa8 + +gUnknown_08615C08:: @ 8615C08 + .incbin "baserom.gba", 0x615c08, 0x130 + +gUnknown_08615D38:: @ 8615D38 + .incbin "baserom.gba", 0x615d38, 0x38 + +gUnknown_08615D70:: @ 8615D70 + .incbin "baserom.gba", 0x615d70, 0xe + +gUnknown_08615D7E:: @ 8615D7E + .incbin "baserom.gba", 0x615d7e, 0x1e + +gUnknown_08615D9C:: @ 8615D9C + .incbin "baserom.gba", 0x615d9c, 0x70 + +gUnknown_08615E0C:: @ 8615E0C + .incbin "baserom.gba", 0x615e0c, 0xa4 + +gUnknown_08615EB0:: @ 8615EB0 + .incbin "baserom.gba", 0x615eb0, 0x8 + +gUnknown_08615EB8:: @ 8615EB8 + .incbin "baserom.gba", 0x615eb8, 0x8 + +gUnknown_08615EC0:: @ 8615EC0 + .incbin "baserom.gba", 0x615ec0, 0x38 + +gUnknown_08615EF8:: @ 8615EF8 + .incbin "baserom.gba", 0x615ef8, 0x8 + +gUnknown_08615F00:: @ 8615F00 + .incbin "baserom.gba", 0x615f00, 0x8 + +gUnknown_08615F08:: @ 8615F08 + .incbin "baserom.gba", 0x615f08, 0x68 + +gUnknown_08615F70:: @ 8615F70 + .incbin "baserom.gba", 0x615f70, 0x8 + +gUnknown_08615F78:: @ 8615F78 + .incbin "baserom.gba", 0x615f78, 0x80 + +gUnknown_08615FF8:: @ 8615FF8 + .incbin "baserom.gba", 0x615ff8, 0x8 + +gUnknown_08616000:: @ 8616000 + .incbin "baserom.gba", 0x616000, 0x8 + +gUnknown_08616008:: @ 8616008 + .incbin "baserom.gba", 0x616008, 0x18 + +gUnknown_08616020:: @ 8616020 + .incbin "baserom.gba", 0x616020, 0x20 + +gUnknown_08616040:: @ 8616040 + .incbin "baserom.gba", 0x616040, 0x74 + +gUnknown_086160B4:: @ 86160B4 + .incbin "baserom.gba", 0x6160b4, 0x20 + +gUnknown_086160D4:: @ 86160D4 + .incbin "baserom.gba", 0x6160d4, 0x4 + +gUnknown_086160D8:: @ 86160D8 + .incbin "baserom.gba", 0x6160d8, 0x1c + +gUnknown_086160F4:: @ 86160F4 + .incbin "baserom.gba", 0x6160f4, 0x4 + +gUnknown_086160F8:: @ 86160F8 + .incbin "baserom.gba", 0x6160f8, 0x28 + +gUnknown_08616120:: @ 8616120 + .incbin "baserom.gba", 0x616120, 0x4 + +gUnknown_08616124:: @ 8616124 + .incbin "baserom.gba", 0x616124, 0x4 + + .align 2 +gFont6BrailleGlyphs:: @ 8616128 + .incbin "data/graphics/fonts/font6.fwjpnfont" + +gUnknown_08617128:: @ 8617128 + .incbin "baserom.gba", 0x617128, 0x48 diff --git a/data/data_emerald2.s b/data/data_emerald2.s new file mode 100644 index 000000000..a20731acb --- /dev/null +++ b/data/data_emerald2.s @@ -0,0 +1,937 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + +gUnknown_08617274:: @ 8617274 + .incbin "baserom.gba", 0x617274, 0x920 + +gUnknown_08617B94:: @ 8617B94 + .incbin "baserom.gba", 0x617b94, 0xb0 + +gUnknown_08617C44:: @ 8617C44 + .incbin "baserom.gba", 0x617c44, 0x120 + +gUnknown_08617D64:: @ 8617D64 + .incbin "baserom.gba", 0x617d64, 0x30 + +gUnknown_08617D94:: @ 8617D94 + .incbin "baserom.gba", 0x617d94, 0x10 + +gUnknown_08617DA4:: @ 8617DA4 + .incbin "baserom.gba", 0x617da4, 0x5c + +gUnknown_08617E00:: @ 8617E00 + .incbin "baserom.gba", 0x617e00, 0x18 + +gUnknown_08617E18:: @ 8617E18 + .incbin "baserom.gba", 0x617e18, 0x1c + +gUnknown_08617E34:: @ 8617E34 + .incbin "baserom.gba", 0x617e34, 0x2c + +gUnknown_08617E60:: @ 8617E60 + .incbin "baserom.gba", 0x617e60, 0x18 + +gUnknown_08617E78:: @ 8617E78 + .incbin "baserom.gba", 0x617e78, 0x15 + +gUnknown_08617E8D:: @ 8617E8D + .incbin "baserom.gba", 0x617e8d, 0xe + +gUnknown_08617E9B:: @ 8617E9B + .incbin "baserom.gba", 0x617e9b, 0x26d + +gUnknown_08618108:: @ 8618108 + .incbin "baserom.gba", 0x618108, 0x8 + +gUnknown_08618110:: @ 8618110 + .incbin "baserom.gba", 0x618110, 0x28 + +gUnknown_08618138:: @ 8618138 + .incbin "baserom.gba", 0x618138, 0x20 + +gUnknown_08618158:: @ 8618158 + .incbin "baserom.gba", 0x618158, 0x3 + +gUnknown_0861815B:: @ 861815B + .incbin "baserom.gba", 0x61815b, 0x5 + +gUnknown_08618160:: @ 8618160 + .incbin "baserom.gba", 0x618160, 0x18 + +gUnknown_08618178:: @ 8618178 + .incbin "baserom.gba", 0x618178, 0x49 + +@ 86181C1 + .include "data/text/move_descriptions.inc" + +@ 861CAAC + .include "data/text/nature_names.inc" + +gUnknown_0861CBB4:: @ 861CBB4 + .incbin "baserom.gba", 0x61cbb4, 0x38 + +gUnknown_0861CBEC:: @ 861CBEC + .incbin "baserom.gba", 0x61cbec, 0xc + +gUnknown_0861CBF8:: @ 861CBF8 + .incbin "baserom.gba", 0x61cbf8, 0xc + +gUnknown_0861CC04:: @ 861CC04 + .incbin "baserom.gba", 0x61cc04, 0xc + +gUnknown_0861CC10:: @ 861CC10 + .incbin "baserom.gba", 0x61cc10, 0xc + +gUnknown_0861CC1C:: @ 861CC1C + .incbin "baserom.gba", 0x61cc1c, 0x8 + +gUnknown_0861CC24:: @ 861CC24 + .incbin "baserom.gba", 0x61cc24, 0xa8 + +gUnknown_0861CCCC:: @ 861CCCC + .incbin "baserom.gba", 0x61cccc, 0x20 + +gUnknown_0861CCEC:: @ 861CCEC + .incbin "baserom.gba", 0x61ccec, 0x28 + +gUnknown_0861CD14:: @ 861CD14 + .incbin "baserom.gba", 0x61cd14, 0x18 + +gUnknown_0861CD2C:: @ 861CD2C + .incbin "baserom.gba", 0x61cd2c, 0xa7 + +gUnknown_0861CDD3:: @ 861CDD3 + .incbin "baserom.gba", 0x61cdd3, 0x81 + +gUnknown_0861CE54:: @ 861CE54 + .incbin "baserom.gba", 0x61ce54, 0x10 + +gUnknown_0861CE64:: @ 861CE64 + .incbin "baserom.gba", 0x61ce64, 0x10 + +gUnknown_0861CE74:: @ 861CE74 + .incbin "baserom.gba", 0x61ce74, 0x7 + +gUnknown_0861CE7B:: @ 861CE7B + .incbin "baserom.gba", 0x61ce7b, 0x7 + +gUnknown_0861CE82:: @ 861CE82 + .incbin "baserom.gba", 0x61ce82, 0xc + +gUnknown_0861CE8E:: @ 861CE8E + .incbin "baserom.gba", 0x61ce8e, 0x9 + +gUnknown_0861CE97:: @ 861CE97 + .incbin "baserom.gba", 0x61ce97, 0x125 + +gUnknown_0861CFBC:: @ 861CFBC + .incbin "baserom.gba", 0x61cfbc, 0x8 + +gUnknown_0861CFC4:: @ 861CFC4 + .incbin "baserom.gba", 0x61cfc4, 0x18 + +gUnknown_0861CFDC:: @ 861CFDC + .incbin "baserom.gba", 0x61cfdc, 0x98 + +gUnknown_0861D074:: @ 861D074 + .incbin "baserom.gba", 0x61d074, 0x8 + +gUnknown_0861D07C:: @ 861D07C + .incbin "baserom.gba", 0x61d07c, 0x8 + +gUnknown_0861D084:: @ 861D084 + .incbin "baserom.gba", 0x61d084, 0x74 + +gUnknown_0861D0F8:: @ 861D0F8 + .incbin "baserom.gba", 0x61d0f8, 0x8 + +gUnknown_0861D100:: @ 861D100 + .incbin "baserom.gba", 0x61d100, 0x8 + +gUnknown_0861D108:: @ 861D108 + .incbin "baserom.gba", 0x61d108, 0x18 + +gUnknown_0861D120:: @ 861D120 + .incbin "baserom.gba", 0x61d120, 0x20 + +gUnknown_0861D140:: @ 861D140 + .incbin "baserom.gba", 0x61d140, 0x60 + +gUnknown_0861D1A0:: @ 861D1A0 + .incbin "baserom.gba", 0x61d1a0, 0xd54 + +gUnknown_0861DEF4:: @ 861DEF4 + .incbin "baserom.gba", 0x61def4, 0x314 + +gUnknown_0861E208:: @ 861E208 + .incbin "baserom.gba", 0x61e208, 0xd5c + +gUnknown_0861EF64:: @ 861EF64 + .incbin "baserom.gba", 0x61ef64, 0x350 + +gUnknown_0861F2B4:: @ 861F2B4 + .incbin "baserom.gba", 0x61f2b4, 0xc + +gUnknown_0861F2C0:: @ 861F2C0 + .incbin "baserom.gba", 0x61f2c0, 0x18 + +gUnknown_0861F2D8:: @ 861F2D8 + .incbin "baserom.gba", 0x61f2d8, 0x30 + +gUnknown_0861F308:: @ 861F308 + .incbin "baserom.gba", 0x61f308, 0x4 + +gUnknown_0861F30C:: @ 861F30C + .incbin "baserom.gba", 0x61f30c, 0x2 + +gUnknown_0861F30E:: @ 861F30E + .incbin "baserom.gba", 0x61f30e, 0x2 + +gUnknown_0861F310:: @ 861F310 + .incbin "baserom.gba", 0x61f310, 0x4 + +gUnknown_0861F314:: @ 861F314 + .incbin "baserom.gba", 0x61f314, 0x8 + +gUnknown_0861F31C:: @ 861F31C + .incbin "baserom.gba", 0x61f31c, 0xc + +gUnknown_0861F328:: @ 861F328 + .incbin "baserom.gba", 0x61f328, 0x28 + +gUnknown_0861F350:: @ 861F350 + .incbin "baserom.gba", 0x61f350, 0x20 + +gUnknown_0861F370:: @ 861F370 + .incbin "baserom.gba", 0x61f370, 0x5c + +gUnknown_0861F3CC:: @ 861F3CC + .incbin "baserom.gba", 0x61f3cc, 0x8 + +gUnknown_0861F3D4:: @ 861F3D4 + .incbin "baserom.gba", 0x61f3d4, 0x18 + +gUnknown_0861F3EC:: @ 861F3EC + .incbin "baserom.gba", 0x61f3ec, 0x618 + +gUnknown_0861FA04:: @ 861FA04 + .incbin "baserom.gba", 0x61fa04, 0x4 + +gUnknown_0861FA08:: @ 861FA08 + .incbin "baserom.gba", 0x61fa08, 0x10 + +gUnknown_0861FA18:: @ 861FA18 + .incbin "baserom.gba", 0x61fa18, 0x30 + +gUnknown_0861FA48:: @ 861FA48 + .incbin "baserom.gba", 0x61fa48, 0x4 + +gUnknown_0861FA4C:: @ 861FA4C + .incbin "baserom.gba", 0x61fa4c, 0x8 + +gUnknown_0861FA54:: @ 861FA54 + .incbin "baserom.gba", 0x61fa54, 0x10 + +gUnknown_0861FA64:: @ 861FA64 + .incbin "baserom.gba", 0x61fa64, 0x8 + +gUnknown_0861FA6C:: @ 861FA6C + .incbin "baserom.gba", 0x61fa6c, 0x30 + +gUnknown_0861FA9C:: @ 861FA9C + .incbin "baserom.gba", 0x61fa9c, 0x68 + +gUnknown_0861FB04:: @ 861FB04 + .incbin "baserom.gba", 0x61fb04, 0x28 + +gUnknown_0861FB2C:: @ 861FB2C + .incbin "baserom.gba", 0x61fb2c, 0x18 + +gUnknown_0861FB44:: @ 861FB44 + .incbin "baserom.gba", 0x61fb44, 0xa0 + +gUnknown_0861FBE4:: @ 861FBE4 + .incbin "baserom.gba", 0x61fbe4, 0x4 + +gUnknown_0861FBE8:: @ 861FBE8 + .incbin "baserom.gba", 0x61fbe8, 0xc + +gUnknown_0861FBF4:: @ 861FBF4 + .incbin "baserom.gba", 0x61fbf4, 0x3 + +gUnknown_0861FBF7:: @ 861FBF7 + .incbin "baserom.gba", 0x61fbf7, 0x5 + +gUnknown_0861FBFC:: @ 861FBFC + .incbin "baserom.gba", 0x61fbfc, 0x8 + +gUnknown_0861FC04:: @ 861FC04 + .incbin "baserom.gba", 0x61fc04, 0x18 + +gUnknown_0861FC1C:: @ 861FC1C + .incbin "baserom.gba", 0x61fc1c, 0x20 + +gUnknown_0861FC3C:: @ 861FC3C + .incbin "baserom.gba", 0x61fc3c, 0x18 + +gUnknown_0861FC54:: @ 861FC54 + .incbin "baserom.gba", 0x61fc54, 0x5 + +gUnknown_0861FC59:: @ 861FC59 + .incbin "baserom.gba", 0x61fc59, 0x1f + +gUnknown_0861FC78:: @ 861FC78 + .incbin "baserom.gba", 0x61fc78, 0x2 + +gUnknown_0861FC7A:: @ 861FC7A + .incbin "baserom.gba", 0x61fc7a, 0xc + +gUnknown_0861FC86:: @ 861FC86 + .incbin "baserom.gba", 0x61fc86, 0x12 + +gUnknown_0861FC98:: @ 861FC98 + .incbin "baserom.gba", 0x61fc98, 0x14 + +gUnknown_0861FCAC:: @ 861FCAC + .incbin "baserom.gba", 0x61fcac, 0xa0 + +gUnknown_0861FD4C:: @ 861FD4C + .incbin "baserom.gba", 0x61fd4c, 0x20 + +gUnknown_0861FD6C:: @ 861FD6C + .incbin "baserom.gba", 0x61fd6c, 0x288 + +gUnknown_0861FFF4:: @ 861FFF4 + .incbin "baserom.gba", 0x61fff4, 0x1a0 + +gUnknown_08620194:: @ 8620194 + .incbin "baserom.gba", 0x620194, 0xc + +gUnknown_086201A0:: @ 86201A0 + .incbin "baserom.gba", 0x6201a0, 0x24 + +gUnknown_086201C4:: @ 86201C4 + .incbin "baserom.gba", 0x6201c4, 0x10 + +gUnknown_086201D4:: @ 86201D4 + .incbin "baserom.gba", 0x6201d4, 0x6c + +gUnknown_08620240:: @ 8620240 + .incbin "baserom.gba", 0x620240, 0x4 + +gUnknown_08620244:: @ 8620244 + .incbin "baserom.gba", 0x620244, 0x88 + +gUnknown_086202CC:: @ 86202CC + .incbin "baserom.gba", 0x6202cc, 0x8 + +gUnknown_086202D4:: @ 86202D4 + .incbin "baserom.gba", 0x6202d4, 0x38 + +gUnknown_0862030C:: @ 862030C + .incbin "baserom.gba", 0x62030c, 0x3 + +gUnknown_0862030F:: @ 862030F + .incbin "baserom.gba", 0x62030f, 0x3d + +gUnknown_0862034C:: @ 862034C + .incbin "baserom.gba", 0x62034c, 0x20 + +gUnknown_0862036C:: @ 862036C + .incbin "baserom.gba", 0x62036c, 0x18 + +gUnknown_08620384:: @ 8620384 + .incbin "baserom.gba", 0x620384, 0x1ca4 + +gUnknown_08622028:: @ 8622028 + .incbin "baserom.gba", 0x622028, 0x4e0 + +gUnknown_08622508:: @ 8622508 + .incbin "baserom.gba", 0x622508, 0x2 + +gUnknown_0862250A:: @ 862250A + .incbin "baserom.gba", 0x62250a, 0x6 + +gUnknown_08622510:: @ 8622510 + .incbin "baserom.gba", 0x622510, 0x20 + +gUnknown_08622530:: @ 8622530 + .incbin "baserom.gba", 0x622530, 0xa4 + +gUnknown_086225D4:: @ 86225D4 + .incbin "baserom.gba", 0x6225d4, 0x10c + +gUnknown_086226E0:: @ 86226E0 + .incbin "baserom.gba", 0x6226e0, 0x20 + +gUnknown_08622700:: @ 8622700 + .incbin "baserom.gba", 0x622700, 0x20 + +gUnknown_08622720:: @ 8622720 + .incbin "baserom.gba", 0x622720, 0x40 + +gUnknown_08622760:: @ 8622760 + .incbin "baserom.gba", 0x622760, 0x2c + +gUnknown_0862278C:: @ 862278C + .incbin "baserom.gba", 0x62278c, 0x8 + +gUnknown_08622794:: @ 8622794 + .incbin "baserom.gba", 0x622794, 0x4 + +gUnknown_08622798:: @ 8622798 + .incbin "baserom.gba", 0x622798, 0x40 + +gUnknown_086227D8:: @ 86227D8 + .incbin "baserom.gba", 0x6227d8, 0x8 + +gUnknown_086227E0:: @ 86227E0 + .incbin "baserom.gba", 0x6227e0, 0x8 + +gUnknown_086227E8:: @ 86227E8 + .incbin "baserom.gba", 0x6227e8, 0xc + +gUnknown_086227F4:: @ 86227F4 + .incbin "baserom.gba", 0x6227f4, 0x14 + +gUnknown_08622808:: @ 8622808 + .incbin "baserom.gba", 0x622808, 0x8 + +gUnknown_08622810:: @ 8622810 + .incbin "baserom.gba", 0x622810, 0x8 + +gUnknown_08622818:: @ 8622818 + .incbin "baserom.gba", 0x622818, 0x18 + +gUnknown_08622830:: @ 8622830 + .incbin "baserom.gba", 0x622830, 0x20 + +gUnknown_08622850:: @ 8622850 + .incbin "baserom.gba", 0x622850, 0x18 + +gUnknown_08622868:: @ 8622868 + .incbin "baserom.gba", 0x622868, 0x20 + +gUnknown_08622888:: @ 8622888 + .incbin "baserom.gba", 0x622888, 0x850 + +gUnknown_086230D8:: @ 86230D8 + .incbin "baserom.gba", 0x6230d8, 0xc + +gUnknown_086230E4:: @ 86230E4 + .incbin "baserom.gba", 0x6230e4, 0x14 + +gUnknown_086230F8:: @ 86230F8 + .incbin "baserom.gba", 0x6230f8, 0x8 + +gUnknown_08623100:: @ 8623100 + .incbin "baserom.gba", 0x623100, 0x10 + +gUnknown_08623110:: @ 8623110 + .incbin "baserom.gba", 0x623110, 0x8 + +gUnknown_08623118:: @ 8623118 + .incbin "baserom.gba", 0x623118, 0xb8 + +gUnknown_086231D0:: @ 86231D0 + .incbin "baserom.gba", 0x6231d0, 0x18 + +gUnknown_086231E8:: @ 86231E8 + .incbin "baserom.gba", 0x6231e8, 0x20 + +gUnknown_08623208:: @ 8623208 + .incbin "baserom.gba", 0x623208, 0x20 + +gUnknown_08623228:: @ 8623228 + .incbin "baserom.gba", 0x623228, 0x14 + +gUnknown_0862323C:: @ 862323C + .incbin "baserom.gba", 0x62323c, 0xfc + +gUnknown_08623338:: @ 8623338 + .incbin "baserom.gba", 0x623338, 0x20 + +gUnknown_08623358:: @ 8623358 + .incbin "baserom.gba", 0x623358, 0xc + +gUnknown_08623364:: @ 8623364 + .incbin "baserom.gba", 0x623364, 0x8 + +gUnknown_0862336C:: @ 862336C + .incbin "baserom.gba", 0x62336c, 0x8 + +gUnknown_08623374:: @ 8623374 + .incbin "baserom.gba", 0x623374, 0x8 + +gUnknown_0862337C:: @ 862337C + .incbin "baserom.gba", 0x62337c, 0x8 + +gUnknown_08623384:: @ 8623384 + .incbin "baserom.gba", 0x623384, 0x1c + +gUnknown_086233A0:: @ 86233A0 + .incbin "baserom.gba", 0x6233a0, 0x14 + +gUnknown_086233B4:: @ 86233B4 + .incbin "baserom.gba", 0x6233b4, 0x10 + +gUnknown_086233C4:: @ 86233C4 + .incbin "baserom.gba", 0x6233c4, 0x20 + +gUnknown_086233E4:: @ 86233E4 + .incbin "baserom.gba", 0x6233e4, 0xc8 + +gUnknown_086234AC:: @ 86234AC + .incbin "baserom.gba", 0x6234ac, 0xc4 + +gUnknown_08623570:: @ 8623570 + .incbin "baserom.gba", 0x623570, 0x20 + +gUnknown_08623590:: @ 8623590 + .incbin "baserom.gba", 0x623590, 0x4 + +gUnknown_08623594:: @ 8623594 + .incbin "baserom.gba", 0x623594, 0x4 + +gUnknown_08623598:: @ 8623598 + .incbin "baserom.gba", 0x623598, 0x1c + +gUnknown_086235B4:: @ 86235B4 + .incbin "baserom.gba", 0x6235b4, 0x8 + +gUnknown_086235BC:: @ 86235BC + .incbin "baserom.gba", 0x6235bc, 0xc + +gUnknown_086235C8:: @ 86235C8 + .incbin "baserom.gba", 0x6235c8, 0xc + +gUnknown_086235D4:: @ 86235D4 + .incbin "baserom.gba", 0x6235d4, 0x4 + +gUnknown_086235D8:: @ 86235D8 + .incbin "baserom.gba", 0x6235d8, 0xc + +gUnknown_086235E4:: @ 86235E4 + .incbin "baserom.gba", 0x6235e4, 0x20 + +gUnknown_08623604:: @ 8623604 + .incbin "baserom.gba", 0x623604, 0xc8 + +gUnknown_086236CC:: @ 86236CC + .incbin "baserom.gba", 0x6236cc, 0xc4 + +gUnknown_08623790:: @ 8623790 + .incbin "baserom.gba", 0x623790, 0x20 + +gUnknown_086237B0:: @ 86237B0 + .incbin "baserom.gba", 0x6237b0, 0x4 + +gUnknown_086237B4:: @ 86237B4 + .incbin "baserom.gba", 0x6237b4, 0x4 + +gUnknown_086237B8:: @ 86237B8 + .incbin "baserom.gba", 0x6237b8, 0x1c + +gUnknown_086237D4:: @ 86237D4 + .incbin "baserom.gba", 0x6237d4, 0x8 + +gUnknown_086237DC:: @ 86237DC + .incbin "baserom.gba", 0x6237dc, 0xc + +gUnknown_086237E8:: @ 86237E8 + .incbin "baserom.gba", 0x6237e8, 0xc + +gUnknown_086237F4:: @ 86237F4 + .incbin "baserom.gba", 0x6237f4, 0x4 + +gUnknown_086237F8:: @ 86237F8 + .incbin "baserom.gba", 0x6237f8, 0x44 + +@ 862383C + .include "data/text/ribbon_descriptions.inc" + +@ 8623A74 + .include "data/text/gift_ribbon_descriptions.inc" + +gUnknown_08623FF8:: @ 8623FF8 + .incbin "baserom.gba", 0x623ff8, 0xa0 + +gUnknown_08624098:: @ 8624098 + .incbin "baserom.gba", 0x624098, 0x20 + +gUnknown_086240B8:: @ 86240B8 + .incbin "baserom.gba", 0x6240b8, 0xae0 + +gUnknown_08624B98:: @ 8624B98 + .incbin "baserom.gba", 0x624b98, 0x8 + +gUnknown_08624BA0:: @ 8624BA0 + .incbin "baserom.gba", 0x624ba0, 0x18 + +gUnknown_08624BB8:: @ 8624BB8 + .incbin "baserom.gba", 0x624bb8, 0x8 + +gUnknown_08624BC0:: @ 8624BC0 + .incbin "baserom.gba", 0x624bc0, 0x4 + +gUnknown_08624BC4:: @ 8624BC4 + .incbin "baserom.gba", 0x624bc4, 0x8 + +gUnknown_08624BCC:: @ 8624BCC + .incbin "baserom.gba", 0x624bcc, 0xc + +gUnknown_08624BD8:: @ 8624BD8 + .incbin "baserom.gba", 0x624bd8, 0xc + +gUnknown_08624BE4:: @ 8624BE4 + .incbin "baserom.gba", 0x624be4, 0x4 + +gUnknown_08624BE8:: @ 8624BE8 + .incbin "baserom.gba", 0x624be8, 0x10 + +gUnknown_08624BF8:: @ 8624BF8 + .incbin "baserom.gba", 0x624bf8, 0x80 + +gUnknown_08624C78:: @ 8624C78 + .incbin "baserom.gba", 0x624c78, 0x8 + +gUnknown_08624C80:: @ 8624C80 + .incbin "baserom.gba", 0x624c80, 0x84 + +gUnknown_08624D04:: @ 8624D04 + .incbin "baserom.gba", 0x624d04, 0x5a4 + +gUnknown_086252A8:: @ 86252A8 + .incbin "baserom.gba", 0x6252a8, 0x54 + +gUnknown_086252FC:: @ 86252FC + .incbin "baserom.gba", 0x6252fc, 0x14 + +gUnknown_08625310:: @ 8625310 + .incbin "baserom.gba", 0x625310, 0x14 + +gUnknown_08625324:: @ 8625324 + .incbin "baserom.gba", 0x625324, 0x14 + +gUnknown_08625338:: @ 8625338 + .incbin "baserom.gba", 0x625338, 0x14 + +gUnknown_0862534C:: @ 862534C + .incbin "baserom.gba", 0x62534c, 0x14 + +gUnknown_08625360:: @ 8625360 + .incbin "baserom.gba", 0x625360, 0x14 + +gUnknown_08625374:: @ 8625374 + .incbin "baserom.gba", 0x625374, 0x14 + +gUnknown_08625388:: @ 8625388 + .incbin "baserom.gba", 0x625388, 0x60 + +gUnknown_086253E8:: @ 86253E8 + .incbin "baserom.gba", 0x6253e8, 0x18 + +gUnknown_08625400:: @ 8625400 + .incbin "baserom.gba", 0x625400, 0x3 + +gUnknown_08625403:: @ 8625403 + .incbin "baserom.gba", 0x625403, 0x1 + +gUnknown_08625404:: @ 8625404 + .incbin "baserom.gba", 0x625404, 0xc + +gUnknown_08625410:: @ 8625410 + .incbin "baserom.gba", 0x625410, 0x100 + +gUnknown_08625510:: @ 8625510 + .incbin "baserom.gba", 0x625510, 0x30 + +gUnknown_08625540:: @ 8625540 + .incbin "baserom.gba", 0x625540, 0x8 + +gUnknown_08625548:: @ 8625548 + .incbin "baserom.gba", 0x625548, 0x500 + +gUnknown_08625A48:: @ 8625A48 + .incbin "baserom.gba", 0x625a48, 0x8 + +gUnknown_08625A50:: @ 8625A50 + .incbin "baserom.gba", 0x625a50, 0x18 + +gUnknown_08625A68:: @ 8625A68 + .incbin "baserom.gba", 0x625a68, 0x8 + +gUnknown_08625A70:: @ 8625A70 + .incbin "baserom.gba", 0x625a70, 0x20 + +gUnknown_08625A90:: @ 8625A90 + .incbin "baserom.gba", 0x625a90, 0x18 + +gUnknown_08625AA8:: @ 8625AA8 + .incbin "baserom.gba", 0x625aa8, 0x18 + +gUnknown_08625AC0:: @ 8625AC0 + .incbin "baserom.gba", 0x625ac0, 0x8 + +gUnknown_08625AC8:: @ 8625AC8 + .incbin "baserom.gba", 0x625ac8, 0x4c + +gUnknown_08625B14:: @ 8625B14 + .incbin "baserom.gba", 0x625b14, 0x18 + +gUnknown_08625B2C:: @ 8625B2C + .incbin "baserom.gba", 0x625b2c, 0x28 + +gUnknown_08625B54:: @ 8625B54 + .incbin "baserom.gba", 0x625b54, 0x18 + +gUnknown_08625B6C:: @ 8625B6C + .incbin "baserom.gba", 0x625b6c, 0x520 + +gUnknown_0862608C:: @ 862608C + .incbin "baserom.gba", 0x62608c, 0x2 + +gUnknown_0862608E:: @ 862608E + .incbin "baserom.gba", 0x62608e, 0x4326 + +gUnknown_0862A3B4:: @ 862A3B4 + .incbin "baserom.gba", 0x62a3b4, 0x218 + +gUnknown_0862A5CC:: @ 862A5CC + .incbin "baserom.gba", 0x62a5cc, 0x8 + +gUnknown_0862A5D4:: @ 862A5D4 + .incbin "baserom.gba", 0x62a5d4, 0x20 + +gUnknown_0862A5F4:: @ 862A5F4 + .incbin "baserom.gba", 0x62a5f4, 0x4 + +gUnknown_0862A5F8:: @ 862A5F8 + .incbin "baserom.gba", 0x62a5f8, 0x20 + +gUnknown_0862A618:: @ 862A618 + .incbin "baserom.gba", 0x62a618, 0x48 + +gUnknown_0862A660:: @ 862A660 + .incbin "baserom.gba", 0x62a660, 0x10 + +gUnknown_0862A670:: @ 862A670 + .incbin "baserom.gba", 0x62a670, 0x18 + +gUnknown_0862A688:: @ 862A688 + .incbin "baserom.gba", 0x62a688, 0x10 + +gUnknown_0862A698:: @ 862A698 + .incbin "baserom.gba", 0x62a698, 0x8 + +gUnknown_0862A6A0:: @ 862A6A0 + .incbin "baserom.gba", 0x62a6a0, 0x8c + +gUnknown_0862A72C:: @ 862A72C + .incbin "baserom.gba", 0x62a72c, 0x24 + +gUnknown_0862A750:: @ 862A750 + .incbin "baserom.gba", 0x62a750, 0x24 + +gUnknown_0862A774:: @ 862A774 + .incbin "baserom.gba", 0x62a774, 0xa8 + +gUnknown_0862A81C:: @ 862A81C + .incbin "baserom.gba", 0x62a81c, 0x30 + +gUnknown_0862A84C:: @ 862A84C + .incbin "baserom.gba", 0x62a84c, 0x18 + +gUnknown_0862A864:: @ 862A864 + .incbin "baserom.gba", 0x62a864, 0x18 + +gUnknown_0862A87C:: @ 862A87C + .incbin "baserom.gba", 0x62a87c, 0xc + +gUnknown_0862A888:: @ 862A888 + .incbin "baserom.gba", 0x62a888, 0x3c + +gUnknown_0862A8C4:: @ 862A8C4 + .incbin "baserom.gba", 0x62a8c4, 0x8 + +gUnknown_0862A8CC:: @ 862A8CC + .incbin "baserom.gba", 0x62a8cc, 0x8 + +gUnknown_0862A8D4:: @ 862A8D4 + .incbin "baserom.gba", 0x62a8d4, 0x24 + +gUnknown_0862A8F8:: @ 862A8F8 + .incbin "baserom.gba", 0x62a8f8, 0x8 + +gUnknown_0862A900:: @ 862A900 + .incbin "baserom.gba", 0x62a900, 0x24 + +gUnknown_0862A924:: @ 862A924 + .incbin "baserom.gba", 0x62a924, 0x8 + +gUnknown_0862A92C:: @ 862A92C + .incbin "baserom.gba", 0x62a92c, 0xa8 + +gUnknown_0862A9D4:: @ 862A9D4 + .incbin "baserom.gba", 0x62a9d4, 0x8 + +gUnknown_0862A9DC:: @ 862A9DC + .incbin "baserom.gba", 0x62a9dc, 0x8 + +gUnknown_0862A9E4:: @ 862A9E4 + .incbin "baserom.gba", 0x62a9e4, 0x30 + +gUnknown_0862AA14:: @ 862AA14 + .incbin "baserom.gba", 0x62aa14, 0x8 + +gUnknown_0862AA1C:: @ 862AA1C + .incbin "baserom.gba", 0x62aa1c, 0x18 + +gUnknown_0862AA34:: @ 862AA34 + .incbin "baserom.gba", 0x62aa34, 0x8 + +gUnknown_0862AA3C:: @ 862AA3C + .incbin "baserom.gba", 0x62aa3c, 0x18 + +gUnknown_0862AA54:: @ 862AA54 + .incbin "baserom.gba", 0x62aa54, 0x3c + +gUnknown_0862AA90:: @ 862AA90 + .incbin "baserom.gba", 0x62aa90, 0x8 + +gUnknown_0862AA98:: @ 862AA98 + .incbin "baserom.gba", 0x62aa98, 0x8 + +gUnknown_0862AAA0:: @ 862AAA0 + .incbin "baserom.gba", 0x62aaa0, 0x18 + +gUnknown_0862AAB8:: @ 862AAB8 + .incbin "baserom.gba", 0x62aab8, 0x14 + +gUnknown_0862AACC:: @ 862AACC + .incbin "baserom.gba", 0x62aacc, 0x30 + +gUnknown_0862AAFC:: @ 862AAFC + .incbin "baserom.gba", 0x62aafc, 0x8 + +gUnknown_0862AB04:: @ 862AB04 + .incbin "baserom.gba", 0x62ab04, 0x8 + +gUnknown_0862AB0C:: @ 862AB0C + .incbin "baserom.gba", 0x62ab0c, 0x8 + +gUnknown_0862AB14:: @ 862AB14 + .incbin "baserom.gba", 0x62ab14, 0x18 + +gUnknown_0862AB2C:: @ 862AB2C + .incbin "baserom.gba", 0x62ab2c, 0x18 + +gUnknown_0862AB44:: @ 862AB44 + .incbin "baserom.gba", 0x62ab44, 0xe4 + +gUnknown_0862AC28:: @ 862AC28 + .incbin "baserom.gba", 0x62ac28, 0x8 + +gUnknown_0862AC30:: @ 862AC30 + .incbin "baserom.gba", 0x62ac30, 0x8 + +gUnknown_0862AC38:: @ 862AC38 + .incbin "baserom.gba", 0x62ac38, 0x8 + +gUnknown_0862AC40:: @ 862AC40 + .incbin "baserom.gba", 0x62ac40, 0x8 + +gUnknown_0862AC48:: @ 862AC48 + .incbin "baserom.gba", 0x62ac48, 0x8 + +gUnknown_0862AC50:: @ 862AC50 + .incbin "baserom.gba", 0x62ac50, 0x8 + +gUnknown_0862AC58:: @ 862AC58 + .incbin "baserom.gba", 0x62ac58, 0x8 + +gUnknown_0862AC60:: @ 862AC60 + .incbin "baserom.gba", 0x62ac60, 0x8 + +gUnknown_0862AC68:: @ 862AC68 + .incbin "baserom.gba", 0x62ac68, 0x8 + +gUnknown_0862AC70:: @ 862AC70 + .incbin "baserom.gba", 0x62ac70, 0x8 + +gUnknown_0862AC78:: @ 862AC78 + .incbin "baserom.gba", 0x62ac78, 0x18 + +gUnknown_0862AC90:: @ 862AC90 + .incbin "baserom.gba", 0x62ac90, 0x18 + +gUnknown_0862ACA8:: @ 862ACA8 + .incbin "baserom.gba", 0x62aca8, 0x18 + +gUnknown_0862ACC0:: @ 862ACC0 + .incbin "baserom.gba", 0x62acc0, 0x18 + +gUnknown_0862ACD8:: @ 862ACD8 + .incbin "baserom.gba", 0x62acd8, 0x18 + +gUnknown_0862ACF0:: @ 862ACF0 + .incbin "baserom.gba", 0x62acf0, 0x18 + +gUnknown_0862AD08:: @ 862AD08 + .incbin "baserom.gba", 0x62ad08, 0xc + +gUnknown_0862AD14:: @ 862AD14 + .incbin "baserom.gba", 0x62ad14, 0x20 + +gUnknown_0862AD34:: @ 862AD34 + .incbin "baserom.gba", 0x62ad34, 0x10 + +gUnknown_0862AD44:: @ 862AD44 + .incbin "baserom.gba", 0x62ad44, 0x10 + +gUnknown_0862AD54:: @ 862AD54 + .incbin "baserom.gba", 0x62ad54, 0x1dc + +gUnknown_0862AF30:: @ 862AF30 + .incbin "baserom.gba", 0x62af30, 0x60c + +gUnknown_0862B53C:: @ 862B53C + .incbin "baserom.gba", 0x62b53c, 0x1e8 + +gUnknown_0862B724:: @ 862B724 + .incbin "baserom.gba", 0x62b724, 0x8 + +gUnknown_0862B72C:: @ 862B72C + .incbin "baserom.gba", 0x62b72c, 0x2c + +gUnknown_0862B758:: @ 862B758 + .incbin "baserom.gba", 0x62b758, 0x18 + +gUnknown_0862B770:: @ 862B770 + .incbin "baserom.gba", 0x62b770, 0x14 + +gUnknown_0862B784:: @ 862B784 + .incbin "baserom.gba", 0x62b784, 0x14 + +gUnknown_0862B798:: @ 862B798 + .incbin "baserom.gba", 0x62b798, 0x14 + +gUnknown_0862B7AC:: @ 862B7AC + .incbin "baserom.gba", 0x62b7ac, 0x14 + +gUnknown_0862B7C0:: @ 862B7C0 + .incbin "baserom.gba", 0x62b7c0, 0x14 + +gUnknown_0862B7D4:: @ 862B7D4 + .incbin "baserom.gba", 0x62b7d4, 0x14 + +gUnknown_0862B7E8:: @ 862B7E8 + .incbin "baserom.gba", 0x62b7e8, 0x14 + +gUnknown_0862B7FC:: @ 862B7FC + .incbin "baserom.gba", 0x62b7fc, 0x2e8 + + \ No newline at end of file diff --git a/data/event_script_command_function_table.inc b/data/event_script_command_function_table.inc index b34f8f666..f44cdb7db 100644 --- a/data/event_script_command_function_table.inc +++ b/data/event_script_command_function_table.inc @@ -1,5 +1,5 @@ .align 2 -gEventScriptCommandFunctionTable:: @ 81DB67C +gScriptCmdTable:: @ 81DB67C .4byte s00_nop .4byte s01_nop .4byte s02_end @@ -144,8 +144,8 @@ gEventScriptCommandFunctionTable:: @ 81DB67C .4byte sub_809B7A4 .4byte sub_809B7B4 .4byte s8F_get_random_val - .4byte s90_add_money - .4byte s91_subtract_money + .4byte s90_AddMoney + .4byte s91_SubtractMoney .4byte s92_check_money .4byte s93_display_money .4byte s94_hide_money diff --git a/data/event_scripts.s b/data/event_scripts.s index 3bfd9fdfd..cef599407 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -6,7 +6,7 @@ @ 81DB67C .include "data/event_script_command_function_table.inc" -gUnknown_081DBA08:: @ 81DBA08 +gScriptCmdTableEnd:: @ 81DBA08 .incbin "baserom.gba", 0x1dba08, 0x4 gSpecialVars:: @ 81DBA0C diff --git a/data/field_effect_scripts.s b/data/field_effect_scripts.s index d879df0ce..89ed27301 100644 --- a/data/field_effect_scripts.s +++ b/data/field_effect_scripts.s @@ -280,7 +280,7 @@ gFieldEffectScript_Unknown50:: @ 82DBC76 field_eff_end gFieldEffectScript_Unknown51:: @ 82DBC80 - field_eff_callnative sub_8159F2C + field_eff_callnative FldEff_SweetScent field_eff_end gFieldEffectScript_Unknown52:: @ 82DBC86 @@ -329,7 +329,7 @@ gFieldEffectScript_Unknown62:: @ 82DBCDE field_eff_end gFieldEffectScript_Unknown63:: @ 82DBCED - field_eff_callnative sub_817C91C + field_eff_callnative FldEff_UseTeleport field_eff_end gFieldEffectScript_Rayquaza:: @ 82DBCF3 diff --git a/data/item_effect_info.inc b/data/item_effect_info.inc index 0af148be3..adbe86619 100644 --- a/data/item_effect_info.inc +++ b/data/item_effect_info.inc @@ -658,7 +658,7 @@ gTamatoBerryItemEffectInfo:: @ 831E57F .byte 0x02 .align 2 -gItemEffectInfoPointers:: @ 831E58C +gItemEffectTable:: @ 831E58C .4byte gPotionItemEffectInfo .4byte gAntidoteItemEffectInfo .4byte gBurnHealItemEffectInfo diff --git a/data/level_up_learnset_pointers.inc b/data/level_up_learnset_pointers.inc index 823124c55..4b757dda9 100644 --- a/data/level_up_learnset_pointers.inc +++ b/data/level_up_learnset_pointers.inc @@ -1,5 +1,5 @@ .align 2 -gLevelUpLearnsetPointers:: @ 832937C +gLevelUpLearnsets:: @ 832937C .4byte gBulbasaurLevelUpLearnset .4byte gBulbasaurLevelUpLearnset .4byte gIvysaurLevelUpLearnset diff --git a/data/rom_8158B30.s b/data/rom_8158B30.s index 1502efc2a..c8d9baa1a 100644 --- a/data/rom_8158B30.s +++ b/data/rom_8158B30.s @@ -3,8 +3,6 @@ .section .rodata -gUnknown_085CDF20:: @ 85CDF20 - .incbin "baserom.gba", 0x5cdf20, 0x380 gUnknown_085CE2A0:: @ 85CE2A0 .incbin "baserom.gba", 0x5ce2a0, 0xb0 @@ -84,7 +82,7 @@ gUnknown_085CEC10:: @ 85CEC10 gUnknown_085CEC28:: @ 85CEC28 .incbin "baserom.gba", 0x5cec28, 0x8 -gUnknown_085CEC30:: @ 85CEC30 +sRoamerLocations:: @ 85CEC30 .incbin "baserom.gba", 0x5cec30, 0x80 @ 85CECB0 @@ -236,6 +234,3 @@ gUnknown_085DFDA0:: @ 85DFDA0 gUnknown_085DFDB8:: @ 85DFDB8 .incbin "baserom.gba", 0x5dfdb8, 0x8 - -gWallyBufferCommands:: @ 85DFDC0 - .incbin "baserom.gba", 0x5dfdc0, 0xe4 diff --git a/data/strings.s b/data/strings.s index 751449a1f..94cf82c59 100644 --- a/data/strings.s +++ b/data/strings.s @@ -46,49 +46,69 @@ gExpandedPlaceholder_May:: @ 85E8260 .string "MAY$" gUnknown_085E8264:: @ 85E8264 - .incbin "baserom.gba", 0x5e8264, 0x4 + +.string "EGG$" gUnknown_085E8268:: @ 85E8268 - .incbin "baserom.gba", 0x5e8268, 0x14 + +.string "POKéMON$" +.string "PROF. BIRCH$" gUnknown_085E827C:: @ 85E827C - .incbin "baserom.gba", 0x5e827c, 0x9 + +.string "NEW GAME$" gUnknown_085E8285:: @ 85E8285 - .incbin "baserom.gba", 0x5e8285, 0x9 + +.string "CONTINUE$" gUnknown_085E828E:: @ 85E828E - .incbin "baserom.gba", 0x5e828e, 0x7 + +.string "OPTION$" gUnknown_085E8295:: @ 85E8295 - .incbin "baserom.gba", 0x5e8295, 0xd + +.string "MYSTERY GIFT$" gUnknown_085E82A2:: @ 85E82A2 - .incbin "baserom.gba", 0x5e82a2, 0xd + +.string "MYSTERY GIFT$" gUnknown_085E82AF:: @ 85E82AF - .incbin "baserom.gba", 0x5e82af, 0xf + +.string "MYSTERY EVENTS$" gUnknown_085E82BE:: @ 85E82BE - .incbin "baserom.gba", 0x5e82be, 0x27 + +.string "The Wireless Adapter is not\nconnected.$" gUnknown_085E82E5:: @ 85E82E5 - .incbin "baserom.gba", 0x5e82e5, 0x43 + +.string "MYSTERY GIFT can’t be used while\nthe Wireless Adapter is attached.$" gUnknown_085E8328:: @ 85E8328 - .incbin "baserom.gba", 0x5e8328, 0x9a + +.string "MYSTERY EVENTS can’t be used while\nthe Wireless Adapter is attached.$" +.string "Updating save file using external\ndata. Please wait.$" +.string "The save file has been updated.$" gUnknown_085E83C2:: @ 85E83C2 - .incbin "baserom.gba", 0x5e83c2, 0x43 + +.string "The save file is corrupted. The\nprevious save file will be loaded.$" gUnknown_085E8405:: @ 85E8405 - .incbin "baserom.gba", 0x5e8405, 0x3b + +.string "The save file has been erased\ndue to corruption or damage.$" gUnknown_085E8440:: @ 85E8440 - .incbin "baserom.gba", 0x5e8440, 0x13 + +.string "1M%ブÊば+が ÎÎっÛÁまÓ+!$" gUnknown_085E8453:: @ 85E8453 - .incbin "baserom.gba", 0x5e8453, 0x7b + +.string "The internal battery has run dry.\nThe game can be played.\pHowever, clock-based events will\nno longer occur.$" +.string "PLAYER$" +.string "POKéDEX$" gUnknown_085E84CE:: @ 85E84CE .incbin "baserom.gba", 0x5e84ce, 0x8e @@ -100,232 +120,425 @@ gUnknown_085E8574:: @ 85E8574 .incbin "baserom.gba", 0x5e8574, 0x14 gUnknown_085E8588:: @ 85E8588 - .incbin "baserom.gba", 0x5e8588, 0x10a + +.string "{248} EXIT$" +.string "BOY$" +.string "GIRL$" +.string "STU$" +.string "MILTON$" +.string "TOM$" +.string "KENNY$" +.string "REID$" +.string "JUDE$" +.string "JAXSON$" +.string "EASTON$" +.string "WALKER$" +.string "TERU$" +.string "JOHNNY$" +.string "BRETT$" +.string "SETH$" +.string "TERRY$" +.string "CASEY$" +.string "DARREN$" +.string "LANDON$" +.string "COLLIN$" +.string "STANLEY$" +.string "QUINCY$" +.string "KIMMY$" +.string "TIARA$" +.string "BELLA$" +.string "JAYLA$" +.string "ALLIE$" +.string "LIANNA$" +.string "SARA$" +.string "MONICA$" +.string "CAMILA$" +.string "AUBREE$" +.string "RUTHIE$" +.string "HAZEL$" +.string "NADINE$" +.string "TANJA$" +.string "YASMIN$" +.string "NICOLA$" +.string "LILLIE$" +.string "TERRA$" +.string "LUCY$" +.string "HALIE$" gUnknown_085E8692:: @ 85E8692 - .incbin "baserom.gba", 0x5e8692, 0x26 + +.string "This is what we call a “POKéMON.”{PAUSE 96}\p$" gUnknown_085E86B8:: @ 85E86B8 - .incbin "baserom.gba", 0x5e86b8, 0xe + +.string "????? POKéMON$" gUnknown_085E86C6:: @ 85E86C6 - .incbin "baserom.gba", 0x5e86c6, 0xa + +.string "{CLEAR_TO}Ï??’??”$" gUnknown_085E86D0:: @ 85E86D0 - .incbin "baserom.gba", 0x5e86d0, 0x4b + +.string "????.? lbs.$" +.string " POKéMON$" +.string "{CLEAR_TO}Ï ’ ”$" +.string " . lbs.$" +.string "$" gUnknown_085E871B:: @ 85E871B - .incbin "baserom.gba", 0x5e871b, 0x8 + +.string "CRY OF$" +.string "$" gUnknown_085E8723:: @ 85E8723 - .incbin "baserom.gba", 0x5e8723, 0x12 + +.string "SIZE COMPARED TO $" gUnknown_085E8735:: @ 85E8735 - .incbin "baserom.gba", 0x5e8735, 0x20 + +.string "POKéDEX registration completed.$" gUnknown_085E8755:: @ 85E8755 - .incbin "baserom.gba", 0x5e8755, 0x3 + +.string "HT$" gUnknown_085E8758:: @ 85E8758 - .incbin "baserom.gba", 0x5e8758, 0x3 + +.string "WT$" gUnknown_085E875B:: @ 85E875B - .incbin "baserom.gba", 0x5e875b, 0x18 + +.string "Searching…\nPlease wait.$" gUnknown_085E8773:: @ 85E8773 - .incbin "baserom.gba", 0x5e8773, 0x12 + +.string "Search completed.$" gUnknown_085E8785:: @ 85E8785 - .incbin "baserom.gba", 0x5e8785, 0x3b5 + +.string "No matching POKéMON were found.$" +.string "Search for POKéMON based on\nselected parameters.$" +.string "Switch POKéDEX listings.$" +.string "Return to the POKéDEX.$" +.string "Select the POKéDEX mode.$" +.string "Select the POKéDEX listing mode.$" +.string "List by the first letter in the name.\nSpotted POKéMON only.$" +.string "List by body color.\nSpotted POKéMON only.$" +.string "List by type.\nOwned POKéMON only.$" +.string "Execute search/switch.$" +.string "HOENN DEX$" +.string "NATIONAL DEX$" +.string "NUMERICAL MODE$" +.string "A TO Z MODE$" +.string "HEAVIEST MODE$" +.string "LIGHTEST MODE$" +.string "TALLEST MODE$" +.string "SMALLEST MODE$" +.string "ABC$" +.string "DEF$" +.string "GHI$" +.string "JKL$" +.string "MNO$" +.string "PQR$" +.string "STU$" +.string "VWX$" +.string "YZ$" +.string "RED$" +.string "BLUE$" +.string "YELLOW$" +.string "GREEN$" +.string "BLACK$" +.string "BROWN$" +.string "PURPLE$" +.string "GRAY$" +.string "WHITE$" +.string "PINK$" +.string "HOENN region’s POKéDEX$" +.string "National edition POKéDEX$" +.string "POKéMON are listed according to their\nnumber.$" +.string "Spotted and owned POKéMON are listed\nalphabetically.$" +.string "Owned POKéMON are listed from the\nheaviest to the lightest.$" +.string "Owned POKéMON are listed from the\nlightest to the heaviest.$" +.string "Owned POKéMON are listed from the\ntallest to the smallest.$" +.string "Owned POKéMON are listed from the\nsmallest to the tallest.$" +.string "$" +.string "DON’T SPECIFY.$" +.string "NONE$" gUnknown_085E8B3A:: @ 85E8B3A - .incbin "baserom.gba", 0x5e8b3a, 0x4 + +.string "▶$" +.string " $" gUnknown_085E8B3E:: @ 85E8B3E - .incbin "baserom.gba", 0x5e8b3e, 0x9e + +.string "Welcome to the HALL OF FAME!$" +.string "Spotted POKéMON: {STR_VAR_1}!\nOwned POKéMON: {STR_VAR_2}!\pPROF. BIRCH’s POKéDEX rating!\pPROF. BIRCH: Let’s see…\p$" +.string "SAVING…\nDON’T TURN OFF THE POWER.$" gUnknown_085E8BDC:: @ 85E8BDC - .incbin "baserom.gba", 0x5e8bdc, 0x24 + +.string "The HALL OF FAME data is corrupted.$" gUnknown_085E8C00:: @ 85E8C00 - .incbin "baserom.gba", 0x5e8c00, 0x14 + +.string "HALL OF FAME No. {STR_VAR_1}$" gUnknown_085E8C14:: @ 85E8C14 - .incbin "baserom.gba", 0x5e8c14, 0x22 + +.string "LEAGUE CHAMPION!\nCONGRATULATIONS!$" gUnknown_085E8C36:: @ 85E8C36 - .incbin "baserom.gba", 0x5e8c36, 0x5 + +.string "No. $" gUnknown_085E8C3B:: @ 85E8C3B - .incbin "baserom.gba", 0x5e8c3b, 0xd + +.string "Lv. $" +.string "IDNo. /$" gUnknown_085E8C48:: @ 85E8C48 - .incbin "baserom.gba", 0x5e8c48, 0x5 + +.string "NAME$" gUnknown_085E8C4D:: @ 85E8C4D - .incbin "baserom.gba", 0x5e8c4d, 0x6 + +.string "IDNo.$" gUnknown_085E8C53:: @ 85E8C53 - .incbin "baserom.gba", 0x5e8c53, 0x3d + +.string "PROF. BIRCH is in trouble!\nRelease a POKéMON and rescue him!$" gUnknown_085E8C90:: @ 85E8C90 - .incbin "baserom.gba", 0x5e8c90, 0x24 + +.string "Do you choose this POKéMON?$" +.string "POKéMON$" gUnknown_085E8CB4:: @ 85E8CB4 - .incbin "baserom.gba", 0x5e8cb4, 0x2f + +.string "FLY to where?$" +.string "USE$" +.string "TOSS$" +.string "REGISTER$" +.string "GIVE$" +.string "CHECK TAG$" gUnknown_085E8CE3:: @ 85E8CE3 - .incbin "baserom.gba", 0x5e8ce3, 0xd + +.string "CONFIRM$" +.string "WALK$" gUnknown_085E8CF0:: @ 85E8CF0 - .incbin "baserom.gba", 0x5e8cf0, 0x7 + +.string "CANCEL$" gUnknown_085E8CF7:: @ 85E8CF7 - .incbin "baserom.gba", 0x5e8cf7, 0xc + +.string "CANCEL$" +.string "SHOW$" gUnknown_085E8D03:: @ 85E8D03 - .incbin "baserom.gba", 0x5e8d03, 0x23 + +.string "$" +.string "CANCEL$" +.string "ITEM$" +.string "MAIL$" +.string "TAKE$" +.string "STORE$" +.string "CHECK$" gUnknown_085E8D26:: @ 85E8D26 - .incbin "baserom.gba", 0x5e8d26, 0xe + +.string "NONE$" +.string "DESELECT$" gUnknown_085E8D34:: @ 85E8D34 - .incbin "baserom.gba", 0x5e8d34, 0x4 + +.string "???$" gUnknown_085E8D38:: @ 85E8D38 - .incbin "baserom.gba", 0x5e8d38, 0x6 + +.string "?????$" gUnknown_085E8D3E:: @ 85E8D3E - .incbin "baserom.gba", 0x5e8d3e, 0x2 + +.string "/$" gUnknown_085E8D40:: @ 85E8D40 - .incbin "baserom.gba", 0x5e8d40, 0x2 + +.string "-$" gUnknown_085E8D42:: @ 85E8D42 - .incbin "baserom.gba", 0x5e8d42, 0x3 + +.string "--$" gUnknown_085E8D45:: @ 85E8D45 - .incbin "baserom.gba", 0x5e8d45, 0x4 + +.string "---$" gUnknown_085E8D49:: @ 85E8D49 - .incbin "baserom.gba", 0x5e8d49, 0x2 + +.string "♂$" gUnknown_085E8D4B:: @ 85E8D4B - .incbin "baserom.gba", 0x5e8d4b, 0x2 + +.string "♀$" gUnknown_085E8D4D:: @ 85E8D4D - .incbin "baserom.gba", 0x5e8d4d, 0x2 + +.string "{LV}$" gUnknown_085E8D4F:: @ 85E8D4F - .incbin "baserom.gba", 0x5e8d4f, 0xa + +.string "{249 8}{CLEAR}À$" +.string "+$" +.string "{RIGHT_ARROW}$" gUnknown_085E8D59:: @ 85E8D59 - .incbin "baserom.gba", 0x5e8d59, 0x5 + +.string "{249 7}{249 8}$" gUnknown_085E8D5E:: @ 85E8D5E - .incbin "baserom.gba", 0x5e8d5e, 0x2 + +.string " $" gUnknown_085E8D60:: @ 85E8D60 - .incbin "baserom.gba", 0x5e8d60, 0x2 + +.string "▶$" gUnknown_085E8D62:: @ 85E8D62 - .incbin "baserom.gba", 0x5e8d62, 0x1e + +.string "Go back to the\nprevious menu.$" gUnknown_085E8D80:: @ 85E8D80 - .incbin "baserom.gba", 0x5e8d80, 0x20 + +.string "What would you like to do?$" +.string "GIVE$" gUnknown_085E8DA0:: @ 85E8DA0 - .incbin "baserom.gba", 0x5e8da0, 0xb -gUnknown_085E8DAB:: @ 85E8DAB - .incbin "baserom.gba", 0x5e8dab, 0x9 +.string "×{STR_VAR_1}$" +.string " BERRY$" + +gOtherText_Coins2:: @ 85E8DAB + +.string "{STR_VAR_1} COINS$" gUnknown_085E8DB4:: @ 85E8DB4 - .incbin "baserom.gba", 0x5e8db4, 0xa + +.string "CLOSE BAG$" gUnknown_085E8DBE:: @ 85E8DBE - .incbin "baserom.gba", 0x5e8dbe, 0x10 + +.string "{STR_VAR_1} is\nselected.$" gUnknown_085E8DCE:: @ 85E8DCE - .incbin "baserom.gba", 0x5e8dce, 0x1b + +.string "You can’t write\nMAIL here.$" gUnknown_085E8DE9:: @ 85E8DE9 - .incbin "baserom.gba", 0x5e8de9, 0x15 + +.string "There is no\nPOKéMON.$" gUnknown_085E8DFE:: @ 85E8DFE - .incbin "baserom.gba", 0x5e8dfe, 0x13 + +.string "Move the\n{STR_VAR_1}\nwhere?$" gUnknown_085E8E11:: @ 85E8E11 - .incbin "baserom.gba", 0x5e8e11, 0x16 + +.string "The {STR_VAR_1} can’t be held.$" gUnknown_085E8E27:: @ 85E8E27 - .incbin "baserom.gba", 0x5e8e27, 0x1b + +.string "The {STR_VAR_1} can’t be held\nhere.$" gUnknown_085E8E42:: @ 85E8E42 - .incbin "baserom.gba", 0x5e8e42, 0x18 + +.string "Deposit how many\n{STR_VAR_1}(s)?$" gUnknown_085E8E5A:: @ 85E8E5A - .incbin "baserom.gba", 0x5e8e5a, 0x14 + +.string "Deposited {STR_VAR_2}\n{STR_VAR_1}(s).$" gUnknown_085E8E6E:: @ 85E8E6E - .incbin "baserom.gba", 0x5e8e6e, 0x20 + +.string "There’s no room to\nstore items.$" gUnknown_085E8E8E:: @ 85E8E8E - .incbin "baserom.gba", 0x5e8e8e, 0x2b + +.string "Important items\ncan’t be stored in\nthe PC!$" gUnknown_085E8EB9:: @ 85E8EB9 - .incbin "baserom.gba", 0x5e8eb9, 0x27 + +.string "That’s much too\nimportant to toss\nout!$" gUnknown_085E8EE0:: @ 85E8EE0 - .incbin "baserom.gba", 0x5e8ee0, 0x19 + +.string "Toss out how many\n{STR_VAR_1}(s)?$" gUnknown_085E8EF9:: @ 85E8EF9 - .incbin "baserom.gba", 0x5e8ef9, 0x15 + +.string "Threw away {STR_VAR_2}\n{STR_VAR_1}(s).$" gUnknown_085E8F0E:: @ 85E8F0E - .incbin "baserom.gba", 0x5e8f0e, 0x23 + +.string "Is it okay to\nthrow away {STR_VAR_2}\n{STR_VAR_1}(s)?$" gUnknown_085E8F31:: @ 85E8F31 - .incbin "baserom.gba", 0x5e8f31, 0x3d + +.string "DAD’s advice…\n{PLAYER}, there’s a time and place for\leverything!{PAUSE_UNTIL_PRESS}$" gUnknown_085E8F6E:: @ 85E8F6E - .incbin "baserom.gba", 0x5e8f6e, 0x25 + +.string "You can’t dismount your BIKE here.{PAUSE_UNTIL_PRESS}$" gUnknown_085E8F93:: @ 85E8F93 - .incbin "baserom.gba", 0x5e8f93, 0x48 + +.string "Huh?\nThe ITEMFINDER’s responding!\pThere’s an item buried around here!{PAUSE_UNTIL_PRESS}$" gUnknown_085E8FDB:: @ 85E8FDB - .incbin "baserom.gba", 0x5e8fdb, 0x27 + +.string "Oh!\nThe ITEMFINDER’s shaking wildly!{PAUSE_UNTIL_PRESS}$" gUnknown_085E9002:: @ 85E9002 - .incbin "baserom.gba", 0x5e9002, 0x24 + +.string "… … … …Nope!\nThere’s no response.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9026:: @ 85E9026 - .incbin "baserom.gba", 0x5e9026, 0x11 + +.string "Your COINS:\n{STR_VAR_1}{PAUSE_UNTIL_PRESS}$" gUnknown_085E9037:: @ 85E9037 - .incbin "baserom.gba", 0x5e9037, 0x10 + +.string "Booted up a TM.$" gUnknown_085E9047:: @ 85E9047 - .incbin "baserom.gba", 0x5e9047, 0x11 + +.string "Booted up an HM.$" gUnknown_085E9058:: @ 85E9058 - .incbin "baserom.gba", 0x5e9058, 0x28 + +.string "It contained\n{STR_VAR_1}.\pTeach {STR_VAR_1}\nto a POKéMON?$" gUnknown_085E9080:: @ 85E9080 - .incbin "baserom.gba", 0x5e9080, 0x12 + +.string "{PLAYER} used the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9092:: @ 85E9092 - .incbin "baserom.gba", 0x5e9092, 0x34 + +.string "But the effects of a REPEL\nlingered from earlier.{PAUSE_UNTIL_PRESS}$" gUnknown_085E90C6:: @ 85E90C6 - .incbin "baserom.gba", 0x5e90c6, 0x2e + +.string "{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be lured.{PAUSE_UNTIL_PRESS}$" gUnknown_085E90F4:: @ 85E90F4 - .incbin "baserom.gba", 0x5e90f4, 0x31 + +.string "{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be repelled.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9125:: @ 85E9125 - .incbin "baserom.gba", 0x5e9125, 0x13 + +.string "The BOX is full.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9138:: @ 85E9138 .incbin "baserom.gba", 0x5e9138, 0x48 @@ -343,313 +556,485 @@ gUnknown_085E91FC:: @ 85E91FC .incbin "baserom.gba", 0x5e91fc, 0x14 gUnknown_085E9210:: @ 85E9210 - .incbin "baserom.gba", 0x5e9210, 0xa + +.string "{249 8}{STR_VAR_1}{CLEAR}Ê{STR_VAR_2}$" gUnknown_085E921A:: @ 85E921A - .incbin "baserom.gba", 0x5e921a, 0xb + +.string "{CLEAR_TO}Ù{STR_VAR_1}{CLEAR}È{STR_VAR_2}$" gUnknown_085E9225:: @ 85E9225 - .incbin "baserom.gba", 0x5e9225, 0x7 + +.string "SIZE /$" gUnknown_085E922C:: @ 85E922C - .incbin "baserom.gba", 0x5e922c, 0x7 + +.string "FIRM /$" gUnknown_085E9233:: @ 85E9233 - .incbin "baserom.gba", 0x5e9233, 0x7 -@ 85E923A +.string "{STR_VAR_1}.{STR_VAR_2}”$" + + .include "data/text/berry_firmness_strings.inc" gUnknown_085E9263:: @ 85E9263 - .incbin "baserom.gba", 0x5e9263, 0x8 + +.string "{249 8}{STR_VAR_1} {STR_VAR_2}$" gUnknown_085E926B:: @ 85E926B - .incbin "baserom.gba", 0x5e926b, 0xb2 + +.string "BERRY TAG$" +.string "RED {POKEBLOCK}$" +.string "BLUE {POKEBLOCK}$" +.string "PINK {POKEBLOCK}$" +.string "GREEN {POKEBLOCK}$" +.string "YELLOW {POKEBLOCK}$" +.string "PURPLE {POKEBLOCK}$" +.string "INDIGO {POKEBLOCK}$" +.string "BROWN {POKEBLOCK}$" +.string "LITEBLUE {POKEBLOCK}$" +.string "OLIVE {POKEBLOCK}$" +.string "GRAY {POKEBLOCK}$" +.string "BLACK {POKEBLOCK}$" +.string "WHITE {POKEBLOCK}$" +.string "GOLD {POKEBLOCK}$" gUnknown_085E931D:: @ 85E931D - .incbin "baserom.gba", 0x5e931d, 0x6 + +.string "SPICY$" gUnknown_085E9323:: @ 85E9323 - .incbin "baserom.gba", 0x5e9323, 0x4 + +.string "DRY$" gUnknown_085E9327:: @ 85E9327 - .incbin "baserom.gba", 0x5e9327, 0x6 + +.string "SWEET$" gUnknown_085E932D:: @ 85E932D - .incbin "baserom.gba", 0x5e932d, 0x7 + +.string "BITTER$" gUnknown_085E9334:: @ 85E9334 - .incbin "baserom.gba", 0x5e9334, 0x10 + +.string "SOUR$" +.string "TASTY$" +.string "FEEL$" gUnknown_085E9344:: @ 85E9344 - .incbin "baserom.gba", 0x5e9344, 0xb + +.string "Stow CASE.$" gUnknown_085E934F:: @ 85E934F - .incbin "baserom.gba", 0x5e934f, 0x4 + +.string "{LV}{STR_VAR_1}$" gUnknown_085E9353:: @ 85E9353 - .incbin "baserom.gba", 0x5e9353, 0x14 + +.string "Throw away this\n{STR_VAR_1}?$" gUnknown_085E9367:: @ 85E9367 - .incbin "baserom.gba", 0x5e9367, 0x18 + +.string "The {STR_VAR_1}\nwas thrown away.$" gUnknown_085E937F:: @ 85E937F - .incbin "baserom.gba", 0x5e937f, 0x11 + +.string "{STR_VAR_1} ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9390:: @ 85E9390 - .incbin "baserom.gba", 0x5e9390, 0x19 + +.string "{STR_VAR_1} happily ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E93A9:: @ 85E93A9 - .incbin "baserom.gba", 0x5e93a9, 0x2c + +.string "{STR_VAR_1} disdainfully ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" +.string "BUY$" +.string "SELL$" +.string "QUIT$" gUnknown_085E93D5:: @ 85E93D5 - .incbin "baserom.gba", 0x5e93d5, 0xb + +.string "IN BAG: {STR_VAR_1}$" gUnknown_085E93E0:: @ 85E93E0 - .incbin "baserom.gba", 0x5e93e0, 0xf + +.string "Quit shopping.$" gUnknown_085E93EF:: @ 85E93EF - .incbin "baserom.gba", 0x5e93ef, 0x28 + +.string "{STR_VAR_1}? Certainly.\nHow many would you like?$" gUnknown_085E9417:: @ 85E9417 - .incbin "baserom.gba", 0x5e9417, 0x28 + +.string "{STR_VAR_1}? Certainly.\nHow many would you like?$" gUnknown_085E943F:: @ 85E943F - .incbin "baserom.gba", 0x5e943f, 0x29 + +.string "{STR_VAR_1}? And you wanted {STR_VAR_2}?\nThat will be ¥{STR_VAR_3}.$" gUnknown_085E9468:: @ 85E9468 - .incbin "baserom.gba", 0x5e9468, 0x2b + +.string "{STR_VAR_1}, is it?\nThat’ll be ¥{STR_VAR_2}. Do you want it?$" gUnknown_085E9493:: @ 85E9493 - .incbin "baserom.gba", 0x5e9493, 0x32 + +.string "You wanted {STR_VAR_1}?\nThat’ll be ¥{STR_VAR_2}. Will that be okay?$" gUnknown_085E94C5:: @ 85E94C5 - .incbin "baserom.gba", 0x5e94c5, 0x22 + +.string "Here you go!\nThank you very much.$" gUnknown_085E94E7:: @ 85E94E7 - .incbin "baserom.gba", 0x5e94e7, 0x29 + +.string "Thank you!\nI’ll send it to your home PC.$" gUnknown_085E9510:: @ 85E9510 - .incbin "baserom.gba", 0x5e9510, 0x29 + +.string "Thanks!\nI’ll send it to your PC at home.$" gUnknown_085E9539:: @ 85E9539 - .incbin "baserom.gba", 0x5e9539, 0x1f + +.string "You don’t have enough money.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9558:: @ 85E9558 - .incbin "baserom.gba", 0x5e9558, 0x27 + +.string "You have no more room for this\nitem.{PAUSE_UNTIL_PRESS}$" gUnknown_085E957F:: @ 85E957F - .incbin "baserom.gba", 0x5e957f, 0x1c + +.string "The space for {STR_VAR_1} is full.{PAUSE_UNTIL_PRESS}$" gUnknown_085E959B:: @ 85E959B - .incbin "baserom.gba", 0x5e959b, 0x2c + +.string "Is there anything else I can help\nyou with?$" gUnknown_085E95C7:: @ 85E95C7 - .incbin "baserom.gba", 0x5e95c7, 0x23 + +.string "Can I help you with anything else?$" gUnknown_085E95EA:: @ 85E95EA - .incbin "baserom.gba", 0x5e95ea, 0x25 + +.string "I’ll throw in a PREMIER BALL, too.{PAUSE_UNTIL_PRESS}$" gUnknown_085E960F:: @ 85E960F - .incbin "baserom.gba", 0x5e960f, 0x20 + +.string "{STR_VAR_2}? Oh, no.\nI can’t buy that.{PAUSE_UNTIL_PRESS}$" gUnknown_085E962F:: @ 85E962F - .incbin "baserom.gba", 0x5e962f, 0x25 + +.string "{STR_VAR_2}?\nHow many would you like to sell?$" gUnknown_085E9654:: @ 85E9654 - .incbin "baserom.gba", 0x5e9654, 0x23 + +.string "I can pay ¥{STR_VAR_1}.\nWould that be okay?$" gUnknown_085E9677:: @ 85E9677 - .incbin "baserom.gba", 0x5e9677, 0x25 + +.string "Turned over the {STR_VAR_2}\nand received ¥{STR_VAR_1}.$" gUnknown_085E969C:: @ 85E969C - .incbin "baserom.gba", 0x5e969c, 0x47 + +.string "¥{STR_VAR_1}$" +.string "SHIFT$" +.string "SEND OUT$" +.string "SWITCH$" +.string "SUMMARY$" +.string "MOVES$" +.string "ENTER$" +.string "NO ENTRY$" +.string "TAKE$" +.string "READ$" +.string "TRADE$" gUnknown_085E96E3:: @ 85E96E3 - .incbin "baserom.gba", 0x5e96e3, 0x3 + +.string "HP$" gUnknown_085E96E6:: @ 85E96E6 - .incbin "baserom.gba", 0x5e96e6, 0x8 + +.string "SP. ATK$" gUnknown_085E96EE:: @ 85E96EE - .incbin "baserom.gba", 0x5e96ee, 0x8 + +.string "SP. DEF$" gUnknown_085E96F6:: @ 85E96F6 - .incbin "baserom.gba", 0x5e96f6, 0x1c + +.string "It won’t have any effect.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9712:: @ 85E9712 - .incbin "baserom.gba", 0x5e9712, 0x26 + +.string "This can’t be used on\nthat POKéMON.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9738:: @ 85E9738 - .incbin "baserom.gba", 0x5e9738, 0x1c + +.string "{STR_VAR_1} can’t be switched\nout!{PAUSE_UNTIL_PRESS}$" gUnknown_085E9754:: @ 85E9754 - .incbin "baserom.gba", 0x5e9754, 0x1b + +.string "{STR_VAR_1} is already\nin battle!{PAUSE_UNTIL_PRESS}$" gUnknown_085E976F:: @ 85E976F - .incbin "baserom.gba", 0x5e976f, 0x20 + +.string "{STR_VAR_1} has already been\nselected.{PAUSE_UNTIL_PRESS}$" gUnknown_085E978F:: @ 85E978F - .incbin "baserom.gba", 0x5e978f, 0x23 + +.string "{STR_VAR_1} has no energy\nleft to battle!{PAUSE_UNTIL_PRESS}$" gUnknown_085E97B2:: @ 85E97B2 - .incbin "baserom.gba", 0x5e97b2, 0x33 + +.string "You can’t switch {STR_VAR_1}’s\nPOKéMON with one of yours!{PAUSE_UNTIL_PRESS}$" gUnknown_085E97E5:: @ 85E97E5 - .incbin "baserom.gba", 0x5e97e5, 0x17 + +.string "An EGG can’t battle!{PAUSE_UNTIL_PRESS}$" gUnknown_085E97FC:: @ 85E97FC - .incbin "baserom.gba", 0x5e97fc, 0x34 + +.string "This can’t be used until a new\nBADGE is obtained.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9830:: @ 85E9830 - .incbin "baserom.gba", 0x5e9830, 0x25 + +.string "No more than {STR_VAR_1} POKéMON\nmay enter.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9855:: @ 85E9855 - .incbin "baserom.gba", 0x5e9855, 0x22 + +.string "Send the removed MAIL to\nyour PC?$" gUnknown_085E9877:: @ 85E9877 - .incbin "baserom.gba", 0x5e9877, 0x20 + +.string "The MAIL was sent to your PC.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9897:: @ 85E9897 - .incbin "baserom.gba", 0x5e9897, 0x1d + +.string "Your PC’s MAILBOX is full.{PAUSE_UNTIL_PRESS}$" gUnknown_085E98B4:: @ 85E98B4 - .incbin "baserom.gba", 0x5e98b4, 0x38 + +.string "If the MAIL is removed, the\nmessage will be lost. Okay?$" gUnknown_085E98EC:: @ 85E98EC - .incbin "baserom.gba", 0x5e98ec, 0x2f + +.string "MAIL must be removed before\nholding an item.{PAUSE_UNTIL_PRESS}$" gUnknown_085E991B:: @ 85E991B - .incbin "baserom.gba", 0x5e991b, 0x1f + +.string "{STR_VAR_1} was given the\n{STR_VAR_2} to hold.{PAUSE_UNTIL_PRESS}$" gUnknown_085E993A:: @ 85E993A - .incbin "baserom.gba", 0x5e993a, 0x46 + +.string "{STR_VAR_1} is already holding\none {STR_VAR_2}.\pWould you like to switch the\ntwo items?$" gUnknown_085E9980:: @ 85E9980 - .incbin "baserom.gba", 0x5e9980, 0x1d + +.string "{STR_VAR_1} isn’t holding\nanything.{PAUSE_UNTIL_PRESS}$" gUnknown_085E999D:: @ 85E999D - .incbin "baserom.gba", 0x5e999d, 0x1b + +.string "Received the {STR_VAR_2}\nfrom {STR_VAR_1}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E99B8:: @ 85E99B8 - .incbin "baserom.gba", 0x5e99b8, 0x23 + +.string "MAIL was taken from the\nPOKéMON.{PAUSE_UNTIL_PRESS}$" gUnknown_085E99DB:: @ 85E99DB - .incbin "baserom.gba", 0x5e99db, 0x2d + +.string "The {STR_VAR_2} was taken and\nreplaced with the {STR_VAR_1}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9A08:: @ 85E9A08 - .incbin "baserom.gba", 0x5e9a08, 0x38 + +.string "This POKéMON is holding an\nitem. It cannot hold MAIL.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9A40:: @ 85E9A40 - .incbin "baserom.gba", 0x5e9a40, 0x29 + +.string "MAIL was transferred from\nthe MAILBOX.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9A69:: @ 85E9A69 - .incbin "baserom.gba", 0x5e9a69, 0x3c + +.string "The BAG is full. The POKéMON’s\nitem could not be removed.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9AA5:: @ 85E9AA5 - .incbin "baserom.gba", 0x5e9aa5, 0xf + +.string "{STR_VAR_1} learned\n{STR_VAR_2}!$" gUnknown_085E9AB4:: @ 85E9AB4 - .incbin "baserom.gba", 0x5e9ab4, 0x35 + +.string "{STR_VAR_1} and {STR_VAR_2}\nare not compatible.\p{STR_VAR_2} can’t be\nlearned.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9AE9:: @ 85E9AE9 - .incbin "baserom.gba", 0x5e9ae9, 0x74 + +.string "{STR_VAR_1} wants to learn the\nmove {STR_VAR_2}.\pHowever, {STR_VAR_1} already\nknows four moves.\pShould a move be deleted and\nreplaced with {STR_VAR_2}?$" gUnknown_085E9B5D:: @ 85E9B5D - .incbin "baserom.gba", 0x5e9b5d, 0x19 + +.string "Stop trying to teach\n{STR_VAR_2}?$" gUnknown_085E9B76:: @ 85E9B76 - .incbin "baserom.gba", 0x5e9b76, 0x20 + +.string "{STR_VAR_1} did not learn the\nmove {STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9B96:: @ 85E9B96 - .incbin "baserom.gba", 0x5e9b96, 0x22 + +.string "Which move should be forgotten?{PAUSE_UNTIL_PRESS}$" gUnknown_085E9BB8:: @ 85E9BB8 - .incbin "baserom.gba", 0x5e9bb8, 0x48 + +.string "1, {PAUSE 15}2, and{PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE 0x0038}Poof!\p{STR_VAR_1} forgot how to\nuse {STR_VAR_2}.\pAnd…{PAUSE_UNTIL_PRESS}$" gUnknown_085E9C00:: @ 85E9C00 - .incbin "baserom.gba", 0x5e9c00, 0x17 + +.string "{STR_VAR_1} already knows\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9C17:: @ 85E9C17 - .incbin "baserom.gba", 0x5e9c17, 0x27 + +.string "{STR_VAR_1}’s HP was restored\nby {STR_VAR_2} point(s).{PAUSE_UNTIL_PRESS}$" gUnknown_085E9C3E:: @ 85E9C3E - .incbin "baserom.gba", 0x5e9c3e, 0x21 + +.string "{STR_VAR_1} was cured of its\npoisoning.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9C5F:: @ 85E9C5F - .incbin "baserom.gba", 0x5e9c5f, 0x1d + +.string "{STR_VAR_1} was cured of\nparalysis.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9C7C:: @ 85E9C7C - .incbin "baserom.gba", 0x5e9c7c, 0xe + +.string "{STR_VAR_1} woke up.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9C8A:: @ 85E9C8A - .incbin "baserom.gba", 0x5e9c8a, 0x18 + +.string "{STR_VAR_1}’s burn was healed.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9CA2:: @ 85E9CA2 - .incbin "baserom.gba", 0x5e9ca2, 0x15 + +.string "{STR_VAR_1} was thawed out.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9CB7:: @ 85E9CB7 - .incbin "baserom.gba", 0x5e9cb7, 0x29 + +.string "PP was restored.{PAUSE_UNTIL_PRESS}$" +.string "{STR_VAR_1} regained health.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9CE0:: @ 85E9CE0 - .incbin "baserom.gba", 0x5e9ce0, 0x15 + +.string "{STR_VAR_1} became healthy.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9CF5:: @ 85E9CF5 - .incbin "baserom.gba", 0x5e9cf5, 0x15 + +.string "{STR_VAR_1}’s PP increased.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9D0A:: @ 85E9D0A - .incbin "baserom.gba", 0x5e9d0a, 0x1b + +.string "{STR_VAR_1} was elevated to\nLv. {STR_VAR_2}.$" gUnknown_085E9D25:: @ 85E9D25 - .incbin "baserom.gba", 0x5e9d25, 0x20 + +.string "{STR_VAR_1}’s base {STR_VAR_2}\nstat was raised.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9D45:: @ 85E9D45 - .incbin "baserom.gba", 0x5e9d45, 0x28 + +.string "{STR_VAR_1} turned friendly.\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}$" gUnknown_085E9D6D:: @ 85E9D6D - .incbin "baserom.gba", 0x5e9d6d, 0x23 + +.string "{STR_VAR_1} adores you!\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}$" gUnknown_085E9D90:: @ 85E9D90 - .incbin "baserom.gba", 0x5e9d90, 0x2e + +.string "{STR_VAR_1} turned friendly.\nThe base {STR_VAR_2} can’t fall!{PAUSE_UNTIL_PRESS}$" gUnknown_085E9DBE:: @ 85E9DBE - .incbin "baserom.gba", 0x5e9dbe, 0x23 + +.string "{STR_VAR_1} snapped out of its\nconfusion.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9DE1:: @ 85E9DE1 - .incbin "baserom.gba", 0x5e9de1, 0x1f + +.string "{STR_VAR_1} got over its\ninfatuation.{PAUSE_UNTIL_PRESS}$" gUnknown_085E9E00:: @ 85E9E00 - .incbin "baserom.gba", 0x5e9e00, 0x14 + +.string "Throw away this\n{STR_VAR_1}?$" gUnknown_085E9E14:: @ 85E9E14 - .incbin "baserom.gba", 0x5e9e14, 0x2da + +.string "The {STR_VAR_1}\nwas thrown away.{PAUSE_UNTIL_PRESS}$" +.string "Teach which POKéMON?$" +.string "Choose a POKéMON.$" +.string "Move to where?$" +.string "Teach which POKéMON?$" +.string "Use on which POKéMON?$" +.string "Give to which POKéMON?$" +.string "Do what with this {PKMN}?$" +.string "There’s nothing to CUT.$" +.string "You can’t SURF here.$" +.string "You’re already SURFING.$" +.string "Can’t use that here.$" +.string "Restore which move?$" +.string "Boost PP of which move?$" +.string "Do what with an item?$" +.string "No POKéMON for battle!$" +.string "Choose a POKéMON.$" +.string "Not enough HP…$" +.string "{STR_VAR_1} POKéMON are needed.$" +.string "POKéMON can’t be the same.$" +.string "No identical hold items.$" +.string "The current is much too fast!$" +.string "Do what with the MAIL?$" +.string "Choose POKéMON or CANCEL.$" +.string "Choose POKéMON and confirm.$" +.string "Let’s enjoy cycling!$" +.string "This is in use already.$" +.string "{STR_VAR_1} is already holding\none {STR_VAR_2}.$" +.string "No use.$" +.string "ABLE$" +.string "FIRST$" +.string "SECOND$" +.string "THIRD$" +.string "ABLE$" +.string "NOT ABLE$" +.string "ABLE!$" +.string "NOT ABLE!$" +.string "LEARNED$" +.string "HAVE$" +.string "DON’T HAVE$" +.string "FOURTH$" gUnknown_085EA0EE:: @ 85EA0EE - .incbin "baserom.gba", 0x5ea0ee, 0x22 + +.string "That POKéMON can’t participate.{PAUSE_UNTIL_PRESS}$" gUnknown_085EA110:: @ 85EA110 - .incbin "baserom.gba", 0x5ea110, 0x16 + +.string "Cancel participation?$" gUnknown_085EA126:: @ 85EA126 - .incbin "baserom.gba", 0x5ea126, 0x13 + +.string "Cancel the battle?$" gUnknown_085EA139:: @ 85EA139 - .incbin "baserom.gba", 0x5ea139, 0x1c + +.string "Return to the WAITING ROOM?$" gUnknown_085EA155:: @ 85EA155 - .incbin "baserom.gba", 0x5ea155, 0x16 + +.string "Cancel the challenge?$" gUnknown_085EA16B:: @ 85EA16B - .incbin "baserom.gba", 0x5ea16b, 0x2b + +.string "Want to escape from here and return\nto {STR_VAR_1}?$" gUnknown_085EA196:: @ 85EA196 - .incbin "baserom.gba", 0x5ea196, 0x34 + +.string "Want to return to the healing spot\nused last in {STR_VAR_1}?$" gUnknown_085EA1CA:: @ 85EA1CA - .incbin "baserom.gba", 0x5ea1ca, 0x3 + +.string "{PAUSE_UNTIL_PRESS}$" gUnknown_085EA1CD:: @ 85EA1CD - .incbin "baserom.gba", 0x5ea1cd, 0x1b + +.string "{STR_VAR_1}& ぐñぐñこÂÉ+à\nだÏÛ ùªÏÁでÒÉ?$" gUnknown_085EA1E8:: @ 85EA1E8 .incbin "baserom.gba", 0x5ea1e8, 0x28 @@ -658,94 +1043,132 @@ gUnknown_085EA210:: @ 85EA210 .incbin "baserom.gba", 0x5ea210, 0x24 gUnknown_085EA234:: @ 85EA234 - .incbin "baserom.gba", 0x5ea234, 0x108 + +.string "An EGG can’t be traded now.$" +.string "The other TRAINER’s POKéMON\ncan’t be traded now.$" +.string " The other TRAINER can’t accept\nthat POKéMON now.$" +.string " You can’t trade with that\nTRAINER now.$" +.string " That isn’t the type of POKéMON\nthat the other TRAINER wants.$" +.string " That isn’t an EGG.$" +.string "REGISTER$" gUnknown_085EA33C:: @ 85EA33C - .incbin "baserom.gba", 0x5ea33c, 0x7 + +.string "ATTACK$" gUnknown_085EA343:: @ 85EA343 - .incbin "baserom.gba", 0x5ea343, 0x8 + +.string "DEFENSE$" gUnknown_085EA34B:: @ 85EA34B - .incbin "baserom.gba", 0x5ea34b, 0x8 + +.string "SP. ATK$" gUnknown_085EA353:: @ 85EA353 - .incbin "baserom.gba", 0x5ea353, 0x8 + +.string "SP. DEF$" gUnknown_085EA35B:: @ 85EA35B - .incbin "baserom.gba", 0x5ea35b, 0x6 + +.string "SPEED$" gUnknown_085EA361:: @ 85EA361 - .incbin "baserom.gba", 0x5ea361, 0x4 + +.string "HP$" +.string "$" gUnknown_085EA365:: @ 85EA365 - .incbin "baserom.gba", 0x5ea365, 0x4 + +.string "OT/$" gUnknown_085EA369:: @ 85EA369 - .incbin "baserom.gba", 0x5ea369, 0xf + +.string "RENTAL POKéMON$" gUnknown_085EA378:: @ 85EA378 - .incbin "baserom.gba", 0x5ea378, 0x6 + +.string "TYPE/$" gUnknown_085EA37E:: @ 85EA37E - .incbin "baserom.gba", 0x5ea37e, 0x6 + +.string "POWER$" gUnknown_085EA384:: @ 85EA384 - .incbin "baserom.gba", 0x5ea384, 0x9 + +.string "ACCURACY$" gUnknown_085EA38D:: @ 85EA38D - .incbin "baserom.gba", 0x5ea38d, 0x7 + +.string "APPEAL$" gUnknown_085EA394:: @ 85EA394 - .incbin "baserom.gba", 0x5ea394, 0x4 + +.string "JAM$" gUnknown_085EA398:: @ 85EA398 - .incbin "baserom.gba", 0x5ea398, 0x7 + +.string "STATUS$" gUnknown_085EA39F:: @ 85EA39F - .incbin "baserom.gba", 0x5ea39f, 0xc + +.string "EXP. POINTS$" gUnknown_085EA3AB:: @ 85EA3AB - .incbin "baserom.gba", 0x5ea3ab, 0x9 + +.string "NEXT LV.$" gUnknown_085EA3B4:: @ 85EA3B4 - .incbin "baserom.gba", 0x5ea3b4, 0xc + +.string "RIBBONS: {STR_VAR_1}$" gUnknown_085EA3C0:: @ 85EA3C0 - .incbin "baserom.gba", 0x5ea3c0, 0x8 + +.string "$" +.string "EVENTS$" gUnknown_085EA3C8:: @ 85EA3C8 - .incbin "baserom.gba", 0x5ea3c8, 0x7 + +.string "SWITCH$" gUnknown_085EA3CF:: @ 85EA3CF - .incbin "baserom.gba", 0x5ea3cf, 0xd + +.string "POKéMON INFO$" gUnknown_085EA3DC:: @ 85EA3DC - .incbin "baserom.gba", 0x5ea3dc, 0xf + +.string "POKéMON SKILLS$" gUnknown_085EA3EB:: @ 85EA3EB - .incbin "baserom.gba", 0x5ea3eb, 0xd + +.string "BATTLE MOVES$" gUnknown_085EA3F8:: @ 85EA3F8 - .incbin "baserom.gba", 0x5ea3f8, 0xe + +.string "C0NTEST MOVES$" gUnknown_085EA406:: @ 85EA406 - .incbin "baserom.gba", 0x5ea406, 0x5 + +.string "INFO$" gUnknown_085EA40B:: @ 85EA40B - .incbin "baserom.gba", 0x5ea40b, 0x37 + +.string "It looks like this EGG will\ntake a long time to hatch.$" gUnknown_085EA442:: @ 85EA442 - .incbin "baserom.gba", 0x5ea442, 0x33 + +.string "What will hatch from this?\nIt will take some time.$" gUnknown_085EA475:: @ 85EA475 - .incbin "baserom.gba", 0x5ea475, 0x2d + +.string "It moves occasionally.\nIt should hatch soon.$" gUnknown_085EA4A2:: @ 85EA4A2 - .incbin "baserom.gba", 0x5ea4a2, 0x29 + +.string "It’s making sounds.\nIt’s about to hatch!$" gUnknown_085EA4CB:: @ 85EA4CB - .incbin "baserom.gba", 0x5ea4cb, 0x21 + +.string "HM moves can’t be\nforgotten now.$" gUnknown_085EA4EC:: @ 85EA4EC .incbin "baserom.gba", 0x5ea4ec, 0x2a @@ -770,621 +1193,1310 @@ gUnknown_085EA5EB:: @ 85EA5EB gUnknown_085EA617:: @ 85EA617 .incbin "baserom.gba", 0x5ea617, 0x30 - + gUnknown_085EA647:: @ 85EA647 - .incbin "baserom.gba", 0x5ea647, 0x31 + +.string "An odd POKéMON EGG found\nby the DAY CARE couple.$" gUnknown_085EA678:: @ 85EA678 - .incbin "baserom.gba", 0x5ea678, 0x33 + +.string "A peculiar POKéMON EGG\nobtained at the nice place.$" gUnknown_085EA6AB:: @ 85EA6AB - .incbin "baserom.gba", 0x5ea6ab, 0x2c + +.string "A peculiar POKéMON EGG\nobtained in a trade.$" gUnknown_085EA6D7:: @ 85EA6D7 - .incbin "baserom.gba", 0x5ea6d7, 0x2b + +.string "A POKéMON EGG obtained\nat the hot springs.$" gUnknown_085EA702:: @ 85EA702 - .incbin "baserom.gba", 0x5ea702, 0x2d + +.string "An odd POKéMON EGG\nobtained from a traveler.$" gUnknown_085EA72F:: @ 85EA72F - .incbin "baserom.gba", 0x5ea72f, 0x8 + +.string "’s BASE$" gUnknown_085EA737:: @ 85EA737 - .incbin "baserom.gba", 0x5ea737, 0x2b + +.string "Is it okay to delete {STR_VAR_1}\nfrom the REGISTRY?$" gUnknown_085EA762:: @ 85EA762 - .incbin "baserom.gba", 0x5ea762, 0x23 + +.string "The registered data was deleted.{PAUSE_UNTIL_PRESS}$" gUnknown_085EA785:: @ 85EA785 - .incbin "baserom.gba", 0x5ea785, 0x43 + +.string "There is no REGISTRY.{PAUSE_UNTIL_PRESS}$" +.string "DEL REGIST.$" +.string "{STR_VAR_3}{STR_VAR_1}/{STR_VAR_2}$" +.string "DECORATE$" +.string "PUT AWAY$" +.string "TOSS$" gUnknown_085EA7C8:: @ 85EA7C8 - .incbin "baserom.gba", 0x5ea7c8, 0x75 + +.string "{COLOR 161}{SHADOW 161}$" +.string "Put out the selected decoration item.$" +.string "Store the chosen decoration in the PC.$" +.string "Throw away unwanted decorations.$" gUnknown_085EA83D:: @ 85EA83D - .incbin "baserom.gba", 0x5ea83d, 0x4e + +.string "There are no decorations.{PAUSE_UNTIL_PRESS}$" +.string "DESK$" +.string "CHAIR$" +.string "PLANT$" +.string "ORNAMENT$" +.string "MAT$" +.string "POSTER$" +.string "DOLL$" +.string "CUSHION$" gUnknown_085EA88B:: @ 85EA88B - .incbin "baserom.gba", 0x5ea88b, 0x5 + +.string "GOLD$" gUnknown_085EA890:: @ 85EA890 - .incbin "baserom.gba", 0x5ea890, 0x7 + +.string "SILVER$" gUnknown_085EA897:: @ 85EA897 - .incbin "baserom.gba", 0x5ea897, 0xf + +.string "Place it here?$" gUnknown_085EA8A6:: @ 85EA8A6 - .incbin "baserom.gba", 0x5ea8a6, 0x19 + +.string "It can’t be placed here.$" gUnknown_085EA8BF:: @ 85EA8BF - .incbin "baserom.gba", 0x5ea8bf, 0x13 + +.string "Cancel decorating?$" gUnknown_085EA8D2:: @ 85EA8D2 - .incbin "baserom.gba", 0x5ea8d2, 0x18 + +.string "This is in use already.$" gUnknown_085EA8EA:: @ 85EA8EA - .incbin "baserom.gba", 0x5ea8ea, 0x47 + +.string "No more decorations can be placed.\nThe most that can be placed are {STR_VAR_1}.$" gUnknown_085EA931:: @ 85EA931 - .incbin "baserom.gba", 0x5ea931, 0x7d + +.string "No more decorations can be placed.\nThe most that can be placed are {STR_VAR_1}.$" +.string "This can’t be placed here.\nIt must be on a DESK, etc.$" gUnknown_085EA9AE:: @ 85EA9AE - .incbin "baserom.gba", 0x5ea9ae, 0x32 + +.string "This decoration can’t be placed in\nyour own room.$" gUnknown_085EA9E0:: @ 85EA9E0 - .incbin "baserom.gba", 0x5ea9e0, 0x34 + +.string "This decoration is in use.\nIt can’t be thrown away.$" gUnknown_085EAA14:: @ 85EAA14 - .incbin "baserom.gba", 0x5eaa14, 0x29 + +.string "This {STR_VAR_1} will be discarded.\nIs that okay?$" gUnknown_085EAA3D:: @ 85EAA3D - .incbin "baserom.gba", 0x5eaa3d, 0x25 + +.string "The decoration item was thrown away.$" gUnknown_085EAA62:: @ 85EAA62 - .incbin "baserom.gba", 0x5eaa62, 0x1f + +.string "Stop putting away decorations?$" gUnknown_085EAA81:: @ 85EAA81 - .incbin "baserom.gba", 0x5eaa81, 0x22 + +.string "There is no decoration item here.$" gUnknown_085EAAA3:: @ 85EAAA3 - .incbin "baserom.gba", 0x5eaaa3, 0x22 + +.string "Return this decoration to the PC?$" gUnknown_085EAAC5:: @ 85EAAC5 - .incbin "baserom.gba", 0x5eaac5, 0x27 + +.string "The decoration was returned to the PC.$" gUnknown_085EAAEC:: @ 85EAAEC - .incbin "baserom.gba", 0x5eaaec, 0x62 + +.string "There are no decorations in use.{PAUSE_UNTIL_PRESS}$" +.string "TRISTAN$" +.string "PHILIP$" +.string "DENNIS$" +.string "ROBERTO$" +.string "TURN OFF$" +.string "DECORATION$" +.string "ITEM STORAGE$" gUnknown_085EAB4E:: @ 85EAB4E - .incbin "baserom.gba", 0x5eab4e, 0x15 + +.string "MAILBOX$" +.string "DEPOSIT ITEM$" gUnknown_085EAB63:: @ 85EAB63 - .incbin "baserom.gba", 0x5eab63, 0xe + +.string "WITHDRAW ITEM$" gUnknown_085EAB71:: @ 85EAB71 - .incbin "baserom.gba", 0x5eab71, 0x60 + +.string "TOSS ITEM$" +.string "Store items in the PC.$" +.string "Take out items from the PC.$" +.string "Throw away items stored in the PC.$" gUnknown_085EABD1:: @ 85EABD1 - .incbin "baserom.gba", 0x5eabd1, 0x16 + +.string "There are no items.{PAUSE_UNTIL_PRESS}$" gUnknown_085EABE7:: @ 85EABE7 - .incbin "baserom.gba", 0x5eabe7, 0x22 + +.string "There is no more\nroom in the BAG.$" gUnknown_085EAC09:: @ 85EAC09 - .incbin "baserom.gba", 0x5eac09, 0x19 + +.string "Withdraw how many\n{STR_VAR_1}(s)?$" gUnknown_085EAC22:: @ 85EAC22 - .incbin "baserom.gba", 0x5eac22, 0x29 + +.string "Withdrew {STR_VAR_2}\n{STR_VAR_1}(s).$" +.string "READ$" +.string "MOVE TO BAG$" +.string "GIVE$" gUnknown_085EAC4B:: @ 85EAC4B - .incbin "baserom.gba", 0x5eac4b, 0x18 + +.string "There’s no MAIL here.{PAUSE_UNTIL_PRESS}$" gUnknown_085EAC63:: @ 85EAC63 - .incbin "baserom.gba", 0x5eac63, 0x2a + +.string "What would you like to do with\n{STR_VAR_1}’s MAIL?$" gUnknown_085EAC8D:: @ 85EAC8D - .incbin "baserom.gba", 0x5eac8d, 0x28 + +.string "The message will be lost.\nIs that okay?$" gUnknown_085EACB5:: @ 85EACB5 - .incbin "baserom.gba", 0x5eacb5, 0x13 + +.string "The BAG is full.{PAUSE_UNTIL_PRESS}$" gUnknown_085EACC8:: @ 85EACC8 - .incbin "baserom.gba", 0x5eacc8, 0x3c + +.string "The MAIL was returned to the BAG\nwith its message erased.{PAUSE_UNTIL_PRESS}$" gUnknown_085EAD04:: @ 85EAD04 - .incbin "baserom.gba", 0x5ead04, 0x4 + +.string "DAD$" gUnknown_085EAD08:: @ 85EAD08 - .incbin "baserom.gba", 0x5ead08, 0x4 + +.string "MOM$" gUnknown_085EAD0C:: @ 85EAD0C - .incbin "baserom.gba", 0x5ead0c, 0x8 + +.string "WALLACE$" gUnknown_085EAD14:: @ 85EAD14 - .incbin "baserom.gba", 0x5ead14, 0x7 + +.string "STEVEN$" gUnknown_085EAD1B:: @ 85EAD1B - .incbin "baserom.gba", 0x5ead1b, 0x7 + +.string "BRAWLY$" gUnknown_085EAD22:: @ 85EAD22 - .incbin "baserom.gba", 0x5ead22, 0x7 + +.string "WINONA$" gUnknown_085EAD29:: @ 85EAD29 - .incbin "baserom.gba", 0x5ead29, 0x7 + +.string "PHOEBE$" gUnknown_085EAD30:: @ 85EAD30 - .incbin "baserom.gba", 0x5ead30, 0x132 + +.string "GLACIA$" +.string "PETALBURG$" +.string "SLATEPORT$" +.string "LITTLEROOT$" +.string "LILYCOVE$" +.string "DEWFORD$" +.string "ENTER$" +.string "INFO$" +.string "What’s a CONTEST?$" +.string "Types of CONTESTS$" +.string "Ranks$" +.string "Judging$" +.string "COOLNESS CONTEST$" +.string "BEAUTY CONTEST$" +.string "CUTENESS CONTEST$" +.string "SMARTNESS CONTEST$" +.string "TOUGHNESS CONTEST$" +.string "DECORATION$" +.string "PACK UP$" +.string "COUNT$" +.string "REGISTRY$" +.string "INFORMATION$" +.string "MACH$" +.string "ACRO$" +.string "PSN$" +.string "PAR$" +.string "SLP$" +.string "BRN$" +.string "FRZ$" +.string "TOXIC$" +.string "OK$" +.string "QUIT$" +.string "Saw it$" +.string "Not yet$" gUnknown_085EAE62:: @ 85EAE62 - .incbin "baserom.gba", 0x5eae62, 0x4 + +.string "YES$" gUnknown_085EAE66:: @ 85EAE66 - .incbin "baserom.gba", 0x5eae66, 0x4b + +.string "NO$" +.string "INFO$" +.string "SINGLE BATTLE$" +.string "DOUBLE BATTLE$" +.string "MULTI BATTLE$" +.string "MR. BRINEY$" +.string "CHALLENGE$" +.string "INFO$" gUnknown_085EAEB1:: @ 85EAEB1 - .incbin "baserom.gba", 0x5eaeb1, 0x7 + +.string "LV. 50$" gUnknown_085EAEB8:: @ 85EAEB8 - .incbin "baserom.gba", 0x5eaeb8, 0x230 + +.string "OPEN LEVEL$" +.string "FRESH WATER{CLEAR_TO}ぶ¥200$" +.string "SODA POP{CLEAR_TO}ぶ¥300$" +.string "LEMONADE{CLEAR_TO}ぶ¥350$" +.string "HOW TO RIDE$" +.string "HOW TO TURN$" +.string "SANDY SLOPES$" +.string "WHEELIES$" +.string "BUNNY-HOPS$" +.string "JUMP$" +.string "Satisfied$" +.string "Dissatisfied$" +.string "DEEPSEATOOTH$" +.string "DEEPSEASCALE$" +.string "BLUE FLUTE$" +.string "YELLOW FLUTE$" +.string "RED FLUTE$" +.string "WHITE FLUTE$" +.string "BLACK FLUTE$" +.string "GLASS CHAIR$" +.string "GLASS DESK$" +.string "TREECKO DOLL 1,000 COINS$" +.string "TORCHIC DOLL 1,000 COINS$" +.string "MUDKIP DOLL 1,000 COINS$" +.string " 50 COINS ¥1,000$" +.string "500 COINS ¥10,000$" +.string "Excellent$" +.string "Not so good$" +.string "RED SHARD$" +.string "YELLOW SHARD$" +.string "BLUE SHARD$" +.string "GREEN SHARD$" +.string "BATTLE FRONTIER$" +.string "Right$" +.string "Left$" +.string "TM32{CLEAR_TO}ぶ1,500 COINS$" +.string "TM29{CLEAR_TO}ぶ3,500 COINS$" +.string "TM35{CLEAR_TO}ぶ4,000 COINS$" +.string "TM24{CLEAR_TO}ぶ4,000 COINS$" +.string "TM13{CLEAR_TO}ぶ4,000 COINS$" gUnknown_085EB0E8:: @ 85EB0E8 - .incbin "baserom.gba", 0x5eb0e8, 0x5 + +.string "COOL$" gUnknown_085EB0ED:: @ 85EB0ED - .incbin "baserom.gba", 0x5eb0ed, 0x7 + +.string "BEAUTY$" gUnknown_085EB0F4:: @ 85EB0F4 - .incbin "baserom.gba", 0x5eb0f4, 0x5 + +.string "CUTE$" gUnknown_085EB0F9:: @ 85EB0F9 - .incbin "baserom.gba", 0x5eb0f9, 0x6 + +.string "SMART$" gUnknown_085EB0FF:: @ 85EB0FF - .incbin "baserom.gba", 0x5eb0ff, 0x6a + +.string "TOUGH$" +.string "NORMAL$" +.string "SUPER$" +.string "HYPER$" +.string "MASTER$" +.string "COOL$" +.string "BEAUTY$" +.string "CUTE$" +.string "SMART$" +.string "TOUGH$" +.string "ITEMS$" +.string "KEY ITEMS$" +.string "POKé BALLS$" +.string "TMs & HMs$" +.string "BERRIES$" gUnknown_085EB169:: @ 85EB169 - .incbin "baserom.gba", 0x5eb169, 0xd + +.string "SOMEONE’S PC$" gUnknown_085EB176:: @ 85EB176 - .incbin "baserom.gba", 0x5eb176, 0xd + +.string "LANETTE’S PC$" gUnknown_085EB183:: @ 85EB183 - .incbin "baserom.gba", 0x5eb183, 0x8 + +.string "{PLAYER}’s PC$" gUnknown_085EB18B:: @ 85EB18B - .incbin "baserom.gba", 0x5eb18b, 0xd + +.string "HALL OF FAME$" gUnknown_085EB198:: @ 85EB198 - .incbin "baserom.gba", 0x5eb198, 0xc4 + +.string "LOG OFF$" +.string "OPPONENT$" +.string "TOURNEY TREE$" +.string "READY TO START$" +.string "NORMAL RANK$" +.string "SUPER RANK$" +.string "HYPER RANK$" +.string "MASTER RANK$" +.string "SINGLE$" +.string "DOUBLE$" +.string "MULTI$" +.string "MULTI-LINK$" +.string "BATTLE BAG$" +.string "HELD ITEM$" +.string "LINK CONTEST$" +.string "ABOUT E-MODE$" +.string "ABOUT G-MODE$" +.string "E-MODE$" +.string "G-MODE$" gUnknown_085EB25C:: @ 85EB25C - .incbin "baserom.gba", 0x5eb25c, 0x8 + +.string "POKéDEX$" gUnknown_085EB264:: @ 85EB264 - .incbin "baserom.gba", 0x5eb264, 0x8 + +.string "POKéMON$" gUnknown_085EB26C:: @ 85EB26C - .incbin "baserom.gba", 0x5eb26c, 0x4 + +.string "BAG$" gUnknown_085EB270:: @ 85EB270 - .incbin "baserom.gba", 0x5eb270, 0x9 + +.string "POKéNAV$" +.string "$" gUnknown_085EB279:: @ 85EB279 - .incbin "baserom.gba", 0x5eb279, 0x5 + +.string "SAVE$" gUnknown_085EB27E:: @ 85EB27E - .incbin "baserom.gba", 0x5eb27e, 0x7 + +.string "OPTION$" gUnknown_085EB285:: @ 85EB285 - .incbin "baserom.gba", 0x5eb285, 0x34a + +.string "EXIT$" +.string " 5BP$" +.string "10BP$" +.string "15BP$" +.string "RED TENT$" +.string "BLUE TENT$" +.string "SOUTHERN ISLAND$" +.string "BIRTH ISLAND$" +.string "FARAWAY ISLAND$" +.string "NAVEL ROCK$" +.string "CLAW FOSSIL$" +.string "ROOT FOSSIL$" +.string "NO$" +.string "I’ll battle now!$" +.string "I won!$" +.string "I lost!$" +.string "I won’t tell.$" +.string "NORMAL TAG MATCH$" +.string "VARIETY TAG MATCH$" +.string "UNIQUE TAG MATCH$" +.string "EXPERT TAG MATCH$" +.string "TRADE CENTER$" +.string "COLOSSEUM$" +.string "RECORD CORNER$" +.string "BERRY CRUSH$" +.string "$" +.string "POKéMON JUMP$" +.string "DODRIO BERRY-PICKING$" +.string "BECOME LEADER$" +.string "JOIN GROUP$" +.string "TWO STYLES$" +.string "LV. 50$" +.string "OPEN LEVEL$" +.string "{PKMN} TYPE & NO.$" +.string "HOLD ITEMS$" +.string "SYMBOLS$" +.string "RECORD$" +.string "BATTLE PTS$" +.string "TOWER INFO$" +.string "BATTLE {PKMN}$" +.string "BATTLE SALON$" +.string "MULTI-LINK$" +.string "BATTLE RULES$" +.string "JUDGE: MIND$" +.string "JUDGE: SKILL$" +.string "JUDGE: BODY$" +.string "MATCHUP$" +.string "TOURNEY TREE$" +.string "DOUBLE KO$" +.string "BASIC RULES$" +.string "SWAP: PARTNER$" +.string "SWAP: NUMBER$" +.string "SWAP: NOTES$" +.string "OPEN LEVEL$" +.string "BATTLE BASICS$" +.string "POKéMON NATURE$" +.string "POKéMON MOVES$" +.string "UNDERPOWERED$" +.string "WHEN IN DANGER$" +.string "PYRAMID: POKéMON$" +.string "PYRAMID: TRAINERS$" +.string "PYRAMID: MAZE$" +.string "BATTLE BAG$" +.string "POKéNAV AND BAG$" +.string "HELD ITEMS$" +.string "POKéMON ORDER$" +.string "BATTLE POKéMON$" +.string "BATTLE TRAINERS$" +.string "GO ON$" +.string "RECORD$" +.string "REST$" +.string "RETIRE$" gUnknown_085EB5CF:: @ 85EB5CF - .incbin "baserom.gba", 0x5eb5cf, 0xb + +.string "99 times +$" gUnknown_085EB5DA:: @ 85EB5DA - .incbin "baserom.gba", 0x5eb5da, 0xb + +.string "1 minute +$" gUnknown_085EB5E5:: @ 85EB5E5 - .incbin "baserom.gba", 0x5eb5e5, 0x9 + +.string " seconds$" gUnknown_085EB5EE:: @ 85EB5EE - .incbin "baserom.gba", 0x5eb5ee, 0xb + +.string " time(s)$" +.string ".$" gUnknown_085EB5F9:: @ 85EB5F9 - .incbin "baserom.gba", 0x5eb5f9, 0x8 + +.string "Big guy$" gUnknown_085EB601:: @ 85EB601 - .incbin "baserom.gba", 0x5eb601, 0x9 + +.string "Big girl$" gUnknown_085EB60A:: @ 85EB60A - .incbin "baserom.gba", 0x5eb60a, 0x4 + +.string "son$" gUnknown_085EB60E:: @ 85EB60E - .incbin "baserom.gba", 0x5eb60e, 0x97 + +.string "daughter$" +.string "BLUE FLUTE$" +.string "YELLOW FLUTE$" +.string "RED FLUTE$" +.string "WHITE FLUTE$" +.string "BLACK FLUTE$" +.string "PRETTY CHAIR$" +.string "PRETTY DESK$" +.string "1F$" +.string "2F$" +.string "3F$" +.string "4F$" +.string "5F$" +.string "6F$" +.string "7F$" +.string "8F$" +.string "9F$" +.string "10F$" +.string "11F$" +.string "B1F$" +.string "B2F$" +.string "B3F$" +.string "B4F$" +.string "ROOFTOP$" gUnknown_085EB6A5:: @ 85EB6A5 - .incbin "baserom.gba", 0x5eb6a5, 0x8 + +.string "Now on:$" gUnknown_085EB6AD:: @ 85EB6AD - .incbin "baserom.gba", 0x5eb6ad, 0x13d + +.string "BP$" +.string "ENERGYPOWDER{CLEAR_TO}メ{SIZE 0}50$" +.string "ENERGY ROOT{CLEAR_TO}メ{SIZE 0}80$" +.string "HEAL POWDER{CLEAR_TO}メ{SIZE 0}50$" +.string "REVIVAL HERB{CLEAR_TO}フ{SIZE 0}300$" +.string "PROTEIN{CLEAR_TO}テ{SIZE 0}1,000$" +.string "IRON{CLEAR_TO}テ{SIZE 0}1,000$" +.string "CARBOS{CLEAR_TO}テ{SIZE 0}1,000$" +.string "CALCIUM{CLEAR_TO}テ{SIZE 0}1,000$" +.string "ZINC{CLEAR_TO}テ{SIZE 0}1,000$" +.string "HP UP{CLEAR_TO}テ{SIZE 0}1,000$" +.string "PP UP{CLEAR_TO}テ{SIZE 0}3,000$" +.string "RANKING HALL$" +.string "EXCHANGE SERVICE$" +.string "LILYCOVE CITY$" +.string "SLATEPORT CITY$" +.string "CAVE OF ORIGIN$" +.string "MT. PYRE$" +.string "SKY PILLAR$" +.string "Don’t remember$" gUnknown_085EB7EA:: @ 85EB7EA - .incbin "baserom.gba", 0x5eb7ea, 0x49f + +.string "EXIT$" +.string "Exit from the BOX?$" +.string "What do you want to do?$" +.string "Please pick a theme.$" +.string "Pick the wallpaper.$" +.string "{SPECIAL_F7} is selected.$" +.string "Jump to which BOX?$" +.string "Deposit in which BOX?$" +.string "{SPECIAL_F7} was deposited.$" +.string "The BOX is full.$" +.string "Release this POKéMON?$" +.string "{SPECIAL_F7} was released.$" +.string "Bye-bye, {SPECIAL_F7} !$" +.string "Mark your POKéMON.$" +.string "That’s your last POKéMON!$" +.string "Your party’s full!$" +.string "You’re holding a POKéMON!$" +.string "Which one will you take?$" +.string "You can’t release an EGG.$" +.string "Continue BOX operations?$" +.string "{SPECIAL_F7} came back!$" +.string "Was it worried about you?$" +.string "… … … … !$" +.string "Please remove the MAIL.$" +.string "GIVE to a POKéMON?$" +.string "Placed item in the BAG.$" +.string "The BAG is full.$" +.string "Put this item in the BAG?$" +.string "{SPECIAL_F7} is now held.$" +.string "Changed to {SPECIAL_F7} .$" +.string "MAIL can’t be stored!$" +.string "CANCEL$" +.string "STORE$" +.string "WITHDRAW$" +.string "SHIFT$" +.string "MOVE$" +.string "PLACE$" +.string "SUMMARY$" +.string "RELEASE$" +.string "MARK$" +.string "NAME$" +.string "JUMP$" +.string "WALLPAPER$" +.string "TAKE$" +.string "GIVE$" +.string "SWITCH$" +.string "BAG$" +.string "INFO$" +.string "SCENERY 1$" +.string "SCENERY 2$" +.string "SCENERY 3$" +.string "ETCETERA$" +.string "FRIENDS$" +.string "FOREST$" +.string "CITY$" +.string "DESERT$" +.string "SAVANNA$" +.string "CRAG$" +.string "VOLCANO$" +.string "SNOW$" +.string "CAVE$" +.string "BEACH$" +.string "SEAFLOOR$" +.string "RIVER$" +.string "SKY$" +.string "POLKA-DOT$" +.string "POKéCENTER$" +.string "MACHINE$" +.string "SIMPLE$" +.string "What would you like to do?$" +.string "WITHDRAW POKéMON$" +.string "DEPOSIT POKéMON$" +.string "MOVE POKéMON$" +.string "MOVE ITEMS$" +.string "SEE YA!$" +.string "Move POKéMON stored in BOXES to\nyour party.$" +.string "Store POKéMON in your party in BOXES.$" +.string "Organize the POKéMON in BOXES and\nin your party.$" +.string "Move items held by any POKéMON\nin a BOX or your party.$" +.string "Return to the previous menu.$" gUnknown_085EBC89:: @ 85EBC89 - .incbin "baserom.gba", 0x5ebc89, 0x24 + +.string "There is just one POKéMON with you.$" gUnknown_085EBCAD:: @ 85EBCAD - .incbin "baserom.gba", 0x5ebcad, 0x14 + +.string "Your party is full!$" gUnknown_085EBCC1:: @ 85EBCC1 - .incbin "baserom.gba", 0x5ebcc1, 0x89 + +.string "BOX$" +.string "Check the map of the HOENN region.$" +.string "Check POKéMON in detail.$" +.string "Call a registered TRAINER.$" +.string "Check obtained RIBBONS.$" +.string "Put away the POKéNAV.$" gUnknown_085EBD4A:: @ 85EBD4A - .incbin "baserom.gba", 0x5ebd4a, 0x115 + +.string "There are no RIBBON winners.$" +.string "No TRAINERS are registered.$" +.string "Check party POKéMON in detail.$" +.string "Check all POKéMON in detail.$" +.string "Return to the POKéNAV menu.$" +.string "Find cool POKéMON.$" +.string "Find beautiful POKéMON.$" +.string "Find cute POKéMON.$" +.string "Find smart POKéMON.$" +.string "Find tough POKéMON.$" +.string "Return to the CONDITION menu.$" gUnknown_085EBE5F:: @ 85EBE5F - .incbin "baserom.gba", 0x5ebe5f, 0xf + +.string "No. registered$" gUnknown_085EBE6E:: @ 85EBE6E - .incbin "baserom.gba", 0x5ebe6e, 0x11f + +.string "No. of battles$" +.string "DETAIL$" +.string "CALL$" +.string "EXIT$" +.string "Can’t call opponent here.$" +.string "STRATEGY$" +.string "TRAINER’S POKéMON$" +.string "SELF-INTRODUCTION$" +.string "{CLEAR}ィ$" +.string "{248} ZOOM {248}ÀCANCEL$" +.string "{248} FULL {248}ÀCANCEL$" +.string "{248} CONDITION {248}ÀCANCEL$" +.string "{248} MARKINGS {248}ÀCANCEL$" +.string "{248} SELECT MARK {248}ÀCANCEL$" +.string "{248} MENU {248}ÀCANCEL$" +.string "{248} OK {248}ÀCANCEL$" +.string "{248}ÀCANCEL$" +.string "{248} RIBBONS {248}ÀCANCEL$" +.string "{248} CHECK {248}ÀCANCEL$" +.string "{248}ÀCANCEL$" gUnknown_085EBF8D:: @ 85EBF8D - .incbin "baserom.gba", 0x5ebf8d, 0x8 + +.string "NATURE/$" gUnknown_085EBF95:: @ 85EBF95 - .incbin "baserom.gba", 0x5ebf95, 0x39 + +.string "That TRAINER is close by.\nTalk to the TRAINER in person!$" gUnknown_085EBFCE:: @ 85EBFCE - .incbin "baserom.gba", 0x5ebfce, 0x9 + +.string "IN PARTY$" gUnknown_085EBFD7:: @ 85EBFD7 - .incbin "baserom.gba", 0x5ebfd7, 0x38 + +.string "No. $" +.string "RIBBONS$" +.string "{SPECIAL_F7} {COLOR_HIGHLIGHT_SHADOW YELLOW DARK_GREY}É♂{COLOR_HIGHLIGHT_SHADOW RED DARK_GREY}Â/{LV}{SPECIAL_F7}À$" +.string "{SPECIAL_F7} {COLOR_HIGHLIGHT_SHADOW MAGENTA DARK_GREY}Ë♀{COLOR_HIGHLIGHT_SHADOW RED DARK_GREY}Â/{LV}{SPECIAL_F7}À$" +.string "{SPECIAL_F7} /{LV}{SPECIAL_F7}À$" gUnknown_085EC00F:: @ 85EC00F - .incbin "baserom.gba", 0x5ec00f, 0x1a + +.string "UNKNOWN$" +.string "CALL$" +.string "CHECK$" +.string "CANCEL$" gUnknown_085EC029:: @ 85EC029 - .incbin "baserom.gba", 0x5ec029, 0x7 + +.string "No. {SPECIAL_F7} $" gUnknown_085EC030:: @ 85EC030 - .incbin "baserom.gba", 0x5ec030, 0x376 + +.string "RIBBONS {SPECIAL_F7} $" +.string "{SPECIAL_F7} {COLOR_HIGHLIGHT_SHADOW YELLOW DARK_GREY}É♂{COLOR_HIGHLIGHT_SHADOW RED DARK_GREY}Â/{LV}{SPECIAL_F7}À{SPECIAL_F7}Á$" +.string "{SPECIAL_F7} {COLOR_HIGHLIGHT_SHADOW MAGENTA DARK_GREY}Ë♀{COLOR_HIGHLIGHT_SHADOW RED DARK_GREY}Â/{LV}{SPECIAL_F7}À{SPECIAL_F7}Á$" +.string "{SPECIAL_F7} /{LV}{SPECIAL_F7}À{SPECIAL_F7}Á$" +.string "Combine four words or phrases$" +.string "and make your profile.$" +.string "Combine six words or phrases$" +.string "and make a message.$" +.string "Find words that describe your$" +.string "feelings right now.$" +.string "With four phrases,$" +.string "Combine nine words or phrases$" +.string "and make a message.$" +.string "Change just one word or phrase$" +.string "and improve the BARD’s song.$" +.string "Your profile$" +.string "Your feeling at the battle’s start$" +.string "What you say if you win a battle$" +.string "What you say if you lose a battle$" +.string "The answer$" +.string "The MAIL message$" +.string "The MAIL salutation$" +.string "The new song$" +.string "Combine two words or phrases$" +.string "and make a trendy saying.$" +.string "The trendy saying$" +.string "is as shown. Okay?$" +.string "Combine two words or phrases$" +.string "to teach her a good saying.$" +.string "Find words which fit$" +.string "the TRAINER’s image.$" +.string "The image:$" +.string "Out of the listed choices,$" +.string "select the answer to the quiz!$" +.string "and create a quiz!$" +.string "Pick a word or phrase and$" +.string "set the quiz answer.$" +.string "The answer:$" +.string "The quiz:$" +.string "Apprentice’s phrase:$" gUnknown_085EC3A6:: @ 85EC3A6 - .incbin "baserom.gba", 0x5ec3a6, 0xe + +.string "Quit editing?$" gUnknown_085EC3B4:: @ 85EC3B4 - .incbin "baserom.gba", 0x5ec3b4, 0x5c + +.string "Stop giving the POKéMON MAIL?$" +.string "and fill out the questionnaire.$" +.string "Let’s reply to the interview!$" gUnknown_085EC410:: @ 85EC410 - .incbin "baserom.gba", 0x5ec410, 0x1f + +.string "All the text being edited will$" gUnknown_085EC42F:: @ 85EC42F - .incbin "baserom.gba", 0x5ec42f, 0x9a + +.string "be deleted. Is that okay?$" +.string "Quit editing?$" +.string "The edited text will not be saved.$" +.string "Is that okay?$" +.string "Please enter a phrase or word.$" +.string "The entire text can’t be deleted.$" gUnknown_085EC4C9:: @ 85EC4C9 - .incbin "baserom.gba", 0x5ec4c9, 0x20 + +.string "Only one phrase may be changed.$" gUnknown_085EC4E9:: @ 85EC4E9 - .incbin "baserom.gba", 0x5ec4e9, 0x37 + +.string "The original song will be used.$" +.string "That’s trendy already!$" gUnknown_085EC520:: @ 85EC520 .incbin "baserom.gba", 0x5ec520, 0x152 gUnknown_085EC672:: @ 85EC672 - .incbin "baserom.gba", 0x5ec672, 0x16 + +.string "You cannot quit here.$" gUnknown_085EC688:: @ 85EC688 - .incbin "baserom.gba", 0x5ec688, 0x20 + +.string "This section must be completed.$" gUnknown_085EC6A8:: @ 85EC6A8 - .incbin "baserom.gba", 0x5ec6a8, 0xa + +.string "{SPECIAL_F7} ’s quiz$" gUnknown_085EC6B2:: @ 85EC6B2 - .incbin "baserom.gba", 0x5ec6b2, 0x54 + +.string "Lady$" +.string "After you have read the quiz$" +.string "question, press the A Button.$" +.string "The quiz answer is?$" gUnknown_085EC706:: @ 85EC706 - .incbin "baserom.gba", 0x5ec706, 0x21 + +.string "Would you like to quit this quiz$" gUnknown_085EC727:: @ 85EC727 - .incbin "baserom.gba", 0x5ec727, 0x1c + +.string "challenge?$" +.string "Is this quiz OK?$" gUnknown_085EC743:: @ 85EC743 - .incbin "baserom.gba", 0x5ec743, 0xf + +.string "Create a quiz!$" gUnknown_085EC752:: @ 85EC752 - .incbin "baserom.gba", 0x5ec752, 0x13 + +.string "Select the answer!$" gUnknown_085EC765:: @ 85EC765 - .incbin "baserom.gba", 0x5ec765, 0x3b + +.string "The lyrics can’t be deleted.$" +.string "POKéMON LEAGUE$" +.string "POKéMON CENTER$" gUnknown_085EC7A0:: @ 85EC7A0 - .incbin "baserom.gba", 0x5ec7a0, 0x41 + +.string " gets a {POKEBLOCK}?$" +.string "Coolness $" +.string "Beauty $" +.string "Cuteness $" +.string "Smartness $" +.string "Toughness $" gUnknown_085EC7E1:: @ 85EC7E1 - .incbin "baserom.gba", 0x5ec7e1, 0xe + +.string "was enhanced!$" gUnknown_085EC7EF:: @ 85EC7EF - .incbin "baserom.gba", 0x5ec7ef, 0x11 + +.string "Nothing changed!$" gUnknown_085EC800:: @ 85EC800 - .incbin "baserom.gba", 0x5ec800, 0x16 + +.string "It won’t eat anymore…$" gUnknown_085EC816:: @ 85EC816 - .incbin "baserom.gba", 0x5ec816, 0x59 + +.string "Save failed. Checking the backup\nmemory… Please wait.\n{COLOR BLUE}“Time required: about 1 minute”$" gUnknown_085EC86F:: @ 85EC86F - .incbin "baserom.gba", 0x5ec86f, 0x65 + +.string "The backup memory is damaged, or\nthe internal battery has run dry.\nYou can still play, but not save.$" gUnknown_085EC8D4:: @ 85EC8D4 - .incbin "baserom.gba", 0x5ec8d4, 0x43 + +.string "{COLOR BLUE}“Game play cannot be continued.\nReturning to the title screen…”$" gUnknown_085EC917:: @ 85EC917 - .incbin "baserom.gba", 0x5ec917, 0x38 + +.string "Check completed.\nAttempting to save again.\nPlease wait.$" gUnknown_085EC94F:: @ 85EC94F - .incbin "baserom.gba", 0x5ec94f, 0x53 + +.string "Save completed.\n{COLOR BLUE}“Game play cannot be continued.\nReturning to the title screen.”$" gUnknown_085EC9A2:: @ 85EC9A2 - .incbin "baserom.gba", 0x5ec9a2, 0x30 + +.string "Save completed.\n{COLOR BLUE}“Please press the A Button.”$" gUnknown_085EC9D2:: @ 85EC9D2 - .incbin "baserom.gba", 0x5ec9d2, 0x6 + +.string "FERRY$" gUnknown_085EC9D8:: @ 85EC9D8 - .incbin "baserom.gba", 0x5ec9d8, 0xc + +.string "SECRET BASE$" gUnknown_085EC9E4:: @ 85EC9E4 - .incbin "baserom.gba", 0x5ec9e4, 0x8 + +.string "HIDEOUT$" gUnknown_085EC9EC:: @ 85EC9EC - .incbin "baserom.gba", 0x5ec9ec, 0x21 + +.string "Reset RTC?\nA: Confirm, B: Cancel$" gUnknown_085ECA0D:: @ 85ECA0D - .incbin "baserom.gba", 0x5eca0d, 0x15 + +.string "Present time in game$" gUnknown_085ECA22:: @ 85ECA22 - .incbin "baserom.gba", 0x5eca22, 0x16 + +.string "Previous time in game$" gUnknown_085ECA38:: @ 85ECA38 - .incbin "baserom.gba", 0x5eca38, 0x17 + +.string "Please reset the time.$" gUnknown_085ECA4F:: @ 85ECA4F - .incbin "baserom.gba", 0x5eca4f, 0x3b + +.string "The clock has been reset.\nData will be saved. Please wait.$" gUnknown_085ECA8A:: @ 85ECA8A - .incbin "baserom.gba", 0x5eca8a, 0x10 + +.string "Save completed.$" gUnknown_085ECA9A:: @ 85ECA9A - .incbin "baserom.gba", 0x5eca9a, 0xd + +.string "Save failed…$" gUnknown_085ECAA7:: @ 85ECAA7 - .incbin "baserom.gba", 0x5ecaa7, 0x31 + +.string "There is no save file, so the time\ncan’t be set.$" gUnknown_085ECAD8:: @ 85ECAD8 - .incbin "baserom.gba", 0x5ecad8, 0x34 + +.string "The in-game clock adjustment system\nis now useable.$" gUnknown_085ECB0C:: @ 85ECB0C - .incbin "baserom.gba", 0x5ecb0c, 0x6 + +.string "SLOTS$" gUnknown_085ECB12:: @ 85ECB12 - .incbin "baserom.gba", 0x5ecb12, 0x9 + +.string "ROULETTE$" gUnknown_085ECB1B:: @ 85ECB1B - .incbin "baserom.gba", 0x5ecb1b, 0x5 + +.string "Good$" gUnknown_085ECB20:: @ 85ECB20 - .incbin "baserom.gba", 0x5ecb20, 0xa + +.string "Very good$" gUnknown_085ECB2A:: @ 85ECB2A - .incbin "baserom.gba", 0x5ecb2a, 0xa + +.string "Excellent$" gUnknown_085ECB34:: @ 85ECB34 - .incbin "baserom.gba", 0x5ecb34, 0x6 + +.string "So-so$" gUnknown_085ECB3A:: @ 85ECB3A - .incbin "baserom.gba", 0x5ecb3a, 0x4 + +.string "Bad$" gUnknown_085ECB3E:: @ 85ECB3E - .incbin "baserom.gba", 0x5ecb3e, 0xa + +.string "The worst$" gUnknown_085ECB48:: @ 85ECB48 - .incbin "baserom.gba", 0x5ecb48, 0x6 + +.string "spicy$" gUnknown_085ECB4E:: @ 85ECB4E - .incbin "baserom.gba", 0x5ecb4e, 0x4 + +.string "dry$" gUnknown_085ECB52:: @ 85ECB52 - .incbin "baserom.gba", 0x5ecb52, 0x6 + +.string "sweet$" gUnknown_085ECB58:: @ 85ECB58 - .incbin "baserom.gba", 0x5ecb58, 0x7 + +.string "bitter$" gUnknown_085ECB5F:: @ 85ECB5F - .incbin "baserom.gba", 0x5ecb5f, 0x5 + +.string "sour$" gUnknown_085ECB64:: @ 85ECB64 - .incbin "baserom.gba", 0x5ecb64, 0x7 + +.string "SINGLE$" gUnknown_085ECB6B:: @ 85ECB6B - .incbin "baserom.gba", 0x5ecb6b, 0x7 + +.string "DOUBLE$" gUnknown_085ECB72:: @ 85ECB72 - .incbin "baserom.gba", 0x5ecb72, 0x8 + +.string "jackpot$" gUnknown_085ECB7A:: @ 85ECB7A - .incbin "baserom.gba", 0x5ecb7a, 0x6 + +.string "first$" gUnknown_085ECB80:: @ 85ECB80 - .incbin "baserom.gba", 0x5ecb80, 0x7 + +.string "second$" gUnknown_085ECB87:: @ 85ECB87 .incbin "baserom.gba", 0x5ecb87, 0x3d6 - + gUnknown_085ECF5D:: @ 85ECF5D - .incbin "baserom.gba", 0x5ecf5d, 0xe -gUnknown_085ECF6B:: @ 85ECF6B - .incbin "baserom.gba", 0x5ecf6b, 0x6 +.string "{STR_VAR_1} fainted…\p\n$" + +gOtherText_Marco:: @ 85ECF6B + +.string "MARCO$" gUnknown_085ECF71:: @ 85ECF71 - .incbin "baserom.gba", 0x5ecf71, 0x7 + +.string "NAME: $" gUnknown_085ECF78:: @ 85ECF78 - .incbin "baserom.gba", 0x5ecf78, 0x6 + +.string "IDNo.$" gUnknown_085ECF7E:: @ 85ECF7E - .incbin "baserom.gba", 0x5ecf7e, 0x8 + +.string "MONEY$" +.string "¥$" gUnknown_085ECF86:: @ 85ECF86 - .incbin "baserom.gba", 0x5ecf86, 0x8 + +.string "POKéDEX$" gUnknown_085ECF8E:: @ 85ECF8E - .incbin "baserom.gba", 0x5ecf8e, 0x1 + +.string "$" gUnknown_085ECF8F:: @ 85ECF8F - .incbin "baserom.gba", 0x5ecf8f, 0xa + +.string ":$" +.string " points$" gUnknown_085ECF99:: @ 85ECF99 - .incbin "baserom.gba", 0x5ecf99, 0xd + +.string "TIME$" +.string "ゲ-ムポ¡ント$" gUnknown_085ECFA6:: @ 85ECFA6 - .incbin "baserom.gba", 0x5ecfa6, 0x12 + +.string "{STR_VAR_1}’s TRAINER CARD$" gUnknown_085ECFB8:: @ 85ECFB8 - .incbin "baserom.gba", 0x5ecfb8, 0x35 + +.string "HALL OF FAME DEBUT $" +.string "LINK BATTLES$" +.string "LINK CABLE BATTLES$" gUnknown_085ECFED:: @ 85ECFED - .incbin "baserom.gba", 0x5ecfed, 0x23 + +.string "W:{COLOR BLUE}{SHADOW YELLOW}{STR_VAR_1}{COLOR RED}{SHADOW GREEN} L:{COLOR BLUE}{SHADOW YELLOW}{STR_VAR_2}{COLOR RED}{SHADOW GREEN}$" gUnknown_085ED010:: @ 85ED010 - .incbin "baserom.gba", 0x5ed010, 0xf + +.string "POKéMON TRADES$" gUnknown_085ED01F:: @ 85ED01F - .incbin "baserom.gba", 0x5ed01f, 0x17 + +.string "UNION TRADES & BATTLES$" gUnknown_085ED036:: @ 85ED036 - .incbin "baserom.gba", 0x5ed036, 0xc + +.string "BERRY CRUSH$" gUnknown_085ED042:: @ 85ED042 - .incbin "baserom.gba", 0x5ed042, 0x43 + +.string "Waiting for the other TRAINER to\nfinish reading your TRAINER CARD.$" gUnknown_085ED085:: @ 85ED085 - .incbin "baserom.gba", 0x5ed085, 0x11 + +.string "{POKEBLOCK}S W/FRIENDS$" gUnknown_085ED096:: @ 85ED096 - .incbin "baserom.gba", 0x5ed096, 0x9 + +.string "{STR_VAR_1}{COLOR RED}{SHADOW GREEN}$" gUnknown_085ED09F:: @ 85ED09F - .incbin "baserom.gba", 0x5ed09f, 0x17 + +.string "WON CONTESTS W/FRIENDS$" gUnknown_085ED0B6:: @ 85ED0B6 - .incbin "baserom.gba", 0x5ed0b6, 0x12 + +.string "BATTLE POINTS WON$" gUnknown_085ED0C8:: @ 85ED0C8 - .incbin "baserom.gba", 0x5ed0c8, 0xb + +.string "{STR_VAR_1}{COLOR RED}{SHADOW GREEN}BP$" gUnknown_085ED0D3:: @ 85ED0D3 - .incbin "baserom.gba", 0x5ed0d3, 0xd + +.string "BATTLE TOWER$" gUnknown_085ED0E0:: @ 85ED0E0 - .incbin "baserom.gba", 0x5ed0e0, 0xb3 + +.string "W/{COLOR BLUE}{SHADOW YELLOW}{STR_VAR_1}{COLOR RED}{SHADOW GREEN} STRAIGHT/{COLOR BLUE}{SHADOW YELLOW}{STR_VAR_2}$" +.string "BATTLE TOWER$" +.string "BATTLE DOME$" +.string "BATTLE PALACE$" +.string "BATTLE FACTORY$" +.string "BATTLE ARENA$" +.string "BATTLE PIKE$" +.string "BATTLE PYRAMID$" +.string " {STR_VAR_1} SINGLE$" +.string " {STR_VAR_1} DOUBLE$" +.string " {STR_VAR_1} MULTI$" +.string " {STR_VAR_1} LINK$" +.string "{STR_VAR_1}$" gUnknown_085ED193:: @ 85ED193 - .incbin "baserom.gba", 0x5ed193, 0x5 + +.string "Give$" gUnknown_085ED198:: @ 85ED198 - .incbin "baserom.gba", 0x5ed198, 0x8 + +.string "No need$" gUnknown_085ED1A0:: @ 85ED1A0 - .incbin "baserom.gba", 0x5ed1a0, 0x7 + +.string "{COLOR GREEN}{SHADOW RED}$" gUnknown_085ED1A7:: @ 85ED1A7 - .incbin "baserom.gba", 0x5ed1a7, 0x4 + +.string "{COLOR LIGHT_GREY}$" gUnknown_085ED1AB:: @ 85ED1AB - .incbin "baserom.gba", 0x5ed1ab, 0x7 + +.string "{HIGHLIGHT TRANSPARENT}{COLOR TRANSPARENT}$" gUnknown_085ED1B2:: @ 85ED1B2 - .incbin "baserom.gba", 0x5ed1b2, 0x3 + +.string "C.$" gUnknown_085ED1B5:: @ 85ED1B5 - .incbin "baserom.gba", 0x5ed1b5, 0x3 + +.string "B.$" gUnknown_085ED1B8:: @ 85ED1B8 - .incbin "baserom.gba", 0x5ed1b8, 0x18 + +.string "Announcing the results!$" gUnknown_085ED1D0:: @ 85ED1D0 - .incbin "baserom.gba", 0x5ed1d0, 0x19 + +.string "The preliminary results!$" gUnknown_085ED1E9:: @ 85ED1E9 - .incbin "baserom.gba", 0x5ed1e9, 0x11 + +.string "Round 2 results!$" gUnknown_085ED1FA:: @ 85ED1FA - .incbin "baserom.gba", 0x5ed1fa, 0xd + +.string "{STR_VAR_1}’s {STR_VAR_2} won!$" gUnknown_085ED207:: @ 85ED207 - .incbin "baserom.gba", 0x5ed207, 0x17 + +.string "Communication standby…$" gUnknown_085ED21E:: @ 85ED21E - .incbin "baserom.gba", 0x5ed21e, 0xa + +.string "{COLOR RED}$" +.string "{COLOR_HIGHLIGHT_SHADOW WHITE2 DARK_GREY}Ó$" gUnknown_085ED228:: @ 85ED228 - .incbin "baserom.gba", 0x5ed228, 0x6 + +.string "{HIGHLIGHT RED}$" +.string " $" gUnknown_085ED22E:: @ 85ED22E - .incbin "baserom.gba", 0x5ed22e, 0x5 + +.string "{COLOR SILVER}♂$" gUnknown_085ED233:: @ 85ED233 - .incbin "baserom.gba", 0x5ed233, 0x5 + +.string "{COLOR BLACK2}♀$" gUnknown_085ED238:: @ 85ED238 - .incbin "baserom.gba", 0x5ed238, 0x71 + +.string "{COLOR SILVER}$" +.string "UPPER$" +.string "lower$" +.string "OTHERS$" +.string "SYMBOLS$" +.string "REGISTER$" +.string "EXIT$" +.string "Quit chatting?$" +.string "Register text where?$" +.string "Register text here?$" +.string "Input text.$" gUnknown_085ED2A9:: @ 85ED2A9 - .incbin "baserom.gba", 0x5ed2a9, 0x14 + +.string "{SPECIAL_F7} joined the chat!$" gUnknown_085ED2BD:: @ 85ED2BD - .incbin "baserom.gba", 0x5ed2bd, 0x152 + +.string "{SPECIAL_F7} left the chat.$" +.string "{SPECIAL_F7} ç{SPECIAL_F7}ÀéÊò:$" +.string "{SPECIAL_F7} ç{SPECIAL_F7}ÀéÊòè ÁまÓ+$" +.string "Exiting the chat…$" +.string "The LEADER, {SPECIAL_F7} , has\nleft, ending the chat.$" +.string "The registered text has been changed.\nIs it okay to save the game?$" +.string "There is already a saved file.\nIs it okay to overwrite it?$" +.string "SAVING…\nDON’T TURN OFF THE POWER.$" +.string "{SPECIAL_F7} saved the game.$" +.string "If the LEADER leaves, the chat\nwill end. Is that okay?$" gUnknown_085ED40F:: @ 85ED40F - .incbin "baserom.gba", 0x5ed40f, 0x6 + +.string "HELLO$" gUnknown_085ED415:: @ 85ED415 - .incbin "baserom.gba", 0x5ed415, 0x8 + +.string "POKéMON$" gUnknown_085ED41D:: @ 85ED41D - .incbin "baserom.gba", 0x5ed41d, 0x6 + +.string "TRADE$" gUnknown_085ED423:: @ 85ED423 - .incbin "baserom.gba", 0x5ed423, 0x7 + +.string "BATTLE$" gUnknown_085ED42A:: @ 85ED42A - .incbin "baserom.gba", 0x5ed42a, 0x6 + +.string "LET’S$" gUnknown_085ED430:: @ 85ED430 - .incbin "baserom.gba", 0x5ed430, 0x4 + +.string "OK!$" gUnknown_085ED434:: @ 85ED434 - .incbin "baserom.gba", 0x5ed434, 0x6 + +.string "SORRY$" gUnknown_085ED43A:: @ 85ED43A - .incbin "baserom.gba", 0x5ed43a, 0x6 + +.string "YAY{249}{249}$" gUnknown_085ED440:: @ 85ED440 - .incbin "baserom.gba", 0x5ed440, 0xa + +.string "THANK YOU$" gUnknown_085ED44A:: @ 85ED44A - .incbin "baserom.gba", 0x5ed44a, 0x15b + +.string "BYE-BYE!$" +.string "Attack the weak points!$" +.string "Ultimate STEEL POKéMON.$" +.string "I’d climb even waterfalls$" +.string "to find a rare stone!$" +.string "I’m the strongest and most$" +.string "energetic after all!$" +.string "Battle with knowledge!$" +.string "I will use various POKéMON.$" +.string "I’ll be a better POKéMON$" +.string "prof than my father is!$" +.string "I’m not so good at battles.$" +.string "I’ll use any POKéMON!$" +.string "My POKéMON and I help$" +.string "my father’s research.$" gUnknown_085ED5A5:: @ 85ED5A5 - .incbin "baserom.gba", 0x5ed5a5, 0x19 + +.string "{STR_VAR_1} hatched from the EGG!$" gUnknown_085ED5BE:: @ 85ED5BE .incbin "baserom.gba", 0x5ed5be, 0x216 gUnknown_085ED7D4:: @ 85ED7D4 - .incbin "baserom.gba", 0x5ed7d4, 0xc + +.string "1. {COLOR LIGHT_GREY}{SHADOW BLACK}{SPECIAL_F7} $" gUnknown_085ED7E0:: @ 85ED7E0 .incbin "baserom.gba", 0x5ed7e0, 0x28 @@ -1393,7 +2505,8 @@ gUnknown_085ED808:: @ 85ED808 .incbin "baserom.gba", 0x5ed808, 0x8 gUnknown_085ED810:: @ 85ED810 - .incbin "baserom.gba", 0x5ed810, 0x10 + +.string "Pressing Speed:$" gUnknown_085ED820:: @ 85ED820 .incbin "baserom.gba", 0x5ed820, 0xc @@ -1414,136 +2527,224 @@ gUnknown_085ED848:: @ 85ED848 .incbin "baserom.gba", 0x5ed848, 0x8 gUnknown_085ED850:: @ 85ED850 - .incbin "baserom.gba", 0x5ed850, 0xc + +.string " Times/sec.$" gUnknown_085ED85C:: @ 85ED85C - .incbin "baserom.gba", 0x5ed85c, 0x4 + +.string "{STR_VAR_1}%$" gUnknown_085ED860:: @ 85ED860 - .incbin "baserom.gba", 0x5ed860, 0x18 + +.string "No. of Presses Rankings$" gUnknown_085ED878:: @ 85ED878 - .incbin "baserom.gba", 0x5ed878, 0x58 + +.string "Crushing Results$" +.string " Neatness Rankings$" +.string " Cooperative Rankings$" +.string " Pressing-Power Rankings$" gUnknown_085ED8D0:: @ 85ED8D0 - .incbin "baserom.gba", 0x5ed8d0, 0xc + +.string "BERRY CRUSH$" gUnknown_085ED8DC:: @ 85ED8DC - .incbin "baserom.gba", 0x5ed8dc, 0x18 + +.string "Pressing-Speed Rankings$" gUnknown_085ED8F4:: @ 85ED8F4 - .incbin "baserom.gba", 0x5ed8f4, 0xb + +.string "{STR_VAR_1} PLAYERS$" gUnknown_085ED8FF:: @ 85ED8FF - .incbin "baserom.gba", 0x5ed8ff, 0xf + +.string "Symbols Earned$" gUnknown_085ED90E:: @ 85ED90E - .incbin "baserom.gba", 0x5ed90e, 0xe + +.string "Battle Record$" gUnknown_085ED91C:: @ 85ED91C - .incbin "baserom.gba", 0x5ed91c, 0x3a7 + +.string "Battle Points$" +.string "CANCEL$" +.string "$" +.string "Check BATTLE FRONTIER MAP.$" +.string "Check TRAINER CARD.$" +.string "View recorded battle.$" +.string "Put away the FRONTIER PASS.$" +.string "Your current Battle Points.$" +.string "Your collected Symbols.$" +.string "Battle Tower - Ability Symbol$" +.string "Battle Dome - Tactics Symbol$" +.string "Battle Palace - Spirits Symbol$" +.string "Battle Arena - Guts Symbol$" +.string "Battle Factory - Knowledge Symbol$" +.string "Battle Pike - Luck Symbol$" +.string "Battle Pyramid - Brave Symbol$" +.string "There is no Battle Record.$" +.string "BATTLE TOWER$" +.string "BATTLE DOME$" +.string "BATTLE PALACE$" +.string "BATTLE ARENA$" +.string "BATTLE FACTORY$" +.string "BATTLE PIKE$" +.string "BATTLE PYRAMID$" +.string "KO opponents and aim for the top!\nYour ability will be tested.$" +.string "Keep winning at the tournament!\nYour tactics will be tested.$" +.string "Watch your POKéMON battle!\nYour spirit will be tested.$" +.string "Win battles with teamed-up POKéMON!\nYour guts will be tested.$" +.string "Aim for victory using rental POKéMON!\nYour knowledge will be tested.$" +.string "Select one of three paths to battle!\nYour luck will be tested.$" +.string "Aim for the top with exploration!\nYour bravery will be tested.$" gUnknown_085EDCC3:: @ 85EDCC3 - .incbin "baserom.gba", 0x5edcc3, 0x7 + +.string "PLAYER$" gUnknown_085EDCCA:: @ 85EDCCA - .incbin "baserom.gba", 0x5edcca, 0x5 + +.string "TIME$" gUnknown_085EDCCF:: @ 85EDCCF - .incbin "baserom.gba", 0x5edccf, 0x8 + +.string "POKéDEX$" gUnknown_085EDCD7:: @ 85EDCD7 - .incbin "baserom.gba", 0x5edcd7, 0x7 + +.string "BADGES$" gUnknown_085EDCDE:: @ 85EDCDE - .incbin "baserom.gba", 0x5edcde, 0x7 + +.string "POWDER$" gUnknown_085EDCE5:: @ 85EDCE5 - .incbin "baserom.gba", 0x5edce5, 0x64 + +.string "DODRIO BERRY-PICKING RECORDS$" +.string "BERRIES picked:$" +.string "Best score:$" +.string "BERRIES picked in a row with\nfive players:$" gUnknown_085EDD49:: @ 85EDD49 - .incbin "baserom.gba", 0x5edd49, 0x22 + +.string "Announcing BERRY-PICKING results!$" gUnknown_085EDD6B:: @ 85EDD6B .incbin "baserom.gba", 0x5edd6b, 0x1b - + gUnknown_085EDD86:: @ 85EDD86 - .incbin "baserom.gba", 0x5edd86, 0x15 + +.string "Announcing rankings!$" gUnknown_085EDD9B:: @ 85EDD9B - .incbin "baserom.gba", 0x5edd9b, 0x22 + +.string "Announcing prizes!$" +.string "1:$" +.string "2:$" +.string "3:$" +.string "4:$" +.string "5:$" gUnknown_085EDDBD:: @ 85EDDBD - .incbin "baserom.gba", 0x5eddbd, 0x25 + +.string "The first-place winner gets\nthis {SPECIAL_F7} !$" gUnknown_085EDDE2:: @ 85EDDE2 - .incbin "baserom.gba", 0x5edde2, 0x19 + +.string "You can’t hold any more!$" gUnknown_085EDDFB:: @ 85EDDFB - .incbin "baserom.gba", 0x5eddfb, 0x1d + +.string "It filled its storage space.$" gUnknown_085EDE18:: @ 85EDE18 - .incbin "baserom.gba", 0x5ede18, 0x14 + +.string "Want to play again?$" gUnknown_085EDE2C:: @ 85EDE2C - .incbin "baserom.gba", 0x5ede2c, 0x31 + +.string "Somebody dropped out.\nThe link will be canceled.$" gUnknown_085EDE5D:: @ 85EDE5D - .incbin "baserom.gba", 0x5ede5d, 0x8 + +.string " points$" gUnknown_085EDE65:: @ 85EDE65 - .incbin "baserom.gba", 0x5ede65, 0x17 + +.string "Communication standby…$" gUnknown_085EDE7C:: @ 85EDE7C - .incbin "baserom.gba", 0x5ede7c, 0x8 + +.string " points$" gUnknown_085EDE84:: @ 85EDE84 - .incbin "baserom.gba", 0x5ede84, 0x9 + +.string " time(s)$" gUnknown_085EDE8D:: @ 85EDE8D - .incbin "baserom.gba", 0x5ede8d, 0x46 + +.string "POKéMON JUMP RECORDS$" +.string "Jumps in a row:$" +.string "Best score:$" +.string "EXCELLENTS in a row:$" gUnknown_085EDED3:: @ 85EDED3 - .incbin "baserom.gba", 0x5eded3, 0x21 + +.string "Awesome score! You’ve\nwon {SPECIAL_F7}À {SPECIAL_F7} !$" gUnknown_085EDEF4:: @ 85EDEF4 - .incbin "baserom.gba", 0x5edef4, 0x1d + +.string "It filled its storage space.$" gUnknown_085EDF11:: @ 85EDF11 - .incbin "baserom.gba", 0x5edf11, 0x19 + +.string "You can’t hold any more!$" gUnknown_085EDF2A:: @ 85EDF2A - .incbin "baserom.gba", 0x5edf2a, 0x14 + +.string "Want to play again?$" gUnknown_085EDF3E:: @ 85EDF3E - .incbin "baserom.gba", 0x5edf3e, 0x31 + +.string "Somebody dropped out.\nThe link will be canceled.$" gUnknown_085EDF6F:: @ 85EDF6F - .incbin "baserom.gba", 0x5edf6f, 0x17 + +.string "Communication standby…$" gUnknown_085EDF86:: @ 85EDF86 - .incbin "baserom.gba", 0x5edf86, 0x1a + +.string "{PLAYER}’s Link Contest Results$" gUnknown_085EDFA0:: @ 85EDFA0 - .incbin "baserom.gba", 0x5edfa0, 0x4 + +.string "1st$" gUnknown_085EDFA4:: @ 85EDFA4 - .incbin "baserom.gba", 0x5edfa4, 0x4 + +.string "2nd$" gUnknown_085EDFA8:: @ 85EDFA8 - .incbin "baserom.gba", 0x5edfa8, 0x4 + +.string "3rd$" gUnknown_085EDFAC:: @ 85EDFAC - .incbin "baserom.gba", 0x5edfac, 0x4 + +.string "4th$" gUnknown_085EDFB0:: @ 85EDFB0 - .incbin "baserom.gba", 0x5edfb0, 0xf + +.string "Friend$" +.string "POKeMON$" gUnknown_085EDFBF:: @ 85EDFBF - .incbin "baserom.gba", 0x5edfbf, 0xa + +.string "êÏぎßóúÁóç$" gUnknown_085EDFC9:: @ 85EDFC9 - .incbin "baserom.gba", 0x5edfc9, 0xd + +.string "{248} ÌっÛÁ {248}Àôòñ$" gUnknown_085EDFD6:: @ 85EDFD6 .incbin "baserom.gba", 0x5edfd6, 0x1f @@ -1583,363 +2784,564 @@ gUnknown_085EE120:: @ 85EE120 gUnknown_085EE12D:: @ 85EE12D .incbin "baserom.gba", 0x5ee12d, 0x2b - + gUnknown_085EE158:: @ 85EE158 - .incbin "baserom.gba", 0x5ee158, 0x20 + +.string "{PLAYER}’s Single Battle Room Results$" gUnknown_085EE178:: @ 85EE178 - .incbin "baserom.gba", 0x5ee178, 0x20 + +.string "{PLAYER}’s Double Battle Room Results$" gUnknown_085EE198:: @ 85EE198 - .incbin "baserom.gba", 0x5ee198, 0x1f + +.string "{PLAYER}’s Multi Battle Room Results$" gUnknown_085EE1B7:: @ 85EE1B7 - .incbin "baserom.gba", 0x5ee1b7, 0x24 + +.string "{PLAYER}’s Link Multi Battle Room Results$" gUnknown_085EE1DB:: @ 85EE1DB - .incbin "baserom.gba", 0x5ee1db, 0x23 + +.string "{PLAYER}’s Single Battle Tourney Results$" gUnknown_085EE1FE:: @ 85EE1FE - .incbin "baserom.gba", 0x5ee1fe, 0x23 + +.string "{PLAYER}’s Double Battle Tourney Results$" gUnknown_085EE221:: @ 85EE221 - .incbin "baserom.gba", 0x5ee221, 0x20 + +.string "{PLAYER}’s Single Battle Hall Results$" gUnknown_085EE241:: @ 85EE241 - .incbin "baserom.gba", 0x5ee241, 0x20 + +.string "{PLAYER}’s Double Battle Hall Results$" gUnknown_085EE261:: @ 85EE261 - .incbin "baserom.gba", 0x5ee261, 0x1b + +.string "{PLAYER}’s Battle Choice Results$" gUnknown_085EE27C:: @ 85EE27C - .incbin "baserom.gba", 0x5ee27c, 0x1c + +.string "{PLAYER}’s Set KO Tourney Results$" gUnknown_085EE298:: @ 85EE298 - .incbin "baserom.gba", 0x5ee298, 0x20 + +.string "{PLAYER}’s Battle Swap Single Results$" gUnknown_085EE2B8:: @ 85EE2B8 - .incbin "baserom.gba", 0x5ee2b8, 0x20 + +.string "{PLAYER}’s Battle Swap Double Results$" gUnknown_085EE2D8:: @ 85EE2D8 - .incbin "baserom.gba", 0x5ee2d8, 0x1a + +.string "{PLAYER}’s Battle Quest Results$" gUnknown_085EE2F2:: @ 85EE2F2 - .incbin "baserom.gba", 0x5ee2f2, 0x7 + +.string "LV. 50$" gUnknown_085EE2F9:: @ 85EE2F9 - .incbin "baserom.gba", 0x5ee2f9, 0x9 + +.string "OPEN LV.$" gUnknown_085EE302:: @ 85EE302 - .incbin "baserom.gba", 0x5ee302, 0xf + +.string "Win streak: {STR_VAR_1}$" gUnknown_085EE311:: @ 85EE311 - .incbin "baserom.gba", 0x5ee311, 0x8 + +.string "CURRENT$" gUnknown_085EE319:: @ 85EE319 - .incbin "baserom.gba", 0x5ee319, 0x7 + +.string "RECORD$" gUnknown_085EE320:: @ 85EE320 - .incbin "baserom.gba", 0x5ee320, 0x6 + +.string "PREV.$" gUnknown_085EE326:: @ 85EE326 - .incbin "baserom.gba", 0x5ee326, 0xc + +.string "Rental/Swap$" gUnknown_085EE332:: @ 85EE332 - .incbin "baserom.gba", 0x5ee332, 0x6 + +.string "Total$" gUnknown_085EE338:: @ 85EE338 - .incbin "baserom.gba", 0x5ee338, 0x11 + +.string "Clear streak: {STR_VAR_1}$" gUnknown_085EE349:: @ 85EE349 - .incbin "baserom.gba", 0x5ee349, 0x12 + +.string "Championships: {STR_VAR_1}$" gUnknown_085EE35B:: @ 85EE35B - .incbin "baserom.gba", 0x5ee35b, 0x12 + +.string "Rooms cleared: {STR_VAR_1}$" gUnknown_085EE36D:: @ 85EE36D - .incbin "baserom.gba", 0x5ee36d, 0x14 + +.string "Times cleared:{CLEAR}È{STR_VAR_1}$" gUnknown_085EE381:: @ 85EE381 - .incbin "baserom.gba", 0x5ee381, 0x11 + +.string "KOs in a row: {STR_VAR_1}$" gUnknown_085EE392:: @ 85EE392 - .incbin "baserom.gba", 0x5ee392, 0xa + +.string "Times: {STR_VAR_1}$" gUnknown_085EE39C:: @ 85EE39C .incbin "baserom.gba", 0x5ee39c, 0x88 gUnknown_085EE424:: @ 85EE424 - .incbin "baserom.gba", 0x5ee424, 0x9 + +.string "1.$" +.string "2.$" +.string "3.$" gUnknown_085EE42D:: @ 85EE42D - .incbin "baserom.gba", 0x5ee42d, 0x22 + +.string "SAVING…\nDON’T TURN OFF THE POWER.$" gUnknown_085EE44F:: @ 85EE44F - .incbin "baserom.gba", 0x5ee44f, 0x24 + +.string "BERRY BLENDER\nMAXIMUM SPEED RECORD!$" gUnknown_085EE473:: @ 85EE473 - .incbin "baserom.gba", 0x5ee473, 0x1e + +.string "2 PLAYERS\n3 PLAYERS\n4 PLAYERS$" gUnknown_085EE491:: @ 85EE491 - .incbin "baserom.gba", 0x5ee491, 0x7 + +.string "YES\nNO$" gUnknown_085EE498:: @ 85EE498 - .incbin "baserom.gba", 0x5ee498, 0x2 + +.string "▶$" gUnknown_085EE49A:: @ 85EE49A - .incbin "baserom.gba", 0x5ee49a, 0xa + +.string "PEEKABOO!$" gUnknown_085EE4A4:: @ 85EE4A4 - .incbin "baserom.gba", 0x5ee4a4, 0x53 + +.string "Communication error…\nPlease check all connections,\nthen turn the power OFF and ON.$" gUnknown_085EE4F7:: @ 85EE4F7 - .incbin "baserom.gba", 0x5ee4f7, 0x15 + +.string "Communication error…$" gUnknown_085EE50C:: @ 85EE50C - .incbin "baserom.gba", 0x5ee50c, 0x47 + +.string "Move closer to your link partner(s).\nAvoid obstacles between partners.$" gUnknown_085EE553:: @ 85EE553 - .incbin "baserom.gba", 0x5ee553, 0x1f + +.string "A Button: Registration Counter$" gUnknown_085EE572:: @ 85EE572 - .incbin "baserom.gba", 0x5ee572, 0x17 + +.string "A Button: Title Screen$" gUnknown_085EE589:: @ 85EE589 - .incbin "baserom.gba", 0x5ee589, 0x4b + +.string "OPTION$" +.string "TEXT SPEED$" +.string "BATTLE SCENE$" +.string "BATTLE STYLE$" +.string "SOUND$" +.string "FRAME$" +.string "CANCEL$" +.string "BUTTON MODE$" gUnknown_085EE5D4:: @ 85EE5D4 - .incbin "baserom.gba", 0x5ee5d4, 0xb + +.string "{COLOR CYAN}{SHADOW MAGENTA}SLOW$" gUnknown_085EE5DF:: @ 85EE5DF - .incbin "baserom.gba", 0x5ee5df, 0xa + +.string "{COLOR CYAN}{SHADOW MAGENTA}MID$" gUnknown_085EE5E9:: @ 85EE5E9 - .incbin "baserom.gba", 0x5ee5e9, 0xb + +.string "{COLOR CYAN}{SHADOW MAGENTA}FAST$" gUnknown_085EE5F4:: @ 85EE5F4 - .incbin "baserom.gba", 0x5ee5f4, 0x9 + +.string "{COLOR CYAN}{SHADOW MAGENTA}ON$" gUnknown_085EE5FD:: @ 85EE5FD - .incbin "baserom.gba", 0x5ee5fd, 0xa + +.string "{COLOR CYAN}{SHADOW MAGENTA}OFF$" gUnknown_085EE607:: @ 85EE607 - .incbin "baserom.gba", 0x5ee607, 0xc + +.string "{COLOR CYAN}{SHADOW MAGENTA}SHIFT$" gUnknown_085EE613:: @ 85EE613 - .incbin "baserom.gba", 0x5ee613, 0xa + +.string "{COLOR CYAN}{SHADOW MAGENTA}SET$" gUnknown_085EE61D:: @ 85EE61D - .incbin "baserom.gba", 0x5ee61d, 0xb + +.string "{COLOR CYAN}{SHADOW MAGENTA}MONO$" gUnknown_085EE628:: @ 85EE628 - .incbin "baserom.gba", 0x5ee628, 0xd + +.string "{COLOR CYAN}{SHADOW MAGENTA}STEREO$" gUnknown_085EE635:: @ 85EE635 - .incbin "baserom.gba", 0x5ee635, 0xb + +.string "{COLOR CYAN}{SHADOW MAGENTA}TYPE$" gUnknown_085EE640:: @ 85EE640 - .incbin "baserom.gba", 0x5ee640, 0x7 + +.string "{COLOR CYAN}{SHADOW MAGENTA}$" gUnknown_085EE647:: @ 85EE647 - .incbin "baserom.gba", 0x5ee647, 0xd + +.string "{COLOR CYAN}{SHADOW MAGENTA}NORMAL$" gUnknown_085EE654:: @ 85EE654 - .incbin "baserom.gba", 0x5ee654, 0x9 + +.string "{COLOR CYAN}{SHADOW MAGENTA}LR$" gUnknown_085EE65D:: @ 85EE65D - .incbin "baserom.gba", 0x5ee65d, 0xa + +.string "{COLOR CYAN}{SHADOW MAGENTA}L=A$" gUnknown_085EE667:: @ 85EE667 - .incbin "baserom.gba", 0x5ee667, 0x23 + +.string "{STR_VAR_1}P LINK$" +.string "BRONZE$" +.string "COPPER$" +.string "SILVER$" +.string "GOLD$" gUnknown_085EE68A:: @ 85EE68A - .incbin "baserom.gba", 0x5ee68a, 0x4 + +.string "DAY$" gUnknown_085EE68E:: @ 85EE68E - .incbin "baserom.gba", 0x5ee68e, 0x2 + +.string ":$" gUnknown_085EE690:: @ 85EE690 - .incbin "baserom.gba", 0x5ee690, 0x6f -gUnknown_085EE6FF:: @ 85EE6FF - .incbin "baserom.gba", 0x5ee6ff, 0x17 +.string "CONFIRM$" +.string "Days$" +.string "Time:$" +.string "Game time$" +.string "RTC time$" +.string "Updated time$" +.string "POKéDEX$" +.string "POKéMON$" +.string "BAG$" +.string "POKéNAV$" +.string "{PLAYER}$" +.string "SAVE$" +.string "OPTION$" +.string "EXIT$" +.string "RETIRE$" +.string "REST$" -gUnknown_085EE716:: @ 85EE716 - .incbin "baserom.gba", 0x5ee716, 0x4f +gOtherText_SafariStock:: @ 85EE6FF + +.string "SAFARI BALLS\nStock: {STR_VAR_1}$" + +gOtherText_BattlePyramid_X:: @ 85EE716 + +.string "Battle Pyramid\n{STR_VAR_1}$" +.string "Floor 1$" +.string "Floor 2$" +.string "Floor 3$" +.string "Floor 4$" +.string "Floor 5$" +.string "Floor 6$" +.string "Floor 7$" +.string "Peak$" gUnknown_085EE765:: @ 85EE765 - .incbin "baserom.gba", 0x5ee765, 0x23 + +.string "Link standby…\n… … B Button: Cancel$" gUnknown_085EE788:: @ 85EE788 - .incbin "baserom.gba", 0x5ee788, 0x37 + +.string "Press the A Button to load event.\n… … B Button: Cancel$" gUnknown_085EE7BF:: @ 85EE7BF - .incbin "baserom.gba", 0x5ee7bf, 0xf + +.string "Loading event…$" gUnknown_085EE7CE:: @ 85EE7CE - .incbin "baserom.gba", 0x5ee7ce, 0x3c + +.string "Don’t remove the Game Link cable.\nDon’t turn off the power.$" gUnknown_085EE80A:: @ 85EE80A - .incbin "baserom.gba", 0x5ee80a, 0x1d + +.string "The event was safely loaded.$" gUnknown_085EE827:: @ 85EE827 .incbin "baserom.gba", 0x5ee827, 0x28 gUnknown_085EE84F:: @ 85EE84F - .incbin "baserom.gba", 0x5ee84f, 0x6 + +.string "HOENN$" gUnknown_085EE855:: @ 85EE855 - .incbin "baserom.gba", 0x5ee855, 0x9 + +.string "NATIONAL$" gUnknown_085EE85E:: @ 85EE85E .incbin "baserom.gba", 0x5ee85e, 0x93 gUnknown_085EE8F1:: @ 85EE8F1 - .incbin "baserom.gba", 0x5ee8f1, 0x6 + +.string "HOENN$" gUnknown_085EE8F7:: @ 85EE8F7 - .incbin "baserom.gba", 0x5ee8f7, 0xc + +.string "Oh! A bite!$" gUnknown_085EE903:: @ 85EE903 - .incbin "baserom.gba", 0x5ee903, 0x1b + +.string "A POKéMON’s on the hook!{PAUSE_UNTIL_PRESS}$" gUnknown_085EE91E:: @ 85EE91E - .incbin "baserom.gba", 0x5ee91e, 0x15 + +.string "Not even a nibble…{PAUSE_UNTIL_PRESS}$" gUnknown_085EE933:: @ 85EE933 - .incbin "baserom.gba", 0x5ee933, 0xf + +.string "It got away…{PAUSE_UNTIL_PRESS}$" gUnknown_085EE942:: @ 85EE942 - .incbin "baserom.gba", 0x5ee942, 0x17 + +.string "{STR_VAR_2} will be\nsent to {STR_VAR_1}.$" gUnknown_085EE959:: @ 85EE959 - .incbin "baserom.gba", 0x5ee959, 0xd + +.string "Bye-bye, {STR_VAR_2}!$" gUnknown_085EE966:: @ 85EE966 - .incbin "baserom.gba", 0x5ee966, 0x11 + +.string "{STR_VAR_1} sent over {STR_VAR_3}.$" gUnknown_085EE977:: @ 85EE977 - .incbin "baserom.gba", 0x5ee977, 0x16 -@ 85EE98D +.string "Take good care of {STR_VAR_3}!$" + + .include "data/text/easy_chat/easy_chat_group_names.inc" gUnknown_085EEA42:: @ 85EEA42 - .incbin "baserom.gba", 0x5eea42, 0x31 + +.string "???$" +.string "MAX. HP$" +.string "ATTACK$" +.string "DEFENSE$" +.string "SPEED$" +.string "SP. ATK$" +.string "SP. DEF$" gUnknown_085EEA73:: @ 85EEA73 - .incbin "baserom.gba", 0x5eea73, 0x3 + +.string "{249}Ç$" gUnknown_085EEA76:: @ 85EEA76 - .incbin "baserom.gba", 0x5eea76, 0x2 + +.string "-$" gUnknown_085EEA78:: @ 85EEA78 - .incbin "baserom.gba", 0x5eea78, 0x6 + +.string "From $" gUnknown_085EEA7E:: @ 85EEA7E - .incbin "baserom.gba", 0x5eea7e, 0x10 + +.string "Mixing records…$" gUnknown_085EEA8E:: @ 85EEA8E - .incbin "baserom.gba", 0x5eea8e, 0x68 + +.string "Record mixing completed.\nThank you for waiting.$" +.string "YOUR NAME?$" +.string "BOX NAME?$" +.string "{STR_VAR_1}’s nickname?$" +.string "Tell him the words.$" gUnknown_085EEAF6:: @ 85EEAF6 - .incbin "baserom.gba", 0x5eeaf6, 0x15 + +.string "{248}ÏMOVE {248} OK {248}ÀBACK$" gUnknown_085EEB0B:: @ 85EEB0B - .incbin "baserom.gba", 0x5eeb0b, 0x73 + +.string "A call can’t be made from here.$" +.string "HANDSOME$" +.string "VINNY$" +.string "MOREME$" +.string "IRONHARD$" +.string "MUSCLE$" +.string "coolness$" +.string "beauty$" +.string "cuteness$" +.string "smartness$" +.string "toughness$" gUnknown_085EEB7E:: @ 85EEB7E - .incbin "baserom.gba", 0x5eeb7e, 0x34 + +.string "Lady$" +.string "slippery$" +.string "roundish$" +.string "wham-ish$" +.string "shiny$" +.string "sticky$" +.string "pointy$" gUnknown_085EEBB2:: @ 85EEBB2 - .incbin "baserom.gba", 0x5eebb2, 0xf + +.string "RENTAL POKéMON$" gUnknown_085EEBC1:: @ 85EEBC1 - .incbin "baserom.gba", 0x5eebc1, 0x1a + +.string "Select the first POKéMON.$" gUnknown_085EEBDB:: @ 85EEBDB - .incbin "baserom.gba", 0x5eebdb, 0x1b + +.string "Select the second POKéMON.$" gUnknown_085EEBF6:: @ 85EEBF6 - .incbin "baserom.gba", 0x5eebf6, 0x1a + +.string "Select the third POKéMON.$" gUnknown_085EEC10:: @ 85EEC10 - .incbin "baserom.gba", 0x5eec10, 0x5 + +.string "RENT$" gUnknown_085EEC15:: @ 85EEC15 - .incbin "baserom.gba", 0x5eec15, 0x8 + +.string "SUMMARY$" gUnknown_085EEC1D:: @ 85EEC1D - .incbin "baserom.gba", 0x5eec1d, 0x7 + +.string "OTHERS$" gUnknown_085EEC24:: @ 85EEC24 - .incbin "baserom.gba", 0x5eec24, 0x9 + +.string "DESELECT$" gUnknown_085EEC2D:: @ 85EEC2D - .incbin "baserom.gba", 0x5eec2d, 0x1c + +.string "Are these three POKéMON OK?$" gUnknown_085EEC49:: @ 85EEC49 - .incbin "baserom.gba", 0x5eec49, 0x4 + +.string "YES$" gUnknown_085EEC4D:: @ 85EEC4D - .incbin "baserom.gba", 0x5eec4d, 0x3 + +.string "NO$" gUnknown_085EEC50:: @ 85EEC50 - .incbin "baserom.gba", 0x5eec50, 0x16 + +.string "Can’t select same {PKMN}.$" gUnknown_085EEC66:: @ 85EEC66 - .incbin "baserom.gba", 0x5eec66, 0xd + +.string "POKéMON SWAP$" gUnknown_085EEC73:: @ 85EEC73 - .incbin "baserom.gba", 0x5eec73, 0x18 + +.string "Select POKéMON to swap.$" gUnknown_085EEC8B:: @ 85EEC8B - .incbin "baserom.gba", 0x5eec8b, 0x1a + +.string "Select POKéMON to accept.$" gUnknown_085EECA5:: @ 85EECA5 - .incbin "baserom.gba", 0x5eeca5, 0x5 + +.string "SWAP$" gUnknown_085EECAA:: @ 85EECAA - .incbin "baserom.gba", 0x5eecaa, 0x8 + +.string "SUMMARY$" gUnknown_085EECB2:: @ 85EECB2 - .incbin "baserom.gba", 0x5eecb2, 0x9 + +.string "RECHOOSE$" gUnknown_085EECBB:: @ 85EECBB - .incbin "baserom.gba", 0x5eecbb, 0xf + +.string "Quit swapping?$" gUnknown_085EECCA:: @ 85EECCA - .incbin "baserom.gba", 0x5eecca, 0x4 + +.string "YES$" gUnknown_085EECCE:: @ 85EECCE - .incbin "baserom.gba", 0x5eecce, 0x3 + +.string "NO$" gUnknown_085EECD1:: @ 85EECD1 - .incbin "baserom.gba", 0x5eecd1, 0xc + +.string "{PKMN} FOR SWAP$" gUnknown_085EECDD:: @ 85EECDD - .incbin "baserom.gba", 0x5eecdd, 0x13 + +.string "CANCEL$" +.string "SWAP$" +.string "ACCEPT$" gUnknown_085EECF0:: @ 85EECF0 - .incbin "baserom.gba", 0x5eecf0, 0x1a + +.string "Accept this POKéMON?$" +.string " $" gUnknown_085EED0A:: @ 85EED0A - .incbin "baserom.gba", 0x5eed0a, 0x1a -gUnknown_085EED24:: @ 85EED24 - .incbin "baserom.gba", 0x5eed24, 0x2 +.string "Same {PKMN} in party already.$" + +gOtherText_DecimalPoint:: @ 85EED24 + +.string ".$" gUnknown_085EED26:: @ 85EED26 - .incbin "baserom.gba", 0x5eed26, 0x7 + +.string "PLAYER$" gUnknown_085EED2D:: @ 85EED2D - .incbin "baserom.gba", 0x5eed2d, 0x7 + +.string "BADGES$" gUnknown_085EED34:: @ 85EED34 - .incbin "baserom.gba", 0x5eed34, 0x8 + +.string "POKéDEX$" gUnknown_085EED3C:: @ 85EED3C - .incbin "baserom.gba", 0x5eed3c, 0x1b4 + +.string "TIME$" +.string "Wireless Communication Status$" +.string "People trading:$" +.string "People battling:$" +.string "People in the UNION ROOM:$" +.string "People communicating:$" +.string "{SPECIAL_F7} players$" +.string "{SPECIAL_F7}À players$" +.string "{SPECIAL_F7}Á players$" +.string "{SPECIAL_F7} players$" +.string "…yセËAyセËLyセËWyセËWONDER CARDS$" +.string " WONDER NEWS$" +.string "WIRELESS COMMUNICATION$" +.string " FRIEND$" +.string " EXIT$" +.string " RECEIVE$" +.string "SEND$" +.string " TOSS$" +.string " A variety of events will be imported\nover Wireless Communication.$" +.string " Read the WONDER CARDS in your\npossession.$" +.string " Read the NEWS that arrived.$" +.string "Return to the title screen.$" gUnknown_085EEEF0:: @ 85EEEF0 .incbin "baserom.gba", 0x5eeef0, 0x3c @@ -1951,7 +3353,9 @@ gUnknown_085EEF68:: @ 85EEF68 .incbin "baserom.gba", 0x5eef68, 0x2c gUnknown_085EEF94:: @ 85EEF94 - .incbin "baserom.gba", 0x5eef94, 0x54 + +.string "Where should the WONDER NEWS\nbe accessed?$" +.string " Communication standby…\nB Button: Cancel$" gUnknown_085EEFE8:: @ 85EEFE8 .incbin "baserom.gba", 0x5eefe8, 0x10 @@ -1996,10 +3400,12 @@ gUnknown_085EF1D8:: @ 85EF1D8 .incbin "baserom.gba", 0x5ef1d8, 0x28 gUnknown_085EF200:: @ 85EF200 - .incbin "baserom.gba", 0x5ef200, 0x1c + +.string "You already had that\nSTAMP.$" gUnknown_085EF21C:: @ 85EF21C - .incbin "baserom.gba", 0x5ef21c, 0x28 + +.string "There’s no more room for adding\nSTAMPS.$" gUnknown_085EF244:: @ 85EF244 .incbin "baserom.gba", 0x5ef244, 0x3c @@ -2008,7 +3414,8 @@ gUnknown_085EF280:: @ 85EF280 .incbin "baserom.gba", 0x5ef280, 0x34 gUnknown_085EF2B4:: @ 85EF2B4 - .incbin "baserom.gba", 0x5ef2b4, 0x30 + +.string "You can’t accept WONDER NEWS\nfrom this TRAINER.$" gUnknown_085EF2E4:: @ 85EF2E4 .incbin "baserom.gba", 0x5ef2e4, 0x18 @@ -2017,7 +3424,8 @@ gUnknown_085EF2FC:: @ 85EF2FC .incbin "baserom.gba", 0x5ef2fc, 0x34 gUnknown_085EF330:: @ 85EF330 - .incbin "baserom.gba", 0x5ef330, 0x30 + +.string "What would you like to do\nwith the WONDER NEWS?$" gUnknown_085EF360:: @ 85EF360 .incbin "baserom.gba", 0x5ef360, 0x1c @@ -2035,13 +3443,16 @@ gUnknown_085EF3F0:: @ 85EF3F0 .incbin "baserom.gba", 0x5ef3f0, 0x20 gUnknown_085EF410:: @ 85EF410 - .incbin "baserom.gba", 0x5ef410, 0x1c + +.string "A GIFT has been sent to {STR_VAR_1}.$" gUnknown_085EF42C:: @ 85EF42C - .incbin "baserom.gba", 0x5ef42c, 0x34 + +.string "The other TRAINER has the same\nWONDER CARD already.$" gUnknown_085EF460:: @ 85EF460 - .incbin "baserom.gba", 0x5ef460, 0x34 + +.string "The other TRAINER has the same\nWONDER NEWS already.$" gUnknown_085EF494:: @ 85EF494 .incbin "baserom.gba", 0x5ef494, 0x30 @@ -2080,130 +3491,230 @@ gUnknown_085EF664:: @ 85EF664 .incbin "baserom.gba", 0x5ef664, 0x14 gUnknown_085EF678:: @ 85EF678 - .incbin "baserom.gba", 0x5ef678, 0x15 + +.string "{248}こPICK {248} OK {248}ÀCANCEL$" gUnknown_085EF68D:: @ 85EF68D - .incbin "baserom.gba", 0x5ef68d, 0x14 + +.string "{PLAYER}’s BATTLE RESULTS$" gUnknown_085EF6A1:: @ 85EF6A1 - .incbin "baserom.gba", 0x5ef6a1, 0x1c + +.string "TOTAL RECORD W:{STR_VAR_1} L:{STR_VAR_2} D:{STR_VAR_3}$" gUnknown_085EF6BD:: @ 85EF6BD .incbin "baserom.gba", 0x5ef6bd, 0x15 - + gUnknown_085EF6D2:: @ 85EF6D2 - .incbin "baserom.gba", 0x5ef6d2, 0x17 + +.string "Communication standby…$" gUnknown_085EF6E9:: @ 85EF6E9 - .incbin "baserom.gba", 0x5ef6e9, 0xf + +.string "Quit the game?$" gUnknown_085EF6F8:: @ 85EF6F8 - .incbin "baserom.gba", 0x5ef6f8, 0x18 + +.string "You’ve got 9,999 COINS.$" gUnknown_085EF710:: @ 85EF710 - .incbin "baserom.gba", 0x5ef710, 0x24 + +.string "You’ve run out of COINS.\nGame over!$" gUnknown_085EF734:: @ 85EF734 - .incbin "baserom.gba", 0x5ef734, 0x1c + +.string "You don’t have three COINS.$" gUnknown_085EF750:: @ 85EF750 - .incbin "baserom.gba", 0x5ef750, 0x131 + +.string "REEL TIME\nHere’s your chance to take\naim and nail marks!\nReel Time continues for the\nawarded number of spins.\nIt all ends on a Big Bonus.$" +.string "The two seem to get along\nvery well.$" +.string "The two seem to get along.$" +.string "The two don’t seem to like\neach other much.$" +.string "The two prefer to play with other\nPOKéMON than each other.$" gUnknown_085EF881:: @ 85EF881 - .incbin "baserom.gba", 0x5ef881, 0x2 + +.string "\n$" gUnknown_085EF883:: @ 85EF883 - .incbin "baserom.gba", 0x5ef883, 0x5 + +.string "EXIT$" gUnknown_085EF888:: @ 85EF888 - .incbin "baserom.gba", 0x5ef888, 0x2 + +.string "{LV}$" gUnknown_085EF88A:: @ 85EF88A - .incbin "baserom.gba", 0x5ef88a, 0xb + +.string "TIME BOARD$" gUnknown_085EF895:: @ 85EF895 - .incbin "baserom.gba", 0x5ef895, 0xe + +.string "TIME CLEARED $" gUnknown_085EF8A3:: @ 85EF8A3 - .incbin "baserom.gba", 0x5ef8a3, 0x1f + +.string "{STR_VAR_1} min. {STR_VAR_2}.{STR_VAR_3} sec.$" +.string "1F$" +.string "2F$" +.string "3F$" +.string "4F$" gUnknown_085EF8C2:: @ 85EF8C2 - .incbin "baserom.gba", 0x5ef8c2, 0x18 + +.string "Teach which move to {STR_VAR_1}?$" gUnknown_085EF8DA:: @ 85EF8DA - .incbin "baserom.gba", 0x5ef8da, 0xa + +.string "Teach {STR_VAR_2}?$" gUnknown_085EF8E4:: @ 85EF8E4 - .incbin "baserom.gba", 0x5ef8e4, 0xf + +.string "{STR_VAR_1} learned\n{STR_VAR_2}!$" gUnknown_085EF8F3:: @ 85EF8F3 - .incbin "baserom.gba", 0x5ef8f3, 0x6d + +.string "{STR_VAR_1} is trying to learn\n{STR_VAR_2}.\pBut {STR_VAR_1} can’t learn more\nthan four moves.\pDelete an older move to make\nroom for {STR_VAR_2}?$" gUnknown_085EF960:: @ 85EF960 - .incbin "baserom.gba", 0x5ef960, 0x19 + +.string "Stop trying to teach\n{STR_VAR_2}?$" gUnknown_085EF979:: @ 85EF979 - .incbin "baserom.gba", 0x5ef979, 0x2d + +.string "{PAUSE 32}1, {PAUSE 15}2, and {PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE 0x0038}Poof!\p$" gUnknown_085EF9A6:: @ 85EF9A6 - .incbin "baserom.gba", 0x5ef9a6, 0x40 + +.string "{STR_VAR_1} forgot {STR_VAR_3}.\pAnd…\p{STR_VAR_1} learned {STR_VAR_2}.$" +.string "{STR_VAR_1} did not learn the\nmove {STR_VAR_2}.$" gUnknown_085EF9E6:: @ 85EF9E6 - .incbin "baserom.gba", 0x5ef9e6, 0x2a + +.string "Give up trying to teach a new\nmove to {STR_VAR_1}?$" gUnknown_085EFA10:: @ 85EFA10 - .incbin "baserom.gba", 0x5efa10, 0x21 + +.string "Which move should be\nforgotten?\p$" gUnknown_085EFA31:: @ 85EFA31 - .incbin "baserom.gba", 0x5efa31, 0xd + +.string "BATTLE MOVES$" gUnknown_085EFA3E:: @ 85EFA3E - .incbin "baserom.gba", 0x5efa3e, 0x14 + +.string "CONTEST MOVES$" +.string "TYPE/$" gUnknown_085EFA52:: @ 85EFA52 - .incbin "baserom.gba", 0x5efa52, 0x4 + +.string "PP/$" gUnknown_085EFA56:: @ 85EFA56 - .incbin "baserom.gba", 0x5efa56, 0x7 + +.string "POWER/$" gUnknown_085EFA5D:: @ 85EFA5D - .incbin "baserom.gba", 0x5efa5d, 0xa + +.string "ACCURACY/$" gUnknown_085EFA67:: @ 85EFA67 - .incbin "baserom.gba", 0x5efa67, 0x7 + +.string "APPEAL$" gUnknown_085EFA6E:: @ 85EFA6E - .incbin "baserom.gba", 0x5efa6e, 0x21 + +.string "JAM$" +.string "KIRA$" +.string "AMY$" +.string "JOHN$" +.string "ROY$" +.string "GABBY$" +.string "ANNA$" gUnknown_085EFA8F:: @ 85EFA8F - .incbin "baserom.gba", 0x5efa8f, 0x1b + +.string "Clear all save data areas?$" gUnknown_085EFAAA:: @ 85EFAAA - .incbin "baserom.gba", 0x5efaaa, 0x1c + +.string "Clearing data…\nPlease wait.$" gUnknown_085EFAC6:: @ 85EFAC6 - .incbin "baserom.gba", 0x5efac6, 0x1a + +.string "Is this the correct time?$" gUnknown_085EFAE0:: @ 85EFAE0 - .incbin "baserom.gba", 0x5efae0, 0x8 + +.string "CONFIRM$" gUnknown_085EFAE8:: @ 85EFAE8 - .incbin "baserom.gba", 0x5efae8, 0xea + +.string "CANCEL$" +.string "DEVON PRES$" +.string "MR. STONE$" +.string "HARD AS ROCK$" +.string "STEVEN$" +.string "RAD NEIGHBOR$" +.string "RELIABLE ONE$" +.string "CALM & KIND$" +.string "{PKMN} LOVER$" +.string "DAD$" +.string "MOM$" +.string "ELUSIVE EYES$" +.string "SCOTT$" +.string "ROCKIN’ WHIZ$" +.string "THE BIG HIT$" +.string "SWELL SHOCK$" +.string "PASSION BURN$" +.string "SKY TAMER$" +.string "MYSTIC DUO$" +.string "DANDY CHARM$" +.string "ELITE FOUR$" +.string "CHAMPION$" +.string "{PKMN} PROF.$" gUnknown_085EFBD2:: @ 85EFBD2 - .incbin "baserom.gba", 0x5efbd2, 0x3a + +.string "Communication standby…\nAwaiting another player to choose.$" gUnknown_085EFC0C:: @ 85EFC0C - .incbin "baserom.gba", 0x5efc0c, 0x1b + +.string "The battle was refused.{PAUSE 60}$" gUnknown_085EFC27:: @ 85EFC27 - .incbin "baserom.gba", 0x5efc27, 0xad + +.string "Refused the battle.{PAUSE 60}$" +.string "NO WEATHER$" +.string "SUNNY$" +.string "SUNNY2$" +.string "RAIN$" +.string "SNOW$" +.string "LIGHTNING$" +.string "FOG$" +.string "VOLCANO ASH$" +.string "SANDSTORM$" +.string "FOG2$" +.string "SEAFLOOR$" +.string "CLOUDY$" +.string "SUNNY3$" +.string "HEAVY RAIN$" +.string "SEAFLOOR2$" +.string "DEL. ALL$" +.string "CANCEL$" +.string "OK$" +.string "QUIZ$" +.string "ANSWER$" gOtherText_PokeBalls:: @ 85EFCD4 - .incbin "baserom.gba", 0x5efcd4, 0xb + +.string "POKé BALLS$" gOtherText_Berry:: @ 85EFCDF - .incbin "baserom.gba", 0x5efcdf, 0x6 + +.string "BERRY$" gOtherText_Berries:: @ 85EFCE5 .incbin "baserom.gba", 0x5efce5, 0xb + diff --git a/graphics/interface/blank.pal b/graphics/interface/blank.pal new file mode 100644 index 000000000..9757f2e57 --- /dev/null +++ b/graphics/interface/blank.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +255 255 255 +189 189 197 +131 131 139 +98 98 123 +65 74 106 +41 49 90 +148 255 164 +139 246 115 +65 205 57 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +213 213 205 +74 74 74 diff --git a/graphics/interface/blank.png b/graphics/interface/blank.png new file mode 100644 index 000000000..3a4ba289c Binary files /dev/null and b/graphics/interface/blank.png differ diff --git a/include/battle.h b/include/battle.h index d5c5dd489..1db546de3 100644 --- a/include/battle.h +++ b/include/battle.h @@ -16,19 +16,400 @@ #define BATTLE_TYPE_KYOGRE_GROUDON 0x1000 #define BATTLE_TYPE_LEGENDARY 0x2000 #define BATTLE_TYPE_REGI 0x4000 -#define BATTLE_TYPE_TWO_VS_ONE 0x8000 +#define BATTLE_TYPE_TWO_OPPONENTS 0x8000 +#define BATTLE_TYPE_DOME 0x10000 +#define BATTLE_TYPE_PALACE 0x20000 +#define BATTLE_TYPE_ARENA 0x40000 +#define BATTLE_TYPE_FACTORY 0x80000 +#define BATTLE_TYPE_x100000 0x100000 +#define BATTLE_TYPE_PYRAMID 0x200000 +#define BATTLE_TYPE_INGAME_PARTNER 0x400000 #define BATTLE_TYPE_RECORDED 0x1000000 +#define BATTLE_TYPE_x2000000 0x2000000 +#define BATTLE_TYPE_x4000000 0x4000000 +#define BATTLE_TYPE_SECRET_BASE 0x8000000 #define BATTLE_TYPE_GROUDON 0x10000000 #define BATTLE_TYPE_KYORGE 0x20000000 #define BATTLE_TYPE_RAYQUAZA 0x40000000 -#define AI_ACTION_UNK1 0x0001 -#define AI_ACTION_UNK2 0x0002 -#define AI_ACTION_UNK3 0x0004 -#define AI_ACTION_UNK4 0x0008 -#define AI_ACTION_UNK5 0x0010 -#define AI_ACTION_UNK6 0x0020 -#define AI_ACTION_UNK7 0x0040 -#define AI_ACTION_UNK8 0x0080 +#define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_x100000 | BATTLE_TYPE_PYRAMID) + +#define BATTLE_WON 0x1 +#define BATTLE_LOST 0x2 +#define BATTLE_DREW 0x3 +#define BATTLE_RAN 0x4 +#define BATTLE_PLAYER_TELEPORTED 0x5 +#define BATTLE_POKE_FLED 0x6 +#define BATTLE_CAUGHT 0x7 +#define BATTLE_OPPONENT_TELEPORTED 0xA + +#define STATUS_SLEEP 0x7 +#define STATUS_POISON 0x8 +#define STATUS_BURN 0x10 +#define STATUS_FREEZE 0x20 +#define STATUS_PARALYSIS 0x40 +#define STATUS_TOXIC_POISON 0x80 +#define STATUS_TOXIC_COUNTER 0xF00 + +#define STATUS_PSN_ANY ((STATUS_POISON | STATUS_TOXIC_POISON)) +#define STATUS_ANY ((STATUS_SLEEP | STATUS_POISON | STATUS_BURN | STATUS_FREEZE | STATUS_PARALYSIS | STATUS_TOXIC_POISON)) + +#define STATUS2_CONFUSION 0x00000007 +#define STATUS2_FLINCHED 0x00000008 +#define STATUS2_UPROAR 0x00000070 +#define STATUS2_BIDE 0x00000300 //two bits 0x100 0x200 +#define STATUS2_LOCK_CONFUSE 0x00000C00 +#define STATUS2_MULTIPLETURNS 0x00001000 +#define STATUS2_WRAPPED 0x0000E000 +#define STATUS2_INFATUATION 0x000F0000 +#define STATUS2_FOCUS_ENERGY 0x00100000 +#define STATUS2_TRANSFORMED 0x00200000 +#define STATUS2_RECHARGE 0x00400000 +#define STATUS2_RAGE 0x00800000 +#define STATUS2_SUBSTITUTE 0x01000000 +#define STATUS2_DESTINY_BOND 0x02000000 +#define STATUS2_ESCAPE_PREVENTION 0x04000000 +#define STATUS2_NIGHTMARE 0x08000000 +#define STATUS2_CURSED 0x10000000 +#define STATUS2_FORESIGHT 0x20000000 +#define STATUS2_DEFENSE_CURL 0x40000000 +#define STATUS2_TORMENT 0x80000000 + +#define STATUS3_LEECHSEED_BANK 0x3 +#define STATUS3_LEECHSEED 0x4 +#define STATUS3_ALWAYS_HITS 0x18 //two bits +#define STATUS3_PERISH_SONG 0x20 +#define STATUS3_ON_AIR 0x40 +#define STATUS3_UNDERGROUND 0x80 +#define STATUS3_MINIMIZED 0x100 +#define STATUS3_ROOTED 0x400 +#define STATUS3_CHARGED_UP 0x200 +#define STATUS3_YAWN 0x1800 //two bits +#define STATUS3_IMPRISIONED 0x2000 +#define STATUS3_GRUDGE 0x4000 +#define STATUS3_CANT_SCORE_A_CRIT 0x8000 +#define STATUS3_MUDSPORT 0x10000 +#define STATUS3_WATERSPORT 0x20000 +#define STATUS3_UNDERWATER 0x40000 +#define STATUS3_INTIMIDATE_POKES 0x80000 +#define STATUS3_TRACE 0x100000 + +#define STATUS3_SEMI_INVULNERABLE ((STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER)) + +#define HITMARKER_x20 0x00000020 +#define HITMARKER_DESTINYBOND 0x00000040 +#define HITMARKER_NO_ANIMATIONS 0x00000080 +#define HITMARKER_IGNORE_SUBSTITUTE 0x00000100 +#define HITMARKER_NO_ATTACKSTRING 0x00000200 +#define HITMARKER_ATTACKSTRING_PRINTED 0x00000400 +#define HITMARKER_NO_PPDEDUCT 0x00000800 +#define HITMARKER_PURSUIT_TRAP 0x00001000 +#define HITMARKER_IGNORE_SAFEGUARD 0x00002000 +#define HITMARKER_SYNCHRONISE_EFFECT 0x00004000 +#define HITMARKER_IGNORE_ON_AIR 0x00010000 +#define HITMARKER_IGNORE_UNDERGROUND 0x00020000 +#define HITMARKER_IGNORE_UNDERWATER 0x00040000 +#define HITMARKER_UNABLE_TO_USE_MOVE 0x00080000 +#define HITMARKER_x100000 0x00100000 +#define HITMARKER_x200000 0x00200000 +#define HITMARKER_x400000 0x00400000 +#define HITMARKER_x800000 0x00800000 +#define HITMARKER_GRUDGE 0x01000000 +#define HITMARKER_OBEYS 0x02000000 +#define HITMARKER_x8000000 0x08000000 +#define HITMARKER_FAINTED(bank) ((gBitTable[bank] << 0x1C)) +#define HITMARKER_UNK(bank) ((0x10000000 << bank)) + +#define SIDE_STATUS_REFLECT (1 << 0) +#define SIDE_STATUS_LIGHTSCREEN (1 << 1) +#define SIDE_STATUS_X4 (1 << 2) +#define SIDE_STATUS_SPIKES (1 << 4) +#define SIDE_STATUS_SAFEGUARD (1 << 5) +#define SIDE_STATUS_FUTUREATTACK (1 << 6) +#define SIDE_STATUS_MIST (1 << 8) +#define SIDE_STATUS_SPIKES_DAMAGED (1 << 9) + +#define ABILITYEFFECT_ON_SWITCHIN 0x0 +#define ABILITYEFFECT_ENDTURN 0x1 +#define ABILITYEFFECT_MOVES_BLOCK 0x2 +#define ABILITYEFFECT_ABSORBING 0x3 +#define ABILITYEFFECT_CONTACT 0x4 +#define ABILITYEFFECT_IMMUNITY 0x5 +#define ABILITYEFFECT_FORECAST 0x6 +#define ABILITYEFFECT_SYNCHRONIZE 0x7 +#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8 +#define ABILITYEFFECT_INTIMIDATE1 0x9 +#define ABILITYEFFECT_INTIMIDATE2 0xA +#define ABILITYEFFECT_TRACE 0xB +#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC +#define ABILITYEFFECT_CHECK_BANK_SIDE 0xD +#define ABILITYEFFECT_FIELD_SPORT 0xE +#define ABILITYEFFECT_CHECK_FIELD_EXCEPT_BANK 0xF +#define ABILITYEFFECT_COUNT_OTHER_SIZE 0x10 +#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11 +#define ABILITYEFFECT_COUNT_ON_FIELD 0x12 +#define ABILITYEFFECT_CHECK_ON_FIELD 0x13 + +#define WEATHER_HAS_EFFECT ((!AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_AIR_LOCK, 0, 0))) + +#define MOVESTATUS_MISSED (1 << 0) +#define MOVESTATUS_SUPEREFFECTIVE (1 << 1) +#define MOVESTATUS_NOTVERYEFFECTIVE (1 << 2) +#define MOVESTATUS_NOTAFFECTED (1 << 3) +#define MOVESTATUS_ONEHITKO (1 << 4) +#define MOVESTATUS_FAILED (1 << 5) +#define MOVESTATUS_ENDURED (1 << 6) +#define MOVESTATUS_HUNGON (1 << 7) + +#define MOVESTATUS_NOEFFECT ((MOVESTATUS_MISSED | MOVESTATUS_NOTAFFECTED | MOVESTATUS_FAILED)) + +#define MAX_TRAINER_ITEMS 4 +#define MAX_MON_MOVES 4 +#define MAX_BANKS_BATTLE 4 + +#define WEATHER_RAIN_TEMPORARY (1 << 0) +#define WEATHER_RAIN_DOWNPOUR (1 << 1) +#define WEATHER_RAIN_PERMANENT (1 << 2) +#define WEATHER_RAIN_ANY ((WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_DOWNPOUR | WEATHER_RAIN_PERMANENT)) +#define WEATHER_SANDSTORM_TEMPORARY (1 << 3) +#define WEATHER_SANDSTORM_PERMANENT (1 << 4) +#define WEATHER_SANDSTORM_ANY ((WEATHER_SANDSTORM_TEMPORARY | WEATHER_SANDSTORM_PERMANENT)) +#define WEATHER_SUN_TEMPORARY (1 << 5) +#define WEATHER_SUN_PERMANENT (1 << 6) +#define WEATHER_SUN_ANY ((WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT)) +#define WEATHER_HAIL (1 << 7) +#define WEATHER_HAIL_ANY ((WEATHER_HAIL)) + +u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg); +u8 GetBankSide(u8 bank); + +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; +}; + +extern const struct Trainer gTrainers[]; + +struct UnknownFlags +{ + u32 flags[4]; +}; + +#define UNKNOWN_FLAG_FLASH_FIRE 1 + +struct DisableStruct +{ + /*0x00*/ u32 unk0; + /*0x04*/ u16 disabledMove; + /*0x06*/ u16 encoredMove; + /*0x08*/ u8 protectUses; + /*0x09*/ u8 stockpileCounter; + /*0x0A*/ u8 substituteHP; + /*0x0B*/ u8 disableTimer1 : 4; + /*0x0B*/ u8 disableTimer2 : 4; + /*0x0C*/ u8 encoredMovePos; + /*0x0D*/ u8 unkD; + /*0x0E*/ u8 encoreTimer1 : 4; + /*0x0E*/ u8 encoreTimer2 : 4; + /*0x0F*/ u8 perishSong1 : 4; + /*0x0F*/ u8 perishSong2 : 4; + /*0x10*/ u8 furyCutterCounter; + /*0x11*/ u8 rolloutTimer1 : 4; + /*0x11*/ u8 rolloutTimer2 : 4; + /*0x12*/ u8 chargeTimer1 : 4; + /*0x12*/ u8 chargeTimer2 : 4; + /*0x13*/ u8 tauntTimer1:4; + /*0x13*/ u8 tauntTimer2:4; + /*0x14*/ u8 bankPreventingEscape; + /*0x15*/ u8 bankWithSureHit; + /*0x16*/ u8 isFirstTurn; + /*0x17*/ u8 unk17; + /*0x18*/ u8 truantCounter : 1; + /*0x18*/ u8 unk18_a : 3; + /*0x18*/ u8 unk18_b : 4; + /*0x19*/ u8 rechargeCounter; + /*0x1A*/ u8 unk1A[2]; +}; + +extern struct DisableStruct gDisableStructs[]; + +//size should be 0x1C +struct AI_ThinkingStruct +{ + u8 aiState; + u8 movesetIndex; + u16 moveConsidered; + s8 score[4]; + u32 funcResult; + u32 aiFlags; + u8 aiAction; + u8 aiLogicId; + u8 filler12[6]; + u8 simulatedRNG[4]; +}; + +struct UsedMoves +{ + u16 moves[4]; + u16 unknown[4]; +}; + +//size should be 0x54 +struct BattleHistory +{ + struct UsedMoves usedMoves[4]; + u8 abilities[4]; + u8 itemEffects[4]; + u16 TrainerItems[4]; + u8 itemsNo; +}; + +struct BattleScriptsStack +{ + u8 *ptr[8]; + u8 size; +}; + +struct BattleResources +{ + void* secretBaseOpponent; + struct UnknownFlags *flags; + struct BattleScriptsStack* battleScriptsStack; + void* battleCallbackStack; + void* statsBeforeLvlUp; + struct AI_ThinkingStruct *ai; + struct BattleHistory *battleHistory; + struct BattleScriptsStack *AI_ScriptsStack; +}; + +extern struct BattleResources* gBattleResources; + +struct BattleResults +{ + u8 playerFaintCounter; // 0x0 + u8 opponentFaintCounter; // 0x1 + u8 unk2; // 0x2 + u8 unk3; // 0x3 + u8 unk4; // 0x4 + u8 unk5_0:1; // 0x5 + u8 unk5_1:1; // 0x5 + u16 poke1Species; // 0x6 + u8 pokeString1[10]; // 0x8 + u8 unk12; + u8 battleTurnCounter; // 0x13 + u8 pokeString2[10]; // 0x14 + u8 field_1E; // 0x1E + u8 field_1F; // 0x1F + u16 lastOpponentSpecies; // 0x20 + u16 lastUsedMove; // 0x22 + u16 opponentMove; // 0x24 + u16 opponentSpecies; // 0x26 + u16 caughtPoke; // 0x28 + u8 caughtNick[10]; // 0x2A + u8 filler34[2]; + u8 unk36[10]; // usedBalls? +}; + +extern struct BattleResults gBattleResults; + +struct BattleStruct +{ + u8 field_1; + u8 field_2; + u8 field_3; + u8 field_4; + u8 wrappedMove1[4]; + u8 wrappedMove2[4]; + u8 moveTarget[4]; + u8 expGetterId; + u8 field_11; + u8 wildVictorySong; + u8 dynamicMoveType; + u8 wrappedBy[4]; + u8 field_18[0x63]; // TODO: expand + u8 field_7B; + u8 field_7C; + u8 field_7D; + u8 field_7E; + u8 formToChangeInto; + u8 chosenMovesIds[4]; + u8 field_84; + u8 field_85; + u8 field_86; + u8 field_87; + u8 field_88; + u8 field_89; + u8 field_8A; + u8 field_8B; + u8 field_8C; + u8 field_8D; + u8 field_8E; + u8 expGetterBank; + u8 field_90; + u8 field_91; + u8 field_92; + u8 field_93; + u8 field_94; + u8 field_95; + u8 field_96; + u8 field_97; + u8 field_98; + u8 field_99; + u8 field_9A; + u8 field_9B; + u8 field_9C; + u8 field_9D; + u8 field_9E; + u8 field_9F; + u8 field_A0; + u8 field_A1; + u8 field_A2; + u8 field_A3; + u8 field_A4; + u8 field_A5; + u8 field_A6; + u8 field_A7; + u16 hpOnSwitchout[4]; + u8 field_B0; + u8 hpScale; + u8 synchronizeMoveEffect; + u8 field_B3; + u8 field_B4; + u8 field_B5; + u8 field_B6; + u8 field_B7; + u16 usedHeldItems[4]; +}; + +extern struct BattleStruct* gBattleStruct; + +struct BattleScripting +{ + u8 field_0; + u8 field_1; + u8 field_2; + u8 field_3; + u32 bideDmg; + u8 field_8; + u8 field_9; + u8 field_A; + u8 field_B; + u8 field_C; + u8 field_D; + u8 dmgMultiplier; + u8 field_F; +}; + +extern struct BattleScripting gBattleScripting; #endif diff --git a/include/battle_ai.h b/include/battle_ai.h new file mode 100644 index 000000000..2a315059b --- /dev/null +++ b/include/battle_ai.h @@ -0,0 +1,13 @@ +#ifndef GUARD_BATTLE_AI_H +#define GUARD_BATTLE_AI_H + +void BattleAI_HandleItemUseBeforeAISetup(u8 defaultScoreMoves); +void BattleAI_SetupAIData(u8 defaultScoreMoves); +u8 BattleAI_ChooseMoveOrAction(void); +void ClearBankMoveHistory(u8 bank); +void RecordAbilityBattle(u8 bank, u8 abilityId); +void ClearBankAbilityHistory(u8 bank); +void RecordItemEffectBattle(u8 bank, u8 itemEffect); +void ClearBankItemEffectHistory(u8 bank); + +#endif // GUARD_BATTLE_AI_H diff --git a/include/battle_message.h b/include/battle_message.h new file mode 100644 index 000000000..3e37a1ccd --- /dev/null +++ b/include/battle_message.h @@ -0,0 +1,23 @@ +#ifndef GUARD_BATTLE_MESSAGE_H +#define GUARD_BATTLE_MESSAGE_H + +struct StringInfoBattle +{ + u16 currentMove; + u16 lastMove; + u16 lastItem; + u8 lastAbility; + u8 scrActive; + u8 unk1605E; + u8 hpScale; + u8 StringBank; + u8 moveType; + u8 abilities[4]; + u8 textBuffs[3][0x10]; +}; + +void BufferStringBattle(u16 stringID); +u32 StrCpyDecodeToDisplayedStringBattle(const u8* src); +u32 StrCpyDecodeBattle(const u8* src, u8* dst); + +#endif // GUARD_BATTLE_MESSAGE_H diff --git a/include/battle_move_effects.h b/include/battle_move_effects.h new file mode 100644 index 000000000..4a9415379 --- /dev/null +++ b/include/battle_move_effects.h @@ -0,0 +1,222 @@ +#ifndef GUARD_BATTLE_MOVE_EFFECTS_H +#define GUARD_BATTLE_MOVE_EFFECTS_H + +enum +{ + EFFECT_HIT, + EFFECT_SLEEP, + EFFECT_POISON_HIT, + EFFECT_ABSORB, + EFFECT_BURN_HIT, + EFFECT_FREEZE_HIT, + EFFECT_PARALYZE_HIT, + EFFECT_EXPLOSION, + EFFECT_DREAM_EATER, + EFFECT_MIRROR_MOVE, + EFFECT_ATTACK_UP, + EFFECT_DEFENSE_UP, + EFFECT_SPEED_UP, + EFFECT_SPECIAL_ATTACK_UP, + EFFECT_SPECIAL_DEFENSE_UP, + EFFECT_ACCURACY_UP, + EFFECT_EVASION_UP, + EFFECT_ALWAYS_HIT, + EFFECT_ATTACK_DOWN, + EFFECT_DEFENSE_DOWN, + EFFECT_SPEED_DOWN, + EFFECT_SPECIAL_ATTACK_DOWN, // unused + EFFECT_SPECIAL_DEFENSE_DOWN, // unused + EFFECT_ACCURACY_DOWN, + EFFECT_EVASION_DOWN, + EFFECT_HAZE, + EFFECT_BIDE, + EFFECT_RAMPAGE, + EFFECT_ROAR, + EFFECT_MULTI_HIT, + EFFECT_CONVERSION, + EFFECT_FLINCH_HIT, + EFFECT_RESTORE_HP, + EFFECT_TOXIC, + EFFECT_PAY_DAY, + EFFECT_LIGHT_SCREEN, + EFFECT_TRI_ATTACK, + EFFECT_REST, + EFFECT_OHKO, + EFFECT_RAZOR_WIND, + EFFECT_SUPER_FANG, + EFFECT_DRAGON_RAGE, + EFFECT_TRAP, + EFFECT_HIGH_CRITICAL, + EFFECT_DOUBLE_HIT, + EFFECT_RECOIL_IF_MISS, + EFFECT_MIST, + EFFECT_FOCUS_ENERGY, + EFFECT_RECOIL, + EFFECT_CONFUSE, + EFFECT_ATTACK_UP_2, + EFFECT_DEFENSE_UP_2, + EFFECT_SPEED_UP_2, + EFFECT_SPECIAL_ATTACK_UP_2, + EFFECT_SPECIAL_DEFENSE_UP_2, + EFFECT_ACCURACY_UP_2, + EFFECT_EVASION_UP_2, + EFFECT_TRANSFORM, + EFFECT_ATTACK_DOWN_2, + EFFECT_DEFENSE_DOWN_2, + EFFECT_SPEED_DOWN_2, + EFFECT_SPECIAL_ATTACK_DOWN_2, + EFFECT_SPECIAL_DEFENSE_DOWN_2, + EFFECT_ACCURACY_DOWN_2, + EFFECT_EVASION_DOWN_2, + EFFECT_REFLECT, + EFFECT_POISON, + EFFECT_PARALYZE, + EFFECT_ATTACK_DOWN_HIT, + EFFECT_DEFENSE_DOWN_HIT, + EFFECT_SPEED_DOWN_HIT, + EFFECT_SPECIAL_ATTACK_DOWN_HIT, + EFFECT_SPECIAL_DEFENSE_DOWN_HIT, + EFFECT_ACCURACY_DOWN_HIT, + EFFECT_EVASION_DOWN_HIT, + EFFECT_SKY_ATTACK, + EFFECT_CONFUSE_HIT, + EFFECT_TWINEEDLE, + EFFECT_VITAL_THROW, + EFFECT_SUBSTITUTE, + EFFECT_RECHARGE, + EFFECT_RAGE, + EFFECT_MIMIC, + EFFECT_METRONOME, + EFFECT_LEECH_SEED, + EFFECT_SPLASH, + EFFECT_DISABLE, + EFFECT_LEVEL_DAMAGE, + EFFECT_PSYWAVE, + EFFECT_COUNTER, + EFFECT_ENCORE, + EFFECT_PAIN_SPLIT, + EFFECT_SNORE, + EFFECT_CONVERSION_2, + EFFECT_LOCK_ON, + EFFECT_SKETCH, + EFFECT_UNUSED_60, // thaw + EFFECT_SLEEP_TALK, + EFFECT_DESTINY_BOND, + EFFECT_FLAIL, + EFFECT_SPITE, + EFFECT_FALSE_SWIPE, + EFFECT_HEAL_BELL, + EFFECT_QUICK_ATTACK, + EFFECT_TRIPLE_KICK, + EFFECT_THIEF, + EFFECT_MEAN_LOOK, + EFFECT_NIGHTMARE, + EFFECT_MINIMIZE, + EFFECT_CURSE, + EFFECT_UNUSED_6E, + EFFECT_PROTECT, + EFFECT_SPIKES, + EFFECT_FORESIGHT, + EFFECT_PERISH_SONG, + EFFECT_SANDSTORM, + EFFECT_ENDURE, + EFFECT_ROLLOUT, + EFFECT_SWAGGER, + EFFECT_FURY_CUTTER, + EFFECT_ATTRACT, + EFFECT_RETURN, + EFFECT_PRESENT, + EFFECT_FRUSTRATION, + EFFECT_SAFEGUARD, + EFFECT_THAW_HIT, + EFFECT_MAGNITUDE, + EFFECT_BATON_PASS, + EFFECT_PURSUIT, + EFFECT_RAPID_SPIN, + EFFECT_SONICBOOM, + EFFECT_UNUSED_83, + EFFECT_MORNING_SUN, + EFFECT_SYNTHESIS, + EFFECT_MOONLIGHT, + EFFECT_HIDDEN_POWER, + EFFECT_RAIN_DANCE, + EFFECT_SUNNY_DAY, + EFFECT_DEFENSE_UP_HIT, + EFFECT_ATTACK_UP_HIT, + EFFECT_ALL_STATS_UP_HIT, + EFFECT_UNUSED_8D, // incomplete fake out in gen 2 + EFFECT_BELLY_DRUM, + EFFECT_PSYCH_UP, + EFFECT_MIRROR_COAT, + EFFECT_SKULL_BASH, + EFFECT_TWISTER, + EFFECT_EARTHQUAKE, + EFFECT_FUTURE_SIGHT, + EFFECT_GUST, + EFFECT_FLINCH_HIT_2, // STOMP ASTONISH EXTRASENSORY NEEDLE_ARM + EFFECT_SOLARBEAM, + EFFECT_THUNDER, + EFFECT_TELEPORT, + EFFECT_BEAT_UP, + EFFECT_FLY, + EFFECT_DEFENSE_CURL, + EFFECT_SOFTBOILED, + EFFECT_FAKE_OUT, + EFFECT_UPROAR, + EFFECT_STOCKPILE, + EFFECT_SPIT_UP, + EFFECT_SWALLOW, + EFFECT_UNUSED_A3, + EFFECT_HAIL, + EFFECT_TORMENT, + EFFECT_FLATTER, + EFFECT_WILL_O_WISP, + EFFECT_MEMENTO, + EFFECT_FACADE, + EFFECT_FOCUS_PUNCH, + EFFECT_SMELLINGSALT, + EFFECT_FOLLOW_ME, + EFFECT_NATURE_POWER, + EFFECT_CHARGE, + EFFECT_TAUNT, + EFFECT_HELPING_HAND, + EFFECT_TRICK, + EFFECT_ROLE_PLAY, + EFFECT_WISH, + EFFECT_ASSIST, + EFFECT_INGRAIN, + EFFECT_SUPERPOWER, + EFFECT_MAGIC_COAT, + EFFECT_RECYCLE, + EFFECT_REVENGE, + EFFECT_BRICK_BREAK, + EFFECT_YAWN, + EFFECT_KNOCK_OFF, + EFFECT_ENDEAVOR, + EFFECT_ERUPTION, + EFFECT_SKILL_SWAP, + EFFECT_IMPRISON, + EFFECT_REFRESH, + EFFECT_GRUDGE, + EFFECT_SNATCH, + EFFECT_LOW_KICK, + EFFECT_SECRET_POWER, + EFFECT_DOUBLE_EDGE, + EFFECT_TEETER_DANCE, + EFFECT_BLAZE_KICK, + EFFECT_MUD_SPORT, + EFFECT_POISON_FANG, + EFFECT_WEATHER_BALL, + EFFECT_OVERHEAT, + EFFECT_TICKLE, + EFFECT_COSMIC_POWER, + EFFECT_SKY_UPPERCUT, + EFFECT_BULK_UP, + EFFECT_POISON_TAIL, + EFFECT_WATER_SPORT, + EFFECT_CALM_MIND, + EFFECT_DRAGON_DANCE, + EFFECT_CAMOUFLAGE, +}; + +#endif // GUARD_BATTLE_MOVE_EFFECTS_H diff --git a/include/berry.h b/include/berry.h index 6d8d8d483..e9f0f8de9 100644 --- a/include/berry.h +++ b/include/berry.h @@ -1,9 +1,15 @@ -// -// Created by Scott Norton on 9/8/17. -// +#ifndef GUARD_BERRY_H +#define GUARD_BERRY_H -#ifndef POKEEMERALD_BERRY_H -#define POKEEMERALD_BERRY_H +enum +{ + BERRY_FIRMNESS_UNKNOWN, + BERRY_FIRMNESS_VERY_SOFT, + BERRY_FIRMNESS_SOFT, + BERRY_FIRMNESS_HARD, + BERRY_FIRMNESS_VERY_HARD, + BERRY_FIRMNESS_SUPER_HARD, +}; #define NUM_BERRIES 44 @@ -11,7 +17,38 @@ extern const u8 *const gBerryTreeFieldObjectGraphicsIdTablePointers[NUM_BERRIES] extern const struct SpriteFrameImage *const gBerryTreePicTablePointers[NUM_BERRIES]; extern const u8 *const gBerryTreePaletteSlotTablePointers[NUM_BERRIES]; +void ClearEnigmaBerries(void); +void SetEnigmaBerry(u8 *src); +u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry); +bool32 IsEnigmaBerryValid(void); +const struct Berry *GetBerryInfo(u8 berry); +struct BerryTree *GetBerryTreeInfo(u8 id); +bool32 FieldObjectInteractionWaterBerryTree(void); +bool8 IsPlayerFacingPlantedBerryTree(void); +bool8 TryToWaterBerryTree(void); +void ClearBerryTrees(void); +bool32 BerryTreeGrow(struct BerryTree *tree); +void BerryTreeTimeUpdate(s32 minutes); +void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 sparkle); +void RemoveBerryTree(u8 id); +u8 GetBerryTypeByBerryTreeId(u8 id); u8 GetStageByBerryTreeId(u8); -u8 GetBerryTypeByBerryTreeId(u8); +u8 ItemIdToBerryType(u16 item); +u16 BerryTypeToItemId(u16 berry); +void GetBerryNameByBerryType(u8 berry, u8 *string); +void ResetBerryTreeSparkleFlag(u8 id); +u8 BerryTreeGetNumStagesWatered(struct BerryTree *tree); +u8 GetNumStagesWateredByBerryTreeId(u8 id); +u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water); +u8 CalcBerryYield(struct BerryTree *tree); +u8 GetBerryCountByBerryTreeId(u8 id); +u16 GetStageDurationByBerryType(u8); +void FieldObjectInteractionGetBerryTreeData(void); +void sub_80B4EE4(void); +void FieldObjectInteractionPlantBerryTree(void); +void FieldObjectInteractionPickBerryTree(void); +void FieldObjectInteractionRemoveBerryTree(void); +u8 PlayerHasBerries(void); +void ResetBerryTreeSparkleFlags(void); -#endif //POKEEMERALD_BERRY_H +#endif // GUARD_BERRY_H diff --git a/include/coins.h b/include/coins.h new file mode 100644 index 000000000..43434b227 --- /dev/null +++ b/include/coins.h @@ -0,0 +1,12 @@ +#ifndef GUARD_COINS_H +#define GUARD_COINS_H + +void PrintCoinsString(u32 coinAmount); +void ShowCoinsWindow(u32 coinAmount, u8 x, u8 y); +void HideCoinsWindow(void); +u16 GetCoins(void); +void SetCoins(u16 coinAmount); +bool8 AddCoins(u16 toAdd); +bool8 SubtractCoins(u16 toSub); + +#endif // GUARD_COINS_H diff --git a/include/config.h b/include/config.h new file mode 100644 index 000000000..162af3143 --- /dev/null +++ b/include/config.h @@ -0,0 +1,12 @@ +#ifndef GUARD_CONFIG_H +#define GUARD_CONFIG_H + +#define ENGLISH + +#ifdef ENGLISH +#define UNITS_IMPERIAL +#else +#define UNITS_METRIC +#endif + +#endif // GUARD_CONFIG_H diff --git a/include/dewford_trend.h b/include/dewford_trend.h new file mode 100644 index 000000000..01e5d9762 --- /dev/null +++ b/include/dewford_trend.h @@ -0,0 +1,7 @@ +#ifndef GUARD_DEWFORDTREND_H +#define GUARD_DEWFORDTREND_H + +void InitDewfordTrend(void); +void UpdateDewfordTrendPerDay(u16); + +#endif // GUARD_DEWFORDTREND_H diff --git a/include/easy_chat.h b/include/easy_chat.h new file mode 100644 index 000000000..5143aa39c --- /dev/null +++ b/include/easy_chat.h @@ -0,0 +1,33 @@ +#ifndef GUARD_EASYCHAT_H +#define GUARD_EASYCHAT_H + +// Taken from Pokeruby, check if it's correct +enum +{ + EC_GROUP_POKEMON, + EC_GROUP_TRAINER, + EC_GROUP_STATUS, + EC_GROUP_BATTLE, + EC_GROUP_GREETINGS, + EC_GROUP_PEOPLE, + EC_GROUP_VOICES, + EC_GROUP_SPEECH, + EC_GROUP_ENDINGS, + EC_GROUP_FEELINGS, + EC_GROUP_CONDITIONS, + EC_GROUP_ACTIONS, + EC_GROUP_LIFESTYLE, + EC_GROUP_HOBBIES, + EC_GROUP_TIME, + EC_GROUP_MISC, + EC_GROUP_ADJECTIVES, + EC_GROUP_EVENTS, + EC_GROUP_MOVE_1, + EC_GROUP_MOVE_2, + EC_GROUP_TRENDY_SAYING, + EC_GROUP_POKEMON_2, +}; + +void InitEasyChatPhrases(void); + +#endif // GUARD_EASYCHAT_H diff --git a/include/gba/defines.h b/include/gba/defines.h index 0f7f06755..e67d64777 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -15,6 +15,11 @@ #define INTR_CHECK (*(u16 *)0x3007FF8) #define INTR_VECTOR (*(void **)0x3007FFC) +#define EWRAM_START 0x02000000 +#define EWRAM_END (EWRAM_START + 0x40000) +#define IWRAM_START 0x03000000 +#define IWRAM_END (IWRAM_START + 0x8000) + #define PLTT 0x5000000 #define PLTT_SIZE 0x400 @@ -29,8 +34,10 @@ #define BG_VRAM VRAM #define BG_VRAM_SIZE 0x10000 -#define BG_CHAR_ADDR(n) (BG_VRAM + (0x4000 * (n))) -#define BG_SCREEN_ADDR(n) (BG_VRAM + (0x800 * (n))) +#define BG_CHAR_SIZE 0x4000 +#define BG_SCREEN_SIZE 0x800 +#define BG_CHAR_ADDR(n) (BG_VRAM + (BG_CHAR_SIZE * (n))) +#define BG_SCREEN_ADDR(n) (BG_VRAM + (BG_SCREEN_SIZE * (n))) // text-mode BG #define OBJ_VRAM0 (VRAM + 0x10000) diff --git a/include/global.berry.h b/include/global.berry.h index 6632e55e2..6695a9f4b 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -19,9 +19,29 @@ struct Berry u8 smoothness; }; +// with no const fields + +struct Berry2 +{ + u8 name[7]; + u8 firmness; + u16 size; + u8 maxYield; + u8 minYield; + u8 *description1; + u8 *description2; + u8 stageDuration; + u8 spicy; + u8 dry; + u8 sweet; + u8 bitter; + u8 sour; + u8 smoothness; +}; + struct EnigmaBerry { - struct Berry berry; + struct Berry2 berry; u8 pic[(6 * 6) * TILE_SIZE_4BPP]; u16 palette[16]; u8 description1[45]; diff --git a/include/global.h b/include/global.h index a006e8591..5e39e7ce8 100644 --- a/include/global.h +++ b/include/global.h @@ -2,6 +2,7 @@ #define GUARD_GLOBAL_H #include "gba/gba.h" +#include "config.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); @@ -130,7 +131,14 @@ struct BerryPickingResults // possibly used in the game itself? Size may be wron u32 bestScore; u16 berriesPicked; u16 berriesPickedInRow; - // unk size + u8 field_8; + u8 field_9; + u8 field_A; + u8 field_B; + u8 field_C; + u8 field_D; + u8 field_E; + u8 field_F; }; struct PyramidBag @@ -140,6 +148,13 @@ struct PyramidBag u8 quantity[10]; }; +struct BerryCrush +{ + u16 berryCrushResults[4]; + u32 berryPowderAmount; + u32 unk; +}; + struct SaveBlock2 { /*0x00*/ u8 playerName[8]; @@ -161,17 +176,15 @@ struct SaveBlock2 /*0x90*/ u8 filler_90[0x8]; /*0x98*/ struct Time localTimeOffset; /*0xA0*/ struct Time lastBerryTreeUpdate; - /*0xA8*/ u8 filler_A8[0x4]; + /*0xA8*/ u32 field_A8; /*0xAC*/ u32 encryptionKey; // TODO: fix and verify labels /*0xB0*/ u8 field_B0[316]; - /*0x1EC*/ u16 berryCrushResults[4]; - /*0x1F4*/ u32 berryPowderAmount; - /*0x1F8*/ u32 field_1F8; - /*0x1FC*/ struct PokemonJumpResults pokeJumpResults; - /*0x20C*/ struct BerryPickingResults berryPickResults; - /*0x214*/ u8 field_214[1040]; + /*0x1EC*/ struct BerryCrush berryCrush; + /*0x1FC*/ struct PokemonJumpResults pokeJump; + /*0x20C*/ struct BerryPickingResults berryPick; + /*0x214*/ u8 field_214[1032]; /*0x624*/ u16 contestLinkResults[20]; // 4 positions for 5 categories, possibly a struct or a 2d array // All below could be a one giant struct @@ -190,7 +203,8 @@ struct SaveBlock2 /*0xEE1*/ u8 field_EE1; /*0xEE2*/ u8 field_EE2[7]; /*0xEE9*/ u8 field_EE9; - /*0xEEA*/ u8 field_EEA[22]; + /*0xEEA*/ u8 field_EEA[66]; + // sizeof=0xF2C }; extern struct SaveBlock2 *gSaveBlock2Ptr; @@ -624,6 +638,23 @@ struct ContestWinner u8 contestRank; }; +struct DaycareMon +{ + struct BoxPokemon mon; + struct MailStruct mail; + u8 OT_name[OT_NAME_LENGTH + 1]; + u8 monName[11]; + u8 language; + u32 stepsTaken; +}; + +struct DaycareData +{ + struct DaycareMon mons[2]; + u32 offspringPersonality; + u8 stepCounter; +}; + #define FLAGS_NUMBER 300 #define VARS_NUMBER 256 @@ -692,33 +723,26 @@ struct SaveBlock1 /*0x????*/ u16 unk2B1C[6]; /*0x????*/ u16 unk2B28[6]; /*0x????*/ u16 unk2B34[6]; - /*0x????*/ u16 unk2B40[6]; + /*0x????*/ u16 unk2B3A[3]; /*0x2BE0*/ struct MailStruct mail[16]; - /*0x2E20*/ u8 additionalPhrases; // bitfield for 33 additional phrases in easy chat system + /*0x2E20*/ u8 additionalPhrases[5]; // bitfield for 33 additional phrases in easy chat system /*0x2E25*/ u8 unk2E25[3]; // possibly padding? /*0x2E28*/ OldMan oldMan; /*0x2e64*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff /*0x2e8c*/ u8 filler_2E8C[0x4]; /*0x2e90*/ struct ContestWinner contestWinners[13]; // 0 - 5 used in contest hall, 6 - 7 unused?, 8 - 12 museum - - // TODO: fix - - /*0x????*/ struct BoxPokemon daycareData[2]; - /*0x????*/ struct RecordMixing_UnknownStruct filler_303C; - /*0x????*/ u8 filler_30B4[0x2]; - /*0x????*/ u8 filler_30B6; - /*0x????*/ u8 filler_30B7[1]; - /*0x????*/ struct LinkBattleRecord linkBattleRecords[5]; - /*0x????*/ u8 filler_3108[8]; - + /*0x3030*/ struct DaycareData daycare; + /*0x3150*/ struct LinkBattleRecord linkBattleRecords[5]; + /*0x31A0*/ u8 filler_31A0[8]; /*0x31A8*/ u8 giftRibbons[52]; /*0x31DC*/ struct Roamer roamer; /*0x31F8*/ struct EnigmaBerry enigmaBerry; - - // TODO: fix - /*0x????*/ struct RamScript ramScript; - /*0x????*/ struct RecordMixingGift recordMixingGift; - /*0x????*/ u8 unk3A8C[52]; //pokedex related + /*0x3728*/ struct RamScript ramScript; + /*0x3B14*/ struct RecordMixingGift recordMixingGift; + /*0x3B24*/ u8 seen2[52]; + /*0x3B58*/ u8 lilycoveLady[536]; // TODO: convert to a union + /*0x3D70*/ u8 babyPhrase[24]; // TODO: convert to a struct + // sizeof: 0x3D88 }; extern struct SaveBlock1* gSaveBlock1Ptr; diff --git a/include/hold_effects.h b/include/hold_effects.h new file mode 100644 index 000000000..b653f5a92 --- /dev/null +++ b/include/hold_effects.h @@ -0,0 +1,72 @@ +#ifndef GUARD_HOLD_EFFECTS_H +#define GUARD_HOLD_EFFECTS_H + +#define HOLD_EFFECT_NONE 0 +#define HOLD_EFFECT_RESTORE_HP 1 +#define HOLD_EFFECT_CURE_PAR 2 +#define HOLD_EFFECT_CURE_SLP 3 +#define HOLD_EFFECT_CURE_PSN 4 +#define HOLD_EFFECT_CURE_BRN 5 +#define HOLD_EFFECT_CURE_FRZ 6 +#define HOLD_EFFECT_RESTORE_PP 7 +#define HOLD_EFFECT_CURE_CONFUSION 8 +#define HOLD_EFFECT_CURE_STATUS 9 +#define HOLD_EFFECT_CONFUSE_SPICY 10 +#define HOLD_EFFECT_CONFUSE_DRY 11 +#define HOLD_EFFECT_CONFUSE_SWEET 12 +#define HOLD_EFFECT_CONFUSE_BITTER 13 +#define HOLD_EFFECT_CONFUSE_SOUR 14 +#define HOLD_EFFECT_ATTACK_UP 15 +#define HOLD_EFFECT_DEFENSE_UP 16 +#define HOLD_EFFECT_SPEED_UP 17 +#define HOLD_EFFECT_SP_ATTACK_UP 18 +#define HOLD_EFFECT_SP_DEFENSE_UP 19 +#define HOLD_EFFECT_CRITICAL_UP 20 +#define HOLD_EFFECT_RANDOM_STAT_UP 21 +#define HOLD_EFFECT_EVASION_UP 22 +#define HOLD_EFFECT_RESTORE_STATS 23 +#define HOLD_EFFECT_MACHO_BRACE 24 +#define HOLD_EFFECT_EXP_SHARE 25 +#define HOLD_EFFECT_QUICK_CLAW 26 +#define HOLD_EFFECT_HAPPINESS_UP 27 +#define HOLD_EFFECT_CURE_ATTRACT 28 +#define HOLD_EFFECT_CHOICE_BAND 29 +#define HOLD_EFFECT_FLINCH 30 +#define HOLD_EFFECT_BUG_POWER 31 +#define HOLD_EFFECT_DOUBLE_PRIZE 32 +#define HOLD_EFFECT_REPEL 33 +#define HOLD_EFFECT_SOUL_DEW 34 +#define HOLD_EFFECT_DEEP_SEA_TOOTH 35 +#define HOLD_EFFECT_DEEP_SEA_SCALE 36 +#define HOLD_EFFECT_CAN_ALWAYS_RUN 37 +#define HOLD_EFFECT_PREVENT_EVOLVE 38 +#define HOLD_EFFECT_FOCUS_BAND 39 +#define HOLD_EFFECT_LUCKY_EGG 40 +#define HOLD_EFFECT_SCOPE_LENS 41 +#define HOLD_EFFECT_STEEL_POWER 42 +#define HOLD_EFFECT_LEFTOVERS 43 +#define HOLD_EFFECT_DRAGON_SCALE 44 +#define HOLD_EFFECT_LIGHT_BALL 45 +#define HOLD_EFFECT_GROUND_POWER 46 +#define HOLD_EFFECT_ROCK_POWER 47 +#define HOLD_EFFECT_GRASS_POWER 48 +#define HOLD_EFFECT_DARK_POWER 49 +#define HOLD_EFFECT_FIGHTING_POWER 50 +#define HOLD_EFFECT_ELECTRIC_POWER 51 +#define HOLD_EFFECT_WATER_POWER 52 +#define HOLD_EFFECT_FLYING_POWER 53 +#define HOLD_EFFECT_POISON_POWER 54 +#define HOLD_EFFECT_ICE_POWER 55 +#define HOLD_EFFECT_GHOST_POWER 56 +#define HOLD_EFFECT_PSYCHIC_POWER 57 +#define HOLD_EFFECT_FIRE_POWER 58 +#define HOLD_EFFECT_DRAGON_POWER 59 +#define HOLD_EFFECT_NORMAL_POWER 60 +#define HOLD_EFFECT_UP_GRADE 61 +#define HOLD_EFFECT_SHELL_BELL 62 +#define HOLD_EFFECT_LUCKY_PUNCH 63 +#define HOLD_EFFECT_METAL_POWDER 64 +#define HOLD_EFFECT_THICK_CLUB 65 +#define HOLD_EFFECT_STICK 66 + +#endif // GUARD_HOLD_EFFECTS_H diff --git a/include/items.h b/include/items.h new file mode 100644 index 000000000..69515f18e --- /dev/null +++ b/include/items.h @@ -0,0 +1,389 @@ +#ifndef GUARD_ITEMS_H +#define GUARD_ITEMS_H + +enum +{ + ITEM_NONE, // 0x000 + ITEM_MASTER_BALL, // 0x001 + ITEM_ULTRA_BALL, // 0x002 + ITEM_GREAT_BALL, // 0x003 + ITEM_POKE_BALL, // 0x004 + ITEM_SAFARI_BALL, // 0x005 + ITEM_NET_BALL, // 0x006 + ITEM_DIVE_BALL, // 0x007 + ITEM_NEST_BALL, // 0x008 + ITEM_REPEAT_BALL, // 0x009 + ITEM_TIMER_BALL, // 0x00a + ITEM_LUXURY_BALL, // 0x00b + ITEM_PREMIER_BALL, // 0x00c + ITEM_POTION, // 0x00d + ITEM_ANTIDOTE, // 0x00e + ITEM_BURN_HEAL, // 0x00f + ITEM_ICE_HEAL, // 0x010 + ITEM_AWAKENING, // 0x011 + ITEM_PARALYZE_HEAL, // 0x012 + ITEM_FULL_RESTORE, // 0x013 + ITEM_MAX_POTION, // 0x014 + ITEM_HYPER_POTION, // 0x015 + ITEM_SUPER_POTION, // 0x016 + ITEM_FULL_HEAL, // 0x017 + ITEM_REVIVE, // 0x018 + ITEM_MAX_REVIVE, // 0x019 + ITEM_FRESH_WATER, // 0x01a + ITEM_SODA_POP, // 0x01b + ITEM_LEMONADE, // 0x01c + ITEM_MOOMOO_MILK, // 0x01d + ITEM_ENERGY_POWDER, // 0x01e + ITEM_ENERGY_ROOT, // 0x01f + ITEM_HEAL_POWDER, // 0x020 + ITEM_REVIVAL_HERB, // 0x021 + ITEM_ETHER, // 0x022 + ITEM_MAX_ETHER, // 0x023 + ITEM_ELIXIR, // 0x024 + ITEM_MAX_ELIXIR, // 0x025 + ITEM_LAVA_COOKIE, // 0x026 + ITEM_BLUE_FLUTE, // 0x027 + ITEM_YELLOW_FLUTE, // 0x028 + ITEM_RED_FLUTE, // 0x029 + ITEM_BLACK_FLUTE, // 0x02a + ITEM_WHITE_FLUTE, // 0x02b + ITEM_BERRY_JUICE, // 0x02c + ITEM_SACRED_ASH, // 0x02d + ITEM_SHOAL_SALT, // 0x02e + ITEM_SHOAL_SHELL, // 0x02f + ITEM_RED_SHARD, // 0x030 + ITEM_BLUE_SHARD, // 0x031 + ITEM_YELLOW_SHARD, // 0x032 + ITEM_GREEN_SHARD, // 0x033 + ITEM_034, + ITEM_035, + ITEM_036, + ITEM_037, + ITEM_038, + ITEM_039, + ITEM_03A, + ITEM_03B, + ITEM_03C, + ITEM_03D, + ITEM_03E, + ITEM_HP_UP, // 0x03f + ITEM_PROTEIN, // 0x040 + ITEM_IRON, // 0x041 + ITEM_CARBOS, // 0x042 + ITEM_CALCIUM, // 0x043 + ITEM_RARE_CANDY, // 0x044 + ITEM_PP_UP, // 0x045 + ITEM_ZINC, // 0x046 + ITEM_PP_MAX, // 0x047 + ITEM_048, + ITEM_GUARD_SPEC, // 0x049 + ITEM_DIRE_HIT, // 0x04a + ITEM_X_ATTACK, // 0x04b + ITEM_X_DEFEND, // 0x04c + ITEM_X_SPEED, // 0x04d + ITEM_X_ACCURACY, // 0x04e + ITEM_X_SPECIAL, // 0x04f + ITEM_POKE_DOLL, // 0x050 + ITEM_FLUFFY_TAIL, // 0x051 + ITEM_052, + ITEM_SUPER_REPEL, // 0x053 + ITEM_MAX_REPEL, // 0x054 + ITEM_ESCAPE_ROPE, // 0x055 + ITEM_REPEL, // 0x056 + ITEM_057, + ITEM_058, + ITEM_059, + ITEM_05A, + ITEM_05B, + ITEM_05C, + ITEM_SUN_STONE, // 0x05d + ITEM_MOON_STONE, // 0x05e + ITEM_FIRE_STONE, // 0x05f + ITEM_THUNDER_STONE, // 0x060 + ITEM_WATER_STONE, // 0x061 + ITEM_LEAF_STONE, // 0x062 + ITEM_063, + ITEM_064, + ITEM_065, + ITEM_066, + ITEM_TINY_MUSHROOM, // 0x067 + ITEM_BIG_MUSHROOM, // 0x068 + ITEM_069, + ITEM_PEARL, // 0x06a + ITEM_BIG_PEARL, // 0x06b + ITEM_STARDUST, // 0x06c + ITEM_STAR_PIECE, // 0x06d + ITEM_NUGGET, // 0x06e + ITEM_HEART_SCALE, // 0x06f + ITEM_070, + ITEM_071, + ITEM_072, + ITEM_073, + ITEM_074, + ITEM_075, + ITEM_076, + ITEM_077, + ITEM_078, + ITEM_ORANGE_MAIL, // 0x079 + ITEM_HARBOR_MAIL, // 0x07a + ITEM_GLITTER_MAIL, // 0x07b + ITEM_MECH_MAIL, // 0x07c + ITEM_WOOD_MAIL, // 0x07d + ITEM_WAVE_MAIL, // 0x07e + ITEM_BEAD_MAIL, // 0x07f + ITEM_SHADOW_MAIL, // 0x080 + ITEM_TROPIC_MAIL, // 0x081 + ITEM_DREAM_MAIL, // 0x082 + ITEM_FAB_MAIL, // 0x083 + ITEM_RETRO_MAIL, // 0x084 + ITEM_CHERI_BERRY, // 0x085 + ITEM_CHESTO_BERRY, // 0x086 + ITEM_PECHA_BERRY, // 0x087 + ITEM_RAWST_BERRY, // 0x088 + ITEM_ASPEAR_BERRY, // 0x089 + ITEM_LEPPA_BERRY, // 0x08a + ITEM_ORAN_BERRY, // 0x08b + ITEM_PERSIM_BERRY, // 0x08c + ITEM_LUM_BERRY, // 0x08d + ITEM_SITRUS_BERRY, // 0x08e + ITEM_FIGY_BERRY, // 0x08f + ITEM_WIKI_BERRY, // 0x090 + ITEM_MAGO_BERRY, // 0x091 + ITEM_AGUAV_BERRY, // 0x092 + ITEM_IAPAPA_BERRY, // 0x093 + ITEM_RAZZ_BERRY, // 0x094 + ITEM_BLUK_BERRY, // 0x095 + ITEM_NANAB_BERRY, // 0x096 + ITEM_WEPEAR_BERRY, // 0x097 + ITEM_PINAP_BERRY, // 0x098 + ITEM_POMEG_BERRY, // 0x099 + ITEM_KELPSY_BERRY, // 0x09a + ITEM_QUALOT_BERRY, // 0x09b + ITEM_HONDEW_BERRY, // 0x09c + ITEM_GREPA_BERRY, // 0x09d + ITEM_TAMATO_BERRY, // 0x09e + ITEM_CORNN_BERRY, // 0x09f + ITEM_MAGOST_BERRY, // 0x0a0 + ITEM_RABUTA_BERRY, // 0x0a1 + ITEM_NOMEL_BERRY, // 0x0a2 + ITEM_SPELON_BERRY, // 0x0a3 + ITEM_PAMTRE_BERRY, // 0x0a4 + ITEM_WATMEL_BERRY, // 0x0a5 + ITEM_DURIN_BERRY, // 0x0a6 + ITEM_BELUE_BERRY, // 0x0a7 + ITEM_LIECHI_BERRY, // 0x0a8 + ITEM_GANLON_BERRY, // 0x0a9 + ITEM_SALAC_BERRY, // 0x0aa + ITEM_PETAYA_BERRY, // 0x0ab + ITEM_APICOT_BERRY, // 0x0ac + ITEM_LANSAT_BERRY, // 0x0ad + ITEM_STARF_BERRY, // 0x0ae + ITEM_ENIGMA_BERRY, // 0x0af + ITEM_0B0, + ITEM_0B1, + ITEM_0B2, + ITEM_BRIGHT_POWDER, // 0x0b3 + ITEM_WHITE_HERB, // 0x0b4 + ITEM_MACHO_BRACE, // 0x0b5 + ITEM_EXP_SHARE, // 0x0b6 + ITEM_QUICK_CLAW, // 0x0b7 + ITEM_SOOTHE_BELL, // 0x0b8 + ITEM_MENTAL_HERB, // 0x0b9 + ITEM_CHOICE_BAND, // 0x0ba + ITEM_KINGS_ROCK, // 0x0bb + ITEM_SILVER_POWDER, // 0x0bc + ITEM_AMULET_COIN, // 0x0bd + ITEM_CLEANSE_TAG, // 0x0be + ITEM_SOUL_DEW, // 0x0bf + ITEM_DEEP_SEA_TOOTH, // 0x0c0 + ITEM_DEEP_SEA_SCALE, // 0x0c1 + ITEM_SMOKE_BALL, // 0x0c2 + ITEM_EVERSTONE, // 0x0c3 + ITEM_FOCUS_BAND, // 0x0c4 + ITEM_LUCKY_EGG, // 0x0c5 + ITEM_SCOPE_LENS, // 0x0c6 + ITEM_METAL_COAT, // 0x0c7 + ITEM_LEFTOVERS, // 0x0c8 + ITEM_DRAGON_SCALE, // 0x0c9 + ITEM_LIGHT_BALL, // 0x0ca + ITEM_SOFT_SAND, // 0x0cb + ITEM_HARD_STONE, // 0x0cc + ITEM_MIRACLE_SEED, // 0x0cd + ITEM_BLACK_GLASSES, // 0x0ce + ITEM_BLACK_BELT, // 0x0cf + ITEM_MAGNET, // 0x0d0 + ITEM_MYSTIC_WATER, // 0x0d1 + ITEM_SHARP_BEAK, // 0x0d2 + ITEM_POISON_BARB, // 0x0d3 + ITEM_NEVER_MELT_ICE, // 0x0d4 + ITEM_SPELL_TAG, // 0x0d5 + ITEM_TWISTED_SPOON, // 0x0d6 + ITEM_CHARCOAL, // 0x0d7 + ITEM_DRAGON_FANG, // 0x0d8 + ITEM_SILK_SCARF, // 0x0d9 + ITEM_UP_GRADE, // 0x0da + ITEM_SHELL_BELL, // 0x0db + ITEM_SEA_INCENSE, // 0x0dc + ITEM_LAX_INCENSE, // 0x0dd + ITEM_LUCKY_PUNCH, // 0x0de + ITEM_METAL_POWDER, // 0x0df + ITEM_THICK_CLUB, // 0x0e0 + ITEM_STICK, // 0x0e1 + ITEM_0E2, + ITEM_0E3, + ITEM_0E4, + ITEM_0E5, + ITEM_0E6, + ITEM_0E7, + ITEM_0E8, + ITEM_0E9, + ITEM_0EA, + ITEM_0EB, + ITEM_0EC, + ITEM_0ED, + ITEM_0EE, + ITEM_0EF, + ITEM_0F0, + ITEM_0F1, + ITEM_0F2, + ITEM_0F3, + ITEM_0F4, + ITEM_0F5, + ITEM_0F6, + ITEM_0F7, + ITEM_0F8, + ITEM_0F9, + ITEM_0FA, + ITEM_0FB, + ITEM_0FC, + ITEM_0FD, + ITEM_RED_SCARF, // 0x0fe + ITEM_BLUE_SCARF, // 0x0ff + ITEM_PINK_SCARF, // 0x100 + ITEM_GREEN_SCARF, // 0x101 + ITEM_YELLOW_SCARF, // 0x102 + ITEM_MACH_BIKE, // 0x103 + ITEM_COIN_CASE, // 0x104 + ITEM_ITEMFINDER, // 0x105 + ITEM_OLD_ROD, // 0x106 + ITEM_GOOD_ROD, // 0x107 + ITEM_SUPER_ROD, // 0x108 + ITEM_SS_TICKET, // 0x109 + ITEM_CONTEST_PASS, // 0x10a + ITEM_10B, + ITEM_WAILMER_PAIL, // 0x10c + ITEM_DEVON_GOODS, // 0x10d + ITEM_SOOT_SACK, // 0x10e + ITEM_BASEMENT_KEY, // 0x10f + ITEM_ACRO_BIKE, // 0x110 + ITEM_POKEBLOCK_CASE, // 0x111 + ITEM_LETTER, // 0x112 + ITEM_EON_TICKET, // 0x113 + ITEM_RED_ORB, // 0x114 + ITEM_BLUE_ORB, // 0x115 + ITEM_SCANNER, // 0x116 + ITEM_GO_GOGGLES, // 0x117 + ITEM_METEORITE, // 0x118 + ITEM_ROOM_1_KEY, // 0x119 + ITEM_ROOM_2_KEY, // 0x11a + ITEM_ROOM_4_KEY, // 0x11b + ITEM_ROOM_6_KEY, // 0x11c + ITEM_STORAGE_KEY, // 0x11d + ITEM_ROOT_FOSSIL, // 0x11e + ITEM_CLAW_FOSSIL, // 0x11f + ITEM_DEVON_SCOPE, // 0x120 + ITEM_TM01, // 0x121 + ITEM_TM02, // 0x122 + ITEM_TM03, // 0x123 + ITEM_TM04, // 0x124 + ITEM_TM05, // 0x125 + ITEM_TM06, // 0x126 + ITEM_TM07, // 0x127 + ITEM_TM08, // 0x128 + ITEM_TM09, // 0x129 + ITEM_TM10, // 0x12a + ITEM_TM11, // 0x12b + ITEM_TM12, // 0x12c + ITEM_TM13, // 0x12d + ITEM_TM14, // 0x12e + ITEM_TM15, // 0x12f + ITEM_TM16, // 0x130 + ITEM_TM17, // 0x131 + ITEM_TM18, // 0x132 + ITEM_TM19, // 0x133 + ITEM_TM20, // 0x134 + ITEM_TM21, // 0x135 + ITEM_TM22, // 0x136 + ITEM_TM23, // 0x137 + ITEM_TM24, // 0x138 + ITEM_TM25, // 0x139 + ITEM_TM26, // 0x13a + ITEM_TM27, // 0x13b + ITEM_TM28, // 0x13c + ITEM_TM29, // 0x13d + ITEM_TM30, // 0x13e + ITEM_TM31, // 0x13f + ITEM_TM32, // 0x140 + ITEM_TM33, // 0x141 + ITEM_TM34, // 0x142 + ITEM_TM35, // 0x143 + ITEM_TM36, // 0x144 + ITEM_TM37, // 0x145 + ITEM_TM38, // 0x146 + ITEM_TM39, // 0x147 + ITEM_TM40, // 0x148 + ITEM_TM41, // 0x149 + ITEM_TM42, // 0x14a + ITEM_TM43, // 0x14b + ITEM_TM44, // 0x14c + ITEM_TM45, // 0x14d + ITEM_TM46, // 0x14e + ITEM_TM47, // 0x14f + ITEM_TM48, // 0x150 + ITEM_TM49, // 0x151 + ITEM_TM50, // 0x152 + ITEM_HM01, // 0x153 + ITEM_HM02, // 0x154 + ITEM_HM03, // 0x155 + ITEM_HM04, // 0x156 + ITEM_HM05, // 0x157 + ITEM_HM06, // 0x158 + ITEM_HM07, // 0x159 + ITEM_HM08, // 0x15a + ITEM_15B, + ITEM_15C, + + // FireRed/LeafGreen + ITEM_OAKS_PARCEL, // 0x15d + ITEM_POKE_FLUTE, // 0x15e + ITEM_SECRET_KEY, // 0x15f + ITEM_BIKE_VOUCHER, // 0x160 + ITEM_GOLD_TEETH, // 0x161 + ITEM_OLD_AMBER, // 0x162 + ITEM_CARD_KEY, // 0x163 + ITEM_LIFT_KEY, // 0x164 + ITEM_HELIX_FOSSIL, // 0x165 + ITEM_DOME_FOSSIL, // 0x166 + ITEM_SILPH_SCOPE, // 0x167 + ITEM_BICYCLE, // 0x168 + ITEM_TOWN_MAP, // 0x169 + ITEM_VS_SEEKER, // 0x16a + ITEM_FAME_CHECKER, // 0x16b + ITEM_TM_CASE, // 0x16c + ITEM_BERRY_POUCH, // 0x16d + ITEM_TEACHY_TV, // 0x16e + ITEM_TRI_PASS, // 0x16f + ITEM_RAINBOW_PASS, // 0x170 + ITEM_TEA, // 0x171 + ITEM_MYSTIC_TICKET, // 0x172 + ITEM_AURORA_TICKET, // 0x173 + ITEM_POWDER_JAR, // 0x174 + ITEM_RUBY, // 0x175 + ITEM_SAPPHIRE, // 0x176 + + // Emerald + ITEM_MAGMA_EMBLEM, // 0x177 + ITEM_OLD_SEA_MAP, // 0x178 +}; + +#endif // GUARD_ITEMS_H diff --git a/include/lilycove_lady.h b/include/lilycove_lady.h new file mode 100644 index 000000000..81825d8ac --- /dev/null +++ b/include/lilycove_lady.h @@ -0,0 +1,6 @@ +#ifndef GUARD_LILYCOVE_LADY_H +#define GUARD_LILYCOVE_LADY_H + +void SetLilycoveLady(void); + +#endif //GUARD_LILYCOVE_LADY_H diff --git a/include/load_save.h b/include/load_save.h new file mode 100644 index 000000000..0fedd720b --- /dev/null +++ b/include/load_save.h @@ -0,0 +1,22 @@ +#ifndef GUARD_LOAD_SAVE_H +#define GUARD_LOAD_SAVE_H + +extern bool32 gFlashMemoryPresent; + +void ClearSav2(void); +void ClearSav1(void); +void CheckForFlashMemory(void); +void MoveSaveBlocks_ResetHeap(void); +bool32 GetSecretBase2Field_9(void); +void ClearSecretBase2Field_9(void); +void SetSecretBase2Field_9(void); +void SetSecretBase2Field_9_AndHideBG(void); +void ClearSecretBase2Field_9_2(void); +void SavePlayerParty(void); +void LoadPlayerParty(void); +void SaveSerializedGame(void); +void LoadSerializedGame(void); +void LoadPlayerBag(void); +void SavePlayerBag(void); + +#endif // GUARD_LOAD_SAVE_H diff --git a/include/lottery_corner.h b/include/lottery_corner.h new file mode 100644 index 000000000..5e2346d37 --- /dev/null +++ b/include/lottery_corner.h @@ -0,0 +1,12 @@ +#ifndef GUARD_LOTTERY_CORNER_H +#define GUARD_LOTTERY_CORNER_H + +void ResetLotteryCorner(void); +void SetRandomLotteryNumber(u16 i); +void RetrieveLotteryNumber(void); +void PickLotteryCornerTicket(void); +void SetLotteryNumber(u32 lotteryNum); +u32 GetLotteryNumber(void); +void SetLotteryNumber16_Unused(u16 lotteryNum); + +#endif // GUARD_LOTTERY_CORNER_H diff --git a/include/mauville_old_man.h b/include/mauville_old_man.h index 5ed7b203b..aefc76083 100644 --- a/include/mauville_old_man.h +++ b/include/mauville_old_man.h @@ -1,10 +1,8 @@ -// -// Created by Scott Norton on 9/8/17. -// -#ifndef POKEEMERALD_MAUVILLE_OLD_MAN_H -#define POKEEMERALD_MAUVILLE_OLD_MAN_H +#ifndef GUARD_MAUVILLE_OLD_MAN_H +#define GUARD_MAUVILLE_OLD_MAN_H +void SetMauvilleOldMan(void); u8 sub_81201C8(void); -#endif //POKEEMERALD_MAUVILLE_OLD_MAN_H +#endif // GUARD_MAUVILLE_OLD_MAN_H diff --git a/include/menu.h b/include/menu.h new file mode 100644 index 000000000..c8aafcb30 --- /dev/null +++ b/include/menu.h @@ -0,0 +1,18 @@ +#ifndef GUARD_MENU_H +#define GUARD_MENU_H + +#include "text.h" + +struct MenuAction +{ + const u8 *text; + u8 (*func)(); +}; + +struct MenuAction2 +{ + const u8 *text; + void (*func)(u8); +}; + +#endif // GUARD_MENU_H diff --git a/include/money.h b/include/money.h new file mode 100644 index 000000000..316dbd697 --- /dev/null +++ b/include/money.h @@ -0,0 +1,10 @@ +#ifndef GUARD_MONEY_H +#define GUARD_MONEY_H + +u32 GetMoney(u32* moneyPtr); +void SetMoney(u32* moneyPtr, u32 newValue); +bool8 IsEnoughMoney(u32* moneyPtr, u32 cost); +void AddMoney(u32* moneyPtr, u32 toAdd); +void SubtractMoney(u32* moneyPtr, u32 toSub); + +#endif // GUARD_MONEY_H diff --git a/include/moves.h b/include/moves.h new file mode 100644 index 000000000..e3b6d3113 --- /dev/null +++ b/include/moves.h @@ -0,0 +1,363 @@ +#ifndef GUARD_MOVES_H +#define GUARD_MOVES_H + +enum +{ + MOVE_NONE, + MOVE_POUND, + MOVE_KARATE_CHOP, + MOVE_DOUBLE_SLAP, + MOVE_COMET_PUNCH, + MOVE_MEGA_PUNCH, + MOVE_PAY_DAY, + MOVE_FIRE_PUNCH, + MOVE_ICE_PUNCH, + MOVE_THUNDER_PUNCH, + MOVE_SCRATCH, + MOVE_VICE_GRIP, + MOVE_GUILLOTINE, + MOVE_RAZOR_WIND, + MOVE_SWORDS_DANCE, + MOVE_CUT, + MOVE_GUST, + MOVE_WING_ATTACK, + MOVE_WHIRLWIND, + MOVE_FLY, + MOVE_BIND, + MOVE_SLAM, + MOVE_VINE_WHIP, + MOVE_STOMP, + MOVE_DOUBLE_KICK, + MOVE_MEGA_KICK, + MOVE_JUMP_KICK, + MOVE_ROLLING_KICK, + MOVE_SAND_ATTACK, + MOVE_HEADBUTT, + MOVE_HORN_ATTACK, + MOVE_FURY_ATTACK, + MOVE_HORN_DRILL, + MOVE_TACKLE, + MOVE_BODY_SLAM, + MOVE_WRAP, + MOVE_TAKE_DOWN, + MOVE_THRASH, + MOVE_DOUBLE_EDGE, + MOVE_TAIL_WHIP, + MOVE_POISON_STING, + MOVE_TWINEEDLE, + MOVE_PIN_MISSILE, + MOVE_LEER, + MOVE_BITE, + MOVE_GROWL, + MOVE_ROAR, + MOVE_SING, + MOVE_SUPERSONIC, + MOVE_SONIC_BOOM, + MOVE_DISABLE, + MOVE_ACID, + MOVE_EMBER, + MOVE_FLAMETHROWER, + MOVE_MIST, + MOVE_WATER_GUN, + MOVE_HYDRO_PUMP, + MOVE_SURF, + MOVE_ICE_BEAM, + MOVE_BLIZZARD, + MOVE_PSYBEAM, + MOVE_BUBBLE_BEAM, + MOVE_AURORA_BEAM, + MOVE_HYPER_BEAM, + MOVE_PECK, + MOVE_DRILL_PECK, + MOVE_SUBMISSION, + MOVE_LOW_KICK, + MOVE_COUNTER, + MOVE_SEISMIC_TOSS, + MOVE_STRENGTH, + MOVE_ABSORB, + MOVE_MEGA_DRAIN, + MOVE_LEECH_SEED, + MOVE_GROWTH, + MOVE_RAZOR_LEAF, + MOVE_SOLAR_BEAM, + MOVE_POISON_POWDER, + MOVE_STUN_SPORE, + MOVE_SLEEP_POWDER, + MOVE_PETAL_DANCE, + MOVE_STRING_SHOT, + MOVE_DRAGON_RAGE, + MOVE_FIRE_SPIN, + MOVE_THUNDER_SHOCK, + MOVE_THUNDERBOLT, + MOVE_THUNDER_WAVE, + MOVE_THUNDER, + MOVE_ROCK_THROW, + MOVE_EARTHQUAKE, + MOVE_FISSURE, + MOVE_DIG, + MOVE_TOXIC, + MOVE_CONFUSION, + MOVE_PSYCHIC, + MOVE_HYPNOSIS, + MOVE_MEDITATE, + MOVE_AGILITY, + MOVE_QUICK_ATTACK, + MOVE_RAGE, + MOVE_TELEPORT, + MOVE_NIGHT_SHADE, + MOVE_MIMIC, + MOVE_SCREECH, + MOVE_DOUBLE_TEAM, + MOVE_RECOVER, + MOVE_HARDEN, + MOVE_MINIMIZE, + MOVE_SMOKESCREEN, + MOVE_CONFUSE_RAY, + MOVE_WITHDRAW, + MOVE_DEFENSE_CURL, + MOVE_BARRIER, + MOVE_LIGHT_SCREEN, + MOVE_HAZE, + MOVE_REFLECT, + MOVE_FOCUS_ENERGY, + MOVE_BIDE, + MOVE_METRONOME, + MOVE_MIRROR_MOVE, + MOVE_SELF_DESTRUCT, + MOVE_EGG_BOMB, + MOVE_LICK, + MOVE_SMOG, + MOVE_SLUDGE, + MOVE_BONE_CLUB, + MOVE_FIRE_BLAST, + MOVE_WATERFALL, + MOVE_CLAMP, + MOVE_SWIFT, + MOVE_SKULL_BASH, + MOVE_SPIKE_CANNON, + MOVE_CONSTRICT, + MOVE_AMNESIA, + MOVE_KINESIS, + MOVE_SOFT_BOILED, + MOVE_HI_JUMP_KICK, + MOVE_GLARE, + MOVE_DREAM_EATER, + MOVE_POISON_GAS, + MOVE_BARRAGE, + MOVE_LEECH_LIFE, + MOVE_LOVELY_KISS, + MOVE_SKY_ATTACK, + MOVE_TRANSFORM, + MOVE_BUBBLE, + MOVE_DIZZY_PUNCH, + MOVE_SPORE, + MOVE_FLASH, + MOVE_PSYWAVE, + MOVE_SPLASH, + MOVE_ACID_ARMOR, + MOVE_CRABHAMMER, + MOVE_EXPLOSION, + MOVE_FURY_SWIPES, + MOVE_BONEMERANG, + MOVE_REST, + MOVE_ROCK_SLIDE, + MOVE_HYPER_FANG, + MOVE_SHARPEN, + MOVE_CONVERSION, + MOVE_TRI_ATTACK, + MOVE_SUPER_FANG, + MOVE_SLASH, + MOVE_SUBSTITUTE, + MOVE_STRUGGLE, + MOVE_SKETCH, + MOVE_TRIPLE_KICK, + MOVE_THIEF, + MOVE_SPIDER_WEB, + MOVE_MIND_READER, + MOVE_NIGHTMARE, + MOVE_FLAME_WHEEL, + MOVE_SNORE, + MOVE_CURSE, + MOVE_FLAIL, + MOVE_CONVERSION_2, + MOVE_AEROBLAST, + MOVE_COTTON_SPORE, + MOVE_REVERSAL, + MOVE_SPITE, + MOVE_POWDER_SNOW, + MOVE_PROTECT, + MOVE_MACH_PUNCH, + MOVE_SCARY_FACE, + MOVE_FAINT_ATTACK, + MOVE_SWEET_KISS, + MOVE_BELLY_DRUM, + MOVE_SLUDGE_BOMB, + MOVE_MUD_SLAP, + MOVE_OCTAZOOKA, + MOVE_SPIKES, + MOVE_ZAP_CANNON, + MOVE_FORESIGHT, + MOVE_DESTINY_BOND, + MOVE_PERISH_SONG, + MOVE_ICY_WIND, + MOVE_DETECT, + MOVE_BONE_RUSH, + MOVE_LOCK_ON, + MOVE_OUTRAGE, + MOVE_SANDSTORM, + MOVE_GIGA_DRAIN, + MOVE_ENDURE, + MOVE_CHARM, + MOVE_ROLLOUT, + MOVE_FALSE_SWIPE, + MOVE_SWAGGER, + MOVE_MILK_DRINK, + MOVE_SPARK, + MOVE_FURY_CUTTER, + MOVE_STEEL_WING, + MOVE_MEAN_LOOK, + MOVE_ATTRACT, + MOVE_SLEEP_TALK, + MOVE_HEAL_BELL, + MOVE_RETURN, + MOVE_PRESENT, + MOVE_FRUSTRATION, + MOVE_SAFEGUARD, + MOVE_PAIN_SPLIT, + MOVE_SACRED_FIRE, + MOVE_MAGNITUDE, + MOVE_DYNAMIC_PUNCH, + MOVE_MEGAHORN, + MOVE_DRAGON_BREATH, + MOVE_BATON_PASS, + MOVE_ENCORE, + MOVE_PURSUIT, + MOVE_RAPID_SPIN, + MOVE_SWEET_SCENT, + MOVE_IRON_TAIL, + MOVE_METAL_CLAW, + MOVE_VITAL_THROW, + MOVE_MORNING_SUN, + MOVE_SYNTHESIS, + MOVE_MOONLIGHT, + MOVE_HIDDEN_POWER, + MOVE_CROSS_CHOP, + MOVE_TWISTER, + MOVE_RAIN_DANCE, + MOVE_SUNNY_DAY, + MOVE_CRUNCH, + MOVE_MIRROR_COAT, + MOVE_PSYCH_UP, + MOVE_EXTREME_SPEED, + MOVE_ANCIENT_POWER, + MOVE_SHADOW_BALL, + MOVE_FUTURE_SIGHT, + MOVE_ROCK_SMASH, + MOVE_WHIRLPOOL, + MOVE_BEAT_UP, + MOVE_FAKE_OUT, + MOVE_UPROAR, + MOVE_STOCKPILE, + MOVE_SPIT_UP, + MOVE_SWALLOW, + MOVE_HEAT_WAVE, + MOVE_HAIL, + MOVE_TORMENT, + MOVE_FLATTER, + MOVE_WILL_O_WISP, + MOVE_MEMENTO, + MOVE_FACADE, + MOVE_FOCUS_PUNCH, + MOVE_SMELLING_SALT, + MOVE_FOLLOW_ME, + MOVE_NATURE_POWER, + MOVE_CHARGE, + MOVE_TAUNT, + MOVE_HELPING_HAND, + MOVE_TRICK, + MOVE_ROLE_PLAY, + MOVE_WISH, + MOVE_ASSIST, + MOVE_INGRAIN, + MOVE_SUPERPOWER, + MOVE_MAGIC_COAT, + MOVE_RECYCLE, + MOVE_REVENGE, + MOVE_BRICK_BREAK, + MOVE_YAWN, + MOVE_KNOCK_OFF, + MOVE_ENDEAVOR, + MOVE_ERUPTION, + MOVE_SKILL_SWAP, + MOVE_IMPRISON, + MOVE_REFRESH, + MOVE_GRUDGE, + MOVE_SNATCH, + MOVE_SECRET_POWER, + MOVE_DIVE, + MOVE_ARM_THRUST, + MOVE_CAMOUFLAGE, + MOVE_TAIL_GLOW, + MOVE_LUSTER_PURGE, + MOVE_MIST_BALL, + MOVE_FEATHER_DANCE, + MOVE_TEETER_DANCE, + MOVE_BLAZE_KICK, + MOVE_MUD_SPORT, + MOVE_ICE_BALL, + MOVE_NEEDLE_ARM, + MOVE_SLACK_OFF, + MOVE_HYPER_VOICE, + MOVE_POISON_FANG, + MOVE_CRUSH_CLAW, + MOVE_BLAST_BURN, + MOVE_HYDRO_CANNON, + MOVE_METEOR_MASH, + MOVE_ASTONISH, + MOVE_WEATHER_BALL, + MOVE_AROMATHERAPY, + MOVE_FAKE_TEARS, + MOVE_AIR_CUTTER, + MOVE_OVERHEAT, + MOVE_ODOR_SLEUTH, + MOVE_ROCK_TOMB, + MOVE_SILVER_WIND, + MOVE_METAL_SOUND, + MOVE_GRASS_WHISTLE, + MOVE_TICKLE, + MOVE_COSMIC_POWER, + MOVE_WATER_SPOUT, + MOVE_SIGNAL_BEAM, + MOVE_SHADOW_PUNCH, + MOVE_EXTRASENSORY, + MOVE_SKY_UPPERCUT, + MOVE_SAND_TOMB, + MOVE_SHEER_COLD, + MOVE_MUDDY_WATER, + MOVE_BULLET_SEED, + MOVE_AERIAL_ACE, + MOVE_ICICLE_SPEAR, + MOVE_IRON_DEFENSE, + MOVE_BLOCK, + MOVE_HOWL, + MOVE_DRAGON_CLAW, + MOVE_FRENZY_PLANT, + MOVE_BULK_UP, + MOVE_BOUNCE, + MOVE_MUD_SHOT, + MOVE_POISON_TAIL, + MOVE_COVET, + MOVE_VOLT_TACKLE, + MOVE_MAGICAL_LEAF, + MOVE_WATER_SPORT, + MOVE_CALM_MIND, + MOVE_LEAF_BLADE, + MOVE_DRAGON_DANCE, + MOVE_ROCK_BLAST, + MOVE_SHOCK_WAVE, + MOVE_WATER_PULSE, + MOVE_DOOM_DESIRE, + MOVE_PSYCHO_BOOST, +}; + +#endif // GUARD_MOVES_H \ No newline at end of file diff --git a/include/new_game.h b/include/new_game.h index 00ab55d70..f9ad7fcb8 100644 --- a/include/new_game.h +++ b/include/new_game.h @@ -8,5 +8,6 @@ void SetDefaultOptions(void); void ClearPokedexFlags(void); void WarpToTruck(void); void NewGameInitData(void); +void ResetMiniGamesResults(void); #endif // GUARD_NEW_GAME_H diff --git a/include/pokeblock.h b/include/pokeblock.h new file mode 100644 index 000000000..5d52f8e55 --- /dev/null +++ b/include/pokeblock.h @@ -0,0 +1,45 @@ +#ifndef GUARD_POKEBLOCK_H +#define GUARD_POKEBLOCK_H + +enum +{ + PBLOCK_CLR_BLACK, + PBLOCK_CLR_RED, + PBLOCK_CLR_BLUE, + PBLOCK_CLR_PINK, + PBLOCK_CLR_GREEN, + PBLOCK_CLR_YELLOW +}; + +enum +{ + PBLOCK_COLOR, + PBLOCK_SPICY, + PBLOCK_DRY, + PBLOCK_SWEET, + PBLOCK_BITTER, + PBLOCK_SOUR, + PBLOCK_FEEL, +}; + +void ClearPokeblocks(void); + +/* +void sub_810B96C(void); +u8 sub_810BA50(s16, s16, u8); +u8 sub_810C9B0(struct Pokeblock *); +s16 GetPokeblockData(const struct Pokeblock *, u8); +u8 sub_810C9E8(struct Pokeblock *); +void sub_810BA7C(u8); +bool8 PokeblockClearIfExists(u8); +s16 PokeblockGetGain(u8, const struct Pokeblock *); +u8 sub_810CB68(u8, u8*); +void PokeblockCopyName(struct Pokeblock *pokeblock, u8 *dest); +void CB2_PreparePokeblockFeedScene(void); + +#include "main.h" + +void sub_8136130(struct Pokeblock *, MainCallback); +*/ + +#endif // GUARD_POKEBLOCK_H diff --git a/include/pokemon.h b/include/pokemon.h index 299a25391..a335e0154 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -65,7 +65,7 @@ #define MON_DATA_SPD 61 #define MON_DATA_SPATK 62 #define MON_DATA_SPDEF 63 -#define MON_DATA_64 64 +#define MON_DATA_MAIL 64 #define MON_DATA_SPECIES2 65 #define MON_DATA_IVS 66 #define MON_DATA_CHAMPION_RIBBON 67 @@ -89,7 +89,11 @@ #define MON_DATA_DEF2 85 #define MON_DATA_SPD2 86 #define MON_DATA_SPATK2 87 -#define MON_DATA_SPDEF2 88 +#define MON_DATA_SPDEF2 88 + +#define OT_ID_RANDOM_NO_SHINY 2 +#define OT_ID_PRESET 1 +#define OT_ID_PLAYER_ID 0 #define MON_MALE 0x00 #define MON_FEMALE 0xFE @@ -114,7 +118,34 @@ #define TYPE_DRAGON 0x10 #define TYPE_DARK 0x11 -enum { +#define PARTY_SIZE 6 +#define MAX_TOTAL_EVS 510 +#define NUM_STATS 6 +#define UNOWN_FORM_COUNT 28 +#define MAX_MON_LEVEL 100 + +enum +{ + EGG_GROUP_NONE, + EGG_GROUP_MONSTER, + EGG_GROUP_WATER_1, + EGG_GROUP_BUG, + EGG_GROUP_FLYING, + EGG_GROUP_FIELD, + EGG_GROUP_FAIRY, + EGG_GROUP_GRASS, + EGG_GROUP_HUMAN_LIKE, + EGG_GROUP_WATER_3, + EGG_GROUP_MINERAL, + EGG_GROUP_AMORPHOUS, + EGG_GROUP_WATER_2, + EGG_GROUP_DITTO, + EGG_GROUP_DRAGON, + EGG_GROUP_UNDISCOVERED +}; + +enum +{ NATURE_HARDY, NATURE_LONELY, NATURE_BRAVE, @@ -258,8 +289,90 @@ struct Pokemon u16 spDefense; }; -extern struct Pokemon gPlayerParty[6]; -extern struct Pokemon gEnemyParty[6]; +struct PokemonStorage +{ + /*0x0000*/ u8 currentBox; + /*0x0001*/ struct BoxPokemon boxes[14][30]; + /*0x8344*/ u8 boxNames[14][9]; + /*0x83C2*/ u8 boxWallpapers[14]; +}; + +struct UnknownPokemonStruct +{ + u16 species; + u16 heldItem; + u16 moves[4]; + u8 level; + u8 ppBonuses; + u8 hpEV; + u8 attackEV; + u8 defenseEV; + u8 speedEV; + u8 spAttackEV; + u8 spDefenseEV; + u32 otId; + u32 hpIV:5; + u32 attackIV:5; + u32 defenseIV:5; + u32 speedIV:5; + u32 spAttackIV:5; + u32 spDefenseIV:5; + u32 gap:1; + u32 altAbility:1; + u32 personality; + u8 nickname[POKEMON_NAME_LENGTH + 1]; + u8 friendship; +}; + +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; +}; + +enum +{ + STAT_STAGE_HP, // 0 + STAT_STAGE_ATK, // 1 + STAT_STAGE_DEF, // 2 + STAT_STAGE_SPEED, // 3 + STAT_STAGE_SPATK, // 4 + STAT_STAGE_SPDEF, // 5 + STAT_STAGE_ACC, // 6 + STAT_STAGE_EVASION, // 7 +}; struct BaseStats { @@ -290,7 +403,8 @@ struct BaseStats /* 0x16 */ u8 ability1; /* 0x17 */ u8 ability2; /* 0x18 */ u8 safariZoneFleeRate; - /* 0x19 */ u8 bodyColor; + /* 0x19 */ u8 bodyColor : 7; + u8 noFlip : 1; }; struct BattleMove @@ -303,14 +417,138 @@ struct BattleMove u8 secondaryEffectChance; u8 target; u8 priority; - u32 flags; + u8 flags; }; +struct __attribute__((packed)) LevelUpMove +{ + u16 move:9; + u16 level:7; +}; + +enum +{ + GROWTH_MEDIUM_FAST, + GROWTH_ERRATIC, + GROWTH_FLUCTUATING, + GROWTH_MEDIUM_SLOW, + GROWTH_FAST, + GROWTH_SLOW +}; + +enum +{ + BODY_COLOR_RED, + BODY_COLOR_BLUE, + BODY_COLOR_YELLOW, + BODY_COLOR_GREEN, + BODY_COLOR_BLACK, + BODY_COLOR_BROWN, + BODY_COLOR_PURPLE, + BODY_COLOR_GRAY, + BODY_COLOR_WHITE, + BODY_COLOR_PINK +}; + +#define EVO_FRIENDSHIP 0x0001 // Pokémon levels up with friendship ≥ 220 +#define EVO_FRIENDSHIP_DAY 0x0002 // Pokémon levels up during the day with friendship ≥ 220 +#define EVO_FRIENDSHIP_NIGHT 0x0003 // Pokémon levels up at night with friendship ≥ 220 +#define EVO_LEVEL 0x0004 // Pokémon reaches the specified level +#define EVO_TRADE 0x0005 // Pokémon is traded +#define EVO_TRADE_ITEM 0x0006 // Pokémon is traded while it's holding the specified item +#define EVO_ITEM 0x0007 // specified item is used on Pokémon +#define EVO_LEVEL_ATK_GT_DEF 0x0008 // Pokémon reaches the specified level with attack > defense +#define EVO_LEVEL_ATK_EQ_DEF 0x0009 // Pokémon reaches the specified level with attack = defense +#define EVO_LEVEL_ATK_LT_DEF 0x000a // Pokémon reaches the specified level with attack < defense +#define EVO_LEVEL_SILCOON 0x000b // Pokémon reaches the specified level with a Silcoon personality value +#define EVO_LEVEL_CASCOON 0x000c // Pokémon reaches the specified level with a Cascoon personality value +#define EVO_LEVEL_NINJASK 0x000d // Pokémon reaches the specified level (special value for Ninjask) +#define EVO_LEVEL_SHEDINJA 0x000e // Pokémon reaches the specified level (special value for Shedinja) +#define EVO_BEAUTY 0x000f // Pokémon levels up with beauty ≥ specified value + +struct Evolution +{ + u16 method; + u16 param; + u16 targetSpecies; +}; + +struct EvolutionData +{ + struct Evolution evolutions[5]; +}; + +extern u8 gPlayerPartyCount; +extern struct Pokemon gPlayerParty[PARTY_SIZE]; +extern u8 gEnemyPartyCount; +extern struct Pokemon gEnemyParty[PARTY_SIZE]; +extern const struct BaseStats gBaseStats[]; +extern const struct EvolutionData gEvolutionTable[]; +extern struct PokemonStorage* gPokemonStoragePtr; +extern const u32 gExperienceTables[][MAX_MON_LEVEL + 1]; + +void ZeroBoxMonData(struct BoxPokemon *boxMon); +void ZeroMonData(struct Pokemon *mon); +void ZeroPlayerPartyMons(void); +void ZeroEnemyPartyMons(void); +void CreateMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId); +void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId); +void CreateMonWithNature(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 nature); +void CreateMonWithGenderNatureLetter(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 gender, u8 nature, u8 unownLetter); +void CreateMaleMon(struct Pokemon *mon, u16 species, u8 level); +void CreateMonWithIVsPersonality(struct Pokemon *mon, u16 species, u8 level, u32 ivs, u32 personality); +void CreateMonWithIVsOTID(struct Pokemon *mon, u16 species, u8 level, u8 *ivs, u32 otId); +void CreateMonWithEVSpread(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 evSpread); +u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon); +void CalculateMonStats(struct Pokemon *mon); +u8 GetLevelFromMonExp(struct Pokemon *mon); +u8 GetLevelFromBoxMonExp(struct BoxPokemon *boxMon); +u16 GiveMoveToMon(struct Pokemon *mon, u16 move); +u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move); +u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move); +void MonRestorePP(struct Pokemon *mon); +void SetMonMoveSlot(struct Pokemon *mon, u16 move, u8 slot); +void SetBattleMonMoveSlot(struct BattlePokemon *mon, u16 move, u8 slot); +void GiveMonInitialMoveset(struct Pokemon *mon); +void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon); +void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move); +void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move); + +u8 GetMonGender(struct Pokemon *mon); +u8 GetBoxMonGender(struct BoxPokemon *boxMon); +u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality); +void EncryptBoxMon(struct BoxPokemon *boxMon); +void DecryptBoxMon(struct BoxPokemon *boxMon); + // These are full type signatures for GetMonData() and GetBoxMonData(), // but they are not used since some code erroneously omits the third arg. // u32 GetMonData(struct Pokemon *mon, s32 field, u8 *data); +// u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data); u32 GetMonData(); +u32 GetBoxMonData(); -u8 pokemon_species_get_gender_info(u16 species, u32 personality); +void SetMonData(struct Pokemon *mon, s32 field, const void *data); +void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *data); +void CopyMon(void *dest, void *src, size_t size); +u8 GiveMonToPlayer(struct Pokemon *mon); +u8 SendMonToPC(struct Pokemon *mon); +u8 CalculatePlayerPartyCount(void); +u8 CalculateEnemyPartyCount(void); + +u8 GetAbilityBySpecies(u16 species, bool8 altAbility); +u8 GetMonAbility(struct Pokemon *mon); +void CreateSecretBaseEnemyParty(struct SecretBaseRecord *secretBaseRecord); +u8 GetSecretBaseTrainerPicIndex(void); +u8 GetSecretBaseTrainerNameIndex(void); +u8 PlayerPartyAndPokemonStorageFull(void); +u8 PokemonStorageFull(void); +void GetSpeciesName(u8 *name, u16 species); +u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex); +void RemoveMonPPBonus(struct Pokemon *mon, u8 moveIndex); +void RemoveBattleMonPPBonus(struct BattlePokemon *mon, u8 moveIndex); +void CopyPlayerPartyMonToBattleData(u8 battleIndex, u8 partyIndex); + +u8 GetNature(struct Pokemon *mon); +u8 GetNatureFromPersonality(u32 personality); #endif // GUARD_POKEMON_H diff --git a/include/pokemon_size_record.h b/include/pokemon_size_record.h new file mode 100644 index 000000000..f61286bd4 --- /dev/null +++ b/include/pokemon_size_record.h @@ -0,0 +1,14 @@ +#ifndef GUARD_POKEMON_SIZE_RECORD_H +#define GUARD_POKEMON_SIZE_RECORD_H + +void InitSeedotSizeRecord(void); +void GetSeedotSizeRecordInfo(void); +void CompareSeedotSize(void); + +void InitLotadSizeRecord(void); +void GetLotadSizeRecordInfo(void); +void CompareLotadSize(void); + +void GiveGiftRibbonToParty(u8 index, u8 ribbonId); + +#endif // GUARD_POKEMON_SIZE_RECORD_H diff --git a/include/roamer.h b/include/roamer.h new file mode 100644 index 000000000..af7f86e79 --- /dev/null +++ b/include/roamer.h @@ -0,0 +1,11 @@ +#ifndef GUARD_ROAMER_H +#define GUARD_ROAMER_H + +void ClearRoamerData(void); +void ClearRoamerLocationData(void); +void UpdateLocationHistoryForRoamer(void); +void RoamerMoveToOtherLocationSet(void); +void RoamerMove(); +u8 TryStartRoamerEncounter(void); + +#endif // GUARD_ROAMER_H diff --git a/include/safari_zone.h b/include/safari_zone.h new file mode 100644 index 000000000..9a81894b8 --- /dev/null +++ b/include/safari_zone.h @@ -0,0 +1,19 @@ +#ifndef GUARD_SAFARI_ZONE_H +#define GUARD_SAFARI_ZONE_H + +extern u8 gNumSafariBalls; + +bool32 GetSafariZoneFlag(void); +void SetSafariZoneFlag(void); +void ResetSafariZoneFlag(void); + +void EnterSafariMode(void); +void ExitSafariMode(void); + +bool8 SafariZoneTakeStep(void); +void SafariZoneRetirePrompt(void); + +struct Pokeblock *SafariZoneGetActivePokeblock(void); +void SafariZoneActivatePokeblockFeeder(u8 pokeblock_index); + +#endif // GUARD_SAFARI_ZONE_H diff --git a/include/script.h b/include/script.h new file mode 100644 index 000000000..ec6a212bc --- /dev/null +++ b/include/script.h @@ -0,0 +1,64 @@ +#ifndef GUARD_SCRIPT_H +#define GUARD_SCRIPT_H + +struct ScriptContext; + +typedef bool8 (*ScrCmdFunc)(struct ScriptContext *); +typedef u8 Script[]; + +struct ScriptContext +{ + u8 stackDepth; + u8 mode; + u8 comparisonResult; + u8 (*nativePtr)(void); + const u8 *scriptPtr; + const u8 *stack[20]; + ScrCmdFunc *cmdTable; + ScrCmdFunc *cmdTableEnd; + u32 data[4]; +}; + +#define ScriptReadByte(ctx) (*(ctx->scriptPtr++)) + +void InitScriptContext(struct ScriptContext *ctx, void *cmdTable, void *cmdTableEnd); +u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr); +void SetupNativeScript(struct ScriptContext *ctx, bool8 (*ptr)(void)); +void StopScript(struct ScriptContext *ctx); +bool8 RunScriptCommand(struct ScriptContext *ctx); +u8 ScriptPush(struct ScriptContext *ctx, const u8 *ptr); +const u8 *ScriptPop(struct ScriptContext *ctx); +void ScriptJump(struct ScriptContext *ctx, u8 *ptr); +void ScriptCall(struct ScriptContext *ctx, u8 *ptr); +void ScriptReturn(struct ScriptContext *ctx); +u16 ScriptReadHalfword(struct ScriptContext *ctx); +u32 ScriptReadWord(struct ScriptContext *ctx); +void ScriptContext2_Enable(void); +void ScriptContext2_Disable(void); +bool8 ScriptContext2_IsEnabled(void); +void ScriptContext1_Init(void); +bool8 ScriptContext1_IsScriptSetUp(void); +bool8 ScriptContext2_RunScript(void); +void ScriptContext1_SetupScript(const u8 *ptr); +void ScriptContext1_Stop(void); +void EnableBothScriptContexts(void); +void ScriptContext2_RunNewScript(const u8 *ptr); +u8 *mapheader_get_tagged_pointer(u8 tag); +void mapheader_run_script_by_tag(u8 tag); +u8 *mapheader_get_first_match_from_tagged_ptr_list(u8 tag); +void mapheader_run_script_with_tag_x1(void); +void mapheader_run_script_with_tag_x3(void); +void mapheader_run_script_with_tag_x5(void); +void mapheader_run_script_with_tag_x7(void); +void mapheader_run_script_with_tag_x6(void); +bool8 mapheader_run_first_tag2_script_list_match(void); +void mapheader_run_first_tag4_script_list_match(void); +u32 CalculateRamScriptChecksum(void); +void ClearRamScript(void); +bool8 InitRamScript(u8 *script, u16 scriptSize, u8 mapGroup, u8 mapNum, u8 objectId); +u8 *GetRamScript(u8 objectId, u8 *script); +bool32 sub_80991F8(void); +u8 *sub_8099244(void); +void sub_80992A0(u8 *script, u16 scriptSize); + +#endif // GUARD_SCRIPT_H diff --git a/include/sprite.h b/include/sprite.h index 68474b2ae..7b3c9fb5a 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -237,9 +237,11 @@ struct OamMatrix s16 d; }; -extern struct Sprite gSprites[]; - extern const struct OamData gDummyOamData; +extern const union AnimCmd *const gDummySpriteAnimTable[]; +extern const union AffineAnimCmd *const gDummySpriteAffineAnimTable[]; + +extern struct Sprite gSprites[]; void ResetSpriteData(void); void AnimateSprites(void); diff --git a/include/start_menu.h b/include/start_menu.h new file mode 100644 index 000000000..6c7cb3237 --- /dev/null +++ b/include/start_menu.h @@ -0,0 +1,6 @@ +#ifndef GUARD_START_MENU_H +#define GUARD_START_MENU_H + +void AppendToList(u8* list, u8* pos, u8 newEntry); + +#endif // GUARD_START_MENU_H diff --git a/include/text.h b/include/text.h index 3641548aa..f52336d84 100644 --- a/include/text.h +++ b/include/text.h @@ -2,14 +2,78 @@ #define GUARD_TEXT_H #define CHAR_SPACE 0x00 +#define CHAR_0 0xA1 #define CHAR_QUESTION_MARK 0xAC +#define CHAR_PERIOD 0xAD #define CHAR_HYPHEN 0xAE +#define CHAR_ELLIPSIS 0xB0 +#define CHAR_MALE 0xB5 +#define CHAR_FEMALE 0xB6 #define CHAR_CURRENCY 0xB7 +#define CHAR_COMMA 0xB8 +#define CHAR_MULT_SIGN 0xB9 +#define CHAR_SLASH 0xBA +#define CHAR_A 0xBB +#define CHAR_B 0xBC +#define CHAR_C 0xBD +#define CHAR_D 0xBE +#define CHAR_E 0xBF +#define CHAR_F 0xC0 +#define CHAR_G 0xC1 +#define CHAR_H 0xC2 +#define CHAR_I 0xC3 +#define CHAR_J 0xC4 +#define CHAR_K 0xC5 +#define CHAR_L 0xC6 +#define CHAR_M 0xC7 +#define CHAR_N 0xC8 +#define CHAR_O 0xC9 +#define CHAR_P 0xCA +#define CHAR_Q 0xCB +#define CHAR_R 0xCC +#define CHAR_S 0xCD +#define CHAR_T 0xCE +#define CHAR_U 0xCF +#define CHAR_V 0xD0 +#define CHAR_W 0xD1 +#define CHAR_X 0xD2 +#define CHAR_Y 0xD3 +#define CHAR_Z 0xD4 +#define CHAR_a 0xD5 +#define CHAR_b 0xD6 +#define CHAR_c 0xD7 +#define CHAR_d 0xD8 +#define CHAR_e 0xD9 +#define CHAR_f 0xDA +#define CHAR_g 0xDB +#define CHAR_h 0xDC +#define CHAR_i 0xDD +#define CHAR_j 0xDE +#define CHAR_k 0xDF +#define CHAR_l 0xE0 +#define CHAR_m 0xE1 +#define CHAR_n 0xE2 +#define CHAR_o 0xE3 +#define CHAR_p 0xE4 +#define CHAR_q 0xE5 +#define CHAR_r 0xE6 +#define CHAR_s 0xE7 +#define CHAR_t 0xE8 +#define CHAR_u 0xE9 +#define CHAR_v 0xEA +#define CHAR_w 0xEB +#define CHAR_x 0xEC +#define CHAR_y 0xED +#define CHAR_z 0xEE #define CHAR_COLON 0xF0 +#define CHAR_PROMPT_SCROLL 0xFA // waits for button press and scrolls dialog +#define CHAR_PROMPT_CLEAR 0xFB // waits for button press and clears dialog #define EXT_CTRL_CODE_BEGIN 0xFC // extended control code #define PLACEHOLDER_BEGIN 0xFD // string placeholder #define CHAR_NEWLINE 0xFE -#define EOS 0xFF // end of string +#define EOS 0xFF // end of string + +#define EXT_CTRL_CODE_JPN 0x15 #define NUM_TEXT_PRINTERS 32 @@ -30,9 +94,9 @@ struct TextPrinter u8 bgColor:4; u8 shadowColor:4; } subPrinter; - + void (*callback)(struct TextSubPrinter *, u16); // 0x10 - + union { struct TextPrinterSubStruct { @@ -48,10 +112,10 @@ struct TextPrinter u8 field_6; u8 active; } sub; - + u8 sub_fields[8]; } sub_union; - + u8 state; // 0x1C u8 text_speed; u8 delayCounter; @@ -91,7 +155,7 @@ extern u8 gStringVar4[]; void SetFontsPointer(const struct FontInfo *fonts); void DeactivateAllTextPrinters (void); -u16 Print(u8 windowId, u8 fontId, u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16)); +u16 PrintTextOnWindow(u8 windowId, u8 fontId, u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16)); bool16 AddTextPrinter(struct TextSubPrinter *textSubPrinter, u8 speed, void (*callback)(struct TextSubPrinter *, u16)); void RunTextPrinters(void); bool8 IsTextPrinterActive(u8 id); diff --git a/include/util.h b/include/util.h new file mode 100644 index 000000000..63887b13f --- /dev/null +++ b/include/util.h @@ -0,0 +1,17 @@ +#ifndef GUARD_UTIL_H +#define GUARD_UTIL_H + +#include "sprite.h" + +extern const u8 gMiscBlank_Gfx[]; // unused in Emerald +extern const u32 gBitTable[]; + +u8 CreateInvisibleSpriteWithCallback(void (*)(struct Sprite *)); +void StoreWordInTwoHalfwords(u16 *, u32); +void LoadWordFromTwoHalfwords(u16 *, u32 *); +int CountTrailingZeroBits(u32 value); +u16 CalcCRC16(u8 *data, s32 length); +u16 CalcCRC16WithTable(u8 *data, u32 length); +u32 CalcByteArraySum(const u8* data, u32 length); + +#endif // GUARD_UTIL_H diff --git a/include/vars.h b/include/vars.h index efbb462a4..8a779dccf 100644 --- a/include/vars.h +++ b/include/vars.h @@ -30,14 +30,14 @@ #define VAR_DEPT_STORE_FLOOR 0x4043 #define VAR_POKELOT_PRIZE 0x4045 #define VAR_NATIONAL_DEX 0x4046 -#define VAR_SHROOMISH_SIZE_RECORD 0x4047 +#define VAR_SEEDOT_SIZE_RECORD 0x4047 #define VAR_ASH_GATHER_COUNT 0x4048 #define VAR_BIRCH_STATE 0x4049 #define VAR_CRUISE_STEP_COUNT 0x404A #define VAR_POKELOT_RND1 0x404B #define VAR_POKELOT_RND2 0x404C -#define VAR_BARBOACH_SIZE_RECORD 0x404F +#define VAR_LOTAD_SIZE_RECORD 0x404F #define VAR_0x4054 0x4054 diff --git a/include/window.h b/include/window.h index 6f5f55c11..36a71a1e0 100644 --- a/include/window.h +++ b/include/window.h @@ -31,7 +31,7 @@ struct Window }; bool16 InitWindows(struct WindowTemplate *templates); -u16 AddWindow(struct WindowTemplate *template); +u16 AddWindow(const struct WindowTemplate *template); int AddWindowWithoutTileMap(struct WindowTemplate *template); void RemoveWindow(u8 windowId); void FreeAllWindowBuffers(void); diff --git a/ld_script.txt b/ld_script.txt index 6e9a7e63c..702c51ec2 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -9,11 +9,14 @@ SECTIONS { ewram (NOLOAD) : ALIGN(4) { + gHeap = .; + + . = 0x1C000; - . = 0x60000; - } + . = 0x40000; +} . = 0x3000000; @@ -42,7 +45,7 @@ SECTIONS { src/malloc.o(.text); src/dma3_manager.o(.text); src/gpu_regs.o(.text); - asm/bg.o(.text); + src/bg.o(.text); asm/blit.o(.text); src/window.o(.text); src/text.o(.text); @@ -54,7 +57,9 @@ SECTIONS { asm/rom3.o(.text); src/decompress.o(.text); asm/rom_8034C54.o(.text); + asm/battle_2.o(.text); asm/battle_3.o(.text); + src/battle_4.o(.text); asm/battle_4.o(.text); asm/battle_5.o(.text); asm/battle_controller_player.o(.text); @@ -62,23 +67,26 @@ SECTIONS { asm/battle_controller_opponent.o(.text); asm/battle_9.o(.text); asm/battle_controller_linkopponent.o(.text); + src/pokemon_1.o(.text); asm/pokemon_1.o(.text); - asm/calculate_base_damage.o(.text); + src/calculate_base_damage.o(.text); + src/pokemon_2.o(.text); asm/pokemon_2.o(.text); + asm/pokemon_item_effect.o(.text); asm/pokemon_3.o(.text); src/trig.o(.text); src/rng.o(.text); - asm/util.o(.text); + src/util.o(.text); src/blend_palette.o(.text); asm/daycare.o(.text); asm/egg_hatch.o(.text); asm/rom_8072304.o(.text); + src/load_save.o(.text); asm/load_save.o(.text); asm/trade.o(.text); asm/berry_blender.o(.text); src/play_time.o(.text); src/new_game.o(.text); - asm/new_game.o(.text); asm/rom4.o(.text); asm/fieldmap.o(.text); asm/metatile_behavior.o(.text); @@ -92,7 +100,7 @@ SECTIONS { asm/field_message_box.o(.text); asm/map_obj_lock.o(.text); src/text_window.o(.text); - asm/script.o(.text); + src/script.o(.text); asm/scrcmd.o(.text); asm/field_control_avatar.o(.text); src/event_data.o(.text); @@ -100,6 +108,7 @@ SECTIONS { asm/field_tasks.o(.text); asm/clock.o(.text); asm/reset_rtc_screen.o(.text); + src/start_menu.o(.text); asm/start_menu.o(.text); asm/tileset.o(.text); src/palette.o(.text); @@ -108,7 +117,7 @@ SECTIONS { asm/rom_80A5C6C.o(.text); src/task.o(.text); asm/reshow_battle_screen.o(.text); - asm/battle_anin_80A9C70.o(.text); + asm/battle_anim_80A9C70.o(.text); asm/title_screen.o(.text); asm/weather.o(.text); asm/rom_80AEFFC.o(.text); @@ -130,6 +139,7 @@ SECTIONS { asm/berry.o(.text); asm/script_menu.o(.text); asm/naming_screen.o(.text); + src/money.o(.text); asm/money.o(.text); asm/contest_effect.o(.text); asm/record_mixing.o(.text); @@ -138,12 +148,12 @@ SECTIONS { asm/contest_link_80F57C4.o(.text); asm/script_pokemon_util_80F87D8.o(.text); asm/field_poison.o(.text); - asm/big_shroomish_barboach.o(.text); + src/pokemon_size_record.o(.text); asm/fldeff_80F9BCC.o(.text); asm/truck_scene.o(.text); asm/porthole.o(.text); asm/rotating_gate.o(.text); - asm/safari_zone.o(.text); + src/safari_zone.o(.text); asm/contest_link_80FC4F4.o(.text); asm/item_use.o(.text); asm/battle_anim_80FE840.o(.text); @@ -171,10 +181,10 @@ SECTIONS { asm/evolution_scene.o(.text); asm/roulette.o(.text); asm/pokedex_cry_screen.o(.text); + src/coins.o(.text); asm/coins.o(.text); asm/landmark.o(.text); asm/fldeff_strength.o(.text); - asm/rom_8145E84.o(.text); asm/battle_transition.o(.text); asm/battle_controller_linkpartner.o(.text); asm/battle_message.o(.text); @@ -187,7 +197,13 @@ SECTIONS { asm/mystery_event_script.o(.text); asm/field_effect_helpers.o(.text); asm/contest_ai.o(.text); - asm/rom_8158B30.o(.text); + asm/battle_anim_sound_tasks.o(.text); + asm/battle_controller_safari.o(.text); + asm/fldeff_sweetscent.o(.text); + asm/rom_815A0D4.o(.text); + asm/decoration_inventory.o(.text); + asm/roamer.o(.text); + asm/rom_8161F74.o(.text); asm/battle_controller_wally.o(.text); asm/player_pc.o(.text); asm/intro.o(.text); @@ -196,7 +212,7 @@ SECTIONS { asm/battle_anim_8170478.o(.text); asm/hall_of_fame.o(.text); asm/credits.o(.text); - asm/lottery_corner.o(.text); + src/lottery_corner.o(.text); asm/diploma.o(.text); asm/berry_tag_screen.o(.text); asm/mystery_event_menu.o(.text); @@ -209,11 +225,13 @@ SECTIONS { asm/bard_music.o(.text); asm/fldeff_teleport.o(.text); asm/rom_817C95C.o(.text); - asm/front_pic_anim.o(.text); - asm/rom_8184DA4.o(.text); + asm/pokemon_animation.o(.text); + asm/recorded_battle.o(.text); asm/battle_controller_recorded_opponent.o(.text); asm/battle_controller_recorded_player.o(.text); asm/rom_818CFC8.o(.text); + asm/lilycove_lady.o(.text); + asm/rom_818E9AC.o(.text); src/multiboot.o(.text); asm/rom_81BAD84.o(.text); asm/battle_controller_player_partner.o(.text); @@ -269,7 +287,7 @@ SECTIONS { ALIGN(4) { src/main.o(.rodata); - data/bg.o(.rodata); + src/bg.o(.rodata); src/window.o(.rodata); src/text.o(.rodata); src/sprite.o(.rodata); @@ -278,21 +296,37 @@ SECTIONS { data/data2.o(.rodata); src/rtc.o(.rodata); data/data2b.o(.rodata); + src/battle_4.o(.rodata); + data/battle_4.o(.rodata); + data/battle_controller_player.o(.rodata); + data/data2b_2.o(.rodata); + data/battle_controller_opponent.o(.rodata); + data/battle_controller_link_opponent.o(.rodata); + data/data2c.o(.rodata); src/trig.o(.rodata); + src/util.o(.rodata); data/data3.o(.rodata); + src/pokemon_size_record.o(.rodata) + data/data3a.o(.rodata) + data/data3b.o(.rodata); + src/battle_ai.o(.rodata); + data/data4.o(.rodata); + data/battle_controller_link_partner.o(.rodata); data/battle_message.o(.rodata); data/cable_car.o(.rodata); data/save.o(.rodata); data/field_effect_helpers.o(.rodata); data/contest_ai.o(.rodata); + data/battle_controller_safari.o(.rodata); data/rom_8158B30.o(.rodata); + data/battle_controller_wally.o(.rodata); data/player_pc.o(.rodata); data/intro.o(.rodata); data/field_region_map.o(.rodata); data/battle_anim_8170478.o(.rodata); data/hall_of_fame.o(.rodata); data/credits.o(.rodata); - data/lottery_corner.o(.rodata); + src/lottery_corner.o(.rodata); data/diploma.o(.rodata); data/strings.o(.rodata); data/berry_tag_screen.o(.rodata); @@ -305,6 +339,11 @@ SECTIONS { data/evolution_graphics.o(.rodata); data/bard_music.o(.rodata); data/data_860A4AC.o(.rodata); + data/battle_controller_recorded_opponent.o(.rodata); + data/battle_controller_recorded_player.o(.rodata); + data/data_emerald.o(.rodata); + data/battle_controller_player_partner.o(.rodata); + data/data_emerald2.o(.rodata); data/fonts.o(.rodata); data/mystery_event_msg.o(.rodata); src/m4a_tables.o(.rodata); diff --git a/src/battle_4.c b/src/battle_4.c new file mode 100644 index 000000000..92561251f --- /dev/null +++ b/src/battle_4.c @@ -0,0 +1,601 @@ +#include "global.h" +#include "battle.h" +#include "battle_move_effects.h" +#include "moves.h" +#include "abilities.h" +#include "item.h" +#include "items.h" +#include "hold_effects.h" + +void atk00_attackcanceler(void); +void atk01_accuracycheck(void); +void atk02_attackstring(void); +void atk03_ppreduce(void); +void atk04_critcalc(void); +void atk05_damagecalc1(void); +void atk06_typecalc(void); +void atk07_dmg_adjustment(void); +void atk08_dmg_adjustment2(void); +void atk09_attackanimation(void); +void atk0A_waitanimation(void); +void atk0B_healthbarupdate(void); +void atk0C_datahpupdate(void); +void atk0D_critmessage(void); +void atk0E_effectiveness_sound(void); +void atk0F_resultmessage(void); +void atk10_printstring(void); +void atk11_printstring_playeronly(void); +void atk12_waitmessage(void); +void atk13_printfromtable(void); +void atk14_printfromtable_playeronly(void); +void atk15_seteffectwithchancetarget(void); +void atk16_seteffectprimary(void); +void atk17_seteffectsecondary(void); +void atk18_status_effect_clear(void); +void atk19_faint_pokemon(void); +void atk1A_faint_animation(void); +void atk1B_faint_effects_clear(void); +void atk1C_jumpifstatus(void); +void atk1D_jumpifstatus2(void); +void atk1E_jumpifability(void); +void atk1F_jumpifsideaffecting(void); +void atk20_jumpifstat(void); +void atk21_jumpifstatus3(void); +void atk22_jumpiftype(void); +void atk23_getexp(void); +void atk24(void); +void atk25_move_values_cleanup(void); +void atk26_set_multihit(void); +void atk27_decrement_multihit(void); +void atk28_goto(void); +void atk29_jumpifbyte(void); +void atk2A_jumpifhalfword(void); +void atk2B_jumpifword(void); +void atk2C_jumpifarrayequal(void); +void atk2D_jumpifarraynotequal(void); +void atk2E_setbyte(void); +void atk2F_addbyte(void); +void atk30_subbyte(void); +void atk31_copyarray(void); +void atk32_copyarray_withindex(void); +void atk33_orbyte(void); +void atk34_orhalfword(void); +void atk35_orword(void); +void atk36_bicbyte(void); +void atk37_bichalfword(void); +void atk38_bicword(void); +void atk39_pause(void); +void atk3A_waitstate(void); +void atk3B_healthbar_update(void); +void atk3C_return(void); +void atk3D_end(void); +void atk3E_end2(void); +void atk3F_end3(void); +void atk40_jump_if_move_affected_by_protect(void); +void atk41_call(void); +void atk42_jumpiftype2(void); +void atk43_jumpifabilitypresent(void); +void atk44(void); +void atk45_playanimation(void); +void atk46_playanimation2(void); +void atk47_setgraphicalstatchangevalues(void); +void atk48_playstatchangeanimation(void); +void atk49_moveendturn(void); +void atk4A_typecalc2(void); +void atk4B_return_atk_to_ball(void); +void atk4C_copy_poke_data(void); +void atk4D_switch_data_update(void); +void atk4E_switchin_anim(void); +void atk4F_jump_if_cannot_switch(void); +void atk50_openpartyscreen(void); +void atk51_switch_handle_order(void); +void atk52_switch_in_effects(void); +void atk53_trainer_slide(void); +void atk54_effectiveness_sound(void); +void atk55_play_sound(void); +void atk56_fainting_cry(void); +void atk57(void); +void atk58_return_to_ball(void); +void atk59_learnmove_inbattle(void); +void atk5A(void); +void atk5B_80256E0(void); +void atk5C_hitanimation(void); +void atk5D_getmoneyreward(void); +void atk5E_8025A70(void); +void atk5F_8025B24(void); +void atk60_increment_gamestat(void); +void atk61_8025BA4(void); +void atk62_08025C6C(void); +void atk63_jumptorandomattack(void); +void atk64_statusanimation(void); +void atk65_status2animation(void); +void atk66_chosenstatusanimation(void); +void atk67_8025ECC(void); +void atk68_80246A0(void); +void atk69_dmg_adjustment2(void); +void atk6A_removeitem(void); +void atk6B_atknameinbuff1(void); +void atk6C_lvlbox_display(void); +void atk6D_set_sentpokes_values(void); +void atk6E_set_atk_to_player0(void); +void atk6F_set_visible(void); +void atk70_record_ability(void); +void atk71_buffer_move_to_learn(void); +void atk72_jump_if_can_run_frombattle(void); +void atk73_hp_thresholds(void); +void atk74_hp_thresholds2(void); +void atk75_8026A58(void); +void atk76_various(void); +void atk77_setprotect(void); +void atk78_faintifabilitynotdamp(void); +void atk79_setatkhptozero(void); +void atk7A_jumpwhiletargetvalid(void); +void atk7B_healhalfHP_if_possible(void); +void atk7C_8025508(void); +void atk7D_set_rain(void); +void atk7E_setreflect(void); +void atk7F_setseeded(void); +void atk80_manipulatedamage(void); +void atk81_setrest(void); +void atk82_jumpifnotfirstturn(void); +void atk83_nop(void); +void atk84_jump_if_cant_sleep(void); +void atk85_stockpile(void); +void atk86_stockpiletobasedamage(void); +void atk87_stockpiletohpheal(void); +void atk88_negativedamage(void); +void atk89_statbuffchange(void); +void atk8A_normalisebuffs(void); +void atk8B_setbide(void); +void atk8C_confuseifrepeatingattackends(void); +void atk8D_setmultihit_counter(void); +void atk8E_prepare_multihit(void); +void atk8F_forcerandomswitch(void); +void atk90_conversion_type_change(void); +void atk91_givepaydaymoney(void); +void atk92_setlightscreen(void); +void atk93_ko_move(void); +void atk94_gethalfcurrentenemyhp(void); +void atk95_setsandstorm(void); +void atk96_weatherdamage(void); +void atk97_try_infatuation(void); +void atk98_status_icon_update(void); +void atk99_setmist(void); +void atk9A_set_focusenergy(void); +void atk9B_transformdataexecution(void); +void atk9C_set_substitute(void); +void atk9D_copyattack(void); +void atk9E_metronome(void); +void atk9F_dmgtolevel(void); +void atkA0_psywavedamageeffect(void); +void atkA1_counterdamagecalculator(void); +void atkA2_mirrorcoatdamagecalculator(void); +void atkA3_disablelastusedattack(void); +void atkA4_setencore(void); +void atkA5_painsplitdmgcalc(void); +void atkA6_settypetorandomresistance(void); +void atkA7_setalwayshitflag(void); +void atkA8_copymovepermanently(void); +void atkA9_sleeptalk_choose_move(void); +void atkAA_set_destinybond(void); +void atkAB_DestinyBondFlagUpdate(void); +void atkAC_remaininghptopower(void); +void atkAD_spite_ppreduce(void); +void atkAE_heal_party_status(void); +void atkAF_cursetarget(void); +void atkB0_set_spikes(void); +void atkB1_set_foresight(void); +void atkB2_setperishsong(void); +void atkB3_rolloutdamagecalculation(void); +void atkB4_jumpifconfusedandstatmaxed(void); +void atkB5_furycuttercalc(void); +void atkB6_happinesstodamagecalculation(void); +void atkB7_presentdamagecalculation(void); +void atkB8_set_safeguard(void); +void atkB9_magnitudedamagecalculation(void); +void atkBA_jumpifnopursuitswitchdmg(void); +void atkBB_setsunny(void); +void atkBC_maxattackhalvehp(void); +void atkBD_copyfoestats(void); +void atkBE_breakfree(void); +void atkBF_set_defense_curl(void); +void atkC0_recoverbasedonsunlight(void); +void atkC1_hidden_power(void); +void atkC2_selectnexttarget(void); +void atkC3_setfutureattack(void); +void atkC4_beat_up(void); +void atkC5_hidepreattack(void); +void atkC6_unhidepostattack(void); +void atkC7_setminimize(void); +void atkC8_sethail(void); +void atkC9_jumpifattackandspecialattackcannotfall(void); +void atkCA_setforcedtarget(void); +void atkCB_setcharge(void); +void atkCC_callterrainattack(void); +void atkCD_cureifburnedparalysedorpoisoned(void); +void atkCE_settorment(void); +void atkCF_jumpifnodamage(void); +void atkD0_settaunt(void); +void atkD1_set_helpinghand(void); +void atkD2_swap_items(void); +void atkD3_copy_ability(void); +void atkD4_wish_effect(void); +void atkD5_setroots(void); +void atkD6_doubledamagedealtifdamaged(void); +void atkD7_setyawn(void); +void atkD8_setdamagetohealthdifference(void); +void atkD9_scaledamagebyhealthratio(void); +void atkDA_abilityswap(void); +void atkDB_imprisoneffect(void); +void atkDC_setgrudge(void); +void atkDD_weightdamagecalculation(void); +void atkDE_asistattackselect(void); +void atkDF_setmagiccoat(void); +void atkE0_setstealstatchange(void); +void atkE1_intimidate_string_loader(void); +void atkE2_switchout_abilities(void); +void atkE3_jumpiffainted(void); +void atkE4_getsecretpowereffect(void); +void atkE5_pickup(void); +void atkE6_castform_change_animation(void); +void atkE7_castform_data_change(void); +void atkE8_settypebasedhalvers(void); +void atkE9_setweatherballtype(void); +void atkEA_recycleitem(void); +void atkEB_settypetoterrain(void); +void atkEC_pursuit_sth(void); +void atkED_802B4B4(void); +void atkEE_removelightscreenreflect(void); +void atkEF_pokeball_catch_calculation(void); +void atkF0_copy_caught_poke(void); +void atkF1_setpoke_as_caught(void); +void atkF2_display_dex_info(void); +void atkF3_nickname_caught_poke(void); +void atkF4_802BEF0(void); +void atkF5_removeattackerstatus1(void); +void atkF6_802BF48(void); +void atkF7_802BF54(void); +void sub_8056EF8(void); + +void (* const gBattleScriptingCommandsTable[])(void) = +{ + atk00_attackcanceler, + atk01_accuracycheck, + atk02_attackstring, + atk03_ppreduce, + atk04_critcalc, + atk05_damagecalc1, + atk06_typecalc, + atk07_dmg_adjustment, + atk08_dmg_adjustment2, + atk09_attackanimation, + atk0A_waitanimation, + atk0B_healthbarupdate, + atk0C_datahpupdate, + atk0D_critmessage, + atk0E_effectiveness_sound, + atk0F_resultmessage, + atk10_printstring, + atk11_printstring_playeronly, + atk12_waitmessage, + atk13_printfromtable, + atk14_printfromtable_playeronly, + atk15_seteffectwithchancetarget, + atk16_seteffectprimary, + atk17_seteffectsecondary, + atk18_status_effect_clear, + atk19_faint_pokemon, + atk1A_faint_animation, + atk1B_faint_effects_clear, + atk1C_jumpifstatus, + atk1D_jumpifstatus2, + atk1E_jumpifability, + atk1F_jumpifsideaffecting, + atk20_jumpifstat, + atk21_jumpifstatus3, + atk22_jumpiftype, + atk23_getexp, + atk24, + atk25_move_values_cleanup, + atk26_set_multihit, + atk27_decrement_multihit, + atk28_goto, + atk29_jumpifbyte, + atk2A_jumpifhalfword, + atk2B_jumpifword, + atk2C_jumpifarrayequal, + atk2D_jumpifarraynotequal, + atk2E_setbyte, + atk2F_addbyte, + atk30_subbyte, + atk31_copyarray, + atk32_copyarray_withindex, + atk33_orbyte, + atk34_orhalfword, + atk35_orword, + atk36_bicbyte, + atk37_bichalfword, + atk38_bicword, + atk39_pause, + atk3A_waitstate, + atk3B_healthbar_update, + atk3C_return, + atk3D_end, + atk3E_end2, + atk3F_end3, + atk40_jump_if_move_affected_by_protect, + atk41_call, + atk42_jumpiftype2, + atk43_jumpifabilitypresent, + atk44, + atk45_playanimation, + atk46_playanimation2, + atk47_setgraphicalstatchangevalues, + atk48_playstatchangeanimation, + atk49_moveendturn, + atk4A_typecalc2, + atk4B_return_atk_to_ball, + atk4C_copy_poke_data, + atk4D_switch_data_update, + atk4E_switchin_anim, + atk4F_jump_if_cannot_switch, + atk50_openpartyscreen, + atk51_switch_handle_order, + atk52_switch_in_effects, + atk53_trainer_slide, + atk54_effectiveness_sound, + atk55_play_sound, + atk56_fainting_cry, + atk57, + atk58_return_to_ball, + atk59_learnmove_inbattle, + atk5A, + atk5B_80256E0, + atk5C_hitanimation, + atk5D_getmoneyreward, + atk5E_8025A70, + atk5F_8025B24, + atk60_increment_gamestat, + atk61_8025BA4, + atk62_08025C6C, + atk63_jumptorandomattack, + atk64_statusanimation, + atk65_status2animation, + atk66_chosenstatusanimation, + atk67_8025ECC, + atk68_80246A0, + atk69_dmg_adjustment2, + atk6A_removeitem, + atk6B_atknameinbuff1, + atk6C_lvlbox_display, + atk6D_set_sentpokes_values, + atk6E_set_atk_to_player0, + atk6F_set_visible, + atk70_record_ability, + atk71_buffer_move_to_learn, + atk72_jump_if_can_run_frombattle, + atk73_hp_thresholds, + atk74_hp_thresholds2, + atk75_8026A58, + atk76_various, + atk77_setprotect, + atk78_faintifabilitynotdamp, + atk79_setatkhptozero, + atk7A_jumpwhiletargetvalid, + atk7B_healhalfHP_if_possible, + atk7C_8025508, + atk7D_set_rain, + atk7E_setreflect, + atk7F_setseeded, + atk80_manipulatedamage, + atk81_setrest, + atk82_jumpifnotfirstturn, + atk83_nop, + atk84_jump_if_cant_sleep, + atk85_stockpile, + atk86_stockpiletobasedamage, + atk87_stockpiletohpheal, + atk88_negativedamage, + atk89_statbuffchange, + atk8A_normalisebuffs, + atk8B_setbide, + atk8C_confuseifrepeatingattackends, + atk8D_setmultihit_counter, + atk8E_prepare_multihit, + atk8F_forcerandomswitch, + atk90_conversion_type_change, + atk91_givepaydaymoney, + atk92_setlightscreen, + atk93_ko_move, + atk94_gethalfcurrentenemyhp, + atk95_setsandstorm, + atk96_weatherdamage, + atk97_try_infatuation, + atk98_status_icon_update, + atk99_setmist, + atk9A_set_focusenergy, + atk9B_transformdataexecution, + atk9C_set_substitute, + atk9D_copyattack, + atk9E_metronome, + atk9F_dmgtolevel, + atkA0_psywavedamageeffect, + atkA1_counterdamagecalculator, + atkA2_mirrorcoatdamagecalculator, + atkA3_disablelastusedattack, + atkA4_setencore, + atkA5_painsplitdmgcalc, + atkA6_settypetorandomresistance, + atkA7_setalwayshitflag, + atkA8_copymovepermanently, + atkA9_sleeptalk_choose_move, + atkAA_set_destinybond, + atkAB_DestinyBondFlagUpdate, + atkAC_remaininghptopower, + atkAD_spite_ppreduce, + atkAE_heal_party_status, + atkAF_cursetarget, + atkB0_set_spikes, + atkB1_set_foresight, + atkB2_setperishsong, + atkB3_rolloutdamagecalculation, + atkB4_jumpifconfusedandstatmaxed, + atkB5_furycuttercalc, + atkB6_happinesstodamagecalculation, + atkB7_presentdamagecalculation, + atkB8_set_safeguard, + atkB9_magnitudedamagecalculation, + atkBA_jumpifnopursuitswitchdmg, + atkBB_setsunny, + atkBC_maxattackhalvehp, + atkBD_copyfoestats, + atkBE_breakfree, + atkBF_set_defense_curl, + atkC0_recoverbasedonsunlight, + atkC1_hidden_power, + atkC2_selectnexttarget, + atkC3_setfutureattack, + atkC4_beat_up, + atkC5_hidepreattack, + atkC6_unhidepostattack, + atkC7_setminimize, + atkC8_sethail, + atkC9_jumpifattackandspecialattackcannotfall, + atkCA_setforcedtarget, + atkCB_setcharge, + atkCC_callterrainattack, + atkCD_cureifburnedparalysedorpoisoned, + atkCE_settorment, + atkCF_jumpifnodamage, + atkD0_settaunt, + atkD1_set_helpinghand, + atkD2_swap_items, + atkD3_copy_ability, + atkD4_wish_effect, + atkD5_setroots, + atkD6_doubledamagedealtifdamaged, + atkD7_setyawn, + atkD8_setdamagetohealthdifference, + atkD9_scaledamagebyhealthratio, + atkDA_abilityswap, + atkDB_imprisoneffect, + atkDC_setgrudge, + atkDD_weightdamagecalculation, + atkDE_asistattackselect, + atkDF_setmagiccoat, + atkE0_setstealstatchange, + atkE1_intimidate_string_loader, + atkE2_switchout_abilities, + atkE3_jumpiffainted, + atkE4_getsecretpowereffect, + atkE5_pickup, + atkE6_castform_change_animation, + atkE7_castform_data_change, + atkE8_settypebasedhalvers, + atkE9_setweatherballtype, + atkEA_recycleitem, + atkEB_settypetoterrain, + atkEC_pursuit_sth, + atkED_802B4B4, + atkEE_removelightscreenreflect, + atkEF_pokeball_catch_calculation, + atkF0_copy_caught_poke, + atkF1_setpoke_as_caught, + atkF2_display_dex_info, + atkF3_nickname_caught_poke, + atkF4_802BEF0, + atkF5_removeattackerstatus1, + atkF6_802BF48, + atkF7_802BF54, + sub_8056EF8 +}; + +struct statFractions +{ + u8 dividend; + u8 divisor; +}; + +const struct statFractions gAccuracyStageRatios[] = +{ + { 33, 100}, // -6 + { 36, 100}, // -5 + { 43, 100}, // -4 + { 50, 100}, // -3 + { 60, 100}, // -2 + { 75, 100}, // -1 + { 1, 1}, // 0 + {133, 100}, // +1 + {166, 100}, // +2 + { 2, 1}, // +3 + {233, 100}, // +4 + {133, 50}, // +5 + { 3, 1}, // +6 +}; + +// The chance is 1/N for each stage. +const u16 gCriticalHitChance[] = {16, 8, 4, 3, 2}; + +const u32 gStatusFlagsForMoveEffects[] = +{ + 0x00000000, + 0x00000007, + 0x00000008, + 0x00000010, + 0x00000020, + 0x00000040, + 0x00000080, + 0x00000007, + 0x00000008, + 0x00000000, + 0x00000070, + 0x00000000, + 0x00001000, + 0x0000E000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00400000, + 0x00000000, + 0x00000000, + 0x04000000, + 0x08000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000C00, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000 +}; diff --git a/src/battle_ai.c b/src/battle_ai.c index 7c4b7604d..76bf4156d 100644 --- a/src/battle_ai.c +++ b/src/battle_ai.c @@ -1,32 +1,36 @@ #include "global.h" +#include "battle_ai.h" #include "pokemon.h" #include "battle.h" #include "species.h" #include "abilities.h" +#include "rng.h" +#include "item.h" +#include "battle_move_effects.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) -#define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(gBattleResources->ai)) -#define UNK_2016A00_STRUCT ((struct UnknownStruct2 *)(gBattleResources->unk18)) -#define UNK_2016C00_STRUCT ((struct UnknownStruct4 *)(gBattleResources->unk1C)) -#define UNK_BATTLE_STRUCT ((struct UnknownStruct1 *)(gBattleResources)) - -#define AI_ACTION_UNK1 0x0001 -#define AI_ACTION_UNK2 0x0002 -#define AI_ACTION_UNK3 0x0004 -#define AI_ACTION_UNK4 0x0008 +#define AI_ACTION_DONE 0x0001 +#define AI_ACTION_FLEE 0x0002 +#define AI_ACTION_WATCH 0x0004 +#define AI_ACTION_DO_NOT_ATTACK 0x0008 #define AI_ACTION_UNK5 0x0010 #define AI_ACTION_UNK6 0x0020 #define AI_ACTION_UNK7 0x0040 #define AI_ACTION_UNK8 0x0080 +#define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(gBattleResources->ai)) +#define BATTLE_HISTORY ((struct BattleHistory *)(gBattleResources->battleHistory)) + enum { - TARGET, - USER + AI_TARGET, + AI_USER, + AI_TARGET_PARTNER, + AI_USER_PARTNER }; // AI states @@ -38,128 +42,6 @@ enum AIState_DoNotProcess }; -//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 AI_ThinkingStruct -{ - u8 aiState; - u8 movesetIndex; - u16 moveConsidered; - s8 score[4]; - u32 funcResult; - u32 aiFlags; - u8 aiAction; - u8 aiLogicId; - u8 filler12[6]; - u8 unk18[4]; -}; - -//size should be 0x54 -struct UnknownStruct2 -{ - u16 unk0[2][8]; - u8 unk20[2]; - u8 filler20[0x1E]; - u8 unk40[4]; - u8 unk44[4]; - u16 unk48[4]; - u8 unk50; -}; - -struct UnknownStruct4 -{ - u8 *ptr[8]; - u8 unk20; -}; - -struct SimpleUnknownStruct -{ - u32 unkArray[4]; // unknown size -}; - -struct UnknownStruct1 -{ - u8 unk0; - u8 filler1[0x3]; - struct SimpleUnknownStruct *unk4; - u8 filler8[0xC]; - struct AI_ThinkingStruct *ai; - struct UnknownStruct2 *unk18; - struct UnknownStruct4 *unk1C; -}; - -struct UnknownStruct5 -{ - u8 filler0[0x3]; - u16 unk4; - u16 unk6; - u8 unk8; - u8 unk9; - u8 fillerA[0x9]; - u8 taunt:4; - u8 unkC:4; - u8 fillerD[0x2]; - u8 unk16; - u8 filler17[0x4]; -}; - -extern struct UnknownStruct5 gDisableStructs[]; - /* gAIScriptPtr is a pointer to the next battle AI cmd command to read. when a command finishes processing, gAIScriptPtr is incremented by @@ -167,168 +49,388 @@ the number of bytes that the current command had reserved for arguments in order to read the next command correctly. refer to battle_ai_scripts.s for the AI scripts. */ -extern u8 *gAIScriptPtr; extern u32 gBattleTypeFlags; extern u8 gActiveBank; -extern struct BattlePokemon gBattleMons[]; +extern struct BattlePokemon gBattleMons[4]; extern u16 gCurrentMove; extern u8 gBankTarget; extern u8 gAbsentBankFlags; -extern u16 gUnknown_02024248[]; -extern u8 *gBattleStruct; -extern struct UnknownStruct1 *gBattleResources; -extern u16 gUnknown_02038BCA; -extern u16 gUnknown_02038BCC; -extern u8 gPlayerMonIndex; -extern struct Trainer gTrainers[]; -extern const u32 gBitTable[]; -extern u8 *gUnknown_082DBEF8[]; -extern u32 gStatuses3[]; -extern u16 gUnknown_0202428E[]; -extern struct BattleMove gBattleMoves[]; -extern u8 gUnknown_03005D10[]; -extern u8 gBattlePartyID[][2]; -extern struct BaseStats gBaseStats[]; -extern u16 gUnknown_02024400; -extern u8 gBattleScripting[]; +extern u16 gLastUsedMovesByBanks[4]; +extern u16 gTrainerBattleOpponent_A; +extern u16 gTrainerBattleOpponent_B; +extern u32 gStatuses3[4]; +extern u16 gSideAffecting[2]; +extern u16 gBattlePartyID[4]; +extern u16 gDynamicBasePower; extern u8 gBattleMoveFlags; -extern int gBattleMoveDamage; +extern s32 gBattleMoveDamage; extern u8 gCritMultiplier; extern u16 gBattleWeather; +extern const struct BattleMove gBattleMoves[]; +extern const struct BaseStats gBaseStats[]; +extern const u32 gBitTable[]; +extern u8 * const gBattleAI_ScriptsTable[]; + extern u8 GetBankIdentity(u8); extern u8 b_first_side(u8, u8, u8); extern u8 GetBankByPlayerAI(u8); -extern void move_effectiveness_something(u16, u8, u8); -extern u8 ItemId_GetHoldEffect(); -extern void b_mc_stack_push(u8 *); -extern bool8 b_mc_stack_pop_cursor(void); -extern void sub_8046E7C(u8, u8); +extern void TypeCalc(u16 move, u8 bankAtk, u8 bankDef); +extern void AI_CalcDmg(u8, u8); + +extern u8 CheckMoveLimitations(); +extern u32 GetAiScriptsInRecordedBattle(); +extern u32 GetAiScriptsInBattleFactory(); + +static u8 BattleAI_ChooseMoveOrAction_Singles(void); +static u8 BattleAI_ChooseMoveOrAction_Doubles(void); +static void RecordLastUsedMoveByTarget(void); +static void BattleAI_DoAIProcessing(void); +static void AIStackPushVar(u8 *); +static bool8 AIStackPop(void); + +static void BattleAICmd_if_random_less_than(void); +static void BattleAICmd_if_random_greater_than(void); +static void BattleAICmd_if_random_equal(void); +static void BattleAICmd_if_random_not_equal(void); +static void BattleAICmd_score(void); +static void BattleAICmd_if_hp_less_than(void); +static void BattleAICmd_if_hp_more_than(void); +static void BattleAICmd_if_hp_equal(void); +static void BattleAICmd_if_hp_not_equal(void); +static void BattleAICmd_if_status(void); +static void BattleAICmd_if_not_status(void); +static void BattleAICmd_if_status2(void); +static void BattleAICmd_if_not_status2(void); +static void BattleAICmd_if_status3(void); +static void BattleAICmd_if_not_status3(void); +static void BattleAICmd_if_side_affecting(void); +static void BattleAICmd_if_not_side_affecting(void); +static void BattleAICmd_if_less_than(void); +static void BattleAICmd_if_more_than(void); +static void BattleAICmd_if_equal(void); +static void BattleAICmd_if_not_equal(void); +static void BattleAICmd_if_less_than_32(void); +static void BattleAICmd_if_more_than_32(void); +static void BattleAICmd_if_equal_32(void); +static void BattleAICmd_if_not_equal_32(void); +static void BattleAICmd_if_move(void); +static void BattleAICmd_if_not_move(void); +static void BattleAICmd_if_in_bytes(void); +static void BattleAICmd_if_not_in_bytes(void); +static void BattleAICmd_if_in_words(void); +static void BattleAICmd_if_not_in_words(void); +static void BattleAICmd_if_user_can_damage(void); +static void BattleAICmd_if_user_cant_damage(void); +static void BattleAICmd_get_turn_count(void); +static void BattleAICmd_get_type(void); +static void BattleAICmd_get_last_used_bank_move_power(void); +static void BattleAICmd_is_most_powerful_move(void); +static void BattleAICmd_get_last_used_bank_move(void); +static void BattleAICmd_if_arg_equal(void); +static void BattleAICmd_if_arg_not_equal(void); +static void BattleAICmd_if_would_go_first(void); +static void BattleAICmd_if_would_not_go_first(void); +static void BattleAICmd_nullsub_2A(void); +static void BattleAICmd_nullsub_2B(void); +static void BattleAICmd_count_alive_pokemon(void); +static void BattleAICmd_get_considered_move(void); +static void BattleAICmd_get_considered_move_effect(void); +static void BattleAICmd_get_ability(void); +static void BattleAICmd_get_highest_type_effectiveness(void); +static void BattleAICmd_if_type_effectiveness(void); +static void BattleAICmd_nullsub_32(void); +static void BattleAICmd_nullsub_33(void); +static void BattleAICmd_if_status_in_party(void); +static void BattleAICmd_if_status_not_in_party(void); +static void BattleAICmd_get_weather(void); +static void BattleAICmd_if_effect(void); +static void BattleAICmd_if_not_effect(void); +static void BattleAICmd_if_stat_level_less_than(void); +static void BattleAICmd_if_stat_level_more_than(void); +static void BattleAICmd_if_stat_level_equal(void); +static void BattleAICmd_if_stat_level_not_equal(void); +static void BattleAICmd_if_can_faint(void); +static void BattleAICmd_if_cant_faint(void); +static void BattleAICmd_if_has_move(void); +static void BattleAICmd_if_dont_have_move(void); +static void BattleAICmd_if_move_effect(void); +static void BattleAICmd_if_not_move_effect(void); +static void BattleAICmd_if_any_move_disabled_or_encored(void); +static void BattleAICmd_if_curr_move_disabled_or_encored(void); +static void BattleAICmd_flee(void); +static void BattleAICmd_if_random_100(void); +static void BattleAICmd_watch(void); +static void BattleAICmd_get_hold_effect(void); +static void BattleAICmd_get_gender(void); +static void BattleAICmd_is_first_turn(void); +static void BattleAICmd_get_stockpile_count(void); +static void BattleAICmd_is_double_battle(void); +static void BattleAICmd_get_used_held_item(void); +static void BattleAICmd_get_move_type_from_result(void); +static void BattleAICmd_get_move_power_from_result(void); +static void BattleAICmd_get_move_effect_from_result(void); +static void BattleAICmd_get_protect_count(void); +static void BattleAICmd_nullsub_52(void); +static void BattleAICmd_nullsub_53(void); +static void BattleAICmd_nullsub_54(void); +static void BattleAICmd_nullsub_55(void); +static void BattleAICmd_nullsub_56(void); +static void BattleAICmd_nullsub_57(void); +static void BattleAICmd_call(void); +static void BattleAICmd_jump(void); +static void BattleAICmd_end(void); +static void BattleAICmd_if_level_cond(void); +static void BattleAICmd_if_target_taunted(void); +static void BattleAICmd_if_target_not_taunted(void); +static void BattleAICmd_check_ability(void); +static void BattleAICmd_is_of_type(void); +static void BattleAICmd_if_target_is_ally(void); +static void BattleAICmd_if_flash_fired(void); +static void BattleAICmd_if_holds_item(void); + +// ewram + +EWRAM_DATA u8 *gAIScriptPtr = NULL; +EWRAM_DATA static u8 sBank_AI = 0; + +// const rom data typedef void (*BattleAICmdFunc)(void); -extern const BattleAICmdFunc sBattleAICmdTable[]; +static const BattleAICmdFunc sBattleAICmdTable[] = +{ + BattleAICmd_if_random_less_than, // 0x0 + BattleAICmd_if_random_greater_than, // 0x1 + BattleAICmd_if_random_equal, // 0x2 + BattleAICmd_if_random_not_equal, // 0x3 + BattleAICmd_score, // 0x4 + BattleAICmd_if_hp_less_than, // 0x5 + BattleAICmd_if_hp_more_than, // 0x6 + BattleAICmd_if_hp_equal, // 0x7 + BattleAICmd_if_hp_not_equal, // 0x8 + BattleAICmd_if_status, // 0x9 + BattleAICmd_if_not_status, // 0xA + BattleAICmd_if_status2, // 0xB + BattleAICmd_if_not_status2, // 0xC + BattleAICmd_if_status3, // 0xD + BattleAICmd_if_not_status3, // 0xE + BattleAICmd_if_side_affecting, // 0xF + BattleAICmd_if_not_side_affecting, // 0x10 + BattleAICmd_if_less_than, // 0x11 + BattleAICmd_if_more_than, // 0x12 + BattleAICmd_if_equal, // 0x13 + BattleAICmd_if_not_equal, // 0x14 + BattleAICmd_if_less_than_32, // 0x15 + BattleAICmd_if_more_than_32, // 0x16 + BattleAICmd_if_equal_32, // 0x17 + BattleAICmd_if_not_equal_32, // 0x18 + BattleAICmd_if_move, // 0x19 + BattleAICmd_if_not_move, // 0x1A + BattleAICmd_if_in_bytes, // 0x1B + BattleAICmd_if_not_in_bytes, // 0x1C + BattleAICmd_if_in_words, // 0x1D + BattleAICmd_if_not_in_words, // 0x1E + BattleAICmd_if_user_can_damage, // 0x1F + BattleAICmd_if_user_cant_damage, // 0x20 + BattleAICmd_get_turn_count, // 0x21 + BattleAICmd_get_type, // 0x22 + BattleAICmd_get_last_used_bank_move_power, // 0x23 + BattleAICmd_is_most_powerful_move, // 0x24 + BattleAICmd_get_last_used_bank_move, // 0x25 + BattleAICmd_if_arg_equal, // 0x26 + BattleAICmd_if_arg_not_equal, // 0x27 + BattleAICmd_if_would_go_first, // 0x28 + BattleAICmd_if_would_not_go_first, // 0x29 + BattleAICmd_nullsub_2A, // 0x2A + BattleAICmd_nullsub_2B, // 0x2B + BattleAICmd_count_alive_pokemon, // 0x2C + BattleAICmd_get_considered_move, // 0x2D + BattleAICmd_get_considered_move_effect, // 0x2E + BattleAICmd_get_ability, // 0x2F + BattleAICmd_get_highest_type_effectiveness, // 0x30 + BattleAICmd_if_type_effectiveness, // 0x31 + BattleAICmd_nullsub_32, // 0x32 + BattleAICmd_nullsub_33, // 0x33 + BattleAICmd_if_status_in_party, // 0x34 + BattleAICmd_if_status_not_in_party, // 0x35 + BattleAICmd_get_weather, // 0x36 + BattleAICmd_if_effect, // 0x37 + BattleAICmd_if_not_effect, // 0x38 + BattleAICmd_if_stat_level_less_than, // 0x39 + BattleAICmd_if_stat_level_more_than, // 0x3A + BattleAICmd_if_stat_level_equal, // 0x3B + BattleAICmd_if_stat_level_not_equal, // 0x3C + BattleAICmd_if_can_faint, // 0x3D + BattleAICmd_if_cant_faint, // 0x3E + BattleAICmd_if_has_move, // 0x3F + BattleAICmd_if_dont_have_move, // 0x40 + BattleAICmd_if_move_effect, // 0x41 + BattleAICmd_if_not_move_effect, // 0x42 + BattleAICmd_if_any_move_disabled_or_encored, // 0x43 + BattleAICmd_if_curr_move_disabled_or_encored, // 0x44 + BattleAICmd_flee, // 0x45 + BattleAICmd_if_random_100, // 0x46 + BattleAICmd_watch, // 0x47 + BattleAICmd_get_hold_effect, // 0x48 + BattleAICmd_get_gender, // 0x49 + BattleAICmd_is_first_turn, // 0x4A + BattleAICmd_get_stockpile_count, // 0x4B + BattleAICmd_is_double_battle, // 0x4C + BattleAICmd_get_used_held_item, // 0x4D + BattleAICmd_get_move_type_from_result, // 0x4E + BattleAICmd_get_move_power_from_result, // 0x4F + BattleAICmd_get_move_effect_from_result, // 0x50 + BattleAICmd_get_protect_count, // 0x51 + BattleAICmd_nullsub_52, // 0x52 + BattleAICmd_nullsub_53, // 0x53 + BattleAICmd_nullsub_54, // 0x54 + BattleAICmd_nullsub_55, // 0x55 + BattleAICmd_nullsub_56, // 0x56 + BattleAICmd_nullsub_57, // 0x57 + BattleAICmd_call, // 0x58 + BattleAICmd_jump, // 0x59 + BattleAICmd_end, // 0x5A + BattleAICmd_if_level_cond, // 0x5B + BattleAICmd_if_target_taunted, // 0x5C + BattleAICmd_if_target_not_taunted, // 0x5D + BattleAICmd_if_target_is_ally, // 0x5E + BattleAICmd_is_of_type, // 0x5F + BattleAICmd_check_ability, // 0x60 + BattleAICmd_if_flash_fired, // 0x61 + BattleAICmd_if_holds_item, // 0x62 +}; -extern u8 sub_803FECC(); -extern u16 Random(); -extern u8 GetBankSide(); -extern u32 sub_8186438(); -extern u32 sub_81A6FB4(); +static const u16 sDiscouragedPowerfulMoveEffects[] = +{ + EFFECT_EXPLOSION, + EFFECT_DREAM_EATER, + EFFECT_RAZOR_WIND, + EFFECT_SKY_ATTACK, + EFFECT_RECHARGE, + EFFECT_SKULL_BASH, + EFFECT_SOLARBEAM, + EFFECT_SPIT_UP, + EFFECT_FOCUS_PUNCH, + EFFECT_SUPERPOWER, + EFFECT_ERUPTION, + EFFECT_OVERHEAT, + 0xFFFF +}; -void BattleAI_SetupAIData(u8 a); -u8 BattleAI_GetAIActionToUse(void); -u8 sub_8130CF4(void); -void sub_8131074(void); -void BattleAI_DoAIProcessing(void); - -void BattleAI_HandleItemUseBeforeAISetup(u8 a) +void BattleAI_HandleItemUseBeforeAISetup(u8 defaultScoreMoves) { s32 i; - u8 *data = (u8 *)gBattleResources->unk18; - - for (i = 0; (u32)i < 0x54; i++) + u8 *data = (u8 *)gBattleResources->battleHistory; + + for (i = 0; i < sizeof(struct BattleHistory); i++) data[i] = 0; - if ((gBattleTypeFlags & 0x0A7F098A) == 8) + // items are allowed to use in ONLY trainer battles + if ((gBattleTypeFlags & + (BATTLE_TYPE_LINK | BATTLE_TYPE_SAFARI | BATTLE_TYPE_BATTLE_TOWER | + BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_TRAINER | BATTLE_TYPE_FRONTIER + | BATTLE_TYPE_INGAME_PARTNER | BATTLE_TYPE_x2000000 | BATTLE_TYPE_SECRET_BASE)) + == BATTLE_TYPE_TRAINER) { for (i = 0; i < 4; i++) { - if (gTrainers[gUnknown_02038BCA].items[i] != 0) + if (gTrainers[gTrainerBattleOpponent_A].items[i] != 0) { - gBattleResources->unk18->unk48[gBattleResources->unk18->unk50] = gTrainers[gUnknown_02038BCA].items[i]; - gBattleResources->unk18->unk50++; + gBattleResources->battleHistory->TrainerItems[gBattleResources->battleHistory->itemsNo] = gTrainers[gTrainerBattleOpponent_A].items[i]; + gBattleResources->battleHistory->itemsNo++; } } } - - BattleAI_SetupAIData(a); + + BattleAI_SetupAIData(defaultScoreMoves); } -void BattleAI_SetupAIData(u8 a) +void BattleAI_SetupAIData(u8 defaultScoreMoves) { s32 i; u8 *data = (u8 *)AI_THINKING_STRUCT; - u8 r6; + u8 moveLimitations; // clear AI data. - for (i = 0; (u32)i < sizeof(struct AI_ThinkingStruct); i++) + for (i = 0; i < sizeof(struct AI_ThinkingStruct); i++) data[i] = 0; // conditional score reset, unlike Ruby. for (i = 0; i < 4; i++) { - if (a & 1) + if (defaultScoreMoves & 1) AI_THINKING_STRUCT->score[i] = 100; else AI_THINKING_STRUCT->score[i] = 0; - a >>= 1; + defaultScoreMoves >>= 1; } - r6 = sub_803FECC(gActiveBank, 0, 0xFF); + moveLimitations = CheckMoveLimitations(gActiveBank, 0, 0xFF); + // ignore moves that aren't possible to use for (i = 0; i < 4; i++) { - if (gBitTable[i] & r6) + if (gBitTable[i] & moveLimitations) AI_THINKING_STRUCT->score[i] = 0; - AI_THINKING_STRUCT->unk18[i] = 100 - (Random() % 16); + AI_THINKING_STRUCT->simulatedRNG[i] = 100 - (Random() % 16); } - gBattleResources->unk1C->unk20 = 0; - gPlayerMonIndex = gActiveBank; - if (gBattleTypeFlags & 1) + gBattleResources->AI_ScriptsStack->size = 0; + sBank_AI = gActiveBank; + // decide a random target bank in doubles + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { - gBankTarget = (Random() & 2) + ((u32)GetBankSide(gActiveBank) ^ 1); + gBankTarget = (Random() & 2) + (GetBankSide(gActiveBank) ^ 1); if (gAbsentBankFlags & gBitTable[gBankTarget]) gBankTarget ^= 2; } + // in singles there's only one choice else - { - //_08130A60 - gBankTarget = gPlayerMonIndex ^ 1; - } - //_08130A68 - if (gBattleTypeFlags & 0x1000000) - AI_THINKING_STRUCT->aiFlags = sub_8186438(); - else if (gBattleTypeFlags & 0x80) + gBankTarget = sBank_AI ^ 1; + + if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) + AI_THINKING_STRUCT->aiFlags = GetAiScriptsInRecordedBattle(); + else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) AI_THINKING_STRUCT->aiFlags = 0x40000000; - else if (gBattleTypeFlags & 0x400) + else if (gBattleTypeFlags & BATTLE_TYPE_ROAMER) AI_THINKING_STRUCT->aiFlags = 0x20000000; - else if (gBattleTypeFlags & 0x10) + else if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) AI_THINKING_STRUCT->aiFlags = 0x80000000; - else if (gBattleTypeFlags & 0x80000) - AI_THINKING_STRUCT->aiFlags = sub_81A6FB4(); - else if (gBattleTypeFlags & 0x0C3F0900) - AI_THINKING_STRUCT->aiFlags = 7; - else if (gBattleTypeFlags & 0x8000) - AI_THINKING_STRUCT->aiFlags = gTrainers[gUnknown_02038BCA].aiFlags | gTrainers[gUnknown_02038BCC].aiFlags; + else if (gBattleTypeFlags & BATTLE_TYPE_FACTORY) + AI_THINKING_STRUCT->aiFlags = GetAiScriptsInBattleFactory(); + else if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_x4000000 | BATTLE_TYPE_SECRET_BASE)) + AI_THINKING_STRUCT->aiFlags = 7; // the smartest possible set + else if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) + AI_THINKING_STRUCT->aiFlags = gTrainers[gTrainerBattleOpponent_A].aiFlags | gTrainers[gTrainerBattleOpponent_B].aiFlags; else - AI_THINKING_STRUCT->aiFlags = gTrainers[gUnknown_02038BCA].aiFlags; - if (gBattleTypeFlags & 1) - AI_THINKING_STRUCT->aiFlags |= 0x80; + AI_THINKING_STRUCT->aiFlags = gTrainers[gTrainerBattleOpponent_A].aiFlags; + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + AI_THINKING_STRUCT->aiFlags |= 0x80; // act smart in doubles and don't attack your partner } -u8 sub_8130BA4(void) +u8 BattleAI_ChooseMoveOrAction(void) { - u16 r4 = gCurrentMove; + u16 savedCurrentMove = gCurrentMove; u8 ret; - - if (!(gBattleTypeFlags & 1)) - ret = BattleAI_GetAIActionToUse(); - else - ret = sub_8130CF4(); - gCurrentMove = r4; + if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) + ret = BattleAI_ChooseMoveOrAction_Singles(); + else + ret = BattleAI_ChooseMoveOrAction_Doubles(); + + gCurrentMove = savedCurrentMove; return ret; } -u8 BattleAI_GetAIActionToUse(void) +static u8 BattleAI_ChooseMoveOrAction_Singles(void) { u8 currentMoveArray[4]; u8 consideredMoveArray[4]; u8 numOfBestMoves; s32 i; - - sub_8131074(); + + RecordLastUsedMoveByTarget(); while (AI_THINKING_STRUCT->aiFlags != 0) { @@ -342,10 +444,10 @@ u8 BattleAI_GetAIActionToUse(void) AI_THINKING_STRUCT->movesetIndex = 0; } - // special flags for safari watch/flee. - if (AI_THINKING_STRUCT->aiAction & 2) + // special flags for safari + if (AI_THINKING_STRUCT->aiAction & AI_ACTION_FLEE) return 4; - if (AI_THINKING_STRUCT->aiAction & 4) + if (AI_THINKING_STRUCT->aiAction & AI_ACTION_WATCH) return 5; numOfBestMoves = 1; @@ -354,7 +456,7 @@ u8 BattleAI_GetAIActionToUse(void) for (i = 1; i < 4; i++) { - if (gBattleMons[gPlayerMonIndex].moves[i] != 0) // emerald adds an extra move ID check for some reason. + if (gBattleMons[sBank_AI].moves[i] != 0) // emerald adds an extra move ID check for some reason. { // in ruby, the order of these if statements are reversed. if (currentMoveArray[0] == AI_THINKING_STRUCT->score[i]) @@ -374,126 +476,121 @@ u8 BattleAI_GetAIActionToUse(void) } #ifdef NONMATCHING -u8 sub_8130CF4(void) +static u8 BattleAI_ChooseMoveOrAction_Doubles(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 + s32 scriptsToRun; + s16 mostMovePoints; + s16 bestMovePointsForTarget[4]; + s8 mostViableTargetsArray[4]; + u8 actionOrMoveIndex[4]; + u8 mostViableMovesScores[4]; + u8 mostViableMovesIndices[4]; + s32 mostViableTargetsNo; + s32 mostViableMovesNo; + + for (i = 0; i < 4; i++) //08130D14 { - if (i == gPlayerMonIndex || gBattleMons[i].hp == 0) + if (i == sBank_AI || gBattleMons[i].hp == 0) { //_08130D2E - spC[i] = -1; - sp0[i] = -1; + actionOrMoveIndex[i] = -1; + bestMovePointsForTarget[i] = -1; } //_08130D48 else { - if (gBattleTypeFlags & 0x20000) - BattleAI_SetupAIData(gBattleStruct[0x92] >> 4); + if (gBattleTypeFlags & BATTLE_TYPE_PALACE) + BattleAI_SetupAIData(gBattleStruct->field_92 >> 4); else BattleAI_SetupAIData(0xF); //_08130D76 gBankTarget = i; - if ((i & 1) != (gPlayerMonIndex & 1)) - sub_8131074(); + if ((i & 1) != (sBank_AI & 1)) + RecordLastUsedMoveByTarget(); //_08130D90 - AI_THINKING_STRUCT->unk11 = 0; - AI_THINKING_STRUCT->unk1 = 0; - r4 = AI_THINKING_STRUCT->aiFlags; - while (r4 != 0) + AI_THINKING_STRUCT->aiLogicId = 0; + AI_THINKING_STRUCT->movesetIndex = 0; + scriptsToRun = AI_THINKING_STRUCT->aiFlags; + while (scriptsToRun != 0) { - if (r4 & 1) + if (scriptsToRun & 1) { AI_THINKING_STRUCT->aiState = AIState_SettingUp; BattleAI_DoAIProcessing(); } - r4 >>= 1; - AI_THINKING_STRUCT->unk11++; - AI_THINKING_STRUCT->unk1 = 0; + scriptsToRun >>= 1; + AI_THINKING_STRUCT->aiLogicId++; + AI_THINKING_STRUCT->movesetIndex = 0; } //_08130DD8 - if (AI_THINKING_STRUCT->unk10 & 2) - spC[i] = 4; - else if (AI_THINKING_STRUCT->unk10 & 4) - spC[i] = 5; + if (AI_THINKING_STRUCT->aiAction & AI_ACTION_FLEE) + actionOrMoveIndex[i] = 4; + else if (AI_THINKING_STRUCT->aiAction & AI_ACTION_WATCH) + actionOrMoveIndex[i] = 5; else { //_08130E10 - sp10[0] = AI_THINKING_STRUCT->score[0]; - sp14[0] = 0; - r5 = 1; + mostViableMovesScores[0] = AI_THINKING_STRUCT->score[0]; + mostViableMovesIndices[0] = 0; + mostViableMovesNo = 1; for (j = 1; j < 4; j++) { - if (gBattleMons[gPlayerMonIndex].moves[j] != 0) + if (gBattleMons[sBank_AI].moves[j] != 0) { - if (sp10[0] == AI_THINKING_STRUCT->score[j]) + if (mostViableMovesScores[0] == AI_THINKING_STRUCT->score[j]) { - sp10[r5] = AI_THINKING_STRUCT->score[j]; - sp14[r5] = j; - r5++; + mostViableMovesScores[mostViableMovesNo] = AI_THINKING_STRUCT->score[j]; + mostViableMovesIndices[mostViableMovesNo] = j; + mostViableMovesNo++; } - if (sp10[0] < AI_THINKING_STRUCT->score[j]) + if (mostViableMovesScores[0] < AI_THINKING_STRUCT->score[j]) { - sp10[0] = AI_THINKING_STRUCT->score[j]; - sp14[0] = j; - r5 = 1; + mostViableMovesScores[0] = AI_THINKING_STRUCT->score[j]; + mostViableMovesIndices[0] = j; + mostViableMovesNo = 1; } } //_08130E72 } - spC[i] = sp14[Random() % r5]; - //asm("":::"r3"); - sp0[i] = sp10[0]; - if (i == (gPlayerMonIndex ^ 2) && sp0[i] < 100) - sp0[i] = -1; + actionOrMoveIndex[i] = mostViableMovesIndices[Random() % mostViableMovesNo]; + bestMovePointsForTarget[i] = mostViableMovesScores[0]; + + // don't use a move against ally if it has less than 100 pts + if (i == (sBank_AI ^ 2) && bestMovePointsForTarget[i] < 100) + bestMovePointsForTarget[i] = -1; } } //_08130EAE } - - //#define i r5 - - //_08130EC4 - r5_2 = sp0[0]; - sp8[0] = 0; - r4_2 = 1; + + //08130EC4 + mostMovePoints = bestMovePointsForTarget[0]; + mostViableTargetsArray[0] = 0; + mostViableTargetsNo = 1; for (i = 1; i < 4; i++) { //_08130EDA - if (r5_2 == sp0[i]) + if (mostMovePoints == bestMovePointsForTarget[i]) { - sp8[r4_2] = i; - r4_2++; + mostViableTargetsArray[mostViableTargetsNo] = i; + mostViableTargetsNo++; } //_08130EEE - if (r5_2 < sp0[i]) + if (mostMovePoints < bestMovePointsForTarget[i]) { - r5_2 = sp0[i]; - sp8[0] = i; - r4_2 = 1; + mostMovePoints = bestMovePointsForTarget[i]; + mostViableTargetsArray[0] = i; + mostViableTargetsNo = 1; } } - gBankTarget = sp8[Random() % r4_2]; - return spC[gBankTarget]; + gBankTarget = mostViableTargetsArray[Random() % mostViableTargetsNo]; + return actionOrMoveIndex[gBankTarget]; } #else __attribute__((naked)) -u8 sub_8130CF4(void) +static u8 BattleAI_ChooseMoveOrAction_Doubles(void) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ @@ -513,7 +610,7 @@ u8 sub_8130CF4(void) str r1, [sp, 0x20]\n\ mov r10, sp\n\ _08130D14:\n\ - ldr r0, =gPlayerMonIndex\n\ + ldr r0, =sBank_AI\n\ ldrb r0, [r0]\n\ cmp r8, r0\n\ beq _08130D2E\n\ @@ -561,12 +658,12 @@ _08130D76:\n\ movs r1, 0x1\n\ mov r2, r8\n\ ands r2, r1\n\ - ldr r0, =gPlayerMonIndex\n\ + ldr r0, =sBank_AI\n\ ldrb r0, [r0]\n\ ands r1, r0\n\ cmp r2, r1\n\ beq _08130D90\n\ - bl sub_8131074\n\ + bl RecordLastUsedMoveByTarget\n\ _08130D90:\n\ ldr r2, =gBattleResources\n\ ldr r0, [r2]\n\ @@ -639,11 +736,11 @@ _08130E10:\n\ movs r5, 0x1\n\ movs r3, 0x1\n\ adds r6, r1, 0\n\ - ldr r0, =gPlayerMonIndex\n\ + ldr r0, =sBank_AI\n\ ldrb r1, [r0]\n\ movs r0, 0x58\n\ muls r0, r1\n\ - ldr r2, =gUnknown_02024090\n\ + ldr r2, =gBattleMons + 0xC\n\ adds r0, r2\n\ adds r4, r0, 0x2\n\ add r7, sp, 0x14\n\ @@ -700,7 +797,7 @@ _08130E72:\n\ ldrb r2, [r6]\n\ mov r0, r10\n\ strh r2, [r0]\n\ - ldr r0, =gPlayerMonIndex\n\ + ldr r0, =sBank_AI\n\ ldrb r1, [r0]\n\ movs r0, 0x2\n\ eors r0, r1\n\ @@ -788,7 +885,7 @@ _08130EFE:\n\ } #endif -void BattleAI_DoAIProcessing(void) +static void BattleAI_DoAIProcessing(void) { while (AI_THINKING_STRUCT->aiState != AIState_FinishedProcessing) { @@ -797,14 +894,14 @@ void BattleAI_DoAIProcessing(void) case AIState_DoNotProcess: //Needed to match. break; case AIState_SettingUp: - gAIScriptPtr = gUnknown_082DBEF8[AI_THINKING_STRUCT->aiLogicId]; // set AI ptr to logic ID. - if (gBattleMons[gPlayerMonIndex].pp[AI_THINKING_STRUCT->movesetIndex] == 0) + gAIScriptPtr = gBattleAI_ScriptsTable[AI_THINKING_STRUCT->aiLogicId]; // set AI ptr to logic ID. + if (gBattleMons[sBank_AI].pp[AI_THINKING_STRUCT->movesetIndex] == 0) { AI_THINKING_STRUCT->moveConsidered = 0; } else { - AI_THINKING_STRUCT->moveConsidered = gBattleMons[gPlayerMonIndex].moves[AI_THINKING_STRUCT->movesetIndex]; + AI_THINKING_STRUCT->moveConsidered = gBattleMons[sBank_AI].moves[AI_THINKING_STRUCT->movesetIndex]; } AI_THINKING_STRUCT->aiState++; break; @@ -814,70 +911,70 @@ void BattleAI_DoAIProcessing(void) else { AI_THINKING_STRUCT->score[AI_THINKING_STRUCT->movesetIndex] = 0; - AI_THINKING_STRUCT->aiAction |= 1; + AI_THINKING_STRUCT->aiAction |= AI_ACTION_DONE; } - if (AI_THINKING_STRUCT->aiAction & 1) + if (AI_THINKING_STRUCT->aiAction & AI_ACTION_DONE) { AI_THINKING_STRUCT->movesetIndex++; - if (AI_THINKING_STRUCT->movesetIndex < 4 && !(AI_THINKING_STRUCT->aiAction & 8)) + if (AI_THINKING_STRUCT->movesetIndex < 4 && !(AI_THINKING_STRUCT->aiAction & AI_ACTION_DO_NOT_ATTACK)) AI_THINKING_STRUCT->aiState = AIState_SettingUp; else AI_THINKING_STRUCT->aiState++; - AI_THINKING_STRUCT->aiAction &= 0xFE; + AI_THINKING_STRUCT->aiAction &= ~(AI_ACTION_DONE); } break; } } } -void sub_8131074(void) +static void RecordLastUsedMoveByTarget(void) { s32 i; - + for (i = 0; i < 4; i++) { - if (gBattleResources->unk18->unk0[gBankTarget][i] == gUnknown_02024248[gBankTarget]) + if (gBattleResources->battleHistory->usedMoves[gBankTarget].moves[i] == gLastUsedMovesByBanks[gBankTarget]) break; - if (gBattleResources->unk18->unk0[gBankTarget][i] != gUnknown_02024248[gBankTarget] //HACK: This redundant condition is a hack to make the asm match. - && gBattleResources->unk18->unk0[gBankTarget][i] == 0) + if (gBattleResources->battleHistory->usedMoves[gBankTarget].moves[i] != gLastUsedMovesByBanks[gBankTarget] //HACK: This redundant condition is a hack to make the asm match. + && gBattleResources->battleHistory->usedMoves[gBankTarget].moves[i] == 0) { - gBattleResources->unk18->unk0[gBankTarget][i] = gUnknown_02024248[gBankTarget]; + gBattleResources->battleHistory->usedMoves[gBankTarget].moves[i] = gLastUsedMovesByBanks[gBankTarget]; break; } } } -void sub_81310F0(u8 a) +void ClearBankMoveHistory(u8 bank) { s32 i; - + for (i = 0; i < 4; i++) - gBattleResources->unk18->unk0[a][i] = 0; + gBattleResources->battleHistory->usedMoves[bank].moves[i] = 0; } -void RecordAbilityBattle(u8 a, u8 b) +void RecordAbilityBattle(u8 bank, u8 abilityId) { - gBattleResources->unk18->unk40[a] = b; + gBattleResources->battleHistory->abilities[bank] = abilityId; } -void sub_8131130(u8 a) +void ClearBankAbilityHistory(u8 bank) { - gBattleResources->unk18->unk40[a] = 0; + gBattleResources->battleHistory->abilities[bank] = 0; } -void b_history__record_item_x12_of_player(u8 a, u8 b) +void RecordItemEffectBattle(u8 bank, u8 itemEffect) { - gBattleResources->unk18->unk44[a] = b; + gBattleResources->battleHistory->itemEffects[bank] = itemEffect; } -void sub_8131160(u8 a) +void ClearBankItemEffectHistory(u8 bank) { - gBattleResources->unk18->unk44[a] = 0; + gBattleResources->battleHistory->itemEffects[bank] = 0; } -void BattleAICmd_if_random_less_than(void) +static void BattleAICmd_if_random_less_than(void) { u16 random = Random(); @@ -887,7 +984,7 @@ void BattleAICmd_if_random_less_than(void) gAIScriptPtr += 6; } -void BattleAICmd_if_random_greater_than(void) +static void BattleAICmd_if_random_greater_than(void) { u16 random = Random(); @@ -897,7 +994,7 @@ void BattleAICmd_if_random_greater_than(void) gAIScriptPtr += 6; } -void BattleAICmd_if_random_equal(void) +static void BattleAICmd_if_random_equal(void) { u16 random = Random(); @@ -907,7 +1004,7 @@ void BattleAICmd_if_random_equal(void) gAIScriptPtr += 6; } -void BattleAICmd_if_random_not_equal(void) +static void BattleAICmd_if_random_not_equal(void) { u16 random = Random(); @@ -917,7 +1014,7 @@ void BattleAICmd_if_random_not_equal(void) gAIScriptPtr += 6; } -void BattleAICmd_score(void) +static void BattleAICmd_score(void) { AI_THINKING_STRUCT->score[AI_THINKING_STRUCT->movesetIndex] += gAIScriptPtr[1]; // add the result to the array of the move consider's score. @@ -927,12 +1024,12 @@ void BattleAICmd_score(void) gAIScriptPtr += 2; // AI return. } -void BattleAICmd_if_hp_less_than(void) +static void BattleAICmd_if_hp_less_than(void) { u16 index; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; @@ -942,12 +1039,12 @@ void BattleAICmd_if_hp_less_than(void) gAIScriptPtr += 7; } -void BattleAICmd_if_hp_more_than(void) +static void BattleAICmd_if_hp_more_than(void) { u16 index; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; @@ -957,12 +1054,12 @@ void BattleAICmd_if_hp_more_than(void) gAIScriptPtr += 7; } -void BattleAICmd_if_hp_equal(void) +static void BattleAICmd_if_hp_equal(void) { u16 index; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; @@ -972,12 +1069,12 @@ void BattleAICmd_if_hp_equal(void) gAIScriptPtr += 7; } -void BattleAICmd_if_hp_not_equal(void) +static void BattleAICmd_if_hp_not_equal(void) { u16 index; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; @@ -987,13 +1084,13 @@ void BattleAICmd_if_hp_not_equal(void) gAIScriptPtr += 7; } -void BattleAICmd_if_status(void) +static void BattleAICmd_if_status(void) { u16 index; u32 arg; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; @@ -1005,13 +1102,13 @@ void BattleAICmd_if_status(void) gAIScriptPtr += 10; } -void BattleAICmd_if_not_status(void) +static void BattleAICmd_if_not_status(void) { u16 index; u32 arg; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; @@ -1023,13 +1120,13 @@ void BattleAICmd_if_not_status(void) gAIScriptPtr += 10; } -void BattleAICmd_if_status2(void) +static void BattleAICmd_if_status2(void) { u16 index; u32 arg; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; @@ -1041,13 +1138,13 @@ void BattleAICmd_if_status2(void) gAIScriptPtr += 10; } -void BattleAICmd_if_not_status2(void) +static void BattleAICmd_if_not_status2(void) { u16 index; u32 arg; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; @@ -1059,13 +1156,13 @@ void BattleAICmd_if_not_status2(void) gAIScriptPtr += 10; } -void BattleAICmd_if_status3(void) +static void BattleAICmd_if_status3(void) { u16 index; u32 arg; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; @@ -1077,13 +1174,13 @@ void BattleAICmd_if_status3(void) gAIScriptPtr += 10; } -void BattleAICmd_if_not_status3(void) +static void BattleAICmd_if_not_status3(void) { u16 index; u32 arg; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; @@ -1095,45 +1192,45 @@ void BattleAICmd_if_not_status3(void) gAIScriptPtr += 10; } -void BattleAICmd_if_status4(void) +static void BattleAICmd_if_side_affecting(void) { u16 index; u32 arg1, arg2; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; arg1 = GetBankIdentity(index) & 1; arg2 = AIScriptRead32(gAIScriptPtr + 2); - if ((gUnknown_0202428E[arg1] & arg2) != 0) + if ((gSideAffecting[arg1] & arg2) != 0) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); else gAIScriptPtr += 10; } -void BattleAICmd_if_not_status4(void) +static void BattleAICmd_if_not_side_affecting(void) { u16 index; u32 arg1, arg2; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; arg1 = GetBankIdentity(index) & 1; arg2 = AIScriptRead32(gAIScriptPtr + 2); - if ((gUnknown_0202428E[arg1] & arg2) == 0) + if ((gSideAffecting[arg1] & arg2) == 0) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); else gAIScriptPtr += 10; } -void BattleAICmd_if_less_than(void) +static void BattleAICmd_if_less_than(void) { if (AI_THINKING_STRUCT->funcResult < gAIScriptPtr[1]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); @@ -1141,7 +1238,7 @@ void BattleAICmd_if_less_than(void) gAIScriptPtr += 6; } -void BattleAICmd_if_more_than(void) +static void BattleAICmd_if_more_than(void) { if (AI_THINKING_STRUCT->funcResult > gAIScriptPtr[1]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); @@ -1149,7 +1246,7 @@ void BattleAICmd_if_more_than(void) gAIScriptPtr += 6; } -void BattleAICmd_if_equal(void) +static void BattleAICmd_if_equal(void) { if (AI_THINKING_STRUCT->funcResult == gAIScriptPtr[1]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); @@ -1157,7 +1254,7 @@ void BattleAICmd_if_equal(void) gAIScriptPtr += 6; } -void BattleAICmd_if_not_equal(void) +static void BattleAICmd_if_not_equal(void) { if (AI_THINKING_STRUCT->funcResult != gAIScriptPtr[1]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); @@ -1165,7 +1262,7 @@ void BattleAICmd_if_not_equal(void) gAIScriptPtr += 6; } -void BattleAICmd_if_less_than_32(void) +static void BattleAICmd_if_less_than_32(void) { u8 *temp = AIScriptReadPtr(gAIScriptPtr + 1); @@ -1175,7 +1272,7 @@ void BattleAICmd_if_less_than_32(void) gAIScriptPtr += 9; } -void BattleAICmd_if_more_than_32(void) +static void BattleAICmd_if_more_than_32(void) { u8 *temp = AIScriptReadPtr(gAIScriptPtr + 1); @@ -1185,7 +1282,7 @@ void BattleAICmd_if_more_than_32(void) gAIScriptPtr += 9; } -void BattleAICmd_if_equal_32(void) +static void BattleAICmd_if_equal_32(void) { u8 *temp = AIScriptReadPtr(gAIScriptPtr + 1); @@ -1195,7 +1292,7 @@ void BattleAICmd_if_equal_32(void) gAIScriptPtr += 9; } -void BattleAICmd_if_not_equal_32(void) +static void BattleAICmd_if_not_equal_32(void) { u8 *temp = AIScriptReadPtr(gAIScriptPtr + 1); @@ -1205,7 +1302,7 @@ void BattleAICmd_if_not_equal_32(void) gAIScriptPtr += 9; } -void BattleAICmd_if_move(void) +static void BattleAICmd_if_move(void) { u16 move = AIScriptRead16(gAIScriptPtr + 1); @@ -1215,7 +1312,7 @@ void BattleAICmd_if_move(void) gAIScriptPtr += 7; } -void BattleAICmd_if_not_move(void) +static void BattleAICmd_if_not_move(void) { u16 move = AIScriptRead16(gAIScriptPtr + 1); @@ -1225,7 +1322,7 @@ void BattleAICmd_if_not_move(void) gAIScriptPtr += 7; } -void BattleAICmd_if_in_bytes(void) +static void BattleAICmd_if_in_bytes(void) { u8 *ptr = AIScriptReadPtr(gAIScriptPtr + 1); @@ -1241,7 +1338,7 @@ void BattleAICmd_if_in_bytes(void) gAIScriptPtr += 9; } -void BattleAICmd_if_not_in_bytes(void) +static void BattleAICmd_if_not_in_bytes(void) { u8 *ptr = AIScriptReadPtr(gAIScriptPtr + 1); @@ -1257,7 +1354,7 @@ void BattleAICmd_if_not_in_bytes(void) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 5); } -void BattleAICmd_if_in_words(void) +static void BattleAICmd_if_in_words(void) { u16 *ptr = (u16 *)AIScriptReadPtr(gAIScriptPtr + 1); @@ -1273,7 +1370,7 @@ void BattleAICmd_if_in_words(void) gAIScriptPtr += 9; } -void BattleAICmd_if_not_in_words(void) +static void BattleAICmd_if_not_in_words(void) { u16 *ptr = (u16 *)AIScriptReadPtr(gAIScriptPtr + 1); @@ -1289,14 +1386,14 @@ void BattleAICmd_if_not_in_words(void) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 5); } -void BattleAICmd_if_user_can_damage(void) +static void BattleAICmd_if_user_can_damage(void) { s32 i; for (i = 0; i < 4; i++) { - if (gBattleMons[gPlayerMonIndex].moves[i] != 0 - && gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].power != 0) + if (gBattleMons[sBank_AI].moves[i] != 0 + && gBattleMoves[gBattleMons[sBank_AI].moves[i]].power != 0) break; } if (i == 4) @@ -1305,14 +1402,14 @@ void BattleAICmd_if_user_can_damage(void) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); } -void BattleAICmd_if_user_cant_damage(void) +static void BattleAICmd_if_user_cant_damage(void) { s32 i; for (i = 0; i < 4; i++) { - if (gBattleMons[gPlayerMonIndex].moves[i] != 0 - && gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].power != 0) + if (gBattleMons[sBank_AI].moves[i] != 0 + && gBattleMoves[gBattleMons[sBank_AI].moves[i]].power != 0) break; } if (i != 4) @@ -1321,26 +1418,26 @@ void BattleAICmd_if_user_cant_damage(void) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); } -void BattleAICmd_get_turn_count(void) +static void BattleAICmd_get_turn_count(void) { - AI_THINKING_STRUCT->funcResult = gUnknown_03005D10[19]; + AI_THINKING_STRUCT->funcResult = gBattleResults.battleTurnCounter; gAIScriptPtr += 1; } -void BattleAICmd_get_type(void) +static void BattleAICmd_get_type(void) { u8 typeVar = gAIScriptPtr[1]; switch (typeVar) { case 1: // player primary type - AI_THINKING_STRUCT->funcResult = gBattleMons[gPlayerMonIndex].type1; + AI_THINKING_STRUCT->funcResult = gBattleMons[sBank_AI].type1; break; case 0: // enemy primary type AI_THINKING_STRUCT->funcResult = gBattleMons[gBankTarget].type1; break; case 3: // player secondary type - AI_THINKING_STRUCT->funcResult = gBattleMons[gPlayerMonIndex].type2; + AI_THINKING_STRUCT->funcResult = gBattleMons[sBank_AI].type2; break; case 2: // enemy secondary type AI_THINKING_STRUCT->funcResult = gBattleMons[gBankTarget].type2; @@ -1352,28 +1449,27 @@ void BattleAICmd_get_type(void) gAIScriptPtr += 2; } -// util for double battles? whats this doing in the middle of the battle AI macros? -u8 sub_8131E70(u8 index) +static u8 BattleAI_GetWantedBank(u8 index) { switch (index) { - case 1: - return gPlayerMonIndex; - case 0: + case AI_USER: + return sBank_AI; + case AI_TARGET: default: return gBankTarget; - case 3: - return gPlayerMonIndex ^ 2; - case 2: + case AI_USER_PARTNER: + return sBank_AI ^ 2; + case AI_TARGET_PARTNER: return gBankTarget ^ 2; } } -void BattleAICmd_unk_5F(void) +static void BattleAICmd_is_of_type(void) { - u8 index = sub_8131E70(gAIScriptPtr[1]); - - if(gBattleMons[index].type1 == gAIScriptPtr[2] || gBattleMons[index].type2 == gAIScriptPtr[2]) + u8 bank = BattleAI_GetWantedBank(gAIScriptPtr[1]); + + if(gBattleMons[bank].type1 == gAIScriptPtr[2] || gBattleMons[bank].type2 == gAIScriptPtr[2]) { AI_THINKING_STRUCT->funcResult = 1; } @@ -1385,14 +1481,14 @@ void BattleAICmd_unk_5F(void) gAIScriptPtr += 3; } -void BattleAICmd_get_move_power(void) +static void BattleAICmd_get_last_used_bank_move_power(void) { AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power; gAIScriptPtr += 1; } __attribute__((naked)) // not even going to try. if it doesnt match in ruby, it wont match in emerald (yet). -void BattleAICmd_is_most_powerful_move(void) +static void BattleAICmd_is_most_powerful_move(void) { asm(".syntax unified\n\ push {r4-r7,lr}\n\ @@ -1402,7 +1498,7 @@ void BattleAICmd_is_most_powerful_move(void) push {r5-r7}\n\ sub sp, 0x14\n\ movs r3, 0\n\ - ldr r0, =gUnknown_085B09C8\n\ + ldr r0, =sDiscouragedPowerfulMoveEffects\n\ ldrh r1, [r0]\n\ ldr r5, =0x0000ffff\n\ ldr r6, =gBattleMoves\n\ @@ -1417,7 +1513,7 @@ void BattleAICmd_is_most_powerful_move(void) lsls r0, 2\n\ adds r0, r6\n\ ldrb r4, [r0]\n\ - ldr r1, =gUnknown_085B09C8\n\ + ldr r1, =sDiscouragedPowerfulMoveEffects\n\ _08131F76:\n\ ldrh r0, [r1]\n\ cmp r4, r0\n\ @@ -1441,7 +1537,7 @@ _08131F86:\n\ b _08132126\n\ _08131F9C:\n\ lsls r0, r3, 1\n\ - ldr r1, =gUnknown_085B09C8\n\ + ldr r1, =sDiscouragedPowerfulMoveEffects\n\ adds r0, r1\n\ ldrh r3, [r0]\n\ ldr r0, =0x0000ffff\n\ @@ -1449,7 +1545,7 @@ _08131F9C:\n\ beq _08131FAC\n\ b _08132126\n\ _08131FAC:\n\ - ldr r0, =gUnknown_02024400\n\ + ldr r0, =gDynamicBasePower\n\ movs r1, 0\n\ strh r1, [r0]\n\ ldr r0, =gBattleStruct\n\ @@ -1464,14 +1560,14 @@ _08131FAC:\n\ strb r2, [r0]\n\ movs r6, 0\n\ mov r9, r3\n\ - ldr r2, =gUnknown_085B09C8\n\ + ldr r2, =sDiscouragedPowerfulMoveEffects\n\ ldrh r2, [r2]\n\ str r2, [sp, 0x10]\n\ _08131FD0:\n\ movs r3, 0\n\ ldr r5, =gBattleMons\n\ lsls r4, r6, 1\n\ - ldr r7, =gPlayerMonIndex\n\ + ldr r7, =sBank_AI\n\ lsls r0, r6, 2\n\ mov r8, r0\n\ adds r1, r6, 0x1\n\ @@ -1493,7 +1589,7 @@ _08131FD0:\n\ lsls r0, 2\n\ adds r0, r2\n\ ldrb r2, [r0]\n\ - ldr r1, =gUnknown_085B09C8\n\ + ldr r1, =sDiscouragedPowerfulMoveEffects\n\ _08132004:\n\ ldrh r0, [r1]\n\ cmp r2, r0\n\ @@ -1515,7 +1611,7 @@ _08132014:\n\ cmp r0, 0\n\ beq _081320C0\n\ lsls r0, r3, 1\n\ - ldr r2, =gUnknown_085B09C8\n\ + ldr r2, =sDiscouragedPowerfulMoveEffects\n\ adds r0, r2\n\ ldrh r0, [r0]\n\ cmp r0, r9\n\ @@ -1534,11 +1630,11 @@ _08132014:\n\ ldrb r0, [r7]\n\ ldr r4, =gBankTarget\n\ ldrb r1, [r4]\n\ - bl sub_8046E7C\n\ + bl AI_CalcDmg\n\ ldrh r0, [r5]\n\ ldrb r1, [r7]\n\ ldrb r2, [r4]\n\ - bl move_effectiveness_something\n\ + bl TypeCalc\n\ mov r4, sp\n\ add r4, r8\n\ ldr r2, =gBattleMoveDamage\n\ @@ -1635,17 +1731,17 @@ _08132130:\n\ .syntax divided"); } -void BattleAICmd_get_move(void) +static void BattleAICmd_get_last_used_bank_move(void) { - if (gAIScriptPtr[1] == USER) - AI_THINKING_STRUCT->funcResult = gUnknown_02024248[gPlayerMonIndex]; + if (gAIScriptPtr[1] == AI_USER) + AI_THINKING_STRUCT->funcResult = gLastUsedMovesByBanks[sBank_AI]; else - AI_THINKING_STRUCT->funcResult = gUnknown_02024248[gBankTarget]; + AI_THINKING_STRUCT->funcResult = gLastUsedMovesByBanks[gBankTarget]; gAIScriptPtr += 2; } -void BattleAICmd_if_arg_equal(void) +static void BattleAICmd_if_arg_equal(void) { if (gAIScriptPtr[1] == AI_THINKING_STRUCT->funcResult) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); @@ -1653,7 +1749,7 @@ void BattleAICmd_if_arg_equal(void) gAIScriptPtr += 6; } -void BattleAICmd_if_arg_not_equal(void) +static void BattleAICmd_if_arg_not_equal(void) { if (gAIScriptPtr[1] != AI_THINKING_STRUCT->funcResult) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); @@ -1661,41 +1757,41 @@ void BattleAICmd_if_arg_not_equal(void) gAIScriptPtr += 6; } -void BattleAICmd_if_would_go_first(void) +static void BattleAICmd_if_would_go_first(void) { - if (b_first_side(gPlayerMonIndex, gBankTarget, 1) == gAIScriptPtr[1]) + if (b_first_side(sBank_AI, gBankTarget, 1) == gAIScriptPtr[1]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); else gAIScriptPtr += 6; } -void BattleAICmd_if_would_not_go_first(void) +static void BattleAICmd_if_would_not_go_first(void) { - if (b_first_side(gPlayerMonIndex, gBankTarget, 1) != gAIScriptPtr[1]) + if (b_first_side(sBank_AI, gBankTarget, 1) != gAIScriptPtr[1]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); else gAIScriptPtr += 6; } -void BattleAICmd_nullsub_2A(void) +static void BattleAICmd_nullsub_2A(void) { } -void BattleAICmd_nullsub_2B(void) +static void BattleAICmd_nullsub_2B(void) { } -void BattleAICmd_count_alive_pokemon(void) +static void BattleAICmd_count_alive_pokemon(void) { u8 index; - u8 var, var2; + u8 bankOnField1, bankOnField2; struct Pokemon *party; int i; AI_THINKING_STRUCT->funcResult = 0; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; @@ -1707,19 +1803,19 @@ void BattleAICmd_count_alive_pokemon(void) if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { u32 status; - var = gBattlePartyID[index][0]; + bankOnField1 = gBattlePartyID[index]; status = GetBankIdentity(index) ^ 2; - var2 = gBattlePartyID[GetBankByPlayerAI(status)][0]; + bankOnField2 = gBattlePartyID[GetBankByPlayerAI(status)]; } - else + else // in singles there's only one bank by side { - var = gBattlePartyID[index][0]; - var2 = gBattlePartyID[index][0]; + bankOnField1 = gBattlePartyID[index]; + bankOnField2 = gBattlePartyID[index]; } for (i = 0; i < 6; i++) { - if (i != var && i != var2 + if (i != bankOnField1 && i != bankOnField2 && GetMonData(&party[i], MON_DATA_HP) != 0 && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG) @@ -1731,39 +1827,39 @@ void BattleAICmd_count_alive_pokemon(void) gAIScriptPtr += 2; } -void BattleAICmd_get_considered_move(void) +static void BattleAICmd_get_considered_move(void) { AI_THINKING_STRUCT->funcResult = AI_THINKING_STRUCT->moveConsidered; gAIScriptPtr += 1; } -void BattleAICmd_get_considered_move_effect(void) +static void BattleAICmd_get_considered_move_effect(void) { AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect; gAIScriptPtr += 1; } -void BattleAICmd_get_ability(void) +static void BattleAICmd_get_ability(void) { u8 index; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + index = sBank_AI; else index = gBankTarget; if(gActiveBank != index) { - if(UNK_2016A00_STRUCT->unk40[index] != 0) + if(BATTLE_HISTORY->abilities[index] != 0) { - AI_THINKING_STRUCT->funcResult = UNK_2016A00_STRUCT->unk40[index]; + AI_THINKING_STRUCT->funcResult = BATTLE_HISTORY->abilities[index]; gAIScriptPtr += 2; return; } - + // abilities that prevent fleeing. - if (gBattleMons[index].ability == ABILITY_SHADOW_TAG - || gBattleMons[index].ability == ABILITY_MAGNET_PULL + if (gBattleMons[index].ability == ABILITY_SHADOW_TAG + || gBattleMons[index].ability == ABILITY_MAGNET_PULL || gBattleMons[index].ability == ABILITY_ARENA_TRAP) { AI_THINKING_STRUCT->funcResult = gBattleMons[index].ability; @@ -1776,7 +1872,7 @@ void BattleAICmd_get_ability(void) if (gBaseStats[gBattleMons[index].species].ability2 != ABILITY_NONE) { // AI has no knowledge of opponent, so it guesses which ability. - if(Random() & 1) + if (Random() & 1) { AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[index].species].ability1; } @@ -1784,7 +1880,7 @@ void BattleAICmd_get_ability(void) { AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[index].species].ability2; } - } + } else { AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[index].species].ability1; // it's definitely ability 1. @@ -1804,90 +1900,76 @@ void BattleAICmd_get_ability(void) } #ifdef NONMATCHING -void tai60_unk(void) +static void BattleAICmd_check_ability(void) { - u8 index = sub_8131E70(gAIScriptPtr[1]); - u8 arg2 = gAIScriptPtr[2]; - u8 var; - - if(gAIScriptPtr[1] == 0 || gAIScriptPtr[1] == 2) + u8 bank = BattleAI_GetWantedBank(gAIScriptPtr[1]); + u8 ability = gAIScriptPtr[2]; + + if (gAIScriptPtr[1] == AI_TARGET || gAIScriptPtr[1] == AI_TARGET_PARTNER) { - // _0813253A - if(UNK_2016A00_STRUCT->unk40[index] != 0) + if (BATTLE_HISTORY->abilities[bank] != 0) { - var = UNK_2016A00_STRUCT->unk40[index]; - AI_THINKING_STRUCT->funcResult = var; + ability = BATTLE_HISTORY->abilities[bank]; + AI_THINKING_STRUCT->funcResult = ability; } - else + // abilities that prevent fleeing. + else if (gBattleMons[bank].ability == ABILITY_SHADOW_TAG + || gBattleMons[bank].ability == ABILITY_MAGNET_PULL + || gBattleMons[bank].ability == ABILITY_ARENA_TRAP) { - // _0813255C - if (gBattleMons[index].ability == ABILITY_SHADOW_TAG - || gBattleMons[index].ability == ABILITY_MAGNET_PULL - || gBattleMons[index].ability == ABILITY_ARENA_TRAP) + ability = gBattleMons[bank].ability; + } + else if (gBaseStats[gBattleMons[bank].species].ability1 != ABILITY_NONE) + { + if (gBaseStats[gBattleMons[bank].species].ability2 != ABILITY_NONE) { - var = gBattleMons[index].ability; + if (gBaseStats[gBattleMons[bank].species].ability1 != ability + && gBaseStats[gBattleMons[bank].species].ability2 != ability) + { + ability = gBaseStats[gBattleMons[bank].species].ability1; + } + else + ability = 0; } else { - // _08132588 - if (gBaseStats[gBattleMons[index].species].ability1 != ABILITY_NONE) - { - if (gBaseStats[gBattleMons[index].species].ability2 != ABILITY_NONE) - { - if(gBaseStats[gBattleMons[index].species].ability1 != arg2 && gBaseStats[gBattleMons[index].species].ability2 != arg2) - { - var = 2; - } - else - { - var = gBaseStats[gBattleMons[index].species].ability1; - } - } - else - { - // _081325B4 - var = gBaseStats[gBattleMons[index].species].ability1; - } - } - else - { - // _081325B8 - var = gBaseStats[gBattleMons[index].species].ability2; - } + ability = gBaseStats[gBattleMons[bank].species].ability1; } } + else + { + ability = gBaseStats[gBattleMons[bank].species].ability2; // AI cant actually reach this part since every mon has at least 1 ability. + } } else { - // _081325BC - var = gBattleMons[index].ability; + // The AI knows its own or partner's ability. + ability = gBattleMons[bank].ability; } - - // _081325CA - if(var == ABILITY_NONE) + if (ability == 0) { - AI_THINKING_STRUCT->funcResult = 2; + AI_THINKING_STRUCT->funcResult = 2; // unable to answer } - else if(var == arg2) + else if (ability == gAIScriptPtr[2]) { - AI_THINKING_STRUCT->funcResult = 1; + AI_THINKING_STRUCT->funcResult = 1; // pokemon has the ability we wanted to check } else { - AI_THINKING_STRUCT->funcResult = 0; + AI_THINKING_STRUCT->funcResult = 0; // pokemon doesn't have the ability we wanted to check } gAIScriptPtr += 3; } #else __attribute__((naked)) -void tai60_unk(void) +static void BattleAICmd_check_ability(void) { asm(".syntax unified\n\ push {r4-r6,lr}\n\ ldr r4, =gAIScriptPtr\n\ ldr r0, [r4]\n\ ldrb r0, [r0, 0x1]\n\ - bl sub_8131E70\n\ + bl BattleAI_GetWantedBank\n\ lsls r0, 24\n\ lsrs r5, r0, 24\n\ ldr r0, [r4]\n\ @@ -2010,13 +2092,15 @@ _08132608:\n\ } #endif -void BattleAICmd_get_highest_possible_damage(void) +static void BattleAICmd_get_highest_type_effectiveness(void) { s32 i; + u8* dynamicMoveType; - gUnknown_02024400 = 0; - gBattleStruct[0x13] = 0; - gBattleScripting[0xE] = 1; + gDynamicBasePower = 0; + dynamicMoveType = &gBattleStruct->dynamicMoveType; + *dynamicMoveType = 0; + gBattleScripting.dmgMultiplier = 1; gBattleMoveFlags = 0; gCritMultiplier = 1; AI_THINKING_STRUCT->funcResult = 0; @@ -2024,11 +2108,11 @@ void BattleAICmd_get_highest_possible_damage(void) for (i = 0; i < 4; i++) { gBattleMoveDamage = 40; - gCurrentMove = gBattleMons[gPlayerMonIndex].moves[i]; + gCurrentMove = gBattleMons[sBank_AI].moves[i]; if (gCurrentMove) { - move_effectiveness_something(gCurrentMove, gPlayerMonIndex, gBankTarget); + TypeCalc(gCurrentMove, sBank_AI, gBankTarget); // reduce by 1/3. if (gBattleMoveDamage == 120) @@ -2040,7 +2124,7 @@ void BattleAICmd_get_highest_possible_damage(void) if (gBattleMoveDamage == 15) gBattleMoveDamage = 10; - if (gBattleMoveFlags & 8) // if it's a status move, it wont do anything. + if (gBattleMoveFlags & MOVESTATUS_NOTAFFECTED) gBattleMoveDamage = 0; if (AI_THINKING_STRUCT->funcResult < gBattleMoveDamage) @@ -2050,20 +2134,20 @@ void BattleAICmd_get_highest_possible_damage(void) gAIScriptPtr += 1; } -void BattleAICmd_if_damage_bonus(void) +static void BattleAICmd_if_type_effectiveness(void) { u8 damageVar; - gUnknown_02024400 = 0; - gBattleStruct[0x13] = 0; - gBattleScripting[0xE] = 1; + gDynamicBasePower = 0; + gBattleStruct->dynamicMoveType = 0; + gBattleScripting.dmgMultiplier = 1; gBattleMoveFlags = 0; gCritMultiplier = 1; gBattleMoveDamage = 40; gCurrentMove = AI_THINKING_STRUCT->moveConsidered; - move_effectiveness_something(gCurrentMove, gPlayerMonIndex, gBankTarget); + TypeCalc(gCurrentMove, sBank_AI, gBankTarget); if (gBattleMoveDamage == 120) gBattleMoveDamage = 80; @@ -2074,7 +2158,7 @@ void BattleAICmd_if_damage_bonus(void) if (gBattleMoveDamage == 15) gBattleMoveDamage = 10; - if (gBattleMoveFlags & 8) + if (gBattleMoveFlags & MOVESTATUS_NOTAFFECTED) gBattleMoveDamage = 0; // store gBattleMoveDamage in a u8 variable because gAIScriptPtr[1] is a u8. @@ -2086,15 +2170,15 @@ void BattleAICmd_if_damage_bonus(void) gAIScriptPtr += 6; } -void BattleAICmd_nullsub_32(void) +static void BattleAICmd_nullsub_32(void) { } -void BattleAICmd_nullsub_33(void) +static void BattleAICmd_nullsub_33(void) { } -void BattleAICmd_if_status_in_party(void) +static void BattleAICmd_if_status_in_party(void) { struct Pokemon *party; int i; @@ -2104,7 +2188,7 @@ void BattleAICmd_if_status_in_party(void) switch(gAIScriptPtr[1]) { case 1: - index = gPlayerMonIndex; + index = sBank_AI; break; default: index = gBankTarget; @@ -2131,7 +2215,7 @@ void BattleAICmd_if_status_in_party(void) gAIScriptPtr += 10; } -void BattleAICmd_if_status_not_in_party(void) +static void BattleAICmd_if_status_not_in_party(void) { struct Pokemon *party; int i; @@ -2141,7 +2225,7 @@ void BattleAICmd_if_status_not_in_party(void) switch(gAIScriptPtr[1]) { case 1: - index = gPlayerMonIndex; + index = sBank_AI; break; default: index = gBankTarget; @@ -2167,21 +2251,21 @@ void BattleAICmd_if_status_not_in_party(void) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 6); } -void BattleAICmd_get_weather(void) +static void BattleAICmd_get_weather(void) { - if (gBattleWeather & 7) + if (gBattleWeather & WEATHER_RAIN_ANY) AI_THINKING_STRUCT->funcResult = 1; - if (gBattleWeather & 0x18) + if (gBattleWeather & WEATHER_SANDSTORM_ANY) AI_THINKING_STRUCT->funcResult = 2; - if (gBattleWeather & 0x60) + if (gBattleWeather & WEATHER_SUN_ANY) AI_THINKING_STRUCT->funcResult = 0; - if (gBattleWeather & 0x80) + if (gBattleWeather & WEATHER_HAIL_ANY) AI_THINKING_STRUCT->funcResult = 3; gAIScriptPtr += 1; } -void BattleAICmd_if_effect(void) +static void BattleAICmd_if_effect(void) { if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect == gAIScriptPtr[1]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); @@ -2189,7 +2273,7 @@ void BattleAICmd_if_effect(void) gAIScriptPtr += 6; } -void BattleAICmd_if_not_effect(void) +static void BattleAICmd_if_not_effect(void) { if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect != gAIScriptPtr[1]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); @@ -2197,67 +2281,67 @@ void BattleAICmd_if_not_effect(void) gAIScriptPtr += 6; } -void BattleAICmd_if_stat_level_less_than(void) +static void BattleAICmd_if_stat_level_less_than(void) { - u32 party; + u32 bank; - if (gAIScriptPtr[1] == USER) - party = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + bank = sBank_AI; else - party = gBankTarget; + bank = gBankTarget; - if (gBattleMons[party].statStages[gAIScriptPtr[2]] < gAIScriptPtr[3]) + if (gBattleMons[bank].statStages[gAIScriptPtr[2]] < gAIScriptPtr[3]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); else gAIScriptPtr += 8; } -void BattleAICmd_if_stat_level_more_than(void) +static void BattleAICmd_if_stat_level_more_than(void) { - u32 party; + u32 bank; - if (gAIScriptPtr[1] == USER) - party = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + bank = sBank_AI; else - party = gBankTarget; + bank = gBankTarget; - if (gBattleMons[party].statStages[gAIScriptPtr[2]] > gAIScriptPtr[3]) + if (gBattleMons[bank].statStages[gAIScriptPtr[2]] > gAIScriptPtr[3]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); else gAIScriptPtr += 8; } -void BattleAICmd_if_stat_level_equal(void) +static void BattleAICmd_if_stat_level_equal(void) { - u32 party; + u32 bank; - if (gAIScriptPtr[1] == USER) - party = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + bank = sBank_AI; else - party = gBankTarget; + bank = gBankTarget; - if (gBattleMons[party].statStages[gAIScriptPtr[2]] == gAIScriptPtr[3]) + if (gBattleMons[bank].statStages[gAIScriptPtr[2]] == gAIScriptPtr[3]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); else gAIScriptPtr += 8; } -void BattleAICmd_if_stat_level_not_equal(void) +static void BattleAICmd_if_stat_level_not_equal(void) { - u32 party; + u32 bank; - if (gAIScriptPtr[1] == USER) - party = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + bank = sBank_AI; else - party = gBankTarget; + bank = gBankTarget; - if (gBattleMons[party].statStages[gAIScriptPtr[2]] != gAIScriptPtr[3]) + if (gBattleMons[bank].statStages[gAIScriptPtr[2]] != gAIScriptPtr[3]) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); else gAIScriptPtr += 8; } -void BattleAICmd_if_can_faint(void) +static void BattleAICmd_if_can_faint(void) { if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power < 2) { @@ -2265,16 +2349,16 @@ void BattleAICmd_if_can_faint(void) return; } - gUnknown_02024400 = 0; - gBattleStruct[0x13] = 0; - gBattleScripting[0xE] = 1; + gDynamicBasePower = 0; + gBattleStruct->dynamicMoveType = 0; + gBattleScripting.dmgMultiplier = 1; gBattleMoveFlags = 0; gCritMultiplier = 1; gCurrentMove = AI_THINKING_STRUCT->moveConsidered; - sub_8046E7C(gPlayerMonIndex, gBankTarget); - move_effectiveness_something(gCurrentMove, gPlayerMonIndex, gBankTarget); + AI_CalcDmg(sBank_AI, gBankTarget); + TypeCalc(gCurrentMove, sBank_AI, gBankTarget); - gBattleMoveDamage = gBattleMoveDamage * AI_THINKING_STRUCT->unk18[AI_THINKING_STRUCT->movesetIndex] / 100; + gBattleMoveDamage = gBattleMoveDamage * AI_THINKING_STRUCT->simulatedRNG[AI_THINKING_STRUCT->movesetIndex] / 100; // moves always do at least 1 damage. if (gBattleMoveDamage == 0) @@ -2286,7 +2370,7 @@ void BattleAICmd_if_can_faint(void) gAIScriptPtr += 5; } -void BattleAICmd_if_cant_faint(void) +static void BattleAICmd_if_cant_faint(void) { if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power < 2) { @@ -2294,16 +2378,16 @@ void BattleAICmd_if_cant_faint(void) return; } - gUnknown_02024400 = 0; - gBattleStruct[0x13] = 0; - gBattleScripting[0xE] = 1; + gDynamicBasePower = 0; + gBattleStruct->dynamicMoveType = 0; + gBattleScripting.dmgMultiplier = 1; gBattleMoveFlags = 0; gCritMultiplier = 1; gCurrentMove = AI_THINKING_STRUCT->moveConsidered; - sub_8046E7C(gPlayerMonIndex, gBankTarget); - move_effectiveness_something(gCurrentMove, gPlayerMonIndex, gBankTarget); + AI_CalcDmg(sBank_AI, gBankTarget); + TypeCalc(gCurrentMove, sBank_AI, gBankTarget); - gBattleMoveDamage = gBattleMoveDamage * AI_THINKING_STRUCT->unk18[AI_THINKING_STRUCT->movesetIndex] / 100; + gBattleMoveDamage = gBattleMoveDamage * AI_THINKING_STRUCT->simulatedRNG[AI_THINKING_STRUCT->movesetIndex] / 100; // this macro is missing the damage 0 = 1 assumption. @@ -2313,18 +2397,17 @@ void BattleAICmd_if_cant_faint(void) gAIScriptPtr += 5; } -void BattleAICmd_if_has_move(void) +static void BattleAICmd_if_has_move(void) { int i; u16 *temp_ptr = (u16 *)(gAIScriptPtr + 2); - + switch(gAIScriptPtr[1]) { - case 1: - // _08132E42 + case AI_USER: for (i = 0; i < 4; i++) { - if (gBattleMons[gPlayerMonIndex].moves[i] == *temp_ptr) + if (gBattleMons[sBank_AI].moves[i] == *temp_ptr) break; } if (i == 4) @@ -2336,9 +2419,9 @@ void BattleAICmd_if_has_move(void) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); return; - } - case 3: // new to Emerald - if(gBattleMons[gPlayerMonIndex ^ 2].hp == 0) + } + case AI_USER_PARTNER: + if (gBattleMons[sBank_AI ^ 2].hp == 0) { gAIScriptPtr += 8; return; @@ -2347,7 +2430,7 @@ void BattleAICmd_if_has_move(void) { for (i = 0; i < 4; i++) { - if (gBattleMons[gPlayerMonIndex ^ 2].moves[i] == *temp_ptr) + if (gBattleMons[sBank_AI ^ 2].moves[i] == *temp_ptr) break; } } @@ -2360,12 +2443,12 @@ void BattleAICmd_if_has_move(void) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); return; - } - case 0: - case 2: + } + case AI_TARGET: + case AI_TARGET_PARTNER: for (i = 0; i < 4; i++) { - if (UNK_2016A00_STRUCT->unk0[gBankTarget][i] == *temp_ptr) + if (BATTLE_HISTORY->usedMoves[gBankTarget].moves[i] == *temp_ptr) break; } if (i == 4) @@ -2381,18 +2464,18 @@ void BattleAICmd_if_has_move(void) } } -void BattleAICmd_if_dont_have_move(void) +static void BattleAICmd_if_dont_have_move(void) { int i; u16 *temp_ptr = (u16 *)(gAIScriptPtr + 2); - + switch(gAIScriptPtr[1]) { - case 1: - case 3: // if_dont_have_move does not have the seperate 3 case check in Emerald unlike if_has_move. + case AI_USER: + case AI_USER_PARTNER: // UB: no separate check for user partner for (i = 0; i < 4; i++) { - if (gBattleMons[gPlayerMonIndex].moves[i] == *temp_ptr) + if (gBattleMons[sBank_AI].moves[i] == *temp_ptr) break; } if (i != 4) @@ -2405,11 +2488,11 @@ void BattleAICmd_if_dont_have_move(void) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); return; } - case 0: - case 2: + case AI_TARGET: + case AI_TARGET_PARTNER: for (i = 0; i < 4; i++) { - if (UNK_2016A00_STRUCT->unk0[gBankTarget][i] == *temp_ptr) + if (BATTLE_HISTORY->usedMoves[gBankTarget].moves[i] == *temp_ptr) break; } if (i != 4) @@ -2425,17 +2508,17 @@ void BattleAICmd_if_dont_have_move(void) } } -void BattleAICmd_if_move_effect(void) +static void BattleAICmd_if_move_effect(void) { int i; switch (gAIScriptPtr[1]) { - case 1: - case 3: // _08133044 - for(i = 0; i < 4; i++) + case AI_USER: + case AI_USER_PARTNER: + for (i = 0; i < 4; i++) { - if(gBattleMons[gPlayerMonIndex].moves[i] != 0 && gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].effect == gAIScriptPtr[2]) + if(gBattleMons[sBank_AI].moves[i] != 0 && gBattleMoves[gBattleMons[sBank_AI].moves[i]].effect == gAIScriptPtr[2]) break; } if (i == 4) @@ -2443,11 +2526,11 @@ void BattleAICmd_if_move_effect(void) else gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); break; - case 0: - case 2: // _08133090 + case AI_TARGET: + case AI_TARGET_PARTNER: for (i = 0; i < 4; i++) { - if (gBattleMons[gPlayerMonIndex].moves[i] != 0 && gBattleMoves[UNK_2016A00_STRUCT->unk0[gBankTarget][i]].effect == gAIScriptPtr[2]) + if (gBattleMons[sBank_AI].moves[i] != 0 && gBattleMoves[BATTLE_HISTORY->usedMoves[gBankTarget].moves[i]].effect == gAIScriptPtr[2]) break; } if (i == 4) @@ -2458,17 +2541,17 @@ void BattleAICmd_if_move_effect(void) } } -void BattleAICmd_if_not_move_effect(void) +static void BattleAICmd_if_not_move_effect(void) { int i; switch (gAIScriptPtr[1]) { - case 1: - case 3: // _0813313C - for(i = 0; i < 4; i++) + case AI_USER: + case AI_USER_PARTNER: + for (i = 0; i < 4; i++) { - if(gBattleMons[gPlayerMonIndex].moves[i] != 0 && gBattleMoves[gBattleMons[gPlayerMonIndex].moves[i]].effect == gAIScriptPtr[2]) + if(gBattleMons[sBank_AI].moves[i] != 0 && gBattleMoves[gBattleMons[sBank_AI].moves[i]].effect == gAIScriptPtr[2]) break; } if (i != 4) @@ -2476,11 +2559,11 @@ void BattleAICmd_if_not_move_effect(void) else gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); break; - case 0: - case 2: // _08133188 + case AI_TARGET: + case AI_TARGET_PARTNER: for (i = 0; i < 4; i++) { - if (UNK_2016A00_STRUCT->unk0[gBankTarget][i] && gBattleMoves[UNK_2016A00_STRUCT->unk0[gBankTarget][i]].effect == gAIScriptPtr[2]) + if (BATTLE_HISTORY->usedMoves[gBankTarget].moves[i] && gBattleMoves[BATTLE_HISTORY->usedMoves[gBankTarget].moves[i]].effect == gAIScriptPtr[2]) break; } if (i != 4) @@ -2491,18 +2574,18 @@ void BattleAICmd_if_not_move_effect(void) } } -void BattleAICmd_if_last_move_did_damage(void) +static void BattleAICmd_if_any_move_disabled_or_encored(void) { - u8 index; + u8 bank; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + bank = sBank_AI; else - index = gBankTarget; + bank = gBankTarget; if (gAIScriptPtr[2] == 0) { - if (gDisableStructs[index].unk4 == 0) + if (gDisableStructs[bank].disabledMove == 0) { gAIScriptPtr += 7; return; @@ -2515,7 +2598,7 @@ void BattleAICmd_if_last_move_did_damage(void) gAIScriptPtr += 7; return; } - else if (gDisableStructs[index].unk6 != 0) + else if (gDisableStructs[bank].encoredMove != 0) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3); return; @@ -2523,20 +2606,20 @@ void BattleAICmd_if_last_move_did_damage(void) gAIScriptPtr += 7; } -void BattleAICmd_if_encored(void) +static void BattleAICmd_if_curr_move_disabled_or_encored(void) { switch (gAIScriptPtr[1]) { - case 0: // _08109348 - if (gDisableStructs[gActiveBank].unk4 == AI_THINKING_STRUCT->moveConsidered) + case 0: + if (gDisableStructs[gActiveBank].disabledMove == AI_THINKING_STRUCT->moveConsidered) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); return; } gAIScriptPtr += 6; return; - case 1: // _08109370 - if (gDisableStructs[gActiveBank].unk6 == AI_THINKING_STRUCT->moveConsidered) + case 1: + if (gDisableStructs[gActiveBank].encoredMove == AI_THINKING_STRUCT->moveConsidered) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); return; @@ -2549,14 +2632,14 @@ void BattleAICmd_if_encored(void) } } -void BattleAICmd_flee(void) +static void BattleAICmd_flee(void) { - AI_THINKING_STRUCT->aiAction |= (AI_ACTION_UNK1 | AI_ACTION_UNK2 | AI_ACTION_UNK4); // what matters is UNK2 being enabled. + AI_THINKING_STRUCT->aiAction |= (AI_ACTION_DONE | AI_ACTION_FLEE | AI_ACTION_DO_NOT_ATTACK); // what matters is UNK2 being enabled. } -void BattleAICmd_if_random_100(void) +static void BattleAICmd_if_random_100(void) { - u8 safariFleeRate = gBattleStruct[0x7B] * 5; // safari flee rate, from 0-20 + u8 safariFleeRate = gBattleStruct->field_7B * 5; // safari flee rate, from 0-20 if ((u8)(Random() % 100) < safariFleeRate) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); @@ -2564,198 +2647,202 @@ void BattleAICmd_if_random_100(void) gAIScriptPtr += 5; } -void BattleAICmd_watch(void) +static void BattleAICmd_watch(void) { - AI_THINKING_STRUCT->aiAction |= (AI_ACTION_UNK1 | AI_ACTION_UNK3 | AI_ACTION_UNK4); // what matters is UNK3 being enabled. + AI_THINKING_STRUCT->aiAction |= (AI_ACTION_DONE | AI_ACTION_WATCH | AI_ACTION_DO_NOT_ATTACK); // what matters is UNK3 being enabled. } -void BattleAICmd_get_hold_effect(void) +static void BattleAICmd_get_hold_effect(void) { - u8 index; + u8 bank; u16 status; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + bank = sBank_AI; else - index = gBankTarget; + bank = gBankTarget; - if (gActiveBank != index) + if (gActiveBank != bank) { - AI_THINKING_STRUCT->funcResult = ItemId_GetHoldEffect(UNK_2016A00_STRUCT->unk44[index]); + AI_THINKING_STRUCT->funcResult = ItemId_GetHoldEffect(BATTLE_HISTORY->itemEffects[bank]); } else - AI_THINKING_STRUCT->funcResult = ItemId_GetHoldEffect(gBattleMons[index].item); + AI_THINKING_STRUCT->funcResult = ItemId_GetHoldEffect(gBattleMons[bank].item); gAIScriptPtr += 2; } -void tai62_unk(void) +static void BattleAICmd_if_holds_item(void) { - u8 index = sub_8131E70(gAIScriptPtr[1]); + u8 bank = BattleAI_GetWantedBank(gAIScriptPtr[1]); u16 item; u8 var1, var2; - - if((index & 1) == (gPlayerMonIndex & 1)) - item = gBattleMons[index].item; - else - item = UNK_2016A00_STRUCT->unk44[index]; - // strange way of loading a 16-bit argument from the AI command. + if ((bank & 1) == (sBank_AI & 1)) + item = gBattleMons[bank].item; + else + item = BATTLE_HISTORY->itemEffects[bank]; + + // UB: doesn't properly read an unaligned u16 var2 = gAIScriptPtr[2]; var1 = gAIScriptPtr[3]; - - if((var1 | var2) == item) + + if ((var1 | var2) == item) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4); else gAIScriptPtr += 8; } -void BattleAICmd_get_gender(void) +static void BattleAICmd_get_gender(void) { - u8 index; + u8 bank; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + bank = sBank_AI; else - index = gBankTarget; + bank = gBankTarget; - AI_THINKING_STRUCT->funcResult = pokemon_species_get_gender_info(gBattleMons[index].species, gBattleMons[index].personality); + AI_THINKING_STRUCT->funcResult = GetGenderFromSpeciesAndPersonality(gBattleMons[bank].species, gBattleMons[bank].personality); gAIScriptPtr += 2; } -void BattleAICmd_is_first_turn(void) +static void BattleAICmd_is_first_turn(void) { - u8 index; + u8 bank; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + bank = sBank_AI; else - index = gBankTarget; + bank = gBankTarget; - AI_THINKING_STRUCT->funcResult = gDisableStructs[index].unk16; + AI_THINKING_STRUCT->funcResult = gDisableStructs[bank].isFirstTurn; gAIScriptPtr += 2; } -void BattleAICmd_get_stockpile_count(void) +static void BattleAICmd_get_stockpile_count(void) { - u8 index; + u8 bank; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + bank = sBank_AI; else - index = gBankTarget; + bank = gBankTarget; - AI_THINKING_STRUCT->funcResult = gDisableStructs[index].unk9; + AI_THINKING_STRUCT->funcResult = gDisableStructs[bank].stockpileCounter; gAIScriptPtr += 2; } -void BattleAICmd_is_double_battle(void) +static void BattleAICmd_is_double_battle(void) { AI_THINKING_STRUCT->funcResult = gBattleTypeFlags & BATTLE_TYPE_DOUBLE; gAIScriptPtr += 1; } -void BattleAICmd_get_item(void) +static void BattleAICmd_get_used_held_item(void) { - u8 index; + u8 bank; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + bank = sBank_AI; else - index = gBankTarget; + bank = gBankTarget; - // this hack and a half matches. whatever. i dont care. someone else fix this mess later. PS: still cant fix this. - AI_THINKING_STRUCT->funcResult = gBattleStruct[0xB8 + (index * 2)]; + // This is likely a leftover from Ruby's code and its ugly ewram access + #ifdef NONMATCHING + AI_THINKING_STRUCT->funcResult = gBattleStruct->usedHeldItems[bank]; + #else + AI_THINKING_STRUCT->funcResult = *(u8*)((u8*)(gBattleStruct) + 0xB8 + (bank * 2)); + #endif // NONMATCHING gAIScriptPtr += 2; } -void BattleAICmd_get_move_type_from_result(void) +static void BattleAICmd_get_move_type_from_result(void) { AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->funcResult].type; gAIScriptPtr += 1; } -void BattleAICmd_get_move_power_from_result(void) +static void BattleAICmd_get_move_power_from_result(void) { AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->funcResult].power; gAIScriptPtr += 1; } -void BattleAICmd_get_move_effect_from_result(void) +static void BattleAICmd_get_move_effect_from_result(void) { AI_THINKING_STRUCT->funcResult = gBattleMoves[AI_THINKING_STRUCT->funcResult].effect; gAIScriptPtr += 1; } -void BattleAICmd_get_protect_count(void) +static void BattleAICmd_get_protect_count(void) { - u8 index; + u8 bank; - if (gAIScriptPtr[1] == USER) - index = gPlayerMonIndex; + if (gAIScriptPtr[1] == AI_USER) + bank = sBank_AI; else - index = gBankTarget; + bank = gBankTarget; - AI_THINKING_STRUCT->funcResult = gDisableStructs[index].unk8; + AI_THINKING_STRUCT->funcResult = gDisableStructs[bank].protectUses; gAIScriptPtr += 2; } -void BattleAICmd_nullsub_52(void) +static void BattleAICmd_nullsub_52(void) { } -void BattleAICmd_nullsub_53(void) +static void BattleAICmd_nullsub_53(void) { } -void BattleAICmd_nullsub_54(void) +static void BattleAICmd_nullsub_54(void) { } -void BattleAICmd_nullsub_55(void) +static void BattleAICmd_nullsub_55(void) { } -void BattleAICmd_nullsub_56(void) +static void BattleAICmd_nullsub_56(void) { } -void BattleAICmd_nullsub_57(void) +static void BattleAICmd_nullsub_57(void) { } -void BattleAICmd_call(void) +static void BattleAICmd_call(void) { - b_mc_stack_push(gAIScriptPtr + 5); + AIStackPushVar(gAIScriptPtr + 5); gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); } -void BattleAICmd_jump(void) +static void BattleAICmd_jump(void) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); } -void BattleAICmd_end(void) +static void BattleAICmd_end(void) { - if (b_mc_stack_pop_cursor() == 0) - AI_THINKING_STRUCT->aiAction |= AI_ACTION_UNK1; + if (AIStackPop() == 0) + AI_THINKING_STRUCT->aiAction |= AI_ACTION_DONE; } -void BattleAICmd_if_level_cond(void) +static void BattleAICmd_if_level_cond(void) { switch (gAIScriptPtr[1]) { case 0: // greater than - if (gBattleMons[gPlayerMonIndex].level > gBattleMons[gBankTarget].level) + if (gBattleMons[sBank_AI].level > gBattleMons[gBankTarget].level) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); return; @@ -2763,7 +2850,7 @@ void BattleAICmd_if_level_cond(void) gAIScriptPtr += 6; return; case 1: // less than - if (gBattleMons[gPlayerMonIndex].level < gBattleMons[gBankTarget].level) + if (gBattleMons[sBank_AI].level < gBattleMons[gBankTarget].level) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); return; @@ -2771,7 +2858,7 @@ void BattleAICmd_if_level_cond(void) gAIScriptPtr += 6; return; case 2: // equal - if (gBattleMons[gPlayerMonIndex].level == gBattleMons[gBankTarget].level) + if (gBattleMons[sBank_AI].level == gBattleMons[gBankTarget].level) { gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); return; @@ -2781,56 +2868,56 @@ void BattleAICmd_if_level_cond(void) } } -void BattleAICmd_if_taunted(void) +static void BattleAICmd_if_target_taunted(void) { - if (gDisableStructs[gBankTarget].taunt != 0) + if (gDisableStructs[gBankTarget].tauntTimer1 != 0) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); else gAIScriptPtr += 5; } -void BattleAICmd_if_not_taunted(void) +static void BattleAICmd_if_target_not_taunted(void) { - if (gDisableStructs[gBankTarget].taunt == 0) + if (gDisableStructs[gBankTarget].tauntTimer1 == 0) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); else gAIScriptPtr += 5; } -void tai5E_unk(void) +static void BattleAICmd_if_target_is_ally(void) { - if((gPlayerMonIndex & 1) == (gBankTarget & 1)) + if((sBank_AI & 1) == (gBankTarget & 1)) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 1); else gAIScriptPtr += 5; } -void tai61_unk(void) +static void BattleAICmd_if_flash_fired(void) { - u8 index = sub_8131E70(gAIScriptPtr[1]); - - if(UNK_BATTLE_STRUCT->unk4->unkArray[index] & 1) + u8 index = BattleAI_GetWantedBank(gAIScriptPtr[1]); + + if(gBattleResources->flags->flags[index] & UNKNOWN_FLAG_FLASH_FIRE) gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); else gAIScriptPtr += 6; } -void b_mc_stack_push(u8 *var) +static void AIStackPushVar(u8 *var) { - UNK_2016C00_STRUCT->ptr[UNK_2016C00_STRUCT->unk20++] = var; + gBattleResources->AI_ScriptsStack->ptr[gBattleResources->AI_ScriptsStack->size++] = var; } -void b_mc_stack_push_cursor(void) +static void AIStackPushVar_cursor(void) { - UNK_2016C00_STRUCT->ptr[UNK_2016C00_STRUCT->unk20++] = gAIScriptPtr; + gBattleResources->AI_ScriptsStack->ptr[gBattleResources->AI_ScriptsStack->size++] = gAIScriptPtr; } -bool8 b_mc_stack_pop_cursor(void) +static bool8 AIStackPop(void) { - if (UNK_2016C00_STRUCT->unk20 != 0) + if (gBattleResources->AI_ScriptsStack->size != 0) { - --UNK_2016C00_STRUCT->unk20; - gAIScriptPtr = UNK_2016C00_STRUCT->ptr[UNK_2016C00_STRUCT->unk20]; + --gBattleResources->AI_ScriptsStack->size; + gAIScriptPtr = gBattleResources->AI_ScriptsStack->ptr[gBattleResources->AI_ScriptsStack->size]; return TRUE; } else diff --git a/src/bg.c b/src/bg.c new file mode 100644 index 000000000..8979eaecd --- /dev/null +++ b/src/bg.c @@ -0,0 +1,1642 @@ +#include "global.h" +#include "dma3.h" + +#define DISPCNT_ALL_BG_AND_MODE_BITS 0x0F07 + +enum { + BG_CTRL_ATTR_VISIBLE = 1, + BG_CTRL_ATTR_CHARBASEINDEX = 2, + BG_CTRL_ATTR_MAPBASEINDEX = 3, + BG_CTRL_ATTR_SCREENSIZE = 4, + BG_CTRL_ATTR_PALETTEMODE = 5, + BG_CTRL_ATTR_PRIORITY = 6, + BG_CTRL_ATTR_MOSAIC = 7, + BG_CTRL_ATTR_WRAPAROUND = 8, +}; + +struct BgControl { + struct BgConfig { + u16 visible:1; + u16 unknown_1:1; + u16 screenSize:2; + u16 priority:2; + u16 mosaic:1; + u16 wraparound:1; + + u16 charBaseIndex:2; + u16 mapBaseIndex:5; + u16 paletteMode:1; + + u8 unknown_2; + u8 unknown_3; + } configs[4]; + + u16 bgVisibilityAndMode; +}; + +struct BgTemplate { + u32 bg:2; + u32 charBaseIndex:2; + u32 mapBaseIndex:5; + u32 screenSize:2; + u32 paletteMode:1; + u32 priority:2; + u32 baseTile:10; +}; + +struct BgConfig2 { + u32 baseTile:10; + u32 basePalette:4; + u32 unk_3:18; + + void* tilemap; + u32 bg_x; + u32 bg_y; +}; + +static struct BgControl gGpuBgConfigs; +static struct BgConfig2 gGpuBgConfigs2[4]; +static u32 gDmaBusyBitfield[4]; + +u32 gUnneededFireRedVariable; + +static const struct BgConfig gZeroedBgControlStruct = { 0 }; + +extern void SetGpuReg(u8 regOffset, u16 value); +extern void SetGpuReg_ForcedBlank(u8 regOffset, u16 value); +extern u16 GetGpuReg(u8 regOffset); +extern int CheckForSpaceForDma3Request(s16 index); + +bool32 IsInvalidBg32(u8); +void ResetBgControlStructs(); +u16 GetBgMetricTextMode(u8, u8); +u32 GetBgMetricAffineMode(u8, u8); +u32 GetBgType(u8); +void SetTextModeAndHideBgs(); +bool8 IsInvalidBg(u8); +bool32 IsTileMapOutsideWram(u8); +void CopyRectToBgTilemapBufferRect(u8, void*, u8, u8, u8, u8, u8, u8, u8, u8, u8, u16, u16); +void CopyTileMapEntry(u16*, u16*, s32, u32, u32); +u32 GetTileMapIndexFromCoords(s32, s32, s32, u32, u32); +void WriteSequenceToBgTilemapBuffer(u8, u16, u8, u8, u8, u8, u8, s16); + +void ResetBgs(void) +{ + ResetBgControlStructs(); + gGpuBgConfigs.bgVisibilityAndMode = 0; + SetTextModeAndHideBgs(); +} + +void SetBgModeInternal(u8 bgMode) +{ + gGpuBgConfigs.bgVisibilityAndMode &= 0xFFF8; + gGpuBgConfigs.bgVisibilityAndMode |= bgMode; +} + +u8 GetBgMode(void) +{ + return gGpuBgConfigs.bgVisibilityAndMode & 0x7; +} + +void ResetBgControlStructs(void) +{ + struct BgConfig* bgConfigs = &gGpuBgConfigs.configs[0]; + struct BgConfig zeroedConfig = gZeroedBgControlStruct; + int i; + + for (i = 0; i < 4; i++) + { + bgConfigs[i] = zeroedConfig; + } +} + +void Unused_ResetBgControlStruct(u8 bg) +{ + if (IsInvalidBg(bg) == FALSE) + { + gGpuBgConfigs.configs[bg] = gZeroedBgControlStruct; + } +} + +void SetBgControlAttributes(u8 bg, u8 charBaseIndex, u8 mapBaseIndex, u8 screenSize, u8 paletteMode, u8 priority, u8 mosaic, u8 wraparound) +{ + if (IsInvalidBg(bg) == FALSE) + { + if (charBaseIndex != 0xFF) + { + gGpuBgConfigs.configs[bg].charBaseIndex = charBaseIndex & 0x3; + } + + if (mapBaseIndex != 0xFF) + { + gGpuBgConfigs.configs[bg].mapBaseIndex = mapBaseIndex & 0x1F; + } + + if (screenSize != 0xFF) + { + gGpuBgConfigs.configs[bg].screenSize = screenSize & 0x3; + } + + if (paletteMode != 0xFF) + { + gGpuBgConfigs.configs[bg].paletteMode = paletteMode; + } + + if (priority != 0xFF) + { + gGpuBgConfigs.configs[bg].priority = priority & 0x3; + } + + if (mosaic != 0xFF) + { + gGpuBgConfigs.configs[bg].mosaic = mosaic & 0x1; + } + + if (wraparound != 0xFF) + { + gGpuBgConfigs.configs[bg].wraparound = wraparound; + } + + gGpuBgConfigs.configs[bg].unknown_2 = 0; + gGpuBgConfigs.configs[bg].unknown_3 = 0; + + gGpuBgConfigs.configs[bg].visible = 1; + } +} + +u16 GetBgControlAttribute(u8 bg, u8 attributeId) +{ + if (IsInvalidBg(bg) == FALSE && gGpuBgConfigs.configs[bg].visible != FALSE) + { + switch (attributeId) + { + case BG_CTRL_ATTR_VISIBLE: + return gGpuBgConfigs.configs[bg].visible; + case BG_CTRL_ATTR_CHARBASEINDEX: + return gGpuBgConfigs.configs[bg].charBaseIndex; + case BG_CTRL_ATTR_MAPBASEINDEX: + return gGpuBgConfigs.configs[bg].mapBaseIndex; + case BG_CTRL_ATTR_SCREENSIZE: + return gGpuBgConfigs.configs[bg].screenSize; + case BG_CTRL_ATTR_PALETTEMODE: + return gGpuBgConfigs.configs[bg].paletteMode; + case BG_CTRL_ATTR_PRIORITY: + return gGpuBgConfigs.configs[bg].priority; + case BG_CTRL_ATTR_MOSAIC: + return gGpuBgConfigs.configs[bg].mosaic; + case BG_CTRL_ATTR_WRAPAROUND: + return gGpuBgConfigs.configs[bg].wraparound; + } + } + + return 0xFF; +} + +u8 LoadBgVram(u8 bg, void *src, u16 size, u16 destOffset, u8 mode) +{ + u16 offset; + s8 cursor; + + if (IsInvalidBg(bg) == FALSE && gGpuBgConfigs.configs[bg].visible != FALSE) + { + switch (mode) + { + case 0x1: + offset = gGpuBgConfigs.configs[bg].charBaseIndex * BG_CHAR_SIZE; + break; + case 0x2: + offset = gGpuBgConfigs.configs[bg].mapBaseIndex * BG_SCREEN_SIZE; + break; + default: + cursor = -1; + goto end; + } + + offset = destOffset + offset; + + cursor = RequestDma3Copy(src, (void*)(offset + BG_VRAM), size, 0); + + if (cursor == -1) + { + return -1; + } + } + else + { + return -1; + } + +end: + return cursor; +} + +void ShowBgInternal(u8 bg) +{ + u16 value; + if (IsInvalidBg(bg) == FALSE && gGpuBgConfigs.configs[bg].visible != FALSE) + { + value = gGpuBgConfigs.configs[bg].priority | + (gGpuBgConfigs.configs[bg].charBaseIndex << 2) | + (gGpuBgConfigs.configs[bg].mosaic << 6) | + (gGpuBgConfigs.configs[bg].paletteMode << 7) | + (gGpuBgConfigs.configs[bg].mapBaseIndex << 8) | + (gGpuBgConfigs.configs[bg].wraparound << 13) | + (gGpuBgConfigs.configs[bg].screenSize << 14); + + SetGpuReg((bg << 1) + 0x8, value); + + gGpuBgConfigs.bgVisibilityAndMode |= 1 << (bg + 8); + gGpuBgConfigs.bgVisibilityAndMode &= DISPCNT_ALL_BG_AND_MODE_BITS; + } +} + +void HideBgInternal(u8 bg) +{ + if (IsInvalidBg(bg) == FALSE) + { + gGpuBgConfigs.bgVisibilityAndMode &= ~(1 << (bg + 8)); + gGpuBgConfigs.bgVisibilityAndMode &= DISPCNT_ALL_BG_AND_MODE_BITS; + } +} + +void SyncBgVisibilityAndMode() +{ + SetGpuReg(0, (GetGpuReg(0) & ~DISPCNT_ALL_BG_AND_MODE_BITS) | gGpuBgConfigs.bgVisibilityAndMode); +} + +void SetTextModeAndHideBgs() +{ + SetGpuReg(0, GetGpuReg(0) & ~DISPCNT_ALL_BG_AND_MODE_BITS); +} + +void SetBgAffineInternal(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) +{ + struct BgAffineSrcData src; + struct BgAffineDstData dest; + + switch (gGpuBgConfigs.bgVisibilityAndMode & 0x7) + { + case 1: + if (bg != 2) + return; + break; + case 2: + if (bg < 2 || bg > 3) + return; + break; + case 0: + default: + return; + } + + src.texX = srcCenterX; + src.texY = srcCenterY; + src.scrX = dispCenterX; + src.scrY = dispCenterY; + src.sx = scaleX; + src.sy = scaleY; + src.alpha = rotationAngle; + + BgAffineSet(&src, &dest, 1); + + SetGpuReg(REG_OFFSET_BG2PA, dest.pa); + SetGpuReg(REG_OFFSET_BG2PB, dest.pb); + SetGpuReg(REG_OFFSET_BG2PC, dest.pc); + SetGpuReg(REG_OFFSET_BG2PD, dest.pd); + SetGpuReg(REG_OFFSET_BG2PA, dest.pa); + SetGpuReg(REG_OFFSET_BG2X_L, (s16)(dest.dx)); + SetGpuReg(REG_OFFSET_BG2X_H, (s16)(dest.dx >> 16)); + SetGpuReg(REG_OFFSET_BG2Y_L, (s16)(dest.dy)); + SetGpuReg(REG_OFFSET_BG2Y_H, (s16)(dest.dy >> 16)); +} + +bool8 IsInvalidBg(u8 bg) +{ + if (bg > 3) + return TRUE; + return FALSE; +} + +int DummiedOutFireRedLeafGreenTileAllocFunc(int a1, int a2, int a3, int a4) +{ + return 0; +} + +void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable) +{ + int i; + ResetBgs(); + + for (i = 0; i < 4; i++) + { + gDmaBusyBitfield[i] = 0; + } + + gUnneededFireRedVariable = leftoverFireRedLeafGreenVariable; +} + +void InitBgsFromTemplates(u8 bgMode, struct BgTemplate *templates, u8 numTemplates) +{ + int i; + u8 bg; + + SetBgModeInternal(bgMode); + ResetBgControlStructs(); + + for (i = 0; i < numTemplates; i++) + { + bg = templates[i].bg; + if (bg < 4) { + SetBgControlAttributes(bg, + templates[i].charBaseIndex, + templates[i].mapBaseIndex, + templates[i].screenSize, + templates[i].paletteMode, + templates[i].priority, + 0, + 0); + + gGpuBgConfigs2[bg].baseTile = templates[i].baseTile; + gGpuBgConfigs2[bg].basePalette = 0; + gGpuBgConfigs2[bg].unk_3 = 0; + + gGpuBgConfigs2[bg].tilemap = NULL; + gGpuBgConfigs2[bg].bg_x = 0; + gGpuBgConfigs2[bg].bg_y = 0; + } + } +} + +void InitBgFromTemplate(struct BgTemplate *template) +{ + u8 bg = template->bg; + + if (bg < 4) + { + SetBgControlAttributes(bg, + template->charBaseIndex, + template->mapBaseIndex, + template->screenSize, + template->paletteMode, + template->priority, + 0, + 0); + + gGpuBgConfigs2[bg].baseTile = template->baseTile; + gGpuBgConfigs2[bg].basePalette = 0; + gGpuBgConfigs2[bg].unk_3 = 0; + + gGpuBgConfigs2[bg].tilemap = NULL; + gGpuBgConfigs2[bg].bg_x = 0; + gGpuBgConfigs2[bg].bg_y = 0; + } +} + +void SetBgMode(u8 bgMode) +{ + SetBgModeInternal(bgMode); +} + +u16 LoadBgTiles(u8 bg, void* src, u16 size, u16 destOffset) +{ + u16 tileOffset; + u8 cursor; + + if (GetBgControlAttribute(bg, BG_CTRL_ATTR_PALETTEMODE) == 0) + { + tileOffset = (gGpuBgConfigs2[bg].baseTile + destOffset) * 0x20; + } + else + { + tileOffset = (gGpuBgConfigs2[bg].baseTile + destOffset) * 0x40; + } + + cursor = LoadBgVram(bg, src, size, tileOffset, DISPCNT_MODE_1); + + if (cursor == 0xFF) + { + return -1; + } + + gDmaBusyBitfield[cursor / 0x20] |= (1 << (cursor % 0x20)); + + if (gUnneededFireRedVariable == 1) + { + DummiedOutFireRedLeafGreenTileAllocFunc(bg, tileOffset / 0x20, size / 0x20, 1); + } + + return cursor; +} + +u16 LoadBgTilemap(u8 bg, void *src, u16 size, u16 destOffset) +{ + u8 cursor; + + cursor = LoadBgVram(bg, src, size, destOffset * 2, DISPCNT_MODE_2); + + if (cursor == 0xFF) + { + return -1; + } + + gDmaBusyBitfield[cursor / 0x20] |= (1 << (cursor % 0x20)); + + return cursor; +} + +u16 Unused_LoadBgPalette(u8 bg, void *src, u16 size, u16 destOffset) +{ + u16 paletteOffset; + s8 cursor; + + if (IsInvalidBg32(bg) == FALSE) + { + paletteOffset = (gGpuBgConfigs2[bg].basePalette * 0x20) + (destOffset * 2); + cursor = RequestDma3Copy(src, (void*)(paletteOffset + BG_PLTT), size, 0); + + if (cursor == -1) + { + return -1; + } + } + else + { + return -1; + } + + gDmaBusyBitfield[cursor / 0x20] |= (1 << (cursor % 0x20)); + + return (u8)cursor; +} + +#ifdef NONMATCHING // Matches everything but r5 and r6 are flipped, rrr +bool8 IsDma3ManagerBusyWithBgCopy(void) +{ + u8 mod; + u8 div; + s8 reqSpace; + + int i; + + for (i = 0; i < 0x80; i++) + { + div = i / 0x20; + mod = i % 0x20; + + if ((gDmaBusyBitfield[div] & (1 << mod)) != FALSE) + { + reqSpace = CheckForSpaceForDma3Request(i); + if (reqSpace == -1) + { + return TRUE; + } + + gDmaBusyBitfield[div] &= ~(1 << mod); + } + } + + return FALSE; +} +#else +__attribute__((naked)) +bool8 IsDma3ManagerBusyWithBgCopy(void) +{ + asm("push {r4-r7,lr}\n\ + mov r5, #0\n\ + mov r7, #0x1\n\ + neg r7, r7\n\ +_08001ADC:\n\ + add r0, r5, #0\n\ + cmp r5, #0\n\ + bge _08001AE4\n\ + add r0, #0x1F\n\ +_08001AE4:\n\ + asr r0, #5\n\ + lsl r2, r0, #24\n\ + lsl r0, #5\n\ + sub r0, r5, r0\n\ + lsl r0, #24\n\ + lsr r0, #24\n\ + ldr r1, =gDmaBusyBitfield\n\ + lsr r2, #22\n\ + add r4, r2, r1\n\ + mov r6, #0x1\n\ + lsl r6, r0\n\ + ldr r0, [r4]\n\ + and r0, r6\n\ + cmp r0, #0\n\ + beq _08001B22\n\ + lsl r0, r5, #16\n\ + asr r0, #16\n\ + bl CheckForSpaceForDma3Request\n\ + lsl r0, #24\n\ + asr r0, #24\n\ + cmp r0, r7\n\ + bne _08001B1C\n\ + mov r0, #0x1\n\ + b _08001B2A\n\ + .pool\n\ +_08001B1C:\n\ + ldr r0, [r4]\n\ + bic r0, r6\n\ + str r0, [r4]\n\ +_08001B22:\n\ + add r5, #0x1\n\ + cmp r5, #0x7F\n\ + ble _08001ADC\n\ + mov r0, #0\n\ +_08001B2A:\n\ + pop {r4-r7}\n\ + pop {r1}\n\ + bx r1\n"); +} +#endif // NONMATCHING + +void ShowBg(u8 bg) +{ + ShowBgInternal(bg); + SyncBgVisibilityAndMode(); +} + +void HideBg(u8 bg) +{ + HideBgInternal(bg); + SyncBgVisibilityAndMode(); +} + +void SetBgAttribute(u8 bg, u8 attributeId, u8 value) +{ + switch (attributeId) + { + case 1: + SetBgControlAttributes(bg, value, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); + break; + case 2: + SetBgControlAttributes(bg, 0xFF, value, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); + break; + case 3: + SetBgControlAttributes(bg, 0xFF, 0xFF, value, 0xFF, 0xFF, 0xFF, 0xFF); + break; + case 4: + SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, value, 0xFF, 0xFF, 0xFF); + break; + case 7: + SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, 0xFF, value, 0xFF, 0xFF); + break; + case 5: + SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, value, 0xFF); + break; + case 6: + SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, value); + break; + } +} + +u16 GetBgAttribute(u8 bg, u8 attributeId) +{ + switch (attributeId) + { + case 1: + return GetBgControlAttribute(bg, BG_CTRL_ATTR_CHARBASEINDEX); + case 2: + return GetBgControlAttribute(bg, BG_CTRL_ATTR_MAPBASEINDEX); + case 3: + return GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE); + case 4: + return GetBgControlAttribute(bg, BG_CTRL_ATTR_PALETTEMODE); + case 7: + return GetBgControlAttribute(bg, BG_CTRL_ATTR_PRIORITY); + case 5: + return GetBgControlAttribute(bg, BG_CTRL_ATTR_MOSAIC); + case 6: + return GetBgControlAttribute(bg, BG_CTRL_ATTR_WRAPAROUND); + case 8: + switch (GetBgType(bg)) + { + case 0: + return GetBgMetricTextMode(bg, 0) * 0x800; + case 1: + return GetBgMetricAffineMode(bg, 0) * 0x100; + default: + return 0; + } + case 9: + return GetBgType(bg); + case 10: + return gGpuBgConfigs2[bg].baseTile; + default: + return -1; + } +} + +u32 ChangeBgX(u8 bg, u32 value, u8 op) +{ + u8 mode; + u16 temp1; + u16 temp2; + + if (IsInvalidBg32(bg) != FALSE || GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE) == 0) + { + return -1; + } + + switch (op) + { + case 0: + default: + gGpuBgConfigs2[bg].bg_x = value; + break; + case 1: + gGpuBgConfigs2[bg].bg_x += value; + break; + case 2: + gGpuBgConfigs2[bg].bg_x -= value; + break; + } + + mode = GetBgMode(); + + switch (bg) + { + case 0: + temp1 = gGpuBgConfigs2[0].bg_x >> 0x8; + SetGpuReg(REG_OFFSET_BG0HOFS, temp1); + break; + case 1: + temp1 = gGpuBgConfigs2[1].bg_x >> 0x8; + SetGpuReg(REG_OFFSET_BG1HOFS, temp1); + break; + case 2: + if (mode == 0) + { + temp1 = gGpuBgConfigs2[2].bg_x >> 0x8; + SetGpuReg(REG_OFFSET_BG2HOFS, temp1); + } + else + { + temp1 = gGpuBgConfigs2[2].bg_x >> 0x10; + temp2 = gGpuBgConfigs2[2].bg_x & 0xFFFF; + SetGpuReg(REG_OFFSET_BG2X_H, temp1); + SetGpuReg(REG_OFFSET_BG2X_L, temp2); + } + break; + case 3: + if (mode == 0) + { + temp1 = gGpuBgConfigs2[3].bg_x >> 0x8; + SetGpuReg(REG_OFFSET_BG3HOFS, temp1); + } + else if (mode == 2) + { + temp1 = gGpuBgConfigs2[3].bg_x >> 0x10; + temp2 = gGpuBgConfigs2[3].bg_x & 0xFFFF; + SetGpuReg(REG_OFFSET_BG3X_H, temp1); + SetGpuReg(REG_OFFSET_BG3X_L, temp2); + } + break; + } + + return gGpuBgConfigs2[bg].bg_x; +} + +u32 GetBgX(u8 bg) +{ + if (IsInvalidBg32(bg) != FALSE) + return -1; + if (GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE) == 0) + return -1; + return gGpuBgConfigs2[bg].bg_x; +} + +u32 ChangeBgY(u8 bg, u32 value, u8 op) +{ + u8 mode; + u16 temp1; + u16 temp2; + + if (IsInvalidBg32(bg) != FALSE || GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE) == 0) + { + return -1; + } + + switch (op) + { + case 0: + default: + gGpuBgConfigs2[bg].bg_y = value; + break; + case 1: + gGpuBgConfigs2[bg].bg_y += value; + break; + case 2: + gGpuBgConfigs2[bg].bg_y -= value; + break; + } + + mode = GetBgMode(); + + switch (bg) + { + case 0: + temp1 = gGpuBgConfigs2[0].bg_y >> 0x8; + SetGpuReg(REG_OFFSET_BG0VOFS, temp1); + break; + case 1: + temp1 = gGpuBgConfigs2[1].bg_y >> 0x8; + SetGpuReg(REG_OFFSET_BG1VOFS, temp1); + break; + case 2: + if (mode == 0) + { + temp1 = gGpuBgConfigs2[2].bg_y >> 0x8; + SetGpuReg(REG_OFFSET_BG2VOFS, temp1); + } + else + { + temp1 = gGpuBgConfigs2[2].bg_y >> 0x10; + temp2 = gGpuBgConfigs2[2].bg_y & 0xFFFF; + SetGpuReg(REG_OFFSET_BG2Y_H, temp1); + SetGpuReg(REG_OFFSET_BG2Y_L, temp2); + } + break; + case 3: + if (mode == 0) + { + temp1 = gGpuBgConfigs2[3].bg_y >> 0x8; + SetGpuReg(REG_OFFSET_BG3VOFS, temp1); + } + else if (mode == 2) + { + temp1 = gGpuBgConfigs2[3].bg_y >> 0x10; + temp2 = gGpuBgConfigs2[3].bg_y & 0xFFFF; + SetGpuReg(REG_OFFSET_BG3Y_H, temp1); + SetGpuReg(REG_OFFSET_BG3Y_L, temp2); + } + break; + } + + return gGpuBgConfigs2[bg].bg_y; +} + +u32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op) +{ + u8 mode; + u16 temp1; + u16 temp2; + + if (IsInvalidBg32(bg) != FALSE || GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE) == 0) + { + return -1; + } + + switch (op) + { + case 0: + default: + gGpuBgConfigs2[bg].bg_y = value; + break; + case 1: + gGpuBgConfigs2[bg].bg_y += value; + break; + case 2: + gGpuBgConfigs2[bg].bg_y -= value; + break; + } + + mode = GetBgMode(); + + switch (bg) + { + case 0: + temp1 = gGpuBgConfigs2[0].bg_y >> 0x8; + SetGpuReg_ForcedBlank(REG_OFFSET_BG0VOFS, temp1); + break; + case 1: + temp1 = gGpuBgConfigs2[1].bg_y >> 0x8; + SetGpuReg_ForcedBlank(REG_OFFSET_BG1VOFS, temp1); + break; + case 2: + if (mode == 0) + { + temp1 = gGpuBgConfigs2[2].bg_y >> 0x8; + SetGpuReg_ForcedBlank(REG_OFFSET_BG2VOFS, temp1); + + } + else + { + temp1 = gGpuBgConfigs2[2].bg_y >> 0x10; + temp2 = gGpuBgConfigs2[2].bg_y & 0xFFFF; + SetGpuReg_ForcedBlank(REG_OFFSET_BG2Y_H, temp1); + SetGpuReg_ForcedBlank(REG_OFFSET_BG2Y_L, temp2); + } + break; + case 3: + if (mode == 0) + { + temp1 = gGpuBgConfigs2[3].bg_y >> 0x8; + SetGpuReg_ForcedBlank(REG_OFFSET_BG3VOFS, temp1); + } + else if (mode == 2) + { + temp1 = gGpuBgConfigs2[3].bg_y >> 0x10; + temp2 = gGpuBgConfigs2[3].bg_y & 0xFFFF; + SetGpuReg_ForcedBlank(REG_OFFSET_BG3Y_H, temp1); + SetGpuReg_ForcedBlank(REG_OFFSET_BG3Y_L, temp2); + } + break; + } + + return gGpuBgConfigs2[bg].bg_y; +} + +u32 GetBgY(u8 bg) +{ + if (IsInvalidBg32(bg) != FALSE) + return -1; + if (GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE) == 0) + return -1; + return gGpuBgConfigs2[bg].bg_y; +} + +void SetBgAffine(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) +{ + SetBgAffineInternal(bg, srcCenterX, srcCenterY, dispCenterX, dispCenterY, scaleX, scaleY, rotationAngle); +} + +u8 Unused_AdjustBgMosaic(u8 a1, u8 a2) +{ + u16 result; + s16 test1; + s16 test2; + + result = GetGpuReg(REG_OFFSET_MOSAIC); + + test1 = result & 0xF; + test2 = (result >> 4) & 0xF; + result &= 0xFF00; + + switch (a2) + { + case 0: + default: + test1 = a1 & 0xF; + test2 = a1 >> 0x4; + break; + case 1: + test1 = a1 & 0xF; + break; + case 2: + if ((test1 + a1) > 0xF) + { + test1 = 0xF; + } + else + { + test1 += a1; + } + break; + case 3: + if ((test1 - a1) < 0) + { + test1 = 0x0; + } + else + { + test1 -= a1; + } + break; + case 4: + test2 = a1 & 0xF; + break; + case 5: + if ((test2 + a1) > 0xF) + { + test2 = 0xF; + } + else + { + test2 += a1; + } + break; + case 6: + if ((test2 - a1) < 0) + { + test2 = 0x0; + } + else + { + test2 -= a1; + } + break; + } + + result |= ((test2 << 0x4) & 0xF0); + result |= (test1 & 0xF); + + SetGpuReg(REG_OFFSET_MOSAIC, result); + + return result; +} + +void SetBgTilemapBuffer(u8 bg, void *tilemap) +{ + if (IsInvalidBg32(bg) == FALSE && GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE) != 0x0) + { + gGpuBgConfigs2[bg].tilemap = tilemap; + } +} + +void UnsetBgTilemapBuffer(u8 bg) +{ + if (IsInvalidBg32(bg) == FALSE && GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE) != 0x0) + { + gGpuBgConfigs2[bg].tilemap = NULL; + } +} + +void* GetBgTilemapBuffer(u8 bg) +{ + if (IsInvalidBg32(bg) != FALSE) + return NULL; + if (GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE) == 0) + return NULL; + return gGpuBgConfigs2[bg].tilemap; +} + +void CopyToBgTilemapBuffer(u8 bg, void *src, u16 mode, u16 destOffset) +{ + if (IsInvalidBg32(bg) == FALSE && IsTileMapOutsideWram(bg) == FALSE) + { + if (mode != 0) + { + CpuCopy16(src, (void *)(gGpuBgConfigs2[bg].tilemap + (destOffset * 2)), mode); + } + else + { + LZ77UnCompWram(src, (void *)(gGpuBgConfigs2[bg].tilemap + (destOffset * 2))); + } + } +} + +void CopyBgTilemapBufferToVram(u8 bg) +{ + u16 sizeToLoad; + + if (IsInvalidBg32(bg) == FALSE && IsTileMapOutsideWram(bg) == FALSE) + { + switch (GetBgType(bg)) + { + case 0: + sizeToLoad = GetBgMetricTextMode(bg, 0) * 0x800; + break; + case 1: + sizeToLoad = GetBgMetricAffineMode(bg, 0) * 0x100; + break; + default: + sizeToLoad = 0; + break; + } + LoadBgVram(bg, gGpuBgConfigs2[bg].tilemap, sizeToLoad, 0, 2); + } +} + +void CopyToBgTilemapBufferRect(u8 bg, void* src, u8 destX, u8 destY, u8 width, u8 height) +{ + void* srcCopy; + u16 destX16; + u16 destY16; + u16 mode; + + if (IsInvalidBg32(bg) == FALSE && IsTileMapOutsideWram(bg) == FALSE) + { + switch (GetBgType(bg)) + { + case 0: + srcCopy = src; + for (destY16 = destY; destY16 < (destY + height); destY16++) + { + for (destX16 = destX; destX16 < (destX + width); destX16++) + { + ((u16*)gGpuBgConfigs2[bg].tilemap)[((destY16 * 0x20) + destX16)] = *((u16*)srcCopy)++; + } + } + break; + case 1: + srcCopy = src; + mode = GetBgMetricAffineMode(bg, 0x1); + for (destY16 = destY; destY16 < (destY + height); destY16++) + { + for (destX16 = destX; destX16 < (destX + width); destX16++) + { + ((u8*)gGpuBgConfigs2[bg].tilemap)[((destY16 * mode) + destX16)] = *((u8*)srcCopy)++; + } + } + break; + } + } +} + +void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette) +{ + CopyRectToBgTilemapBufferRect(bg, src, 0, 0, rectWidth, rectHeight, destX, destY, rectWidth, rectHeight, palette, 0, 0); +} +// Skipping for now, it probably uses structs passed by value +/* +void CopyRectToBgTilemapBufferRect(u8 bg, void* src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, u16 tileOffset, u16 palette2) +{ + u16 attribute; + u16 mode; + u16 mode2; + + void* srcCopy; + u16 destX16; + u16 destY16; + + if (IsInvalidBg32(bg) == FALSE && IsTileMapOutsideWram(bg) == FALSE) + { + attribute = GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE); + mode = GetBgMetricTextMode(bg, 0x1) * 0x20; + mode2 = GetBgMetricTextMode(bg, 0x2) * 0x20; + switch (GetBgType(bg)) + { + case 0: + srcCopy = src; + for (destY16 = destY; destY16 < (destY + rectHeight); destY16++) + { + for (destX16 = destX; destX16 < (destX + rectWidth); destX16++) + { + CopyTileMapEntry(&((u16*)srcCopy)[(srcY * rectWidth) + srcX], &((u16*)gGpuBgConfigs2[bg].tilemap)[GetTileMapIndexFromCoords(destX16, destY16, attribute, mode, mode2)], palette1, tileOffset, palette2); + } + } + break; + case 1: + srcCopy = src; + mode = GetBgMetricAffineMode(bg, 0x1); + for (destY16 = destY; destY16 < (destY + rectHeight); destY16++) + { + for (destX16 = destX; destX16 < (destX + rectWidth); destX16++) + { + CopyTileMapEntry(&((u16*)srcCopy)[(srcY * rectWidth) + srcX], &((u16*)gGpuBgConfigs2[bg].tilemap)[GetTileMapIndexFromCoords(destX16, destY16, attribute, mode, mode2)], palette1, tileOffset, palette2); + } + } + break; + } + } +}*/ +__attribute__((naked)) +void CopyRectToBgTilemapBufferRect(u8 bg, void* src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, u16 tileOffset, u16 palette2) +{ + asm("push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, #0x40\n\ + str r1, [sp, #0x8]\n\ + ldr r1, [sp, #0x60]\n\ + ldr r4, [sp, #0x68]\n\ + ldr r5, [sp, #0x6C]\n\ + ldr r6, [sp, #0x70]\n\ + ldr r7, [sp, #0x74]\n\ + mov r8, r7\n\ + ldr r7, [sp, #0x78]\n\ + mov r9, r7\n\ + ldr r7, [sp, #0x7C]\n\ + mov r10, r7\n\ + ldr r7, [sp, #0x80]\n\ + mov r12, r7\n\ + lsl r0, #24\n\ + lsr r0, #24\n\ + str r0, [sp, #0x4]\n\ + lsl r2, #24\n\ + lsr r2, #24\n\ + str r2, [sp, #0xC]\n\ + lsl r3, #24\n\ + lsr r3, #24\n\ + str r3, [sp, #0x10]\n\ + lsl r1, #24\n\ + lsr r7, r1, #24\n\ + lsl r4, #24\n\ + lsr r4, #24\n\ + str r4, [sp, #0x14]\n\ + lsl r5, #24\n\ + lsr r5, #24\n\ + lsl r6, #24\n\ + lsr r6, #24\n\ + str r6, [sp, #0x18]\n\ + mov r0, r8\n\ + lsl r0, #24\n\ + lsr r4, r0, #24\n\ + mov r1, r9\n\ + lsl r1, #24\n\ + lsr r1, #24\n\ + str r1, [sp, #0x1C]\n\ + mov r2, r10\n\ + lsl r2, #16\n\ + lsr r2, #16\n\ + str r2, [sp, #0x20]\n\ + mov r0, r12\n\ + lsl r0, #16\n\ + lsr r0, #16\n\ + str r0, [sp, #0x24]\n\ + ldr r0, [sp, #0x4]\n\ + bl IsInvalidBg32\n\ + cmp r0, #0\n\ + beq _08002592\n\ + b _080026EE\n\ +_08002592:\n\ + ldr r0, [sp, #0x4]\n\ + bl IsTileMapOutsideWram\n\ + cmp r0, #0\n\ + beq _0800259E\n\ + b _080026EE\n\ +_0800259E:\n\ + ldr r0, [sp, #0x4]\n\ + mov r1, #0x4\n\ + bl GetBgControlAttribute\n\ + lsl r0, #16\n\ + lsr r0, #16\n\ + str r0, [sp, #0x30]\n\ + ldr r0, [sp, #0x4]\n\ + mov r1, #0x1\n\ + bl GetBgMetricTextMode\n\ + lsl r0, #21\n\ + lsr r0, #16\n\ + str r0, [sp, #0x28]\n\ + ldr r0, [sp, #0x4]\n\ + mov r1, #0x2\n\ + bl GetBgMetricTextMode\n\ + lsl r0, #21\n\ + lsr r0, #16\n\ + str r0, [sp, #0x2C]\n\ + ldr r0, [sp, #0x4]\n\ + bl GetBgType\n\ + cmp r0, #0\n\ + beq _080025D8\n\ + cmp r0, #0x1\n\ + beq _08002674\n\ + b _080026EE\n\ +_080025D8:\n\ + ldr r1, [sp, #0x10]\n\ + add r0, r1, #0\n\ + mul r0, r7\n\ + ldr r2, [sp, #0xC]\n\ + add r0, r2\n\ + lsl r0, #1\n\ + ldr r1, [sp, #0x8]\n\ + add r6, r1, r0\n\ + add r0, r5, r4\n\ + cmp r5, r0\n\ + blt _080025F0\n\ + b _080026EE\n\ +_080025F0:\n\ + ldr r2, [sp, #0x18]\n\ + sub r2, r7, r2\n\ + str r2, [sp, #0x34]\n\ + str r0, [sp, #0x38]\n\ +_080025F8:\n\ + ldr r4, [sp, #0x14]\n\ + ldr r7, [sp, #0x18]\n\ + add r0, r4, r7\n\ + add r1, r5, #0x1\n\ + str r1, [sp, #0x3C]\n\ + cmp r4, r0\n\ + bge _0800265A\n\ + ldr r2, [sp, #0x4]\n\ + lsl r0, r2, #4\n\ + ldr r1, =gGpuBgConfigs2+4\n\ + add r0, r1\n\ + mov r10, r0\n\ + ldr r7, [sp, #0x20]\n\ + lsl r7, #16\n\ + mov r9, r7\n\ + ldr r1, [sp, #0x24]\n\ + lsl r0, r1, #16\n\ + asr r0, #16\n\ + mov r8, r0\n\ +_0800261E:\n\ + ldr r2, [sp, #0x2C]\n\ + str r2, [sp]\n\ + add r0, r4, #0\n\ + add r1, r5, #0\n\ + ldr r2, [sp, #0x30]\n\ + ldr r3, [sp, #0x28]\n\ + bl GetTileMapIndexFromCoords\n\ + lsl r0, #16\n\ + lsr r0, #15\n\ + mov r7, r10\n\ + ldr r1, [r7]\n\ + add r1, r0\n\ + mov r0, r8\n\ + str r0, [sp]\n\ + add r0, r6, #0\n\ + ldr r2, [sp, #0x1C]\n\ + mov r7, r9\n\ + asr r3, r7, #16\n\ + bl CopyTileMapEntry\n\ + add r6, #0x2\n\ + add r0, r4, #0x1\n\ + lsl r0, #16\n\ + lsr r4, r0, #16\n\ + ldr r1, [sp, #0x14]\n\ + ldr r2, [sp, #0x18]\n\ + add r0, r1, r2\n\ + cmp r4, r0\n\ + blt _0800261E\n\ +_0800265A:\n\ + ldr r5, [sp, #0x34]\n\ + lsl r0, r5, #1\n\ + add r6, r0\n\ + ldr r7, [sp, #0x3C]\n\ + lsl r0, r7, #16\n\ + lsr r5, r0, #16\n\ + ldr r0, [sp, #0x38]\n\ + cmp r5, r0\n\ + blt _080025F8\n\ + b _080026EE\n\ + .pool\n\ +_08002674:\n\ + ldr r1, [sp, #0x10]\n\ + add r0, r1, #0\n\ + mul r0, r7\n\ + ldr r2, [sp, #0xC]\n\ + add r0, r2\n\ + ldr r1, [sp, #0x8]\n\ + add r6, r1, r0\n\ + ldr r0, [sp, #0x4]\n\ + mov r1, #0x1\n\ + bl GetBgMetricAffineMode\n\ + lsl r0, #16\n\ + lsr r0, #16\n\ + mov r9, r0\n\ + add r0, r5, r4\n\ + cmp r5, r0\n\ + bge _080026EE\n\ + ldr r2, [sp, #0x18]\n\ + sub r2, r7, r2\n\ + str r2, [sp, #0x34]\n\ + str r0, [sp, #0x38]\n\ + ldr r7, =gGpuBgConfigs2+4\n\ + mov r10, r7\n\ + ldr r0, [sp, #0x4]\n\ + lsl r0, #4\n\ + mov r8, r0\n\ +_080026A8:\n\ + ldr r4, [sp, #0x14]\n\ + ldr r1, [sp, #0x18]\n\ + add r0, r4, r1\n\ + add r2, r5, #0x1\n\ + str r2, [sp, #0x3C]\n\ + cmp r4, r0\n\ + bge _080026DE\n\ + mov r3, r8\n\ + add r3, r10\n\ + mov r7, r9\n\ + mul r7, r5\n\ + mov r12, r7\n\ + add r2, r0, #0\n\ +_080026C2:\n\ + ldr r1, [r3]\n\ + mov r5, r12\n\ + add r0, r5, r4\n\ + add r1, r0\n\ + ldrb r0, [r6]\n\ + ldr r7, [sp, #0x20]\n\ + add r0, r7\n\ + strb r0, [r1]\n\ + add r6, #0x1\n\ + add r0, r4, #0x1\n\ + lsl r0, #16\n\ + lsr r4, r0, #16\n\ + cmp r4, r2\n\ + blt _080026C2\n\ +_080026DE:\n\ + ldr r0, [sp, #0x34]\n\ + add r6, r0\n\ + ldr r1, [sp, #0x3C]\n\ + lsl r0, r1, #16\n\ + lsr r5, r0, #16\n\ + ldr r2, [sp, #0x38]\n\ + cmp r5, r2\n\ + blt _080026A8\n\ +_080026EE:\n\ + add sp, #0x40\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n"); +} + +void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height) +{ + u16 x16; + u16 y16; + u16 mode; + + if (IsInvalidBg32(bg) == FALSE && IsTileMapOutsideWram(bg) == FALSE) + { + switch (GetBgType(bg)) + { + case 0: + for (y16 = y; y16 < (y + height); y16++) + { + for (x16 = x; x16 < (x + width); x16++) + { + ((u16*)gGpuBgConfigs2[bg].tilemap)[((y16 * 0x20) + x16)] = tileNum; + } + } + break; + case 1: + mode = GetBgMetricAffineMode(bg, 0x1); + for (y16 = y; y16 < (y + height); y16++) + { + for (x16 = x; x16 < (x + width); x16++) + { + ((u8*)gGpuBgConfigs2[bg].tilemap)[((y16 * mode) + x16)] = tileNum; + } + } + break; + } + } +} + +void FillBgTilemapBufferRect(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height, u8 palette) +{ + WriteSequenceToBgTilemapBuffer(bg, tileNum, x, y, width, height, palette, 0); +} + +void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot, s16 tileNumDelta) +{ + u16 mode; + u16 mode2; + u16 attribute; + u16 mode3; + + u16 x16; + u16 y16; + + if (IsInvalidBg32(bg) == FALSE && IsTileMapOutsideWram(bg) == FALSE) + { + attribute = GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE); + mode = GetBgMetricTextMode(bg, 0x1) * 0x20; + mode2 = GetBgMetricTextMode(bg, 0x2) * 0x20; + switch (GetBgType(bg)) + { + case 0: + for (y16 = y; y16 < (y + height); y16++) + { + for (x16 = x; x16 < (x + width); x16++) + { + CopyTileMapEntry(&firstTileNum, &((u16*)gGpuBgConfigs2[bg].tilemap)[(u16)GetTileMapIndexFromCoords(x16, y16, attribute, mode, mode2)], paletteSlot, 0, 0); + firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & 0x3FF); + } + } + break; + case 1: + mode3 = GetBgMetricAffineMode(bg, 0x1); + for (y16 = y; y16 < (y + height); y16++) + { + for (x16 = x; x16 < (x + width); x16++) + { + ((u8*)gGpuBgConfigs2[bg].tilemap)[(y16 * mode3) + x16] = firstTileNum; + firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & 0x3FF); + } + } + break; + } + } +} + +u16 GetBgMetricTextMode(u8 bg, u8 whichMetric) +{ + u8 attribute; + + attribute = GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE); + + switch (whichMetric) + { + case 0: + switch (attribute) + { + case 0: + return 1; + case 1: + case 2: + return 2; + case 3: + return 4; + } + break; + case 1: + switch (attribute) + { + case 0: + return 1; + case 1: + return 2; + case 2: + return 1; + case 3: + return 2; + } + break; + case 2: + switch (attribute) + { + case 0: + case 1: + return 1; + case 2: + case 3: + return 2; + } + break; + } + return 0; +} + +u32 GetBgMetricAffineMode(u8 bg, u8 whichMetric) +{ + u8 attribute; + + attribute = GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE); + + switch (whichMetric) + { + case 0: + switch (attribute) + { + case 0: + return 0x1; + case 1: + return 0x4; + case 2: + return 0x10; + case 3: + return 0x40; + } + break; + case 1: + case 2: + return 0x10 << attribute; + } + return 0; +} + +u32 GetTileMapIndexFromCoords(s32 x, s32 y, s32 screenSize, u32 screenWidth, u32 screenHeight) +{ + x = x & (screenWidth - 1); + y = y & (screenHeight - 1); + + switch (screenSize) + { + case 0: + case 2: + break; + case 3: + if (y >= 0x20) + y += 0x20; + case 1: + if (x >= 0x20) + { + x -= 0x20; + y += 0x20; + } + } + return (y * 0x20) + x; +} + +#ifdef NONMATCHING // This one has some weird switch statement cases that refuse to cooperate +void CopyTileMapEntry(u16 *src, u16 *dest, s32 palette1, u32 tileOffset, u32 palette2) +{ + u16 test; + switch (palette1) + { + default: + if (palette1 > 0x10 || palette1 < 0) + test = *src + tileOffset + (palette2 << 12); + else + test = ((*src + tileOffset) & 0xFFF) + ((palette1 + palette2) << 12); + break; + case 0x10: + test = ((*dest & 0xFC00) + (palette2 << 12)) | ((*src + tileOffset) & 0x3FF); + break; + } + + *dest = test; +} +#else +__attribute__((naked)) +void CopyTileMapEntry(u16 *src, u16 *dest, s32 palette1, u32 tileOffset, u32 palette2) +{ + asm("push {r4-r6,lr}\n\ + add r4, r0, #0\n\ + add r6, r1, #0\n\ + ldr r5, [sp, #0x10]\n\ + cmp r2, #0x10\n\ + beq _08002B14\n\ + cmp r2, #0x10\n\ + bgt _08002B34\n\ + cmp r2, #0\n\ + blt _08002B34\n\ + ldrh r0, [r4]\n\ + add r0, r3\n\ + ldr r3, =0x00000fff\n\ + add r1, r3, #0\n\ + and r0, r1\n\ + add r1, r2, r5\n\ + lsl r1, #12\n\ + b _08002B3A\n\ + .pool\n\ +_08002B14:\n\ + ldrh r1, [r6]\n\ + mov r0, #0xFC\n\ + lsl r0, #8\n\ + and r1, r0\n\ + lsl r2, r5, #12\n\ + add r2, r1, r2\n\ + ldrh r0, [r4]\n\ + add r0, r3\n\ + ldr r3, =0x000003ff\n\ + add r1, r3, #0\n\ + and r0, r1\n\ + orr r0, r2\n\ + b _08002B3C\n\ + .pool\n\ +_08002B34:\n\ + ldrh r0, [r4]\n\ + add r0, r3\n\ + lsl r1, r5, #12\n\ +_08002B3A:\n\ + add r0, r1\n\ +_08002B3C:\n\ + lsl r0, #16\n\ + lsr r1, r0, #16\n\ + strh r1, [r6]\n\ + pop {r4-r6}\n\ + pop {r0}\n\ + bx r0\n"); +} +#endif // NONMATCHING + +u32 GetBgType(u8 bg) +{ + u8 mode; + + mode = GetBgMode(); + + + switch (bg) + { + case 0: + case 1: + switch (mode) + { + case 0: + case 1: + return 0; + } + break; + case 2: + switch (mode) + { + case 0: + return 0; + case 1: + case 2: + return 1; + } + break; + case 3: + switch (mode) + { + case 0: + return 0; + case 2: + return 1; + } + break; + } + + return 0xFFFF; +} + +bool32 IsInvalidBg32(u8 bg) +{ + if (bg > 3) + return TRUE; + return FALSE; +} + +bool32 IsTileMapOutsideWram(u8 bg) +{ + if (gGpuBgConfigs2[bg].tilemap > (void*)IWRAM_END) + return TRUE; + if (gGpuBgConfigs2[bg].tilemap == 0x0) + return TRUE; + return FALSE; +} diff --git a/src/calculate_base_damage.c b/src/calculate_base_damage.c new file mode 100644 index 000000000..105b334f2 --- /dev/null +++ b/src/calculate_base_damage.c @@ -0,0 +1,284 @@ +#include "global.h" +#include "abilities.h" +#include "battle.h" +#include "hold_effects.h" +#include "event_data.h" +#include "item.h" +#include "items.h" +#include "pokemon.h" +#include "species.h" +#include "moves.h" +#include "battle_move_effects.h" + +extern u32 gBattleTypeFlags; +extern struct BattlePokemon gBattleMons[4]; +extern u16 gCurrentMove; +extern u8 gCritMultiplier; +extern u16 gBattleWeather; +extern struct BattleEnigmaBerry gEnigmaBerries[]; +extern u16 gBattleMovePower; +extern u16 gTrainerBattleOpponent_A; + +u8 CountAliveMonsInBattle(u8); +bool8 ShouldGetStatBadgeBoost(u16 flagId, u8 bank); + +extern const struct BattleMove gBattleMoves[]; +extern const u8 gHoldEffectToType[][2]; +extern const u8 gStatStageRatios[][2]; + +#define APPLY_STAT_MOD(var, mon, stat, statIndex) \ +{ \ + (var) = (stat) * (gStatStageRatios)[(mon)->statStages[(statIndex)]][0]; \ + (var) /= (gStatStageRatios)[(mon)->statStages[(statIndex)]][1]; \ +} + +s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 bankAtk, u8 bankDef) +{ + u32 i; + s32 damage = 0; + s32 damageHelper; + u8 type; + u16 attack, defense; + u16 spAttack, spDefense; + u8 defenderHoldEffect; + u8 defenderHoldEffectParam; + u8 attackerHoldEffect; + u8 attackerHoldEffectParam; + + if (!powerOverride) + gBattleMovePower = gBattleMoves[move].power; + else + gBattleMovePower = powerOverride; + + if (!typeOverride) + type = gBattleMoves[move].type; + else + type = typeOverride & 0x3F; + + attack = attacker->attack; + defense = defender->defense; + spAttack = attacker->spAttack; + spDefense = defender->spDefense; + + if (attacker->item == ITEM_ENIGMA_BERRY) + { + attackerHoldEffect = gEnigmaBerries[bankAtk].holdEffect; + attackerHoldEffectParam = gEnigmaBerries[bankAtk].holdEffectParam; + } + else + { + attackerHoldEffect = ItemId_GetHoldEffect(attacker->item); + attackerHoldEffectParam = ItemId_GetHoldEffectParam(attacker->item); + } + + if (defender->item == ITEM_ENIGMA_BERRY) + { + defenderHoldEffect = gEnigmaBerries[bankDef].holdEffect; + defenderHoldEffectParam = gEnigmaBerries[bankDef].holdEffectParam; + } + else + { + defenderHoldEffect = ItemId_GetHoldEffect(defender->item); + defenderHoldEffectParam = ItemId_GetHoldEffectParam(defender->item); + } + + if (attacker->ability == ABILITY_HUGE_POWER || attacker->ability == ABILITY_PURE_POWER) + attack *= 2; + + if (ShouldGetStatBadgeBoost(BADGE01_GET, bankAtk)) + attack = (110 * attack) / 100; + if (ShouldGetStatBadgeBoost(BADGE05_GET, bankDef)) + defense = (110 * defense) / 100; + if (ShouldGetStatBadgeBoost(BADGE07_GET, bankAtk)) + spAttack = (110 * spAttack) / 100; + if (ShouldGetStatBadgeBoost(BADGE07_GET, bankDef)) + spDefense = (110 * spDefense) / 100; + + for (i = 0; i < 17; i++) + { + if (attackerHoldEffect == gHoldEffectToType[i][0] + && type == gHoldEffectToType[i][1]) + { + if (type <= 8) + attack = (attack * (attackerHoldEffectParam + 100)) / 100; + else + spAttack = (spAttack * (attackerHoldEffectParam + 100)) / 100; + break; + } + } + + if (attackerHoldEffect == HOLD_EFFECT_CHOICE_BAND) + attack = (150 * attack) / 100; + if (attackerHoldEffect == HOLD_EFFECT_SOUL_DEW && !(gBattleTypeFlags & (BATTLE_TYPE_FRONTIER)) && (attacker->species == SPECIES_LATIAS || attacker->species == SPECIES_LATIOS)) + spAttack = (150 * spAttack) / 100; + if (defenderHoldEffect == HOLD_EFFECT_SOUL_DEW && !(gBattleTypeFlags & (BATTLE_TYPE_FRONTIER)) && (defender->species == SPECIES_LATIAS || defender->species == SPECIES_LATIOS)) + spDefense = (150 * spDefense) / 100; + if (attackerHoldEffect == HOLD_EFFECT_DEEP_SEA_TOOTH && attacker->species == SPECIES_CLAMPERL) + spAttack *= 2; + if (defenderHoldEffect == HOLD_EFFECT_DEEP_SEA_SCALE && defender->species == SPECIES_CLAMPERL) + spDefense *= 2; + if (attackerHoldEffect == HOLD_EFFECT_LIGHT_BALL && attacker->species == SPECIES_PIKACHU) + spAttack *= 2; + if (defenderHoldEffect == HOLD_EFFECT_METAL_POWDER && defender->species == SPECIES_DITTO) + defense *= 2; + if (attackerHoldEffect == HOLD_EFFECT_THICK_CLUB && (attacker->species == SPECIES_CUBONE || attacker->species == SPECIES_MAROWAK)) + attack *= 2; + if (defender->ability == ABILITY_THICK_FAT && (type == TYPE_FIRE || type == TYPE_ICE)) + spAttack /= 2; + if (attacker->ability == ABILITY_HUSTLE) + attack = (150 * attack) / 100; + if (attacker->ability == ABILITY_PLUS && AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_MINUS, 0, 0)) + spAttack = (150 * spAttack) / 100; + if (attacker->ability == ABILITY_MINUS && AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_PLUS, 0, 0)) + spAttack = (150 * spAttack) / 100; + if (attacker->ability == ABILITY_GUTS && attacker->status1) + attack = (150 * attack) / 100; + if (defender->ability == ABILITY_MARVEL_SCALE && defender->status1) + defense = (150 * defense) / 100; + if (type == TYPE_ELECTRIC && AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, 0, 0xFD, 0)) + gBattleMovePower /= 2; + if (type == TYPE_FIRE && AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, 0, 0xFE, 0)) + gBattleMovePower /= 2; + if (type == TYPE_GRASS && attacker->ability == ABILITY_OVERGROW && attacker->hp <= (attacker->maxHP / 3)) + gBattleMovePower = (150 * gBattleMovePower) / 100; + if (type == TYPE_FIRE && attacker->ability == ABILITY_BLAZE && attacker->hp <= (attacker->maxHP / 3)) + gBattleMovePower = (150 * gBattleMovePower) / 100; + if (type == TYPE_WATER && attacker->ability == ABILITY_TORRENT && attacker->hp <= (attacker->maxHP / 3)) + gBattleMovePower = (150 * gBattleMovePower) / 100; + if (type == TYPE_BUG && attacker->ability == ABILITY_SWARM && attacker->hp <= (attacker->maxHP / 3)) + gBattleMovePower = (150 * gBattleMovePower) / 100; + if (gBattleMoves[gCurrentMove].effect == EFFECT_EXPLOSION) + defense /= 2; + + if (type < TYPE_MYSTERY) // is physical + { + if (gCritMultiplier == 2) + { + if (attacker->statStages[STAT_STAGE_ATK] > 6) + APPLY_STAT_MOD(damage, attacker, attack, STAT_STAGE_ATK) + else + damage = attack; + } + else + APPLY_STAT_MOD(damage, attacker, attack, STAT_STAGE_ATK) + + damage = damage * gBattleMovePower; + damage *= (2 * attacker->level / 5 + 2); + + if (gCritMultiplier == 2) + { + if (defender->statStages[STAT_STAGE_DEF] < 6) + APPLY_STAT_MOD(damageHelper, defender, defense, STAT_STAGE_DEF) + else + damageHelper = defense; + } + else + APPLY_STAT_MOD(damageHelper, defender, defense, STAT_STAGE_DEF) + + damage = damage / damageHelper; + damage /= 50; + + if ((attacker->status1 & STATUS_BURN) && attacker->ability != ABILITY_GUTS) + damage /= 2; + + if ((sideStatus & SIDE_STATUS_REFLECT) && gCritMultiplier == 1) + { + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMonsInBattle(2) == 2) + damage = 2 * (damage / 3); + else + damage /= 2; + } + + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == 8 && CountAliveMonsInBattle(2) == 2) + damage /= 2; + + // moves always do at least 1 damage. + if (damage == 0) + damage = 1; + } + + if (type == TYPE_MYSTERY) + damage = 0; // is ??? type. does 0 damage. + + if (type > TYPE_MYSTERY) // is special? + { + if (gCritMultiplier == 2) + { + if (attacker->statStages[STAT_STAGE_SPATK] > 6) + APPLY_STAT_MOD(damage, attacker, spAttack, STAT_STAGE_SPATK) + else + damage = spAttack; + } + else + APPLY_STAT_MOD(damage, attacker, spAttack, STAT_STAGE_SPATK) + + damage = damage * gBattleMovePower; + damage *= (2 * attacker->level / 5 + 2); + + if (gCritMultiplier == 2) + { + if (defender->statStages[STAT_STAGE_SPDEF] < 6) + APPLY_STAT_MOD(damageHelper, defender, spDefense, STAT_STAGE_SPDEF) + else + damageHelper = spDefense; + } + else + APPLY_STAT_MOD(damageHelper, defender, spDefense, STAT_STAGE_SPDEF) + + damage = (damage / damageHelper); + damage /= 50; + + if ((sideStatus & SIDE_STATUS_LIGHTSCREEN) && gCritMultiplier == 1) + { + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMonsInBattle(2) == 2) + damage = 2 * (damage / 3); + else + damage /= 2; + } + + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == 8 && CountAliveMonsInBattle(2) == 2) + damage /= 2; + + // are effects of weather negated with cloud nine or air lock + if (!AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_CLOUD_NINE, 0, 0) + && !AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_AIR_LOCK, 0, 0)) + { + if (gBattleWeather & WEATHER_RAIN_TEMPORARY) + { + switch (type) + { + case TYPE_FIRE: + damage /= 2; + break; + case TYPE_WATER: + damage = (15 * damage) / 10; + break; + } + } + + // any weather except sun weakens solar beam + if ((gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_HAIL)) && gCurrentMove == MOVE_SOLAR_BEAM) + damage /= 2; + + // sunny + if (gBattleWeather & WEATHER_SUN_ANY) + { + switch (type) + { + case TYPE_FIRE: + damage = (15 * damage) / 10; + break; + case TYPE_WATER: + damage /= 2; + break; + } + } + } + + // flash fire triggered + if ((gBattleResources->flags->flags[bankAtk] & UNKNOWN_FLAG_FLASH_FIRE) && type == TYPE_FIRE) + damage = (15 * damage) / 10; + } + + return damage + 2; +} diff --git a/src/coins.c b/src/coins.c new file mode 100644 index 000000000..f43b5b336 --- /dev/null +++ b/src/coins.c @@ -0,0 +1,77 @@ +#include "global.h" +#include "coins.h" +#include "text.h" +#include "window.h" +#include "text_window.h" +#include "string_util.h" + +#define MAX_COINS 9999 + +EWRAM_DATA u8 sCoinsWindowId = 0; + +extern s32 GetStringRightAlignXOffset(u8 fontId, u8 *str, s32 totalWidth); +extern void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock); +extern void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, s16 tileStart, s8 palette); +extern void sub_819746C(u8 windowId, bool8 copyToVram); + +extern const u8 gOtherText_Coins2[]; + +void PrintCoinsString(u32 coinAmount) +{ + u32 xAlign; + + ConvertIntToDecimalStringN(gStringVar1, coinAmount, STR_CONV_MODE_RIGHT_ALIGN, 4); + StringExpandPlaceholders(gStringVar4, gOtherText_Coins2); + + xAlign = GetStringRightAlignXOffset(1, gStringVar4, 0x40); + PrintTextOnWindow(sCoinsWindowId, 1, gStringVar4, xAlign, 1, 0, NULL); +} + +void ShowCoinsWindow(u32 coinAmount, u8 x, u8 y) +{ + struct WindowTemplate template; + SetWindowTemplateFields(&template, 0, x, y, 8, 2, 0xF, 0x141); + sCoinsWindowId = AddWindow(&template); + FillWindowPixelBuffer(sCoinsWindowId, 0); + PutWindowTilemap(sCoinsWindowId); + SetWindowBorderStyle(sCoinsWindowId, FALSE, 0x214, 0xE); + PrintCoinsString(coinAmount); +} + +void HideCoinsWindow(void) +{ + sub_819746C(sCoinsWindowId, TRUE); + RemoveWindow(sCoinsWindowId); +} + +u16 GetCoins(void) +{ + return gSaveBlock1Ptr->coins ^ gSaveBlock2Ptr->encryptionKey; +} + +void SetCoins(u16 coinAmount) +{ + gSaveBlock1Ptr->coins = coinAmount ^ gSaveBlock2Ptr->encryptionKey; +} + +/* Can't match it lol +bool8 AddCoins(u16 toAdd) +{ + u16 newAmount; + u16 ownedCoins = GetCoins(); + if (ownedCoins >= MAX_COINS) + return FALSE; + // check overflow, can't have less coins than previously + if (ownedCoins > ownedCoins + toAdd) + { + newAmount = MAX_COINS; + } + else + { + newAmount = ownedCoins + toAdd; + if (newAmount > MAX_COINS) + newAmount = MAX_COINS; + } + SetCoins(newAmount); + return TRUE; +}*/ diff --git a/src/load_save.c b/src/load_save.c new file mode 100644 index 000000000..588387186 --- /dev/null +++ b/src/load_save.c @@ -0,0 +1,114 @@ +#include "global.h" +#include "gba/flash_internal.h" +#include "load_save.h" +#include "main.h" +#include "pokemon.h" +#include "rng.h" +#include "malloc.h" + +extern u8 gPlayerPartyCount; +extern struct PokemonStorage* gPokemonStoragePtr; +extern void* gUnknown_0203CF5C; +extern u8 gHeap[0x1C000]; + +extern bool16 IdentifyFlash(void); +extern void SetBagItemsPointers(void); +extern void SetDecorationInventoriesPointers(void); +extern void InitHeap(void *heapStart, u32 heapSize); + +void ApplyNewEncyprtionKeyToAllEncryptedData(u32 encryptionKey); + +#define SAVEBLOCK_MOVE_RANGE 128 + +EWRAM_DATA struct SaveBlock2 gSaveblock2 = {0}; +EWRAM_DATA u8 gSaveblock2_DMA[SAVEBLOCK_MOVE_RANGE] = {0}; + +EWRAM_DATA struct SaveBlock1 gSaveblock1 = {0}; +EWRAM_DATA u8 gSaveblock1_DMA[SAVEBLOCK_MOVE_RANGE] = {0}; + +EWRAM_DATA struct PokemonStorage gPokemonStorage = {0}; +EWRAM_DATA u8 gSaveblock3_DMA[SAVEBLOCK_MOVE_RANGE] = {0}; + +void CheckForFlashMemory(void) +{ + if (!IdentifyFlash()) + { + gFlashMemoryPresent = TRUE; + InitFlashTimer(); + } + else + gFlashMemoryPresent = FALSE; +} + +void ClearSav2(void) +{ + CpuFill16(0, &gSaveblock2, sizeof(struct SaveBlock2) + sizeof(gSaveblock2_DMA)); +} + +void ClearSav1(void) +{ + CpuFill16(0, &gSaveblock1, sizeof(struct SaveBlock1) + sizeof(gSaveblock1_DMA)); +} + +void SetSaveBlocksPointers(u16 offset) +{ + struct SaveBlock1** sav1_LocalVar = &gSaveBlock1Ptr; + + offset = (offset + Random()) & (SAVEBLOCK_MOVE_RANGE - 4); + + gSaveBlock2Ptr = (void*)(&gSaveblock2) + offset; + *sav1_LocalVar = (void*)(&gSaveblock1) + offset; + gPokemonStoragePtr = (void*)(&gPokemonStorage) + offset; + + SetBagItemsPointers(); + SetDecorationInventoriesPointers(); +} + +struct SaveBlocksInOne +{ + struct SaveBlock2 sav2; + struct SaveBlock1 sav1; + struct PokemonStorage sav3; +}; +/* +void MoveSaveBlocks_ResetHeap(void) +{ + void *vblankCB, *hblankCB; + u32 encryptionKey; + struct SaveBlocksInOne* copiedSavs; + + // save interrupt functions and turn them off + vblankCB = gMain.vblankCallback; + hblankCB = gMain.hblankCallback; + gMain.vblankCallback = NULL; + gMain.hblankCallback = NULL; + gUnknown_0203CF5C = NULL; + + copiedSavs = (void*)(gHeap); + + // copy saveblocks' content + copiedSavs->sav2 = *gSaveBlock2Ptr; + copiedSavs->sav1 = *gSaveBlock1Ptr; + copiedSavs->sav3 = *gPokemonStoragePtr; + + // change saveblocks' pointers + // argument is a sum of the individual trainerId bytes + SetSaveBlocksPointers(copiedSavs->sav2.playerTrainerId[0] + copiedSavs->sav2.playerTrainerId[1] + copiedSavs->sav2.playerTrainerId[2] + copiedSavs->sav2.playerTrainerId[3]); + + // restore saveblock data since the pointers changed + *gSaveBlock2Ptr = copiedSavs->sav2; + *gSaveBlock1Ptr = copiedSavs->sav1; + *gPokemonStoragePtr = copiedSavs->sav3; + + // heap was destroyed in the copying process, so reset it + InitHeap(gHeap, sizeof(gHeap)); + + // restore interrupt functions + gMain.hblankCallback = hblankCB; + gMain.vblankCallback = vblankCB; + + // create a new encryption key + encryptionKey = (Random() << 0x10) + (Random()); + ApplyNewEncyprtionKeyToAllEncryptedData(encryptionKey); + gSaveBlock2Ptr->encryptionKey = encryptionKey; +}*/ diff --git a/src/lottery_corner.c b/src/lottery_corner.c new file mode 100644 index 000000000..3939f7d7f --- /dev/null +++ b/src/lottery_corner.c @@ -0,0 +1,167 @@ +#include "global.h" +#include "lottery_corner.h" +#include "event_data.h" +#include "pokemon.h" +#include "items.h" +#include "rng.h" +#include "species.h" +#include "string_util.h" +#include "text.h" + +static EWRAM_DATA u16 sWinNumberDigit = 0; +static EWRAM_DATA u16 sOtIdDigit = 0; + +static const u16 sLotteryPrizes[] = +{ + ITEM_PP_UP, + ITEM_EXP_SHARE, + ITEM_MAX_REVIVE, + ITEM_MASTER_BALL, +}; + +static u8 GetMatchingDigits(u16, u16); + +void ResetLotteryCorner(void) +{ + u16 rand = Random(); + + SetLotteryNumber((Random() << 16) | rand); + VarSet(VAR_POKELOT_PRIZE, 0); +} + +void SetRandomLotteryNumber(u16 i) +{ + u32 var = Random(); + + while (--i != 0xFFFF) + var = var * 1103515245 + 12345; + + SetLotteryNumber(var); +} + +void RetrieveLotteryNumber(void) +{ + u16 lottoNumber = GetLotteryNumber(); + gScriptResult = lottoNumber; +} + +void PickLotteryCornerTicket(void) +{ + u16 i; + u16 j; + u32 box; + u32 slot; + + gSpecialVar_0x8004 = 0; + slot = 0; + box = 0; + for (i = 0; i < 6; i++) + { + struct Pokemon *pkmn = &gPlayerParty[i]; + + // UB: Too few arguments for function GetMonData + if (GetMonData(pkmn, MON_DATA_SPECIES) != SPECIES_NONE) + { + // do not calculate ticket values for eggs. + if (!GetMonData(pkmn, MON_DATA_IS_EGG)) + { + u32 otId = GetMonData(pkmn, MON_DATA_OT_ID); + u8 numMatchingDigits = GetMatchingDigits(gScriptResult, otId); + + if (numMatchingDigits > gSpecialVar_0x8004 && numMatchingDigits > 1) + { + gSpecialVar_0x8004 = numMatchingDigits - 1; + box = 14; + slot = i; + } + } + } + else // pokemon are always arranged from populated spots first to unpopulated, so the moment a NONE species is found, that's the end of the list. + break; + } + + // player has 14 boxes. + for (i = 0; i < 14; i++) + { + // player has 30 slots per box. + for (j = 0; j < 30; j++) + { + if (GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SPECIES) != SPECIES_NONE && + !GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_IS_EGG)) + { + u32 otId = GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_OT_ID); + u8 numMatchingDigits = GetMatchingDigits(gScriptResult, otId); + + if (numMatchingDigits > gSpecialVar_0x8004 && numMatchingDigits > 1) + { + gSpecialVar_0x8004 = numMatchingDigits - 1; + box = i; + slot = j; + } + } + } + } + + if (gSpecialVar_0x8004 != 0) + { + gSpecialVar_0x8005 = sLotteryPrizes[gSpecialVar_0x8004 - 1]; + + if (box == 14) + { + gSpecialVar_0x8006 = 0; + GetMonData(&gPlayerParty[slot], MON_DATA_NICKNAME, gStringVar1); + } + else + { + gSpecialVar_0x8006 = 1; + GetBoxMonData(&gPokemonStoragePtr->boxes[box][slot], MON_DATA_NICKNAME, gStringVar1); + } + StringGetEnd10(gStringVar1); + } +} + +static u8 GetMatchingDigits(u16 winNumber, u16 otId) +{ + u8 i; + u8 matchingDigits = 0; + + for (i = 0; i < 5; i++) + { + sWinNumberDigit = winNumber % 10; + sOtIdDigit = otId % 10; + + if (sWinNumberDigit == sOtIdDigit) + { + winNumber = winNumber / 10; + otId = otId / 10; + matchingDigits++; + } + else + break; + } + return matchingDigits; +} + +// lottery numbers go from 0 to 99999, not 65535 (0xFFFF). interestingly enough, the function that calls GetLotteryNumber shifts to u16, so it cant be anything above 65535 anyway. +void SetLotteryNumber(u32 lotteryNum) +{ + u16 lowNum = lotteryNum >> 16; + u16 highNum = lotteryNum; + + VarSet(VAR_POKELOT_RND1, highNum); + VarSet(VAR_POKELOT_RND2, lowNum); +} + +u32 GetLotteryNumber(void) +{ + u16 highNum = VarGet(VAR_POKELOT_RND1); + u16 lowNum = VarGet(VAR_POKELOT_RND2); + + return (lowNum << 16) | highNum; +} + +// interestingly, this may have been the original lottery number set function, but GF tried to change it to 32-bit later but didnt finish changing all calls as one GetLotteryNumber still shifts to u16. +void SetLotteryNumber16_Unused(u16 lotteryNum) +{ + SetLotteryNumber(lotteryNum); +} diff --git a/src/main.c b/src/main.c index 7c8075a6f..5707e18af 100644 --- a/src/main.c +++ b/src/main.c @@ -5,6 +5,7 @@ #include "rng.h" #include "dma3.h" #include "gba/flash_internal.h" +#include "battle.h" extern u16 GetGpuReg(u8); extern void SetGpuReg(u8, u16); @@ -34,9 +35,8 @@ extern struct SoundInfo gSoundInfo; extern u32 gFlashMemoryPresent; extern u32 IntrMain[]; extern u8 gHeap[]; -extern struct SaveBlock2 gUnknown_02024A54; -extern char *gUnknown_03005D94; -extern char gUnknown_02029808[]; +extern struct SaveBlock2 gSaveblock2; +extern struct PokemonStorage gPokemonStorage; extern u32 gBattleTypeFlags; extern u8 gUnknown_03002748; extern u32 *gUnknown_0203CF5C; @@ -185,8 +185,8 @@ static void InitMainCallbacks(void) gMain.vblankCounter2 = 0; gMain.callback1 = NULL; SetMainCallback2(c2_copyright_1); - gSaveBlock2Ptr = &gUnknown_02024A54; - gUnknown_03005D94 = gUnknown_02029808; + gSaveBlock2Ptr = &gSaveblock2; + gPokemonStoragePtr = &gPokemonStorage; } static void CallCallbacks(void) @@ -359,7 +359,7 @@ static void VBlankIntr(void) m4aSoundMain(); sub_8033648(); - if (!gMain.inBattle || (gBattleTypeFlags & 0x013F0102) == 0) + if (!gMain.inBattle || !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_RECORDED))) Random(); sub_800E174(); @@ -368,7 +368,7 @@ static void VBlankIntr(void) gMain.intrCheck |= INTR_FLAG_VBLANK; } -void StartFlashMemoryTimer(void) +void InitFlashTimer(void) { SetFlashTimerIntr(2, gIntrTable + 0x7); } diff --git a/src/malloc.c b/src/malloc.c index 5317565dc..ccb2f7d20 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -1,7 +1,5 @@ #include "global.h" -EWRAM_DATA u8 gHeap[0x1C000] = {0}; - static void *sHeapStart; static u32 sHeapSize; diff --git a/src/money.c b/src/money.c new file mode 100644 index 000000000..be64d9633 --- /dev/null +++ b/src/money.c @@ -0,0 +1,55 @@ +#include "global.h" +#include "money.h" + +#define MAX_MONEY 999999 + +u32 GetMoney(u32* moneyPtr) +{ + return *moneyPtr ^ gSaveBlock2Ptr->encryptionKey; +} + +void SetMoney(u32* moneyPtr, u32 newValue) +{ + *moneyPtr = gSaveBlock2Ptr->encryptionKey ^ newValue; +} + +bool8 IsEnoughMoney(u32* moneyPtr, u32 cost) +{ + if (GetMoney(moneyPtr) >= cost) + return TRUE; + else + return FALSE; +} + +void AddMoney(u32* moneyPtr, u32 toAdd) +{ + u32 toSet = GetMoney(moneyPtr); + + // can't have more money than MAX + if (toSet + toAdd > MAX_MONEY) + { + toSet = MAX_MONEY; + } + else + { + toSet += toAdd; + // check overflow, can't have less money after you receive more + if (toSet < GetMoney(moneyPtr)) + toSet = MAX_MONEY; + } + + SetMoney(moneyPtr, toSet); +} + +void SubtractMoney(u32* moneyPtr, u32 toSub) +{ + u32 toSet = GetMoney(moneyPtr); + + // can't subtract more than you already have + if (toSet < toSub) + toSet = 0; + else + toSet -= toSub; + + SetMoney(moneyPtr, toSet); +} diff --git a/src/new_game.c b/src/new_game.c index 649cf4e6d..2bf774c69 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -1,22 +1,64 @@ #include "global.h" #include "new_game.h" #include "rng.h" +#include "pokemon.h" +#include "roamer.h" +#include "pokemon_size_record.h" +#include "script.h" +#include "lottery_corner.h" +#include "play_time.h" +#include "mauville_old_man.h" +#include "lilycove_lady.h" +#include "load_save.h" +#include "pokeblock.h" +#include "dewford_trend.h" +#include "berry.h" +#include "rtc.h" +#include "easy_chat.h" +#include "event_data.h" +#include "money.h" +#include "coins.h" extern u8 gPlayerPartyCount; extern u8 gDifferentSaveFile; extern u16 gSaveFileStatus; extern u8 gUnknown_030060B0; +// TODO: replace those declarations with file headers extern u16 GetGeneratedTrainerIdLower(void); extern void ClearContestWinnerPicsInContestHall(void); extern void warp1_set(s8 mapBank, s8 mapNo, s8 warpNo, s8 xPos, s8 yPos); extern void warp_in(void); extern void sub_80BB358(void); -extern void ZeroPlayerPartyMons(void); -extern void ZeroEnemyPartyMons(void); extern void ResetBagScrollPositions(void); extern void sub_813624C(void); // clears something pokeblock related -extern void ClearSav2(void); // clears something pokeblock related +extern void ResetPokedex(void); +extern void sub_8084400(void); +extern void ClearMailData(void); +extern void ClearTVShowData(void); +extern void ResetGabbyAndTy(void); +extern void ResetSecretBases(void); +extern void ResetLinkContestBoolean(void); +extern void ResetGameStats(void); +extern void sub_8052DA8(void); +extern void InitLinkBattleRecords(void); +extern void ResetPokemonStorageSystem(void); +extern void ClearBag(void); +extern void NewGameInitPCItems(void); +extern void ClearDecorationInventories(void); +extern void ResetFanClub(void); +extern void copy_strings_to_sav1(void); +extern void sub_819FAA0(void); +extern void sub_81A4B14(void); +extern void sub_8195E10(void); +extern void sub_801AFD8(void); +extern void sub_800E5AC(void); +extern void sub_81D54BC(void); +extern void ResetContestLinkResults(void); +extern void ResetPokeJumpResults(void); +extern void SetBerryPowder(u32* powder, u32 newValue); + +extern u8 gUnknown_082715DE[]; void WriteUnalignedWord(u32 var, u8 *dataPtr) { @@ -104,8 +146,71 @@ void sub_808447C(void) ResetBagScrollPositions(); sub_813624C(); } -/* + void NewGameInitData(void) { - Finish when more header files are available -}*/ + if (gSaveFileStatus == 0 || gSaveFileStatus == 2) + RtcReset(); + + gDifferentSaveFile = 1; + gSaveBlock2Ptr->encryptionKey = 0; + ZeroPlayerPartyMons(); + ZeroEnemyPartyMons(); + ResetPokedex(); + sub_8084400(); + ClearSav1(); + ClearMailData(); + gSaveBlock2Ptr->specialSaveWarp = 0; + gSaveBlock2Ptr->field_A8 = 0; + InitPlayerTrainerId(); + PlayTimeCounter_Reset(); + ClearPokedexFlags(); + InitEventData(); + ClearTVShowData(); + ResetGabbyAndTy(); + ResetSecretBases(); + ClearBerryTrees(); + SetMoney(&gSaveBlock1Ptr->money, 3000); + SetCoins(0); + ResetLinkContestBoolean(); + ResetGameStats(); + ClearAllContestWinnerPics(); + InitLinkBattleRecords(); + InitSeedotSizeRecord(); + InitLotadSizeRecord(); + gPlayerPartyCount = 0; + ZeroPlayerPartyMons(); + ResetPokemonStorageSystem(); + ClearRoamerData(); + ClearRoamerLocationData(); + gSaveBlock1Ptr->registeredItem = 0; + ClearBag(); + NewGameInitPCItems(); + ClearPokeblocks(); + ClearDecorationInventories(); + InitEasyChatPhrases(); + SetMauvilleOldMan(); + InitDewfordTrend(); + ResetFanClub(); + ResetLotteryCorner(); + WarpToTruck(); + ScriptContext2_RunNewScript(gUnknown_082715DE); + ResetMiniGamesResults(); + copy_strings_to_sav1(); + SetLilycoveLady(); + sub_819FAA0(); + sub_81A4B14(); + sub_8195E10(); + sub_801AFD8(); + sub_800E5AC(); + sub_81D54BC(); + ResetContestLinkResults(); +} + +void ResetMiniGamesResults(void) +{ + CpuFill16(0, &gSaveBlock2Ptr->berryCrush, sizeof(struct BerryCrush)); + SetBerryPowder(&gSaveBlock2Ptr->berryCrush.berryPowderAmount, 0); + ResetPokeJumpResults(); + CpuFill16(0, &gSaveBlock2Ptr->berryPick, sizeof(struct BerryPickingResults)); +} diff --git a/src/palette.c b/src/palette.c index eb055a294..aa9a84e4c 100644 --- a/src/palette.c +++ b/src/palette.c @@ -54,7 +54,7 @@ EWRAM_DATA struct PaletteStruct sPaletteStructs[0x10] = {0}; EWRAM_DATA struct PaletteFadeControl gPaletteFade = {0}; EWRAM_DATA u32 gFiller_2037FE0 = 0; EWRAM_DATA u32 sPlttBufferTransferPending = 0; -EWRAM_DATA u8 sPaletteDecompressionBuffer[0x400] = {0}; +EWRAM_DATA u8 gPaletteDecompressionBuffer[0x400] = {0}; extern struct PaletteStructTemplate gDummyPaletteStructTemplate; extern void *gUnknown_0852487C; @@ -102,9 +102,9 @@ void sub_80A1884(u16 a1) void LoadCompressedPalette(const void *src, u16 offset, u16 size) { - LZDecompressWram(src, sPaletteDecompressionBuffer); - CpuCopy16(sPaletteDecompressionBuffer, gPlttBufferUnfaded + offset, size); - CpuCopy16(sPaletteDecompressionBuffer, gPlttBufferFaded + offset, size); + LZDecompressWram(src, gPaletteDecompressionBuffer); + CpuCopy16(gPaletteDecompressionBuffer, gPlttBufferUnfaded + offset, size); + CpuCopy16(gPaletteDecompressionBuffer, gPlttBufferFaded + offset, size); } void LoadPalette(const void *src, u16 offset, u16 size) diff --git a/src/play_time.c b/src/play_time.c index 444c2c86c..27a57f28b 100644 --- a/src/play_time.c +++ b/src/play_time.c @@ -10,7 +10,7 @@ enum static u8 sPlayTimeCounterState; -void PlayTimeCounter_Reset() +void PlayTimeCounter_Reset(void) { sPlayTimeCounterState = STOPPED; @@ -20,7 +20,7 @@ void PlayTimeCounter_Reset() gSaveBlock2Ptr->playTimeVBlanks = 0; } -void PlayTimeCounter_Start() +void PlayTimeCounter_Start(void) { sPlayTimeCounterState = RUNNING; @@ -28,12 +28,12 @@ void PlayTimeCounter_Start() PlayTimeCounter_SetToMax(); } -void PlayTimeCounter_Stop() +void PlayTimeCounter_Stop(void) { sPlayTimeCounterState = STOPPED; } -void PlayTimeCounter_Update() +void PlayTimeCounter_Update(void) { if (sPlayTimeCounterState == RUNNING) { @@ -62,7 +62,7 @@ void PlayTimeCounter_Update() } } -void PlayTimeCounter_SetToMax() +void PlayTimeCounter_SetToMax(void) { sPlayTimeCounterState = MAXED_OUT; diff --git a/src/pokemon_1.c b/src/pokemon_1.c new file mode 100644 index 000000000..e28c56252 --- /dev/null +++ b/src/pokemon_1.c @@ -0,0 +1,325 @@ +#include "global.h" +#include "pokemon.h" +#include "rng.h" +#include "main.h" +#include "items.h" +#include "string_util.h" +#include "text.h" + +//Extracts the upper 16 bits of a 32-bit number +#define HIHALF(n) (((n) & 0xFFFF0000) >> 16) + +//Extracts the lower 16 bits of a 32-bit number +#define LOHALF(n) ((n) & 0xFFFF) + +extern u8 sav1_map_get_name(void); + +void ZeroBoxMonData(struct BoxPokemon *boxMon) +{ + u8 *raw = (u8 *)boxMon; + u32 i; + for (i = 0; i < sizeof(struct BoxPokemon); i++) + raw[i] = 0; +} + +void ZeroMonData(struct Pokemon *mon) +{ + u32 arg; + ZeroBoxMonData(&mon->box); + arg = 0; + SetMonData(mon, MON_DATA_STATUS, &arg); + SetMonData(mon, MON_DATA_LEVEL, &arg); + SetMonData(mon, MON_DATA_HP, &arg); + SetMonData(mon, MON_DATA_MAX_HP, &arg); + SetMonData(mon, MON_DATA_ATK, &arg); + SetMonData(mon, MON_DATA_DEF, &arg); + SetMonData(mon, MON_DATA_SPD, &arg); + SetMonData(mon, MON_DATA_SPATK, &arg); + SetMonData(mon, MON_DATA_SPDEF, &arg); + arg = 255; + SetMonData(mon, MON_DATA_MAIL, &arg); +} + +void ZeroPlayerPartyMons(void) +{ + s32 i; + for (i = 0; i < 6; i++) + ZeroMonData(&gPlayerParty[i]); +} + +void ZeroEnemyPartyMons(void) +{ + s32 i; + for (i = 0; i < 6; i++) + ZeroMonData(&gEnemyParty[i]); +} + +void CreateMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId) +{ + u32 arg; + ZeroMonData(mon); + CreateBoxMon(&mon->box, species, level, fixedIV, hasFixedPersonality, fixedPersonality, otIdType, fixedOtId); + SetMonData(mon, MON_DATA_LEVEL, &level); + arg = 255; + SetMonData(mon, MON_DATA_MAIL, &arg); + CalculateMonStats(mon); +} + +void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId) +{ + u8 speciesName[POKEMON_NAME_LENGTH + 1]; + u32 personality; + u32 value; + u16 checksum; + + ZeroBoxMonData(boxMon); + + if (hasFixedPersonality) + personality = fixedPersonality; + else + personality = Random32(); + + SetBoxMonData(boxMon, MON_DATA_PERSONALITY, &personality); + + //Determine original trainer ID + if (otIdType == OT_ID_RANDOM_NO_SHINY) //Pokemon cannot be shiny + { + u32 shinyValue; + do + { + value = Random32(); + shinyValue = HIHALF(value) ^ LOHALF(value) ^ HIHALF(personality) ^ LOHALF(personality); + } while (shinyValue < 8); + } + else if (otIdType == OT_ID_PRESET) //Pokemon has a preset OT ID + { + value = fixedOtId; + } + else //Player is the OT + { + value = gSaveBlock2Ptr->playerTrainerId[0] + | (gSaveBlock2Ptr->playerTrainerId[1] << 8) + | (gSaveBlock2Ptr->playerTrainerId[2] << 16) + | (gSaveBlock2Ptr->playerTrainerId[3] << 24); + } + + SetBoxMonData(boxMon, MON_DATA_OT_ID, &value); + + checksum = CalculateBoxMonChecksum(boxMon); + SetBoxMonData(boxMon, MON_DATA_CHECKSUM, &checksum); + EncryptBoxMon(boxMon); + GetSpeciesName(speciesName, species); + SetBoxMonData(boxMon, MON_DATA_NICKNAME, speciesName); + SetBoxMonData(boxMon, MON_DATA_LANGUAGE, &gGameLanguage); + SetBoxMonData(boxMon, MON_DATA_OT_NAME, gSaveBlock2Ptr->playerName); + SetBoxMonData(boxMon, MON_DATA_SPECIES, &species); + SetBoxMonData(boxMon, MON_DATA_EXP, &gExperienceTables[gBaseStats[species].growthRate][level]); + SetBoxMonData(boxMon, MON_DATA_FRIENDSHIP, &gBaseStats[species].friendship); + value = sav1_map_get_name(); + SetBoxMonData(boxMon, MON_DATA_MET_LOCATION, &value); + SetBoxMonData(boxMon, MON_DATA_MET_LEVEL, &level); + SetBoxMonData(boxMon, MON_DATA_MET_GAME, &gGameVersion); + value = ITEM_POKE_BALL; + SetBoxMonData(boxMon, MON_DATA_POKEBALL, &value); + SetBoxMonData(boxMon, MON_DATA_OT_GENDER, &gSaveBlock2Ptr->playerGender); + + if (fixedIV < 32) + { + SetBoxMonData(boxMon, MON_DATA_HP_IV, &fixedIV); + SetBoxMonData(boxMon, MON_DATA_ATK_IV, &fixedIV); + SetBoxMonData(boxMon, MON_DATA_DEF_IV, &fixedIV); + SetBoxMonData(boxMon, MON_DATA_SPD_IV, &fixedIV); + SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &fixedIV); + SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &fixedIV); + } + else + { + u32 iv; + value = Random(); + + iv = value & 0x1F; + SetBoxMonData(boxMon, MON_DATA_HP_IV, &iv); + iv = (value & 0x3E0) >> 5; + SetBoxMonData(boxMon, MON_DATA_ATK_IV, &iv); + iv = (value & 0x7C00) >> 10; + SetBoxMonData(boxMon, MON_DATA_DEF_IV, &iv); + + value = Random(); + + iv = value & 0x1F; + SetBoxMonData(boxMon, MON_DATA_SPD_IV, &iv); + iv = (value & 0x3E0) >> 5; + SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &iv); + iv = (value & 0x7C00) >> 10; + SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv); + } + + if (gBaseStats[species].ability2) + { + value = personality & 1; + SetBoxMonData(boxMon, MON_DATA_ALT_ABILITY, &value); + } + + GiveBoxMonInitialMoveset(boxMon); +} + +void CreateMonWithNature(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 nature) +{ + u32 personality; + + do + { + personality = Random32(); + } + while (nature != GetNatureFromPersonality(personality)); + + CreateMon(mon, species, level, fixedIV, 1, personality, OT_ID_PLAYER_ID, 0); +} + +void CreateMonWithGenderNatureLetter(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 gender, u8 nature, u8 unownLetter) +{ + u32 personality; + + if ((u8)(unownLetter - 1) < 28) + { + u16 actualLetter; + + do + { + personality = Random32(); + actualLetter = ((((personality & 0x3000000) >> 18) | ((personality & 0x30000) >> 12) | ((personality & 0x300) >> 6) | (personality & 0x3)) % 28); + } + while (nature != GetNatureFromPersonality(personality) + || gender != GetGenderFromSpeciesAndPersonality(species, personality) + || actualLetter != unownLetter - 1); + } + else + { + do + { + personality = Random32(); + } + while (nature != GetNatureFromPersonality(personality) + || gender != GetGenderFromSpeciesAndPersonality(species, personality)); + } + + CreateMon(mon, species, level, fixedIV, 1, personality, OT_ID_PLAYER_ID, 0); +} + +// This is only used to create Wally's Ralts. +void CreateMaleMon(struct Pokemon *mon, u16 species, u8 level) +{ + u32 personality; + u32 otId; + + do + { + otId = Random32(); + personality = Random32(); + } + while (GetGenderFromSpeciesAndPersonality(species, personality) != MON_MALE); + CreateMon(mon, species, level, 32, 1, personality, OT_ID_PRESET, otId); +} + +void CreateMonWithIVsPersonality(struct Pokemon *mon, u16 species, u8 level, u32 ivs, u32 personality) +{ + CreateMon(mon, species, level, 0, 1, personality, OT_ID_PLAYER_ID, 0); + SetMonData(mon, MON_DATA_IVS, &ivs); + CalculateMonStats(mon); +} + +void CreateMonWithIVsOTID(struct Pokemon *mon, u16 species, u8 level, u8 *ivs, u32 otId) +{ + CreateMon(mon, species, level, 0, 0, 0, OT_ID_PRESET, otId); + SetMonData(mon, MON_DATA_HP_IV, &ivs[0]); + SetMonData(mon, MON_DATA_ATK_IV, &ivs[1]); + SetMonData(mon, MON_DATA_DEF_IV, &ivs[2]); + SetMonData(mon, MON_DATA_SPD_IV, &ivs[3]); + SetMonData(mon, MON_DATA_SPATK_IV, &ivs[4]); + SetMonData(mon, MON_DATA_SPDEF_IV, &ivs[5]); + CalculateMonStats(mon); +} + +void CreateMonWithEVSpread(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 evSpread) +{ + s32 i; + s32 statCount = 0; + u16 evAmount; + u8 temp; + + CreateMon(mon, species, level, fixedIV, 0, 0, 0, 0); + + temp = evSpread; + + for (i = 0; i < 6; i++) + { + if (temp & 1) + statCount++; + temp >>= 1; + } + + evAmount = 510 / statCount; + + temp = 1; + + for (i = 0; i < 6; i++) + { + if (evSpread & temp) + SetMonData(mon, MON_DATA_HP_EV + i, &evAmount); + temp <<= 1; + } + + CalculateMonStats(mon); +} + +void sub_806819C(struct Pokemon *mon, struct UnknownPokemonStruct *src) +{ + s32 i; + u8 nickname[30]; + u8 language; + u8 value; + + CreateMon(mon, src->species, src->level, 0, 1, src->personality, 1, src->otId); + + for (i = 0; i < 4; i++) + SetMonMoveSlot(mon, src->moves[i], i); + + SetMonData(mon, MON_DATA_PP_BONUSES, &src->ppBonuses); + SetMonData(mon, MON_DATA_HELD_ITEM, &src->heldItem); + SetMonData(mon, MON_DATA_FRIENDSHIP, &src->friendship); + + StringCopy(nickname, src->nickname); + + if (nickname[0] == EXT_CTRL_CODE_BEGIN && nickname[1] == EXT_CTRL_CODE_JPN) + { + language = LANGUAGE_JAPANESE; + StripExtCtrlCodes(nickname); + } + else + language = GAME_LANGUAGE; + + SetMonData(mon, MON_DATA_LANGUAGE, &language); + SetMonData(mon, MON_DATA_NICKNAME, nickname); + SetMonData(mon, MON_DATA_HP_EV, &src->hpEV); + SetMonData(mon, MON_DATA_ATK_EV, &src->attackEV); + SetMonData(mon, MON_DATA_DEF_EV, &src->defenseEV); + SetMonData(mon, MON_DATA_SPD_EV, &src->speedEV); + SetMonData(mon, MON_DATA_SPATK_EV, &src->spAttackEV); + SetMonData(mon, MON_DATA_SPDEF_EV, &src->spDefenseEV); + value = src->altAbility; + SetMonData(mon, MON_DATA_ALT_ABILITY, &value); + value = src->hpIV; + SetMonData(mon, MON_DATA_HP_IV, &value); + value = src->attackIV; + SetMonData(mon, MON_DATA_ATK_IV, &value); + value = src->defenseIV; + SetMonData(mon, MON_DATA_DEF_IV, &value); + value = src->speedIV; + SetMonData(mon, MON_DATA_SPD_IV, &value); + value = src->spAttackIV; + SetMonData(mon, MON_DATA_SPATK_IV, &value); + value = src->spDefenseIV; + SetMonData(mon, MON_DATA_SPDEF_IV, &value); + MonRestorePP(mon); + CalculateMonStats(mon); +} diff --git a/src/pokemon_2.c b/src/pokemon_2.c new file mode 100644 index 000000000..d50853383 --- /dev/null +++ b/src/pokemon_2.c @@ -0,0 +1,4 @@ +#include "global.h" +#include "pokemon.h" + + diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c new file mode 100644 index 000000000..804dbda74 --- /dev/null +++ b/src/pokemon_size_record.c @@ -0,0 +1,222 @@ +#include "global.h" +#include "pokemon_size_record.h" +#include "event_data.h" +#include "species.h" +#include "string_util.h" +#include "text.h" +#include "pokemon.h" + +#define DEFAULT_MAX_SIZE 0x8000 // was 0x8100 in Ruby/Sapphire + +struct UnknownStruct +{ + u16 unk0; + u8 unk2; + u16 unk4; +}; + +extern u16 GetPokedexHeightWeight(u16 dexNo, bool8 height); +extern u16 SpeciesToNationalPokedexNum(u16 species); + +static const struct UnknownStruct sBigMonSizeTable[] = +{ + { 290, 1, 0 }, + { 300, 1, 10 }, + { 400, 2, 110 }, + { 500, 4, 310 }, + { 600, 20, 710 }, + { 700, 50, 2710 }, + { 800, 100, 7710 }, + { 900, 150, 17710 }, + { 1000, 150, 32710 }, + { 1100, 100, -17826 }, + { 1200, 50, -7826 }, + { 1300, 20, -2826 }, + { 1400, 5, -826 }, + { 1500, 2, -326 }, + { 1600, 1, -126 }, + { 1700, 1, -26 }, +}; + +static const u8 sGiftRibbonsMonDataIds[] = +{ + MON_DATA_GIFT_RIBBON_1, MON_DATA_GIFT_RIBBON_2, MON_DATA_GIFT_RIBBON_3, + MON_DATA_GIFT_RIBBON_4, MON_DATA_GIFT_RIBBON_5, MON_DATA_GIFT_RIBBON_6, + MON_DATA_GIFT_RIBBON_7 +}; + +extern const u8 gOtherText_DecimalPoint[]; +extern const u8 gOtherText_Marco[]; +extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1]; + +#define CM_PER_INCH 2.54 + +static u32 GetMonSizeHash(struct Pokemon *pkmn) +{ + u16 personality = GetMonData(pkmn, MON_DATA_PERSONALITY); + u16 hpIV = GetMonData(pkmn, MON_DATA_HP_IV) & 0xF; + u16 attackIV = GetMonData(pkmn, MON_DATA_ATK_IV) & 0xF; + u16 defenseIV = GetMonData(pkmn, MON_DATA_DEF_IV) & 0xF; + u16 speedIV = GetMonData(pkmn, MON_DATA_SPD_IV) & 0xF; + u16 spAtkIV = GetMonData(pkmn, MON_DATA_SPATK_IV) & 0xF; + u16 spDefIV = GetMonData(pkmn, MON_DATA_SPDEF_IV) & 0xF; + u32 hibyte = ((attackIV ^ defenseIV) * hpIV) ^ (personality & 0xFF); + u32 lobyte = ((spAtkIV ^ spDefIV) * speedIV) ^ (personality >> 8); + + return (hibyte << 8) + lobyte; +} + +static u8 TranslateBigMonSizeTableIndex(u16 a) +{ + u8 i; + + for (i = 1; i < 15; i++) + { + if (a < sBigMonSizeTable[i].unk4) + return i - 1; + } + return i; +} + +static u32 GetMonSize(u16 species, u16 b) +{ + u64 unk2; + u64 unk4; + u64 unk0; + u32 height; + u32 var; + + height = GetPokedexHeightWeight(SpeciesToNationalPokedexNum(species), 0); + var = TranslateBigMonSizeTableIndex(b); + unk0 = sBigMonSizeTable[var].unk0; + unk2 = sBigMonSizeTable[var].unk2; + unk4 = sBigMonSizeTable[var].unk4; + unk0 += (b - unk4) / unk2; + return height * unk0 / 10; +} + +static void FormatMonSizeRecord(u8 *string, u32 size) +{ +#ifdef UNITS_IMPERIAL + //Convert size from centimeters to inches + size = (double)(size * 10) / (CM_PER_INCH * 10); +#endif + + string = ConvertIntToDecimalStringN(string, size / 10, 0, 8); + string = StringAppend(string, gOtherText_DecimalPoint); + ConvertIntToDecimalStringN(string, size % 10, 0, 1); +} + +static u8 CompareMonSize(u16 species, u16 *sizeRecord) +{ + if (gScriptResult == 0xFF) + { + return 0; + } + else + { + struct Pokemon *pkmn = &gPlayerParty[gScriptResult]; + + if (GetMonData(pkmn, MON_DATA_IS_EGG) == TRUE || GetMonData(pkmn, MON_DATA_SPECIES) != species) + { + return 1; + } + else + { + u32 oldSize; + u32 newSize; + u16 sizeParams; + + *(&sizeParams) = GetMonSizeHash(pkmn); + newSize = GetMonSize(species, sizeParams); + oldSize = GetMonSize(species, *sizeRecord); + FormatMonSizeRecord(gStringVar2, newSize); + if (newSize <= oldSize) + { + return 2; + } + else + { + *sizeRecord = sizeParams; + return 3; + } + } + } +} + +// Stores species name in gStringVar1, trainer's name in gStringVar2, and size in gStringVar3 +static void GetMonSizeRecordInfo(u16 species, u16 *sizeRecord) +{ + u32 size = GetMonSize(species, *sizeRecord); + + FormatMonSizeRecord(gStringVar3, size); + StringCopy(gStringVar1, gSpeciesNames[species]); + if (*sizeRecord == DEFAULT_MAX_SIZE) + StringCopy(gStringVar2, gOtherText_Marco); + else + StringCopy(gStringVar2, gSaveBlock2Ptr->playerName); +} + +void InitSeedotSizeRecord(void) +{ + VarSet(VAR_SEEDOT_SIZE_RECORD, DEFAULT_MAX_SIZE); +} + +void GetSeedotSizeRecordInfo(void) +{ + u16 *sizeRecord = GetVarPointer(VAR_SEEDOT_SIZE_RECORD); + + GetMonSizeRecordInfo(SPECIES_SEEDOT, sizeRecord); +} + +void CompareSeedotSize(void) +{ + u16 *sizeRecord = GetVarPointer(VAR_SEEDOT_SIZE_RECORD); + + gScriptResult = CompareMonSize(SPECIES_SEEDOT, sizeRecord); +} + +void InitLotadSizeRecord(void) +{ + VarSet(VAR_LOTAD_SIZE_RECORD, DEFAULT_MAX_SIZE); +} + +void GetLotadSizeRecordInfo(void) +{ + u16 *sizeRecord = GetVarPointer(VAR_LOTAD_SIZE_RECORD); + + GetMonSizeRecordInfo(SPECIES_LOTAD, sizeRecord); +} + +void CompareLotadSize(void) +{ + u16 *sizeRecord = GetVarPointer(VAR_LOTAD_SIZE_RECORD); + + gScriptResult = CompareMonSize(SPECIES_LOTAD, sizeRecord); +} + +void GiveGiftRibbonToParty(u8 index, u8 ribbonId) +{ + s32 i; + bool32 gotRibbon = FALSE; + u8 data = 1; + u8 array[8]; + memcpy(array, sGiftRibbonsMonDataIds, sizeof(sGiftRibbonsMonDataIds)); + + if (index < 11 && ribbonId < 65) + { + gSaveBlock1Ptr->giftRibbons[index] = ribbonId; + for (i = 0; i < 6; i++) + { + struct Pokemon *pkmn = &gPlayerParty[i]; + + if (GetMonData(pkmn, MON_DATA_SPECIES) != 0 && GetMonData(pkmn, MON_DATA_SANITY_BIT3) == 0) + { + SetMonData(pkmn, array[index], &data); + gotRibbon = TRUE; + } + } + if (gotRibbon) + FlagSet(SYS_RIBBON_GET); + } +} diff --git a/src/rng.c b/src/rng.c index 6f4f2ce55..ddd149018 100644 --- a/src/rng.c +++ b/src/rng.c @@ -4,13 +4,10 @@ // The number 1103515245 comes from the example implementation of rand and srand // in the ISO C standard. -extern u32 gRngValue; -extern u32 gRng2Value; - EWRAM_DATA static u8 sUnknown = 0; EWRAM_DATA static u32 sRandCount = 0; -u16 Random() +u16 Random(void) { gRngValue = 1103515245 * gRngValue + 24691; sRandCount++; diff --git a/src/safari_zone.c b/src/safari_zone.c new file mode 100644 index 000000000..fdfdd961a --- /dev/null +++ b/src/safari_zone.c @@ -0,0 +1,268 @@ +#include "global.h" +#include "safari_zone.h" +#include "event_data.h" +#include "game_stat.h" +#include "main.h" +#include "battle.h" +#include "string_util.h" + +struct PokeblockFeeder +{ + /*0x00*/ s16 x; + /*0x02*/ s16 y; + /*0x04*/ s8 mapNum; + /*0x05*/ u8 stepCounter; + /*0x08*/ struct Pokeblock pokeblock; +}; + +#define NUM_POKEBLOCK_FEEDERS 10 + +extern u8 gBattleOutcome; +extern void* gUnknown_03005DAC; + +extern u8 gUnknown_082A4B8A[]; +extern u8 gUnknown_082A4B6F[]; +extern u8 gUnknown_082A4B4C[]; +extern u8 gUnknown_082A4B9B[]; +extern const u8* const gPokeblockNames[]; + +extern void sub_80EE44C(u8, u8); +extern void IncrementGameStat(u8 index); +extern void ScriptContext1_SetupScript(u8*); +extern void ScriptContext2_RunNewScript(u8*); +extern void c2_exit_to_overworld_2_switch(void); +extern void c2_exit_to_overworld_1_continue_scripts_restart_music(void); +extern void c2_load_new_map(void); +extern void sub_80AF6F0(void); +extern void ScriptContext1_Stop(void); +extern void warp_in(void); +extern void GetXYCoordsOneStepInFrontOfPlayer(s16* x, s16* y); +extern void PlayerGetDestCoords(s16* x, s16* y); + +EWRAM_DATA u8 gNumSafariBalls = 0; +EWRAM_DATA static u16 sSafariZoneStepCounter = 0; +EWRAM_DATA static u8 sSafariZoneCaughtMons = 0; +EWRAM_DATA static u8 sSafariZoneFleedMons = 0; +EWRAM_DATA static struct PokeblockFeeder sPokeblockFeeders[NUM_POKEBLOCK_FEEDERS] = {0}; + +static void ClearAllPokeblockFeeders(void); +static void DecrementFeederStepCounters(void); + +bool32 GetSafariZoneFlag(void) +{ + return FlagGet(SYS_SAFARI_MODE); +} + +void SetSafariZoneFlag(void) +{ + FlagSet(SYS_SAFARI_MODE); +} + +void ResetSafariZoneFlag(void) +{ + FlagReset(SYS_SAFARI_MODE); +} + +void EnterSafariMode(void) +{ + IncrementGameStat(GAME_STAT_ENTERED_SAFARI_ZONE); + SetSafariZoneFlag(); + ClearAllPokeblockFeeders(); + gNumSafariBalls = 30; + sSafariZoneStepCounter = 500; + sSafariZoneCaughtMons = 0; + sSafariZoneFleedMons = 0; +} + +void ExitSafariMode(void) +{ + sub_80EE44C(sSafariZoneCaughtMons, sSafariZoneFleedMons); + ResetSafariZoneFlag(); + ClearAllPokeblockFeeders(); + gNumSafariBalls = 0; + sSafariZoneStepCounter = 0; +} + +bool8 SafariZoneTakeStep(void) +{ + if (GetSafariZoneFlag() == FALSE) + { + return FALSE; + } + + DecrementFeederStepCounters(); + sSafariZoneStepCounter--; + if (sSafariZoneStepCounter == 0) + { + ScriptContext1_SetupScript(gUnknown_082A4B8A); + return TRUE; + } + return FALSE; +} + +void SafariZoneRetirePrompt(void) +{ + ScriptContext1_SetupScript(gUnknown_082A4B6F); +} + +void sub_80FC190(void) +{ + sSafariZoneFleedMons += gBattleResults.field_1F; + if (gBattleOutcome == BATTLE_CAUGHT) + sSafariZoneCaughtMons++; + if (gNumSafariBalls != 0) + { + SetMainCallback2(c2_exit_to_overworld_2_switch); + } + else if (gBattleOutcome == 8) + { + ScriptContext2_RunNewScript(gUnknown_082A4B4C); + warp_in(); + gUnknown_03005DAC = sub_80AF6F0; + SetMainCallback2(c2_load_new_map); + } + else if (gBattleOutcome == BATTLE_CAUGHT) + { + ScriptContext1_SetupScript(gUnknown_082A4B9B); + ScriptContext1_Stop(); + SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music); + } +} + +static void ClearPokeblockFeeder(u8 index) +{ + memset(&sPokeblockFeeders[index], 0, sizeof(struct PokeblockFeeder)); +} + +static void ClearAllPokeblockFeeders(void) +{ + memset(sPokeblockFeeders, 0, sizeof(sPokeblockFeeders)); +} + +static void GetPokeblockFeederInFront(void) +{ + s16 x, y; + u16 i; + + GetXYCoordsOneStepInFrontOfPlayer(&x, &y); + + for (i = 0; i < NUM_POKEBLOCK_FEEDERS; i++) + { + if (gSaveBlock1Ptr->location.mapNum == sPokeblockFeeders[i].mapNum + && sPokeblockFeeders[i].x == x + && sPokeblockFeeders[i].y == y) + { + gScriptResult = i; + StringCopy(gStringVar1, gPokeblockNames[sPokeblockFeeders[i].pokeblock.color]); + return; + } + } + + gScriptResult = -1; +} + +void GetPokeblockFeederWithinRange(void) +{ + s16 x, y; + u16 i; + + PlayerGetDestCoords(&x, &y); + + for (i = 0; i < NUM_POKEBLOCK_FEEDERS; i++) + { + if (gSaveBlock1Ptr->location.mapNum == sPokeblockFeeders[i].mapNum) + { + //Get absolute value of x and y distance from Pokeblock feeder on current map + x -= sPokeblockFeeders[i].x; + y -= sPokeblockFeeders[i].y; + if (x < 0) + x *= -1; + if (y < 0) + y *= -1; + if ((x + y) <= 5) + { + gScriptResult = i; + return; + } + } + } + + gScriptResult = -1; +} + +// unused +struct Pokeblock *SafariZoneGetPokeblockInFront(void) +{ + GetPokeblockFeederInFront(); + + if (gScriptResult == 0xFFFF) + return NULL; + else + return &sPokeblockFeeders[gScriptResult].pokeblock; +} + +struct Pokeblock *SafariZoneGetActivePokeblock(void) +{ + GetPokeblockFeederWithinRange(); + + if (gScriptResult == 0xFFFF) + return NULL; + else + return &sPokeblockFeeders[gScriptResult].pokeblock; +} + +void SafariZoneActivatePokeblockFeeder(u8 pkblId) +{ + s16 x, y; + u8 i; + + for (i = 0; i < NUM_POKEBLOCK_FEEDERS; i++) + { + // Find free entry in sPokeblockFeeders + if (sPokeblockFeeders[i].mapNum == 0 + && sPokeblockFeeders[i].x == 0 + && sPokeblockFeeders[i].y == 0) + { + // Initialize Pokeblock feeder + GetXYCoordsOneStepInFrontOfPlayer(&x, &y); + sPokeblockFeeders[i].mapNum = gSaveBlock1Ptr->location.mapNum; + sPokeblockFeeders[i].pokeblock = gSaveBlock1Ptr->pokeblocks[pkblId]; + sPokeblockFeeders[i].stepCounter = 100; + sPokeblockFeeders[i].x = x; + sPokeblockFeeders[i].y = y; + break; + } + } +} + +static void DecrementFeederStepCounters(void) +{ + u8 i; + + for (i = 0; i < NUM_POKEBLOCK_FEEDERS; i++) + { + if (sPokeblockFeeders[i].stepCounter != 0) + { + sPokeblockFeeders[i].stepCounter--; + if (sPokeblockFeeders[i].stepCounter == 0) + ClearPokeblockFeeder(i); + } + } +} + +// unused +bool8 GetInFrontFeederPokeblockAndSteps(void) +{ + GetPokeblockFeederInFront(); + + if (gScriptResult == 0xFFFF) + { + return FALSE; + } + + ConvertIntToDecimalStringN(gStringVar2, + sPokeblockFeeders[gScriptResult].stepCounter, + STR_CONV_MODE_LEADING_ZEROS, 3); + + return TRUE; +} diff --git a/src/save.c b/src/save.c index ccb653f66..5ca855247 100644 --- a/src/save.c +++ b/src/save.c @@ -5,7 +5,6 @@ extern struct SaveSectionOffsets gSaveSectionOffsets[0xE]; extern struct SaveSectionLocation gRamSaveSectionLocations[0xE]; -extern void *gUnknown_03005D94; extern u8 gDecompressionBuffer[]; extern u32 gFlashMemoryPresent; extern u16 gUnknown_03006294; @@ -593,7 +592,7 @@ void UpdateSaveAddresses(void) for(i = 5; i < 14; i++) { - gRamSaveSectionLocations[i].data = gUnknown_03005D94 + gSaveSectionOffsets[i].toAdd; + gRamSaveSectionLocations[i].data = gPokemonStoragePtr + gSaveSectionOffsets[i].toAdd; gRamSaveSectionLocations[i].size = gSaveSectionOffsets[i].size; } } @@ -630,7 +629,7 @@ _081531AC:\n\ bge _081531AC\n\ movs r4, 0x5\n\ ldr r1, =gRamSaveSectionLocations\n\ - ldr r5, =gUnknown_03005D94\n\ + ldr r5, =gPokemonStoragePtr\n\ ldr r0, =gSaveSectionOffsets\n\ adds r3, r1, 0\n\ adds r3, 0x28\n\ diff --git a/src/script.c b/src/script.c new file mode 100644 index 000000000..b2809a137 --- /dev/null +++ b/src/script.c @@ -0,0 +1,434 @@ +#include "global.h" +#include "script.h" +#include "event_data.h" +#include "util.h" + +#define RAM_SCRIPT_MAGIC 51 + +extern u8* gUnknown_020375C0; + +extern bool32 sub_801B27C(void); + +// ewram bss +IWRAM_DATA static u8 sScriptContext1Status; +IWRAM_DATA static u32 sUnusedVariable1; +IWRAM_DATA static struct ScriptContext sScriptContext1; +IWRAM_DATA static u32 sUnusedVariable2; +IWRAM_DATA static struct ScriptContext sScriptContext2; +IWRAM_DATA static bool8 sScriptContext2Enabled; + +extern ScrCmdFunc gScriptCmdTable[]; +extern ScrCmdFunc gScriptCmdTableEnd[]; +extern void *gNullScriptPtr; + +void InitScriptContext(struct ScriptContext *ctx, void *cmdTable, void *cmdTableEnd) +{ + s32 i; + + ctx->mode = 0; + ctx->scriptPtr = 0; + ctx->stackDepth = 0; + ctx->nativePtr = 0; + ctx->cmdTable = cmdTable; + ctx->cmdTableEnd = cmdTableEnd; + + for (i = 0; i < 4; i++) + ctx->data[i] = 0; + + for (i = 0; i < 20; i++) + ctx->stack[i] = 0; +} + +u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr) +{ + ctx->scriptPtr = ptr; + ctx->mode = 1; + return 1; +} + +void SetupNativeScript(struct ScriptContext *ctx, bool8 (*ptr)(void)) +{ + ctx->mode = 2; + ctx->nativePtr = ptr; +} + +void StopScript(struct ScriptContext *ctx) +{ + ctx->mode = 0; + ctx->scriptPtr = 0; +} + +bool8 RunScriptCommand(struct ScriptContext *ctx) +{ + if (ctx->mode == 0) + return FALSE; + + switch (ctx->mode) + { + case 0: + return FALSE; + case 2: + if (ctx->nativePtr) + { + if (ctx->nativePtr() == TRUE) + ctx->mode = 1; + return TRUE; + } + ctx->mode = 1; + case 1: + while (1) + { + u8 cmdCode; + ScrCmdFunc *func; + + if (!ctx->scriptPtr) + { + ctx->mode = 0; + return FALSE; + } + + if (ctx->scriptPtr == gNullScriptPtr) + { + while (1) + asm("svc 2"); // HALT + } + + cmdCode = *(ctx->scriptPtr); + ctx->scriptPtr++; + func = &ctx->cmdTable[cmdCode]; + + if (func >= ctx->cmdTableEnd) + { + ctx->mode = 0; + return FALSE; + } + + if ((*func)(ctx) == 1) + return TRUE; + } + } + + return TRUE; +} + +u8 ScriptPush(struct ScriptContext *ctx, const u8 *ptr) +{ + if (ctx->stackDepth + 1 >= 20) + { + return 1; + } + else + { + ctx->stack[ctx->stackDepth] = ptr; + ctx->stackDepth++; + return 0; + } +} + +const u8 *ScriptPop(struct ScriptContext *ctx) +{ + if (ctx->stackDepth == 0) + return NULL; + + ctx->stackDepth--; + return ctx->stack[ctx->stackDepth]; +} + +void ScriptJump(struct ScriptContext *ctx, u8 *ptr) +{ + ctx->scriptPtr = ptr; +} + +void ScriptCall(struct ScriptContext *ctx, u8 *ptr) +{ + ScriptPush(ctx, ctx->scriptPtr); + ctx->scriptPtr = ptr; +} + +void ScriptReturn(struct ScriptContext *ctx) +{ + ctx->scriptPtr = ScriptPop(ctx); +} + +u16 ScriptReadHalfword(struct ScriptContext *ctx) +{ + u16 value = *(ctx->scriptPtr++); + value |= *(ctx->scriptPtr++) << 8; + return value; +} + +u32 ScriptReadWord(struct ScriptContext *ctx) +{ + u32 value0 = *(ctx->scriptPtr++); + u32 value1 = *(ctx->scriptPtr++); + u32 value2 = *(ctx->scriptPtr++); + u32 value3 = *(ctx->scriptPtr++); + return (((((value3 << 8) + value2) << 8) + value1) << 8) + value0; +} + +void ScriptContext2_Enable(void) +{ + sScriptContext2Enabled = TRUE; +} + +void ScriptContext2_Disable(void) +{ + sScriptContext2Enabled = FALSE; +} + +bool8 ScriptContext2_IsEnabled(void) +{ + return sScriptContext2Enabled; +} + +bool8 ScriptContext1_IsScriptSetUp(void) +{ + if (sScriptContext1Status == 0) + return TRUE; + else + return FALSE; +} + +void ScriptContext1_Init(void) +{ + InitScriptContext(&sScriptContext1, gScriptCmdTable, gScriptCmdTableEnd); + sScriptContext1Status = 2; +} + +bool8 ScriptContext2_RunScript(void) +{ + if (sScriptContext1Status == 2) + return 0; + + if (sScriptContext1Status == 1) + return 0; + + ScriptContext2_Enable(); + + if (!RunScriptCommand(&sScriptContext1)) + { + sScriptContext1Status = 2; + ScriptContext2_Disable(); + return 0; + } + + return 1; +} + +void ScriptContext1_SetupScript(const u8 *ptr) +{ + InitScriptContext(&sScriptContext1, gScriptCmdTable, gScriptCmdTableEnd); + SetupBytecodeScript(&sScriptContext1, ptr); + ScriptContext2_Enable(); + sScriptContext1Status = 0; +} + +void ScriptContext1_Stop(void) +{ + sScriptContext1Status = 1; +} + +void EnableBothScriptContexts(void) +{ + sScriptContext1Status = 0; + ScriptContext2_Enable(); +} + +void ScriptContext2_RunNewScript(const u8 *ptr) +{ + InitScriptContext(&sScriptContext2, &gScriptCmdTable, &gScriptCmdTableEnd); + SetupBytecodeScript(&sScriptContext2, ptr); + while (RunScriptCommand(&sScriptContext2) == TRUE); +} + +u8 *mapheader_get_tagged_pointer(u8 tag) +{ + u8 *mapScripts = gMapHeader.mapScripts; + + if (!mapScripts) + return NULL; + + while (1) + { + if (!*mapScripts) + return NULL; + if (*mapScripts == tag) + { + mapScripts++; + return (u8 *)(mapScripts[0] + (mapScripts[1] << 8) + (mapScripts[2] << 16) + (mapScripts[3] << 24)); + } + mapScripts += 5; + } +} + +void mapheader_run_script_by_tag(u8 tag) +{ + u8 *ptr = mapheader_get_tagged_pointer(tag); + if (ptr) + ScriptContext2_RunNewScript(ptr); +} + +u8 *mapheader_get_first_match_from_tagged_ptr_list(u8 tag) +{ + u8 *ptr = mapheader_get_tagged_pointer(tag); + + if (!ptr) + return NULL; + + while (1) + { + u16 varIndex1; + u16 varIndex2; + varIndex1 = ptr[0] | (ptr[1] << 8); + if (!varIndex1) + return NULL; + ptr += 2; + varIndex2 = ptr[0] | (ptr[1] << 8); + ptr += 2; + if (VarGet(varIndex1) == VarGet(varIndex2)) + return (u8 *)(ptr[0] + (ptr[1] << 8) + (ptr[2] << 16) + (ptr[3] << 24)); + ptr += 4; + } +} + +void mapheader_run_script_with_tag_x1(void) +{ + mapheader_run_script_by_tag(1); +} + +void mapheader_run_script_with_tag_x3(void) +{ + mapheader_run_script_by_tag(3); +} + +void mapheader_run_script_with_tag_x5(void) +{ + mapheader_run_script_by_tag(5); +} + +void mapheader_run_script_with_tag_x7(void) +{ + mapheader_run_script_by_tag(7); +} + +void mapheader_run_script_with_tag_x6(void) +{ + mapheader_run_script_by_tag(6); +} + +bool8 mapheader_run_first_tag2_script_list_match(void) +{ + u8 *ptr = mapheader_get_first_match_from_tagged_ptr_list(2); + + if (!ptr) + return 0; + + ScriptContext1_SetupScript(ptr); + return 1; +} + +void mapheader_run_first_tag4_script_list_match(void) +{ + u8 *ptr = mapheader_get_first_match_from_tagged_ptr_list(4); + if (ptr) + ScriptContext2_RunNewScript(ptr); +} + +u32 CalculateRamScriptChecksum(void) +{ + return CalcCRC16WithTable((u8*)(&gSaveBlock1Ptr->ramScript.data), sizeof(gSaveBlock1Ptr->ramScript.data)); +} + +void ClearRamScript(void) +{ + CpuFill32(0, &gSaveBlock1Ptr->ramScript, sizeof(struct RamScript)); +} + +bool8 InitRamScript(u8 *script, u16 scriptSize, u8 mapGroup, u8 mapNum, u8 objectId) +{ + struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data; + + ClearRamScript(); + + if (scriptSize > sizeof(scriptData->script)) + return FALSE; + + scriptData->magic = RAM_SCRIPT_MAGIC; + scriptData->mapGroup = mapGroup; + scriptData->mapNum = mapNum; + scriptData->objectId = objectId; + memcpy(scriptData->script, script, scriptSize); + gSaveBlock1Ptr->ramScript.checksum = CalculateRamScriptChecksum(); + return TRUE; +} + +u8 *GetRamScript(u8 objectId, u8 *script) +{ + struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data; + gUnknown_020375C0 = NULL; + if (scriptData->magic != RAM_SCRIPT_MAGIC) + return script; + if (scriptData->mapGroup != gSaveBlock1Ptr->location.mapGroup) + return script; + if (scriptData->mapNum != gSaveBlock1Ptr->location.mapNum) + return script; + if (scriptData->objectId != objectId) + return script; + if (CalculateRamScriptChecksum() != gSaveBlock1Ptr->ramScript.checksum) + { + ClearRamScript(); + return script; + } + else + { + gUnknown_020375C0 = script; + return scriptData->script; + } +} + +bool32 sub_80991F8(void) +{ + struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data; + if (scriptData->magic != RAM_SCRIPT_MAGIC) + return FALSE; + if (scriptData->mapGroup != 0xFF) + return FALSE; + if (scriptData->mapNum != 0xFF) + return FALSE; + if (scriptData->objectId != 0xFF) + return FALSE; + if (CalculateRamScriptChecksum() != gSaveBlock1Ptr->ramScript.checksum) + return FALSE; + return TRUE; +} + +u8 *sub_8099244(void) +{ + struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data; + if (!sub_801B27C()) + return NULL; + if (scriptData->magic != RAM_SCRIPT_MAGIC) + return NULL; + if (scriptData->mapGroup != 0xFF) + return NULL; + if (scriptData->mapNum != 0xFF) + return NULL; + if (scriptData->objectId != 0xFF) + return NULL; + if (CalculateRamScriptChecksum() != gSaveBlock1Ptr->ramScript.checksum) + { + ClearRamScript(); + return NULL; + } + else + { + return scriptData->script; + } +} + +void sub_80992A0(u8 *script, u16 scriptSize) +{ + if (scriptSize > sizeof(gSaveBlock1Ptr->ramScript.data.script)) + scriptSize = sizeof(gSaveBlock1Ptr->ramScript.data.script); + InitRamScript(script, scriptSize, 0xFF, 0xFF, 0xFF); +} diff --git a/src/start_menu.c b/src/start_menu.c new file mode 100644 index 000000000..ffcab5220 --- /dev/null +++ b/src/start_menu.c @@ -0,0 +1,231 @@ +#include "global.h" +#include "start_menu.h" +#include "menu.h" +#include "safari_zone.h" +#include "event_data.h" +#include "window.h" +#include "string_util.h" +#include "text.h" + +// Menu actions +enum +{ + MENU_ACTION_POKEDEX, + MENU_ACTION_POKEMON, + MENU_ACTION_BAG, + MENU_ACTION_POKENAV, + MENU_ACTION_PLAYER, + MENU_ACTION_SAVE, + MENU_ACTION_OPTION, + MENU_ACTION_EXIT, + MENU_ACTION_RETIRE_SAFARI, + MENU_ACTION_PLAYER_LINK, + MENU_ACTION_REST_FRONTIER, + MENU_ACTION_RETIRE_FRONTIER, + MENU_ACTION_PYRAMID_BAG +}; + +static void BuildStartMenuActions_LinkMode(void); +static void BuildStartMenuActions_UnionRoom(void); +static void BuildStartMenuActions_SafariZone(void); +static void BuildStartMenuActions_BattlePike(void); +static void BuildStartMenuActions_BattlePyramid(void); +static void BuildStartMenuActions_MultiBattleRoom(void); +static void BuildStartMenuActions_Normal(void); +u8 StartMenu_PlayerName(void); + +extern bool32 is_c1_link_related_active(void); +extern bool32 InUnionRoom(void); +extern bool8 InBattlePike(void); +extern bool8 InBattlePyramid(void); +extern bool8 InMultiBattleRoom(void); +extern void sub_81973FC(u8 windowId, u8 a1); +extern void sub_8198070(u8 windowId, u8 a1); + +EWRAM_DATA u8 sSafariBallsWindowId = 0; +EWRAM_DATA u8 sBattlePyramidFloorWindowId = 0; +EWRAM_DATA u8 sStartMenuCursorPos = 0; +EWRAM_DATA u8 sNumStartMenuActions = 0; +EWRAM_DATA u8 sCurrentStartMenuActions[9] = {0}; + +void BuildStartMenuActions(void) +{ + sNumStartMenuActions = 0; + if (is_c1_link_related_active() == TRUE) + BuildStartMenuActions_LinkMode(); + else if (InUnionRoom() == TRUE) + BuildStartMenuActions_UnionRoom(); + else if (GetSafariZoneFlag() == TRUE) + BuildStartMenuActions_SafariZone(); + else if (InBattlePike()) + BuildStartMenuActions_BattlePike(); + else if (InBattlePyramid()) + BuildStartMenuActions_BattlePyramid(); + else if (InMultiBattleRoom()) + BuildStartMenuActions_MultiBattleRoom(); + else + BuildStartMenuActions_Normal(); +} + +void AddStartMenuAction(u8 action) +{ + AppendToList(sCurrentStartMenuActions, &sNumStartMenuActions, action); +} + +static void BuildStartMenuActions_Normal(void) +{ + if (FlagGet(SYS_POKEDEX_GET) == TRUE) + AddStartMenuAction(MENU_ACTION_POKEDEX); + if (FlagGet(SYS_POKEMON_GET) == TRUE) + AddStartMenuAction(MENU_ACTION_POKEMON); + AddStartMenuAction(MENU_ACTION_BAG); + if (FlagGet(SYS_POKENAV_GET) == TRUE) + AddStartMenuAction(MENU_ACTION_POKENAV); + AddStartMenuAction(MENU_ACTION_PLAYER); + AddStartMenuAction(MENU_ACTION_SAVE); + AddStartMenuAction(MENU_ACTION_OPTION); + AddStartMenuAction(MENU_ACTION_EXIT); +} + +static void BuildStartMenuActions_SafariZone(void) +{ + AddStartMenuAction(MENU_ACTION_RETIRE_SAFARI); + AddStartMenuAction(MENU_ACTION_POKEDEX); + AddStartMenuAction(MENU_ACTION_POKEMON); + AddStartMenuAction(MENU_ACTION_BAG); + AddStartMenuAction(MENU_ACTION_PLAYER); + AddStartMenuAction(MENU_ACTION_OPTION); + AddStartMenuAction(MENU_ACTION_EXIT); +} + +static void BuildStartMenuActions_LinkMode(void) +{ + AddStartMenuAction(MENU_ACTION_POKEMON); + AddStartMenuAction(MENU_ACTION_BAG); + if (FlagGet(SYS_POKENAV_GET) == TRUE) + AddStartMenuAction(MENU_ACTION_POKENAV); + AddStartMenuAction(MENU_ACTION_PLAYER_LINK); + AddStartMenuAction(MENU_ACTION_OPTION); + AddStartMenuAction(MENU_ACTION_EXIT); +} + +static void BuildStartMenuActions_UnionRoom(void) +{ + AddStartMenuAction(MENU_ACTION_POKEMON); + AddStartMenuAction(MENU_ACTION_BAG); + if (FlagGet(SYS_POKENAV_GET) == TRUE) + AddStartMenuAction(MENU_ACTION_POKENAV); + AddStartMenuAction(MENU_ACTION_PLAYER); + AddStartMenuAction(MENU_ACTION_OPTION); + AddStartMenuAction(MENU_ACTION_EXIT); +} + +static void BuildStartMenuActions_BattlePike(void) +{ + AddStartMenuAction(MENU_ACTION_POKEDEX); + AddStartMenuAction(MENU_ACTION_POKEMON); + AddStartMenuAction(MENU_ACTION_PLAYER); + AddStartMenuAction(MENU_ACTION_OPTION); + AddStartMenuAction(MENU_ACTION_EXIT); +} + +static void BuildStartMenuActions_BattlePyramid(void) +{ + AddStartMenuAction(MENU_ACTION_POKEMON); + AddStartMenuAction(MENU_ACTION_PYRAMID_BAG); + AddStartMenuAction(MENU_ACTION_PLAYER); + AddStartMenuAction(MENU_ACTION_REST_FRONTIER); + AddStartMenuAction(MENU_ACTION_RETIRE_FRONTIER); + AddStartMenuAction(MENU_ACTION_OPTION); + AddStartMenuAction(MENU_ACTION_EXIT); +} + +static void BuildStartMenuActions_MultiBattleRoom(void) +{ + AddStartMenuAction(MENU_ACTION_POKEMON); + AddStartMenuAction(MENU_ACTION_PLAYER); + AddStartMenuAction(MENU_ACTION_OPTION); + AddStartMenuAction(MENU_ACTION_EXIT); +} + +extern const struct WindowTemplate gSafariBallsWindowTemplate; +extern const struct WindowTemplate gPyramidFloorWindowTemplate_1; +extern const struct WindowTemplate gPyramidFloorWindowTemplate_2; +extern const u8 gOtherText_SafariStock[]; + +void DisplaySafariBallsWindow(void) +{ + sSafariBallsWindowId = AddWindow(&gSafariBallsWindowTemplate); + PutWindowTilemap(sSafariBallsWindowId); + sub_81973FC(sSafariBallsWindowId, 0); + ConvertIntToDecimalStringN(gStringVar1, gNumSafariBalls, STR_CONV_MODE_RIGHT_ALIGN, 2); + StringExpandPlaceholders(gStringVar4, gOtherText_SafariStock); + PrintTextOnWindow(sSafariBallsWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL); + CopyWindowToVram(sSafariBallsWindowId, 2); +} + +extern const u8* const gUnknown_08510510[]; +extern const u8 gOtherText_BattlePyramid_X[]; + +void DisplayPyramidFloorWindow(void) +{ + // TODO: fix location + if (*(u16*)(&gSaveBlock2Ptr->field_CAA[8]) == 7) + sBattlePyramidFloorWindowId = AddWindow(&gPyramidFloorWindowTemplate_1); + else + sBattlePyramidFloorWindowId = AddWindow(&gPyramidFloorWindowTemplate_2); + PutWindowTilemap(sBattlePyramidFloorWindowId); + sub_81973FC(sBattlePyramidFloorWindowId, 0); + StringCopy(gStringVar1, gUnknown_08510510[*(u16*)(&gSaveBlock2Ptr->field_CAA[8])]); + StringExpandPlaceholders(gStringVar4, gOtherText_BattlePyramid_X); + PrintTextOnWindow(sBattlePyramidFloorWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL); + CopyWindowToVram(sBattlePyramidFloorWindowId, 2); +} + +void RemoveExtraStartMenuWindows(void) +{ + if (GetSafariZoneFlag()) + { + sub_8198070(sSafariBallsWindowId, 0); + CopyWindowToVram(sSafariBallsWindowId, 2); + RemoveWindow(sSafariBallsWindowId); + } + if (InBattlePyramid()) + { + sub_8198070(sBattlePyramidFloorWindowId, 0); + RemoveWindow(sBattlePyramidFloorWindowId); + } +} + +extern const struct MenuAction sStartMenuItems[]; + +/* +// Prints n menu items starting at *index +static bool32 PrintStartMenuItemsMultistep(s16 *index, u32 n) +{ + s8 _index = *index; + + do + { + if (sStartMenuItems[sCurrentStartMenuActions[_index]].func == StartMenu_PlayerName) + { + + } + else + { + + } + + } while (++_index > sNumStartMenuActions); + + if (--n == 0) + { + *index = _index; + return FALSE; + } + else + { + *index = _index; + return TRUE; + } +}*/ diff --git a/src/task.c b/src/task.c index 70dd6b292..fafa7c70d 100644 --- a/src/task.c +++ b/src/task.c @@ -9,7 +9,7 @@ struct Task gTasks[NUM_TASKS]; static void InsertTask(u8 newTaskId); static u8 FindFirstActiveTask(); -void ResetTasks() +void ResetTasks(void) { u8 i; @@ -110,7 +110,7 @@ void DestroyTask(u8 taskId) } } -void RunTasks() +void RunTasks(void) { u8 taskId = FindFirstActiveTask(); @@ -189,7 +189,7 @@ u8 FindTaskIdByFunc(TaskFunc func) return -1; } -u8 GetTaskCount() +u8 GetTaskCount(void) { u8 i; u8 count = 0; diff --git a/src/text.c b/src/text.c index 6754e1a42..cad8326e3 100644 --- a/src/text.c +++ b/src/text.c @@ -149,7 +149,7 @@ void DeactivateAllTextPrinters (void) gTextPrinters[printer].sub_union.sub.active = 0; } -u16 Print(u8 windowId, u8 fontId, u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16)) +u16 PrintTextOnWindow(u8 windowId, u8 fontId, u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16)) { struct TextSubPrinter subPrinter; diff --git a/src/util.c b/src/util.c new file mode 100644 index 000000000..27b7c5ee5 --- /dev/null +++ b/src/util.c @@ -0,0 +1,503 @@ +#include "global.h" +#include "util.h" +#include "sprite.h" + +const u32 gBitTable[] = +{ + 1 << 0, + 1 << 1, + 1 << 2, + 1 << 3, + 1 << 4, + 1 << 5, + 1 << 6, + 1 << 7, + 1 << 8, + 1 << 9, + 1 << 10, + 1 << 11, + 1 << 12, + 1 << 13, + 1 << 14, + 1 << 15, + 1 << 16, + 1 << 17, + 1 << 18, + 1 << 19, + 1 << 20, + 1 << 21, + 1 << 22, + 1 << 23, + 1 << 24, + 1 << 25, + 1 << 26, + 1 << 27, + 1 << 28, + 1 << 29, + 1 << 30, + 1 << 31, +}; + +static const struct SpriteTemplate sInvisibleSpriteTemplate = +{ + .tileTag = 0, + .paletteTag = 0, + .oam = &gDummyOamData, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const u8 sSpriteDimensions[3][4][2] = +{ + // square + { + {1, 1}, + {2, 2}, + {4, 4}, + {8, 8}, + }, + + // horizontal rectangle + { + {2, 1}, + {4, 1}, + {4, 2}, + {8, 4}, + }, + + // vertical rectangle + { + {1, 2}, + {1, 4}, + {2, 4}, + {4, 8}, + }, +}; + +static const u16 sCrc16Table[] = +{ + 0x0000, 0x1189, 0x2312, 0x329B, 0x4624, 0x57AD, 0x6536, 0x74BF, + 0x8C48, 0x9DC1, 0xAF5A, 0xBED3, 0xCA6C, 0xDBE5, 0xE97E, 0xF8F7, + 0x1081, 0x0108, 0x3393, 0x221A, 0x56A5, 0x472C, 0x75B7, 0x643E, + 0x9CC9, 0x8D40, 0xBFDB, 0xAE52, 0xDAED, 0xCB64, 0xF9FF, 0xE876, + 0x2102, 0x308B, 0x0210, 0x1399, 0x6726, 0x76AF, 0x4434, 0x55BD, + 0xAD4A, 0xBCC3, 0x8E58, 0x9FD1, 0xEB6E, 0xFAE7, 0xC87C, 0xD9F5, + 0x3183, 0x200A, 0x1291, 0x0318, 0x77A7, 0x662E, 0x54B5, 0x453C, + 0xBDCB, 0xAC42, 0x9ED9, 0x8F50, 0xFBEF, 0xEA66, 0xD8FD, 0xC974, + 0x4204, 0x538D, 0x6116, 0x709F, 0x0420, 0x15A9, 0x2732, 0x36BB, + 0xCE4C, 0xDFC5, 0xED5E, 0xFCD7, 0x8868, 0x99E1, 0xAB7A, 0xBAF3, + 0x5285, 0x430C, 0x7197, 0x601E, 0x14A1, 0x0528, 0x37B3, 0x263A, + 0xDECD, 0xCF44, 0xFDDF, 0xEC56, 0x98E9, 0x8960, 0xBBFB, 0xAA72, + 0x6306, 0x728F, 0x4014, 0x519D, 0x2522, 0x34AB, 0x0630, 0x17B9, + 0xEF4E, 0xFEC7, 0xCC5C, 0xDDD5, 0xA96A, 0xB8E3, 0x8A78, 0x9BF1, + 0x7387, 0x620E, 0x5095, 0x411C, 0x35A3, 0x242A, 0x16B1, 0x0738, + 0xFFCF, 0xEE46, 0xDCDD, 0xCD54, 0xB9EB, 0xA862, 0x9AF9, 0x8B70, + 0x8408, 0x9581, 0xA71A, 0xB693, 0xC22C, 0xD3A5, 0xE13E, 0xF0B7, + 0x0840, 0x19C9, 0x2B52, 0x3ADB, 0x4E64, 0x5FED, 0x6D76, 0x7CFF, + 0x9489, 0x8500, 0xB79B, 0xA612, 0xD2AD, 0xC324, 0xF1BF, 0xE036, + 0x18C1, 0x0948, 0x3BD3, 0x2A5A, 0x5EE5, 0x4F6C, 0x7DF7, 0x6C7E, + 0xA50A, 0xB483, 0x8618, 0x9791, 0xE32E, 0xF2A7, 0xC03C, 0xD1B5, + 0x2942, 0x38CB, 0x0A50, 0x1BD9, 0x6F66, 0x7EEF, 0x4C74, 0x5DFD, + 0xB58B, 0xA402, 0x9699, 0x8710, 0xF3AF, 0xE226, 0xD0BD, 0xC134, + 0x39C3, 0x284A, 0x1AD1, 0x0B58, 0x7FE7, 0x6E6E, 0x5CF5, 0x4D7C, + 0xC60C, 0xD785, 0xE51E, 0xF497, 0x8028, 0x91A1, 0xA33A, 0xB2B3, + 0x4A44, 0x5BCD, 0x6956, 0x78DF, 0x0C60, 0x1DE9, 0x2F72, 0x3EFB, + 0xD68D, 0xC704, 0xF59F, 0xE416, 0x90A9, 0x8120, 0xB3BB, 0xA232, + 0x5AC5, 0x4B4C, 0x79D7, 0x685E, 0x1CE1, 0x0D68, 0x3FF3, 0x2E7A, + 0xE70E, 0xF687, 0xC41C, 0xD595, 0xA12A, 0xB0A3, 0x8238, 0x93B1, + 0x6B46, 0x7ACF, 0x4854, 0x59DD, 0x2D62, 0x3CEB, 0x0E70, 0x1FF9, + 0xF78F, 0xE606, 0xD49D, 0xC514, 0xB1AB, 0xA022, 0x92B9, 0x8330, + 0x7BC7, 0x6A4E, 0x58D5, 0x495C, 0x3DE3, 0x2C6A, 0x1EF1, 0x0F78, +}; + +const u8 gMiscBlank_Gfx[] = INCBIN_U8("graphics/interface/blank.4bpp"); // unused in Emerald + +u8 CreateInvisibleSpriteWithCallback(void (*callback)(struct Sprite *)) +{ + u8 sprite = CreateSprite(&sInvisibleSpriteTemplate, 248, 168, 14); + gSprites[sprite].invisible = TRUE; + gSprites[sprite].callback = callback; + return sprite; +} + +void StoreWordInTwoHalfwords(u16 *h, u32 w) +{ + h[0] = (u16)(w); + h[1] = (u16)(w >> 16); +} + +void LoadWordFromTwoHalfwords(u16 *h, u32 *w) +{ + *w = h[0] | (s16)h[1] << 16; +} + +void SetBgAffineStruct(struct BgAffineSrcData *src, u32 texX, u32 texY, s16 scrX, s16 scrY, s16 sx, s16 sy, u16 alpha) +{ + src->texX = texX; + src->texY = texY; + src->scrX = scrX; + src->scrY = scrY; + src->sx = sx; + src->sy = sy; + src->alpha = alpha; +} + +void DoBgAffineSet(struct BgAffineDstData *dest, u32 texX, u32 texY, s16 scrX, s16 scrY, s16 sx, s16 sy, u16 alpha) +{ + struct BgAffineSrcData src; + + SetBgAffineStruct(&src, texX, texY, scrX, scrY, sx, sy, alpha); + BgAffineSet(&src, dest, 1); +} + +#ifdef NONMATCHING + +// Functionally equivalent. +// Only the two yflip loops don't match. +void CopySpriteTiles(u8 shape, u8 size, u8 *tiles, u16 *tilemap, u8 *output) +{ + u8 x, y; + s8 i, j; + u8 xflip[32]; + u8 h = sSpriteDimensions[shape][size][1]; + u8 w = sSpriteDimensions[shape][size][0]; + + for (y = 0; y < h; y++) + { + int filler = 32 - w; + + for (x = 0; x < w; x++) + { + int tile = (*tilemap & 0x3ff) * 32; + int attr = *tilemap & 0xc00; + + if (attr == 0) + { + void *src = tiles + tile; + void *dest = output; + int length = 32; + DmaCopy32(3, src, dest, length); + } + else if (attr == 0x800) // yflip + { + for (i = 0; i < 8; i++) + { + void *src = tiles; + void *dest = output; + int length = 4; + // this is likely wrong, but makes it closer to matching + src += tile + (7 - i) * 4; + dest += i * 4; + DmaCopy32(3, src, dest, length); + } + } + else // xflip + { + for (i = 0; i < 8; i++) + { + for (j = 0; j < 4; j++) + { + u8 i2 = i * 4; + xflip[i2 + (3-j)] = (tiles[tile + i2 + j] & 0xf) << 4; + xflip[i2 + (3-j)] |= tiles[tile + i2 + j] >> 4; + } + } + if (*tilemap & 0x800) // yflip + { + for (i = 0; i < 8; i++) + { + void *src = xflip + (7-i) * 4; + void *dest = output + i*4; + int length = 4; + DmaCopy32(3, src, dest, length); + } + } + else + { + void *src = xflip; + void *dest = output; + int length = 32; + DmaCopy32(3, src, dest, length); + } + } + tilemap++; + output += 32; + } + tilemap += filler; + } +} + +#else +__attribute__((naked)) void CopySpriteTiles(u8 shape, u8 size, u8 *tiles, u16 *tilemap, u8 *output) +{ + asm("\n\ + .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, 0x38\n\ + str r2, [sp, 0x20]\n\ + adds r4, r3, 0\n\ + ldr r7, [sp, 0x58]\n\ + lsls r0, 24\n\ + lsls r1, 24\n\ + ldr r2, =sSpriteDimensions\n\ + lsrs r1, 23\n\ + lsrs r0, 21\n\ + adds r1, r0\n\ + adds r0, r2, 0x1\n\ + adds r0, r1, r0\n\ + ldrb r0, [r0]\n\ + str r0, [sp, 0x24]\n\ + adds r1, r2\n\ + ldrb r1, [r1]\n\ + str r1, [sp, 0x28]\n\ + movs r0, 0\n\ + b _0806F88C\n\ + .pool\n\ + _0806F740:\n\ + movs r5, 0\n\ + adds r0, 0x1\n\ + str r0, [sp, 0x30]\n\ + b _0806F874\n\ + _0806F748:\n\ + ldrh r0, [r4]\n\ + ldr r2, =0x000003ff\n\ + adds r1, r2, 0\n\ + ands r1, r0\n\ + lsls r1, 5\n\ + mov r8, r1\n\ + movs r2, 0xC0\n\ + lsls r2, 4\n\ + adds r1, r2, 0\n\ + ands r1, r0\n\ + mov r2, sp\n\ + strh r0, [r2, 0x34]\n\ + cmp r1, 0\n\ + bne _0806F788\n\ + ldr r0, [sp, 0x20]\n\ + add r0, r8\n\ + adds r1, r7, 0\n\ + ldr r2, =0x04000008\n\ + bl CpuSet\n\ + adds r4, 0x2\n\ + str r4, [sp, 0x2C]\n\ + adds r7, 0x20\n\ + mov r10, r7\n\ + adds r5, 0x1\n\ + mov r9, r5\n\ + b _0806F86A\n\ + .pool\n\ + _0806F788:\n\ + movs r0, 0x80\n\ + lsls r0, 4\n\ + cmp r1, r0\n\ + bne _0806F7CC\n\ + movs r1, 0\n\ + adds r4, 0x2\n\ + str r4, [sp, 0x2C]\n\ + movs r2, 0x20\n\ + adds r2, r7\n\ + mov r10, r2\n\ + adds r5, 0x1\n\ + mov r9, r5\n\ + _0806F7A0:\n\ + lsls r4, r1, 24\n\ + asrs r4, 24\n\ + movs r0, 0x7\n\ + subs r0, r4\n\ + lsls r0, 2\n\ + add r0, r8\n\ + ldr r1, [sp, 0x20]\n\ + adds r0, r1, r0\n\ + lsls r1, r4, 2\n\ + adds r1, r7, r1\n\ + ldr r2, =0x04000001\n\ + bl CpuSet\n\ + adds r4, 0x1\n\ + lsls r4, 24\n\ + lsrs r1, r4, 24\n\ + asrs r4, 24\n\ + cmp r4, 0x7\n\ + ble _0806F7A0\n\ + b _0806F86A\n\ + .pool\n\ + _0806F7CC:\n\ + movs r1, 0\n\ + adds r4, 0x2\n\ + str r4, [sp, 0x2C]\n\ + movs r2, 0x20\n\ + adds r2, r7\n\ + mov r10, r2\n\ + adds r5, 0x1\n\ + mov r9, r5\n\ + movs r0, 0xF\n\ + mov r12, r0\n\ + _0806F7E0:\n\ + movs r2, 0\n\ + lsls r4, r1, 24\n\ + lsls r0, r4, 2\n\ + lsrs r0, 24\n\ + adds r6, r0, 0x3\n\ + mov r1, r8\n\ + adds r5, r1, r0\n\ + _0806F7EE:\n\ + lsls r1, r2, 24\n\ + asrs r1, 24\n\ + subs r0, r6, r1\n\ + mov r2, sp\n\ + adds r3, r2, r0\n\ + adds r0, r5, r1\n\ + ldr r2, [sp, 0x20]\n\ + adds r0, r2, r0\n\ + ldrb r2, [r0]\n\ + mov r0, r12\n\ + ands r0, r2\n\ + lsls r0, 4\n\ + lsrs r2, 4\n\ + orrs r0, r2\n\ + strb r0, [r3]\n\ + adds r1, 0x1\n\ + lsls r1, 24\n\ + lsrs r2, r1, 24\n\ + asrs r1, 24\n\ + cmp r1, 0x3\n\ + ble _0806F7EE\n\ + movs r1, 0x80\n\ + lsls r1, 17\n\ + adds r0, r4, r1\n\ + lsrs r1, r0, 24\n\ + asrs r0, 24\n\ + cmp r0, 0x7\n\ + ble _0806F7E0\n\ + mov r2, sp\n\ + ldrh r0, [r2, 0x34]\n\ + movs r2, 0x80\n\ + lsls r2, 4\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + beq _0806F860\n\ + movs r1, 0\n\ + _0806F836:\n\ + lsls r4, r1, 24\n\ + asrs r4, 24\n\ + movs r0, 0x7\n\ + subs r0, r4\n\ + lsls r0, 2\n\ + add r0, sp\n\ + lsls r1, r4, 2\n\ + adds r1, r7, r1\n\ + ldr r2, =0x04000001\n\ + bl CpuSet\n\ + adds r4, 0x1\n\ + lsls r4, 24\n\ + lsrs r1, r4, 24\n\ + asrs r4, 24\n\ + cmp r4, 0x7\n\ + ble _0806F836\n\ + b _0806F86A\n\ + .pool\n\ + _0806F860:\n\ + mov r0, sp\n\ + adds r1, r7, 0\n\ + ldr r2, =0x04000008\n\ + bl CpuSet\n\ + _0806F86A:\n\ + ldr r4, [sp, 0x2C]\n\ + mov r7, r10\n\ + mov r1, r9\n\ + lsls r0, r1, 24\n\ + lsrs r5, r0, 24\n\ + _0806F874:\n\ + ldr r2, [sp, 0x28]\n\ + cmp r5, r2\n\ + bcs _0806F87C\n\ + b _0806F748\n\ + _0806F87C:\n\ + movs r0, 0x20\n\ + ldr r1, [sp, 0x28]\n\ + subs r0, r1\n\ + lsls r0, 1\n\ + adds r4, r0\n\ + ldr r2, [sp, 0x30]\n\ + lsls r0, r2, 24\n\ + lsrs r0, 24\n\ + _0806F88C:\n\ + ldr r1, [sp, 0x24]\n\ + cmp r0, r1\n\ + bcs _0806F894\n\ + b _0806F740\n\ + _0806F894:\n\ + add sp, 0x38\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided"); +} + +#endif // NONMATCHING + +int CountTrailingZeroBits(u32 value) +{ + u8 i; + + for (i = 0; i < 32; i++) + { + if ((value & 1) == 0) + value >>= 1; + else + return i; + } + return 0; +} + +u16 CalcCRC16(u8 *data, s32 length) +{ + u16 i, j; + u16 crc = 0x1121; + + for (i = 0; i < length; i++) + { + crc ^= data[i]; + for (j = 0; j < 8; j++) + { + if (crc & 1) + crc = (crc >> 1) ^ 0x8408; + else + crc >>= 1; + } + } + return ~crc; +} + +u16 CalcCRC16WithTable(u8 *data, u32 length) +{ + u16 i; + u16 crc = 0x1121; + u8 byte; + + for (i = 0; i < length; i++) + { + byte = crc >> 8; + crc ^= data[i]; + crc = byte ^ sCrc16Table[(u8)crc]; + } + return ~crc; +} + +u32 CalcByteArraySum(const u8* data, u32 length) +{ + u32 sum, i; + for (sum = 0, i = 0; i < length; i++) + sum += data[i]; + return sum; +} diff --git a/src/window.c b/src/window.c index f3d2e833e..574b13aa0 100644 --- a/src/window.c +++ b/src/window.c @@ -118,7 +118,7 @@ bool16 InitWindows(struct WindowTemplate *templates) return TRUE; } -u16 AddWindow(struct WindowTemplate *template) +u16 AddWindow(const struct WindowTemplate *template) { u16 win; u8 bgLayer; diff --git a/sym_bss.txt b/sym_bss.txt index 80856b170..070e7e5f9 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -23,20 +23,7 @@ gDma3RequestCursor: @ 3000811 .space 0x7 .include "src/gpu_regs.o" - - .align 4 -gUnknown_030008E0: @ 30008E0 - .space 0x18 - -gUnknown_030008F8: @ 30008F8 - .space 0x4 - -gUnknown_030008FC: @ 30008FC - .space 0x3C - -gUnknown_03000938: @ 3000938 - .space 0x10 - + .include "src/bg.o" .include "src/text.o" .include "src/sprite.o" @@ -175,18 +162,9 @@ gUnknown_03000E2C: @ 3000E2C gUnknown_03000E30: @ 3000E30 .space 0x8 -gUnknown_03000E38: @ 3000E38 - .space 0x8 - -gUnknown_03000E40: @ 3000E40 - .space 0x78 - -gUnknown_03000EB8: @ 3000EB8 - .space 0x74 - -gUnknown_03000F2C: @ 3000F2C - .space 0x4 +.include "src/script.o" +.align 2 gUnknown_03000F30: @ 3000F30 .space 0x4 @@ -336,10 +314,10 @@ gUnknown_03001204: @ 3001204 gUnknown_03001208: @ 3001208 .space 0x2 -gUnknown_0300120A: @ 300120A +sTestingTransitionId: @ 300120A .space 0x1 -gUnknown_0300120B: @ 300120B +sTestingTransitionState: @ 300120B .space 0x5 gUnknown_03001210: @ 3001210 diff --git a/sym_common.txt b/sym_common.txt index dbf6c17a8..c2a966f53 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -39,9 +39,9 @@ IntrMain_Buffer: @ 3002750 gPcmDmaCounter: @ 3002F50 .space 0x4 -gUnneededFireRedVariable: @ 3002F54 - .space 0xC + .include "bg.o" + .align 4 gUnknown_03002F60: @ 3002F60 .space 0x10 @@ -209,7 +209,7 @@ gUnknown_03005D00: @ 3005D00 gBattleMainFunc: @ 3005D04 .space 0xC -gUnknown_03005D10: @ 3005D10 +gBattleResults: @ 3005D10 .space 0x2A gUnknown_03005D3A: @ 3005D3A @@ -224,7 +224,7 @@ gUnknown_03005D54: @ 3005D54 gBattleBankFunc: @ 3005D60 .space 0x10 -gUnknown_03005D70: @ 3005D70 +gHealthBoxesIds: @ 3005D70 .space 0x4 gUnknown_03005D74: @ 3005D74 @@ -251,7 +251,7 @@ gSaveBlock1Ptr: @ 3005D8C gSaveBlock2Ptr: @ 3005D90 .space 0x4 -gUnknown_03005D94: @ 3005D94 +gPokemonStoragePtr: @ 3005D94 .space 0x4 gUnknown_03005D98: @ 3005D98 diff --git a/sym_ewram.txt b/sym_ewram.txt index ccbb7f3b6..b9d1f6650 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -1,4 +1,3 @@ - .include "src/malloc.o" .include "src/decompress.o" gTrainerId: @ 2020000 @@ -53,12 +52,9 @@ gUnknown_020229C8: @ 20229C8 gUnknown_020229CC: @ 20229CC .space 0x1C -gUnknown_020229E8: @ 20229E8 - .space 0x8 - -gUnknown_020229F0: @ 20229F0 - .space 0x1C - +gLinkPlayers: @ 20229E8 + .space 0x24 + gUnknown_02022A0C: @ 2022A0C .space 0x68 @@ -245,7 +241,7 @@ gUnknown_02022E28: @ 2022E28 gUnknown_02022E2A: @ 2022E2A .space 0x2 -gUnknown_02022E2C: @ 2022E2C +gDisplayedStringBattle: @ 2022E2C .space 0x12C gBattleTextBuff1: @ 2022F58 @@ -263,7 +259,7 @@ gBattleTextBuff2: @ 2022F68 gUnknown_02022F6A: @ 2022F6A .space 0xE -gUnknown_02022F78: @ 2022F78 +gBattleTextBuff3: @ 2022F78 .space 0x10 gUnknown_02022F88: @ 2022F88 @@ -291,22 +287,10 @@ gUnknown_02023060: @ 2023060 .space 0x4 gBattleBufferA: @ 2023064 - .space 0x2 - -gUnknown_02023066: @ 2023066 - .space 0x1 - -gUnknown_02023067: @ 2023067 - .space 0x1 - -gUnknown_02023068: @ 2023068 - .space 0x7FC + .space 0x800 gBattleBufferB: @ 2023864 - .space 0x4 - -gUnknown_02023868: @ 2023868 - .space 0x7FC + .space 0x800 gActiveBank: @ 2024064 .space 0x4 @@ -336,31 +320,7 @@ gFightStateTracker: @ 2024083 .space 0x1 gBattleMons: @ 2024084 - .space 0xC - -gUnknown_02024090: @ 2024090 - .space 0xC - -gUnknown_0202409C: @ 202409C - .space 0xC - -gUnknown_020240A8: @ 20240A8 - .space 0x4 - -gUnknown_020240AC: @ 20240AC - .space 0x8 - -gUnknown_020240B4: @ 20240B4 - .space 0x18 - -gUnknown_020240CC: @ 20240CC - .space 0x4 - -gUnknown_020240D0: @ 20240D0 - .space 0x4 - -gUnknown_020240D4: @ 20240D4 - .space 0x110 + .space 0x160 gBankSpriteIds: @ 20241E4 .space 0x4 @@ -389,7 +349,7 @@ gUnknown_020241F4: @ 20241F4 gUnknown_020241F8: @ 20241F8 .space 0x10 -gUnknown_02024208: @ 2024208 +gLastUsedItem: @ 2024208 .space 0x2 gLastUsedAbility: @ 202420A @@ -434,7 +394,7 @@ gUnknown_02024230: @ 2024230 gUnknown_02024240: @ 2024240 .space 0x8 -gUnknown_02024248: @ 2024248 +gLastUsedMovesByBanks: @ 2024248 .space 0x8 gUnknown_02024250: @ 2024250 @@ -470,7 +430,7 @@ gUnknown_02024288: @ 2024288 gUnknown_0202428C: @ 202428C .space 0x2 -gUnknown_0202428E: @ 202428E +gSideAffecting: @ 202428E .space 0x6 gSideTimers: @ 2024294 @@ -518,26 +478,17 @@ gUnknown_020243FC: @ 20243FC gUnknown_020243FE: @ 20243FE .space 0x2 -gUnknown_02024400: @ 2024400 +gDynamicBasePower: @ 2024400 .space 0x2 gUnknown_02024402: @ 2024402 .space 0x2 gEnigmaBerries: @ 2024404 - .space 0x8 - -gUnknown_0202440C: @ 202440C - .space 0x68 + .space 0x70 gBattleScripting: @ 2024474 - .space 0x4 - -gUnknown_02024478: @ 2024478 - .space 0x10 - -gUnknown_02024488: @ 2024488 - .space 0x14 + .space 0x28 gBattleStruct: @ 202449C .space 0x4 @@ -587,13 +538,13 @@ gUnknown_020244DC: @ 20244DC gBattleMovePower: @ 20244E0 .space 0x2 -gUnknown_020244E2: @ 20244E2 +gMoveToLearn: @ 20244E2 .space 0x2 gUnknown_020244E4: @ 20244E4 .space 0x4 -gUnknown_020244E8: @ 20244E8 +sLearningMoveTableID: @ 20244E8 .space 0x1 gPlayerPartyCount: @ 20244E9 @@ -603,40 +554,10 @@ gUnknown_020244EA: @ 20244EA .space 0x2 gPlayerParty: @ 20244EC - .space 0x64 - -gUnknown_02024550: @ 2024550 - .space 0x64 - -gUnknown_020245B4: @ 20245B4 - .space 0x64 - -gUnknown_02024618: @ 2024618 - .space 0x64 - -gUnknown_0202467C: @ 202467C - .space 0x64 - -gUnknown_020246E0: @ 20246E0 - .space 0x64 + .space 600 gEnemyParty: @ 2024744 - .space 0x64 - -gUnknown_020247A8: @ 20247A8 - .space 0x64 - -gUnknown_0202480C: @ 202480C - .space 0x64 - -gUnknown_02024870: @ 2024870 - .space 0x64 - -gUnknown_020248D4: @ 20248D4 - .space 0x64 - -gUnknown_02024938: @ 2024938 - .space 0x64 + .space 600 gUnknown_0202499C: @ 202499C .space 0x18 @@ -662,14 +583,7 @@ gUnknown_02024A38: @ 2024A38 gUnknown_02024A4C: @ 2024A4C .space 0x8 -gUnknown_02024A54: @ 2024A54 - .space 0xFAC - -gUnknown_02025A00: @ 2025A00 - .space 0x3E08 - -gUnknown_02029808: @ 2029808 - .space 0x8450 + .include "src/load_save.o" gUnknown_02031C58: @ 2031C58 .space 0x528 @@ -813,21 +727,7 @@ gUnknown_020375D6: @ 20375D6 .space 0x2 .include "src/event_data.o" - -gUnknown_0203760C: @ 203760C - .space 0x1 - -gUnknown_0203760D: @ 203760D - .space 0x1 - -gUnknown_0203760E: @ 203760E - .space 0x1 - -gUnknown_0203760F: @ 203760F - .space 0x1 - -gUnknown_02037610: @ 2037610 - .space 0x9 + .include "src/start_menu.o" gUnknown_02037619: @ 2037619 .space 0x1 @@ -948,10 +848,10 @@ gUnknown_02038BC6: @ 2038BC6 gUnknown_02038BC8: @ 2038BC8 .space 0x2 -gUnknown_02038BCA: @ 2038BCA +gTrainerBattleOpponent_A: @ 2038BCA .space 0x2 -gUnknown_02038BCC: @ 2038BCC +gTrainerBattleOpponent_B: @ 2038BCC .space 0x2 gUnknown_02038BCE: @ 2038BCE @@ -1305,23 +1205,7 @@ gUnknown_0203A044: @ 203A044 gUnknown_0203A048: @ 203A048 .space 0x4 -gUnknown_0203A04C: @ 203A04C - .space 0x2 - -gUnknown_0203A04E: @ 203A04E - .space 0x2 - -gUnknown_0203A050: @ 203A050 - .space 0x1 - -gUnknown_0203A051: @ 203A051 - .space 0x3 - -gUnknown_0203A054: @ 203A054 - .space 0x8 - -gUnknown_0203A05C: @ 203A05C - .space 0x98 + .include "src/safari_zone.o" gUnknown_0203A0F4: @ 203A0F4 .space 0x4 @@ -1521,12 +1405,9 @@ gUnknown_0203AB30: @ 203AB30 gUnknown_0203AB34: @ 203AB34 .space 0x4 -gAIScriptPtr: @ 203AB38 - .space 0x4 - -gPlayerMonIndex: @ 203AB3C - .space 0x4 - + .include "src/battle_ai.o" + +.align 2 gUnknown_0203AB40: @ 203AB40 .space 0x8 @@ -1617,16 +1498,16 @@ gUnknown_0203AB94: @ 203AB94 gUnknown_0203AB98: @ 203AB98 .space 0x4 -gUnknown_0203AB9C: @ 203AB9C + .include "src/coins.o" + + .align 2 +sTransitionStructPtr: @ 203ABA0 .space 0x4 -gUnknown_0203ABA0: @ 203ABA0 +gAbilitiesPerBank: @ 203ABA4 .space 0x4 -gUnknown_0203ABA4: @ 203ABA4 - .space 0x4 - -gUnknown_0203ABA8: @ 203ABA8 +gStringInfo: @ 203ABA8 .space 0x4 gUnknown_0203ABAC: @ 203ABAC @@ -1666,13 +1547,13 @@ gUnknown_0203BC34: @ 203BC34 gUnknown_0203BC38: @ 203BC38 .space 0x8 -gUnknown_0203BC40: @ 203BC40 +gDecorationInventories: @ 203BC40 .space 0x40 -gUnknown_0203BC80: @ 203BC80 +sLocationHistory: @ 203BC80 .space 0x6 -gUnknown_0203BC86: @ 203BC86 +sRoamerLocation: @ 203BC86 .space 0x2 gUnknown_0203BC88: @ 203BC88 @@ -1759,11 +1640,7 @@ gUnknown_0203BCE5: @ 203BCE5 gUnknown_0203BCE8: @ 203BCE8 .space 0x4 -gUnknown_0203BCEC: @ 203BCEC - .space 0x2 - -gUnknown_0203BCEE: @ 203BCEE - .space 0x2 + .include "src/lottery_corner.o" gUnknown_0203BCF0: @ 203BCF0 .space 0x4